Spreg.pas
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:23k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. {*******************************************************************}
  2. {                                                                   }
  3. {       Almediadev Visual Component Library                         }
  4. {       DynamicSkinForm                                             }
  5. {       Version 5.60                                                }
  6. {                                                                   }
  7. {       Copyright (c) 2000-2003 Almediadev                          }
  8. {       ALL RIGHTS RESERVED                                         }
  9. {                                                                   }
  10. {       Home:  http://www.almdev.com                                }
  11. {       Support: support@almdev.com                                 }
  12. {                                                                   }
  13. {*******************************************************************}
  14. unit spreg;
  15. {$P+,S-,W-,R-}
  16. {$WARNINGS OFF}
  17. {$HINTS OFF}
  18. interface
  19. uses Classes, Menus, Dialogs, Forms, Controls,
  20.     {$IFDEF  VER140} DesignEditors, DesignIntf
  21.     {$ELSE} {$IFDEF  VER150} DesignEditors, DesignIntf {$ELSE} DsgnIntf {$ENDIF} {$ENDIF};
  22. type
  23.   TspSkinStatusBarEditor = class(TDefaultEditor)
  24.   public
  25.     procedure ExecuteVerb(Index: Integer); override;
  26.     function GetVerb(Index: Integer): string; override;
  27.     function GetVerbCount: Integer; override;
  28.   end;
  29.   TspSkinToolBarEditor = class(TDefaultEditor)
  30.   public
  31.     procedure ExecuteVerb(Index: Integer); override;
  32.     function GetVerb(Index: Integer): string; override;
  33.     function GetVerbCount: Integer; override;
  34.   end;
  35.   TspSkinPageControlEditor = class(TDefaultEditor)
  36.   public
  37.     procedure ExecuteVerb(Index: Integer); override;
  38.     function GetVerb(Index: Integer): string; override;
  39.     function GetVerbCount: Integer; override;
  40.   end;
  41. procedure Register;
  42. implementation
  43. uses
  44.   SPUtils, SPEffBMP, DynamicSkinForm, SkinData, SkinCtrls, SkinHint, SkinGrids,
  45.   SkinTabs, SysUtils, SkinBoxCtrls, SkinMenus, spTrayIcon, spMessages,
  46.   spSkinZip, spSkinUnZip, spFileCtrl, spSkinShellCtrls, spNBPagesEditor,
  47.   spCalendar, spColorCtrls, spDialogs;
  48.   { TFilenameProperty }
  49. type
  50.   TspFilenameProperty = class(TStringProperty)
  51.   public
  52.     procedure Edit; override;
  53.     function GetAttributes: TPropertyAttributes; override;
  54.   end;
  55.   TspSkinDataNameProperty = class(TStringProperty)
  56.   public
  57.     function GetAttributes: TPropertyAttributes; override;
  58.     procedure GetValueList(List: TStrings); virtual;
  59.     procedure GetValues(Proc: TGetStrProc); override;
  60.   end;
  61.   TspButtonSkinDataNameProperty = class(TspSkinDataNameProperty)
  62.   public
  63.     procedure GetValueList(List: TStrings); override;
  64.   end;
  65.   TspEditSkinDataNameProperty = class(TspSkinDataNameProperty)
  66.   public
  67.     procedure GetValueList(List: TStrings); override;
  68.   end;
  69.   TspSpinEditSkinDataNameProperty = class(TspSkinDataNameProperty)
  70.   public
  71.     procedure GetValueList(List: TStrings); override;
  72.   end;
  73.   TspGaugeSkinDataNameProperty = class(TspSkinDataNameProperty)
  74.   public
  75.     procedure GetValueList(List: TStrings); override;
  76.   end;
  77.   TspMenuButtonSkinDataNameProperty = class(TspSkinDataNameProperty)
  78.   public
  79.     procedure GetValueList(List: TStrings); override;
  80.   end;
  81.   TspPanelSkinDataNameProperty = class(TspSkinDataNameProperty)
  82.   public
  83.     procedure GetValueList(List: TStrings); override;
  84.   end;
  85.   TspListBoxSkinDataNameProperty = class(TspSkinDataNameProperty)
  86.   public
  87.     procedure GetValueList(List: TStrings); override;
  88.   end;
  89.   TspCheckListBoxSkinDataNameProperty = class(TspSkinDataNameProperty)
  90.   public
  91.     procedure GetValueList(List: TStrings); override;
  92.   end;
  93.   TspComboBoxSkinDataNameProperty = class(TspSkinDataNameProperty)
  94.   public
  95.     procedure GetValueList(List: TStrings); override;
  96.   end;
  97.   TspSplitterSkinDataNameProperty = class(TspSkinDataNameProperty)
  98.   public
  99.     procedure GetValueList(List: TStrings); override;
  100.   end;
  101.   procedure TspSkinDataNameProperty.GetValueList(List: TStrings);
  102.   begin
  103.   end;
  104.   procedure TspSkinDataNameProperty.GetValues(Proc: TGetStrProc);
  105.   var
  106.     I: Integer;
  107.     Values: TStringList;
  108.   begin
  109.     Values := TStringList.Create;
  110.     try
  111.       GetValueList(Values);
  112.       for I := 0 to Values.Count - 1 do Proc(Values[I]);
  113.     finally
  114.       Values.Free;
  115.     end;
  116.   end;
  117.   function TspSkinDataNameProperty.GetAttributes: TPropertyAttributes;
  118.   begin
  119.     Result := [paValueList, paMultiSelect];
  120.   end;
  121.   procedure TspEditSkinDataNameProperty.GetValueList(List: TStrings);
  122.   begin
  123.     List.Add('edit');
  124.     List.Add('buttonedit');
  125.     List.Add('statusedit');
  126.     List.Add('statusbuttonedit');
  127.     List.Add('tooledit');
  128.     List.Add('toolbuttonedit');
  129.   end;
  130.   procedure TspSpinEditSkinDataNameProperty.GetValueList(List: TStrings);
  131.   begin
  132.     List.Add('spinedit');
  133.     List.Add('statusspinedit');
  134.     List.Add('toolspinedit');
  135.   end;
  136.   procedure TspButtonSkinDataNameProperty.GetValueList(List: TStrings);
  137.   begin
  138.     List.Add('button');
  139.     List.Add('resizebutton');
  140.     List.Add('toolbutton');
  141.     List.Add('bigtoolbutton');
  142.   end;
  143.   procedure TspGaugeSkinDataNameProperty.GetValueList(List: TStrings);
  144.   begin
  145.     List.Add('gauge');
  146.     List.Add('vgauge');
  147.     List.Add('statusgauge');
  148.   end;
  149.   procedure TspMenuButtonSkinDataNameProperty.GetValueList(List: TStrings);
  150.   begin
  151.     List.Add('toolmenubutton');
  152.     List.Add('bigtoolmenubutton');
  153.     List.Add('toolmenutrackbutton');
  154.     List.Add('bigtoolmenutrackbutton');
  155.   end;
  156.   procedure TspPanelSkinDataNameProperty.GetValueList(List: TStrings);
  157.   begin
  158.     List.Add('panel');
  159.     List.Add('toolpanel');
  160.     List.Add('bigtoolpanel');
  161.     List.Add('statusbar');
  162.     List.Add('groupbox');
  163.   end;
  164.   procedure TspListBoxSkinDataNameProperty.GetValueList(List: TStrings);
  165.   begin
  166.     List.Add('listbox');
  167.     List.Add('captionlistbox');
  168.   end;
  169.   procedure TspCheckListBoxSkinDataNameProperty.GetValueList(List: TStrings);
  170.   begin
  171.     List.Add('checklistbox');
  172.     List.Add('captionchecklistbox');
  173.   end;
  174.   procedure TspComboBoxSkinDataNameProperty.GetValueList(List: TStrings);
  175.   begin
  176.     List.Add('combobox');
  177.     List.Add('captioncombobox');
  178.     List.Add('statuscombobox');
  179.     List.Add('toolcombobox');
  180.   end;
  181.   procedure TspSplitterSkinDataNameProperty.GetValueList(List: TStrings);
  182.   begin
  183.     List.Add('vsplitter');
  184.     List.Add('hsplitter');
  185.   end;
  186.   procedure TspFilenameProperty.Edit;
  187.   var
  188.     FileOpen: TOpenDialog;
  189.   begin
  190.     FileOpen := TOpenDialog.Create(Application);
  191.     try
  192.       FileOpen.Filename := '';
  193.       FileOpen.InitialDir := ExtractFilePath(FileOpen.Filename);
  194.       FileOpen.Filter := '*.*|*.*';
  195.       FileOpen.Options := FileOpen.Options + [ofHideReadOnly];
  196.       if FileOpen.Execute then SetValue(FileOpen.Filename);
  197.     finally
  198.       FileOpen.Free;
  199.     end;
  200.   end;
  201.   function TspFilenameProperty.GetAttributes: TPropertyAttributes;
  202.   begin
  203.     Result := [paDialog , paRevertable];
  204.   end;
  205. type
  206.   TspSetPagesProperty = class(TPropertyEditor)
  207.   public
  208.     procedure Edit; override;
  209.     function GetAttributes: TPropertyAttributes; override;
  210.     function GetValue: string; override;
  211.     procedure SetValue(const Value: string); override;
  212.    end;
  213. procedure TspSetPagesProperty.Edit;
  214. var
  215.   NB: TspSkinNoteBook;
  216. begin
  217.   try
  218.     NB := TspSkinNoteBook(GetComponent(0));
  219.     spNBPagesEditor.Execute(NB);
  220.   finally
  221.   end;
  222. end;
  223. function TspSetPagesProperty.GetAttributes: TPropertyAttributes;
  224. begin
  225.   Result := [paDialog];
  226. end;
  227. function TspSetPagesProperty.GetValue: string;
  228. begin
  229.   Result := '(Pages)';
  230. end;      
  231. procedure TspSetPagesProperty.SetValue(const Value: string);
  232. begin
  233.   if Value = '' then SetOrdValue(0);
  234. end;
  235. { Registration }
  236. resourcestring
  237.   sNEW_PAGE = 'New page';
  238.   sDEL_PAGE = 'Delete page';
  239.   sNEW_STATUSPANEL = 'New panel';
  240.   sNEW_STATUSGAUGE = 'New gauge';
  241.   sNEW_STATUSEDIT = 'New edit';
  242.   sNEW_STATUSBUTTONEDIT = 'New edit with button';
  243.   sNEW_STATUSCOMBOBOX = 'New combobox';
  244.   sNEW_STATUSSPINEDIT = 'New spinedit';
  245.   sNEW_TOOLBUTTON = 'New button';
  246.   sNEW_TOOLMENUBUTTON = 'New button with tracking menu';
  247.   sNEW_TOOLMENUTRACKBUTTON = 'New button with chevron and tracking menu';
  248.   sNEW_TOOLSEPARATOR = 'New separator';
  249.   sNEW_TOOLCOMBOBOX = 'New combobox';
  250.   sNEW_TOOLEDIT = 'New edit';
  251.   sNEW_TOOLBUTTONEDIT = 'New edit with button';
  252.   sNEW_TOOLSPINEDIT = 'New spinedit';
  253. procedure Register;
  254. begin
  255.   RegisterComponents('Skin Pack',  [TspDynamicSkinForm,
  256.     TspSkinData, TspStoredSkin, TspCompressedStoredSkin, TspSkinMainMenuBar,
  257.     TspSkinMDITabsBar,
  258.     TspSkinPopupMenu, TspSkinMainMenu, TspTrayIcon,
  259.     TspSkinPanel, TspSkinGroupBox, TspSkinExPanel, TspSkinScrollPanel,
  260.     TspSkinRadioGroup, TspSkinCheckGroup,
  261.     TspSkinButton, TspSkinMenuButton,
  262.     TspSkinSpeedButton, TspSkinMenuSpeedButton,
  263.     TspSkinCheckRadioBox,
  264.     TspSkinGauge, TspSkinTrackBar, TspSkinLabel, TspSkinStdLabel, TspSkinBitLabel,
  265.     TspSkinFrameRegulator,
  266.     TspSkinFrameGauge,
  267.     TspSkinXFormButton,
  268.     TspSkinHint, TspSkinDrawGrid, TspSkinStringGrid,
  269.     TspSkinPageControl, TspSkinTabControl,
  270.     TspSkinListBox, TspSkinComboBox, TspSkinEdit, TspSkinMaskEdit,
  271.     TspSkinPasswordEdit, TspSkinNumericEdit,
  272.     TspSkinMemo, TspSkinMemo2,
  273.     TspSkinScrollBar, TspSkinSpinEdit, TspSkinCheckListBox,
  274.     TspSkinAnimate, TspSkinSwitch, TspSkinUpDown,
  275.     TspSkinControlBar, TspSkinToolBar, TspSkinStatusBar,
  276.     TspSkinSplitter,
  277.     TspSkinScrollBox, TspSkinColorComboBox, TspSkinFontComboBox,
  278.     TspSkinListView, TspSkinTreeView, TspSkinStatusPanel,
  279.     TspSkinRichEdit, TspSkinDateEdit, TspSkinTimeEdit,
  280.     TspSkinMessage, TspSkinZip, TspSkinUnZip, TspSkinTextLabel,
  281.     TspSkinFileListView, TspSkinDirTreeView, TspSkinShellDriveComboBox,
  282.     TspSkinDriveComboBox, TspSkinFilterComboBox,
  283.     TspSkinDirectoryListBox, TspSkinFileListBox,
  284.     TspSkinDirectoryEdit, TspSkinFileEdit, TspSkinSaveFileEdit,
  285.     TspSkinHeaderControl, TspSkinTrackEdit, TspSkinSlider,
  286.     TspSkinLinkLabel, TspSkinLinkImage, TspSkinButtonLabel, TspSkinBevel,
  287.     TspSkinButtonsBar, TspSkinNoteBook, TspSkinMonthCalendar,
  288.     TspSkinColorGrid]);
  289.  RegisterComponents('Skin Pack Dialogs', [ TspSkinSelectDirectoryDialog,
  290.     TspSkinOpenDialog, TspSkinSaveDialog,
  291.     TspSkinOpenPictureDialog, TspSkinSavePictureDialog, TspSkinFontDialog,
  292.     TspSkinInputDialog, TspSkinPasswordDialog, TspSkinConfirmDialog,
  293.     TspSkinProgressDialog, TspSkinTextDialog,
  294.     TspSkinColorDialog]);
  295.   RegisterClass(TspSkinTabSheet);
  296.   RegisterPropertyEditor(TypeInfo(string), TspStoredSkin, 'FileName', TspFilenameProperty);
  297.   RegisterPropertyEditor(TypeInfo(string), TspCompressedStoredSkin, 'FileName', TspFilenameProperty);
  298.   RegisterPropertyEditor(TypeInfo(string), TspCompressedStoredSkin, 'CompressedFileName', TspFilenameProperty);
  299.   RegisterPropertyEditor(TypeInfo(string), TspSkinListView, 'HeaderSkinDataName', TspButtonSkinDataNameProperty);
  300.   RegisterPropertyEditor(TypeInfo(string), TspSkinOpenDialog, 'LVHeaderSkinDataName', TspButtonSkinDataNameProperty);
  301.   RegisterPropertyEditor(TypeInfo(string), TspSkinSaveDialog, 'LVHeaderSkinDataName', TspButtonSkinDataNameProperty);
  302.   RegisterPropertyEditor(TypeInfo(string), TspSkinOpenPictureDialog, 'LVHeaderSkinDataName', TspButtonSkinDataNameProperty);
  303.   RegisterPropertyEditor(TypeInfo(string), TspSkinSavePictureDialog, 'LVHeaderSkinDataName', TspButtonSkinDataNameProperty);
  304.   RegisterPropertyEditor(TypeInfo(string), TspSkinButton, 'SkinDataName', TspButtonSkinDataNameProperty);
  305.   RegisterPropertyEditor(TypeInfo(string), TspSkinEdit, 'SkinDataName', TspEditSkinDataNameProperty);
  306.   RegisterPropertyEditor(TypeInfo(string), TspSkinSpinEdit, 'SkinDataName', TspSpinEditSkinDataNameProperty);
  307.   RegisterPropertyEditor(TypeInfo(string), TspSkinButtonsBar, 'SectionButtonSkinDataName', TspButtonSkinDataNameProperty);
  308.   RegisterPropertyEditor(TypeInfo(string), TspSkinHeaderControl, 'SkinDataName', TspButtonSkinDataNameProperty);
  309.   RegisterPropertyEditor(TypeInfo(string), TspSkinGauge, 'SkinDataName', TspGaugeSkinDataNameProperty);
  310.   RegisterPropertyEditor(TypeInfo(string), TspSkinMenuButton, 'SkinDataName', TspMenuButtonSkinDataNameProperty);
  311.   RegisterPropertyEditor(TypeInfo(string), TspSkinSpeedButton, 'SkinDataName', TspButtonSkinDataNameProperty);
  312.   RegisterPropertyEditor(TypeInfo(string), TspSkinMenuSpeedButton, 'SkinDataName', TspMenuButtonSkinDataNameProperty);
  313.   RegisterPropertyEditor(TypeInfo(string), TspSkinPanel, 'SkinDataName', TspPanelSkinDataNameProperty);
  314.   RegisterPropertyEditor(TypeInfo(string), TspSkinListBox, 'SkinDataName', TspListBoxSkinDataNameProperty);
  315.   RegisterPropertyEditor(TypeInfo(string), TspSkinCheckListBox, 'SkinDataName', TspCheckListBoxSkinDataNameProperty);
  316.   RegisterPropertyEditor(TypeInfo(string), TspSkinSplitter, 'SkinDataName', TspSplitterSkinDataNameProperty);
  317.   RegisterPropertyEditor(TypeInfo(string), TspSkinComboBox, 'SkinDataName', TspComboBoxSkinDataNameProperty);
  318.   RegisterPropertyEditor(TypeInfo(TStrings),  TspSkinNoteBook, 'Pages', TspSetPagesProperty);
  319.   RegisterComponentEditor(TspSkinPageControl, TspSkinPageControlEditor);
  320.   RegisterComponentEditor(TspSkinTabSheet, TspSkinPageControlEditor);
  321.   RegisterComponentEditor(TspSkinStatusBar, TspSkinStatusBarEditor);
  322.   RegisterComponentEditor(TspSkinToolBar, TspSkinToolBarEditor);
  323. end;
  324. function TspSkinPageControlEditor.GetVerb(Index: Integer): string;
  325. begin
  326.   case Index of
  327.     0:  result := sNEW_PAGE;
  328.     1:  result := sDEL_PAGE;
  329.   end;
  330. end;
  331. procedure TspSkinPageControlEditor.ExecuteVerb(Index: Integer);
  332. var
  333.   NewPage: TspSkinCustomTabSheet;
  334.   PControl : TspSkinPageControl;
  335. begin
  336.   if Component is TspSkinPageControl then
  337.     PControl := TspSkinPageControl(Component)
  338.   else PControl := TspSkinPageControl(TspSkinTabSheet(Component).PageControl);
  339.   case Index of
  340.     0:  begin
  341.           NewPage := TspSkinTabSheet.Create(Designer.GetRoot);
  342.           with NewPage do
  343.           begin
  344.             Parent := PControl;
  345.             PageControl := PControl;
  346.             Name := Designer.UniqueName(ClassName);
  347.             Caption := Name;
  348.           end;
  349.         end;
  350.     1:  begin
  351.           with PControl do
  352.           begin
  353.             NewPage := TspSkinCustomTabSheet(ActivePage);
  354.             NewPage.PageControl := nil;
  355.             NewPage.Free;
  356.           end;
  357.         end;
  358.   end;
  359.   if Designer <> nil then Designer.Modified;
  360. end;
  361. function TspSkinPageControlEditor.GetVerbCount: Integer;
  362. begin
  363.   Result := 2;
  364. end;
  365. procedure TspSkinStatusBarEditor.ExecuteVerb(Index: Integer);
  366. var
  367.   NewPanel: TspSkinStatusPanel;
  368.   NewGauge: TspSkinGauge;
  369.   NewEdit: TspSkinEdit;
  370.   NewSpinEdit: TspSkinSpinEdit;
  371.   NewComboBox: TspSkinComboBox;
  372.   PControl : TspSkinStatusBar;
  373. begin
  374.   if Component is TspSkinStatusBar
  375.   then
  376.     PControl := TspSkinStatusBar(Component)
  377.   else
  378.     Exit;
  379.   case Index of
  380.     0:  begin
  381.           NewPanel := TspSkinStatusPanel.Create(Designer.GetRoot);
  382.           with NewPanel do
  383.           begin
  384.             Left := PControl.Width;
  385.             Parent := PControl;
  386.             Align := alLeft;
  387.             Name := Designer.UniqueName(ClassName);
  388.             SkinData := PControl.SkinData;
  389.             Designer.SelectComponent(NewPanel);
  390.           end;
  391.         end;
  392.     1:  begin
  393.           NewGauge := TspSkinGauge.Create(Designer.GetRoot);
  394.           with NewGauge do
  395.           begin
  396.             Left := PControl.Width;
  397.             SkinDataName := 'statusgauge';
  398.             Parent := PControl;
  399.             Align := alLeft;
  400.             Name := Designer.UniqueName(ClassName);
  401.             SkinData := PControl.SkinData;
  402.             Designer.SelectComponent(NewGauge);
  403.           end;
  404.         end;
  405.     2:
  406.        begin
  407.          NewEdit := TspSkinEdit.Create(Designer.GetRoot);
  408.           with NewEdit do
  409.           begin
  410.             Left := PControl.Width;
  411.             SkinDataName := 'statusedit';
  412.             Parent := PControl;
  413.             Align := alLeft;
  414.             Name := Designer.UniqueName(ClassName);
  415.             SkinData := PControl.SkinData;
  416.             Designer.SelectComponent(NewEdit);
  417.           end;
  418.        end;
  419.     3:
  420.        begin
  421.          NewEdit := TspSkinEdit.Create(Designer.GetRoot);
  422.          with NewEdit do
  423.          begin
  424.            ButtonMode := True;
  425.            Left := PControl.Width;
  426.            SkinDataName := 'statusbuttonedit';
  427.            Parent := PControl;
  428.            Align := alLeft;
  429.            Name := Designer.UniqueName(ClassName);
  430.            SkinData := PControl.SkinData;
  431.            Designer.SelectComponent(NewEdit);
  432.          end;
  433.        end;
  434.     4:
  435.        begin
  436.          NewSpinEdit := TspSkinSpinEdit.Create(Designer.GetRoot);
  437.          with NewSpinEdit do
  438.          begin
  439.            Left := PControl.Width;
  440.            SkinDataName := 'statusspinedit';
  441.            Parent := PControl;
  442.            Align := alLeft;
  443.            Name := Designer.UniqueName(ClassName);
  444.            SkinData := PControl.SkinData;
  445.            Designer.SelectComponent(NewEdit);
  446.          end;
  447.        end;
  448.      5:
  449.        begin
  450.          NewComboBox := TspSkinComboBox.Create(Designer.GetRoot);
  451.          with NewComboBox do
  452.          begin
  453.            Left := PControl.Width;
  454.            SkinDataName := 'statuscombobox';
  455.            Parent := PControl;
  456.            Align := alLeft;
  457.            Name := Designer.UniqueName(ClassName);
  458.            SkinData := PControl.SkinData;
  459.            Designer.SelectComponent(NewEdit);
  460.          end;
  461.        end;
  462.   end;
  463.   if Designer <> nil then Designer.Modified;
  464. end;
  465. function TspSkinStatusBarEditor.GetVerbCount: Integer;
  466. begin
  467.   Result := 6;
  468. end;
  469. function TspSkinStatusBarEditor.GetVerb(Index: Integer): string;
  470. begin
  471.   case Index of
  472.     0: Result := sNEW_STATUSPANEL;
  473.     1: Result := sNEW_STATUSGAUGE;
  474.     2: Result := sNEW_STATUSEDIT;
  475.     3: Result := sNEW_STATUSBUTTONEDIT;
  476.     4: Result := sNEW_STATUSSPINEDIT;
  477.     5: Result := sNEW_STATUSCOMBOBOX;
  478.   end;
  479. end;
  480. procedure TspSkinToolBarEditor.ExecuteVerb(Index: Integer);
  481. var
  482.   NewSpeedButton: TspSkinSpeedButton;
  483.   NewMenuSpeedButton: TspSkinMenuSpeedButton;
  484.   NewBevel: TspSkinBevel;
  485.   NewEdit: TspSkinEdit;
  486.   NewSpinEdit: TspSkinSpinEdit;
  487.   NewComboBox: TspSkinComboBox;
  488.   PControl : TspSkinToolBar;
  489. begin
  490.   if Component is TspSkinToolBar
  491.   then
  492.     PControl := TspSkinToolBar(Component)
  493.   else
  494.     Exit;
  495.   case Index of
  496.     0:  begin
  497.           NewSpeedButton := TspSkinSpeedButton.Create(Designer.GetRoot);
  498.           with NewSpeedButton do
  499.           begin
  500.             Flat := PControl.Flat;
  501.             SkinData := PControl.SkinData;
  502.             Left := PControl.Width;
  503.             Parent := PControl;
  504.             Align := alLeft;
  505.             Name := Designer.UniqueName(ClassName);
  506.             if PControl.SkinDataName = 'bigtoolpanel'
  507.             then
  508.               SkinDataName := 'bigtoolbutton'
  509.             else
  510.               SkinDataName := 'toolbutton';
  511.             Designer.SelectComponent(NewSpeedButton);
  512.           end;
  513.         end;
  514.     1:  begin
  515.           NewMenuSpeedButton := TspSkinMenuSpeedButton.Create(Designer.GetRoot);
  516.           with NewMenuSpeedButton do
  517.           begin
  518.             Flat := PControl.Flat;
  519.             SkinData := PControl.SkinData;
  520.             Left := PControl.Width;
  521.             Parent := PControl;
  522.             Align := alLeft;
  523.             Name := Designer.UniqueName(ClassName);
  524.             if PControl.SkinDataName = 'bigtoolpanel'
  525.             then
  526.               SkinDataName := 'bigtoolmenubutton'
  527.             else
  528.               SkinDataName := 'toolmenubutton';
  529.             Designer.SelectComponent(NewMenuSpeedButton);
  530.           end;
  531.         end;
  532.     2:  begin
  533.           NewMenuSpeedButton := TspSkinMenuSpeedButton.Create(Designer.GetRoot);
  534.           with NewMenuSpeedButton do
  535.           begin
  536.             Flat := PControl.Flat;
  537.             SkinData := PControl.SkinData;
  538.             Left := PControl.Width;
  539.             TrackButtonMode := True;
  540.             Parent := PControl;
  541.             Align := alLeft;
  542.             Name := Designer.UniqueName(ClassName);
  543.             if PControl.SkinDataName = 'bigtoolpanel'
  544.             then
  545.               SkinDataName := 'bigtoolmenutrackbutton'
  546.             else
  547.               SkinDataName := 'toolmenutrackbutton';
  548.             Designer.SelectComponent(NewMenuSpeedButton);
  549.           end;
  550.         end;
  551.     3: begin
  552.           NewBevel := TspSkinBevel.Create(Designer.GetRoot);
  553.           with NewBevel do
  554.           begin
  555.             SkinData := PControl.SkinData;
  556.             Left := PControl.Width;
  557.             Width := 25;
  558.             DividerMode := True;
  559.             Parent := PControl;
  560.             Align := alLeft;
  561.             Name := Designer.UniqueName(ClassName);
  562.             Designer.SelectComponent(NewBevel);
  563.           end;
  564.         end;
  565.     4:
  566.        begin
  567.          NewEdit := TspSkinEdit.Create(Designer.GetRoot);
  568.           with NewEdit do
  569.           begin
  570.             Left := PControl.Width;
  571.             SkinDataName := 'tooledit';
  572.             Parent := PControl;
  573.             Align := alLeft;
  574.             Name := Designer.UniqueName(ClassName);
  575.             SkinData := PControl.SkinData;
  576.             Designer.SelectComponent(NewEdit);
  577.           end;
  578.        end;
  579.     5:
  580.        begin
  581.          NewEdit := TspSkinEdit.Create(Designer.GetRoot);
  582.          with NewEdit do
  583.          begin
  584.            ButtonMode := True;
  585.            Left := PControl.Width;
  586.            SkinDataName := 'toolbuttonedit';
  587.            Parent := PControl;
  588.            Align := alLeft;
  589.            Name := Designer.UniqueName(ClassName);
  590.            SkinData := PControl.SkinData;
  591.            Designer.SelectComponent(NewEdit);
  592.          end;
  593.        end;
  594.     6:
  595.        begin
  596.          NewSpinEdit := TspSkinSpinEdit.Create(Designer.GetRoot);
  597.          with NewSpinEdit do
  598.          begin
  599.            Left := PControl.Width;
  600.            SkinDataName := 'toolspinedit';
  601.            Parent := PControl;
  602.            Align := alLeft;
  603.            Name := Designer.UniqueName(ClassName);
  604.            SkinData := PControl.SkinData;
  605.            Designer.SelectComponent(NewEdit);
  606.          end;
  607.        end;
  608.     7:
  609.        begin
  610.          NewComboBox := TspSkinComboBox.Create(Designer.GetRoot);
  611.          with NewComboBox do
  612.          begin
  613.            Left := PControl.Width;
  614.            SkinDataName := 'toolcombobox';
  615.            Parent := PControl;
  616.            Align := alLeft;
  617.            Name := Designer.UniqueName(ClassName);
  618.            SkinData := PControl.SkinData;
  619.            Designer.SelectComponent(NewEdit);
  620.          end;
  621.        end;
  622.   end;
  623.   if Designer <> nil then Designer.Modified;
  624. end;
  625. function TspSkinToolBarEditor.GetVerbCount: Integer;
  626. begin
  627.   Result := 8;
  628. end;
  629. function TspSkinToolBarEditor.GetVerb(Index: Integer): string;
  630. begin
  631.   case Index of
  632.     0: Result := sNEW_TOOLBUTTON;
  633.     1: Result := sNEW_TOOLMENUBUTTON;
  634.     2: Result := sNEW_TOOLMENUTRACKBUTTON;
  635.     3: Result := sNEW_TOOLSEPARATOR;
  636.     4: Result := sNEW_TOOLEDIT;
  637.     5: Result := sNEW_TOOLBUTTONEDIT;
  638.     6: Result := sNEW_TOOLSPINEDIT;
  639.     7: Result := sNEW_TOOLCOMBOBOX;
  640.   end;
  641. end;
  642. end.