educationlaz: added minimal and extended component set from Michael Kuhardt

git-svn-id: trunk@22813 -
This commit is contained in:
mattias 2009-11-26 20:51:07 +00:00
parent 4a5ccd0c77
commit 5c523c50a9
4 changed files with 183 additions and 51 deletions

View File

@ -1,34 +1,34 @@
inherited EduCompPaletteFrame: TEduCompPaletteFrame
Height = 380
Height = 409
Width = 480
ClientHeight = 380
ClientHeight = 409
ClientWidth = 480
OnClick = FrameClick
TabOrder = 0
DesignLeft = 395
DesignTop = 160
DesignLeft = 623
DesignTop = 145
object ComponentsGroupBox: TGroupBox[0]
AnchorSideTop.Control = Owner
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 135
Height = 368
Left = 142
Height = 397
Top = 6
Width = 339
Width = 332
Align = alClient
Anchors = [akTop, akBottom]
BorderSpacing.Around = 6
Caption = 'ComponentsGroupBox'
ClientHeight = 346
ClientWidth = 331
ClientHeight = 379
ClientWidth = 328
TabOrder = 0
object ComponentsTreeView: TTreeView
Left = 0
Height = 346
Height = 379
Top = 0
Width = 331
Width = 328
Align = alClient
DefaultItemHeight = 19
DefaultItemHeight = 15
ReadOnly = True
TabOrder = 0
OnMouseDown = ComponentsTreeViewMouseDown
@ -37,39 +37,56 @@ inherited EduCompPaletteFrame: TEduCompPaletteFrame
end
object LeftPanel: TPanel[1]
Left = 0
Height = 380
Height = 409
Top = 0
Width = 129
Width = 136
Align = alLeft
AutoSize = True
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 6
ChildSizing.VerticalSpacing = 6
ClientHeight = 380
ClientWidth = 129
ClientHeight = 409
ClientWidth = 136
TabOrder = 1
object ShowAllButton: TButton
Left = 7
Height = 20
Top = 7
Width = 115
Align = alTop
AutoSize = True
Left = 16
Height = 23
Top = 176
Width = 100
Align = alCustom
Caption = 'ShowAllButton'
OnClick = ShowAllButtonClick
TabOrder = 0
end
object HideAllButton: TButton
Left = 7
Height = 20
Top = 33
Width = 115
Align = alTop
AutoSize = True
Left = 16
Height = 23
Top = 328
Width = 100
Align = alCustom
Caption = 'HideAllButton'
OnClick = HideAllButtonClick
TabOrder = 1
end
object ShowMinimalButton: TButton
Left = 16
Height = 23
Top = 96
Width = 100
Align = alCustom
Caption = 'ShowMinimalButton'
OnClick = ShowMinimalButtonClick
TabOrder = 2
end
object ShowExtendedButton: TButton
Left = 16
Height = 23
Top = 136
Width = 100
Caption = 'ShowExtendedButton'
OnClick = ShowExtendedButtonClick
TabOrder = 3
end
end
end

View File

@ -1,28 +1,33 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TEduCompPaletteFrame','FORMDATA',[
'TPF0'#241#20'TEduCompPaletteFrame'#19'EduCompPaletteFrame'#6'Height'#3'|'#1#5
+'Width'#3#224#1#12'ClientHeight'#3'|'#1#11'ClientWidth'#3#224#1#7'OnClick'#7
+#10'FrameClick'#8'TabOrder'#2#0#10'DesignLeft'#3#139#1#9'DesignTop'#3#160#0#0
+#242#2#0#9'TGroupBox'#18'ComponentsGroupBox'#21'AnchorSideTop.Control'#7#5'O'
+'wner'#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9
+'asrBottom'#4'Left'#3#135#0#6'Height'#3'p'#1#3'Top'#2#6#5'Width'#3'S'#1#5'Al'
+'ign'#7#8'alClient'#7'Anchors'#11#5'akTop'#8'akBottom'#0#20'BorderSpacing.Ar'
+'ound'#2#6#7'Caption'#6#18'ComponentsGroupBox'#12'ClientHeight'#3'Z'#1#11'Cl'
+'ientWidth'#3'K'#1#8'TabOrder'#2#0#0#9'TTreeView'#18'ComponentsTreeView'#4'L'
+'eft'#2#0#6'Height'#3'Z'#1#3'Top'#2#0#5'Width'#3'K'#1#5'Align'#7#8'alClient'
+#17'DefaultItemHeight'#2#19#8'ReadOnly'#9#8'TabOrder'#2#0#11'OnMouseDown'#7
'TPF0'#241#20'TEduCompPaletteFrame'#19'EduCompPaletteFrame'#6'Height'#3#153#1
+#5'Width'#3#224#1#12'ClientHeight'#3#153#1#11'ClientWidth'#3#224#1#7'OnClick'
+#7#10'FrameClick'#8'TabOrder'#2#0#10'DesignLeft'#3'o'#2#9'DesignTop'#3#145#0
+#0#242#2#0#9'TGroupBox'#18'ComponentsGroupBox'#21'AnchorSideTop.Control'#7#5
+'Owner'#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9
+'asrBottom'#4'Left'#3#142#0#6'Height'#3#141#1#3'Top'#2#6#5'Width'#3'L'#1#5'A'
+'lign'#7#8'alClient'#7'Anchors'#11#5'akTop'#8'akBottom'#0#20'BorderSpacing.A'
+'round'#2#6#7'Caption'#6#18'ComponentsGroupBox'#12'ClientHeight'#3'{'#1#11'C'
+'lientWidth'#3'H'#1#8'TabOrder'#2#0#0#9'TTreeView'#18'ComponentsTreeView'#4
+'Left'#2#0#6'Height'#3'{'#1#3'Top'#2#0#5'Width'#3'H'#1#5'Align'#7#8'alClient'
+#17'DefaultItemHeight'#2#15#8'ReadOnly'#9#8'TabOrder'#2#0#11'OnMouseDown'#7
+#27'ComponentsTreeViewMouseDown'#7'Options'#11#17'tvoAutoItemHeight'#16'tvoH'
+'ideSelection'#21'tvoKeepCollapsedNodes'#11'tvoReadOnly'#14'tvoShowButtons'
+#12'tvoShowLines'#11'tvoShowRoot'#11'tvoToolTips'#0#0#0#0#242#2#1#6'TPanel'#9
+'LeftPanel'#4'Left'#2#0#6'Height'#3'|'#1#3'Top'#2#0#5'Width'#3#129#0#5'Align'
+#7#6'alLeft'#8'AutoSize'#9#28'ChildSizing.LeftRightSpacing'#2#6#28'ChildSizi'
+'ng.TopBottomSpacing'#2#6#29'ChildSizing.HorizontalSpacing'#2#6#27'ChildSizi'
+'ng.VerticalSpacing'#2#6#12'ClientHeight'#3'|'#1#11'ClientWidth'#3#129#0#8'T'
+'abOrder'#2#1#0#7'TButton'#13'ShowAllButton'#4'Left'#2#7#6'Height'#2#20#3'To'
+'p'#2#7#5'Width'#2's'#5'Align'#7#5'alTop'#8'AutoSize'#9#7'Caption'#6#13'Show'
+'AllButton'#7'OnClick'#7#18'ShowAllButtonClick'#8'TabOrder'#2#0#0#0#7'TButto'
+'n'#13'HideAllButton'#4'Left'#2#7#6'Height'#2#20#3'Top'#2'!'#5'Width'#2's'#5
+'Align'#7#5'alTop'#8'AutoSize'#9#7'Caption'#6#13'HideAllButton'#7'OnClick'#7
+#18'HideAllButtonClick'#8'TabOrder'#2#1#0#0#0#0
+'LeftPanel'#4'Left'#2#0#6'Height'#3#153#1#3'Top'#2#0#5'Width'#3#136#0#5'Alig'
+'n'#7#6'alLeft'#8'AutoSize'#9#28'ChildSizing.LeftRightSpacing'#2#6#28'ChildS'
+'izing.TopBottomSpacing'#2#6#29'ChildSizing.HorizontalSpacing'#2#6#27'ChildS'
+'izing.VerticalSpacing'#2#6#12'ClientHeight'#3#153#1#11'ClientWidth'#3#136#0
+#8'TabOrder'#2#1#0#7'TButton'#13'ShowAllButton'#4'Left'#2#16#6'Height'#2#23#3
+'Top'#3#176#0#5'Width'#2'd'#5'Align'#7#8'alCustom'#7'Caption'#6#13'ShowAllBu'
+'tton'#7'OnClick'#7#18'ShowAllButtonClick'#8'TabOrder'#2#0#0#0#7'TButton'#13
+'HideAllButton'#4'Left'#2#16#6'Height'#2#23#3'Top'#3'H'#1#5'Width'#2'd'#5'Al'
+'ign'#7#8'alCustom'#7'Caption'#6#13'HideAllButton'#7'OnClick'#7#18'HideAllBu'
+'ttonClick'#8'TabOrder'#2#1#0#0#7'TButton'#17'ShowMinimalButton'#4'Left'#2#16
+#6'Height'#2#23#3'Top'#2'`'#5'Width'#2'd'#5'Align'#7#8'alCustom'#7'Caption'#6
+#17'ShowMinimalButton'#7'OnClick'#7#22'ShowMinimalButtonClick'#8'TabOrder'#2
+#2#0#0#7'TButton'#18'ShowExtendedButton'#4'Left'#2#16#6'Height'#2#23#3'Top'#3
+#136#0#5'Width'#2'd'#7'Caption'#6#18'ShowExtendedButton'#7'OnClick'#7#23'Sho'
+'wExtendedButtonClick'#8'TabOrder'#2#3#0#0#0#0
]);

View File

@ -12,7 +12,7 @@
* *
*****************************************************************************
Author: Mattias Gaertner
Author: Mattias Gaertner, Michael Kuhardt
Abstract:
Frame to setup the component palette.
@ -50,6 +50,8 @@ type
{ TEduCompPaletteFrame }
TEduCompPaletteFrame = class(TAbstractIDEOptionsEditor)
ShowExtendedButton: TButton;
ShowMinimalButton: TButton;
ComponentsGroupBox: TGroupBox;
ComponentsTreeView: TTreeView;
HideAllButton: TButton;
@ -60,12 +62,15 @@ type
procedure FrameClick(Sender: TObject);
procedure HideAllButtonClick(Sender: TObject);
procedure ShowAllButtonClick(Sender: TObject);
procedure ShowExtendedButtonClick(Sender: TObject);
procedure ShowMinimalButtonClick(Sender: TObject);
private
HideImgID: LongInt;
ShowImgID: LongInt;
procedure FillComponentTreeView;
procedure SaveFillComponentTreeView;
procedure ShowHideAll(aShow: boolean);
procedure ShowSelected(extended: boolean);
public
function GetTitle: String; override;
procedure ReadSettings(AOptions: TAbstractIDEOptions); override;
@ -124,6 +129,20 @@ begin
ShowHideAll(true);
end;
procedure TEduCompPaletteFrame.ShowExtendedButtonClick(Sender: TObject);
begin
ShowHideAll(false);
ShowSelected(true);
end;
procedure TEduCompPaletteFrame.ShowMinimalButtonClick(Sender: TObject);
begin
ShowHideAll(false);
ShowSelected(false);
end;
procedure TEduCompPaletteFrame.FillComponentTreeView;
var
i: Integer;
@ -203,19 +222,106 @@ begin
while Node<>nil do begin
if Node.Parent<>nil then begin
CompName:=Node.Text;
EduComponentPaletteOptions.ComponentVisible[CompName]:=aShow;
if aShow then
Node.StateIndex:=ShowImgID
else
Node.StateIndex:=HideImgID;
end else begin
end
else begin
end;
Node:=Node.GetNext;
end;
ComponentsTreeView.EndUpdate;
end;
procedure TEduCompPaletteFrame.ShowSelected(extended: boolean);
var
Node: TTreeNode;
CompName: String;
MinimalComponents: array[0..12] of String;
ExtendedComponents: array[0..25] of String;
i,k: integer;
begin
MinimalComponents[0] := 'TEdit';
MinimalComponents[1] := 'TButton';
MinimalComponents[2] := 'TCheckBox';
MinimalComponents[3] := 'TLabel';
MinimalComponents[4] := 'TListBox';
MinimalComponents[5] := 'TComboBox';
MinimalComponents[6] := 'TRadioGroup';
MinimalComponents[7] := 'TRadioButton';
MinimalComponents[8] := 'TPanel';
MinimalComponents[9] := 'TMainMenu';
MinimalComponents[10] := 'TMemo';
MinimalComponents[11] := 'TGroupBox';
MinimalComponents[12] := 'TImage';
ExtendedComponents[0] := 'TBitBtn';
ExtendedComponents[1] := 'TScrollBar';
ExtendedComponents[2] := 'TPopupMenu';
ExtendedComponents[3] := 'TCheckGroup';
ExtendedComponents[4] := 'TActionList';
ExtendedComponents[5] := 'TStringGrid';
ExtendedComponents[6] := 'TSpeedButton';
ExtendedComponents[7] := 'TTimer';
ExtendedComponents[8] := 'TIdleTimer';
ExtendedComponents[9] := 'TPageControl';
ExtendedComponents[10] := 'TStaticText';
ExtendedComponents[11] := 'TDBGrid';
ExtendedComponents[12] := 'TOpenDialog';
ExtendedComponents[13] := 'TSaveDialog';
ExtendedComponents[14] := 'TSelectDirectoryDialog';
ExtendedComponents[15] := 'TDataSource';
ExtendedComponents[16] := 'TDBNavigator';
ExtendedComponents[17] := 'TDBText';
ExtendedComponents[18] := 'TDBEdit';
ExtendedComponents[19] := 'TDBMemo';
ExtendedComponents[20] := 'TDBImage';
ExtendedComponents[21] := 'TDBListBox';
ExtendedComponents[22] := 'TDBLookupListBox';
ExtendedComponents[23] := 'TDBComboBox';
ExtendedComponents[24] := 'TDBLookupComboBox';
ExtendedComponents[25] := 'TDBCheckBox';
ComponentsTreeView.BeginUpdate;
Node:=ComponentsTreeView.Items.GetFirstNode;
while Node<>nil do begin
if Node.Parent<>nil then begin
CompName:=Node.Text;
for i := 0 to 12 do begin
if (CompareText (CompName , MinimalComponents[i] )=0) then begin
EduComponentPaletteOptions.ComponentVisible[CompName]:=true;
Node.StateIndex:=ShowImgID;
end;
end;
if extended then begin
for k := 0 to 25 do begin
if (CompareText (CompName , ExtendedComponents[k] )=0) then begin
EduComponentPaletteOptions.ComponentVisible[CompName]:=true;
Node.StateIndex:=ShowImgID;
end;
end;
end;
end;
Node:=Node.GetNext;
end;
ComponentsTreeView.EndUpdate;
end;
function TEduCompPaletteFrame.GetTitle: String;
begin
Result:='Component palette';
@ -230,6 +336,8 @@ procedure TEduCompPaletteFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
begin
ShowAllButton.Caption:=ersShowAll;
HideAllButton.Caption:=ersHideAll;
ShowMinimalButton.Caption:=ersShowMinimal;
ShowExtendedButton.Caption:=ersShowExtended;
ComponentsGroupBox.Caption:=ersVisibleComponents;
end;

View File

@ -31,6 +31,8 @@ resourcestring
EduRSEducation = 'Education';
ersShowAll = 'Show all';
ersHideAll = 'Hide all';
ersShowExtended = 'Show Extended';
ersShowMinimal = 'Show Minimal';
ersVisibleComponents = 'Visible components';
ersShowAllChilds = 'Show all childs';
ersIDEMenuItems = 'IDE menu items';