探索FireMonkey的StyleBook皮肤控件的使用
2017-03-16 21:56
423 查看
StyleBook 介绍及VICEN对皮肤控件的一些看法
可以说StyleBook的出现,简直是皮肤控件厂商的噩梦,因为用户可以通过StyleBook快速切换控件样式,而不需要在去购买第三方换肤控件,对于免费并且是官方集成的StyleBook来说,优势不言而喻。因此,以后的皮肤控件除非有自己的特色,例如Raize,提供了很多系统没有的控件,并且有自己的独特的外形风格,否则很难在发展下去。我们很期待有一套类似QQ样的界面控件套件,可以换肤、切换窗口样式颜色、跟换窗口背景图片等。
先来看看StyleBook为我们提供了哪些默认的界面风格,这些界面风格都被安装在:
..\Program Files\Embarcadero\RAD Studio\9.0\Redist\styles\Fmx\
目录下,如果你要发布你的程序,将这里的你需要用到的.style文件一并复制到你发布软件目录即可。
StyleBook提供的界面风格如下:
Windows7.Style
RubyGraphite.style
MacGraphite.Style
MacBlue.Style
IOS.Style
GoldenGraphite.Style
FMX.Platform.Win.style
FMX.Platform.Mac.style
FMX.Platform.iOS.style
dark.style
Blend.Style
AquaGraphite.style
Amakrits.Style
Air.Style
虽然并不多,但可以自行设计扩展,而且支持动态切换,使用也相当的简单。
下面我们看看如何来使用 StyleBook
1) 首先我们来新建一个FireMonkey HD Application工程
2) 在窗口上放一个StyleBook控件,它位于Standard控件页下。
3) 将窗口的StyleBook属性与StyleBookl控件链接。
procedure TFrmStyleTest.FormCreate(Sender: TObject);
begin
Self.StyleBook := StyleBook;
end;
4) 现在就可以使用StyleBook.FileName := ‘样式名称’ 来切换样式了,需要特别注意的是,样式文件必须与EXE在同一个目录,因为测试程序样式文件没加路径,如果不在同一目录就没显示效果。
代码如下:
可以说StyleBook的出现,简直是皮肤控件厂商的噩梦,因为用户可以通过StyleBook快速切换控件样式,而不需要在去购买第三方换肤控件,对于免费并且是官方集成的StyleBook来说,优势不言而喻。因此,以后的皮肤控件除非有自己的特色,例如Raize,提供了很多系统没有的控件,并且有自己的独特的外形风格,否则很难在发展下去。我们很期待有一套类似QQ样的界面控件套件,可以换肤、切换窗口样式颜色、跟换窗口背景图片等。
先来看看StyleBook为我们提供了哪些默认的界面风格,这些界面风格都被安装在:
..\Program Files\Embarcadero\RAD Studio\9.0\Redist\styles\Fmx\
目录下,如果你要发布你的程序,将这里的你需要用到的.style文件一并复制到你发布软件目录即可。
StyleBook提供的界面风格如下:
Windows7.Style
RubyGraphite.style
MacGraphite.Style
MacBlue.Style
IOS.Style
GoldenGraphite.Style
FMX.Platform.Win.style
FMX.Platform.Mac.style
FMX.Platform.iOS.style
dark.style
Blend.Style
AquaGraphite.style
Amakrits.Style
Air.Style
虽然并不多,但可以自行设计扩展,而且支持动态切换,使用也相当的简单。
下面我们看看如何来使用 StyleBook
1) 首先我们来新建一个FireMonkey HD Application工程
2) 在窗口上放一个StyleBook控件,它位于Standard控件页下。
3) 将窗口的StyleBook属性与StyleBookl控件链接。
procedure TFrmStyleTest.FormCreate(Sender: TObject);
begin
Self.StyleBook := StyleBook;
end;
4) 现在就可以使用StyleBook.FileName := ‘样式名称’ 来切换样式了,需要特别注意的是,样式文件必须与EXE在同一个目录,因为测试程序样式文件没加路径,如果不在同一目录就没显示效果。
代码如下:
unit FireStyle; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Menus, FMX.Edit, FMX.ListBox, FMX.Layouts, FMX.Memo; type TFrmStyleTest = class(TForm) StyleBook: TStyleBook; MainMenu: TMainMenu; Menu_File: TMenuItem; Menu_File_Open: TMenuItem; Menu_Help: TMenuItem; Menu_File_New: TMenuItem; Menu_File_Line0: TMenuItem; Menu_File_Quit: TMenuItem; Menu_Help_About: TMenuItem; Chk_Test: TCheckBox; Rb_Style_0: TRadioButton; Rb_Style_1: TRadioButton; Rb_Style_2: TRadioButton; Rb_Style_3: TRadioButton; Rb_Style_4: TRadioButton; Rb_Style_5: TRadioButton; Rb_Style_6: TRadioButton; Rb_Style_7: TRadioButton; Rb_Style_8: TRadioButton; Rb_Style_9: TRadioButton; Rb_Style_10: TRadioButton; Rb_Style_11: TRadioButton; Rb_Style_12: TRadioButton; Rb_Style_13: TRadioButton; Lab_StyleName: TLabel; But_Close: TButton; Ed_StyleName: TEdit; tb_Test: TTrackBar; pb_Bar: TProgressBar; sb_Test: TScrollBar; cmb_Test: TComboBox; ListBoxItem1: TListBoxItem; ListBoxItem2: TListBoxItem; ListBoxItem3: TListBoxItem; Memo_Test: TMemo; tmr_Process: TTimer; procedure FormCreate(Sender: TObject); procedure But_CloseClick(Sender: TObject); procedure Menu_File_QuitClick(Sender: TObject); procedure Rb_Style_0Click(Sender: TObject); procedure tmr_ProcessTimer(Sender: TObject); private procedure ApplyStyle(swStyle: WideString); { Private declarations } public { Public declarations } end; var FrmStyleTest: TFrmStyleTest; implementation {$R *.fmx} procedure TFrmStyleTest.But_CloseClick(Sender: TObject); begin Close; end; procedure TFrmStyleTest.FormCreate(Sender: TObject); begin Self.StyleBook := StyleBook; ApplyStyle('iOS.style'); end; procedure TFrmStyleTest.Menu_File_QuitClick(Sender: TObject); begin Close; end; procedure TFrmStyleTest.Rb_Style_0Click(Sender: TObject); begin try ApplyStyle((Sender as TRadioButton).Text); except end; end; procedure TFrmStyleTest.tmr_ProcessTimer(Sender: TObject); begin if (pb_Bar.Value + 1) > 100 then pb_Bar.Value := 0 else pb_Bar.Value := pb_Bar.Value + 1; end; procedure TFrmStyleTest.ApplyStyle(swStyle:WideString); begin if swStyle<>'' then StyleBook.FileName := swStyle; Ed_StyleName.Text := swStyle; end; end.
相关文章推荐
- [入门] 探索FireMonkey的StyleBook皮肤控件的使用(附示例程序)
- StyleBook皮肤控件的使用
- Delphi XE2 之 FireMonkey 入门(20) - TStyleBook(皮肤、样式相关)
- 【FireMonkey】StyleBook使用方法
- Delphi XE2 之 FireMonkey 入门(20) - TStyleBook(皮肤、样式相关)
- Delphi XE2 之 FireMonkey 入门(20) - TStyleBook(皮肤、样式相关)
- 【FireMonkey】StyleBook使用方法
- DNN 皮肤控件的功能、使用、介绍
- VS中使用皮肤控件实现换肤功能
- c#Windwosmedia控件使用探索(4)
- ActionScript 3.0 Step By Step系列(九):使用样式(style)和皮肤(Skin)两大画笔为应用程序界面画妆
- c#Windwosmedia控件使用探索
- Delphi 皮肤控件AlphaControls的使用
- C++ Bulider之ActiveX控件之TF1Book的使用
- ASP.NET皮肤控件——使用方法
- Skin++皮肤控件的使用
- MFC中对Windows Media Player 控件使用个性皮肤
- 使用js获得html控件的style属性内容
- 免费皮肤控件的使用方法及效果测试——USkin v2.2
- Delphi 7皮肤控件VCLSkin 5.60的使用