⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spreg.pas

📁 P2P即时通讯源码(DELPHI编写)
💻 PAS
📖 第 1 页 / 共 2 页
字号:
{*******************************************************************}
{                                                                   }
{       Almediadev Visual Component Library                         }
{       DynamicSkinForm                                             }
{       Version 5.60                                                }
{                                                                   }
{       Copyright (c) 2000-2003 Almediadev                          }
{       ALL RIGHTS RESERVED                                         }
{                                                                   }
{       Home:  http://www.almdev.com                                }
{       Support: support@almdev.com                                 }
{                                                                   }
{*******************************************************************}

unit spreg;

{$P+,S-,W-,R-}
{$WARNINGS OFF}
{$HINTS OFF}

interface

uses Classes, Menus, Dialogs, Forms, Controls,
    {$IFDEF  VER140} DesignEditors, DesignIntf
    {$ELSE} {$IFDEF  VER150} DesignEditors, DesignIntf {$ELSE} DsgnIntf {$ENDIF} {$ENDIF};

type
  TspSkinStatusBarEditor = class(TDefaultEditor)
  public
    procedure ExecuteVerb(Index: Integer); override;
    function GetVerb(Index: Integer): string; override;
    function GetVerbCount: Integer; override;
  end;

  TspSkinToolBarEditor = class(TDefaultEditor)
  public
    procedure ExecuteVerb(Index: Integer); override;
    function GetVerb(Index: Integer): string; override;
    function GetVerbCount: Integer; override;
  end;

  TspSkinPageControlEditor = class(TDefaultEditor)
  public
    procedure ExecuteVerb(Index: Integer); override;
    function GetVerb(Index: Integer): string; override;
    function GetVerbCount: Integer; override;
  end;

procedure Register;

implementation

uses
  SPUtils, SPEffBMP, DynamicSkinForm, SkinData, SkinCtrls, SkinHint, SkinGrids,
  SkinTabs, SysUtils, SkinBoxCtrls, SkinMenus, spTrayIcon, spMessages,
  spSkinZip, spSkinUnZip, spFileCtrl, spSkinShellCtrls, spNBPagesEditor,
  spCalendar, spColorCtrls, spDialogs;

  { TFilenameProperty }
type
  TspFilenameProperty = class(TStringProperty)
  public
    procedure Edit; override;
    function GetAttributes: TPropertyAttributes; override;
  end;

  TspSkinDataNameProperty = class(TStringProperty)
  public
    function GetAttributes: TPropertyAttributes; override;
    procedure GetValueList(List: TStrings); virtual;
    procedure GetValues(Proc: TGetStrProc); override;
  end;

  TspButtonSkinDataNameProperty = class(TspSkinDataNameProperty)
  public
    procedure GetValueList(List: TStrings); override;
  end;

  TspEditSkinDataNameProperty = class(TspSkinDataNameProperty)
  public
    procedure GetValueList(List: TStrings); override;
  end;

  TspSpinEditSkinDataNameProperty = class(TspSkinDataNameProperty)
  public
    procedure GetValueList(List: TStrings); override;
  end;

  TspGaugeSkinDataNameProperty = class(TspSkinDataNameProperty)
  public
    procedure GetValueList(List: TStrings); override;
  end;

  TspMenuButtonSkinDataNameProperty = class(TspSkinDataNameProperty)
  public
    procedure GetValueList(List: TStrings); override;
  end;

  TspPanelSkinDataNameProperty = class(TspSkinDataNameProperty)
  public
    procedure GetValueList(List: TStrings); override;
  end;

  TspListBoxSkinDataNameProperty = class(TspSkinDataNameProperty)
  public
    procedure GetValueList(List: TStrings); override;
  end;

  TspCheckListBoxSkinDataNameProperty = class(TspSkinDataNameProperty)
  public
    procedure GetValueList(List: TStrings); override;
  end;

  TspComboBoxSkinDataNameProperty = class(TspSkinDataNameProperty)
  public
    procedure GetValueList(List: TStrings); override;
  end;


  TspSplitterSkinDataNameProperty = class(TspSkinDataNameProperty)
  public
    procedure GetValueList(List: TStrings); override;
  end;

  procedure TspSkinDataNameProperty.GetValueList(List: TStrings);
  begin
  end;

  procedure TspSkinDataNameProperty.GetValues(Proc: TGetStrProc);
  var
    I: Integer;
    Values: TStringList;
  begin
    Values := TStringList.Create;
    try
      GetValueList(Values);
      for I := 0 to Values.Count - 1 do Proc(Values[I]);
    finally
      Values.Free;
    end;
  end;

  function TspSkinDataNameProperty.GetAttributes: TPropertyAttributes;
  begin
    Result := [paValueList, paMultiSelect];
  end;

  procedure TspEditSkinDataNameProperty.GetValueList(List: TStrings);
  begin
    List.Add('edit');
    List.Add('buttonedit');
    List.Add('statusedit');
    List.Add('statusbuttonedit');
    List.Add('tooledit');
    List.Add('toolbuttonedit');
  end;

  procedure TspSpinEditSkinDataNameProperty.GetValueList(List: TStrings);
  begin
    List.Add('spinedit');
    List.Add('statusspinedit');
    List.Add('toolspinedit');
  end;

  procedure TspButtonSkinDataNameProperty.GetValueList(List: TStrings);
  begin
    List.Add('button');
    List.Add('resizebutton');
    List.Add('toolbutton');
    List.Add('bigtoolbutton');
  end;

  procedure TspGaugeSkinDataNameProperty.GetValueList(List: TStrings);
  begin
    List.Add('gauge');
    List.Add('vgauge');
    List.Add('statusgauge');
  end;

  procedure TspMenuButtonSkinDataNameProperty.GetValueList(List: TStrings);
  begin
    List.Add('toolmenubutton');
    List.Add('bigtoolmenubutton');
    List.Add('toolmenutrackbutton');
    List.Add('bigtoolmenutrackbutton');
  end;

  procedure TspPanelSkinDataNameProperty.GetValueList(List: TStrings);
  begin
    List.Add('panel');
    List.Add('toolpanel');
    List.Add('bigtoolpanel');
    List.Add('statusbar');
    List.Add('groupbox');
  end;

  procedure TspListBoxSkinDataNameProperty.GetValueList(List: TStrings);
  begin
    List.Add('listbox');
    List.Add('captionlistbox');
  end;

  procedure TspCheckListBoxSkinDataNameProperty.GetValueList(List: TStrings);
  begin
    List.Add('checklistbox');
    List.Add('captionchecklistbox');
  end;

  procedure TspComboBoxSkinDataNameProperty.GetValueList(List: TStrings);
  begin
    List.Add('combobox');
    List.Add('captioncombobox');
    List.Add('statuscombobox');
    List.Add('toolcombobox');
  end;

  procedure TspSplitterSkinDataNameProperty.GetValueList(List: TStrings);
  begin
    List.Add('vsplitter');
    List.Add('hsplitter');
  end;

  procedure TspFilenameProperty.Edit;
  var
    FileOpen: TOpenDialog;
  begin
    FileOpen := TOpenDialog.Create(Application);
    try
      FileOpen.Filename := '';
      FileOpen.InitialDir := ExtractFilePath(FileOpen.Filename);
      FileOpen.Filter := '*.*|*.*';
      FileOpen.Options := FileOpen.Options + [ofHideReadOnly];
      if FileOpen.Execute then SetValue(FileOpen.Filename);
    finally
      FileOpen.Free;
    end;
  end;

  function TspFilenameProperty.GetAttributes: TPropertyAttributes;
  begin
    Result := [paDialog , paRevertable];
  end;

type
  TspSetPagesProperty = class(TPropertyEditor)
  public
    procedure Edit; override;
    function GetAttributes: TPropertyAttributes; override;
    function GetValue: string; override;
    procedure SetValue(const Value: string); override;
   end;

procedure TspSetPagesProperty.Edit;
var
  NB: TspSkinNoteBook;
begin
  try
    NB := TspSkinNoteBook(GetComponent(0));
    spNBPagesEditor.Execute(NB);
  finally
  end;
end;

function TspSetPagesProperty.GetAttributes: TPropertyAttributes;
begin
  Result := [paDialog];
end;

function TspSetPagesProperty.GetValue: string;
begin
  Result := '(Pages)';
end;      

procedure TspSetPagesProperty.SetValue(const Value: string);
begin
  if Value = '' then SetOrdValue(0);
end;


{ Registration }

resourcestring
  sNEW_PAGE = 'New page';
  sDEL_PAGE = 'Delete page';

  sNEW_STATUSPANEL = 'New panel';
  sNEW_STATUSGAUGE = 'New gauge';
  sNEW_STATUSEDIT = 'New edit';
  sNEW_STATUSBUTTONEDIT = 'New edit with button';
  sNEW_STATUSCOMBOBOX = 'New combobox';
  sNEW_STATUSSPINEDIT = 'New spinedit';

  sNEW_TOOLBUTTON = 'New button';
  sNEW_TOOLMENUBUTTON = 'New button with tracking menu';
  sNEW_TOOLMENUTRACKBUTTON = 'New button with chevron and tracking menu';
  sNEW_TOOLSEPARATOR = 'New separator';
  sNEW_TOOLCOMBOBOX = 'New combobox';
  sNEW_TOOLEDIT = 'New edit';
  sNEW_TOOLBUTTONEDIT = 'New edit with button';
  sNEW_TOOLSPINEDIT = 'New spinedit';

procedure Register;
begin
  RegisterComponents('Skin Pack',  [TspDynamicSkinForm,
    TspSkinData, TspStoredSkin, TspCompressedStoredSkin, TspSkinMainMenuBar,
    TspSkinMDITabsBar,
    TspSkinPopupMenu, TspSkinMainMenu, TspTrayIcon,
    TspSkinPanel, TspSkinGroupBox, TspSkinExPanel, TspSkinScrollPanel,
    TspSkinRadioGroup, TspSkinCheckGroup,
    TspSkinButton, TspSkinMenuButton,
    TspSkinSpeedButton, TspSkinMenuSpeedButton,
    TspSkinCheckRadioBox,
    TspSkinGauge, TspSkinTrackBar, TspSkinLabel, TspSkinStdLabel, TspSkinBitLabel,
    TspSkinFrameRegulator,
    TspSkinFrameGauge,
    TspSkinXFormButton,
    TspSkinHint, TspSkinDrawGrid, TspSkinStringGrid,
    TspSkinPageControl, TspSkinTabControl,
    TspSkinListBox, TspSkinComboBox, TspSkinEdit, TspSkinMaskEdit,
    TspSkinPasswordEdit, TspSkinNumericEdit,
    TspSkinMemo, TspSkinMemo2,
    TspSkinScrollBar, TspSkinSpinEdit, TspSkinCheckListBox,
    TspSkinAnimate, TspSkinSwitch, TspSkinUpDown,
    TspSkinControlBar, TspSkinToolBar, TspSkinStatusBar,
    TspSkinSplitter,
    TspSkinScrollBox, TspSkinColorComboBox, TspSkinFontComboBox,
    TspSkinListView, TspSkinTreeView, TspSkinStatusPanel,
    TspSkinRichEdit, TspSkinDateEdit, TspSkinTimeEdit,
    TspSkinMessage, TspSkinZip, TspSkinUnZip, TspSkinTextLabel,
    TspSkinFileListView, TspSkinDirTreeView, TspSkinShellDriveComboBox,
    TspSkinDriveComboBox, TspSkinFilterComboBox,
    TspSkinDirectoryListBox, TspSkinFileListBox,
    TspSkinDirectoryEdit, TspSkinFileEdit, TspSkinSaveFileEdit,
    TspSkinHeaderControl, TspSkinTrackEdit, TspSkinSlider,
    TspSkinLinkLabel, TspSkinLinkImage, TspSkinButtonLabel, TspSkinBevel,
    TspSkinButtonsBar, TspSkinNoteBook, TspSkinMonthCalendar,
    TspSkinColorGrid]);

 RegisterComponents('Skin Pack Dialogs', [ TspSkinSelectDirectoryDialog,
    TspSkinOpenDialog, TspSkinSaveDialog,
    TspSkinOpenPictureDialog, TspSkinSavePictureDialog, TspSkinFontDialog,
    TspSkinInputDialog, TspSkinPasswordDialog, TspSkinConfirmDialog,
    TspSkinProgressDialog, TspSkinTextDialog,
    TspSkinColorDialog]);

  RegisterClass(TspSkinTabSheet);

  RegisterPropertyEditor(TypeInfo(string), TspStoredSkin, 'FileName', TspFilenameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspCompressedStoredSkin, 'FileName', TspFilenameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspCompressedStoredSkin, 'CompressedFileName', TspFilenameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinListView, 'HeaderSkinDataName', TspButtonSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinOpenDialog, 'LVHeaderSkinDataName', TspButtonSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinSaveDialog, 'LVHeaderSkinDataName', TspButtonSkinDataNameProperty);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -