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

Delphi控件源码

开发平台:

Delphi

  1. {*******************************************************************}
  2. {                                                                   }
  3. {       Almediadev Visual Component Library                         }
  4. {       BusinessSkinForm                                            }
  5. {       Version 2.90                                                }
  6. {                                                                   }
  7. {       Copyright (c) 2000-2004 Almediadev                          }
  8. {       ALL RIGHTS RESERVED                                         }
  9. {                                                                   }
  10. {       Home:  http://www.almdev.com                                }
  11. {       Support: support@almdev.com                                 }
  12. {                                                                   }
  13. {*******************************************************************}
  14. unit bsreg;
  15. {$P+,S-,W-,R-}
  16. {$WARNINGS OFF}
  17. {$HINTS OFF}
  18. interface
  19. uses Classes, Menus, Dialogs, Forms, Controls,
  20.     {$IFNDEF  VER130} DesignEditors, DesignIntf {$ELSE} DsgnIntf {$ENDIF};
  21. type
  22.   TbsSkinStatusBarEditor = class(TDefaultEditor)
  23.   public
  24.     procedure ExecuteVerb(Index: Integer); override;
  25.     function GetVerb(Index: Integer): string; override;
  26.     function GetVerbCount: Integer; override;
  27.   end;
  28.   TbsSkinToolBarEditor = class(TDefaultEditor)
  29.   public
  30.     procedure ExecuteVerb(Index: Integer); override;
  31.     function GetVerb(Index: Integer): string; override;
  32.     function GetVerbCount: Integer; override;
  33.   end;
  34.   TbsSkinPageControlEditor = class(TDefaultEditor)
  35.   public
  36.     procedure ExecuteVerb(Index: Integer); override;
  37.     function GetVerb(Index: Integer): string; override;
  38.     function GetVerbCount: Integer; override;
  39.   end;
  40. procedure Register;
  41. implementation
  42. uses
  43.   bsUtils, BusinessSkinForm, bsSkinData, bsSkinCtrls, bsSkinHint, bsSkinGrids,
  44.   bsSkinTabs, SysUtils, bsSkinBoxCtrls, bsSkinMenus, bsTrayIcon,
  45.   bsDBGrids, bsDBCtrls, DB, bsCalc, bsMessages, bsSkinZip, bsSkinUnZip,
  46.   bsFileCtrl, bsSkinShellCtrls, NBPagesEditor, bsCalendar, bsColorCtrls,
  47.   bsDialogs, bsRootEdit;
  48. { TColumnDataFieldEditor }
  49. type
  50.   { TFilenameProperty }
  51.   TbsFilenameProperty = class(TStringProperty)
  52.   public
  53.     procedure Edit; override;
  54.     function GetAttributes: TPropertyAttributes; override;
  55.   end;
  56.   TbsDBStringProperty = class(TStringProperty)
  57.   public
  58.     function GetAttributes: TPropertyAttributes; override;
  59.     procedure GetValueList(List: TStrings); virtual;
  60.     procedure GetValues(Proc: TGetStrProc); override;
  61.   end;
  62.   TbsSkinDataNameProperty = class(TStringProperty)
  63.   public
  64.     function GetAttributes: TPropertyAttributes; override;
  65.     procedure GetValueList(List: TStrings); virtual;
  66.     procedure GetValues(Proc: TGetStrProc); override;
  67.   end;
  68.   TbsButtonSkinDataNameProperty = class(TbsSkinDataNameProperty)
  69.   public
  70.     procedure GetValueList(List: TStrings); override;
  71.   end;
  72.   TbsTrackEditSkinDataNameProperty = class(TbsSkinDataNameProperty)
  73.   public
  74.     procedure GetValueList(List: TStrings); override;
  75.   end;
  76.   TbsEditSkinDataNameProperty = class(TbsSkinDataNameProperty)
  77.   public
  78.     procedure GetValueList(List: TStrings); override;
  79.   end;
  80.   TbsSpinEditSkinDataNameProperty = class(TbsSkinDataNameProperty)
  81.   public
  82.     procedure GetValueList(List: TStrings); override;
  83.   end;
  84.   TbsGaugeSkinDataNameProperty = class(TbsSkinDataNameProperty)
  85.   public
  86.     procedure GetValueList(List: TStrings); override;
  87.   end;
  88.   TbsToolBarSkinDataNameProperty = class(TbsSkinDataNameProperty)
  89.   public
  90.     procedure GetValueList(List: TStrings); override;
  91.   end;
  92.   TbsMenuButtonSkinDataNameProperty = class(TbsSkinDataNameProperty)
  93.   public
  94.     procedure GetValueList(List: TStrings); override;
  95.   end;
  96.   TbsPanelSkinDataNameProperty = class(TbsSkinDataNameProperty)
  97.   public
  98.     procedure GetValueList(List: TStrings); override;
  99.   end;
  100.   TbsListBoxSkinDataNameProperty = class(TbsSkinDataNameProperty)
  101.   public
  102.     procedure GetValueList(List: TStrings); override;
  103.   end;
  104.   TbsComboBoxSkinDataNameProperty = class(TbsSkinDataNameProperty)
  105.   public
  106.     procedure GetValueList(List: TStrings); override;
  107.   end;
  108.    TbsCheckListBoxSkinDataNameProperty = class(TbsSkinDataNameProperty)
  109.   public
  110.     procedure GetValueList(List: TStrings); override;
  111.   end;
  112.   TbsSplitterSkinDataNameProperty = class(TbsSkinDataNameProperty)
  113.   public
  114.     procedure GetValueList(List: TStrings); override;
  115.   end;
  116.   procedure TbsSkinDataNameProperty.GetValueList(List: TStrings);
  117.   begin
  118.   end;
  119.   procedure TbsSkinDataNameProperty.GetValues(Proc: TGetStrProc);
  120.   var
  121.     I: Integer;
  122.     Values: TStringList;
  123.   begin
  124.     Values := TStringList.Create;
  125.     try
  126.       GetValueList(Values);
  127.       for I := 0 to Values.Count - 1 do Proc(Values[I]);
  128.     finally
  129.       Values.Free;
  130.     end;
  131.   end;
  132.   function TbsSkinDataNameProperty.GetAttributes: TPropertyAttributes;
  133.   begin
  134.     Result := [paValueList, paMultiSelect];
  135.   end;
  136.   procedure TbsButtonSkinDataNameProperty.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 TbsTrackEditSkinDataNameProperty.GetValueList(List: TStrings);
  144.   begin
  145.     List.Add('buttonedit');
  146.     List.Add('statusbuttonedit');
  147.     List.Add('toolbuttonedit');
  148.   end;
  149.   procedure TbsEditSkinDataNameProperty.GetValueList(List: TStrings);
  150.   begin
  151.     List.Add('edit');
  152.     List.Add('buttonedit');
  153.     List.Add('statusedit');
  154.     List.Add('statusbuttonedit');
  155.     List.Add('tooledit');
  156.     List.Add('toolbuttonedit');
  157.   end;
  158.   procedure TbsSpinEditSkinDataNameProperty.GetValueList(List: TStrings);
  159.   begin
  160.     List.Add('spinedit');
  161.     List.Add('statusspinedit');
  162.     List.Add('toolspinedit');
  163.   end;
  164.   procedure TbsGaugeSkinDataNameProperty.GetValueList(List: TStrings);
  165.   begin
  166.     List.Add('gauge');
  167.     List.Add('vgauge');
  168.     List.Add('statusgauge');
  169.   end;
  170.   procedure TbsMenuButtonSkinDataNameProperty.GetValueList(List: TStrings);
  171.   begin
  172.     List.Add('toolmenubutton');
  173.     List.Add('bigtoolmenubutton');
  174.     List.Add('toolmenutrackbutton');
  175.     List.Add('bigtoolmenutrackbutton');
  176.   end;
  177.   procedure TbsToolBarSkinDataNameProperty.GetValueList(List: TStrings);
  178.   begin
  179.     List.Add('toolpanel');
  180.     List.Add('bigtoolpanel');
  181.   end;
  182.   procedure TbsPanelSkinDataNameProperty.GetValueList(List: TStrings);
  183.   begin
  184.     List.Add('panel');
  185.     List.Add('toolpanel');
  186.     List.Add('bigtoolpanel');
  187.     List.Add('statusbar');
  188.     List.Add('groupbox');
  189.   end;
  190.   procedure TbsListBoxSkinDataNameProperty.GetValueList(List: TStrings);
  191.   begin
  192.     List.Add('listbox');
  193.     List.Add('captionlistbox');
  194.   end;
  195.   procedure TbsComboBoxSkinDataNameProperty.GetValueList(List: TStrings);
  196.   begin
  197.     List.Add('combobox');
  198.     List.Add('captioncombobox');
  199.     List.Add('statuscombobox');
  200.     List.Add('toolcombobox');
  201.   end;
  202.   procedure TbsCheckListBoxSkinDataNameProperty.GetValueList(List: TStrings);
  203.   begin
  204.     List.Add('checklistbox');
  205.     List.Add('captionchecklistbox');
  206.   end;
  207.   procedure TbsSplitterSkinDataNameProperty.GetValueList(List: TStrings);
  208.   begin
  209.     List.Add('vsplitter');
  210.     List.Add('hsplitter');
  211.   end;
  212.   procedure TbsFilenameProperty.Edit;
  213.   var
  214.     FileOpen: TOpenDialog;
  215.   begin
  216.     FileOpen := TOpenDialog.Create(Application);
  217.     try
  218.       FileOpen.Filename := '';
  219.       FileOpen.InitialDir := ExtractFilePath(FileOpen.Filename);
  220.       FileOpen.Filter := '*.*|*.*';
  221.       FileOpen.Options := FileOpen.Options + [ofHideReadOnly];
  222.       if FileOpen.Execute then SetValue(FileOpen.Filename);
  223.     finally
  224.       FileOpen.Free;
  225.     end;
  226.   end;
  227.   function TbsFilenameProperty.GetAttributes: TPropertyAttributes;
  228.   begin
  229.     Result := [paDialog , paRevertable];
  230.   end;
  231.   function TbsDBStringProperty.GetAttributes: TPropertyAttributes;
  232.   begin
  233.     Result := [paValueList, paSortList, paMultiSelect];
  234.   end;
  235.   procedure TbsDBStringProperty.GetValueList(List: TStrings);
  236.   begin
  237.   end;
  238. procedure TbsDBStringProperty.GetValues(Proc: TGetStrProc);
  239. var
  240.   I: Integer;
  241.   Values: TStringList;
  242. begin
  243.   Values := TStringList.Create;
  244.   try
  245.     GetValueList(Values);
  246.     for I := 0 to Values.Count - 1 do Proc(Values[I]);
  247.   finally
  248.     Values.Free;
  249.   end;
  250. end;
  251. type
  252.   TbsColumnDataFieldProperty = class(TbsDBStringProperty)
  253.     procedure GetValueList(List: TStrings); override;
  254.   end;
  255. procedure TbsColumnDataFieldProperty.GetValueList(List: TStrings);
  256. var
  257.   Grid: TbsSkinCustomDBGrid;
  258.   DataSource: TDataSource;
  259. begin
  260.   Grid := (GetComponent(0) as TbsColumn).Grid;
  261.   if (Grid = nil) then Exit;
  262.   DataSource := Grid.DataSource;
  263.   if (DataSource <> nil) and (DataSource.DataSet <> nil) then
  264.     DataSource.DataSet.GetFieldNames(List);
  265. end;
  266. type
  267.   TbsSkinDBLookUpListBoxFieldProperty = class(TbsDBStringProperty)
  268.     procedure GetValueList(List: TStrings); override;
  269.   end;
  270. procedure TbsSkinDBLookUpListBoxFieldProperty.GetValueList(List: TStrings);
  271. var
  272.   DataSource: TDataSource;
  273.   LookUpControl: TbsDBLookUpControl;
  274. begin
  275.   DataSource := (GetComponent(0) as TbsSkinDBLookUpListBox).ListSource;
  276.   if (DataSource <> nil) and (DataSource.DataSet <> nil) then
  277.     DataSource.DataSet.GetFieldNames(List);
  278. end;
  279. type
  280.   TbsSkinDBLookUpComboBoxFieldProperty = class(TbsDBStringProperty)
  281.     procedure GetValueList(List: TStrings); override;
  282.   end;
  283. procedure TbsSkinDBLookUpComboBoxFieldProperty.GetValueList(List: TStrings);
  284. var
  285.   DataSource: TDataSource;
  286.   LookUpControl: TbsDBLookUpControl;
  287. begin
  288.   DataSource := (GetComponent(0) as TbsSkinDBLookUpComboBox).ListSource;
  289.   if (DataSource <> nil) and (DataSource.DataSet <> nil) then
  290.     DataSource.DataSet.GetFieldNames(List);
  291. end;
  292. type
  293.   TbsSetPagesProperty = class(TPropertyEditor)
  294.   public
  295.     procedure Edit; override;
  296.     function GetAttributes: TPropertyAttributes; override;
  297.     function GetValue: string; override;
  298.     procedure SetValue(const Value: string); override;
  299.    end;
  300. procedure TbsSetPagesProperty.Edit;
  301. var
  302.   NB: TbsSkinNoteBook;
  303. begin
  304.   try
  305.     NB := TbsSkinNoteBook(GetComponent(0));
  306.     NBPagesEditor.Execute(NB);
  307.   finally
  308.   end;
  309. end;
  310. function TbsSetPagesProperty.GetAttributes: TPropertyAttributes;
  311. begin
  312.   Result := [paDialog];
  313. end;
  314. function TbsSetPagesProperty.GetValue: string;
  315. begin
  316.   Result := '(Pages)';
  317. end;
  318. procedure TbsSetPagesProperty.SetValue(const Value: string);
  319. begin
  320.   if Value = '' then SetOrdValue(0);
  321. end;
  322. { Registration }
  323. resourcestring
  324.   sNEW_PAGE = 'New page';
  325.   sDEL_PAGE = 'Delete page';
  326.   sNEW_STATUSPANEL = 'New panel';
  327.   sNEW_STATUSGAUGE = 'New gauge';
  328.   sNEW_STATUSEDIT = 'New edit';
  329.   sNEW_STATUSBUTTONEDIT = 'New edit with button';
  330.   sNEW_STATUSCOMBOBOX = 'New combobox';
  331.   sNEW_STATUSSPINEDIT = 'New spinedit';
  332.   sNEW_TOOLBUTTON = 'New button';
  333.   sNEW_TOOLMENUBUTTON = 'New button with dropdown menu';
  334.   sNEW_TOOLMENUTRACKBUTTON = 'New button with chevron and dropdown menu';
  335.   sNEW_TOOLSEPARATOR = 'New separator';
  336.   sNEW_TOOLCOMBOBOX = 'New combobox';
  337.   sNEW_TOOLEDIT = 'New edit';
  338.   sNEW_TOOLBUTTONEDIT = 'New edit with button';
  339.   sNEW_TOOLSPINEDIT = 'New spinedit';
  340. procedure Register;
  341. begin
  342.   RegisterComponents('BusinessSkinForm VCL',  [TbsBusinessSkinForm,
  343.     TbsSkinData, TbsResourceStrData,
  344.     TbsCompressedStoredSkin, TbsSkinMainMenuBar,
  345.     TbsSkinMDITabsBar,
  346.     TbsSkinPopupMenu, TbsSkinMainMenu, TbsTrayIcon,
  347.     TbsSkinPanel, TbsSkinGroupBox, TbsSkinExPanel, TbsSkinScrollPanel, 
  348.     TbsSkinRadioGroup, TbsSkinCheckGroup,
  349.     TbsSkinSpeedButton, TbsSkinMenuSpeedButton,
  350.     TbsSkinButton, TbsSkinCheckRadioBox,
  351.     TbsSkinGauge, TbsSkinTrackBar, TbsSkinLabel, TbsSkinStdlabel,  
  352.     TbsSkinHint, TbsSkinDrawGrid, TbsSkinStringGrid,
  353.     TbsSkinPageControl, TbsSkinTabControl,
  354.     TbsSkinListBox, TbsSkinComboBox, TbsSkinEdit, TbsSkinMaskEdit,
  355.     TbsSkinPasswordEdit,
  356.     TbsSkinMemo, TbsSkinMemo2,
  357.     TbsSkinScrollBar, TbsSkinSpinEdit, TbsSkinNumericEdit,
  358.     TbsSkinCheckListBox,  TbsSkinCheckComboBox, TbsSkinUpDown,
  359.     TbsSkinControlBar, TbsSkinToolBar,
  360.     TbsSkinSplitter, TbsSkinMenuButton,
  361.     TbsSkinScrollBox, TbsSkinColorComboBox, TbsSkinFontComboBox, TbsSkinFontSizeComboBox,
  362.     TbsSkinTreeView, TbsSkinListView, TbsSkinStatusBar, TbsSkinStatusPanel,
  363.     TbsSkinRichEdit, TbsSkinDateEdit, TbsSkinCalculator, TbsSkinCalcEdit,
  364.     TbsSkinZip, TbsSkinUnZip, TbsSkinTextLabel,
  365.     TbsSkinFileListBox, TbsSkinDirectoryListBox, TbsSkinDriveComboBox,
  366.     TbsSkinFilterComboBox, TbsSkinFileListView, TbsSkinDirTreeView,
  367.     TbsSkinShellDriveComboBox,  TbsSkinShellComboBox, 
  368.     TbsSkinDirectoryEdit, TbsSkinFileEdit, TbsSkinSaveFileEdit,
  369.     TbsSkinTrackEdit, TbsSkinHeaderControl, TbsSkinLinkLabel, TbsSkinLinkImage,
  370.     TbsSkinButtonLabel,  TbsSkinSlider, TbsSkinTimeEdit,
  371.     TbsSkinBevel, TbsSkinButtonsBar, TbsSkinNoteBook, TbsSkinMonthCalendar,
  372.     TbsSkinXFormButton, TbsSkinColorGrid]);
  373.   RegisterComponents('BusinessSkinForm DB VCL',
  374.     [TbsSkinDBGrid, TbsSkinDBText,
  375.      TbsSkinDBEdit, TbsSkinDBMemo, TbsSkinDBMemo2,
  376.      TbsSkinDBCheckRadioBox, TbsSkinDBListBox, TbsSkinDBComboBox,
  377.      TbsSkinDBNavigator, TbsSkinDBImage, TbsSkinDBRadioGroup,
  378.      TbsSkinDBSpinEdit, TbsSkinDBRichEdit,
  379.      TbsSkinDBLookUpListBox, TbsSkinDBLookUpComboBox,
  380.      TbsSkinDBCalcEdit, TbsSkinDBDateEdit, TbsSkinDBTimeEdit,
  381.      TbsSkinDBPasswordEdit, TbsSkinDBNumericEdit]);
  382.   RegisterComponents('BusinessSkinForm VCL Dialogs',
  383.     [TbsSkinMessage, TbsOpenSkinDialog, TbsSelectSkinDialog,
  384.      TbsSelectSkinsFromFoldersDialog,  
  385.      TbsSkinSelectDirectoryDialog,
  386.      TbsSkinOpenDialog, TbsSkinSaveDialog,
  387.      TbsSkinOpenPictureDialog, TbsSkinSavePictureDialog,
  388.      TbsSkinInputDialog, TbsSkinPasswordDialog, TbsSkinTextDialog,
  389.      TbsSkinFontDialog, TbsSkinProgressDialog, TbsSkinConfirmDialog,
  390.      TbsSkinColorDialog, TbsSkinSelectValueDialog]);
  391.   RegisterClass(TbsSkinTabSheet);
  392.   RegisterComponentEditor(TbsSkinPageControl, TbsSkinPageControlEditor);
  393.   RegisterComponentEditor(TbsSkinStatusBar, TbsSkinStatusBarEditor);
  394.   RegisterComponentEditor(TbsSkinToolBar, TbsSkinToolBarEditor);
  395.   RegisterComponentEditor(TbsSkinTabSheet, TbsSkinPageControlEditor);
  396.   RegisterPropertyEditor(TypeInfo(string), TbsColumn, 'FieldName', TbsColumnDataFieldProperty);
  397.   RegisterPropertyEditor(TypeInfo(string), TbsCompressedStoredSkin, 'FileName', TbsFilenameProperty);
  398.   RegisterPropertyEditor(TypeInfo(string), TbsCompressedStoredSkin, 'CompressedFileName', TbsFilenameProperty);
  399.   RegisterPropertyEditor(TypeInfo(string), TbsSkinDBLookUpListBox, 'KeyField', TbsSkinDBLookUpListBoxFieldProperty);
  400.   RegisterPropertyEditor(TypeInfo(string), TbsSkinDBLookUpListBox, 'ListField', TbsSkinDBLookUpListBoxFieldProperty);
  401.   RegisterPropertyEditor(TypeInfo(string), TbsSkinDBLookUpComboBox, 'KeyField', TbsSkinDBLookUpComboBoxFieldProperty);
  402.   RegisterPropertyEditor(TypeInfo(string), TbsSkinDBLookUpComboBox, 'ListField', TbsSkinDBLookUpComboBoxFieldProperty);
  403.   RegisterPropertyEditor(TypeInfo(string), TbsSkinButton, 'SkinDataName', TbsButtonSkinDataNameProperty);
  404.   RegisterPropertyEditor(TypeInfo(string), TbsSkinEdit, 'SkinDataName', TbsEditSkinDataNameProperty);
  405.   RegisterPropertyEditor(TypeInfo(string), TbsSkinTrackEdit, 'SkinDataName', TbsTrackEditSkinDataNameProperty);
  406.   RegisterPropertyEditor(TypeInfo(string), TbsSkinSpinEdit, 'SkinDataName', TbsSpinEditSkinDataNameProperty);
  407.   RegisterPropertyEditor(TypeInfo(string), TbsSkinDBNavigator, 'BtnSkinDataName', TbsButtonSkinDataNameProperty);
  408.   RegisterPropertyEditor(TypeInfo(string), TbsSkinButtonsBar, 'SectionButtonSkinDataName', TbsButtonSkinDataNameProperty);
  409.   RegisterPropertyEditor(TypeInfo(string), TbsSkinHeaderControl, 'SkinDataName', TbsButtonSkinDataNameProperty);
  410.   RegisterPropertyEditor(TypeInfo(string), TbsSkinListView, 'HeaderSkinDataName', TbsButtonSkinDataNameProperty);
  411.   RegisterPropertyEditor(TypeInfo(string), TbsSkinFileEdit, 'LVHeaderSkinDataName', TbsButtonSkinDataNameProperty);
  412.   RegisterPropertyEditor(TypeInfo(string), TbsSkinSaveFileEdit, 'LVHeaderSkinDataName', TbsButtonSkinDataNameProperty);
  413.   RegisterPropertyEditor(TypeInfo(string), TbsSkinOpenDialog, 'LVHeaderSkinDataName', TbsButtonSkinDataNameProperty);
  414.   RegisterPropertyEditor(TypeInfo(string), TbsSkinOpenPictureDialog, 'LVHeaderSkinDataName', TbsButtonSkinDataNameProperty);
  415.   RegisterPropertyEditor(TypeInfo(string), TbsSkinSaveDialog, 'LVHeaderSkinDataName', TbsButtonSkinDataNameProperty);
  416.   RegisterPropertyEditor(TypeInfo(string), TbsSkinSavePictureDialog, 'LVHeaderSkinDataName', TbsButtonSkinDataNameProperty);
  417.   RegisterPropertyEditor(TypeInfo(string), TbsSkinGauge, 'SkinDataName', TbsGaugeSkinDataNameProperty);
  418.   RegisterPropertyEditor(TypeInfo(string), TbsSkinMenuButton, 'SkinDataName', TbsMenuButtonSkinDataNameProperty);
  419.   RegisterPropertyEditor(TypeInfo(string), TbsSkinSpeedButton, 'SkinDataName', TbsButtonSkinDataNameProperty);
  420.   RegisterPropertyEditor(TypeInfo(string), TbsSkinMenuSpeedButton, 'SkinDataName', TbsMenuButtonSkinDataNameProperty);
  421.   RegisterPropertyEditor(TypeInfo(string), TbsSkinPanel, 'SkinDataName', TbsPanelSkinDataNameProperty);
  422.   RegisterPropertyEditor(TypeInfo(string), TbsSkinToolBar, 'SkinDataName', TbsToolBarSkinDataNameProperty);
  423.   RegisterPropertyEditor(TypeInfo(string), TbsSkinComboBox, 'SkinDataName', TbsComboBoxSkinDataNameProperty);
  424.   RegisterPropertyEditor(TypeInfo(string), TbsSkinListBox, 'SkinDataName', TbsListBoxSkinDataNameProperty);
  425.   RegisterPropertyEditor(TypeInfo(string), TbsSkinCheckListBox, 'SkinDataName', TbsCheckListBoxSkinDataNameProperty);
  426.   RegisterPropertyEditor(TypeInfo(string), TbsSkinSplitter, 'SkinDataName', TbsSplitterSkinDataNameProperty);
  427.   RegisterPropertyEditor(TypeInfo(TStrings),  TbsSkinNoteBook, 'Pages', TbsSetPagesProperty);
  428.   //
  429.   RegisterPropertyEditor(TypeInfo(TRoot), TbsSkinDirTreeView, 'Root', TbsRootProperty);
  430.   RegisterPropertyEditor(TypeInfo(TRoot), TbsSkinFileListView, 'Root', TbsRootProperty);
  431.   RegisterPropertyEditor(TypeInfo(TRoot), TbsSkinShellComboBox, 'Root', TbsRootProperty);
  432.   RegisterComponentEditor(TbsSkinDirTreeView, TbsRootEditor);
  433.   RegisterComponentEditor(TbsSkinFileListView, TbsRootEditor);
  434.   RegisterComponentEditor(TbsSkinShellComboBox, TbsRootEditor);
  435.   //
  436. end;
  437. function TbsSkinPageControlEditor.GetVerb(Index: Integer): string;
  438. begin
  439.   case Index of
  440.     0:  result := sNEW_PAGE;
  441.     1:  result := sDEL_PAGE;
  442.   end;
  443. end;
  444. procedure TbsSkinPageControlEditor.ExecuteVerb(Index: Integer);
  445. var
  446.   NewPage: TbsSkinCustomTabSheet;
  447.   PControl : TbsSkinPageControl;
  448. begin
  449.   if Component is TbsSkinPageControl then
  450.     PControl := TbsSkinPageControl(Component)
  451.   else PControl := TbsSkinPageControl(TbsSkinTabSheet(Component).PageControl);
  452.   case Index of
  453.     0:  begin
  454.           NewPage := TbsSkinTabSheet.Create(Designer.GetRoot);
  455.           with NewPage do
  456.           begin
  457.             Parent := PControl;
  458.             PageControl := PControl;
  459.             Name := Designer.UniqueName(ClassName);
  460.             Caption := Name;
  461.           end;
  462.         end;
  463.     1:  begin  
  464.           with PControl do
  465.           begin
  466.             NewPage := TbsSkinCustomTabSheet(ActivePage);
  467.             NewPage.PageControl := nil;
  468.             NewPage.Free;
  469.           end;
  470.         end;
  471.   end;
  472.   if Designer <> nil then Designer.Modified;
  473. end;
  474. function TbsSkinPageControlEditor.GetVerbCount: Integer;
  475. begin
  476.   Result := 2;
  477. end;
  478. procedure TbsSkinStatusBarEditor.ExecuteVerb(Index: Integer);
  479. var
  480.   NewPanel: TbsSkinStatusPanel;
  481.   NewGauge: TbsSkinGauge;
  482.   NewEdit: TbsSkinEdit;
  483.   NewSpinEdit: TbsSkinSpinEdit;
  484.   NewComboBox: TbsSkinComboBox;
  485.   PControl : TbsSkinStatusBar;
  486. begin
  487.   if Component is TbsSkinStatusBar
  488.   then
  489.     PControl := TbsSkinStatusBar(Component)
  490.   else
  491.     Exit;
  492.   case Index of
  493.     0:  begin
  494.           NewPanel := TbsSkinStatusPanel.Create(Designer.GetRoot);
  495.           with NewPanel do
  496.           begin
  497.             Left := PControl.Width;
  498.             Parent := PControl;
  499.             Align := alLeft;
  500.             Name := Designer.UniqueName(ClassName);
  501.             SkinData := PControl.SkinData;
  502.             Designer.SelectComponent(NewPanel);
  503.           end;
  504.         end;
  505.     1:  begin
  506.           NewGauge := TbsSkinGauge.Create(Designer.GetRoot);
  507.           with NewGauge do
  508.           begin
  509.             Left := PControl.Width;
  510.             SkinDataName := 'statusgauge';
  511.             Parent := PControl;
  512.             Align := alLeft;
  513.             Name := Designer.UniqueName(ClassName);
  514.             SkinData := PControl.SkinData;
  515.             Designer.SelectComponent(NewGauge);
  516.           end;
  517.         end;
  518.     2:
  519.        begin
  520.          NewEdit := TbsSkinEdit.Create(Designer.GetRoot);
  521.           with NewEdit do
  522.           begin
  523.             Left := PControl.Width;
  524.             SkinDataName := 'statusedit';
  525.             Parent := PControl;
  526.             Align := alLeft;
  527.             Name := Designer.UniqueName(ClassName);
  528.             SkinData := PControl.SkinData;
  529.             Designer.SelectComponent(NewEdit);
  530.           end;
  531.        end;
  532.     3:
  533.        begin
  534.          NewEdit := TbsSkinEdit.Create(Designer.GetRoot);
  535.          with NewEdit do
  536.          begin
  537.            ButtonMode := True;
  538.            Left := PControl.Width;
  539.            SkinDataName := 'statusbuttonedit';
  540.            Parent := PControl;
  541.            Align := alLeft;
  542.            Name := Designer.UniqueName(ClassName);
  543.            SkinData := PControl.SkinData;
  544.            Designer.SelectComponent(NewEdit);
  545.          end;
  546.        end;
  547.     4:
  548.        begin
  549.          NewSpinEdit := TbsSkinSpinEdit.Create(Designer.GetRoot);
  550.          with NewSpinEdit do
  551.          begin
  552.            Left := PControl.Width;
  553.            SkinDataName := 'statusspinedit';
  554.            Parent := PControl;
  555.            Align := alLeft;
  556.            Name := Designer.UniqueName(ClassName);
  557.            SkinData := PControl.SkinData;
  558.            Designer.SelectComponent(NewEdit);
  559.          end;
  560.        end;
  561.      5:
  562.        begin
  563.          NewComboBox := TbsSkinComboBox.Create(Designer.GetRoot);
  564.          with NewComboBox do
  565.          begin
  566.            Left := PControl.Width;
  567.            SkinDataName := 'statuscombobox';
  568.            Parent := PControl;
  569.            Align := alLeft;
  570.            Name := Designer.UniqueName(ClassName);
  571.            SkinData := PControl.SkinData;
  572.            Designer.SelectComponent(NewEdit);
  573.          end;
  574.        end;
  575.   end;
  576.   if Designer <> nil then Designer.Modified;
  577. end;
  578. function TbsSkinStatusBarEditor.GetVerbCount: Integer;
  579. begin
  580.   Result := 6;
  581. end;
  582. function TbsSkinStatusBarEditor.GetVerb(Index: Integer): string;
  583. begin
  584.   case Index of
  585.     0: Result := sNEW_STATUSPANEL;
  586.     1: Result := sNEW_STATUSGAUGE;
  587.     2: Result := sNEW_STATUSEDIT;
  588.     3: Result := sNEW_STATUSBUTTONEDIT;
  589.     4: Result := sNEW_STATUSSPINEDIT;
  590.     5: Result := sNEW_STATUSCOMBOBOX;
  591.   end;
  592. end;
  593. procedure TbsSkinToolBarEditor.ExecuteVerb(Index: Integer);
  594. var
  595.   NewSpeedButton: TbsSkinSpeedButton;
  596.   NewMenuSpeedButton: TbsSkinMenuSpeedButton;
  597.   NewBevel: TbsSkinBevel;
  598.   NewEdit: TbsSkinEdit;
  599.   NewSpinEdit: TbsSkinSpinEdit;
  600.   NewComboBox: TbsSkinComboBox;
  601.   PControl : TbsSkinToolBar;
  602. begin
  603.   if Component is TbsSkinToolBar
  604.   then
  605.     PControl := TbsSkinToolBar(Component)
  606.   else
  607.     Exit;
  608.   case Index of
  609.     0:  begin
  610.           NewSpeedButton := TbsSkinSpeedButton.Create(Designer.GetRoot);
  611.           with NewSpeedButton do
  612.           begin
  613.             Flat := PControl.Flat;
  614.             SkinData := PControl.SkinData;
  615.             Left := PControl.Width;
  616.             Parent := PControl;
  617.             Align := alLeft;
  618.             Name := Designer.UniqueName(ClassName);
  619.             if PControl.SkinDataName = 'bigtoolpanel'
  620.             then
  621.               SkinDataName := 'bigtoolbutton'
  622.             else
  623.               SkinDataName := 'toolbutton';
  624.             Designer.SelectComponent(NewSpeedButton);
  625.           end;
  626.         end;
  627.     1:  begin
  628.           NewMenuSpeedButton := TbsSkinMenuSpeedButton.Create(Designer.GetRoot);
  629.           with NewMenuSpeedButton do
  630.           begin
  631.             Flat := PControl.Flat;
  632.             SkinData := PControl.SkinData;
  633.             Left := PControl.Width;
  634.             Parent := PControl;
  635.             Align := alLeft;
  636.             Name := Designer.UniqueName(ClassName);
  637.             if PControl.SkinDataName = 'bigtoolpanel'
  638.             then
  639.               SkinDataName := 'bigtoolmenubutton'
  640.             else
  641.               SkinDataName := 'toolmenubutton';
  642.             Designer.SelectComponent(NewMenuSpeedButton);
  643.           end;
  644.         end;
  645.     2:  begin
  646.           NewMenuSpeedButton := TbsSkinMenuSpeedButton.Create(Designer.GetRoot);
  647.           with NewMenuSpeedButton do
  648.           begin
  649.             Flat := PControl.Flat;
  650.             SkinData := PControl.SkinData;
  651.             Left := PControl.Width;
  652.             TrackButtonMode := True;
  653.             Parent := PControl;
  654.             Align := alLeft;
  655.             Name := Designer.UniqueName(ClassName);
  656.             if PControl.SkinDataName = 'bigtoolpanel'
  657.             then
  658.               SkinDataName := 'bigtoolmenutrackbutton'
  659.             else
  660.               SkinDataName := 'toolmenutrackbutton';
  661.             Designer.SelectComponent(NewMenuSpeedButton);
  662.           end;
  663.         end;
  664.     3: begin
  665.           NewBevel := TbsSkinBevel.Create(Designer.GetRoot);
  666.           with NewBevel do
  667.           begin
  668.             SkinData := PControl.SkinData;
  669.             Left := PControl.Width;
  670.             Width := 25;
  671.             DividerMode := True;
  672.             Parent := PControl;
  673.             Align := alLeft;
  674.             Name := Designer.UniqueName(ClassName);
  675.             Designer.SelectComponent(NewBevel);
  676.           end;
  677.         end;
  678.      4:
  679.        begin
  680.          NewEdit := TbsSkinEdit.Create(Designer.GetRoot);
  681.           with NewEdit do
  682.           begin
  683.             Left := PControl.Width;
  684.             SkinDataName := 'tooledit';
  685.             Parent := PControl;
  686.             Align := alLeft;
  687.             Name := Designer.UniqueName(ClassName);
  688.             SkinData := PControl.SkinData;
  689.             Designer.SelectComponent(NewEdit);
  690.           end;
  691.        end;
  692.     5:
  693.        begin
  694.          NewEdit := TbsSkinEdit.Create(Designer.GetRoot);
  695.          with NewEdit do
  696.          begin
  697.            ButtonMode := True;
  698.            Left := PControl.Width;
  699.            SkinDataName := 'toolbuttonedit';
  700.            Parent := PControl;
  701.            Align := alLeft;
  702.            Name := Designer.UniqueName(ClassName);
  703.            SkinData := PControl.SkinData;
  704.            Designer.SelectComponent(NewEdit);
  705.          end;
  706.        end;
  707.     6:
  708.        begin
  709.          NewSpinEdit := TbsSkinSpinEdit.Create(Designer.GetRoot);
  710.          with NewSpinEdit do
  711.          begin
  712.            Left := PControl.Width;
  713.            SkinDataName := 'toolspinedit';
  714.            Parent := PControl;
  715.            Align := alLeft;
  716.            Name := Designer.UniqueName(ClassName);
  717.            SkinData := PControl.SkinData;
  718.            Designer.SelectComponent(NewEdit);
  719.          end;
  720.        end;
  721.     7:
  722.        begin
  723.          NewComboBox := TbsSkinComboBox.Create(Designer.GetRoot);
  724.          with NewComboBox do
  725.          begin
  726.            Left := PControl.Width;
  727.            SkinDataName := 'toolcombobox';
  728.            Parent := PControl;
  729.            Align := alLeft;
  730.            Name := Designer.UniqueName(ClassName);
  731.            SkinData := PControl.SkinData;
  732.            Designer.SelectComponent(NewEdit);
  733.          end;
  734.        end;
  735.   end;
  736.   if Designer <> nil then Designer.Modified;
  737. end;
  738. function TbsSkinToolBarEditor.GetVerbCount: Integer;
  739. begin
  740.   Result := 8;
  741. end;
  742. function TbsSkinToolBarEditor.GetVerb(Index: Integer): string;
  743. begin
  744.   case Index of
  745.     0: Result := sNEW_TOOLBUTTON;
  746.     1: Result := sNEW_TOOLMENUBUTTON;
  747.     2: Result := sNEW_TOOLMENUTRACKBUTTON;
  748.     3: Result := sNEW_TOOLSEPARATOR;
  749.     4: Result := sNEW_TOOLEDIT;
  750.     5: Result := sNEW_TOOLBUTTONEDIT;
  751.     6: Result := sNEW_TOOLSPINEDIT;
  752.     7: Result := sNEW_TOOLCOMBOBOX;
  753.   end;
  754. end;
  755. end.