Difference between revisions of "TGroupBox/ja"

From Lazarus wiki
Jump to navigationJump to search
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
 
{{ Japanese Menu }}
 
{{ Japanese Menu }}
  
A '''TGroupBox''' [[image:tgroupbox.png]] is a container that allows a number of objects to be grouped physically and conceptually on a [[TForm|form]].
+
'''TGroupBox'''は、[[image:tgroupbox.png]]フォーム上で物理的および概念的に複数のオブジェクトをグループ化するためのコンテナである。GroupBox内のコントロールは、関連する機能や情報をグループ化して表示するのに役立つ。
  
==Usage==
+
==使い方==
To use a [[doc:lcl/stdctrls/tgroupbox.html|TGroupBox]] on a form, you can simply select it on the [[Standard tab/ja|Standardタブ]] of the [[Component Palette/ja|コンポーネントパレット]] and place it by clicking on the form.
+
フォーム上で[[doc:lcl/stdctrls/tgroupbox.html|TGroupBox]]を使用するには、単に[[Component Palette/ja|コンポーネントパレット]][[Standard tab/ja|Standardタブ]]からそれを選択し、フォーム上でクリックして配置する。GroupBoxは、関連するコントロールや情報を視覚的にグループ化するための便利なコンテナである。
  
==Small example==
+
====
* create a new application and place two TGroupBoxes on your form
+
* 新しいアプリケーションを作成し、フォームに2つのTGroupBoxを配置
* in GroupBox1 insert a [[TButton]] ''Button1'' and in GroupBox2 TButton ''Button2''
+
* GroupBox1には[[TButton/ja]]''Button1''を、GroupBox2にはTButton、''Button2''を配置する。
* put on your form (outside of the groupboxes) two [[TRadioButton]]
+
* フォームの外側に[[TRadioButton/ja]]を2つ配置する。
* change in the [[IDE_Window:_Object_Inspector|object Inspector]] the caption of RadioButton1 to ''User'' and of RadioButton2 to ''Administrator''
+
* [[IDE_Window:_Object_Inspector/ja|オブジェクトインスペクタ]]で、RadioButton1のCaptionを''User''に、RadioButton2のCaptionを''Administrator''に変更する。
* change the [[Property|property]] ''Checked'' of RadioButton2 to ''[[True]]''
+
* RadioButton2のChecked[[Property/ja|property]]''[[True]]''に設定する。
* create the ''OnChange'' [[Event handler|event handler]] of RadioButton1 by double clicking ''RadioButton1''
+
* RadioButton1をダブルクリックして、RadioButton1の''OnChange''[[Event handler|イベントハンドラ]]''を作成する。
* use this handler also for RadioButton2
+
* このハンドラをRadioButton2のOnChangeイベントにも割り当てる。
** choose in the object Inspector ''RadioButton2'
+
** オブジェクトインスペクタで、''RadioButton2''を選択する。
** now select the tab ''Events'' in the object Inspector
+
** オブジェクトインスペクタに移動し''Events'' を選択する。
** go to the event ''OnChange'' and select in the adjacent combobox ''RadioButton1Change''
+
** OnChangeイベントを選択し、隣接するコンボボックスで''RadioButton1Change''を選択する。
* make ''GroupBox2'' for user invisible by choosing in the RadioButton
+
* ラジオボタンのイベントハンドラで、''GroupBox2''をユーザーから非表示にする。
** write following line in the event handler of the RadioButtons in the source editor:
+
** ソースエディタのRadioButtonのイベントハンドラに以下の行を記述する:
 
<syntaxhighlight lang="Pascal">
 
<syntaxhighlight lang="Pascal">
 
procedure TForm1.RadioButton1Change(Sender: TObject);
 
procedure TForm1.RadioButton1Change(Sender: TObject);
Line 27: Line 27:
 
end;  
 
end;  
 
</syntaxhighlight>
 
</syntaxhighlight>
* add still the event handler of the buttons and add some code like:
+
ボタンのイベントハンドラも追加し、以下のようなコードを追加する:
 
<syntaxhighlight lang="Pascal">
 
<syntaxhighlight lang="Pascal">
 
procedure TForm1.Button1Click(Sender: TObject);
 
procedure TForm1.Button1Click(Sender: TObject);
Line 33: Line 33:
 
   ShowMessage('User and administrator can click this button');
 
   ShowMessage('User and administrator can click this button');
 
end;
 
end;
 
 
procedure TForm1.Button2Click(Sender: TObject);
 
procedure TForm1.Button2Click(Sender: TObject);
 
begin
 
begin
Line 39: Line 38:
 
end;  
 
end;  
 
</syntaxhighlight>
 
</syntaxhighlight>
* it shows in the [[Dialog_Examples#ShowMessage|ShowMessage dialog]] who can press the button
+
* ボタンを押せる人を示す[[Dialog_Examples#ShowMessage|ShowMessage]]ダイアログに表示される。
* start your program, it could look like:
+
* 実行すると以下のように見える:
  
 
[[image:ExampleTGroupBox1.png]] -> [[image:ExampleTGroupBox2.png]]
 
[[image:ExampleTGroupBox1.png]] -> [[image:ExampleTGroupBox2.png]]

Latest revision as of 09:05, 24 March 2024

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

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

TGroupBoxは、tgroupbox.pngフォーム上で物理的および概念的に複数のオブジェクトをグループ化するためのコンテナである。GroupBox内のコントロールは、関連する機能や情報をグループ化して表示するのに役立つ。

使い方

フォーム上でTGroupBoxを使用するには、単にコンポーネントパレットStandardタブからそれを選択し、フォーム上でクリックして配置する。GroupBoxは、関連するコントロールや情報を視覚的にグループ化するための便利なコンテナである。

  • 新しいアプリケーションを作成し、フォームに2つのTGroupBoxを配置
  • GroupBox1にはTButton/jaButton1を、GroupBox2にはTButton、Button2を配置する。
  • フォームの外側にTRadioButton/jaを2つ配置する。
  • オブジェクトインスペクタで、RadioButton1のCaptionをUserに、RadioButton2のCaptionをAdministratorに変更する。
  • RadioButton2のCheckedpropertyTrueに設定する。
  • RadioButton1をダブルクリックして、RadioButton1のOnChangeイベントハンドラを作成する。
  • このハンドラをRadioButton2のOnChangeイベントにも割り当てる。
    • オブジェクトインスペクタで、RadioButton2を選択する。
    • オブジェクトインスペクタに移動しEvents を選択する。
    • OnChangeイベントを選択し、隣接するコンボボックスでRadioButton1Changeを選択する。
  • ラジオボタンのイベントハンドラで、GroupBox2をユーザーから非表示にする。
    • ソースエディタのRadioButtonのイベントハンドラに以下の行を記述する:
procedure TForm1.RadioButton1Change(Sender: TObject);
begin
  GroupBox2.Visible:=Radiobutton2.Checked;
end;

ボタンのイベントハンドラも追加し、以下のようなコードを追加する:

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage('User and administrator can click this button');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
  ShowMessage('Only administrator can click this button');
end;
  • ボタンを押せる人を示すShowMessageダイアログに表示される。
  • 実行すると以下のように見える:

ExampleTGroupBox1.png -> ExampleTGroupBox2.png

See also


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