📄 spreg.pas
字号:
{*******************************************************************}
{ }
{ Almediadev Visual Component Library }
{ DynamicSkinForm }
{ Version 6.85 }
{ }
{ Copyright (c) 2000-2004 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,
{$IFNDEF VER130} DesignEditors, DesignIntf {$ELSE} DsgnIntf {$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, spRootEdit, SkinPrinter,
spCategoryButtons, spButtonGroup;
{ 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');
List.Add('resizebutton');
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, TspCompressedStoredSkin, TspResourceStrData,
TspSkinMainMenuBar, TspSkinMDITabsBar, TspSkinPopupMenu,
TspSkinMainMenu, TspTrayIcon, TspSkinHint, TspSkinZip, TspSkinUnZip,
TspSkinScrollBar,
TspSkinCheckRadioBox, TspSkinButton, TspSkinMenuButton,
TspSkinSpeedButton, TspSkinMenuSpeedButton, TspSkinXFormButton,
TspSkinUpDown,
TspSkinStdLabel, TspSkinLabel, TspSkinBitLabel, TspSkinTextLabel,
TspSkinLinkLabel, TspSkinLinkImage, TspSkinButtonLabel, TspSkinBevel,
TspSkinSplitter,
TspSkinListBox, TspSkinComboBox, TspSkinMRUComboBox,
TspSkinColorComboBox, TspSkinColorListBox,
TspSkinFontComboBox, TspSkinFontListBox,
TspSkinFontSizeComboBox,
TspSkinEdit, TspSkinMaskEdit,
TspSkinPasswordEdit, TspSkinNumericEdit, TspSkinMonthCalendar,
TspSkinDateEdit, TspSkinTimeEdit,
TspSkinTrackEdit, TspSkinURLEdit,
TspSkinMemo, TspSkinMemo2, TspSkinRichEdit,
TspSkinSpinEdit, TspSkinCheckListBox, TspSkinCheckComboBox,
TspSkinPanel, TspSkinGroupBox, TspSkinExPanel, TspSkinScrollPanel,
TspSkinPaintPanel,
TspSkinRadioGroup, TspSkinCheckGroup,
TspSkinControlBar, TspSkinToolBar, TspSkinStatusBar, TspSkinStatusPanel,
TspSkinButtonsBar, TspSkinNoteBook, TspSkinScrollBox, TspSkinHeaderControl,
TspSkinPageControl, TspSkinTabControl,
TspSkinListView, TspSkinTreeView, TspSkinDrawGrid, TspSkinStringGrid,
TspSkinTrackBar, TspSkinSlider, TspSkinGauge,
TspSkinFrameRegulator, TspSkinFrameGauge,
TspSkinAnimate, TspSkinSwitch,
TspSkinFileListView, TspSkinDirTreeView, TspSkinShellDriveComboBox,
TspSkinShellComboBox,
TspSkinDriveComboBox, TspSkinFilterComboBox,
TspSkinDirectoryListBox, TspSkinFileListBox,
TspSkinDirectoryEdit, TspSkinFileEdit, TspSkinSaveFileEdit,
TspSkinColorGrid,
TspSkinCategoryButtons, TspSkinButtonGroup ]);
RegisterComponents('Skin Pack Dialogs', [TspSkinMessage, TspSkinSelectDirectoryDialog,
TspOpenSkinDialog, TspSelectSkinDialog, TspSelectSkinsFromFoldersDialog,
TspSkinOpenDialog, TspSkinSaveDialog,
TspSkinOpenPictureDialog, TspSkinSavePictureDialog, TspSkinFontDialog,
TspSkinInputDialog, TspSkinPasswordDialog, TspSkinConfirmDialog,
TspSkinProgressDialog, TspSkinTextDialog,
TspSkinColorDialog, TspSkinSelectValueDialog,
TspSkinPrintDialog, TspSkinPrinterSetupDialog, TspSkinSmallPrintDialog,
TspSkinPageSetupDialog,
TspSkinFindDialog, TspSkinReplaceDialog,
TspSkinOpenPreviewDialog, TspSkinSavePreviewDialog,
TspSkinOpenSoundDialog, TspSkinSaveSoundDialog]);
RegisterClass(TspSkinTabSheet);
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 + -