📄 sxskinlibrary.pas
字号:
procedure SaveToStream(S:TStream;const RootPath:String); override;
procedure LoadFromStream(S:TStream;Version:Integer;
const RootPath,ZipFilePath:String); override;
constructor Create;
destructor Destroy; override;
end;
TSXFontData=record
SetFontName:Boolean;
SetFontSize:Boolean;
SetFontStyle:Boolean;
SetFontColor:Boolean;
SetHasShadow:Boolean;
SetShadowColor:Boolean;
SetSmoothLevel:Boolean;
SetDoPrepaint:Boolean;
//
FontName:String;
FontSize:Integer;
FontStyle:TFontStyles;
FontColor:TColor32;
HasShadow:Boolean;
ShadowColor:TColor32;
SmoothLevel:Integer;
DoPrepaint:Boolean;
end;
TSXSkinStyleTextElement=class(TSXSkinStyleElement)
public
Alignment:TAlignment;
VerticalAlignment:TVerticalAlignment;
RectValue:String;
Text:String;
FontData:TSXFontData;
TextRect:TRect;
procedure Assign(Element:TSXSkinStyleElement); override;
function GetCopy:TSXSkinStyleElement; override;
procedure DrawToBitmap(B:TBitmap32;X,Y:Integer);
function OnGetVariable(const VarName:String;var Error:Boolean):Single;
procedure EvalPrePaintParams(Control:TControl;CElementID:Integer;
VComparer:TSXVariableComparer=nil;Changed:Boolean=False);
procedure SetProperty(const Name,Value,SkinFilePath:String); override;
procedure SaveToStream(S:TStream;const RootPath:String); override;
procedure LoadFromStream(S:TStream;Version:Integer;
const RootPath,ZipFilePath:String); override;
end;
TSXSkinStyleType=(sstUnknown,
sstGeneral,
sstLabel,
sstCheckBox,
sstRadioButton,
sstGroupBox,
sstMultiState,
sstMultiStateCheck,
sstButton,
sstEdit,
sstSelective,
sstForm,
sstUpDown,
sstSpinEdit);
TSXSkinStyleList=class;
TSXSkinStyle=class
public
Name:String;
BasedOnList:TStringList;
procedure AssignStyle(Style:TSXSkinStyle); virtual;
procedure SetParameter(const Name,Value:String); virtual;
procedure SaveToStream(S:TStream;const RootPath:String); virtual;
procedure LoadFromStream(S:TStream;Version:Integer;
const RootPath,ZipFilePath:String;DestList1,DestList2:TSXSkinStyleList); virtual;
constructor Create;
destructor Destroy; override;
end;
TSXSkinGeneralStyle=class(TSXSkinStyle)
public
ZipFilePath:String;
SkinFilePath:String;
SetTransparent:Boolean;
SetUseBuffering:Boolean;
SetMouseCaptureByTransparency:Boolean;
SetMouseCaptureTransparencyLimit:Boolean;
SetMouseCaptureRegion:Boolean;
//
Transparent:Boolean;
UseBuffering:Boolean;
MouseCaptureByTransparency:Boolean;
MouseCaptureTransparencyLimit:Integer;
MouseCaptureRegion:String;
Elements:TSXSkinStyleElementList;
//
TmpWidth:Integer;
TmpHeight:Integer;
TmpOnGetVariable:TSXOnGetVariable;
procedure AssignStyle(Style:TSXSkinStyle); override;
procedure SetParameter(const Name,Value:String); override;
procedure DrawToBitmap(Control:TControl;CElementID:Integer;
Bitmap:TBitmap32;X,Y,Width,Height:Integer;Rect:TRect;Rgn:HRGN;
SkinLibrary:TSXSkinLibrary;VComparer:TSXVariableComparer=nil;
ForceEvalParams:Boolean=False);
function NestedOnGetVariable(const VarName:String;var Error:Boolean):Single;
function NeedToPaintBackground:Boolean;
function IsTransparent(Control:TControl;CElementID:Integer;
X,Y,Width,Height:Integer;SkinLibrary:TSXSkinLibrary;Limit:Integer=10;
VComparer:TSXVariableComparer=nil;ForceEvalParams:Boolean=False):Boolean;
function CapturesMouseAt(Control:TControl;CElementID:Integer;
X,Y,Width,Height:Integer;SkinLibrary:TSXSkinLibrary;
VComparer:TSXVariableComparer=nil):Boolean;
procedure SaveToStream(S:TStream;const RootPath:String); override;
procedure LoadFromStream(S:TStream;Version:Integer;
const RootPath,ZipFilePath:String;DestList1,DestList2:TSXSkinStyleList); override;
constructor Create;
destructor Destroy; override;
end;
TSXSkinSelectiveStyle=class(TSXSkinStyle)
public
Conditions:TStringList;
Styles:TStringList;
DefaultStyle:String;
procedure AssignStyle(Style:TSXSkinStyle); override;
procedure SetParameter(const Name,Value:String); override;
function GetAppropriateStyle(AOnGetVariable:TSXOnGetVariable):String;
procedure SaveToStream(S:TStream;const RootPath:String); override;
procedure LoadFromStream(S:TStream;Version:Integer;
const RootPath,ZipFilePath:String;DestList1,DestList2:TSXSkinStyleList); override;
constructor Create;
destructor Destroy; override;
end;
TSXSkinLabelStateParam=record
FD:TSXFontData;
end;
PSXSkinLabelStateParam=^TSXSkinLabelStateParam;
TSXSkinLabelStyle=class(TSXSkinStyle)
public
NState:TSXSkinLabelStateParam;
HState:TSXSkinLabelStateParam;
RState:TSXSkinLabelStateParam;
procedure AssignStyle(Style:TSXSkinStyle); override;
procedure SetParameter(const Name,Value:String); override;
procedure SaveToStream(S:TStream;const RootPath:String); override;
procedure LoadFromStream(S:TStream;Version:Integer;
const RootPath,ZipFilePath:String;DestList1,DestList2:TSXSkinStyleList); override;
end;
TSXSkinCheckBoxStateParam=record
SetStyle:Boolean;
SetOverStyle:Boolean;
SetGlyphStyle:Boolean;
SetGlyphWidth:Boolean;
SetGlyphHeight:Boolean;
//
Style:String;
OverStyle:String;
GlyphStyle:String;
GlyphWidth:Integer;
GlyphHeight:Integer;
FD:TSXFontData;
//
SetCaptionLeftOffset:Boolean;
SetCaptionTopOffset:Boolean;
SetCaptionRightOffset:Boolean;
SetCaptionBottomOffset:Boolean;
CaptionLeftOffset:Integer;
CaptionTopOffset:Integer;
CaptionRightOffset:Integer;
CaptionBottomOffset:Integer;
//
SetTextLeftOffset:Boolean;
SetTextTopOffset:Boolean;
SetTextRightOffset:Boolean;
SetTextBottomOffset:Boolean;
TextLeftOffset:Integer;
TextTopOffset:Integer;
TextRightOffset:Integer;
TextBottomOffset:Integer;
end;
PSXSkinCheckBoxStateParam=^TSXSkinCheckBoxStateParam;
TSXSkinCheckBoxStyle=class(TSXSkinStyle)
public
NUUState:TSXSkinCheckBoxStateParam;
NFUState:TSXSkinCheckBoxStateParam;
HUUState:TSXSkinCheckBoxStateParam;
HFUState:TSXSkinCheckBoxStateParam;
DFUState:TSXSkinCheckBoxStateParam;
RUUState:TSXSkinCheckBoxStateParam;
NUCState:TSXSkinCheckBoxStateParam;
NFCState:TSXSkinCheckBoxStateParam;
HUCState:TSXSkinCheckBoxStateParam;
HFCState:TSXSkinCheckBoxStateParam;
DFCState:TSXSkinCheckBoxStateParam;
RUCState:TSXSkinCheckBoxStateParam;
NUGState:TSXSkinCheckBoxStateParam;
NFGState:TSXSkinCheckBoxStateParam;
HUGState:TSXSkinCheckBoxStateParam;
HFGState:TSXSkinCheckBoxStateParam;
DFGState:TSXSkinCheckBoxStateParam;
RUGState:TSXSkinCheckBoxStateParam;
//
HInCheckBoxEffect:TSXTransformEffectData;
HOutCheckBoxEffect:TSXTransformEffectData;
CheckCheckBoxEffect:TSXTransformEffectData;
UncheckCheckBoxEffect:TSXTransformEffectData;
DownCheckBoxEffect:TSXTransformEffectData;
UpCheckBoxEffect:TSXTransformEffectData;
EnableCheckBoxEffect:TSXTransformEffectData;
DisableCheckBoxEffect:TSXTransformEffectData;
FocusCheckBoxEffect:TSXTransformEffectData;
UnfocusCheckBoxEffect:TSXTransformEffectData;
//
HInGlyphEffect:TSXTransformEffectData;
HOutGlyphEffect:TSXTransformEffectData;
CheckGlyphEffect:TSXTransformEffectData;
UncheckGlyphEffect:TSXTransformEffectData;
DownGlyphEffect:TSXTransformEffectData;
UpGlyphEffect:TSXTransformEffectData;
EnableGlyphEffect:TSXTransformEffectData;
DisableGlyphEffect:TSXTransformEffectData;
FocusGlyphEffect:TSXTransformEffectData;
UnfocusGlyphEffect:TSXTransformEffectData;
procedure AssignStyle(Style:TSXSkinStyle); override;
procedure SetParameter(const Name,Value:String); override;
procedure GetCurrentCBState(var CBState:TSXSkinCheckBoxStateParam;
State:TCheckBoxState;Down,MouseOver,Focused,Enabled:Boolean);
procedure SaveToStream(S:TStream;const RootPath:String); override;
procedure LoadFromStream(S:TStream;Version:Integer;
const RootPath,ZipFilePath:String;DestList1,DestList2:TSXSkinStyleList); override;
end;
TSXSkinRadioButtonStateParam=record
SetStyle:Boolean;
SetOverStyle:Boolean;
SetGlyphStyle:Boolean;
SetGlyphWidth:Boolean;
SetGlyphHeight:Boolean;
//
Style:String;
OverStyle:String;
GlyphStyle:String;
GlyphWidth:Integer;
GlyphHeight:Integer;
FD:TSXFontData;
//
SetCaptionLeftOffset:Boolean;
SetCaptionTopOffset:Boolean;
SetCaptionRightOffset:Boolean;
SetCaptionBottomOffset:Boolean;
CaptionLeftOffset:Integer;
CaptionTopOffset:Integer;
CaptionRightOffset:Integer;
CaptionBottomOffset:Integer;
//
SetTextLeftOffset:Boolean;
SetTextTopOffset:Boolean;
SetTextRightOffset:Boolean;
SetTextBottomOffset:Boolean;
TextLeftOffset:Integer;
TextTopOffset:Integer;
TextRightOffset:Integer;
TextBottomOffset:Integer;
end;
PSXSkinRadioButtonStateParam=^TSXSkinRadioButtonStateParam;
TSXSkinRadioButtonStyle=class(TSXSkinStyle)
public
NUUState:TSXSkinRadioButtonStateParam;
NFUState:TSXSkinRadioButtonStateParam;
HUUState:TSXSkinRadioButtonStateParam;
HFUState:TSXSkinRadioButtonStateParam;
DFUState:TSXSkinRadioButtonStateParam;
RUUState:TSXSkinRadioButtonStateParam;
NUCState:TSXSkinRadioButtonStateParam;
NFCState:TSXSkinRadioButtonStateParam;
HUCState:TSXSkinRadioButtonStateParam;
HFCState:TSXSkinRadioButtonStateParam;
DFCState:TSXSkinRadioButtonStateParam;
RUCState:TSXSkinRadioButtonStateParam;
//
HInRadioButtonEffect:TSXTransformEffectData;
HOutRadioButtonEffect:TSXTransformEffectData;
CheckRadioButtonEffect:TSXTransformEffectData;
UncheckRadioButtonEffect:TSXTransformEffectData;
DownRadioButtonEffect:TSXTransformEffectData;
UpRadioButtonEffect:TSXTransformEffectData;
EnableRadioButtonEffect:TSXTransformEffectData;
DisableRadioButtonEffect:TSXTransformEffectData;
FocusRadioButtonEffect:TSXTransformEffectData;
UnfocusRadioButtonEffect:TSXTransformEffectData;
//
HInGlyphEffect:TSXTransformEffectData;
HOutGlyphEffect:TSXTransformEffectData;
CheckGlyphEffect:TSXTransformEffectData;
UncheckGlyphEffect:TSXTransformEffectData;
DownGlyphEffect:TSXTransformEffectData;
UpGlyphEffect:TSXTransformEffectData;
EnableGlyphEffect:TSXTransformEffectData;
DisableGlyphEffect:TSXTransformEffectData;
FocusGlyphEffect:TSXTransformEffectData;
UnfocusGlyphEffect:TSXTransformEffectData;
procedure AssignStyle(Style:TSXSkinStyle); override;
procedure SetParameter(const Name,Value:String); override;
procedure GetCurrentRBState(var RBState:TSXSkinRadioButtonStateParam;
Checked,Down,MouseOver,Focused,Enabled:Boolean);
procedure SaveToStream(S:TStream;const RootPath:String); override;
procedure LoadFromStream(S:TStream;Version:Integer;
const RootPath,ZipFilePath:String;DestList1,DestList2:TSXSkinStyleList); override;
end;
TSXSkinGroupBoxStateParam=record
SetStyle:Boolean;
SetOverStyle:Boolean;
SetCaptionPosition:Boolean;
SetTransparentRect:Boolean;
//
Style:String;
OverStyle:String;
CaptionPosition:Integer;
//
SetCaptionLeftOffset:Boolean;
SetCaptionTopOffset:Boolean;
SetCaptionRightOffset:Boolean;
SetCaptionBottomOffset:Boolean;
CaptionLeftOffset:Integer;
CaptionTopOffset:Integer;
CaptionRightOffset:Integer;
CaptionBottomOffset:Integer;
//
SetTextLeftOffset:Boolean;
SetTextTopOffset:Boolean;
SetTextRightOffset:Boolean;
SetTextBottomOffset:Boolean;
TextLeftOffset:Integer;
TextTopOffset:Integer;
TextRightOffset:Integer;
TextBottomOffset:Integer;
//
TransparentRect:String;
end;
PSXSkinGroupBoxStateParam=^TSXSkinGroupBoxStateParam;
TSXSkinGroupBoxStyle=class(TSXSkinStyle)
public
SetLabelStyle:Boolean;
SetGlyphWidth:Boolean;
SetGlyphHeight:Boolean;
SetClientRect:Boolean;
//
LabelStyle:String;
NUState:TSXSkinGroupBoxStateParam;
NFState:TSXSkinGroupBoxStateParam;
HUState:TSXSkinGroupBoxStateParam;
HFState:TSXSkinGroupBoxStateParam;
RUState:TSXSkinGroupBoxStateParam;
GlyphWidth:Integer;
GlyphHeight:Integer;
ClientRect:String;
procedure AssignStyle(Style:TSXSkinStyle); override;
procedure SetParameter(const Name,Value:String); override;
procedure GetCurrentGBState(var GBState:TSXSkinGroupBoxStateParam;
MouseOver,Focused,Enabled:Boolean);
procedure SaveToStream(S:TStream;const RootPath:String); override;
procedure LoadFromStream(S:TStream;Version:Integer;
const RootPath,ZipFilePath:String;DestList1,DestList2:TSXSkinStyleList); override;
end;
TSXSkinMultiStateStyle=class(TSXSkinStyle)
public
SetNStyle:Boolean;
SetHStyle:Boolean;
SetDStyle:Boolean;
SetRStyle:Boolean;
//
NStyle:String;
HStyle:String;
DStyle:String;
RStyle:String;
procedure AssignStyle(Style:TSXSkinStyle); override;
procedure SetParameter(const Name,Value:String); override;
procedure SaveToStream(S:TStream;const RootPath:String); override;
procedure LoadFromStream(S:TStream;Version:Integer;
const RootPath,ZipFilePath:String;DestList1,DestList2:TSXSkinStyleList); override;
end;
TSXSkinMultiStateCheckStyle=class(TSXSkinStyle)
public
SetNUStyle:Boolean;
SetHUStyle:Boolean;
SetDUStyle:Boolean;
SetRUStyle:Boolean;
SetNCStyle:Boolean;
SetHCStyle:Boolean;
SetDCStyle:Boolean;
SetRCStyle:Boolean;
//
NUStyle:String;
HUStyle:String;
DUStyle:String;
RUStyle:String;
NCStyle:String;
HCStyle:String;
DCStyle:String;
RCStyle:String;
procedure AssignStyle(Style:TSXSkinStyle); override;
procedure SetParameter(const Name,Value:String); override;
procedure SaveToStream(S:TStream;const RootPath:String); override;
procedure LoadFromStream(S:TStream;Version:Integer;
const RootPath,ZipFilePath:String;DestList1,DestList2:TSXSkinStyleList); override;
end;
TSXSkinButtonStateParam=record
SetStyle:Boolean;
SetOverStyle:Boolean;
SetCaptionLeftOffset:Boolean;
SetCaptionTopOffset:Boolean;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -