📄 winskindata.pas
字号:
f3rdControls.add('TLMDLMDClock=Panel');
f3rdControls.add('TLMDTrackbar=panel');
f3rdControls.add('TLMDListCombobox=combobox');
f3rdControls.add('TLMDCheckListCombobox=combobox');
f3rdControls.add('TLMDHeaderListCombobox=combobox');
f3rdControls.add('TLMDImageCombobox=combobox');
f3rdControls.add('TLMDColorCombobox=combobox');
f3rdControls.add('TLMDFontCombobox=combobox');
f3rdControls.add('TLMDFontSizeCombobox=combobox');
f3rdControls.add('TLMDFontSizeCombobox=combobox');
f3rdControls.add('TLMDPrinterCombobox=combobox');
f3rdControls.add('TLMDDriveCombobox=combobox');
f3rdControls.add('TLMDCalculatorComboBox=combobox');
f3rdControls.add('TLMDTrackBarComboBox=combobox');
f3rdControls.add('TLMDCalendarComboBox=combobox');
f3rdControls.add('TLMDTreeComboBox=combobox');
f3rdControls.add('TLMDRADIOGROUP=radiogroup');
f3rdControls.add('TLMDCheckGroup=CheckGroup');
f3rdControls.add('TLMDDBRADIOGROUP=radiogroup');
f3rdControls.add('TLMDDBCheckGroup=CheckGroup');
f3rdControls.add('TLMDCalculatorEdit=edit');
f3rdControls.add('TLMDEDIT=Edit');
f3rdControls.add('TLMDMASKEDIT=Edit');
f3rdControls.add('TLMDBROWSEEDIT=Edit');
f3rdControls.add('TLMDEXTSPINEDIT=Edit');
f3rdControls.add('TLMDCALENDAREDIT=Edit');
f3rdControls.add('TLMDFILEOPENEDIT=Edit');
f3rdControls.add('TLMDFILESAVEEDIT=Edit');
f3rdControls.add('TLMDCOLOREDIT=Edit');
f3rdControls.add('TLMDDBEDIT=Edit');
f3rdControls.add('TLMDDBMASKEDIT=Edit');
f3rdControls.add('TLMDDBEXTSPINEDIT=Edit');
f3rdControls.add('TLMDDBSPINEDIT=Edit');
f3rdControls.add('TLMDDBEDITDBLookup=Edit');
f3rdControls.add('TLMDEDITDBLookup=Edit');
//combobox
f3rdControls.add('TDBLookupCombobox=Combobox');
f3rdControls.add('TWWDBCombobox=Combobox');
f3rdControls.add('TWWDBLookupCombo=Combobox');
f3rdControls.add('TWWDBCombobox=Combobox');
f3rdControls.add('TWWKeyCombo=Combobox') ;
f3rdControls.add('TWWTempKeyCombo=combobox');
f3rdControls.add('TWWDBDateTimePicker=Combobox');
f3rdControls.add('TWWRADIOGROUP=radiogroup');
f3rdControls.add('TWWDBEDIT=Edit');
f3rdControls.add('TcxButton=bitbtn');
// f3rdControls.add('TcxDBCheckBox=checkbox');
f3rdControls.add('TcxDBRadioGroup=radiogroup');
f3rdControls.add('TcxRadioGroup=radiogroup');
f3rdControls.add('TcxGroupbox=groupbox');
// f3rdControls.add('TcxCheckBox=checkbox');
{ f3rdControls.add('TDXDBPICKEDIT=Combobox');
f3rdControls.add('TDXDBCALCEDIT=Combobox');
f3rdControls.add('TDXDBIMAGEEDIT=Combobox');
f3rdControls.add('TDXDBPOPUPEDIT=Combobox');
f3rdControls.add('TDXDBEXTLOOKUPEDIT=Combobox');
f3rdControls.add('TDXDBLOOKUPEDIT=Combobox');
f3rdControls.add('TDXDBDATEEDIT=Combobox');
f3rdControls.add('TDXDATEEDIT=Combobox');
f3rdControls.add('TDXPICKEDIT=Combobox');
f3rdControls.add('TDXPOPUPEDIT=Combobox');
//edit
f3rdControls.add('TDXDBCURRENCYEDIT=Edit');
f3rdControls.add('TDXDBEDIT=Edit');
f3rdControls.add('TDXDBMASKEDIT=Edit');
f3rdControls.add('TDXDBHYPERLINKEDIT=Edit');
f3rdControls.add('TDXEDIT=Edit');
f3rdControls.add('TDXMASKEDIT=Edit');
f3rdControls.add('TDXBUTTONEDIT=Edit');
f3rdControls.add('TDXCURRENCYEDIT=Edit');
f3rdControls.add('TDXHYPERLINKEDIT=Edit');}
f3rdControls.add('TOVCPICTUREFIELD=Edit');
f3rdControls.add('TOVCDBPICTUREFIELD=Edit');
f3rdControls.add('TOVCSLIDEREDIT=Edit');
f3rdControls.add('TOVCDBSLIDEREDIT=Edit');
f3rdControls.add('TOVCSIMPLEFIELD=Edit');
f3rdControls.add('TOVCDBSIMPLEFIELD=Edit');
f3rdControls.add('TO32DBFLEXEDIT=Edit');
f3rdControls.add('TOVCNUMERICFIELD=Edit');
f3rdControls.add('TOVCDBNUMERICFIELD=Edit');
end;
destructor TSkinControlList.Destroy;
begin
fedit.free;
fcombobox.free;
fradiobutton.free;
fcheckbox.free;
inherited destroy;
end;
procedure TSkinControlList.SetEdit(Value: TStrings);
begin
FEdit.Assign(Value);
end;
procedure TSkinControlList.SetCheckbox(Value: TStrings);
begin
Fcheckbox.Assign(Value);
end;
procedure TSkinControlList.Setradiobutton(Value: TStrings);
begin
Fradiobutton.Assign(Value);
end;
procedure TSkinControlList.SetCombobox(Value: TStrings);
begin
FCombobox.Assign(Value);
end;
constructor TDataSkinObject.Create(AIDName: String);
begin
inherited create;
Map:=Tbitmap.create;
Idname:=aidname;
end;
destructor TDataSkinObject.Destroy;
begin
try
if not IsBadReadPtr(map, map.InstanceSize) then begin
map.assign(nil);
Map.free;
end;
except
end;
inherited destroy;
end;
constructor TDataSkinBorder.Create(AIDName: String);
begin
inherited create(aidname);
MaskMap:=TBitMap.create;
Idname:=aidname;
end;
destructor TDataSkinBorder.Destroy;
begin
MaskMap.free;
inherited destroy;
end;
constructor TDataSkinButton.Create(AIDName: String);
begin
inherited create(aidname);
CheckMap :=Tbitmap.create;
RadioMap :=Tbitmap.create;
end;
destructor TDataSkinButton.Destroy;
begin
try
if not IsBadReadPtr(checkmap, checkmap.InstanceSize) then begin
CheckMap.free;
end;
except
end;
try
if not IsBadReadPtr(radiomap, radiomap.InstanceSize) then begin
RadioMap.free;
end;
except
end;
inherited destroy;
end;
constructor TSkinData.Create(AOwner: TComponent);
var i: integer;
begin
inherited Create(AOwner);
// fOnNewform:=nil;
OnBeforeSkinForm := nil;
OnAfterSkinForm := nil;
ftype := sfMainform;
data := TMemorystream.create;
Empty := True;
sysicon:=Tbitmap.create;
sysicon.PixelFormat := pf24bit;
logo:=Tbitmap.create;
logo.PixelFormat := pf24bit;
MenuMsg:=true;
findll := false;
f3rdControls:=TStringlist.create;
initcontrollist;
Button := TDataSkinButton.create('Buttons');
border[1]:=TDataskinborder.create('Left');
border[2]:=TDataskinborder.create('Right');
border[3]:=TDataskinborder.create('Top');
border[4]:=TDataskinborder.create('Bottom');
Title := TDataSkinTitle.create('Title');
fmenuauto := true;
fmenumerge := false;
fSkinOptions := [xoPreview,xoToolbarBK];
// if gSkindata=nil then gskindata:=self;
fdisabletag:=99;
FContainers := [xccForm, xccFrame, xccToolbar, xccCoolbar, xccControlbar, xccPanel,
xccScrollBox, xccGroupBox, xccTabSheet, xccPageScroller];
FSkinControls := [xcMainMenu, xcPopupMenu, xcToolbar, xcControlbar, xcCombo,
xcCheckBox, xcRadioButton,xcProgress,xcScrollbar,xcedit,
xcButton,xcedit, xcBitBtn, xcSpeedButton, xcPanel,xcSpin,xcTrackbar,xcGroupBox,
xcTab,xcStatusBar,xcSystemMenu];
bmpmenu:=Timagelist.create(nil);
bmpmenu.GetResource(rtBitmap,'VCLSKINMENU',16,[lrTransparent],clwhite);
fversion := c_version;
cxMax := GetSystemMetrics(SM_CXMAXIMIZED);
cyMax := GetSystemMetrics(SM_CYMAXIMIZED);
mincaption:=nil;
// bmpmenu.ResInstLoad(rtBitmap,'VCLSKINMENU',16,[lrTransparent],clwhite);
end;
destructor TSkinData.Destroy;
var i:integer;
begin
bmpmenu.free;
f3rdControls.free;
if skinmanager<>nil then
skinmanager.Removeskindata(self);
// skinmanager=nil;
data.free;
sysicon.free;
logo.free;
if CaptionFont<>nil then CaptionFont.free;
for i:= 1 to 4 do begin
border[i].free;
end;
for i:= 0 to length(SysBtn)-1 do begin
SysBtn[i].free;
end;
Button.free;
Title.free;
if BGBrush<>0 then begin
deleteobject(BgBrush);
BGBrush:=0;
end;
if box<>nil then Box.free;
if boxlabel<>nil then Boxlabel.free;
if toolbar<>nil then toolbar.free;
if Tab<>nil then Tab.free;
if TabSheet<>nil then TabSheet.free;
if MinCaption<>nil then MinCaption.free;
if StatusBar<>nil then statusbar.free;
if ComBox<>nil then Combox.free;
if ComBoxborder<>nil then ComBoxborder.free;
if ComBoxArrow<>nil then ComBoxArrow.free;
if ExtraImages<>nil then ExtraImages.free;
if Progress<>nil then Progress.free;
if ProgressChunk<>nil then ProgressChunk.free;
if Header<>nil then Header.free;
if MenuBar<>nil then MenuBar.free;
if MenuItem<>nil then MenuItem.free;
if MenuItemBG<>nil then MenuItemBG.free;
if SArrow<>nil then SArrow.free;
if HBar<>nil then HBar.free;
if VBar<>nil then VBar.free;
if HSlider<>nil then HSlider.free;
if VSlider<>nil then VSlider.free;
if Hspin<>nil then Hspin.free;
if Vspin<>nil then Vspin.free;
if TrackHorz<>nil then TrackHorz.free;
if TrackVert<>nil then TrackVert.free;
if trackbar<>nil then trackbar.free;
if trackbarvert<>nil then trackbarvert.free;
if TrackLeft<>nil then TrackLeft.free;
if TrackRight<>nil then TrackRight.free;
if TrackTop<>nil then TrackTop.free;
if TrackBottom<>nil then TrackBottom.free;
if Toolbarbtn<>nil then toolbarbtn.free;
{ if skinmanager.dlist.count=0 then begin
skinmanager.free;
skinmanager:=nil;
end;}
inherited Destroy;
end;
procedure TSkinData.SetControlList(Value: TStrings);
begin
f3rdControls.Assign(Value);
end;
procedure TSkinData.ReadBord;
var s:string;
i:integer;
begin
for i:= 1 to 4 do begin
if i<3 then begin
border[i].r.top:=ini.Readinteger('Personality',border[i].IDName+'TopHeight',0);
border[i].r.Bottom:=ini.Readinteger('Personality',border[i].IDName+'BotHeight',0);
border[i].r.left:= 0;
border[i].r.right:= 0;
end else begin
border[i].r.top:= 0;
border[i].r.Bottom:=0;
border[i].r.left:=ini.Readinteger('Personality',border[i].IDName+'TopHeight',0);
border[i].r.right:=ini.Readinteger('Personality',border[i].IDName+'BotHeight',0);
end;
border[i].frame:=ini.Readinteger('Personality',border[i].IDName+'Frame',1);
border[i].Tile:=ini.Readinteger('Personality',border[i].IDName+'Stretch',1);
border[i].trans:=ini.readinteger('Personality',border[i].IDName+'Trans',1);
readbmp(border[i].map,ini.ReadString('Personality',border[i].IDName, ''));
if border[i].Tile>1 then border[i].Tile:=1;
// readbmp(border[i].maskmap,ini.ReadString('Personality', border[i].IDName+'Mask', ''));
end;
end;
procedure TSkinData.Readbmp(bmp:Tbitmap;fname:string);
var s,s1:string;
begin
s:= ExtractFileName(fname);
s1:=ExtractFileExt(fname);
if (s<>'') and (s1='.bmp') then begin
reader.readfile(s,ms);
if ms.size>0 then
bmp.LoadFromstream(ms)
else bmp.Assign(nil);
end else bmp.Assign(nil);
end;
procedure TSkinData.ReadSysButton;
var i,n,a,v1:integer;
j:real;
s:string;
b:boolean;
begin
for i:= 0 to high(SysBtn) do SysBtn[i].free;
ini.ReadSections(sectionlist);
for i:= sectionlist.count-1 downto 0 do begin
s:=Uppercase(sectionlist.strings[i]);
b:=false;
if (s='BUTTONS') or (s='BUTTON.RADIO')
or (s='BUTTON.CHECKBOX') or (s='BUTTON') then b:=true
else if (pos('BUTTON',s)<>1) then b:=true
else begin
a:=ini.readinteger(s,'Action',0);
v1:=ini.readinteger(s,'Visibility',-1);
if a=-1 then begin
if v1=0 then b:=false
else b:=true;
end;
end;
if b then sectionlist.delete(i);
end;
n:=sectionlist.count;
setlength(SysBtn,n+3);
for i:= 0 to sectionlist.count-1 do begin
s:=Uppercase(sectionlist.strings[i]);
SysBtn[i]:= TDataSkinSysButton.create(s);
SysBtn[i].Action:=ini.readinteger(s,'Action',0);
SysBtn[i].Align:=ini.readinteger(s,'Align',0);
SysBtn[i].Xcoord:=ini.readinteger(s,'Xcoord',0);
SysBtn[i].Ycoord:=ini.readinteger(s,'Ycoord',0);
SysBtn[i].Visibility:=ini.readinteger(s,'Visibility',0);
if SysBtn[i].Action=-1 then
SysBtn[i].Visibility1:=ini.readinteger(s,'Visibility1',-1)
else
SysBtn[i].Visibility1:=ini.readinteger(s,'Visibility1',0);
SysBtn[i].CombineOp:=ini.readinteger(s,'CombineOp',-1);
SysBtn[i].frame:=ini.readinteger(s,'frame',0);
readbmp(SysBtn[i].map,ini.ReadString(s, 'ButtonImage', ''));
if sysbtn[i].frame=0 then begin
sysbtn[i].frame:=6;
if not sysbtn[i].map.empty then begin
j:=sysbtn[i].map.width / sysbtn[i].map.height;
if j>3.8 then
sysbtn[i].frame:=6
else
sysbtn[i].frame:=3;
if sysbtn[i].action<0 then
sysbtn[i].frame:=6
end;
if sysbtn[i].action in [3,11] then
sysbtn[i].map.assign(nil);
end;
end;
for i:= n to n+2 do begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -