Professional Documents
Culture Documents
http://www.cnpack.org
CnSkin
(master@cnpack.org ), savetime, e-
CnPack
V0.8.2.0
2008.01.07
2008.01.12
e- CnPack Skin
savetime SkinMagic
WindowProc
Skin
SkinStyle SkinStyle
SkinStyle
SkinThemes
SkinMagic
1
2
CnPack CnPack
CnSkin CnPack
savetime
e-
master@cnpack.org http://www.cnpack.org
CnPack
CnPack Skin
SkinStyleSkinTheme
SkinMagic
SkinStyle SkinStyle
Skin SkinThemes
SkinThemes
SkinStyle SkinThemes
SkinThemes Active
VCL
VCL ButtonLabelComboBox
SkinMagicMagic
SkinThemes
CnPack Skin
TCnSkinStyle ICnSkinParams
CnPack TCnSkinStyle
CnSkinXPBlueStyleCnSkinXPGreenStyleCnSkinXPSilverStyle
Windows XP
CnSkinStyle Loaded
CnSkinStyle
CnPack CnSkinThemes
Active
Skins TCnSkinStyle
CnPack SkinIndex
SkinIndex SkinIndex
CurrentSkin CnSkinThemes
SkinStyle CnSkinThemes
CnSkinThemes
TCnSkinThemeController CnSkinThemes
AfterConstuction BeforeDestruction
CnSkinMagic
WindowProc WindowProc
WindowProc
WindowProc
SkinActive CnSkinThemes Active
True WindowProc
WindowProc
class
SkinWindowProc
RegisterClass TControl
Skin WindowProc
TClassData
CnSkinMagic AfterConstuction BeforeDestruction
CnSkinMagic
TControlSubClass WindowProc
TControlSubClass WindowProc CnSkinThemes
Active SkinWindowProc WindowProc
WindowProc SkinWindowProc SkinWindowProc
7CnSkinStyle
1CnSkinStyle
TCnSkinXPGreenStyle
TCnSkinXPBlueStyle - TCnSkinXPStyle TCnSkinStyle TComponent
TCnSkinXPSilverStyle
II
TCnSkinStyle ICnSkinParams
ICnSkinParams = interface(IUnknown)
['{C4FDB92B-AE10-49F9-918E-F4F7DC9CD1E4}']
function GetFaceColor: TColor;
function GetLightColor: TColor;
function GetMenuHotColor: TColor;
function GetShadowColor: TColor;
function GetActiveCaptionColor: TColor;
function GetInActiveCaptionColor: TColor;
function GetCaptionHeight: Integer;
function GetBorderSize: Integer;
function GetButtonSize: Integer;
function GetButtonRight: Integer;
function GetButtonTop: Integer;
function GetCaptionFontSize: Integer;
function GetRgnSize: Integer;
function GetWindowBmp: TBitmap;
function GetWindowBtnBmp: TBitmap;
function GetScrollBarBmp: TBitmap;
{* }
end;
2CnSkinThemes
1CnSkinThemes
TCnSkinThemes TObject
CnSkin CnSkinFormCnSkinMenu
CnSkinThemes CnSkinThemes SkinStyle
CnSkinThemes Controls
CnSkinStyle CnSkinThemes
CnSkinThemes SkinStyles
TCnSkinThemes = class(TObject)
private
FSkins: TList;
FControls: TList;
FOldSkinIndex: Integer;
FSkinIndex: Integer;
FCurrentSkin: TCnSkinStyle;
FActive: Boolean;
function GetSkinCount: Integer;
procedure SetSkinIndex(const Value: Integer);
4CnSkinThemeController
TCnSkinThemeController - TComponent
CnSkinThemeController CnSkinThemes
CnSkinThemes TCnSkinThemes
CnSkinThemes
CriticalSection
CnSkinThemes
3CnSkinMagic
1CnSkinMagic
TCnSkinMagic TComponent
CnSkinMagic
TCnSkinMagic = class(TCnComponent)
{* }
private
function GetSkinActive: Boolean;
protected
class procedure RefreshControls;
{* }
public
class procedure EnableSkin;
{* CnSkinMagic }
class procedure DisableSkin;
{* CnSkinMagic }
class procedure RegisterClass(AClass: TControlClass; AWindowProc: Point
er);
{* CnSkinMagic Class, ,
: AClass SubClass , TControlClass
AWndProc SubClass WindowProc,
AWindowProc
procedure AWindowProc(Self: TControlSubClass; var Message: TMessage)
;
}
published
property SkinActive: Boolean read GetSkinActive;
{* Skin , EnableSkin DisableSkin }
end;
RegisterClass AWindowProc
4TControlSubClass
TControlSubClass = class(TObject)
{* SubClass Skin public }
private
FControl: TControl;
FSkinWindowProc: TWndMethod;
FOldWindowProc: TWndMethod;
FIsWinControl: Boolean;
FMouseInControl: Boolean;
constructor Create(AControl: TControl);
{* Skin , private }
procedure WindowProc(var Message: TMessage);
public
property Control: TControl read FControl;
{* SubClass () }
property OldWindowProc: TWndMethod read FOldWindowProc;
{* WindowProc }
property IsWinControl: Boolean read FIsWinControl;
{* TWinControl }
property MouseInControl: Boolean read FMouseInControl;
{* }
end;
SkinWindowProc
5TClassData
TCnClassList = class(TList)
{* ClassData }
protected
procedure Notify(Ptr: Pointer; Action: TListNotification); override;
end;
Notify ItemTClassData
TClassData
TClassData = record
{* TCnClassList }
ClassType: TClass;
WindowProc: Pointer;
OldAfterConstruction: Pointer;
OldBeforeDestruction: Pointer;
end;
CnAfterConstruction AfterConstruction
TControlSubClass
AfterConstruction
CnBeforeDestruction BeforeDestruction
TControlSubClass ,
BeforeDestruction
4CnSkinForm
1CnSkinForm
TCnSkinForm TComponent
CnSkinForm Skin
CnSkinStyle CnSkinThemes CnSkinForm
Owner WindowProc NC
FormStyle fsNone
4 2
1 2 N
5CnSkinMenu
1CnSkinMenu
TCnSkinMenu TComponent
4 2
1 2 N
CnSkinForm
CnSkinMenu
Delphi5/6/7Windows98/NT/2000/XP
Delphi 5
CnSkinForm MDI
CnRadioButton