IDE: options: scroll tree to category

git-svn-id: trunk@19677 -
This commit is contained in:
mattias 2009-04-28 23:04:31 +00:00
parent d861d852d9
commit 94a5ebbef2
4 changed files with 38 additions and 30 deletions

View File

@ -1,4 +1,4 @@
object IDEOptionsDialog: TIDEOptionsDialog inherited IDEOptionsDialog: TIDEOptionsDialog
Left = 317 Left = 317
Height = 500 Height = 500
Top = 304 Top = 304
@ -10,16 +10,16 @@ object IDEOptionsDialog: TIDEOptionsDialog
ClientWidth = 700 ClientWidth = 700
Constraints.MinHeight = 300 Constraints.MinHeight = 300
Constraints.MinWidth = 300 Constraints.MinWidth = 300
OnShow = FormShow
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '0.9.27' object ButtonPanel: TButtonPanel[0]
object ButtonPanel: TButtonPanel
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = Owner
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
Left = 6 Left = 6
Height = 34 Height = 44
Top = 460 Top = 450
Width = 688 Width = 688
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Right = 6 BorderSpacing.Right = 6
@ -28,19 +28,19 @@ object IDEOptionsDialog: TIDEOptionsDialog
TabOrder = 1 TabOrder = 1
ShowButtons = [pbOK, pbCancel, pbHelp] ShowButtons = [pbOK, pbCancel, pbHelp]
end end
object CategoryTree: TTreeView object CategoryTree: TTreeView[1]
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner AnchorSideTop.Control = Owner
AnchorSideBottom.Control = ButtonPanel AnchorSideBottom.Control = ButtonPanel
Left = 6 Left = 6
Height = 454 Height = 444
Top = 6 Top = 6
Width = 206 Width = 206
Anchors = [akTop, akLeft, akBottom] Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 6 BorderSpacing.Top = 6
Constraints.MinWidth = 206 Constraints.MinWidth = 206
DefaultItemHeight = 15 DefaultItemHeight = 19
ReadOnly = True ReadOnly = True
TabOrder = 0 TabOrder = 0
OnChange = CategoryTreeChange OnChange = CategoryTreeChange

View File

@ -1,24 +1,24 @@
{ This is an automatically generated lazarus resource file } { This is an automatically generated lazarus resource file }
LazarusResources.Add('TIDEOptionsDialog','FORMDATA',[ LazarusResources.Add('TIDEOptionsDialog','FORMDATA',[
'TPF0'#17'TIDEOptionsDialog'#16'IDEOptionsDialog'#4'Left'#3'='#1#6'Height'#3 'TPF0'#241#17'TIDEOptionsDialog'#16'IDEOptionsDialog'#4'Left'#3'='#1#6'Height'
+#244#1#3'Top'#3'0'#1#5'Width'#3#188#2#13'ActiveControl'#7#12'CategoryTree'#11 +#3#244#1#3'Top'#3'0'#1#5'Width'#3#188#2#13'ActiveControl'#7#12'CategoryTree'
+'BorderIcons'#11#12'biSystemMenu'#0#7'Caption'#6#16'IDEOptionsDialog'#12'Cli' +#11'BorderIcons'#11#12'biSystemMenu'#0#7'Caption'#6#16'IDEOptionsDialog'#12
+'entHeight'#3#244#1#11'ClientWidth'#3#188#2#21'Constraints.MinHeight'#3','#1 +'ClientHeight'#3#244#1#11'ClientWidth'#3#188#2#21'Constraints.MinHeight'#3','
+#20'Constraints.MinWidth'#3','#1#8'Position'#7#14'poScreenCenter'#10'LCLVers' +#1#20'Constraints.MinWidth'#3','#1#6'OnShow'#7#8'FormShow'#8'Position'#7#14
+'ion'#6#6'0.9.27'#0#12'TButtonPanel'#11'ButtonPanel'#22'AnchorSideLeft.Contr' +'poScreenCenter'#0#242#2#0#12'TButtonPanel'#11'ButtonPanel'#22'AnchorSideLef'
+'ol'#7#5'Owner'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Si' +'t.Control'#7#5'Owner'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideR'
+'de'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#5'Owner'#4'Left'#2#6#6'He' +'ight.Side'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#5'Owner'#4'Left'#2
+'ight'#2'"'#3'Top'#3#204#1#5'Width'#3#176#2#18'BorderSpacing.Left'#2#6#19'Bo' +#6#6'Height'#2','#3'Top'#3#194#1#5'Width'#3#176#2#18'BorderSpacing.Left'#2#6
+'rderSpacing.Right'#2#6#20'BorderSpacing.Bottom'#2#6#20'BorderSpacing.Around' +#19'BorderSpacing.Right'#2#6#20'BorderSpacing.Bottom'#2#6#20'BorderSpacing.A'
+#2#0#8'TabOrder'#2#1#11'ShowButtons'#11#4'pbOK'#8'pbCancel'#6'pbHelp'#0#0#0#9 +'round'#2#0#8'TabOrder'#2#1#11'ShowButtons'#11#4'pbOK'#8'pbCancel'#6'pbHelp'
+'TTreeView'#12'CategoryTree'#22'AnchorSideLeft.Control'#7#5'Owner'#21'Anchor' +#0#0#0#242#2#1#9'TTreeView'#12'CategoryTree'#22'AnchorSideLeft.Control'#7#5
+'SideTop.Control'#7#5'Owner'#24'AnchorSideBottom.Control'#7#11'ButtonPanel'#4 +'Owner'#21'AnchorSideTop.Control'#7#5'Owner'#24'AnchorSideBottom.Control'#7
+'Left'#2#6#6'Height'#3#198#1#3'Top'#2#6#5'Width'#3#206#0#7'Anchors'#11#5'akT' +#11'ButtonPanel'#4'Left'#2#6#6'Height'#3#188#1#3'Top'#2#6#5'Width'#3#206#0#7
+'op'#6'akLeft'#8'akBottom'#0#18'BorderSpacing.Left'#2#6#17'BorderSpacing.Top' +'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#18'BorderSpacing.Left'#2#6#17
+#2#6#20'Constraints.MinWidth'#3#206#0#17'DefaultItemHeight'#2#15#8'ReadOnly' +'BorderSpacing.Top'#2#6#20'Constraints.MinWidth'#3#206#0#17'DefaultItemHeigh'
+#9#8'TabOrder'#2#0#8'OnChange'#7#18'CategoryTreeChange'#7'Options'#11#17'tvo' +'t'#2#19#8'ReadOnly'#9#8'TabOrder'#2#0#8'OnChange'#7#18'CategoryTreeChange'#7
+'AutoItemHeight'#16'tvoHideSelection'#21'tvoKeepCollapsedNodes'#11'tvoReadOn' +'Options'#11#17'tvoAutoItemHeight'#16'tvoHideSelection'#21'tvoKeepCollapsedN'
+'ly'#14'tvoShowButtons'#12'tvoShowLines'#11'tvoShowRoot'#11'tvoToolTips'#0#0 +'odes'#11'tvoReadOnly'#14'tvoShowButtons'#12'tvoShowLines'#11'tvoShowRoot'#11
+#0#0 +'tvoToolTips'#0#0#0#0
]); ]);

View File

@ -41,6 +41,7 @@ type
CategoryTree: TTreeView; CategoryTree: TTreeView;
procedure CategoryTreeChange(Sender: TObject; Node: TTreeNode); procedure CategoryTreeChange(Sender: TObject; Node: TTreeNode);
procedure FormShow(Sender: TObject);
procedure HelpButtonClick(Sender: TObject); procedure HelpButtonClick(Sender: TObject);
procedure OkButtonClick(Sender: TObject); procedure OkButtonClick(Sender: TObject);
procedure CancelButtonClick(Sender: TObject); procedure CancelButtonClick(Sender: TObject);
@ -129,6 +130,13 @@ begin
end; end;
end; end;
procedure TIDEOptionsDialog.FormShow(Sender: TObject);
begin
// make the category visible in the treeview
if (CategoryTree.Selected<>nil) and (CategoryTree.Selected.Parent<>nil) then
CategoryTree.TopItem:=CategoryTree.Selected.Parent;
end;
procedure TIDEOptionsDialog.OkButtonClick(Sender: TObject); procedure TIDEOptionsDialog.OkButtonClick(Sender: TObject);
begin begin
if not CheckValues then if not CheckValues then

View File

@ -173,11 +173,11 @@ const
{ iitThumbnail8BitMask } [iitThumbnail32BitData] { iitThumbnail8BitMask } [iitThumbnail32BitData]
); );
function GetIcnsIconType(StrIconType: FourCharCode): TicnsIconType; function GetIcnsIconType(const StrIconType: FourCharCode): TicnsIconType;
implementation implementation
function GetIcnsIconType(StrIconType: FourCharCode): TicnsIconType; function GetIcnsIconType(const StrIconType: FourCharCode): TicnsIconType;
begin begin
Result := iitNone; Result := iitNone;