IDE: code explorer: added mode option

git-svn-id: trunk@13548 -
This commit is contained in:
mattias 2007-12-31 14:29:16 +00:00
parent 9fa2584d36
commit 1d750468f5
7 changed files with 267 additions and 112 deletions

View File

@ -1,59 +1,33 @@
object CodeExplorerDlg: TCodeExplorerDlg object CodeExplorerDlg: TCodeExplorerDlg
Left = 279 Left = 378
Height = 300 Height = 340
Top = 167 Top = 170
Width = 400 Width = 321
HorzScrollBar.Page = 399 HorzScrollBar.Page = 320
VertScrollBar.Page = 299 VertScrollBar.Page = 339
ActiveControl = UpdatePage ActiveControl = MainNotebook
BorderStyle = bsSizeToolWin BorderStyle = bsSizeToolWin
Caption = 'CodeExplorerDlg' Caption = 'CodeExplorerDlg'
ClientHeight = 300 ClientHeight = 340
ClientWidth = 400 ClientWidth = 321
OnCreate = CodeExplorerDlgCreate OnCreate = CodeExplorerDlgCreate
OnDestroy = CodeExplorerDlgDestroy OnDestroy = CodeExplorerDlgDestroy
Position = poScreenCenter Position = poScreenCenter
object OkButton: TButton
AnchorSideRight.Control = CancelButton
Left = 216
Height = 29
Top = 264
Width = 72
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = 'OkButton'
OnClick = OkButtonClick
TabOrder = 0
end
object CancelButton: TButton
Left = 294
Height = 29
Top = 264
Width = 98
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = 'CancelButton'
ModalResult = 2
TabOrder = 1
end
object MainNotebook: TNotebook object MainNotebook: TNotebook
Height = 248 Height = 292
Width = 400 Width = 321
Align = alTop Align = alClient
Anchors = [akTop, akLeft, akRight, akBottom]
PageIndex = 0 PageIndex = 0
TabOrder = 2 TabOrder = 0
object UpdatePage: TPage object UpdatePage: TPage
Caption = 'UpdatePage' Caption = 'UpdatePage'
ClientWidth = 396 ClientWidth = 317
ClientHeight = 217 ClientHeight = 261
object RefreshRadioGroup: TRadioGroup object RefreshRadioGroup: TRadioGroup
Left = 6 Left = 6
Height = 141 Height = 144
Top = 6 Top = 55
Width = 384 Width = 305
Align = alTop Align = alTop
AutoFill = True AutoFill = True
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -66,8 +40,8 @@ object CodeExplorerDlg: TCodeExplorerDlg
ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1 ChildSizing.ControlsPerLine = 1
ClientHeight = 122 ClientHeight = 125
ClientWidth = 380 ClientWidth = 301
Items.Strings = ( Items.Strings = (
'Manual' 'Manual'
'SwitchPage' 'SwitchPage'
@ -76,17 +50,89 @@ object CodeExplorerDlg: TCodeExplorerDlg
TabOrder = 0 TabOrder = 0
end end
object FollowCursorCheckBox: TCheckBox object FollowCursorCheckBox: TCheckBox
Left = 6 AnchorSideTop.Control = RefreshRadioGroup
Height = 22 AnchorSideTop.Side = asrBottom
Top = 165 Left = 4
Width = 384 Height = 19
Align = alTop Top = 217
Width = 188
Align = alCustom
AutoSize = False
BorderSpacing.Top = 12 BorderSpacing.Top = 12
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'FollowCursorCheckBox' Caption = 'FollowCursorCheckBox'
TabOrder = 1 TabOrder = 1
Visible = False Visible = False
end end
object ModeRadioGroup: TRadioGroup
Left = 6
Height = 43
Top = 6
Width = 305
Align = alTop
AutoFill = True
BorderSpacing.Around = 6
Caption = 'ModeRadioGroup'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 2
ClientHeight = 24
ClientWidth = 301
Columns = 2
ItemIndex = 0
Items.Strings = (
'Category'
'Source'
)
TabOrder = 2
end
end
end
object ButtonPanel: TPanel
Height = 48
Top = 292
Width = 321
Align = alBottom
AutoSize = True
BevelOuter = bvNone
ClientHeight = 48
ClientWidth = 321
TabOrder = 1
object OkButton: TBitBtn
Left = 174
Height = 36
Top = 6
Width = 57
Align = alRight
AutoSize = True
BorderSpacing.Around = 6
Caption = '&OK'
Default = True
Kind = bkOK
ModalResult = 1
NumGlyphs = 0
OnClick = OkButtonClick
TabOrder = 0
end
object CancelButton: TBitBtn
Left = 237
Height = 36
Top = 6
Width = 78
Align = alRight
AutoSize = True
BorderSpacing.Around = 6
Cancel = True
Caption = 'Cancel'
Kind = bkCancel
ModalResult = 2
NumGlyphs = 0
TabOrder = 1
end end
end end
end end

View File

@ -1,34 +1,47 @@
{ This is an automatically generated lazarus resource file } { This is an automatically generated lazarus resource file }
LazarusResources.Add('TCodeExplorerDlg','FORMDATA',[ LazarusResources.Add('TCodeExplorerDlg','FORMDATA',[
'TPF0'#16'TCodeExplorerDlg'#15'CodeExplorerDlg'#4'Left'#3#23#1#6'Height'#3',' 'TPF0'#16'TCodeExplorerDlg'#15'CodeExplorerDlg'#4'Left'#3'z'#1#6'Height'#3'T'
+#1#3'Top'#3#167#0#5'Width'#3#144#1#18'HorzScrollBar.Page'#3#143#1#18'VertScr' +#1#3'Top'#3#170#0#5'Width'#3'A'#1#18'HorzScrollBar.Page'#3'@'#1#18'VertScrol'
+'ollBar.Page'#3'+'#1#13'ActiveControl'#7#10'UpdatePage'#11'BorderStyle'#7#13 +'lBar.Page'#3'S'#1#13'ActiveControl'#7#12'MainNotebook'#11'BorderStyle'#7#13
+'bsSizeToolWin'#7'Caption'#6#15'CodeExplorerDlg'#12'ClientHeight'#3','#1#11 +'bsSizeToolWin'#7'Caption'#6#15'CodeExplorerDlg'#12'ClientHeight'#3'T'#1#11
+'ClientWidth'#3#144#1#8'OnCreate'#7#21'CodeExplorerDlgCreate'#9'OnDestroy'#7 +'ClientWidth'#3'A'#1#8'OnCreate'#7#21'CodeExplorerDlgCreate'#9'OnDestroy'#7
+#22'CodeExplorerDlgDestroy'#8'Position'#7#14'poScreenCenter'#0#7'TButton'#8 +#22'CodeExplorerDlgDestroy'#8'Position'#7#14'poScreenCenter'#0#9'TNotebook'
+'OkButton'#23'AnchorSideRight.Control'#7#12'CancelButton'#4'Left'#3#216#0#6 +#12'MainNotebook'#6'Height'#3'$'#1#5'Width'#3'A'#1#5'Align'#7#8'alClient'#9
+'Height'#2#29#3'Top'#3#8#1#5'Width'#2'H'#7'Anchors'#11#7'akRight'#8'akBottom' +'PageIndex'#2#0#8'TabOrder'#2#0#0#5'TPage'#10'UpdatePage'#7'Caption'#6#10'Up'
+#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#8'OkButton'#7'OnC' +'datePage'#11'ClientWidth'#3'='#1#12'ClientHeight'#3#5#1#0#11'TRadioGroup'#17
+'lick'#7#13'OkButtonClick'#8'TabOrder'#2#0#0#0#7'TButton'#12'CancelButton'#4 +'RefreshRadioGroup'#4'Left'#2#6#6'Height'#3#144#0#3'Top'#2'7'#5'Width'#3'1'#1
+'Left'#3'&'#1#6'Height'#2#29#3'Top'#3#8#1#5'Width'#2'b'#7'Anchors'#11#7'akRi' +#5'Align'#7#5'alTop'#8'AutoFill'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6
+'ght'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6 +#17'RefreshRadioGroup'#28'ChildSizing.LeftRightSpacing'#2#6#28'ChildSizing.T'
+#12'CancelButton'#11'ModalResult'#2#2#8'TabOrder'#2#1#0#0#9'TNotebook'#12'Ma' +'opBottomSpacing'#2#6#29'ChildSizing.EnlargeHorizontal'#7#24'crsHomogenousCh'
+'inNotebook'#6'Height'#3#248#0#5'Width'#3#144#1#5'Align'#7#5'alTop'#7'Anchor' +'ildResize'#27'ChildSizing.EnlargeVertical'#7#24'crsHomogenousChildResize'#28
+'s'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#9'PageIndex'#2#0#8'TabOrd' +'ChildSizing.ShrinkHorizontal'#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVer'
+'er'#2#2#0#5'TPage'#10'UpdatePage'#7'Caption'#6#10'UpdatePage'#11'ClientWidt' +'tical'#7#14'crsScaleChilds'#18'ChildSizing.Layout'#7#29'cclLeftToRightThenT'
+'h'#3#140#1#12'ClientHeight'#3#217#0#0#11'TRadioGroup'#17'RefreshRadioGroup' +'opToBottom'#27'ChildSizing.ControlsPerLine'#2#1#12'ClientHeight'#2'}'#11'Cl'
+#4'Left'#2#6#6'Height'#3#141#0#3'Top'#2#6#5'Width'#3#128#1#5'Align'#7#5'alTo' +'ientWidth'#3'-'#1#13'Items.Strings'#1#6#6'Manual'#6#10'SwitchPage'#6#4'Idle'
+'p'#8'AutoFill'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#17'RefreshRadioG' +#0#8'TabOrder'#2#0#0#0#9'TCheckBox'#20'FollowCursorCheckBox'#21'AnchorSideTo'
+'roup'#28'ChildSizing.LeftRightSpacing'#2#6#28'ChildSizing.TopBottomSpacing' +'p.Control'#7#17'RefreshRadioGroup'#18'AnchorSideTop.Side'#7#9'asrBottom'#4
+#2#6#29'ChildSizing.EnlargeHorizontal'#7#24'crsHomogenousChildResize'#27'Chi' +'Left'#2#4#6'Height'#2#19#3'Top'#3#217#0#5'Width'#3#188#0#5'Align'#7#8'alCus'
+'ldSizing.EnlargeVertical'#7#24'crsHomogenousChildResize'#28'ChildSizing.Shr' +'tom'#8'AutoSize'#8#17'BorderSpacing.Top'#2#12#20'BorderSpacing.Around'#2#6#7
+'inkHorizontal'#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crs' +'Caption'#6#20'FollowCursorCheckBox'#8'TabOrder'#2#1#7'Visible'#8#0#0#11'TRa'
+'ScaleChilds'#18'ChildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27 +'dioGroup'#14'ModeRadioGroup'#4'Left'#2#6#6'Height'#2'+'#3'Top'#2#6#5'Width'
+'ChildSizing.ControlsPerLine'#2#1#12'ClientHeight'#2'z'#11'ClientWidth'#3'|' +#3'1'#1#5'Align'#7#5'alTop'#8'AutoFill'#9#20'BorderSpacing.Around'#2#6#7'Cap'
+#1#13'Items.Strings'#1#6#6'Manual'#6#10'SwitchPage'#6#4'Idle'#0#8'TabOrder'#2 +'tion'#6#14'ModeRadioGroup'#28'ChildSizing.LeftRightSpacing'#2#6#28'ChildSiz'
+#0#0#0#9'TCheckBox'#20'FollowCursorCheckBox'#4'Left'#2#6#6'Height'#2#22#3'To' +'ing.TopBottomSpacing'#2#6#29'ChildSizing.EnlargeHorizontal'#7#24'crsHomogen'
+'p'#3#165#0#5'Width'#3#128#1#5'Align'#7#5'alTop'#17'BorderSpacing.Top'#2#12 +'ousChildResize'#27'ChildSizing.EnlargeVertical'#7#24'crsHomogenousChildResi'
+#20'BorderSpacing.Around'#2#6#7'Caption'#6#20'FollowCursorCheckBox'#8'TabOrd' +'ze'#28'ChildSizing.ShrinkHorizontal'#7#14'crsScaleChilds'#26'ChildSizing.Sh'
+'er'#2#1#7'Visible'#8#0#0#0#0#0 +'rinkVertical'#7#14'crsScaleChilds'#18'ChildSizing.Layout'#7#29'cclLeftToRig'
+'htThenTopToBottom'#27'ChildSizing.ControlsPerLine'#2#2#12'ClientHeight'#2#24
+#11'ClientWidth'#3'-'#1#7'Columns'#2#2#9'ItemIndex'#2#0#13'Items.Strings'#1#6
+#8'Category'#6#6'Source'#0#8'TabOrder'#2#2#0#0#0#0#6'TPanel'#11'ButtonPanel'
+#6'Height'#2'0'#3'Top'#3'$'#1#5'Width'#3'A'#1#5'Align'#7#8'alBottom'#8'AutoS'
+'ize'#9#10'BevelOuter'#7#6'bvNone'#12'ClientHeight'#2'0'#11'ClientWidth'#3'A'
+#1#8'TabOrder'#2#1#0#7'TBitBtn'#8'OkButton'#4'Left'#3#174#0#6'Height'#2'$'#3
+'Top'#2#6#5'Width'#2'9'#5'Align'#7#7'alRight'#8'AutoSize'#9#20'BorderSpacing'
+'.Around'#2#6#7'Caption'#6#3'&OK'#7'Default'#9#4'Kind'#7#4'bkOK'#11'ModalRes'
+'ult'#2#1#9'NumGlyphs'#2#0#7'OnClick'#7#13'OkButtonClick'#8'TabOrder'#2#0#0#0
+#7'TBitBtn'#12'CancelButton'#4'Left'#3#237#0#6'Height'#2'$'#3'Top'#2#6#5'Wid'
+'th'#2'N'#5'Align'#7#7'alRight'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#6
+'Cancel'#9#7'Caption'#6#6'Cancel'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2#9
+'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#0#0
]); ]);

View File

@ -46,10 +46,16 @@ type
cerSwitchEditorPage,// everytime the source editor switches to another page cerSwitchEditorPage,// everytime the source editor switches to another page
cerOnIdle // on idle cerOnIdle // on idle
); );
TCodeExplorerMode = (
cemCategory, // Category - Delphi like
cemSource // Follows Source Code
);
TCodeExplorerOptions = class(TPersistent) TCodeExplorerOptions = class(TPersistent)
private private
FFollowCursor: boolean; FFollowCursor: boolean;
FMode : TCodeExplorerMode;
FOptionsFilename: string; FOptionsFilename: string;
FRefresh: TCodeExplorerRefresh; FRefresh: TCodeExplorerRefresh;
public public
@ -63,6 +69,7 @@ type
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string); procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
public public
property Refresh: TCodeExplorerRefresh read FRefresh write FRefresh; property Refresh: TCodeExplorerRefresh read FRefresh write FRefresh;
property Mode: TCodeExplorerMode read FMode write FMode;
property OptionsFilename: string read FOptionsFilename write FOptionsFilename; property OptionsFilename: string read FOptionsFilename write FOptionsFilename;
property FollowCursor: boolean read FFollowCursor write FFollowCursor; property FollowCursor: boolean read FFollowCursor write FFollowCursor;
end; end;
@ -70,10 +77,12 @@ type
{ TCodeExplorerDlg } { TCodeExplorerDlg }
TCodeExplorerDlg = class(TForm) TCodeExplorerDlg = class(TForm)
CancelButton: TBitBtn;
FollowCursorCheckBox: TCheckBox; FollowCursorCheckBox: TCheckBox;
MainNotebook: TNotebook; MainNotebook: TNotebook;
OkButton: TButton; ModeRadioGroup: TRadioGroup;
CancelButton: TButton; OkButton: TBitBtn;
ButtonPanel: TPanel;
RefreshRadioGroup: TRadioGroup; RefreshRadioGroup: TRadioGroup;
UpdatePage: TPage; UpdatePage: TPage;
procedure CodeExplorerDlgCreate(Sender: TObject); procedure CodeExplorerDlgCreate(Sender: TObject);
@ -98,13 +107,16 @@ const
'SwitchEditorPage', 'SwitchEditorPage',
'OnIdle' 'OnIdle'
); );
CodeExplorerModeNames: array[TCodeExplorerMode] of string = (
'Category',
'Source'
);
var var
CodeExplorerOptions: TCodeExplorerOptions;// set by the IDE CodeExplorerOptions: TCodeExplorerOptions;// set by the IDE
function CodeExplorerRefreshNameToEnum(const s: string): TCodeExplorerRefresh; function CodeExplorerRefreshNameToEnum(const s: string): TCodeExplorerRefresh;
function CodeExplorerModeNameToEnum(const s: string): TCodeExplorerMode;
function ShowCodeExplorerOptions: TModalResult; function ShowCodeExplorerOptions: TModalResult;
@ -117,6 +129,13 @@ begin
Result:=cerDefault; Result:=cerDefault;
end; end;
function CodeExplorerModeNameToEnum(const s: string): TCodeExplorerMode;
begin
for Result:=Low(TCodeExplorerMode) to High(TCodeExplorerMode) do
if CompareText(CodeExplorerModeNames[Result],s)=0 then exit;
Result:=cemCategory;
end;
function ShowCodeExplorerOptions: TModalResult; function ShowCodeExplorerOptions: TModalResult;
var var
CodeExplorerDlg: TCodeExplorerDlg; CodeExplorerDlg: TCodeExplorerDlg;
@ -148,6 +167,7 @@ end;
procedure TCodeExplorerOptions.Clear; procedure TCodeExplorerOptions.Clear;
begin begin
FMode:=cemCategory;
FRefresh:=cerDefault; FRefresh:=cerDefault;
FFollowCursor:=true; FFollowCursor:=true;
end; end;
@ -159,6 +179,7 @@ begin
if Source is TCodeExplorerOptions then begin if Source is TCodeExplorerOptions then begin
Src:=TCodeExplorerOptions(Source); Src:=TCodeExplorerOptions(Source);
FRefresh:=Src.Refresh; FRefresh:=Src.Refresh;
FMode:=Src.Mode;
FFollowCursor:=Src.FollowCursor; FFollowCursor:=Src.FollowCursor;
end else end else
inherited Assign(Source); inherited Assign(Source);
@ -210,6 +231,8 @@ begin
Clear; Clear;
FRefresh:=CodeExplorerRefreshNameToEnum( FRefresh:=CodeExplorerRefreshNameToEnum(
XMLConfig.GetValue(Path+'Refresh/Value','')); XMLConfig.GetValue(Path+'Refresh/Value',''));
FMode:=CodeExplorerModeNameToEnum(
XMLConfig.GetValue(Path+'Mode/Value',''));
FFollowCursor:=XMLConfig.GetValue(Path+'FollowCursor',true); FFollowCursor:=XMLConfig.GetValue(Path+'FollowCursor',true);
end; end;
@ -219,6 +242,9 @@ begin
XMLConfig.SetDeleteValue(Path+'Refresh/Value', XMLConfig.SetDeleteValue(Path+'Refresh/Value',
CodeExplorerRefreshNames[FRefresh], CodeExplorerRefreshNames[FRefresh],
CodeExplorerRefreshNames[cerDefault]); CodeExplorerRefreshNames[cerDefault]);
XMLConfig.SetDeleteValue(Path+'Mode/Value',
CodeExplorerModeNames[FMode],
CodeExplorerModeNames[cemCategory]);
XMLConfig.SetDeleteValue(Path+'FollowCursor',FFollowCursor,true); XMLConfig.SetDeleteValue(Path+'FollowCursor',FFollowCursor,true);
end; end;
@ -246,6 +272,14 @@ begin
else else
RefreshRadioGroup.ItemIndex:=1; RefreshRadioGroup.ItemIndex:=1;
end; end;
case Options.Mode of
cemCategory: ModeRadioGroup.ItemIndex:=0;
cemSource: ModeRadioGroup.ItemIndex:=1;
else
ModeRadioGroup.ItemIndex:=0;
end;
FollowCursorCheckBox.Checked:=Options.FollowCursor; FollowCursorCheckBox.Checked:=Options.FollowCursor;
end; end;
@ -256,6 +290,12 @@ begin
1: FOptions.Refresh:=cerSwitchEditorPage; 1: FOptions.Refresh:=cerSwitchEditorPage;
2: FOptions.Refresh:=cerOnIdle; 2: FOptions.Refresh:=cerOnIdle;
end; end;
case ModeRadioGroup.ItemIndex of
0: FOptions.Mode:=cemCategory;
1: FOptions.Mode:=cemSource;
end;
Options.FollowCursor:=FollowCursorCheckBox.Checked; Options.FollowCursor:=FollowCursorCheckBox.Checked;
end; end;
@ -272,6 +312,11 @@ begin
Items[1]:=lisCEOWhenSwitchingFile; Items[1]:=lisCEOWhenSwitchingFile;
Items[2]:=lisCEOOnIdle; Items[2]:=lisCEOOnIdle;
end; end;
ModeRadioGroup.Caption:=lisCEOMode;
with ModeRadioGroup do begin
Items[0]:=lisCEOModeCategory;
Items[1]:=lisCEOModeSource;
end;
FollowCursorCheckBox.Caption:=lisCEFollowCursor; FollowCursorCheckBox.Caption:=lisCEFollowCursor;
end; end;

View File

@ -56,7 +56,7 @@ object CodeExplorerView: TCodeExplorerView
ClientWidth = 207 ClientWidth = 207
TabOrder = 1 TabOrder = 1
object OptionsSpeedButton: TSpeedButton object OptionsSpeedButton: TSpeedButton
Left = 182 Left = 180
Height = 22 Height = 22
Hint = 'Options for CodeExplorer' Hint = 'Options for CodeExplorer'
Top = 1 Top = 1
@ -105,7 +105,7 @@ object CodeExplorerView: TCodeExplorerView
ParentShowHint = False ParentShowHint = False
end end
object RefreshSpeedButton: TSpeedButton object RefreshSpeedButton: TSpeedButton
Left = 159 Left = 132
Height = 22 Height = 22
Hint = 'Refresh CodeExplorer' Hint = 'Refresh CodeExplorer'
Top = 1 Top = 1
@ -153,13 +153,25 @@ object CodeExplorerView: TCodeExplorerView
ShowHint = True ShowHint = True
ParentShowHint = False ParentShowHint = False
end end
object ModeSpeedButton: TSpeedButton
Left = 156
Height = 22
Top = 1
Width = 23
Anchors = [akTop, akRight]
Color = clBtnFace
NumGlyphs = 0
OnClick = ModeSpeedButtonClick
ShowHint = True
ParentShowHint = False
end
object CodeFilterEdit: TEdit object CodeFilterEdit: TEdit
AnchorSideLeft.Control = CodePage AnchorSideLeft.Control = CodePage
AnchorSideTop.Control = CodePage AnchorSideTop.Control = CodePage
AnchorSideRight.Control = CodePage AnchorSideRight.Control = CodePage
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Height = 23 Height = 23
Width = 157 Width = 130
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
AutoSelect = True AutoSelect = True
OnChange = CodeFilterEditChange OnChange = CodeFilterEditChange

View File

@ -23,7 +23,7 @@ LazarusResources.Add('TCodeExplorerView','FORMDATA',[
+'ckExpand'#0#0#0#6'TPanel'#23'CodeTreeviewButtonPanel'#6'Height'#2#25#5'Widt' +'ckExpand'#0#0#0#6'TPanel'#23'CodeTreeviewButtonPanel'#6'Height'#2#25#5'Widt'
+'h'#3#207#0#5'Align'#7#5'alTop'#10'BevelOuter'#7#6'bvNone'#12'ClientHeight'#2 +'h'#3#207#0#5'Align'#7#5'alTop'#10'BevelOuter'#7#6'bvNone'#12'ClientHeight'#2
+#25#11'ClientWidth'#3#207#0#8'TabOrder'#2#1#0#12'TSpeedButton'#18'OptionsSpe' +#25#11'ClientWidth'#3#207#0#8'TabOrder'#2#1#0#12'TSpeedButton'#18'OptionsSpe'
+'edButton'#4'Left'#3#182#0#6'Height'#2#22#4'Hint'#6#24'Options for CodeExplo' +'edButton'#4'Left'#3#180#0#6'Height'#2#22#4'Hint'#6#24'Options for CodeExplo'
+'rer'#3'Top'#2#1#5'Width'#2#23#7'Anchors'#11#5'akTop'#7'akRight'#0#5'Color'#7 +'rer'#3'Top'#2#1#5'Width'#2#23#7'Anchors'#11#5'akTop'#7'akRight'#0#5'Color'#7
+#9'clBtnFace'#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0 +#9'clBtnFace'#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0
+'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0 +'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0
@ -76,7 +76,7 @@ LazarusResources.Add('TCodeExplorerView','FORMDATA',[
+#255#255#255#0#0#0#0#28#0#0#0'3'#0#0#0'6'#0#0#0'6'#0#0#0'6'#0#0#0'6'#0#0#0'6' +#255#255#255#0#0#0#0#28#0#0#0'3'#0#0#0'6'#0#0#0'6'#0#0#0'6'#0#0#0'6'#0#0#0'6'
+#0#0#0'6'#0#0#0'6'#0#0#0'6'#0#0#0' '#0#0#0#2#255#255#255#0#255#255#255#0#9'N' +#0#0#0'6'#0#0#0'6'#0#0#0'6'#0#0#0' '#0#0#0#2#255#255#255#0#255#255#255#0#9'N'
+'umGlyphs'#2#0#7'OnClick'#7#23'OptionsSpeedButtonClick'#8'ShowHint'#9#14'Par' +'umGlyphs'#2#0#7'OnClick'#7#23'OptionsSpeedButtonClick'#8'ShowHint'#9#14'Par'
+'entShowHint'#8#0#0#12'TSpeedButton'#18'RefreshSpeedButton'#4'Left'#3#159#0#6 +'entShowHint'#8#0#0#12'TSpeedButton'#18'RefreshSpeedButton'#4'Left'#3#132#0#6
+'Height'#2#22#4'Hint'#6#20'Refresh CodeExplorer'#3'Top'#2#1#5'Width'#2#23#7 +'Height'#2#22#4'Hint'#6#20'Refresh CodeExplorer'#3'Top'#2#1#5'Width'#2#23#7
+'Anchors'#11#5'akTop'#7'akRight'#0#5'Color'#7#9'clBtnFace'#10'Glyph.Data'#10 +'Anchors'#11#5'akTop'#7'akRight'#0#5'Color'#7#9'clBtnFace'#10'Glyph.Data'#10
+':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0 +':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0
@ -126,26 +126,29 @@ LazarusResources.Add('TCodeExplorerView','FORMDATA',[
+#164'e4'#29#167'i:'#159#167'j:'#222#165'g6'#246#167'i9'#229#167'j:'#188#164 +#164'e4'#29#167'i:'#159#167'j:'#222#165'g6'#246#167'i9'#229#167'j:'#188#164
+'e4S'#164'e4'#5#255#255#255#0#255#255#255#0#255#255#255#0#164'e4y'#164'e4'#16 +'e4S'#164'e4'#5#255#255#255#0#255#255#255#0#255#255#255#0#164'e4y'#164'e4'#16
+#9'NumGlyphs'#2#0#7'OnClick'#7#23'RefreshSpeedButtonClick'#8'ShowHint'#9#14 +#9'NumGlyphs'#2#0#7'OnClick'#7#23'RefreshSpeedButtonClick'#8'ShowHint'#9#14
+'ParentShowHint'#8#0#0#5'TEdit'#14'CodeFilterEdit'#22'AnchorSideLeft.Control' +'ParentShowHint'#8#0#0#12'TSpeedButton'#15'ModeSpeedButton'#4'Left'#3#156#0#6
+#7#8'CodePage'#21'AnchorSideTop.Control'#7#8'CodePage'#23'AnchorSideRight.Co' +'Height'#2#22#3'Top'#2#1#5'Width'#2#23#7'Anchors'#11#5'akTop'#7'akRight'#0#5
+'ntrol'#7#8'CodePage'#20'AnchorSideRight.Side'#7#9'asrBottom'#6'Height'#2#23 +'Color'#7#9'clBtnFace'#9'NumGlyphs'#2#0#7'OnClick'#7#20'ModeSpeedButtonClick'
,#5'Width'#3#157#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#10'AutoSelec' ,#8'ShowHint'#9#14'ParentShowHint'#8#0#0#5'TEdit'#14'CodeFilterEdit'#22'Ancho'
+'t'#9#8'OnChange'#7#20'CodeFilterEditChange'#8'TabOrder'#2#0#4'Text'#6#14'Co' +'rSideLeft.Control'#7#8'CodePage'#21'AnchorSideTop.Control'#7#8'CodePage'#23
+'deFilterEdit'#0#0#0#0#5'TPage'#14'DirectivesPage'#7'Caption'#6#14'Directive' +'AnchorSideRight.Control'#7#8'CodePage'#20'AnchorSideRight.Side'#7#9'asrBott'
+'sPage'#11'ClientWidth'#3#211#0#12'ClientHeight'#3#191#1#0#5'TEdit'#20'Direc' +'om'#6'Height'#2#23#5'Width'#3#130#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRi'
+'tivesFilterEdit'#22'AnchorSideLeft.Control'#7#14'DirectivesPage'#21'AnchorS' +'ght'#0#10'AutoSelect'#9#8'OnChange'#7#20'CodeFilterEditChange'#8'TabOrder'#2
+'ideTop.Control'#7#14'DirectivesPage'#23'AnchorSideRight.Control'#7#14'Direc' +#0#4'Text'#6#14'CodeFilterEdit'#0#0#0#0#5'TPage'#14'DirectivesPage'#7'Captio'
+'tivesPage'#20'AnchorSideRight.Side'#7#9'asrBottom'#6'Height'#2#23#5'Width'#3 +'n'#6#14'DirectivesPage'#11'ClientWidth'#3#211#0#12'ClientHeight'#3#191#1#0#5
+#211#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'OnChange'#7#26'Direct' +'TEdit'#20'DirectivesFilterEdit'#22'AnchorSideLeft.Control'#7#14'DirectivesP'
+'ivesFilterEditChange'#8'TabOrder'#2#0#4'Text'#6#20'DirectivesFilterEdit'#0#0 +'age'#21'AnchorSideTop.Control'#7#14'DirectivesPage'#23'AnchorSideRight.Cont'
+#9'TTreeView'#18'DirectivesTreeView'#21'AnchorSideTop.Control'#7#20'Directiv' +'rol'#7#14'DirectivesPage'#20'AnchorSideRight.Side'#7#9'asrBottom'#6'Height'
+'esFilterEdit'#18'AnchorSideTop.Side'#7#9'asrBottom'#6'Height'#3#167#1#3'Top' +#2#23#5'Width'#3#211#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'OnCha'
+#2#24#5'Width'#3#211#0#5'Align'#7#8'alBottom'#7'Anchors'#11#5'akTop'#6'akLef' +'nge'#7#26'DirectivesFilterEditChange'#8'TabOrder'#2#0#4'Text'#6#20'Directiv'
+'t'#7'akRight'#8'akBottom'#0#17'BorderSpacing.Top'#2#1#17'DefaultItemHeight' +'esFilterEdit'#0#0#9'TTreeView'#18'DirectivesTreeView'#21'AnchorSideTop.Cont'
+#2#19#9'PopupMenu'#7#13'TreePopupmenu'#8'TabOrder'#2#1#10'OnDblClick'#7#26'D' +'rol'#7#20'DirectivesFilterEdit'#18'AnchorSideTop.Side'#7#9'asrBottom'#6'Hei'
+'irectivesTreeViewDblClick'#10'OnDeletion'#7#26'DirectivesTreeViewDeletion'#7 +'ght'#3#167#1#3'Top'#2#24#5'Width'#3#211#0#5'Align'#7#8'alBottom'#7'Anchors'
+'OnKeyUp'#7#23'DirectivesTreeViewKeyUp'#0#0#0#0#10'TImageList'#10'Imagelist1' +#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#17'BorderSpacing.Top'#2#1#17
+#4'left'#2'@'#3'top'#2' '#0#0#10'TPopupMenu'#13'TreePopupmenu'#4'left'#2'@'#3 +'DefaultItemHeight'#2#19#9'PopupMenu'#7#13'TreePopupmenu'#8'TabOrder'#2#1#10
+'top'#2'H'#0#9'TMenuItem'#9'MenuItem1'#7'Caption'#6#9'New Item1'#7'Visible'#8 +'OnDblClick'#7#26'DirectivesTreeViewDblClick'#10'OnDeletion'#7#26'Directives'
+#0#0#0#0 +'TreeViewDeletion'#7'OnKeyUp'#7#23'DirectivesTreeViewKeyUp'#0#0#0#0#10'TImag'
+'eList'#10'Imagelist1'#4'left'#2'@'#3'top'#2' '#0#0#10'TPopupMenu'#13'TreePo'
+'pupmenu'#4'left'#2'@'#3'top'#2'H'#0#9'TMenuItem'#9'MenuItem1'#7'Caption'#6#9
+'New Item1'#7'Visible'#8#0#0#0#0
]); ]);

View File

@ -88,6 +88,7 @@ type
CodeTreeviewButtonPanel: TPanel; CodeTreeviewButtonPanel: TPanel;
OptionsSpeedButton: TSpeedButton; OptionsSpeedButton: TSpeedButton;
RefreshSpeedButton: TSpeedButton; RefreshSpeedButton: TSpeedButton;
ModeSpeedButton: TSpeedButton;
TreePopupmenu: TPopupMenu; TreePopupmenu: TPopupMenu;
procedure CodeExplorerViewClose(Sender: TObject; procedure CodeExplorerViewClose(Sender: TObject;
var CloseAction: TCloseAction); var CloseAction: TCloseAction);
@ -106,6 +107,7 @@ type
Shift: TShiftState); Shift: TShiftState);
procedure JumpToMenuitemClick(Sender: TObject); procedure JumpToMenuitemClick(Sender: TObject);
procedure MainNotebookPageChanged(Sender: TObject); procedure MainNotebookPageChanged(Sender: TObject);
procedure ModeSpeedButtonClick(Sender: TObject);
procedure OptionsSpeedButtonClick(Sender: TObject); procedure OptionsSpeedButtonClick(Sender: TObject);
procedure RefreshMenuitemClick(Sender: TObject); procedure RefreshMenuitemClick(Sender: TObject);
procedure OnApplicationIdle(Sender: TObject; var Done: Boolean); procedure OnApplicationIdle(Sender: TObject; var Done: Boolean);
@ -118,6 +120,7 @@ type
FLastCodeChangeStep: integer; FLastCodeChangeStep: integer;
FLastDirectivesFilter: string; FLastDirectivesFilter: string;
FLastDirectivesChangeStep: integer; FLastDirectivesChangeStep: integer;
FMode : TCodeExplorerMode;
FOnGetCodeTree: TOnGetCodeTree; FOnGetCodeTree: TOnGetCodeTree;
FOnGetDirectivesTree: TOnGetDirectivesTree; FOnGetDirectivesTree: TOnGetDirectivesTree;
FOnJumpToCode: TOnJumpToCode; FOnJumpToCode: TOnJumpToCode;
@ -159,6 +162,7 @@ type
procedure SetCodeFilter(const AValue: string); procedure SetCodeFilter(const AValue: string);
procedure SetCurrentPage(const AValue: TCodeExplorerPage); procedure SetCurrentPage(const AValue: TCodeExplorerPage);
procedure SetDirectivesFilter(const AValue: string); procedure SetDirectivesFilter(const AValue: string);
procedure SetMode(AMode: TCodeExplorerMode);
protected protected
procedure KeyUp(var Key: Word; Shift: TShiftState); override; procedure KeyUp(var Key: Word; Shift: TShiftState); override;
procedure ApplyCodeFilter; procedure ApplyCodeFilter;
@ -186,6 +190,7 @@ type
property OnGetDirectivesTree: TOnGetDirectivesTree read FOnGetDirectivesTree property OnGetDirectivesTree: TOnGetDirectivesTree read FOnGetDirectivesTree
write FOnGetDirectivesTree; write FOnGetDirectivesTree;
property OnJumpToCode: TOnJumpToCode read FOnJumpToCode write FOnJumpToCode; property OnJumpToCode: TOnJumpToCode read FOnJumpToCode write FOnJumpToCode;
property Mode: TCodeExplorerMode read FMode write FMode;
property CodeFilename: string read FCodeFilename; property CodeFilename: string read FCodeFilename;
property CodeFilter: string read GetCodeFilter write SetCodeFilter; property CodeFilter: string read GetCodeFilter write SetCodeFilter;
property DirectivesFilename: string read FDirectivesFilename; property DirectivesFilename: string read FDirectivesFilename;
@ -283,6 +288,8 @@ procedure TCodeExplorerView.CodeExplorerViewCREATE(Sender: TObject);
begin begin
LoadCodeExplorerOptions; LoadCodeExplorerOptions;
SetMode(CodeExplorerOptions.Mode);
Name:=NonModalIDEWindowNames[nmiwCodeExplorerName]; Name:=NonModalIDEWindowNames[nmiwCodeExplorerName];
Caption := lisMenuViewCodeExplorer; Caption := lisMenuViewCodeExplorer;
EnvironmentOptions.IDEWindowLayoutList.Apply(Self,Name); EnvironmentOptions.IDEWindowLayoutList.Apply(Self,Name);
@ -399,6 +406,14 @@ begin
Refresh(true); Refresh(true);
end; end;
procedure TCodeExplorerView.ModeSpeedButtonClick(Sender: TObject);
begin
// Let's Invert Mode of Exibition
if Mode = cemCategory then
SetMode(cemSource)
else SetMode(cemCategory);
end;
procedure TCodeExplorerView.OptionsSpeedButtonClick(Sender: TObject); procedure TCodeExplorerView.OptionsSpeedButtonClick(Sender: TObject);
begin begin
if ShowCodeExplorerOptions=mrOk then if ShowCodeExplorerOptions=mrOk then
@ -679,6 +694,22 @@ begin
DirectivesFilterChanged; DirectivesFilterChanged;
end; end;
procedure TCodeExplorerView.SetMode(AMode: TCodeExplorerMode);
begin
FMode:=AMode;
case FMode of
cemCategory :
begin
ModeSpeedButton.Caption:='C'; // To-Do: Change it to use image instead of 'C'.
ModeSpeedButton.Hint:= lisCEModeShowSourceNodes;
end;
cemSource :
begin
ModeSpeedButton.Caption:='S'; // To-Do: Change it to use image instead of 'S'.
ModeSpeedButton.Hint:= lisCEModeShowCategories;
end;
end;
end;
procedure TCodeExplorerView.KeyUp(var Key: Word; Shift: TShiftState); procedure TCodeExplorerView.KeyUp(var Key: Word; Shift: TShiftState);
begin begin
inherited KeyUp(Key, Shift); inherited KeyUp(Key, Shift);

View File

@ -3407,6 +3407,8 @@ resourcestring
lisNewClass = 'New Class'; lisNewClass = 'New Class';
lisOldAncestors = 'Old Ancestors'; lisOldAncestors = 'Old Ancestors';
lisNewAncestors = 'New Ancestors'; lisNewAncestors = 'New Ancestors';
lisCEModeShowCategories = 'Show Categories';
lisCEModeShowSourceNodes = 'Show Source Nodes';
lisCEOCodeExplorer = 'CodeExplorer Options'; lisCEOCodeExplorer = 'CodeExplorer Options';
lisCEOUpdate = 'Update'; lisCEOUpdate = 'Update';
lisCEORefreshAutomatically = 'Refresh automatically'; lisCEORefreshAutomatically = 'Refresh automatically';
@ -3414,6 +3416,9 @@ resourcestring
lisCEOWhenSwitchingFile = 'When switching file in source editor'; lisCEOWhenSwitchingFile = 'When switching file in source editor';
lisCEOOnIdle = 'On idle'; lisCEOOnIdle = 'On idle';
lisCEFollowCursor = 'Follow cursor'; lisCEFollowCursor = 'Follow cursor';
lisCEOMode = 'Prefered Exibition Mode';
lisCEOModeCategory = 'Category';
lisCEOModeSource = 'Source';
lisMenuLazDoc = 'LazDoc Editor'; lisMenuLazDoc = 'LazDoc Editor';
lisLazDocMainFormCaption = 'LazDoc editor'; lisLazDocMainFormCaption = 'LazDoc editor';