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

📄 skinbuild.pas

📁 BusinessSkinForm_v6.07_FS,delphi皮肤
💻 PAS
📖 第 1 页 / 共 5 页
字号:
      11: Add(TbsDataSkinListBox.Create(AName));
      12: Add(TbsDataSkinComboBox.Create(AName));
      13: Add(TbsDataSkinSpinEditControl.Create(AName));
      14: Add(TbsDataSkinCheckListBox.Create(AName));
      15: Add(TbsDataSkinStdLabelControl.Create(AName));
      16: Add(TbsDataSkinUpDownControl.Create(AName));
      17: Add(TbsDataSkinControlBar.Create(AName));
      18: Add(TbsDataSkinSplitterControl.Create(AName));
      19: Add(TbsDataSkinPanelControl.Create(AName));
      20: Add(TbsDataSkinMenuButtonControl.Create(AName));
      21: Add(TbsDataSkinScrollBoxControl.Create(AName));
      22: Add(TbsDataSkinTreeView.Create(AName));
      23: Add(TbsDataSkinListView.Create(AName));
      24: Add(TbsDataSkinRichEdit.Create(AName));
      25: Add(TbsDataSkinExPanelControl.Create(AName));
      26: Add(TbsDataSkinSlider.Create(AName));
      27: Add(TbsDataSkinBevel.Create(AName));
    end;
  Names.Items.Add(AName);
  Names.ItemIndex := Names.Items.Count - 1;
  LoadControl(Names.ItemIndex);
end;

procedure TSBForm.AddObject;
begin
  if (Index > 1) and (AName = '') then Exit;
  if Names.Items.IndexOf(AName) <> -1 then Exit;
  with SkinData.ObjectList do
    case Index of
      0: Add(TbsDataSkinCaption.Create(AName));
      1: Add(TbsDataSkinStdButton.Create(AName));
      2: Add(TbsDataSkinButton.Create(AName));
      3: Add(TbsDataSkinMainMenuBarItem.Create(AName));
      4: Add(TbsDataSkinMainMenuBarButton.Create(AName));
      5: Add(TbsDataSkinMenuItem.Create(AName));
      6: Add(TbsDataSkinAnimate.Create(AName));
    end;
  Names.Items.Add(AName);
  Names.ItemIndex := Names.Items.Count - 1;
  LoadObject(Names.ItemIndex);
end;

procedure TSBForm.LoadCaption(Index: Integer);
begin
  DefLoadObject(Index);
  with PE, TbsDataSkinCaption(SkinData.ObjectList.Items[Index]) do
  begin
    AddRectProperty('textrect', TextRct, 'arect12');
    if FontName = '' then FontName := 'Arial';
    AddProperty('fontname', FontName, 'string');
    if FontHeight = 0 then FontHeight := 14;
    AddIntProperty('fontheight', FontHeight, 'int');
    AddFSProperty('fontstyle', FontStyle, 'fontstyle');
    AddIntProperty('fontcolor', FontColor, 'skincolor');
    AddIntProperty('activefontcolor', ActiveFontColor, 'skincolor');
    AddAlignmentProperty('alignment', Alignment, 'alignment');
    AddBolProperty('shadow', Shadow, 'boolean');
    AddIntProperty('shadowcolor', ShadowColor, 'skincolor');
    AddBolProperty('light', Light, 'boolean');
    AddIntProperty('lightcolor', LightColor, 'skincolor');
    AddIntProperty('activelightcolor', ActiveLightColor, 'skincolor');
    AddIntProperty('activeshadowcolor', ActiveShadowColor, 'skincolor');
    AddRectProperty('framerect', FrameRect, 'arect');
    AddRectProperty('activeframerect', ActiveFrameRect, 'arect');
    AddRectProperty('frametextrect', FrameTextRect, 'frametextrect');
    AddIntProperty('frameleftoffset', FrameLeftOffset, 'int');
    AddIntProperty('framerightoffset', FrameRightOffset, 'int');
    AddBolProperty('stretcheffect', StretchEffect, 'boolean');
    AddRectProperty('animateskinrect', AnimateSkinRect, 'arect');
    AddIntProperty('framecount', FrameCount, 'int');
    AddIntProperty('animateinterval', AnimateInterval, 'int');
    AddBolProperty('inactiveanimation', InActiveAnimation, 'boolean');
    AddBolProperty('fullframe', FullFrame, 'boolean');
  end;
  PE.Cells[0, 0] := '< caption >';
end;

procedure TSBForm.SaveCaption(Index: Integer);
begin
  DefSaveObject(Index);
  with PE, TbsDataSkinCaption(SkinData.ObjectList.Items[Index]) do
  begin
    TextRct := GetRectProperty('textrect');
    FontName := GetStrProperty('fontname');
    FontHeight := GetIntProperty('fontheight');
    FontStyle := GetFSProperty('fontstyle');
    FontColor := GetIntProperty('fontcolor');
    ActiveFontColor := GetIntProperty('activefontcolor');
    Alignment := GetAlignmentProperty('alignment');
    Shadow := GetBolProperty('shadow');
    ShadowColor := GetIntProperty('shadowcolor');
    Light := GetBolProperty('light');
    LightColor := GetIntProperty('lightcolor');
    ActiveLightColor := GetIntProperty('activelightcolor');
    ActiveShadowColor := GetIntProperty('activeshadowcolor');
    FrameRect := GetRectProperty('framerect');
    ActiveFrameRect := GetRectProperty('activeframerect');
    FrameTextRect := GetRectProperty('frametextrect');
    FrameLeftOffset := GetIntProperty('frameleftoffset');
    FrameRightOffset := GetIntProperty('framerightoffset');
    StretchEffect := GetBolProperty('stretcheffect');
    AnimateSkinRect := GetRectProperty('animateskinrect');
    FrameCount :=  GetIntProperty('framecount');
    AnimateInterval := GetIntProperty('animateinterval');
    InActiveAnimation := GetBolProperty('inactiveanimation');
    FullFrame := GetBolProperty('fullframe');
  end;
end;

procedure TSBForm.LoadButton(Index: Integer);
begin
  DefLoadObject(Index);
  with PE, TbsDataSkinButton(SkinData.ObjectList.Items[Index]) do
  begin
    AddRectProperty('downrect', DownRect, 'arect');
    AddRectProperty('disableskinrect', DisableSkinRect, 'arect');
  end;
  PE.Cells[0, 0] := '< button >';
end;

procedure TSBForm.SaveButton(Index: Integer);
begin
  DefSaveObject(Index);
  with PE, TbsDataSkinButton(SkinData.ObjectList.Items[Index]) do
  begin
    DownRect := GetRectProperty('downrect');
    DisableSkinRect := GetRectProperty('disableskinrect');
  end;
end;

procedure TSBForm.LoadAnimate(Index: Integer);
begin
  with PE, TbsDataSkinAnimate(SkinData.ObjectList.Items[Index]) do
  begin
    DeleteProperties(True);
    AddProperty('name', IDName, 'string');
    AddProperty('hint', Hint, 'string');
    AddIntProperty('activepictureindex', ActivePictureIndex, 'pindex');
    AddBolProperty('skinrectinapicture', SkinRectInApicture, 'boolean');
    AddRectProperty('skinrect', SkinRect, 'stdrect');
    AddRectProperty('activeskinrect', ActiveSkinRect, 'arect');
    AddRectProperty('inactiveskinrect', InActiveSkinRect, 'arect');
    AddRectProperty('downskinrect', DownSkinRect, 'arect');
    AddIntProperty('countframes', CountFrames, 'int');
    AddBolProperty('buttonstyle', ButtonStyle, 'boolean');
    AddBolProperty('cycle', Cycle, 'boolean');
    AddIntProperty('timerinterval', TimerInterval, 'int');
    AddProperty('command', SetStdCommand(Command), 'stdcommand');
    AddRectProperty('restorerect', RestoreRect, 'arect');
    AddRectProperty('restoreactiverect', RestoreActiveRect, 'arect');
    AddRectProperty('restoredownrect', RestoreDownRect, 'arect');
    AddRectProperty('restoreinactiverect', RestoreInActiveRect, 'arect');
  end;
  PE.Cells[0, 0] := '< animate >'
end;

procedure TSBForm.SaveAnimate(Index: Integer);
begin
  with PE, TbsDataSkinAnimate(SkinData.ObjectList.Items[Index]) do
  begin
    IDName := GetStrProperty('name');
    Hint := GetStrProperty('hint');
    ActivePictureIndex := GetIntProperty('activepictureindex');
    SkinRectInApicture := GetBolProperty('skinrectinapicture');
    SkinRect := GetRectProperty('skinrect');
    DownSkinRect := GetRectProperty('downskinrect');
    InActiveSkinRect := GetRectProperty('inactiveskinrect');
    ActiveSkinRect := GetRectProperty('activeskinrect');
    CountFrames := GetIntProperty('countframes');
    ButtonStyle := GetBolProperty('buttonstyle');
    Cycle := GetBolProperty('cycle');
    TimerInterval := GetIntProperty('timerinterval');
    Command := GetStdCommand(GetPropertyValue('command'));
    Names.Items[Index] := IDName;
    RestoreRect := GetRectProperty('restorerect');
    RestoreActiveRect := GetRectProperty('restoreactiverect');
    RestoreDownRect := GetRectProperty('restoredownrect');
    RestoreInActiveRect := GetRectProperty('restoreinactiverect');
  end;
  PE.Cells[0, 0] := '< animate >'
end;

procedure TSBForm.LoadStdButton(Index: Integer);
begin
  with PE, TbsDataSkinStdButton(SkinData.ObjectList.Items[Index]) do
  begin
    DeleteProperties(True);
    AddProperty('name', IDName, 'string');
    AddProperty('hint', Hint, 'string');
    AddIntProperty('activepictureindex', ActivePictureIndex, 'pindex');
    AddBolProperty('skinrectinapicture', SkinRectInApicture, 'boolean');
    AddRectProperty('skinrect', SkinRect, 'stdrect');
    AddRectProperty('activeskinrect', ActiveSkinRect, 'arect');
    AddRectProperty('inactiveskinrect', InActiveSkinRect, 'arect');
    AddBolProperty('morphing', Morphing, 'boolean');
    AddProperty('morphkind', SetMorphKind(MorphKind), 'morphkind');
    //
    AddRectProperty('downrect', DownRect, 'arect');
    AddRectProperty('disableskinrect', DisableSkinRect, 'arect');
    AddRectProperty('restorerect', RestoreRect, 'arect');
    AddRectProperty('restoreactiverect', RestoreActiveRect, 'arect');
    AddRectProperty('restoredownrect', RestoreDownRect, 'arect');
    AddRectProperty('restoreinactiverect', RestoreInActiveRect, 'arect');
    AddProperty('command', SetStdCommand(Command), 'stdcommand');
  end;
  PE.Cells[0, 0] := '< stdbutton >';
end;

procedure TSBForm.LoadMainMenuBarButton(Index: Integer);
var
  P: TbsProperty;
begin
  DefLoadObject(Index);
  P := PE.GetProperty('skinrect');
  P.PropertyType := 'arect';
  with PE, TbsDataSkinMainMenuBarButton(SkinData.ObjectList.Items[Index]) do
  begin
    AddRectProperty('downrect', DownRect, 'arect');
    AddRectProperty('restorerect', RestoreRect, 'arect');
    AddRectProperty('restoreactiverect', RestoreActiveRect, 'arect');
    AddRectProperty('restoredownrect', RestoreDownRect, 'arect');
    AddProperty('command', SetStdCommand(Command), 'stdcommand');
  end;
  PE.Cells[0, 0] := '< mainmenubarbutton >';
end;

procedure TSBForm.SaveStdButton(Index: Integer);
begin
  DefSaveObject(Index);
  with PE, TbsDataSkinStdButton(SkinData.ObjectList.Items[Index]) do
  begin
    SkinRectInApicture := GetBolProperty('skinrectinapicture');
    Command := GetStdCommand(GetStrProperty('command'));
    DownRect := GetRectProperty('downrect');
    DisableSkinRect := GetRectProperty('disableskinrect');
    RestoreRect := GetRectProperty('restorerect');
    RestoreActiveRect := GetRectProperty('restoreactiverect');
    RestoreDownRect := GetRectProperty('restoredownrect');
    RestoreInActiveRect := GetRectProperty('restoreinactiverect');
  end;
end;

procedure TSBForm.SaveMainMenuBarButton(Index: Integer);
begin
  DefSaveObject(Index);
  with PE, TbsDataSkinMainMenuBarButton(SkinData.ObjectList.Items[Index]) do
  begin
    Command := GetStdCommand(GetStrProperty('command'));
    DownRect := GetRectProperty('downrect');
    RestoreRect := GetRectProperty('restorerect');
    RestoreActiveRect := GetRectProperty('restoreactiverect');
    RestoreDownRect := GetRectProperty('restoredownrect');
  end;
end;

procedure TSBForm.DefLoadObject(Index: Integer);
begin
  with PE, TbsDataSkinObject(SkinData.ObjectList.Items[Index]) do
  begin
    DeleteProperties(True);
    AddProperty('name', IDName, 'string');
    AddProperty('hint', Hint, 'string');
    AddIntProperty('activepictureindex', ActivePictureIndex, 'pindex');
    AddRectProperty('skinrect', SkinRect, 'rect');
    AddRectProperty('activeskinrect', ActiveSkinRect, 'arect');
    AddRectProperty('inactiveskinrect', InActiveSkinRect, 'arect');
    AddBolProperty('morphing', Morphing, 'boolean');
    AddProperty('morphkind', SetMorphKind(MorphKind), 'morphkind');
  end;
end;

procedure TSBForm.DefSaveObject(Index: Integer);
begin
  with PE, TbsDataSkinObject(SkinData.ObjectList.Items[Index]) do
  begin
    IDName := GetStrProperty('name');
    Hint := GetStrProperty('hint');
    ActivePictureIndex := GetIntProperty('activepictureindex');
    SkinRect := GetRectProperty('skinrect');
    ActiveSkinRect := GetRectProperty('activeskinrect');
    InActiveSkinRect := GetRectProperty('inactiveskinrect');
    Morphing := GetBolProperty('morphing');
    MorphKind := GetMorphKind(GetStrProperty('morphkind'));
    Names.Items[Index] := IDName;
  end;
end;

procedure TSBForm.LoadMenuItem(Index: Integer);
var
  P: TbsProperty;
begin
  DefLoadObject(Index);
  P := PE.GetProperty('skinrect');
  P.PropertyType := 'arect';
  with PE, TbsDataSkinMenuItem(SkinData.ObjectList.Items[Index]) do
  begin
    AddRectProperty('dividerrect', DividerRect, 'arect');
    AddIntProperty('itemleftoffset', ItemLO, 'int');
    AddIntProperty('itemrightoffset', ItemRO, 'int');
    AddIntProperty('dividerleftoffset', DividerLO, 'int');
    AddIntProperty('dividerrightoffset', DividerRO, 'int');
    AddRectProperty('textrect', TextRct, 'arect1');
    AddRectProperty('imagerect', ImageRct, 'arect1');
    if FontName = '' then FontName := 'Arial';
    AddProperty('fontname', FontName, 'string');
    if FontHeight = 0 then FontHeight := 14;
    AddIntProperty('fontheight', FontHeight, 'int');
    AddFSProperty('fontstyle', FontStyle, 'fontstyle');
    AddIntProperty('fontcolor', FontColor, 'skincolor');
    AddIntProperty('activefontcolor', ActiveFontColor, 'skincolor');
    AddIntProperty('unenabledfontcolor', UnEnabledFontColor, 'skincolor');
    AddBolProperty('stretcheffect', StretchEffect, 'boolean');
    AddBolProperty('inactivestretcheffect', InActiveStretchEffect, 'boolean');
    AddBolProperty('dividerstretcheffect', DividerStretchEffect, 'boolean');
    AddRectProperty('animateskinrect', AnimateSkinRect, 'arect');
    AddIntProperty('framecount', FrameCount, 'int');
    AddIntProperty('animateinterval', AnimateInterval, 'int');
    AddBolProperty('inactiveanimation', InActiveAnimation, 'boolean');
    AddBolProperty('useimagecolor', UseImageColor, 'boolean');
    AddIntProperty('imagecolor', ImageColor, 'skincolor');
    AddIntProperty('activeimagecolor', ActiveImageColor, 'skincolor');
    AddBolProperty('inactivetransparent', InActiveTransparent, 'boolean');
    //
    AddRectProperty('checkimagerect', CheckImageRect, 'arect');
    AddRectProperty('activecheckimagerect', ActiveCheckImageRect, 'arect');
    AddRectProperty('radioimagerect', RadioImageRect, 'arect');
    AddRectProperty('activeradioimagerect', ActiveRadioImageRect, 'arect');
    AddRectProperty('arrowimagerect', ArrowImageRect, 'arect');
    AddRectProperty('activearrowimagerect', ActiveArrowImageRect, 'arect');
  end;
  PE.Cells[0, 0] := '< menuitem >';

⌨️ 快捷键说明

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