delphi for DirectUI界面库

来源:互联网 发布:诗经楚辞取名 知乎 编辑:程序博客网 时间:2024/04/28 08:29

下面是form代码

unit Unit1;interfaceuses    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,    Dialogs, CometSkin, StdCtrls, ComCtrls, ExtCtrls, Menus;const    IDM_MODULE_HOME = 100;    IDM_MODULE_PROTEC = 101;    IDM_MODULE_SEARCH = 102;    IDM_MODULE_TOOLS = 103;    IDM_MODULE_CLOCK = 104;    IDM_MODULE_HISTORY = 105;type    TForm1 = class(TSkinForm)    Label1: TLabel;    PopupMenu1: TPopupMenu;    N11: TMenuItem;    Button1: TButton;        procedure FormCreate(Sender: TObject);    procedure Button1Click(Sender: TObject);    private    { Private declarations }        procedure WMControlClick(var msg: TMessage); message            WM_SkinControl_Click;    public    { Public declarations }    end;var    Form1: TForm1;implementation{$R *.dfm}{$R '.\Res\SkinRes.RES'}procedure TForm1.Button1Click(Sender: TObject);beginend;procedure TForm1.FormCreate(Sender: TObject);begin    SetBkImage('BkImage1_jpg', 'Skin', 255, 150, 60, 60);    AddModuleButton(IDM_MODULE_HOME, '首 页', 'Module_Home_png', 'Skin');    AddModuleButton(IDM_MODULE_PROTEC, '保 护', 'Module_protec_png', 'Skin');    AddModuleButton(IDM_MODULE_SEARCH, '查 杀', 'Module_search_png', 'Skin');    AddModuleButton(IDM_MODULE_TOOLS, '工 具', 'Module_tools_png', 'Skin');    AddModuleButton(IDM_MODULE_CLOCK, '任 务', 'Module_clock_png', 'Skin');    AddModuleButton(IDM_MODULE_HISTORY, '记 录', 'Module_history_png', 'Skin');    AddModuleButton(IDM_MODULE_HISTORY, '记 录', 'Module_history_png', 'Skin');    SetModuleCheck(IDM_MODULE_HOME);end;procedure TForm1.WMControlClick(var msg: TMessage);var    CtlID: Integer; //控件ID    nIndex: Integer; //控件索引    pt: TPoint;begin    CtlID := msg.WParam;    nIndex := msg.LParam;    case CtlID of        SCM_MAINMENU:            begin            //MessageBox(Handle, '你点击[主菜单]了', '提示', MB_ICONINFORMATION);            GetCursorPos(pt);            PopupMenu1.Popup(pt.X,pt.Y);            end;        IDM_MODULE_HOME:            begin                SetModuleCheck(CtlID);                MessageBox(Handle, '你点击[首 页]了', '提示',                    MB_ICONINFORMATION);            end;        IDM_MODULE_PROTEC:            begin                SetModuleCheck(CtlID);                MessageBox(Handle, '你点击[保 护]了', '提示',                    MB_ICONINFORMATION);            end;        IDM_MODULE_SEARCH:            begin                SetModuleCheck(CtlID);                MessageBox(Handle, '你点击[查 杀]了', '提示',                    MB_ICONINFORMATION);            end;        IDM_MODULE_TOOLS:            begin                SetModuleCheck(CtlID);                MessageBox(Handle, '你点击[工 具]了', '提示',                    MB_ICONINFORMATION);            end;        IDM_MODULE_CLOCK:            begin                SetModuleCheck(CtlID);                MessageBox(Handle, '你点击[任 务]了', '提示',                    MB_ICONINFORMATION);            end;        IDM_MODULE_HISTORY:            begin                SetModuleCheck(CtlID);                MessageBox(Handle, '你点击[记 录]了', '提示',                    MB_ICONINFORMATION);            end;    end;end;end.

开源DirectUI界面库

微软 
https://github.com/jameskeane/directui
中国
http://code.google.com/p/duilib/
俄国
https://github.com/rsdn/avalon

0 0
原创粉丝点击