mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 23:30:22 +02:00
ide: IDE options
- don't show shortcut dialog on every single click on keymapping tree but show on double click - move TIDEWindowSetupLayoutComponent from IDEOptionsDefs to windows_options frame where it is only used git-svn-id: trunk@19865 -
This commit is contained in:
parent
e3c48b9278
commit
07e509a88a
@ -3,6 +3,7 @@ inherited EditorKeymappingOptionsFrame: TEditorKeymappingOptionsFrame
|
|||||||
Width = 461
|
Width = 461
|
||||||
ClientHeight = 510
|
ClientHeight = 510
|
||||||
ClientWidth = 461
|
ClientWidth = 461
|
||||||
|
TabOrder = 0
|
||||||
Visible = False
|
Visible = False
|
||||||
DesignLeft = 110
|
DesignLeft = 110
|
||||||
DesignTop = 145
|
DesignTop = 145
|
||||||
@ -54,7 +55,7 @@ inherited EditorKeymappingOptionsFrame: TEditorKeymappingOptionsFrame
|
|||||||
RowSelect = True
|
RowSelect = True
|
||||||
ScrollBars = ssAutoBoth
|
ScrollBars = ssAutoBoth
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
OnMouseUp = KeyMappingTreeViewMouseUp
|
OnDblClick = KeyMappingTreeViewDblClick
|
||||||
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoRowSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips]
|
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoRowSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips]
|
||||||
end
|
end
|
||||||
object KeyMappingFindKeyButton: TButton[3]
|
object KeyMappingFindKeyButton: TButton[3]
|
||||||
|
@ -1,46 +1,44 @@
|
|||||||
{ This is an automatically generated lazarus resource file }
|
|
||||||
|
|
||||||
LazarusResources.Add('TEditorKeymappingOptionsFrame','FORMDATA',[
|
LazarusResources.Add('TEditorKeymappingOptionsFrame','FORMDATA',[
|
||||||
'TPF0'#241#29'TEditorKeymappingOptionsFrame'#28'EditorKeymappingOptionsFrame'
|
'TPF0'#241#29'TEditorKeymappingOptionsFrame'#28'EditorKeymappingOptionsFrame'
|
||||||
+#6'Height'#3#254#1#5'Width'#3#205#1#12'ClientHeight'#3#254#1#11'ClientWidth'
|
+#6'Height'#3#254#1#5'Width'#3#205#1#12'ClientHeight'#3#254#1#11'ClientWidth'
|
||||||
+#3#205#1#7'Visible'#8#10'DesignLeft'#2'n'#9'DesignTop'#3#145#0#0#242#2#0#6'T'
|
+#3#205#1#8'TabOrder'#2#0#7'Visible'#8#10'DesignLeft'#2'n'#9'DesignTop'#3#145
|
||||||
+'Label'#19'KeyMappingHelpLabel'#22'AnchorSideLeft.Control'#7#5'Owner'#21'Anc'
|
+#0#0#242#2#0#6'TLabel'#19'KeyMappingHelpLabel'#22'AnchorSideLeft.Control'#7#5
|
||||||
+'horSideTop.Control'#7#5'Owner'#4'Left'#2#0#6'Height'#2#14#3'Top'#2#0#5'Widt'
|
+'Owner'#21'AnchorSideTop.Control'#7#5'Owner'#4'Left'#2#0#6'Height'#2#14#3'To'
|
||||||
+'h'#2'i'#7'Caption'#6#19'KeyMappingHelpLabel'#11'ParentColor'#8#0#0#242#2#1#5
|
+'p'#2#0#5'Width'#2'i'#7'Caption'#6#19'KeyMappingHelpLabel'#11'ParentColor'#8
|
||||||
+'TEdit'#20'KeyMappingFilterEdit'#22'AnchorSideLeft.Control'#7#5'Owner'#21'An'
|
+#0#0#242#2#1#5'TEdit'#20'KeyMappingFilterEdit'#22'AnchorSideLeft.Control'#7#5
|
||||||
+'chorSideTop.Control'#7#19'KeyMappingHelpLabel'#18'AnchorSideTop.Side'#7#9'a'
|
+'Owner'#21'AnchorSideTop.Control'#7#19'KeyMappingHelpLabel'#18'AnchorSideTop'
|
||||||
+'srBottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7
|
+'.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideR'
|
||||||
+#9'asrBottom'#4'Left'#2#0#6'Height'#2#23#3'Top'#2#20#5'Width'#3#205#1#7'Anch'
|
+'ight.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#23#3'Top'#2#20#5'Width'#3
|
||||||
+'ors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'AutoSize'#9#17'BorderSpacing.Top'
|
+#205#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'AutoSize'#9#17'Border'
|
||||||
+#2#6#8'OnChange'#7#26'KeyMappingFilterEditChange'#7'OnEnter'#7#25'KeyMapping'
|
+'Spacing.Top'#2#6#8'OnChange'#7#26'KeyMappingFilterEditChange'#7'OnEnter'#7
|
||||||
+'FilterEditEnter'#6'OnExit'#7#24'KeyMappingFilterEditExit'#8'TabOrder'#2#0#4
|
+#25'KeyMappingFilterEditEnter'#6'OnExit'#7#24'KeyMappingFilterEditExit'#8'Ta'
|
||||||
+'Text'#6#20'KeyMappingFilterEdit'#0#0#242#2#2#9'TTreeView'#18'KeyMappingTree'
|
+'bOrder'#2#0#4'Text'#6#20'KeyMappingFilterEdit'#0#0#242#2#2#9'TTreeView'#18
|
||||||
+'View'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#20
|
+'KeyMappingTreeView'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.'
|
||||||
+'KeyMappingFilterEdit'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRi'
|
+'Control'#7#20'KeyMappingFilterEdit'#18'AnchorSideTop.Side'#7#9'asrBottom'#23
|
||||||
+'ght.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#24'AnchorSi'
|
+'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'
|
||||||
+'deBottom.Control'#7#23'KeyMappingFindKeyButton'#4'Left'#2#0#6'Height'#3#147
|
+#24'AnchorSideBottom.Control'#7#23'KeyMappingFindKeyButton'#4'Left'#2#0#6'He'
|
||||||
+#1#3'Top'#2'1'#5'Width'#3#205#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8
|
+'ight'#3#147#1#3'Top'#2'1'#5'Width'#3#205#1#7'Anchors'#11#5'akTop'#6'akLeft'
|
||||||
+'akBottom'#0#17'BorderSpacing.Top'#2#6#20'BorderSpacing.Bottom'#2#6#17'Defau'
|
+#7'akRight'#8'akBottom'#0#17'BorderSpacing.Top'#2#6#20'BorderSpacing.Bottom'
|
||||||
+'ltItemHeight'#2#15#8'ReadOnly'#9#9'RowSelect'#9#10'ScrollBars'#7#10'ssAutoB'
|
+#2#6#17'DefaultItemHeight'#2#15#8'ReadOnly'#9#9'RowSelect'#9#10'ScrollBars'#7
|
||||||
+'oth'#8'TabOrder'#2#1#9'OnMouseUp'#7#25'KeyMappingTreeViewMouseUp'#7'Options'
|
+#10'ssAutoBoth'#8'TabOrder'#2#1#10'OnDblClick'#7#26'KeyMappingTreeViewDblCli'
|
||||||
+#11#17'tvoAutoItemHeight'#16'tvoHideSelection'#21'tvoKeepCollapsedNodes'#11
|
+'ck'#7'Options'#11#17'tvoAutoItemHeight'#16'tvoHideSelection'#21'tvoKeepColl'
|
||||||
+'tvoReadOnly'#12'tvoRowSelect'#14'tvoShowButtons'#12'tvoShowLines'#11'tvoSho'
|
+'apsedNodes'#11'tvoReadOnly'#12'tvoRowSelect'#14'tvoShowButtons'#12'tvoShowL'
|
||||||
+'wRoot'#11'tvoToolTips'#0#0#0#242#2#3#7'TButton'#23'KeyMappingFindKeyButton'
|
+'ines'#11'tvoShowRoot'#11'tvoToolTips'#0#0#0#242#2#3#7'TButton'#23'KeyMappin'
|
||||||
+#22'AnchorSideLeft.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBotto'
|
+'gFindKeyButton'#22'AnchorSideLeft.Control'#7#5'Owner'#20'AnchorSideRight.Si'
|
||||||
+'m'#24'AnchorSideBottom.Control'#7#28'KeyMappingChooseSchemeButton'#4'Left'#2
|
+'de'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#28'KeyMappingChooseScheme'
|
||||||
+#0#6'Height'#2#23#3'Top'#3#202#1#5'Width'#3#154#0#7'Anchors'#11#6'akLeft'#8
|
+'Button'#4'Left'#2#0#6'Height'#2#23#3'Top'#3#202#1#5'Width'#3#154#0#7'Anchor'
|
||||||
+'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Bottom'#2#6#7'Caption'#6#23'KeyM'
|
+'s'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Bottom'#2#6#7
|
||||||
+'appingFindKeyButton'#7'OnClick'#7#28'KeyMappingFindKeyButtonClick'#8'TabOrd'
|
+'Caption'#6#23'KeyMappingFindKeyButton'#7'OnClick'#7#28'KeyMappingFindKeyBut'
|
||||||
+'er'#2#2#0#0#242#2#4#7'TButton'#28'KeyMappingChooseSchemeButton'#22'AnchorSi'
|
+'tonClick'#8'TabOrder'#2#2#0#0#242#2#4#7'TButton'#28'KeyMappingChooseSchemeB'
|
||||||
+'deLeft.Control'#7#5'Owner'#24'AnchorSideBottom.Control'#7#5'Owner'#21'Ancho'
|
+'utton'#22'AnchorSideLeft.Control'#7#5'Owner'#24'AnchorSideBottom.Control'#7
|
||||||
+'rSideBottom.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#23#3'Top'#3#231#1#5
|
+#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#23
|
||||||
+'Width'#3#191#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#7'Captio'
|
+#3'Top'#3#231#1#5'Width'#3#191#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'Aut'
|
||||||
+'n'#6#28'KeyMappingChooseSchemeButton'#7'OnClick'#7'!KeyMappingChooseSchemeB'
|
+'oSize'#9#7'Caption'#6#28'KeyMappingChooseSchemeButton'#7'OnClick'#7'!KeyMap'
|
||||||
+'uttonClick'#8'TabOrder'#2#3#0#0#242#2#5#7'TButton KeyMappingConsistencyChec'
|
+'pingChooseSchemeButtonClick'#8'TabOrder'#2#3#0#0#242#2#5#7'TButton KeyMappi'
|
||||||
+'kButton'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9
|
+'ngConsistencyCheckButton'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorS'
|
||||||
+'asrBottom'#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'
|
+'ideRight.Side'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#5'Owner'#21'An'
|
||||||
+#7#9'asrBottom'#4'Left'#3#1#1#6'Height'#2#23#3'Top'#3#231#1#5'Width'#3#204#0
|
+'chorSideBottom.Side'#7#9'asrBottom'#4'Left'#3#1#1#6'Height'#2#23#3'Top'#3
|
||||||
+#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#7'Caption'#6' KeyMappi'
|
+#231#1#5'Width'#3#204#0#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9
|
||||||
+'ngConsistencyCheckButton'#7'OnClick'#7'%KeyMappingConsistencyCheckButtonCli'
|
+#7'Caption'#6' KeyMappingConsistencyCheckButton'#7'OnClick'#7'%KeyMappingCon'
|
||||||
+'ck'#8'TabOrder'#2#4#0#0#0
|
+'sistencyCheckButtonClick'#8'TabOrder'#2#4#0#0#0
|
||||||
]);
|
]);
|
||||||
|
@ -48,8 +48,7 @@ type
|
|||||||
procedure KeyMappingFilterEditEnter(Sender: TObject);
|
procedure KeyMappingFilterEditEnter(Sender: TObject);
|
||||||
procedure KeyMappingFilterEditExit(Sender: TObject);
|
procedure KeyMappingFilterEditExit(Sender: TObject);
|
||||||
procedure KeyMappingFindKeyButtonClick(Sender: TObject);
|
procedure KeyMappingFindKeyButtonClick(Sender: TObject);
|
||||||
procedure KeyMappingTreeViewMouseUp(Sender: TObject; Button: TMouseButton;
|
procedure KeyMappingTreeViewDblClick(Sender: TObject);
|
||||||
Shift: TShiftState; X, Y: Integer);
|
|
||||||
private
|
private
|
||||||
FDialog: TAbstractOptionsEditorDialog;
|
FDialog: TAbstractOptionsEditorDialog;
|
||||||
KeyMapNameFilter: string;
|
KeyMapNameFilter: string;
|
||||||
@ -204,14 +203,16 @@ begin
|
|||||||
FillKeyMappingTreeView;
|
FillKeyMappingTreeView;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TEditorKeymappingOptionsFrame.KeyMappingTreeViewMouseUp(
|
procedure TEditorKeymappingOptionsFrame.KeyMappingTreeViewDblClick(
|
||||||
Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
Sender: TObject);
|
||||||
var
|
var
|
||||||
|
P: TPoint;
|
||||||
i: integer;
|
i: integer;
|
||||||
ARelation: TKeyCommandRelation;
|
ARelation: TKeyCommandRelation;
|
||||||
ANode: TTreeNode;
|
ANode: TTreeNode;
|
||||||
begin
|
begin
|
||||||
ANode := KeyMappingTreeView.GetNodeAt(X, Y);
|
P := KeyMappingTreeView.ScreenToClient(Mouse.CursorPos);
|
||||||
|
ANode := KeyMappingTreeView.GetNodeAt(P.X, P.Y);
|
||||||
if (ANode <> nil) and (ANode.Data <> nil) and
|
if (ANode <> nil) and (ANode.Data <> nil) and
|
||||||
(TObject(ANode.Data) is TKeyCommandRelation) then
|
(TObject(ANode.Data) is TKeyCommandRelation) then
|
||||||
begin
|
begin
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
inherited WindowOptionsFrame: TWindowOptionsFrame
|
inherited WindowOptionsFrame: TWindowOptionsFrame
|
||||||
Height = 396
|
Height = 396
|
||||||
Width = 463
|
Width = 463
|
||||||
ClientHeight = 392
|
ClientHeight = 396
|
||||||
ClientWidth = 459
|
ClientWidth = 463
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Visible = False
|
Visible = False
|
||||||
DesignLeft = 413
|
DesignLeft = 66
|
||||||
DesignTop = 210
|
DesignTop = 87
|
||||||
object MinimizeAllOnMinimizeMainCheckBox: TCheckBox[0]
|
object MinimizeAllOnMinimizeMainCheckBox: TCheckBox[0]
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
AnchorSideTop.Control = Owner
|
AnchorSideTop.Control = Owner
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 22
|
Height = 17
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 276
|
Width = 195
|
||||||
Caption = 'MinimizeAllOnMinimizeMainCheckBox'
|
Caption = 'MinimizeAllOnMinimizeMainCheckBox'
|
||||||
Enabled = False
|
Enabled = False
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
@ -25,9 +25,9 @@ inherited WindowOptionsFrame: TWindowOptionsFrame
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 22
|
Height = 17
|
||||||
Top = 22
|
Top = 17
|
||||||
Width = 183
|
Width = 141
|
||||||
Caption = 'HideIDEOnRunCheckBox'
|
Caption = 'HideIDEOnRunCheckBox'
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
@ -40,13 +40,13 @@ inherited WindowOptionsFrame: TWindowOptionsFrame
|
|||||||
AnchorSideBottom.Control = Owner
|
AnchorSideBottom.Control = Owner
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 326
|
Height = 345
|
||||||
Top = 66
|
Top = 51
|
||||||
Width = 459
|
Width = 463
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
Caption = 'WindowPositionsGroupBox'
|
Caption = 'WindowPositionsGroupBox'
|
||||||
ClientHeight = 307
|
ClientHeight = 327
|
||||||
ClientWidth = 455
|
ClientWidth = 459
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
object WindowPositionsListBox: TListBox
|
object WindowPositionsListBox: TListBox
|
||||||
AnchorSideLeft.Control = WindowPositionsGroupBox
|
AnchorSideLeft.Control = WindowPositionsGroupBox
|
||||||
@ -56,13 +56,12 @@ inherited WindowOptionsFrame: TWindowOptionsFrame
|
|||||||
Left = 6
|
Left = 6
|
||||||
Height = 100
|
Height = 100
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 443
|
Width = 447
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
OnSelectionChange = WindowPositionsListBoxSelectionChange
|
OnSelectionChange = WindowPositionsListBoxSelectionChange
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
TopIndex = -1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object HideMessagesIconsCheckBox: TCheckBox[3]
|
object HideMessagesIconsCheckBox: TCheckBox[3]
|
||||||
@ -70,9 +69,9 @@ inherited WindowOptionsFrame: TWindowOptionsFrame
|
|||||||
AnchorSideTop.Control = HideIDEOnRunCheckBox
|
AnchorSideTop.Control = HideIDEOnRunCheckBox
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 22
|
Height = 17
|
||||||
Top = 44
|
Top = 34
|
||||||
Width = 218
|
Width = 163
|
||||||
Caption = 'HideMessagesIconsCheckBox'
|
Caption = 'HideMessagesIconsCheckBox'
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
end
|
end
|
||||||
|
@ -1,34 +1,32 @@
|
|||||||
{ This is an automatically generated lazarus resource file }
|
|
||||||
|
|
||||||
LazarusResources.Add('TWindowOptionsFrame','FORMDATA',[
|
LazarusResources.Add('TWindowOptionsFrame','FORMDATA',[
|
||||||
'TPF0'#241#19'TWindowOptionsFrame'#18'WindowOptionsFrame'#6'Height'#3#140#1#5
|
'TPF0'#241#19'TWindowOptionsFrame'#18'WindowOptionsFrame'#6'Height'#3#140#1#5
|
||||||
+'Width'#3#207#1#12'ClientHeight'#3#136#1#11'ClientWidth'#3#203#1#8'TabOrder'
|
+'Width'#3#207#1#12'ClientHeight'#3#140#1#11'ClientWidth'#3#207#1#8'TabOrder'
|
||||||
+#2#0#7'Visible'#8#10'DesignLeft'#3#157#1#9'DesignTop'#3#210#0#0#242#2#0#9'TC'
|
+#2#0#7'Visible'#8#10'DesignLeft'#2'B'#9'DesignTop'#2'W'#0#242#2#0#9'TCheckBo'
|
||||||
+'heckBox!MinimizeAllOnMinimizeMainCheckBox'#22'AnchorSideLeft.Control'#7#5'O'
|
+'x!MinimizeAllOnMinimizeMainCheckBox'#22'AnchorSideLeft.Control'#7#5'Owner'
|
||||||
+'wner'#21'AnchorSideTop.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asr'
|
+#21'AnchorSideTop.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'
|
||||||
+'Bottom'#4'Left'#2#0#6'Height'#2#22#3'Top'#2#0#5'Width'#3#20#1#7'Caption'#6
|
+#4'Left'#2#0#6'Height'#2#17#3'Top'#2#0#5'Width'#3#195#0#7'Caption'#6'!Minimi'
|
||||||
+'!MinimizeAllOnMinimizeMainCheckBox'#7'Enabled'#8#8'TabOrder'#2#0#0#0#242#2#1
|
+'zeAllOnMinimizeMainCheckBox'#7'Enabled'#8#8'TabOrder'#2#0#0#0#242#2#1#9'TCh'
|
||||||
+#9'TCheckBox'#20'HideIDEOnRunCheckBox'#22'AnchorSideLeft.Control'#7#5'Owner'
|
+'eckBox'#20'HideIDEOnRunCheckBox'#22'AnchorSideLeft.Control'#7#5'Owner'#21'A'
|
||||||
+#21'AnchorSideTop.Control'#7'!MinimizeAllOnMinimizeMainCheckBox'#18'AnchorSi'
|
+'nchorSideTop.Control'#7'!MinimizeAllOnMinimizeMainCheckBox'#18'AnchorSideTo'
|
||||||
+'deTop.Side'#7#9'asrBottom'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2
|
+'p.Side'#7#9'asrBottom'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#0#6
|
||||||
+#0#6'Height'#2#22#3'Top'#2#22#5'Width'#3#183#0#7'Caption'#6#20'HideIDEOnRunC'
|
+'Height'#2#17#3'Top'#2#17#5'Width'#3#141#0#7'Caption'#6#20'HideIDEOnRunCheck'
|
||||||
+'heckBox'#8'TabOrder'#2#1#0#0#242#2#2#9'TGroupBox'#23'WindowPositionsGroupBo'
|
+'Box'#8'TabOrder'#2#1#0#0#242#2#2#9'TGroupBox'#23'WindowPositionsGroupBox'#22
|
||||||
+'x'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#25'Hid'
|
+'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#25'HideMessa'
|
||||||
+'eMessagesIconsCheckBox'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSide'
|
+'gesIconsCheckBox'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.'
|
||||||
+'Right.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#24'Anchor'
|
+'Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#24'AnchorSideBo'
|
||||||
+'SideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'L'
|
+'ttom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#2
|
||||||
+'eft'#2#0#6'Height'#3'F'#1#3'Top'#2'B'#5'Width'#3#203#1#7'Anchors'#11#5'akTo'
|
+#0#6'Height'#3'Y'#1#3'Top'#2'3'#5'Width'#3#207#1#7'Anchors'#11#5'akTop'#6'ak'
|
||||||
+'p'#6'akLeft'#7'akRight'#8'akBottom'#0#7'Caption'#6#23'WindowPositionsGroupB'
|
+'Left'#7'akRight'#8'akBottom'#0#7'Caption'#6#23'WindowPositionsGroupBox'#12
|
||||||
+'ox'#12'ClientHeight'#3'3'#1#11'ClientWidth'#3#199#1#8'TabOrder'#2#2#0#8'TLi'
|
+'ClientHeight'#3'G'#1#11'ClientWidth'#3#203#1#8'TabOrder'#2#2#0#8'TListBox'
|
||||||
+'stBox'#22'WindowPositionsListBox'#22'AnchorSideLeft.Control'#7#23'WindowPos'
|
+#22'WindowPositionsListBox'#22'AnchorSideLeft.Control'#7#23'WindowPositionsG'
|
||||||
+'itionsGroupBox'#21'AnchorSideTop.Control'#7#23'WindowPositionsGroupBox'#23
|
+'roupBox'#21'AnchorSideTop.Control'#7#23'WindowPositionsGroupBox'#23'AnchorS'
|
||||||
+'AnchorSideRight.Control'#7#23'WindowPositionsGroupBox'#20'AnchorSideRight.S'
|
+'ideRight.Control'#7#23'WindowPositionsGroupBox'#20'AnchorSideRight.Side'#7#9
|
||||||
+'ide'#7#9'asrBottom'#4'Left'#2#6#6'Height'#2'd'#3'Top'#2#6#5'Width'#3#187#1#7
|
+'asrBottom'#4'Left'#2#6#6'Height'#2'd'#3'Top'#2#6#5'Width'#3#191#1#7'Anchors'
|
||||||
+'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#20'BorderSpacing.Around'#2#6#10
|
+#11#5'akTop'#6'akLeft'#7'akRight'#0#20'BorderSpacing.Around'#2#6#10'ItemHeig'
|
||||||
+'ItemHeight'#2#0#17'OnSelectionChange'#7'%WindowPositionsListBoxSelectionCha'
|
+'ht'#2#0#17'OnSelectionChange'#7'%WindowPositionsListBoxSelectionChange'#8'T'
|
||||||
+'nge'#8'TabOrder'#2#0#8'TopIndex'#2#255#0#0#0#242#2#3#9'TCheckBox'#25'HideMe'
|
+'abOrder'#2#0#0#0#0#242#2#3#9'TCheckBox'#25'HideMessagesIconsCheckBox'#22'An'
|
||||||
+'ssagesIconsCheckBox'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop'
|
+'chorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#20'HideIDEOnRu'
|
||||||
+'.Control'#7#20'HideIDEOnRunCheckBox'#18'AnchorSideTop.Side'#7#9'asrBottom'#4
|
+'nCheckBox'#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#17
|
||||||
+'Left'#2#0#6'Height'#2#22#3'Top'#2','#5'Width'#3#218#0#7'Caption'#6#25'HideM'
|
+#3'Top'#2'"'#5'Width'#3#163#0#7'Caption'#6#25'HideMessagesIconsCheckBox'#8'T'
|
||||||
+'essagesIconsCheckBox'#8'TabOrder'#2#3#0#0#0
|
+'abOrder'#2#3#0#0#0
|
||||||
]);
|
]);
|
||||||
|
@ -29,6 +29,48 @@ uses
|
|||||||
EnvironmentOpts, LazarusIDEStrConsts, IDEOptionDefs, ObjectInspector, IDEOptionsIntf;
|
EnvironmentOpts, LazarusIDEStrConsts, IDEOptionDefs, ObjectInspector, IDEOptionsIntf;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
TOnApplyWindowPos = procedure(Layout: TIDEWindowLayout) of object;
|
||||||
|
|
||||||
|
TIDEWindowSetupLayoutComponent = class(TGroupBox)
|
||||||
|
RestoreWindowGeometryRadioButton: TRadioButton;
|
||||||
|
DefaultRadioButton: TRadioButton;
|
||||||
|
CustomPositionRadioButton: TRadioButton;
|
||||||
|
LeftLabel: TLabel;
|
||||||
|
LeftEdit: TEdit;
|
||||||
|
TopLabel: TLabel;
|
||||||
|
TopEdit: TEdit;
|
||||||
|
WidthLabel: TLabel;
|
||||||
|
WidthEdit: TEdit;
|
||||||
|
HeightLabel: TLabel;
|
||||||
|
HeightEdit: TEdit;
|
||||||
|
UseWindowManagerSettingRadioButton: TRadioButton;
|
||||||
|
DockedRadioButton: TRadioButton;
|
||||||
|
ApplyButton: TButton;
|
||||||
|
GetWindowPositionButton: TButton;
|
||||||
|
procedure ApplyButtonClick(Sender: TObject);
|
||||||
|
procedure GetWindowPositionButtonClick(Sender: TObject);
|
||||||
|
private
|
||||||
|
fOnApplyWindowPos: TOnApplyWindowPos;
|
||||||
|
fLayout: TIDEWindowLayout;
|
||||||
|
fUpdateRadioButtons: boolean;
|
||||||
|
protected
|
||||||
|
function GetLayout: TIDEWindowLayout;
|
||||||
|
procedure SetLayout(const AValue: TIDEWindowLayout);
|
||||||
|
function GetPlacementRadioButtons(APlacement: TIDEWindowPlacement): TRadioButton;
|
||||||
|
procedure SetPlacementRadioButtons(APlacement: TIDEWindowPlacement;
|
||||||
|
const AValue: TRadioButton);
|
||||||
|
procedure LoadFrom(ALayout: TIDEWindowLayout);
|
||||||
|
procedure BoundsChanged; override;
|
||||||
|
public
|
||||||
|
constructor Create(TheOwner: TComponent); override;
|
||||||
|
procedure Save;
|
||||||
|
procedure SaveTo(AnLayout: TIDEWindowLayout);
|
||||||
|
property Layout: TIDEWindowLayout read GetLayout write SetLayout;
|
||||||
|
property PlacementRadioButtons[APlacement: TIDEWindowPlacement]: TRadioButton
|
||||||
|
read GetPlacementRadioButtons write SetPlacementRadioButtons;
|
||||||
|
property OnApplyWindowPos: TOnApplyWindowPos
|
||||||
|
read fOnApplyWindowPos write fOnApplyWindowPos;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TWindowOptionsFrame }
|
{ TWindowOptionsFrame }
|
||||||
|
|
||||||
@ -175,6 +217,239 @@ begin
|
|||||||
Result := TEnvironmentOptions;
|
Result := TEnvironmentOptions;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TIDEWindowSetupLayoutComponent }
|
||||||
|
|
||||||
|
procedure TIDEWindowSetupLayoutComponent.BoundsChanged;
|
||||||
|
begin
|
||||||
|
inherited BoundsChanged;
|
||||||
|
LoadFrom(fLayout);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEWindowSetupLayoutComponent.LoadFrom(ALayout: TIDEWindowLayout);
|
||||||
|
var
|
||||||
|
APlacement: TIDEWindowPlacement;
|
||||||
|
CurY: LongInt;
|
||||||
|
Col2X: Integer;
|
||||||
|
PreviousButton: TRadioButton;
|
||||||
|
|
||||||
|
procedure SetLabelAndEdit(var ALabel: TLabel;
|
||||||
|
var AnEdit: TEdit; const ACaption: string; x, y: integer);
|
||||||
|
begin
|
||||||
|
if iwpCustomPosition in ALayout.WindowPlacementsAllowed then begin
|
||||||
|
if ALabel=nil then ALabel:=TLabel.Create(Self);
|
||||||
|
with ALabel do begin
|
||||||
|
Parent:=Self;
|
||||||
|
SetBounds(x,y,45,Height);
|
||||||
|
Caption:=ACaption;
|
||||||
|
end;
|
||||||
|
if AnEdit=nil then AnEdit:=TEdit.Create(Self);
|
||||||
|
with AnEdit do begin
|
||||||
|
Parent:=Self;
|
||||||
|
SetBounds(x+ALabel.Width+3,y,40,Height);
|
||||||
|
Text:='';
|
||||||
|
end;
|
||||||
|
end else begin
|
||||||
|
FreeAndNil(ALabel);
|
||||||
|
FreeAndNil(AnEdit);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetRadioBtnCaptions(aPos : TIDEWindowPlacement) : String;
|
||||||
|
begin
|
||||||
|
Result:='?';
|
||||||
|
Case aPos of
|
||||||
|
iwpUseWindowManagerSetting : Result:= rsiwpUseWindowManagerSetting;
|
||||||
|
iwpDefault : Result:= rsiwpDefault;
|
||||||
|
iwpRestoreWindowGeometry : Result:= rsiwpRestoreWindowGeometry;
|
||||||
|
iwpDocked : Result:= rsiwpDocked;
|
||||||
|
iwpCustomPosition : Result:= rsiwpCustomPosition;
|
||||||
|
iwpRestoreWindowSize : Result:= rsiwpRestoreWindowSize;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if ALayout=nil then exit;
|
||||||
|
CurY:=5;
|
||||||
|
Col2X:=300;
|
||||||
|
PreviousButton:= nil;
|
||||||
|
for APlacement:=Low(TIDEWindowPlacement) to High(TIDEWindowPlacement) do
|
||||||
|
begin
|
||||||
|
if APlacement in ALayout.WindowPlacementsAllowed then
|
||||||
|
begin
|
||||||
|
if PlacementRadioButtons[APlacement]=nil then
|
||||||
|
PlacementRadioButtons[APlacement]:=TRadioButton.Create(Self);
|
||||||
|
with PlacementRadioButtons[APlacement] do
|
||||||
|
begin
|
||||||
|
Parent:=Self;
|
||||||
|
Left := 6;
|
||||||
|
if PreviousButton=nil then
|
||||||
|
Top := 6
|
||||||
|
else
|
||||||
|
AnchorToNeighbour(akTop,6,PreviousButton);
|
||||||
|
Caption:=GetRadioBtnCaptions(APlacement);
|
||||||
|
Checked:=(APlacement=ALayout.WindowPlacement);
|
||||||
|
end;
|
||||||
|
PreviousButton := PlacementRadioButtons[APlacement];
|
||||||
|
|
||||||
|
case APlacement of
|
||||||
|
iwpCustomPosition:
|
||||||
|
begin
|
||||||
|
// custom window position
|
||||||
|
SetLabelAndEdit(LeftLabel,LeftEdit,dlgLeftPos,Col2X,CurY);
|
||||||
|
SetLabelAndEdit(TopLabel,TopEdit,dlgTopPos,
|
||||||
|
LeftEdit.Left+LeftEdit.Width+15,CurY);
|
||||||
|
inc(CurY,LeftEdit.Height+6);
|
||||||
|
SetLabelAndEdit(WidthLabel,WidthEdit,dlgWidthPos,LeftLabel.Left,CurY);
|
||||||
|
SetLabelAndEdit(HeightLabel,HeightEdit,DlgHeightPos,
|
||||||
|
WidthEdit.Left+WidthEdit.Width+15,CurY);
|
||||||
|
inc(CurY,WidthEdit.Height+6);
|
||||||
|
if ALayout.CustomCoordinatesAreValid then begin
|
||||||
|
LeftEdit.Text:=IntToStr(ALayout.Left);
|
||||||
|
TopEdit.Text:=IntToStr(ALayout.Top);
|
||||||
|
WidthEdit.Text:=IntToStr(ALayout.Width);
|
||||||
|
HeightEdit.Text:=IntToStr(ALayout.Height);
|
||||||
|
end else if ALayout.Form<>nil then begin
|
||||||
|
LeftEdit.Text:=IntToStr(ALayout.Form.Left);
|
||||||
|
TopEdit.Text:=IntToStr(ALayout.Form.Top);
|
||||||
|
WidthEdit.Text:=IntToStr(ALayout.Form.Width);
|
||||||
|
HeightEdit.Text:=IntToStr(ALayout.Form.Height);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end else begin
|
||||||
|
// window placement not allowed
|
||||||
|
if PlacementRadioButtons[APlacement]<>nil then
|
||||||
|
begin
|
||||||
|
PlacementRadioButtons[APlacement].Free;
|
||||||
|
PlacementRadioButtons[APlacement]:=nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if ApplyButton=nil then
|
||||||
|
ApplyButton:=TButton.Create(Self);
|
||||||
|
|
||||||
|
with ApplyButton do
|
||||||
|
begin
|
||||||
|
Parent:=Self;
|
||||||
|
SetBounds(Col2X,CurY,Width,Height);
|
||||||
|
OnClick:=@ApplyButtonClick;
|
||||||
|
Caption:=dlgButApply;
|
||||||
|
AutoSize:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if iwpCustomPosition in ALayout.WindowPlacementsAllowed then
|
||||||
|
begin
|
||||||
|
if GetWindowPositionButton=nil then
|
||||||
|
GetWindowPositionButton:=TButton.Create(Self);
|
||||||
|
with GetWindowPositionButton do
|
||||||
|
begin
|
||||||
|
Parent:=Self;
|
||||||
|
OnClick:=@GetWindowPositionButtonClick;
|
||||||
|
Caption:=dlgGetPosition;
|
||||||
|
AutoSize:=true;
|
||||||
|
AnchorToNeighbour(akLeft,6,ApplyButton);
|
||||||
|
AnchorParallel(akTop,0,ApplyButton);
|
||||||
|
Enabled := ALayout.Form <> nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
//inc(CurY,ApplyButton.Height+7);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEWindowSetupLayoutComponent.SaveTo(AnLayout: TIDEWindowLayout);
|
||||||
|
var
|
||||||
|
APlacement: TIDEWindowPlacement;
|
||||||
|
ARadioButton: TRadioButton;
|
||||||
|
begin
|
||||||
|
if AnLayout=nil then exit;
|
||||||
|
if LeftEdit<>nil then
|
||||||
|
AnLayout.Left:=StrToIntDef(LeftEdit.Text,0);
|
||||||
|
if TopEdit<>nil then
|
||||||
|
AnLayout.Top:=StrToIntDef(TopEdit.Text,0);
|
||||||
|
if WidthEdit<>nil then
|
||||||
|
AnLayout.Width:=StrToIntDef(WidthEdit.Text,0);
|
||||||
|
if HeightEdit<>nil then
|
||||||
|
AnLayout.Height:=StrToIntDef(HeightEdit.Text,0);
|
||||||
|
for APlacement:=Low(TIDEWindowPlacement) to High(TIDEWindowPlacement) do
|
||||||
|
begin
|
||||||
|
ARadioButton:=GetPlacementRadioButtons(APlacement);
|
||||||
|
if (ARadioButton<>nil) and ARadioButton.Checked then
|
||||||
|
AnLayout.WindowPlacement:=APlacement;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TIDEWindowSetupLayoutComponent.Create(TheOwner: TComponent);
|
||||||
|
begin
|
||||||
|
inherited Create(TheOwner);
|
||||||
|
fUpdateRadioButtons:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TIDEWindowSetupLayoutComponent.GetPlacementRadioButtons(
|
||||||
|
APlacement: TIDEWindowPlacement): TRadioButton;
|
||||||
|
begin
|
||||||
|
case APlacement of
|
||||||
|
iwpRestoreWindowGeometry: Result:=RestoreWindowGeometryRadioButton;
|
||||||
|
iwpDefault: Result:=DefaultRadioButton;
|
||||||
|
iwpCustomPosition: Result:=CustomPositionRadioButton;
|
||||||
|
iwpUseWindowManagerSetting: Result:=UseWindowManagerSettingRadioButton;
|
||||||
|
iwpDocked: Result:=DockedRadioButton;
|
||||||
|
else
|
||||||
|
Result:=nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEWindowSetupLayoutComponent.SetPlacementRadioButtons(
|
||||||
|
APlacement: TIDEWindowPlacement; const AValue: TRadioButton);
|
||||||
|
begin
|
||||||
|
case APlacement of
|
||||||
|
iwpRestoreWindowGeometry: RestoreWindowGeometryRadioButton:=AValue;
|
||||||
|
iwpDefault: DefaultRadioButton:=AValue;
|
||||||
|
iwpCustomPosition: CustomPositionRadioButton:=AValue;
|
||||||
|
iwpUseWindowManagerSetting: UseWindowManagerSettingRadioButton:=AValue;
|
||||||
|
iwpDocked: DockedRadioButton:=AValue;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEWindowSetupLayoutComponent.ApplyButtonClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Save;
|
||||||
|
if Assigned(OnApplyWindowPos) then OnApplyWindowPos(Layout);
|
||||||
|
Layout.Apply;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEWindowSetupLayoutComponent.GetWindowPositionButtonClick(
|
||||||
|
Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Layout.Form<>nil then begin
|
||||||
|
if LeftEdit<>nil then
|
||||||
|
LeftEdit.Text:=IntToStr(Layout.Form.Left);
|
||||||
|
if TopEdit<>nil then
|
||||||
|
TopEdit.Text:=IntToStr(Layout.Form.Top);
|
||||||
|
if WidthEdit<>nil then
|
||||||
|
WidthEdit.Text:=IntToStr(Layout.Form.Width);
|
||||||
|
if HeightEdit<>nil then
|
||||||
|
HeightEdit.Text:=IntToStr(Layout.Form.Height);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TIDEWindowSetupLayoutComponent.GetLayout: TIDEWindowLayout;
|
||||||
|
begin
|
||||||
|
Result:=fLayout;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEWindowSetupLayoutComponent.SetLayout(
|
||||||
|
const AValue: TIDEWindowLayout);
|
||||||
|
begin
|
||||||
|
fLayout:=AValue;
|
||||||
|
LoadFrom(fLayout);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEWindowSetupLayoutComponent.Save;
|
||||||
|
begin
|
||||||
|
SaveTo(Layout);
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
{$I window_options.lrs}
|
{$I window_options.lrs}
|
||||||
RegisterIDEOptionsEditor(GroupEnvironment, TWindowOptionsFrame, EnvOptionsWindow);
|
RegisterIDEOptionsEditor(GroupEnvironment, TWindowOptionsFrame, EnvOptionsWindow);
|
||||||
|
@ -274,52 +274,6 @@ type
|
|||||||
read GetItems write SetItems; default;
|
read GetItems write SetItems; default;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
TOnApplyWindowPos = procedure(Layout: TIDEWindowLayout) of object;
|
|
||||||
|
|
||||||
TIDEWindowSetupLayoutComponent = class(TGroupBox)
|
|
||||||
RestoreWindowGeometryRadioButton: TRadioButton;
|
|
||||||
DefaultRadioButton: TRadioButton;
|
|
||||||
CustomPositionRadioButton: TRadioButton;
|
|
||||||
LeftLabel: TLabel;
|
|
||||||
LeftEdit: TEdit;
|
|
||||||
TopLabel: TLabel;
|
|
||||||
TopEdit: TEdit;
|
|
||||||
WidthLabel: TLabel;
|
|
||||||
WidthEdit: TEdit;
|
|
||||||
HeightLabel: TLabel;
|
|
||||||
HeightEdit: TEdit;
|
|
||||||
UseWindowManagerSettingRadioButton: TRadioButton;
|
|
||||||
DockedRadioButton: TRadioButton;
|
|
||||||
ApplyButton: TButton;
|
|
||||||
GetWindowPositionButton: TButton;
|
|
||||||
procedure ApplyButtonClick(Sender: TObject);
|
|
||||||
procedure GetWindowPositionButtonClick(Sender: TObject);
|
|
||||||
private
|
|
||||||
fOnApplyWindowPos: TOnApplyWindowPos;
|
|
||||||
fLayout: TIDEWindowLayout;
|
|
||||||
fUpdateRadioButtons: boolean;
|
|
||||||
protected
|
|
||||||
function GetLayout: TIDEWindowLayout;
|
|
||||||
procedure SetLayout(const AValue: TIDEWindowLayout);
|
|
||||||
function GetPlacementRadioButtons(APlacement: TIDEWindowPlacement
|
|
||||||
): TRadioButton;
|
|
||||||
procedure SetPlacementRadioButtons(APlacement: TIDEWindowPlacement;
|
|
||||||
const AValue: TRadioButton);
|
|
||||||
procedure LoadFrom(ALayout: TIDEWindowLayout);
|
|
||||||
procedure BoundsChanged; override;
|
|
||||||
public
|
|
||||||
constructor Create(TheOwner: TComponent); override;
|
|
||||||
procedure Save;
|
|
||||||
procedure SaveTo(AnLayout: TIDEWindowLayout);
|
|
||||||
property Layout: TIDEWindowLayout read GetLayout write SetLayout;
|
|
||||||
property PlacementRadioButtons[APlacement: TIDEWindowPlacement]: TRadioButton
|
|
||||||
read GetPlacementRadioButtons write SetPlacementRadioButtons;
|
|
||||||
property OnApplyWindowPos: TOnApplyWindowPos
|
|
||||||
read fOnApplyWindowPos write fOnApplyWindowPos;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
IDEWindowDockModeNames: array[TIDEWindowDockMode] of string = (
|
IDEWindowDockModeNames: array[TIDEWindowDockMode] of string = (
|
||||||
'Default', 'Left', 'Right', 'Top', 'Bottom'
|
'Default', 'Left', 'Right', 'Top', 'Bottom'
|
||||||
@ -856,244 +810,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TIDEWindowSetupLayoutComponent }
|
|
||||||
|
|
||||||
|
|
||||||
procedure TIDEWindowSetupLayoutComponent.BoundsChanged;
|
|
||||||
begin
|
|
||||||
inherited BoundsChanged;
|
|
||||||
LoadFrom(fLayout);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TIDEWindowSetupLayoutComponent.LoadFrom(ALayout: TIDEWindowLayout);
|
|
||||||
var
|
|
||||||
APlacement: TIDEWindowPlacement;
|
|
||||||
CurY: LongInt;
|
|
||||||
Col2X: Integer;
|
|
||||||
PreviousButton: TRadioButton;
|
|
||||||
|
|
||||||
procedure SetLabelAndEdit(var ALabel: TLabel;
|
|
||||||
var AnEdit: TEdit; const ACaption: string; x, y: integer);
|
|
||||||
begin
|
|
||||||
if iwpCustomPosition in ALayout.WindowPlacementsAllowed then begin
|
|
||||||
if ALabel=nil then ALabel:=TLabel.Create(Self);
|
|
||||||
with ALabel do begin
|
|
||||||
Parent:=Self;
|
|
||||||
SetBounds(x,y,45,Height);
|
|
||||||
Caption:=ACaption;
|
|
||||||
end;
|
|
||||||
if AnEdit=nil then AnEdit:=TEdit.Create(Self);
|
|
||||||
with AnEdit do begin
|
|
||||||
Parent:=Self;
|
|
||||||
SetBounds(x+ALabel.Width+3,y,40,Height);
|
|
||||||
Text:='';
|
|
||||||
end;
|
|
||||||
end else begin
|
|
||||||
FreeAndNil(ALabel);
|
|
||||||
FreeAndNil(AnEdit);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function GetRadioBtnCaptions(aPos : TIDEWindowPlacement) : String;
|
|
||||||
begin
|
|
||||||
Result:='?';
|
|
||||||
Case aPos of
|
|
||||||
iwpUseWindowManagerSetting : Result:= rsiwpUseWindowManagerSetting;
|
|
||||||
iwpDefault : Result:= rsiwpDefault;
|
|
||||||
iwpRestoreWindowGeometry : Result:= rsiwpRestoreWindowGeometry;
|
|
||||||
iwpDocked : Result:= rsiwpDocked;
|
|
||||||
iwpCustomPosition : Result:= rsiwpCustomPosition;
|
|
||||||
iwpRestoreWindowSize : Result:= rsiwpRestoreWindowSize;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
|
||||||
if ALayout=nil then exit;
|
|
||||||
CurY:=5;
|
|
||||||
Col2X:=300;
|
|
||||||
PreviousButton:= nil;
|
|
||||||
for APlacement:=Low(TIDEWindowPlacement) to High(TIDEWindowPlacement) do
|
|
||||||
begin
|
|
||||||
if APlacement in ALayout.WindowPlacementsAllowed then
|
|
||||||
begin
|
|
||||||
if PlacementRadioButtons[APlacement]=nil then
|
|
||||||
PlacementRadioButtons[APlacement]:=TRadioButton.Create(Self);
|
|
||||||
with PlacementRadioButtons[APlacement] do
|
|
||||||
begin
|
|
||||||
Parent:=Self;
|
|
||||||
Left := 6;
|
|
||||||
if PreviousButton=nil then
|
|
||||||
Top := 6
|
|
||||||
else
|
|
||||||
AnchorToNeighbour(akTop,6,PreviousButton);
|
|
||||||
Caption:=GetRadioBtnCaptions(APlacement);
|
|
||||||
Checked:=(APlacement=ALayout.WindowPlacement);
|
|
||||||
end;
|
|
||||||
PreviousButton := PlacementRadioButtons[APlacement];
|
|
||||||
|
|
||||||
case APlacement of
|
|
||||||
iwpCustomPosition:
|
|
||||||
begin
|
|
||||||
// custom window position
|
|
||||||
SetLabelAndEdit(LeftLabel,LeftEdit,dlgLeftPos,Col2X,CurY);
|
|
||||||
SetLabelAndEdit(TopLabel,TopEdit,dlgTopPos,
|
|
||||||
LeftEdit.Left+LeftEdit.Width+15,CurY);
|
|
||||||
inc(CurY,LeftEdit.Height+6);
|
|
||||||
SetLabelAndEdit(WidthLabel,WidthEdit,dlgWidthPos,LeftLabel.Left,CurY);
|
|
||||||
SetLabelAndEdit(HeightLabel,HeightEdit,DlgHeightPos,
|
|
||||||
WidthEdit.Left+WidthEdit.Width+15,CurY);
|
|
||||||
inc(CurY,WidthEdit.Height+6);
|
|
||||||
if ALayout.CustomCoordinatesAreValid then begin
|
|
||||||
LeftEdit.Text:=IntToStr(ALayout.Left);
|
|
||||||
TopEdit.Text:=IntToStr(ALayout.Top);
|
|
||||||
WidthEdit.Text:=IntToStr(ALayout.Width);
|
|
||||||
HeightEdit.Text:=IntToStr(ALayout.Height);
|
|
||||||
end else if ALayout.Form<>nil then begin
|
|
||||||
LeftEdit.Text:=IntToStr(ALayout.Form.Left);
|
|
||||||
TopEdit.Text:=IntToStr(ALayout.Form.Top);
|
|
||||||
WidthEdit.Text:=IntToStr(ALayout.Form.Width);
|
|
||||||
HeightEdit.Text:=IntToStr(ALayout.Form.Height);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
end else begin
|
|
||||||
// window placement not allowed
|
|
||||||
if PlacementRadioButtons[APlacement]<>nil then
|
|
||||||
begin
|
|
||||||
PlacementRadioButtons[APlacement].Free;
|
|
||||||
PlacementRadioButtons[APlacement]:=nil;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
if ApplyButton=nil then
|
|
||||||
ApplyButton:=TButton.Create(Self);
|
|
||||||
|
|
||||||
with ApplyButton do
|
|
||||||
begin
|
|
||||||
Parent:=Self;
|
|
||||||
SetBounds(Col2X,CurY,Width,Height);
|
|
||||||
OnClick:=@ApplyButtonClick;
|
|
||||||
Caption:=dlgButApply;
|
|
||||||
AutoSize:=true;
|
|
||||||
end;
|
|
||||||
|
|
||||||
if iwpCustomPosition in ALayout.WindowPlacementsAllowed then
|
|
||||||
begin
|
|
||||||
if GetWindowPositionButton=nil then
|
|
||||||
GetWindowPositionButton:=TButton.Create(Self);
|
|
||||||
with GetWindowPositionButton do
|
|
||||||
begin
|
|
||||||
Parent:=Self;
|
|
||||||
OnClick:=@GetWindowPositionButtonClick;
|
|
||||||
Caption:=dlgGetPosition;
|
|
||||||
AutoSize:=true;
|
|
||||||
AnchorToNeighbour(akLeft,6,ApplyButton);
|
|
||||||
AnchorParallel(akTop,0,ApplyButton);
|
|
||||||
Enabled := ALayout.Form <> nil;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
//inc(CurY,ApplyButton.Height+7);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TIDEWindowSetupLayoutComponent.SaveTo(AnLayout: TIDEWindowLayout);
|
|
||||||
var
|
|
||||||
APlacement: TIDEWindowPlacement;
|
|
||||||
ARadioButton: TRadioButton;
|
|
||||||
begin
|
|
||||||
if AnLayout=nil then exit;
|
|
||||||
if LeftEdit<>nil then
|
|
||||||
AnLayout.Left:=StrToIntDef(LeftEdit.Text,0);
|
|
||||||
if TopEdit<>nil then
|
|
||||||
AnLayout.Top:=StrToIntDef(TopEdit.Text,0);
|
|
||||||
if WidthEdit<>nil then
|
|
||||||
AnLayout.Width:=StrToIntDef(WidthEdit.Text,0);
|
|
||||||
if HeightEdit<>nil then
|
|
||||||
AnLayout.Height:=StrToIntDef(HeightEdit.Text,0);
|
|
||||||
for APlacement:=Low(TIDEWindowPlacement) to High(TIDEWindowPlacement) do
|
|
||||||
begin
|
|
||||||
ARadioButton:=GetPlacementRadioButtons(APlacement);
|
|
||||||
if (ARadioButton<>nil) and ARadioButton.Checked then
|
|
||||||
AnLayout.WindowPlacement:=APlacement;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
constructor TIDEWindowSetupLayoutComponent.Create(TheOwner: TComponent);
|
|
||||||
begin
|
|
||||||
inherited Create(TheOwner);
|
|
||||||
fUpdateRadioButtons:=false;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TIDEWindowSetupLayoutComponent.GetPlacementRadioButtons(
|
|
||||||
APlacement: TIDEWindowPlacement): TRadioButton;
|
|
||||||
begin
|
|
||||||
case APlacement of
|
|
||||||
iwpRestoreWindowGeometry: Result:=RestoreWindowGeometryRadioButton;
|
|
||||||
iwpDefault: Result:=DefaultRadioButton;
|
|
||||||
iwpCustomPosition: Result:=CustomPositionRadioButton;
|
|
||||||
iwpUseWindowManagerSetting: Result:=UseWindowManagerSettingRadioButton;
|
|
||||||
iwpDocked: Result:=DockedRadioButton;
|
|
||||||
else
|
|
||||||
Result:=nil;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TIDEWindowSetupLayoutComponent.SetPlacementRadioButtons(
|
|
||||||
APlacement: TIDEWindowPlacement; const AValue: TRadioButton);
|
|
||||||
begin
|
|
||||||
case APlacement of
|
|
||||||
iwpRestoreWindowGeometry: RestoreWindowGeometryRadioButton:=AValue;
|
|
||||||
iwpDefault: DefaultRadioButton:=AValue;
|
|
||||||
iwpCustomPosition: CustomPositionRadioButton:=AValue;
|
|
||||||
iwpUseWindowManagerSetting: UseWindowManagerSettingRadioButton:=AValue;
|
|
||||||
iwpDocked: DockedRadioButton:=AValue;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TIDEWindowSetupLayoutComponent.ApplyButtonClick(Sender: TObject);
|
|
||||||
begin
|
|
||||||
Save;
|
|
||||||
if Assigned(OnApplyWindowPos) then OnApplyWindowPos(Layout);
|
|
||||||
Layout.Apply;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TIDEWindowSetupLayoutComponent.GetWindowPositionButtonClick(
|
|
||||||
Sender: TObject);
|
|
||||||
begin
|
|
||||||
if Layout.Form<>nil then begin
|
|
||||||
if LeftEdit<>nil then
|
|
||||||
LeftEdit.Text:=IntToStr(Layout.Form.Left);
|
|
||||||
if TopEdit<>nil then
|
|
||||||
TopEdit.Text:=IntToStr(Layout.Form.Top);
|
|
||||||
if WidthEdit<>nil then
|
|
||||||
WidthEdit.Text:=IntToStr(Layout.Form.Width);
|
|
||||||
if HeightEdit<>nil then
|
|
||||||
HeightEdit.Text:=IntToStr(Layout.Form.Height);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TIDEWindowSetupLayoutComponent.GetLayout: TIDEWindowLayout;
|
|
||||||
begin
|
|
||||||
Result:=fLayout;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TIDEWindowSetupLayoutComponent.SetLayout(
|
|
||||||
const AValue: TIDEWindowLayout);
|
|
||||||
begin
|
|
||||||
fLayout:=AValue;
|
|
||||||
LoadFrom(fLayout);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TIDEWindowSetupLayoutComponent.Save;
|
|
||||||
begin
|
|
||||||
SaveTo(Layout);
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TXMLOptionsStorage }
|
{ TXMLOptionsStorage }
|
||||||
|
|
||||||
function TXMLOptionsStorage.GetFullPathValue(const APath, ADefault: String
|
function TXMLOptionsStorage.GetFullPathValue(const APath, ADefault: String): String;
|
||||||
): String;
|
|
||||||
begin
|
begin
|
||||||
Result:=XMLConfig.GetValue(APath, ADefault);
|
Result:=XMLConfig.GetValue(APath, ADefault);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user