Difference between revisions of "TPanel/ja"

From Lazarus wiki
Jump to navigationJump to search
 
Line 1: Line 1:
 
{{TPanel}}
 
{{TPanel}}
 
 
{{ Japanese Menu }}
 
{{ Japanese Menu }}
  
'''TPanel''' [[image:tpanel.png]] is a component that creates a panel on a form.  A TPanel is a descendant of [[TWinControl]] and is available under the [[Standard tab/ja|Standardタブ]] of the [[Component Palette/ja|コンポーネントパレット]]. A TPanel can act as a visible container for other components.
+
'''TPanel''' [[image:tpanel.png]]は、フォーム上にパネルを作成するコンポーネントである。TPanelはTWinControlの派生であり、[[Component Palette/ja|コンポーネントパレット]][[Standard tab/ja|Standardタブ]]の下にある。TPanelは他のコンポーネントの可視コンテナとして機能することができる。
  
== Example ==
+
== ==
  
One way to use panels is when the control group is displayed and hidden.
+
パネルを使用する方法の1つは、コントロールグループを表示および非表示にする場合である。
Instead of showing or hiding individual controls, you can hide and show the panel and all of its child controls with a single command.
+
個々のコントロールを表示または非表示にする代わりに、パネルとそのすべての子コントロールを1つのコマンドで非表示または表示することができる。
In this example, the following components are used: [[TButton]], [[TShape]]
+
この例では、次のコンポーネントが使用されている: [[TButton/ja]], [[TShape]]
  
 
=== Create code ===
 
=== Create code ===
  
* Create a new blank [[Graphical User Interface|GUI]] application with the [[TForm|form]] Form1
+
*新しい空の[[Graphical User Interface|GUI]]アプリケーションを作成し、[[TForm|form]] Form1を作成します。
* Create the OnCreate event handler for the form, by clicking on your form, use the Object Inspector, the tab events, select the OnCreate event and click the button [...] or double click the button in the form.
+
* フォームのOnCreateイベントハンドラを作成するには、フォームをクリックし、オブジェクトインスペクタを使用して、イベントタブに移動し、OnCreateイベントを選択し、[...]ボタンをクリックするか、フォーム内のボタンをダブルクリックする。
* Add following code (Complete the missing parts):
+
* 以下のコードを加える(足りない部分は補うこと):
  
 
<syntaxhighlight lang="pascal">
 
<syntaxhighlight lang="pascal">
Line 88: Line 87:
  
 
</syntaxhighlight>
 
</syntaxhighlight>
==See also==
+
==以下も参照のこと==
 
* [[doc:lcl/extctrls/tpanel.html|TPanel doc]]
 
* [[doc:lcl/extctrls/tpanel.html|TPanel doc]]
 
* [[TBevel]]
 
* [[TBevel]]

Latest revision as of 10:26, 24 March 2024

Deutsch (de) English (en) suomi (fi) français (fr) 日本語 (ja) русский (ru)

日本語版メニュー
メインページ - Lazarus Documentation日本語版 - 翻訳ノート - 日本語障害情報

TPanel tpanel.pngは、フォーム上にパネルを作成するコンポーネントである。TPanelはTWinControlの派生であり、コンポーネントパレットStandardタブの下にある。TPanelは他のコンポーネントの可視コンテナとして機能することができる。

パネルを使用する方法の1つは、コントロールグループを表示および非表示にする場合である。 個々のコントロールを表示または非表示にする代わりに、パネルとそのすべての子コントロールを1つのコマンドで非表示または表示することができる。 この例では、次のコンポーネントが使用されている: TButton/ja, TShape

Create code

  • 新しい空のGUIアプリケーションを作成し、form Form1を作成します。
  • フォームのOnCreateイベントハンドラを作成するには、フォームをクリックし、オブジェクトインスペクタを使用して、イベントタブに移動し、OnCreateイベントを選択し、[...]ボタンをクリックするか、フォーム内のボタンをダブルクリックする。
  • 以下のコードを加える(足りない部分は補うこと):
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls;

type

  { TForm1 }

  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    aPanel:TPanel;
    procedure aButtonClick(Sender: TObject);
  public

  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
var
  aButton:TButton;

  aShape1,aShape2:TShape;
begin
  Caption :='Panel demo';
  aButton:=TButton.Create(Self);
  aButton.Parent:=Self;
  aButton.Caption:= 'Show/Hide';
  aPanel:=TPanel.Create(Self);
  aPanel.Parent:=Self;
  aPanel.Caption:='';
  aShape1:=TShape.Create(aPanel);
  aShape1.Parent:=aPanel;
  aShape1.Shape:=stStar;
  aShape1.Top := 5;
  aShape2:=TShape.Create(aPanel);
  aShape2.Parent:=aPanel;
  aShape2.Shape:=stStar;
  aShape2.Top := 5;
  aShape2.Left:=aShape1.Width+10;
  aPanel.Height:=aShape1.Height+10;
  aButton.Top:=aPanel.Height+10;
  aButton.OnClick:=@aButtonClick;
  Height := aButton.Top+aButton.Height+10;
end;

procedure TForm1.aButtonClick(Sender: TObject);  //the event handler for the button
begin
  if (Sender is TButton)
    then begin
      if aPanel.Visible then aPanel.Visible := false else aPanel.Visible := true;
    end;
end;
end.

以下も参照のこと


LCL Components
Component Tab Components
Standard TMainMenu • TPopupMenu • TButton • TLabel • TEdit • TMemo • TToggleBox • TCheckBox • TRadioButton • TListBox • TComboBox • TScrollBar • TGroupBox • TRadioGroup • TCheckGroup • TPanel • TFrame • TActionList
Additional TBitBtn/ja • TSpeedButton/ja • TStaticText/ja • TImage/ja • TShape/ja • TBevel/ja • TPaintBox/ja • TNotebook/ja • TLabeledEdit/ja • TSplitter/ja • TTrayIcon/ja • TControlBar/ja • TFlowPanel/ja • TMaskEdit/ja • TCheckListBox/ja • TScrollBox/ja • TApplicationProperties/ja • TStringGrid/ja • TDrawGrid/ja • TPairSplitter/ja • TColorBox/ja • TColorListBox/ja • TValueListEditor/ja
Common Controls TTrackBar • TProgressBar • TTreeView • TListView • TStatusBar • TToolBar • TCoolBar • TUpDown • TPageControl • TTabControl • THeaderControl • TImageList • TPopupNotifier • TDateTimePicker
Dialogs TOpenDialog • TSaveDialog • TSelectDirectoryDialog • TColorDialog • TFontDialog • TFindDialog • TReplaceDialog • TTaskDialog • TOpenPictureDialog • TSavePictureDialog • TCalendarDialog • TCalculatorDialog • TPrinterSetupDialog • TPrintDialog • TPageSetupDialog
Data Controls TDBNavigator/ja • TDBText/ja • TDBEdit/ja • TDBMemo/ja • TDBImage/ja • TDBListBox/ja • TDBLookupListBox/ja • TDBComboBox/ja • TDBLookupComboBox/ja • TDBCheckBox/ja • TDBRadioGroup/ja • TDBCalendar/ja • TDBGroupBox/ja • TDBGrid/ja • TDBDateTimePicker/ja
Data Access TDataSource/ja • TCSVDataSet/ja • TSdfDataSet/ja • TBufDataset/ja • TFixedFormatDataSet/ja • TDbf/ja • TMemDataset/ja
System TTimer • TIdleTimer • TLazComponentQueue • THTMLHelpDatabase • THTMLBrowserHelpViewer • TAsyncProcess • TProcessUTF8 • TProcess • TSimpleIPCClient • TSimpleIPCServer • TXMLConfig • TEventLog • TServiceManager • TCHMHelpDatabase • TLHelpConnector
Misc TColorButton • TSpinEdit • TFloatSpinEdit • TArrow • TCalendar • TEditButton • TFileNameEdit • TDirectoryEdit • TDateEdit • TTimeEdit • TCalcEdit • TFileListBox • TFilterComboBox • TComboBoxEx • TCheckComboBox • TButtonPanel • TShellTreeView • TShellListView • TXMLPropStorage • TINIPropStorage • TJSONPropStorage • TIDEDialogLayoutStorage • TMRUManager • TStrHolder
LazControls TCheckBoxThemed • TDividerBevel • TExtendedNotebook • TListFilterEdit • TListViewFilterEdit • TLvlGraphControl • TShortPathEdit • TSpinEditEx • TFloatSpinEditEx • TTreeFilterEdit • TExtendedTabControl •
RTTI TTIEdit • TTIComboBox • TTIButton • TTICheckBox • TTILabel • TTIGroupBox • TTIRadioGroup • TTICheckGroup • TTICheckListBox • TTIListBox • TTIMemo • TTICalendar • TTIImage • TTIFloatSpinEdit • TTISpinEdit • TTITrackBar • TTIProgressBar • TTIMaskEdit • TTIColorButton • TMultiPropertyLink • TTIPropertyGrid • TTIGrid
SQLdb TSQLQuery/ja • TSQLTransaction/ja • TSQLScript • TSQLConnector • TMSSQLConnection • TSybaseConnection • TPQConnection • TPQTEventMonitor • TOracleConnection • TODBCConnection • TMySQL40Connection • TMySQL41Connection • TMySQL50Connection • TMySQL51Connection • TMySQL55Connection • TMySQL56Connection • TMySQL57Connection • TSQLite3Connection/ja • TIBConnection • TFBAdmin • TFBEventMonitor • TSQLDBLibraryLoader
Pascal Script TPSScript • TPSScriptDebugger • TPSDllPlugin • TPSImport_Classes • TPSImport_DateUtils • TPSImport_ComObj • TPSImport_DB • TPSImport_Forms • TPSImport_Controls • TPSImport_StdCtrls • TPSCustomPlugin
SynEdit TSynEdit • TSynCompletion • TSynAutoComplete • TSynMacroRecorder • TSynExporterHTML • TSynPluginSyncroEdit • TSynPasSyn • TSynFreePascalSyn • TSynCppSyn • TSynJavaSyn • TSynPerlSyn • TSynHTMLSyn • TSynXMLSyn • TSynLFMSyn • TSynDiffSyn • TSynUNIXShellScriptSyn • TSynCssSyn • TSynPHPSyn • TSynTeXSyn • TSynSQLSyn • TSynPythonSyn • TSynVBSyn • TSynAnySyn • TSynMultiSyn • TSynBatSyn • TSynIniSyn • TSynPoSyn
Chart TChart • TListChartSource • TRandomChartSource • TUserDefinedChartSource • TCalculatedChartSource • TDbChartSource • TChartToolset • TChartAxisTransformations • TChartStyles • TChartLegendPanel • TChartNavScrollBar • TChartNavPanel • TIntervalChartSource • TDateTimeIntervalChartSource • TChartListBox • TChartExtentLink • TChartImageList
IPro TIpFileDataProvider • TIpHtmlDataProvider • TIpHttpDataProvider • TIpHtmlPanel
Virtual Controls TVirtualDrawTree • TVirtualStringTree • TVTHeaderPopupMenu