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

📄 converterunit.pas

📁 skin components for design of your applicastions
💻 PAS
📖 第 1 页 / 共 5 页
字号:
     if BitmapIsOpaque(B2) then
      SkinIni.WriteString('RadioButtonGlyph_RUU','Transparent','0');
     B2.Free;
     SkinIni.WriteString('RadioButtonGlyph_RUU','Element1','E1,IMAGE');
     SkinIni.WriteString('RadioButtonGlyph_RUU','E1.Path',SavedShort(_radiobutton+'\ruu.png',MyName));
     SkinIni.WriteString('_RadioButton','RUU_Glyph','RadioButtonGlyph_RUU');
     SkinIni.WriteString('_MultiStateCheck_RadioButton','RUStyle','RadioButtonGlyph_RUU');
    end;
   //
   if Count>=5 then
    begin
     //Normal Unfocused Checked
     B2:=GetSubBitmap(Bitmap,Layout,Count,4);
     SaveBitmap(B2,DirPath+MyName+'\'+_radiobutton+'\nuc.png',IsTransp,TranspColor);
     if BitmapIsOpaque(B2) then
      SkinIni.WriteString('RadioButtonGlyph_NUC','Transparent','0');
     B2.Free;
     SkinIni.WriteString('RadioButtonGlyph_NUC','Element1','E1,IMAGE');
     SkinIni.WriteString('RadioButtonGlyph_NUC','E1.Path',SavedShort(_radiobutton+'\nuc.png',MyName));
     SkinIni.WriteString('_RadioButton','NUC_Glyph','RadioButtonGlyph_NUC');
     SkinIni.WriteString('_MultiStateCheck_RadioButton','NCStyle','RadioButtonGlyph_NUC');
    end;
   if Count>=6 then
    begin
     //Highlighted Unfocused Checked
     B2:=GetSubBitmap(Bitmap,Layout,Count,5);
     SaveBitmap(B2,DirPath+MyName+'\'+_radiobutton+'\huc.png',IsTransp,TranspColor);
     if BitmapIsOpaque(B2) then
      SkinIni.WriteString('RadioButtonGlyph_HUC','Transparent','0');
     B2.Free;
     SkinIni.WriteString('RadioButtonGlyph_HUC','Element1','E1,IMAGE');
     SkinIni.WriteString('RadioButtonGlyph_HUC','E1.Path',SavedShort(_radiobutton+'\huc.png',MyName));
     SkinIni.WriteString('_RadioButton','HUC_Glyph','RadioButtonGlyph_HUC');
     SkinIni.WriteString('_MultiStateCheck_RadioButton','HCStyle','RadioButtonGlyph_HUC');
    end;
   if Count>=7 then
    begin
     //Down Focused Checked
     B2:=GetSubBitmap(Bitmap,Layout,Count,6);
     SaveBitmap(B2,DirPath+MyName+'\'+_radiobutton+'\dfc.png',IsTransp,TranspColor);
     if BitmapIsOpaque(B2) then
      SkinIni.WriteString('RadioButtonGlyph_DFC','Transparent','0');
     B2.Free;
     SkinIni.WriteString('RadioButtonGlyph_DFC','Element1','E1,IMAGE');
     SkinIni.WriteString('RadioButtonGlyph_DFC','E1.Path',SavedShort(_radiobutton+'\dfc.png',MyName));
     SkinIni.WriteString('_RadioButton','DFC_Glyph','RadioButtonGlyph_DFC');
     SkinIni.WriteString('_MultiStateCheck_RadioButton','DCStyle','RadioButtonGlyph_DFC');
    end;
   if Count>=8 then
    begin
     //Read-only Unfocused Checked
     B2:=GetSubBitmap(Bitmap,Layout,Count,7);
     SaveBitmap(B2,DirPath+MyName+'\'+_radiobutton+'\ruc.png',IsTransp,TranspColor);
     if BitmapIsOpaque(B2) then
      SkinIni.WriteString('RadioButtonGlyph_RUC','Transparent','0');
     B2.Free;
     SkinIni.WriteString('RadioButtonGlyph_RUC','Element1','E1,IMAGE');
     SkinIni.WriteString('RadioButtonGlyph_RUC','E1.Path',SavedShort(_radiobutton+'\ruc.png',MyName));
     SkinIni.WriteString('_RadioButton','RUC_Glyph','RadioButtonGlyph_RUC');
     SkinIni.WriteString('_MultiStateCheck_RadioButton','RCStyle','RadioButtonGlyph_RUC');
    end;
   Bitmap.Free;
   //
   SkinIni.WriteString('RadioButton_Focus','Element1','E1,FOCUS_RECT');
   SkinIni.WriteString('RadioButton_Focus','E1.Rect','TL,TT,TR,TB');
   //
   SkinIni.WriteString('_RadioButton','NUU_TextLeftOffset','2');
   SkinIni.WriteString('_RadioButton','NUU_TextTopOffset','2');
   SkinIni.WriteString('_RadioButton','NUU_TextRightOffset','2');
   SkinIni.WriteString('_RadioButton','NUU_TextBottomOffset','2');
   SkinIni.WriteString('_RadioButton','NFU_OverStyle','RadioButton_Focus');
   //
   S1:=IniClassProp(TmpIni,'button.radiobutton(uncheckeddisabled)','TextColor','');
   if S1<>'' then
    SkinIni.WriteString('_RadioButton','RUU_FontColor',ConvertColor(S1));
   //
   S1:=IniClassProp(TmpIni,'button.radiobutton(checkeddisabled)','TextColor','');
   if S1<>'' then
    SkinIni.WriteString('_RadioButton','RUC_FontColor',ConvertColor(S1));
  end;
 if CheckBox7.Checked then
  begin
   SkinIni.WriteString('_RadioButton','HighlightInGlyphStepsNum','8');
   SkinIni.WriteString('_RadioButton','HighlightOutGlyphStepsNum','4');
   SkinIni.WriteString('_RadioButton','CheckGlyphStepsNum','8');
   SkinIni.WriteString('_RadioButton','UncheckGlyphStepsNum','6');
   SkinIni.WriteString('_RadioButton','DownGlyphStepsNum','4');
   SkinIni.WriteString('_RadioButton','UpGlyphStepsNum','2');
   SkinIni.WriteString('_RadioButton','EnableGlyphStepsNum','8');
   SkinIni.WriteString('_RadioButton','DisableGlyphStepsNum','8');
  end;
end;

procedure TForm1.ProcessGroupBox(const MyName:String;SkinIni,TmpIni:TIniFile);
var     FName:String;
       Bitmap:TBitmap;
    S1,Sizing:String;
           R1:TRect;
     IsTransp:Boolean;
  TranspColor:TColor;
begin
 FName:=IniClassProp(TmpIni,'button.groupbox','ImageFile','');
 if FName<>'' then
  begin
   Bitmap:=LoadBitmap(FName);
   if Bitmap=nil then
    begin
     Memo1.Lines.Add('GROUPBOX image not found!');
     exit;
    end;
   R1:=ConvertRect(IniClassProp(TmpIni,'button.groupbox','SizingMargins',''));
   Sizing:=LowerCase(IniClassProp(TmpIni,'button.groupbox','SizingType',''));
   IsTransp:=SameText(IniClassProp(TmpIni,'button.groupbox','Transparent',''),'true');
   TranspColor:=GetTColor(IniClassProp(TmpIni,'button.groupbox','TransparentColor','255 0 255'));
   SaveBoxTileImages(Bitmap,R1.Left,R1.Right,R1.Top,R1.Bottom,DirPath+MyName+'\'+_groupbox+'\*.png',IsTransp,TranspColor);
   Bitmap.Free;
   SkinIni.WriteString('GroupBox_NU','UseBuffering','1');
   SkinIni.WriteString('GroupBox_NU','Element1','E1,BOX_TILE');
   SaveRedirectedBoxTile('GroupBox_NU','1',_groupbox+'\*.png',MyName,SkinIni);
   if Sizing='stretch' then
    SkinIni.WriteString('GroupBox_NU','E1.ResizeMode','Stretch');
   SkinIni.WriteString('GroupBox_NU','E1.Rect','0,(CT+CB)|2,W,H');
   SkinIni.WriteString('GroupBox_NU','Element2','E2,ERASE_RECT');
   SkinIni.WriteString('GroupBox_NU','E2.Rect','CL-1,CT,CR+1,CB');
   //
   SkinIni.WriteString('GroupBox_Focus','Element1','E1,FOCUS_RECT');
   SkinIni.WriteString('GroupBox_Focus','E1.Rect','TL,TT,TR,TB');
   //
   S1:=IniClassProp(TmpIni,'button.groupbox','TextColor','');
   SkinIni.WriteString('_Label_GroupBox','N_FontColor',ConvertColor(S1));
   //
   SkinIni.WriteString('_GroupBox','LabelStyle','_Label_GroupBox');
   SkinIni.WriteString('_GroupBox','NU_Style','GroupBox_NU');
   SkinIni.WriteString('_GroupBox','NU_CaptionPosition','8');
   SkinIni.WriteString('_GroupBox','NU_CaptionLeftOffset','2');
   SkinIni.WriteString('_GroupBox','NU_CaptionRightOffset','2');
   SkinIni.WriteString('_GroupBox','NU_TextLeftOffset','2');
   SkinIni.WriteString('_GroupBox','NU_TextTopOffset','2');
   SkinIni.WriteString('_GroupBox','NU_TextRightOffset','2');
   SkinIni.WriteString('_GroupBox','NU_TextBottomOffset','2');
   SkinIni.WriteString('_GroupBox','NF_OverStyle','GroupBox_Focus');
   SkinIni.WriteString('_GroupBox','ClientRect','3,CB+2,W-3,H-3');
   //
   S1:=IniClassProp(TmpIni,'button.groupbox','borderOnly','');
   if SameText(S1,'true') then
    begin
     DeleteFile(DirPath+MyName+'\'+_groupbox+'\center.png');
     SkinIni.WriteString('_GroupBox','NU_TransparentRect',inttostr(R1.Left)+
          ',CB+1,W-'+inttostr(R1.Right)+',H-'+inttostr(R1.Bottom));
    end;
  end;
end;

procedure TForm1.ProcessEdit(const MyName:String;SkinIni,TmpIni:TIniFile);
var   BgType:String;
    FName,S1:String;
      Bitmap:TBitmap;
          R1:TRect;
       BSize:Integer;
       C1,C2:String;
       C3,C4:String;
      Sizing:String;
    IsTransp:Boolean;
 TranspColor:TColor;
begin
 BgType:=IniClassProp(TmpIni,'edit','BgType','');
 if SameText(BgType,'ImageFile') then
  begin
   FName:=IniClassProp(TmpIni,'edit','Imagefile','');
   if FName<>'' then
    begin
     Bitmap:=LoadBitmap(FName);
     if Bitmap=nil then
      begin
       Memo1.Lines.Add('EDIT image not found!');
       exit;
      end;
     R1:=ConvertRect(IniClassProp(TmpIni,'edit','SizingMargins',''));
     Sizing:=LowerCase(IniClassProp(TmpIni,'edit','SizingType',''));
     IsTransp:=SameText(IniClassProp(TmpIni,'edit','Transparent',''),'true');
     TranspColor:=GetTColor(IniClassProp(TmpIni,'edit','TransparentColor','255 0 255'));
     SaveBoxTileImages(Bitmap,R1.Left,R1.Right,R1.Top,R1.Bottom,DirPath+MyName+'\'+_edit+'\*.png',IsTransp,TranspColor);
     if BitmapIsOpaque(Bitmap) then
      SkinIni.WriteString('Edit_NU','Transparent','0');
     Bitmap.Free;
     SkinIni.WriteString('Edit_NU','Element1','E1,BOX_TILE');
     SaveRedirectedBoxTile('Edit_NU','1',_edit+'\*.png',MyName,SkinIni);
     if Sizing='stretch' then
      SkinIni.WriteString('Edit_NU','E1.ResizeMode','Stretch');
    end;
  end else
 if SameText(BgType,'BorderFill') then
  begin
   BSize:=StrToIntDef(IniClassProp(TmpIni,'edit','BorderSize',''),1);
   C1:=TmpIni.ReadString('edit','FillColor','');
   C2:=TmpIni.ReadString('edit','BorderColor','');
   SkinIni.WriteString('Edit_NU','Transparent','0');
   SkinIni.WriteString('Edit_NU','Element1','E1,RECT');
   SkinIni.WriteString('Edit_NU','E1.Rect','0,0,W-1,H-1');
   if C1<>'' then
    begin
     SkinIni.WriteString('Edit_NU','E1.HasFill','1');
     SkinIni.WriteString('Edit_NU','E1.FillColor',ConvertColor(C1));
    end;
   if C2<>'' then
    begin
     SkinIni.WriteString('Edit_NU','E1.HasBorder','1');
     SkinIni.WriteString('Edit_NU','E1.BorderColor',ConvertColor(C2));
    end;
   if BSize<>1 then
    SkinIni.WriteString('Edit_NU','E1.BorderThickness',inttostr(BSize));
   //
   C3:=IniClassProp(TmpIni,'edit.edittext(Disabled)','FillColor','');
   C4:=IniClassProp(TmpIni,'edit.edittext(Disabled)','BorderColor','');
   if (C3<>'') or (C4<>'') then
    begin
     if C3<>'' then C1:=C3;
     if C4<>'' then C2:=C4;
     SkinIni.WriteString('Edit_RU','Transparent','0');
     SkinIni.WriteString('Edit_RU','Element1','E1,RECT');
     SkinIni.WriteString('Edit_RU','E1.Rect','0,0,W-1,H-1');
     if C1<>'' then
      begin
       SkinIni.WriteString('Edit_RU','E1.HasFill','1');
       SkinIni.WriteString('Edit_RU','E1.FillColor',ConvertColor(C1));
      end;
     if C2<>'' then
      begin
       SkinIni.WriteString('Edit_RU','E1.HasBorder','1');
       SkinIni.WriteString('Edit_RU','E1.BorderColor',ConvertColor(C2));
      end;
     if BSize<>1 then
      SkinIni.WriteString('Edit_RU','E1.BorderThickness',inttostr(BSize));
     //
     SkinIni.WriteString('_Edit','RU_Style','Edit_RU');
    end;
  end;
 //
 SkinIni.WriteString('_Edit','NU_Style','Edit_NU');
 SkinIni.WriteString('_Edit','TextLeftOffset','3');
 SkinIni.WriteString('_Edit','TextTopOffset','5');
 SkinIni.WriteString('_Edit','TextRightOffset','3');
 SkinIni.WriteString('_Edit','TextBottomOffset','5');
 //
 S1:=TmpIni.ReadString('edit','TextColor','');
 if S1<>'' then
  SkinIni.WriteString('_Edit','NU_FontColor',ConvertColor(S1));
 //
 S1:=IniClassProp(TmpIni,'edit.edittext(Disabled)','TextColor','');
 if S1<>'' then
  SkinIni.WriteString('_Edit','RU_FontColor',ConvertColor(S1));
end;

procedure TForm1.ProcessForm(const MyName:String;SkinIni,TmpIni:TIniFile);
var    FName:String;
   Bitmap,B2:TBitmap;
 Layout,S,S2:String;
       Count:Integer;
       R1,R2:TRect;
      Sizing:String;
      LeftRS:TRect;
     RightRS:TRect;
    BottomRS:TRect;
    LFSizing:String;
    RFSizing:String;
    BFSizing:String;
     COpaque:Boolean;
     LOpaque:Boolean;
     ROpaque:Boolean;
     BOpaque:Boolean;
    MinCount:Integer;
  OffsetType:String;
      Offset:String;
    OffsetPT:TPoint;
    FontName:String;
    FontSize:Integer;
   FontStyle:TFontStyles;
       Align:String;
    IsTransp:Boolean;
 TranspColor:TColor;
          CH:String;
begin
 CH:=inttostr(StrToIntDef(IniClassProp(TmpIni,'SysMetrics','CaptionBarHeight',''),25)+5);
 MinCount:=100;
 LeftRS:=Rect(0,0,0,0);
 RightRS:=Rect(0,0,0,0);
 BottomRS:=Rect(0,0,0,0);
 COpaque:=False; LOpaque:=False; ROpaque:=False; BOpaque:=False;
 //Normal Caption
 FName:=IniClassProp(TmpIni,'Window.Caption','ImageFile','');
 if FName<>'' then
  begin
   Bitmap:=LoadBitmap(FName);
   if Bitmap=nil then
    begin
     Memo1.Lines.Add('WINDOW.CAPTION image not found!');
     exit;
    end;
   COpaque:=BitmapIsOpaque(Bitmap);
   Layout:=IniClassProp(TmpIni,'Window.Caption','Imagelayout','');
   Count:=StrToIntDef(IniClassProp(TmpIni,'Window.Caption','ImageCount',''),0);
   IsTransp:=SameText(IniClassProp(TmpIni,'Window.Caption','Transparent',''),'true');
   TranspColor:=GetTColor(IniClassProp(TmpIni,'Window.Caption','TransparentColor','255 0 255'));
   if Count=0 then Count:=1;
   if Count<MinCount then MinCount:=Count;
   R1:=ConvertRect(IniClassProp(TmpIni,'Window.Caption','SizingMargins',''));
   R2:=ConvertRect(IniClassProp(TmpIni,'Window.Caption','ContentMargins',''));
   Sizing:=LowerCase(IniClassProp(TmpIni,'Window.Caption','SizingType',''));
   if Count>1 then
    begin
     //Normal Focused
     B2:=GetSubBitmap(Bitmap,Layout,Count,0);
     SaveBoxTileImages(B2,R1.Left,R1.Right,R1.Top,R1.Bottom,DirPath+MyName+'\'+_form+'\'+_caption+'_nf_*.png',IsTransp,TranspColor,False);
     B2.Free;
     SkinIni.WriteString('Form_Caption_NF','Element1','E1,BOX_TILE');
     SkinIni.WriteString('Form_Caption_NF','E1.Transparent','0');
     SaveRedirectedBoxTile('Form_Caption_NF','1',_form+'\'+_caption+'_nf_*.png',MyName,SkinIni);
     if Sizing='stretch' then
      SkinIni.WriteString('Form_Caption_NF','E1.ResizeMode','Stretch');
     SkinIni.WriteString('_Form','NF_Caption','Form_Caption_NF');
     //
     if not COpaque then
      SkinIni.WriteString('_Form','NF_FullMask','Full,-BoxTile,'+_form+'\'+_caption+'_nf_*.png,'+
          Sizing+',W,CH,#FF000000,#FF000000,'+inttostr(R1.Left)+','+inttostr(R1.Right)+','+
          inttostr(R1.Top)+','+inttostr(R1.Bottom));
    end;
   if Count>=1 then
    begin
     //Normal Unfocused
     if Count=1 then
      B2:=GetSubBitmap(Bitmap,Layout,Count,0) else
       B2:=GetSubBitmap(Bitmap,Layout,Count,1);
     SaveBoxTileImages(B2,R1.Left,R1.Right,R1.Top,R1.Bottom,DirPath+MyName+'\'+_form+'\'+_caption+'_nu_*.png',IsTransp,TranspColor,False);
     B2.Free;
     SkinIni.WriteString('Form_Caption_NU','Element1','E1,BOX_TILE');
     SkinIni.WriteString('Form_Caption_NU','E1.Transparent','0');
     SaveRedirectedBoxTile('Form_Caption_NU','1',_form+'\'+_caption+'_nu_*.png',MyName,SkinIni);
     if Sizing='stretch' then
      SkinIni.WriteString('Form_Caption_NU','E1.ResizeMode','Stretch');
     SkinIni.WriteString('_Form','NU_Caption','Form_Caption_NU');
     //
     if not COpaque then
      SkinIni.WriteString('_Form','NU_FullMask','Full,-BoxTile,'+_form+'\'+_caption+'_nu_*.png,'+
          Sizing+',W,CH,#FF000000,#FF000000,'+inttostr(R1.Left)+','+inttostr(R1.Right)+','+
          inttostr(R1.Top)+','+inttostr(R1.Bottom));
    end;
   Align:=CorrectAlignm

⌨️ 快捷键说明

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