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
Left = 279
Height = 300
Top = 167
Width = 400
HorzScrollBar.Page = 399
VertScrollBar.Page = 299
ActiveControl = UpdatePage
Left = 378
Height = 340
Top = 170
Width = 321
HorzScrollBar.Page = 320
VertScrollBar.Page = 339
ActiveControl = MainNotebook
BorderStyle = bsSizeToolWin
Caption = 'CodeExplorerDlg'
ClientHeight = 300
ClientWidth = 400
ClientHeight = 340
ClientWidth = 321
OnCreate = CodeExplorerDlgCreate
OnDestroy = CodeExplorerDlgDestroy
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
Height = 248
Width = 400
Align = alTop
Anchors = [akTop, akLeft, akRight, akBottom]
Height = 292
Width = 321
Align = alClient
PageIndex = 0
TabOrder = 2
TabOrder = 0
object UpdatePage: TPage
Caption = 'UpdatePage'
ClientWidth = 396
ClientHeight = 217
ClientWidth = 317
ClientHeight = 261
object RefreshRadioGroup: TRadioGroup
Left = 6
Height = 141
Top = 6
Width = 384
Height = 144
Top = 55
Width = 305
Align = alTop
AutoFill = True
BorderSpacing.Around = 6
@ -66,8 +40,8 @@ object CodeExplorerDlg: TCodeExplorerDlg
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 122
ClientWidth = 380
ClientHeight = 125
ClientWidth = 301
Items.Strings = (
'Manual'
'SwitchPage'
@ -76,17 +50,89 @@ object CodeExplorerDlg: TCodeExplorerDlg
TabOrder = 0
end
object FollowCursorCheckBox: TCheckBox
Left = 6
Height = 22
Top = 165
Width = 384
Align = alTop
AnchorSideTop.Control = RefreshRadioGroup
AnchorSideTop.Side = asrBottom
Left = 4
Height = 19
Top = 217
Width = 188
Align = alCustom
AutoSize = False
BorderSpacing.Top = 12
BorderSpacing.Around = 6
Caption = 'FollowCursorCheckBox'
TabOrder = 1
Visible = False
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

View File

@ -1,34 +1,47 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TCodeExplorerDlg','FORMDATA',[
'TPF0'#16'TCodeExplorerDlg'#15'CodeExplorerDlg'#4'Left'#3#23#1#6'Height'#3','
+#1#3'Top'#3#167#0#5'Width'#3#144#1#18'HorzScrollBar.Page'#3#143#1#18'VertScr'
+'ollBar.Page'#3'+'#1#13'ActiveControl'#7#10'UpdatePage'#11'BorderStyle'#7#13
+'bsSizeToolWin'#7'Caption'#6#15'CodeExplorerDlg'#12'ClientHeight'#3','#1#11
+'ClientWidth'#3#144#1#8'OnCreate'#7#21'CodeExplorerDlgCreate'#9'OnDestroy'#7
+#22'CodeExplorerDlgDestroy'#8'Position'#7#14'poScreenCenter'#0#7'TButton'#8
+'OkButton'#23'AnchorSideRight.Control'#7#12'CancelButton'#4'Left'#3#216#0#6
+'Height'#2#29#3'Top'#3#8#1#5'Width'#2'H'#7'Anchors'#11#7'akRight'#8'akBottom'
+#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#8'OkButton'#7'OnC'
+'lick'#7#13'OkButtonClick'#8'TabOrder'#2#0#0#0#7'TButton'#12'CancelButton'#4
+'Left'#3'&'#1#6'Height'#2#29#3'Top'#3#8#1#5'Width'#2'b'#7'Anchors'#11#7'akRi'
+'ght'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6
+#12'CancelButton'#11'ModalResult'#2#2#8'TabOrder'#2#1#0#0#9'TNotebook'#12'Ma'
+'inNotebook'#6'Height'#3#248#0#5'Width'#3#144#1#5'Align'#7#5'alTop'#7'Anchor'
+'s'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#9'PageIndex'#2#0#8'TabOrd'
+'er'#2#2#0#5'TPage'#10'UpdatePage'#7'Caption'#6#10'UpdatePage'#11'ClientWidt'
+'h'#3#140#1#12'ClientHeight'#3#217#0#0#11'TRadioGroup'#17'RefreshRadioGroup'
+#4'Left'#2#6#6'Height'#3#141#0#3'Top'#2#6#5'Width'#3#128#1#5'Align'#7#5'alTo'
+'p'#8'AutoFill'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#17'RefreshRadioG'
+'roup'#28'ChildSizing.LeftRightSpacing'#2#6#28'ChildSizing.TopBottomSpacing'
+#2#6#29'ChildSizing.EnlargeHorizontal'#7#24'crsHomogenousChildResize'#27'Chi'
+'ldSizing.EnlargeVertical'#7#24'crsHomogenousChildResize'#28'ChildSizing.Shr'
+'inkHorizontal'#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crs'
+'ScaleChilds'#18'ChildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27
+'ChildSizing.ControlsPerLine'#2#1#12'ClientHeight'#2'z'#11'ClientWidth'#3'|'
+#1#13'Items.Strings'#1#6#6'Manual'#6#10'SwitchPage'#6#4'Idle'#0#8'TabOrder'#2
+#0#0#0#9'TCheckBox'#20'FollowCursorCheckBox'#4'Left'#2#6#6'Height'#2#22#3'To'
+'p'#3#165#0#5'Width'#3#128#1#5'Align'#7#5'alTop'#17'BorderSpacing.Top'#2#12
+#20'BorderSpacing.Around'#2#6#7'Caption'#6#20'FollowCursorCheckBox'#8'TabOrd'
+'er'#2#1#7'Visible'#8#0#0#0#0#0
'TPF0'#16'TCodeExplorerDlg'#15'CodeExplorerDlg'#4'Left'#3'z'#1#6'Height'#3'T'
+#1#3'Top'#3#170#0#5'Width'#3'A'#1#18'HorzScrollBar.Page'#3'@'#1#18'VertScrol'
+'lBar.Page'#3'S'#1#13'ActiveControl'#7#12'MainNotebook'#11'BorderStyle'#7#13
+'bsSizeToolWin'#7'Caption'#6#15'CodeExplorerDlg'#12'ClientHeight'#3'T'#1#11
+'ClientWidth'#3'A'#1#8'OnCreate'#7#21'CodeExplorerDlgCreate'#9'OnDestroy'#7
+#22'CodeExplorerDlgDestroy'#8'Position'#7#14'poScreenCenter'#0#9'TNotebook'
+#12'MainNotebook'#6'Height'#3'$'#1#5'Width'#3'A'#1#5'Align'#7#8'alClient'#9
+'PageIndex'#2#0#8'TabOrder'#2#0#0#5'TPage'#10'UpdatePage'#7'Caption'#6#10'Up'
+'datePage'#11'ClientWidth'#3'='#1#12'ClientHeight'#3#5#1#0#11'TRadioGroup'#17
+'RefreshRadioGroup'#4'Left'#2#6#6'Height'#3#144#0#3'Top'#2'7'#5'Width'#3'1'#1
+#5'Align'#7#5'alTop'#8'AutoFill'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6
+#17'RefreshRadioGroup'#28'ChildSizing.LeftRightSpacing'#2#6#28'ChildSizing.T'
+'opBottomSpacing'#2#6#29'ChildSizing.EnlargeHorizontal'#7#24'crsHomogenousCh'
+'ildResize'#27'ChildSizing.EnlargeVertical'#7#24'crsHomogenousChildResize'#28
+'ChildSizing.ShrinkHorizontal'#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVer'
+'tical'#7#14'crsScaleChilds'#18'ChildSizing.Layout'#7#29'cclLeftToRightThenT'
+'opToBottom'#27'ChildSizing.ControlsPerLine'#2#1#12'ClientHeight'#2'}'#11'Cl'
+'ientWidth'#3'-'#1#13'Items.Strings'#1#6#6'Manual'#6#10'SwitchPage'#6#4'Idle'
+#0#8'TabOrder'#2#0#0#0#9'TCheckBox'#20'FollowCursorCheckBox'#21'AnchorSideTo'
+'p.Control'#7#17'RefreshRadioGroup'#18'AnchorSideTop.Side'#7#9'asrBottom'#4
+'Left'#2#4#6'Height'#2#19#3'Top'#3#217#0#5'Width'#3#188#0#5'Align'#7#8'alCus'
+'tom'#8'AutoSize'#8#17'BorderSpacing.Top'#2#12#20'BorderSpacing.Around'#2#6#7
+'Caption'#6#20'FollowCursorCheckBox'#8'TabOrder'#2#1#7'Visible'#8#0#0#11'TRa'
+'dioGroup'#14'ModeRadioGroup'#4'Left'#2#6#6'Height'#2'+'#3'Top'#2#6#5'Width'
+#3'1'#1#5'Align'#7#5'alTop'#8'AutoFill'#9#20'BorderSpacing.Around'#2#6#7'Cap'
+'tion'#6#14'ModeRadioGroup'#28'ChildSizing.LeftRightSpacing'#2#6#28'ChildSiz'
+'ing.TopBottomSpacing'#2#6#29'ChildSizing.EnlargeHorizontal'#7#24'crsHomogen'
+'ousChildResize'#27'ChildSizing.EnlargeVertical'#7#24'crsHomogenousChildResi'
+'ze'#28'ChildSizing.ShrinkHorizontal'#7#14'crsScaleChilds'#26'ChildSizing.Sh'
+'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
cerOnIdle // on idle
);
TCodeExplorerMode = (
cemCategory, // Category - Delphi like
cemSource // Follows Source Code
);
TCodeExplorerOptions = class(TPersistent)
private
FFollowCursor: boolean;
FMode : TCodeExplorerMode;
FOptionsFilename: string;
FRefresh: TCodeExplorerRefresh;
public
@ -63,6 +69,7 @@ type
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
public
property Refresh: TCodeExplorerRefresh read FRefresh write FRefresh;
property Mode: TCodeExplorerMode read FMode write FMode;
property OptionsFilename: string read FOptionsFilename write FOptionsFilename;
property FollowCursor: boolean read FFollowCursor write FFollowCursor;
end;
@ -70,10 +77,12 @@ type
{ TCodeExplorerDlg }
TCodeExplorerDlg = class(TForm)
CancelButton: TBitBtn;
FollowCursorCheckBox: TCheckBox;
MainNotebook: TNotebook;
OkButton: TButton;
CancelButton: TButton;
ModeRadioGroup: TRadioGroup;
OkButton: TBitBtn;
ButtonPanel: TPanel;
RefreshRadioGroup: TRadioGroup;
UpdatePage: TPage;
procedure CodeExplorerDlgCreate(Sender: TObject);
@ -98,13 +107,16 @@ const
'SwitchEditorPage',
'OnIdle'
);
CodeExplorerModeNames: array[TCodeExplorerMode] of string = (
'Category',
'Source'
);
var
CodeExplorerOptions: TCodeExplorerOptions;// set by the IDE
function CodeExplorerRefreshNameToEnum(const s: string): TCodeExplorerRefresh;
function CodeExplorerModeNameToEnum(const s: string): TCodeExplorerMode;
function ShowCodeExplorerOptions: TModalResult;
@ -117,6 +129,13 @@ begin
Result:=cerDefault;
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;
var
CodeExplorerDlg: TCodeExplorerDlg;
@ -148,6 +167,7 @@ end;
procedure TCodeExplorerOptions.Clear;
begin
FMode:=cemCategory;
FRefresh:=cerDefault;
FFollowCursor:=true;
end;
@ -159,6 +179,7 @@ begin
if Source is TCodeExplorerOptions then begin
Src:=TCodeExplorerOptions(Source);
FRefresh:=Src.Refresh;
FMode:=Src.Mode;
FFollowCursor:=Src.FollowCursor;
end else
inherited Assign(Source);
@ -210,6 +231,8 @@ begin
Clear;
FRefresh:=CodeExplorerRefreshNameToEnum(
XMLConfig.GetValue(Path+'Refresh/Value',''));
FMode:=CodeExplorerModeNameToEnum(
XMLConfig.GetValue(Path+'Mode/Value',''));
FFollowCursor:=XMLConfig.GetValue(Path+'FollowCursor',true);
end;
@ -219,6 +242,9 @@ begin
XMLConfig.SetDeleteValue(Path+'Refresh/Value',
CodeExplorerRefreshNames[FRefresh],
CodeExplorerRefreshNames[cerDefault]);
XMLConfig.SetDeleteValue(Path+'Mode/Value',
CodeExplorerModeNames[FMode],
CodeExplorerModeNames[cemCategory]);
XMLConfig.SetDeleteValue(Path+'FollowCursor',FFollowCursor,true);
end;
@ -246,6 +272,14 @@ begin
else
RefreshRadioGroup.ItemIndex:=1;
end;
case Options.Mode of
cemCategory: ModeRadioGroup.ItemIndex:=0;
cemSource: ModeRadioGroup.ItemIndex:=1;
else
ModeRadioGroup.ItemIndex:=0;
end;
FollowCursorCheckBox.Checked:=Options.FollowCursor;
end;
@ -256,6 +290,12 @@ begin
1: FOptions.Refresh:=cerSwitchEditorPage;
2: FOptions.Refresh:=cerOnIdle;
end;
case ModeRadioGroup.ItemIndex of
0: FOptions.Mode:=cemCategory;
1: FOptions.Mode:=cemSource;
end;
Options.FollowCursor:=FollowCursorCheckBox.Checked;
end;
@ -272,6 +312,11 @@ begin
Items[1]:=lisCEOWhenSwitchingFile;
Items[2]:=lisCEOOnIdle;
end;
ModeRadioGroup.Caption:=lisCEOMode;
with ModeRadioGroup do begin
Items[0]:=lisCEOModeCategory;
Items[1]:=lisCEOModeSource;
end;
FollowCursorCheckBox.Caption:=lisCEFollowCursor;
end;

View File

@ -56,7 +56,7 @@ object CodeExplorerView: TCodeExplorerView
ClientWidth = 207
TabOrder = 1
object OptionsSpeedButton: TSpeedButton
Left = 182
Left = 180
Height = 22
Hint = 'Options for CodeExplorer'
Top = 1
@ -105,7 +105,7 @@ object CodeExplorerView: TCodeExplorerView
ParentShowHint = False
end
object RefreshSpeedButton: TSpeedButton
Left = 159
Left = 132
Height = 22
Hint = 'Refresh CodeExplorer'
Top = 1
@ -153,13 +153,25 @@ object CodeExplorerView: TCodeExplorerView
ShowHint = True
ParentShowHint = False
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
AnchorSideLeft.Control = CodePage
AnchorSideTop.Control = CodePage
AnchorSideRight.Control = CodePage
AnchorSideRight.Side = asrBottom
Height = 23
Width = 157
Width = 130
Anchors = [akTop, akLeft, akRight]
AutoSelect = True
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'
+'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'
+'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
+#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
@ -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'
+#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'
+'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
+'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
@ -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
+'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
+'ParentShowHint'#8#0#0#5'TEdit'#14'CodeFilterEdit'#22'AnchorSideLeft.Control'
+#7#8'CodePage'#21'AnchorSideTop.Control'#7#8'CodePage'#23'AnchorSideRight.Co'
+'ntrol'#7#8'CodePage'#20'AnchorSideRight.Side'#7#9'asrBottom'#6'Height'#2#23
,#5'Width'#3#157#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#10'AutoSelec'
+'t'#9#8'OnChange'#7#20'CodeFilterEditChange'#8'TabOrder'#2#0#4'Text'#6#14'Co'
+'deFilterEdit'#0#0#0#0#5'TPage'#14'DirectivesPage'#7'Caption'#6#14'Directive'
+'sPage'#11'ClientWidth'#3#211#0#12'ClientHeight'#3#191#1#0#5'TEdit'#20'Direc'
+'tivesFilterEdit'#22'AnchorSideLeft.Control'#7#14'DirectivesPage'#21'AnchorS'
+'ideTop.Control'#7#14'DirectivesPage'#23'AnchorSideRight.Control'#7#14'Direc'
+'tivesPage'#20'AnchorSideRight.Side'#7#9'asrBottom'#6'Height'#2#23#5'Width'#3
+#211#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'OnChange'#7#26'Direct'
+'ivesFilterEditChange'#8'TabOrder'#2#0#4'Text'#6#20'DirectivesFilterEdit'#0#0
+#9'TTreeView'#18'DirectivesTreeView'#21'AnchorSideTop.Control'#7#20'Directiv'
+'esFilterEdit'#18'AnchorSideTop.Side'#7#9'asrBottom'#6'Height'#3#167#1#3'Top'
+#2#24#5'Width'#3#211#0#5'Align'#7#8'alBottom'#7'Anchors'#11#5'akTop'#6'akLef'
+'t'#7'akRight'#8'akBottom'#0#17'BorderSpacing.Top'#2#1#17'DefaultItemHeight'
+#2#19#9'PopupMenu'#7#13'TreePopupmenu'#8'TabOrder'#2#1#10'OnDblClick'#7#26'D'
+'irectivesTreeViewDblClick'#10'OnDeletion'#7#26'DirectivesTreeViewDeletion'#7
+'OnKeyUp'#7#23'DirectivesTreeViewKeyUp'#0#0#0#0#10'TImageList'#10'Imagelist1'
+#4'left'#2'@'#3'top'#2' '#0#0#10'TPopupMenu'#13'TreePopupmenu'#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
+'ParentShowHint'#8#0#0#12'TSpeedButton'#15'ModeSpeedButton'#4'Left'#3#156#0#6
+'Height'#2#22#3'Top'#2#1#5'Width'#2#23#7'Anchors'#11#5'akTop'#7'akRight'#0#5
+'Color'#7#9'clBtnFace'#9'NumGlyphs'#2#0#7'OnClick'#7#20'ModeSpeedButtonClick'
,#8'ShowHint'#9#14'ParentShowHint'#8#0#0#5'TEdit'#14'CodeFilterEdit'#22'Ancho'
+'rSideLeft.Control'#7#8'CodePage'#21'AnchorSideTop.Control'#7#8'CodePage'#23
+'AnchorSideRight.Control'#7#8'CodePage'#20'AnchorSideRight.Side'#7#9'asrBott'
+'om'#6'Height'#2#23#5'Width'#3#130#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRi'
+'ght'#0#10'AutoSelect'#9#8'OnChange'#7#20'CodeFilterEditChange'#8'TabOrder'#2
+#0#4'Text'#6#14'CodeFilterEdit'#0#0#0#0#5'TPage'#14'DirectivesPage'#7'Captio'
+'n'#6#14'DirectivesPage'#11'ClientWidth'#3#211#0#12'ClientHeight'#3#191#1#0#5
+'TEdit'#20'DirectivesFilterEdit'#22'AnchorSideLeft.Control'#7#14'DirectivesP'
+'age'#21'AnchorSideTop.Control'#7#14'DirectivesPage'#23'AnchorSideRight.Cont'
+'rol'#7#14'DirectivesPage'#20'AnchorSideRight.Side'#7#9'asrBottom'#6'Height'
+#2#23#5'Width'#3#211#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'OnCha'
+'nge'#7#26'DirectivesFilterEditChange'#8'TabOrder'#2#0#4'Text'#6#20'Directiv'
+'esFilterEdit'#0#0#9'TTreeView'#18'DirectivesTreeView'#21'AnchorSideTop.Cont'
+'rol'#7#20'DirectivesFilterEdit'#18'AnchorSideTop.Side'#7#9'asrBottom'#6'Hei'
+'ght'#3#167#1#3'Top'#2#24#5'Width'#3#211#0#5'Align'#7#8'alBottom'#7'Anchors'
+#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#17'BorderSpacing.Top'#2#1#17
+'DefaultItemHeight'#2#19#9'PopupMenu'#7#13'TreePopupmenu'#8'TabOrder'#2#1#10
+'OnDblClick'#7#26'DirectivesTreeViewDblClick'#10'OnDeletion'#7#26'Directives'
+'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;
OptionsSpeedButton: TSpeedButton;
RefreshSpeedButton: TSpeedButton;
ModeSpeedButton: TSpeedButton;
TreePopupmenu: TPopupMenu;
procedure CodeExplorerViewClose(Sender: TObject;
var CloseAction: TCloseAction);
@ -106,6 +107,7 @@ type
Shift: TShiftState);
procedure JumpToMenuitemClick(Sender: TObject);
procedure MainNotebookPageChanged(Sender: TObject);
procedure ModeSpeedButtonClick(Sender: TObject);
procedure OptionsSpeedButtonClick(Sender: TObject);
procedure RefreshMenuitemClick(Sender: TObject);
procedure OnApplicationIdle(Sender: TObject; var Done: Boolean);
@ -118,6 +120,7 @@ type
FLastCodeChangeStep: integer;
FLastDirectivesFilter: string;
FLastDirectivesChangeStep: integer;
FMode : TCodeExplorerMode;
FOnGetCodeTree: TOnGetCodeTree;
FOnGetDirectivesTree: TOnGetDirectivesTree;
FOnJumpToCode: TOnJumpToCode;
@ -159,6 +162,7 @@ type
procedure SetCodeFilter(const AValue: string);
procedure SetCurrentPage(const AValue: TCodeExplorerPage);
procedure SetDirectivesFilter(const AValue: string);
procedure SetMode(AMode: TCodeExplorerMode);
protected
procedure KeyUp(var Key: Word; Shift: TShiftState); override;
procedure ApplyCodeFilter;
@ -186,6 +190,7 @@ type
property OnGetDirectivesTree: TOnGetDirectivesTree read FOnGetDirectivesTree
write FOnGetDirectivesTree;
property OnJumpToCode: TOnJumpToCode read FOnJumpToCode write FOnJumpToCode;
property Mode: TCodeExplorerMode read FMode write FMode;
property CodeFilename: string read FCodeFilename;
property CodeFilter: string read GetCodeFilter write SetCodeFilter;
property DirectivesFilename: string read FDirectivesFilename;
@ -283,6 +288,8 @@ procedure TCodeExplorerView.CodeExplorerViewCREATE(Sender: TObject);
begin
LoadCodeExplorerOptions;
SetMode(CodeExplorerOptions.Mode);
Name:=NonModalIDEWindowNames[nmiwCodeExplorerName];
Caption := lisMenuViewCodeExplorer;
EnvironmentOptions.IDEWindowLayoutList.Apply(Self,Name);
@ -399,6 +406,14 @@ begin
Refresh(true);
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);
begin
if ShowCodeExplorerOptions=mrOk then
@ -679,6 +694,22 @@ begin
DirectivesFilterChanged;
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);
begin
inherited KeyUp(Key, Shift);

View File

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