├── .gitignore ├── README.md ├── button.go ├── color.go ├── doc ├── 1.9.0-组合状态定义枚举.h ├── cToGo.go ├── update │ ├── 升级前必读v1.8.9.2.txt │ ├── 升级前必读v1.8.9.3.txt │ ├── 升级前必读v1.8.9.4.txt │ ├── 升级前必读v1.8.9.6.txt │ ├── 升级前必读v1.9.0.txt │ ├── 升级前必读v1.9.1.txt │ ├── 升级前必读v1.9.2.txt │ ├── 升级前必读v1.9.3.txt │ └── 升级前必读v1.9.9.txt ├── 使用说明.txt ├── 炫彩界面库-帮助文档(v1.9.9).chm └── 用户协议.txt ├── error.go ├── event.go ├── examples ├── button │ ├── button_animation │ │ ├── animation.go │ │ ├── notifyicon.manifest │ │ └── rsrc.syso │ └── button_simple │ │ ├── build.bat │ │ ├── button_example.go │ │ ├── notifyicon.manifest │ │ └── rsrc.syso ├── check │ └── check.go ├── comboBox │ └── comboBox.go ├── element │ └── element.go ├── frame │ └── frame.go ├── hello │ ├── build.bat │ └── hello.go ├── imageviewer │ ├── imageviewer.go │ ├── imageviewer.manifest │ └── rsrc.syso ├── img │ ├── 001.png │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ ├── 6.png │ ├── README │ ├── arrow_divide.png │ ├── bro.ico │ ├── buy.png │ ├── comma_face_01.png │ ├── comma_face_02.png │ ├── comma_face_03.png │ ├── comma_face_04.png │ ├── comma_face_05.png │ ├── comma_face_06.png │ ├── comma_face_07.png │ ├── comma_face_08.png │ ├── comma_face_09.png │ ├── comma_face_10.png │ ├── comma_face_11.png │ ├── comma_face_12.png │ ├── comma_face_13.png │ ├── comma_face_14.png │ ├── comma_face_15.png │ ├── comma_face_16.png │ ├── comma_face_17.png │ ├── comma_face_18.png │ ├── document-new.png │ ├── document-properties.png │ ├── folder_add.png │ ├── girl.jpg │ ├── main.ico │ ├── main.png │ ├── open.png │ ├── plus.png │ ├── pumpkin.png │ ├── system-shutdown.png │ ├── upload.ico │ └── x.ico ├── list │ └── list.go ├── listBox │ └── listBox.go ├── listView │ └── listView.go ├── menu │ └── menu.go ├── menuBar │ └── menuBar.go ├── modal │ └── modal.go ├── notifyicon │ ├── walk_menu │ │ ├── notifyicon.go │ │ ├── notifyicon.manifest │ │ └── rsrc.syso │ └── xcgui_menu │ │ ├── main.manifest │ │ ├── notifyicon.go │ │ └── rsrc.syso ├── progressBar │ └── progressBar.go ├── radio │ └── radio.go ├── richedit │ └── richedit.go ├── scrollBar │ └── scrollBar.go ├── scrollView │ └── scrollView.go ├── shapeLine │ └── shapeLine.go ├── shapePicture │ └── shapePicture.go ├── shapeRect │ └── shapeRect.go ├── shapeText │ └── shapeText.go ├── sliderBar │ └── sliderBar.go ├── toolBar │ └── toolBar.go ├── tree │ └── tree.go ├── ui │ ├── QQTest1 │ │ ├── QQImage │ │ │ ├── QQZone.png │ │ │ ├── SuperVIP_LIGHT.png │ │ │ ├── avatar.png │ │ │ └── avatar_large.png │ │ ├── image │ │ │ ├── ArrowBottomHover.png │ │ │ ├── ArrowBottomNormal.png │ │ │ ├── ArrowTopHover.png │ │ │ ├── ArrowTopNormal.png │ │ │ ├── MainPanel_FolderNode_expandTextureHighlight.png │ │ │ ├── Messagebox18_highlight.png │ │ │ ├── PopTipsTestIcon.png │ │ │ ├── QQZone.png │ │ │ ├── ShadowBorder.png │ │ │ ├── StatusSucceeded.gif │ │ │ ├── SuperVIP_LIGHT.png │ │ │ ├── VASFlagEnable.png │ │ │ ├── avatar.png │ │ │ ├── btn_MedalWall_Down.png │ │ │ ├── btn_MedalWall_Hover.png │ │ │ ├── btn_Skin_down.png │ │ │ ├── btn_Skin_highlight.png │ │ │ ├── btn_home_down.png │ │ │ ├── btn_home_hover.png │ │ │ ├── btn_medalwall_dark.png │ │ │ ├── btn_medalwall_normal.png │ │ │ ├── btn_skin_normal.png │ │ │ ├── expand.png │ │ │ ├── expandno.png │ │ │ ├── filemanager.png │ │ │ ├── filemanager_down.png │ │ │ ├── filemanager_hover.png │ │ │ ├── find.png │ │ │ ├── find_down.png │ │ │ ├── find_hover.png │ │ │ ├── finger_normal.png │ │ │ ├── icon.png │ │ │ ├── icon_contacts_hover.png │ │ │ ├── icon_contacts_normal.png │ │ │ ├── icon_contacts_selected.png │ │ │ ├── icon_group_hover.png │ │ │ ├── icon_group_normal.png │ │ │ ├── icon_group_selected.png │ │ │ ├── icon_last_hover.png │ │ │ ├── icon_last_normal.png │ │ │ ├── icon_last_selected.png │ │ │ ├── main_musicbtn20_music.png │ │ │ ├── mainmenu_allservices.png │ │ │ ├── mainpanel_foldernode_collapsetexture.png │ │ │ ├── mainpanel_foldernode_collapsetexturehighlight.png │ │ │ ├── mainpanel_foldernode_expandtexture.png │ │ │ ├── medalwall_ani.png │ │ │ ├── menu_btn_highlight.png │ │ │ ├── menu_btn_normal.png │ │ │ ├── menu_help.png │ │ │ ├── message.png │ │ │ ├── message_down.png │ │ │ ├── message_highlight.png │ │ │ ├── messagebox16.png │ │ │ ├── myCollection_mainpanel_down.png │ │ │ ├── myCollection_mainpanel_hover.png │ │ │ ├── mycollection_mainpanel.png │ │ │ ├── note1.png │ │ │ ├── openchat_down.png │ │ │ ├── openchat_hover.png │ │ │ ├── openchat_normal.png │ │ │ ├── qqlogoclassic.png │ │ │ ├── school_joinclass.png │ │ │ ├── skin1.jpg │ │ │ ├── success.png │ │ │ ├── sysbtn_close_down.png │ │ │ ├── sysbtn_close_hover.png │ │ │ ├── sysbtn_close_normal.png │ │ │ ├── sysbtn_max_down.png │ │ │ ├── sysbtn_max_hover.png │ │ │ ├── sysbtn_max_normal.png │ │ │ ├── sysbtn_min_down.png │ │ │ ├── sysbtn_min_hover.png │ │ │ ├── sysbtn_min_normal.png │ │ │ ├── sysbtn_restore_down.png │ │ │ ├── sysbtn_restore_hover.png │ │ │ ├── sysbtn_restore_normal.png │ │ │ ├── tools.png │ │ │ ├── tools_down.png │ │ │ ├── tools_hover.png │ │ │ ├── vip0.png │ │ │ ├── warning.png │ │ │ └── wrong.bmp │ │ ├── layout.xml │ │ ├── main.manifest │ │ ├── resource.xml │ │ ├── rsrc.syso │ │ ├── ui.go │ │ └── xml-template-test │ │ │ ├── Tree_Item_friend.xml │ │ │ ├── Tree_Item_friend_sel.xml │ │ │ └── Tree_Item_group.xml │ └── QQTest2 │ │ ├── QQTest.xcproj │ │ ├── data.xml │ │ ├── image │ │ ├── 0.png │ │ ├── 90.png │ │ ├── ArrowBottomHover.png │ │ ├── ArrowBottomNormal.png │ │ ├── ArrowTopHover.png │ │ ├── ArrowTopNormal.png │ │ ├── MainPanel_FolderNode_expandTextureHighlight.png │ │ ├── Messagebox18_highlight.png │ │ ├── PopTipsTestIcon.png │ │ ├── QQZone.png │ │ ├── ShadowBorder.png │ │ ├── StatusSucceeded.gif │ │ ├── SuperVIP_LIGHT.png │ │ ├── VASFlagEnable.png │ │ ├── avatar.png │ │ ├── btn_MedalWall_Down.png │ │ ├── btn_MedalWall_Hover.png │ │ ├── btn_Skin_down.png │ │ ├── btn_Skin_highlight.png │ │ ├── btn_home_down.png │ │ ├── btn_home_hover.png │ │ ├── btn_medalwall_dark.png │ │ ├── btn_medalwall_normal.png │ │ ├── btn_skin_normal.png │ │ ├── filemanager.png │ │ ├── filemanager_down.png │ │ ├── filemanager_hover.png │ │ ├── find.png │ │ ├── find_down.png │ │ ├── find_hover.png │ │ ├── finger_normal.png │ │ ├── icon.png │ │ ├── icon_contacts_hover.png │ │ ├── icon_contacts_normal.png │ │ ├── icon_contacts_selected.png │ │ ├── icon_group_hover.png │ │ ├── icon_group_normal.png │ │ ├── icon_group_selected.png │ │ ├── icon_last_hover.png │ │ ├── icon_last_normal.png │ │ ├── icon_last_selected.png │ │ ├── main_musicbtn20_music.png │ │ ├── mainmenu_allservices.png │ │ ├── mainpanel_foldernode_collapsetexture.png │ │ ├── mainpanel_foldernode_collapsetexturehighlight.png │ │ ├── mainpanel_foldernode_expandtexture.png │ │ ├── medalwall_ani.png │ │ ├── menu_btn_highlight.png │ │ ├── menu_btn_normal.png │ │ ├── menu_help.png │ │ ├── message.png │ │ ├── message_down.png │ │ ├── message_highlight.png │ │ ├── messagebox16.png │ │ ├── myCollection_mainpanel_down.png │ │ ├── myCollection_mainpanel_hover.png │ │ ├── mycollection_mainpanel.png │ │ ├── note1.png │ │ ├── openchat_down.png │ │ ├── openchat_hover.png │ │ ├── openchat_normal.png │ │ ├── qqlogoclassic.png │ │ ├── school_joinclass.png │ │ ├── skin1.jpg │ │ ├── success.png │ │ ├── sysbtn_close_down.png │ │ ├── sysbtn_close_hover.png │ │ ├── sysbtn_close_normal.png │ │ ├── sysbtn_max_down.png │ │ ├── sysbtn_max_hover.png │ │ ├── sysbtn_max_normal.png │ │ ├── sysbtn_min_down.png │ │ ├── sysbtn_min_hover.png │ │ ├── sysbtn_min_normal.png │ │ ├── sysbtn_restore_down.png │ │ ├── sysbtn_restore_hover.png │ │ ├── sysbtn_restore_normal.png │ │ ├── tools.png │ │ ├── tools_down.png │ │ ├── tools_hover.png │ │ ├── vip0.png │ │ ├── warning.png │ │ └── wrong.bmp │ │ ├── layout.xml │ │ ├── layoutTest.xml │ │ ├── main.manifest │ │ ├── qq.go │ │ ├── resource.xml │ │ ├── rsrc.syso │ │ └── style.xml ├── web │ └── main.go ├── wke │ ├── image │ │ ├── skin.jpg │ │ ├── skin.png │ │ ├── skin2.jpg │ │ ├── skin2.png │ │ ├── sysbtn_close_down.png │ │ ├── sysbtn_close_hover.png │ │ ├── sysbtn_close_normal.png │ │ ├── sysbtn_max_down.png │ │ ├── sysbtn_max_hover.png │ │ ├── sysbtn_max_normal.png │ │ ├── sysbtn_min_down.png │ │ ├── sysbtn_min_hover.png │ │ ├── sysbtn_min_normal.png │ │ ├── sysbtn_restore_down.png │ │ ├── sysbtn_restore_hover.png │ │ └── sysbtn_restore_normal.png │ ├── jsCallFunction.html │ ├── main.go │ ├── xml │ │ ├── good.xcproj │ │ ├── image │ │ │ ├── skin.jpg │ │ │ ├── skin.png │ │ │ ├── skin2.jpg │ │ │ ├── skin2.png │ │ │ ├── sysbtn_close_down.png │ │ │ ├── sysbtn_close_hover.png │ │ │ ├── sysbtn_close_normal.png │ │ │ ├── sysbtn_max_down.png │ │ │ ├── sysbtn_max_hover.png │ │ │ ├── sysbtn_max_normal.png │ │ │ ├── sysbtn_min_down.png │ │ │ ├── sysbtn_min_hover.png │ │ │ ├── sysbtn_min_normal.png │ │ │ ├── sysbtn_restore_down.png │ │ │ ├── sysbtn_restore_hover.png │ │ │ └── sysbtn_restore_normal.png │ │ ├── layout.xml │ │ ├── resource.xml │ │ └── style.xml │ └── xml2 │ │ ├── good.xcproj │ │ ├── image │ │ ├── skin.jpg │ │ ├── skin.png │ │ ├── skin2.jpg │ │ ├── skin2.png │ │ ├── sysbtn_close_down.png │ │ ├── sysbtn_close_hover.png │ │ ├── sysbtn_close_normal.png │ │ ├── sysbtn_max_down.png │ │ ├── sysbtn_max_hover.png │ │ ├── sysbtn_max_normal.png │ │ ├── sysbtn_min_down.png │ │ ├── sysbtn_min_hover.png │ │ ├── sysbtn_min_normal.png │ │ ├── sysbtn_restore_down.png │ │ ├── sysbtn_restore_hover.png │ │ └── sysbtn_restore_normal.png │ │ ├── layout.xml │ │ ├── resource.xml │ │ └── style.xml └── xml-template │ ├── ComboBox_ListBox_Item.xml │ ├── ListBox_Item.xml │ ├── ListView_Item.xml │ ├── List_Item.xml │ └── Tree_Item.xml ├── image.go ├── lib ├── XCGUI.dll ├── XCGUI.lib ├── last │ ├── wke.dll │ ├── wkeBrowser.dll │ ├── wkeBrowser.h │ └── xcgui.h ├── wke.dll ├── wkeBrowser.dll ├── wkeBrowser.h ├── wkeBrowser.lib └── xcgui.h ├── mainwindow.go ├── messagebox.go ├── point.go ├── rectangle.go ├── size.go ├── widget.go ├── window.go ├── wke ├── api.go ├── define.go └── wke.go └── xc ├── aapi.go ├── adapterListView.go ├── adapterMap.go ├── adapterTable.go ├── adapterTree.go ├── bkInfoManager.go ├── button.go ├── color.go ├── comboBox.go ├── dateTime.go ├── define.go ├── download.go ├── draw.go ├── element.go ├── fontX.go ├── frameWindow.go ├── image.go ├── kernel32.go ├── layoutAlign.go ├── layoutObject.go ├── list.go ├── listbox.go ├── listview.go ├── menu.go ├── menuBar.go ├── modalWindow.go ├── monthCal.go ├── pane.go ├── progressBar.go ├── richEdit.go ├── scrollBar.go ├── scrollView.go ├── shape.go ├── shapeEllipse.go ├── shapeGif.go ├── shapeGroupBox.go ├── shapeLine.go ├── shapePicture.go ├── shapeRect.go ├── shapeText.go ├── sliderBar.go ├── tabBar.go ├── textLink.go ├── toolBar.go ├── tree.go ├── ui.go ├── user32.go ├── window.go ├── xc.go ├── xe.go └── xwm.go /.gitignore: -------------------------------------------------------------------------------- 1 | doc/* 2 | !doc/*.h 3 | !doc/*.dll 4 | !doc/*.chm 5 | !doc/cToGo.go 6 | !doc/update/ 7 | XCGUI.dll 8 | !lib/XCGUI.dll 9 | 10 | # !examples/lib/XCGUI.dll 11 | *.exe 12 | *.txt 13 | !doc/*.txt 14 | !doc/update/*.txt 15 | *.chw 16 | 17 | # wke 18 | *localStorage/ 19 | -------------------------------------------------------------------------------- /color.go: -------------------------------------------------------------------------------- 1 | package xcgui 2 | 3 | import ( 4 | "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | type Color xc.COLORREF 8 | 9 | func RGB(r, g, b byte) Color { 10 | return Color(uint32(r) | uint32(g)<<8 | uint32(b)<<16) 11 | } 12 | 13 | func (c Color) R() byte { 14 | return byte(c & 0xff) 15 | } 16 | 17 | func (c Color) G() byte { 18 | return byte((c >> 8) & 0xff) 19 | } 20 | 21 | func (c Color) B() byte { 22 | return byte((c >> 16) & 0xff) 23 | } 24 | -------------------------------------------------------------------------------- /doc/1.9.0-组合状态定义枚举.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/doc/1.9.0-组合状态定义枚举.h -------------------------------------------------------------------------------- /doc/cToGo.go: -------------------------------------------------------------------------------- 1 | package doc 2 | 3 | /* 4 | Win32 C/C++ golang 字符对照表 5 | 6 | WIN32类型 C/C++ 类型 GO 类型 7 | HANDLE void * uintptr 8 | BYTE unsigned char uint8, byte 9 | SHORT short int16 10 | WORD unsigned short uint16 11 | INT int int32, int 12 | UINT unsigned int uint32 13 | LONG long int32 14 | BOOL int int 15 | DWORD unsigned long uint32 16 | ULONG unsigned long uint32 17 | CHAR char byte 18 | WCHAR wchar_t uint16 19 | LPSTR utf8/char * *byte 20 | LPCSTR const utf8/char * *byte, syscall.StringBytePtr(), xc.UTF8PtrToSting() 21 | LPWSTR wchar_t * *uint16 22 | LPCWSTR const wchar_t * *uint16, syscall.StringToUTF16Ptr() 23 | FLOAT float float32 24 | DOUBLE double float64 25 | LONGLONG __int64 int64 26 | DWORD64 unsigned __int64 uint64 27 | */ 28 | -------------------------------------------------------------------------------- /doc/update/升级前必读v1.8.9.2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/doc/update/升级前必读v1.8.9.2.txt -------------------------------------------------------------------------------- /doc/update/升级前必读v1.8.9.3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/doc/update/升级前必读v1.8.9.3.txt -------------------------------------------------------------------------------- /doc/update/升级前必读v1.8.9.4.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/doc/update/升级前必读v1.8.9.4.txt -------------------------------------------------------------------------------- /doc/update/升级前必读v1.8.9.6.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/doc/update/升级前必读v1.8.9.6.txt -------------------------------------------------------------------------------- /doc/update/升级前必读v1.9.0.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/doc/update/升级前必读v1.9.0.txt -------------------------------------------------------------------------------- /doc/update/升级前必读v1.9.1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/doc/update/升级前必读v1.9.1.txt -------------------------------------------------------------------------------- /doc/update/升级前必读v1.9.2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/doc/update/升级前必读v1.9.2.txt -------------------------------------------------------------------------------- /doc/update/升级前必读v1.9.3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/doc/update/升级前必读v1.9.3.txt -------------------------------------------------------------------------------- /doc/update/升级前必读v1.9.9.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/doc/update/升级前必读v1.9.9.txt -------------------------------------------------------------------------------- /doc/使用说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/doc/使用说明.txt -------------------------------------------------------------------------------- /doc/炫彩界面库-帮助文档(v1.9.9).chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/doc/炫彩界面库-帮助文档(v1.9.9).chm -------------------------------------------------------------------------------- /doc/用户协议.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/doc/用户协议.txt -------------------------------------------------------------------------------- /error.go: -------------------------------------------------------------------------------- 1 | package xcgui 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "runtime/debug" 7 | ) 8 | 9 | import ( 10 | "github.com/codyguo/xcgui/xc" 11 | ) 12 | 13 | var ( 14 | logErrors bool 15 | panicOnError bool 16 | ) 17 | 18 | type Error struct { 19 | inner error 20 | message string 21 | stack []byte 22 | } 23 | 24 | func (err *Error) Inner() error { 25 | return err.inner 26 | } 27 | 28 | func (err *Error) Message() string { 29 | if err.message != "" { 30 | return err.message 31 | } 32 | 33 | if err.inner != nil { 34 | if xcErr, ok := err.inner.(*Error); ok { 35 | return xcErr.Message() 36 | } else { 37 | return err.inner.Error() 38 | } 39 | } 40 | 41 | return "" 42 | } 43 | 44 | func (err *Error) Stack() []byte { 45 | return err.stack 46 | } 47 | 48 | func (err *Error) Error() string { 49 | return fmt.Sprintf("%s\n\nStack:\n%s", err.Message(), err.stack) 50 | } 51 | 52 | func processErrorNoPanic(err error) error { 53 | if logErrors { 54 | if walkErr, ok := err.(*Error); ok { 55 | log.Print(walkErr.Error()) 56 | } else { 57 | log.Printf("%s\n\nStack:\n%s", err, debug.Stack()) 58 | } 59 | } 60 | 61 | return err 62 | } 63 | 64 | func processError(err error) error { 65 | processErrorNoPanic(err) 66 | 67 | if panicOnError { 68 | panic(err) 69 | } 70 | 71 | return err 72 | } 73 | 74 | func newErr(message string) error { 75 | return &Error{message: message, stack: debug.Stack()} 76 | } 77 | 78 | func newError(message string) error { 79 | return processError(newErr(message)) 80 | } 81 | 82 | func newErrorNoPanic(message string) error { 83 | return processErrorNoPanic(newErr(message)) 84 | } 85 | 86 | func lastError(win32FuncName string) error { 87 | if errno := xc.GetLastError(); errno != xc.ERROR_SUCCESS { 88 | return newError(fmt.Sprintf("%s: Error %d", win32FuncName, errno)) 89 | } 90 | 91 | return newError(win32FuncName) 92 | } 93 | 94 | func errorFromHRESULT(funcName string, hr xc.HRESULT) error { 95 | return newError(fmt.Sprintf("%s: Error %d", funcName, hr)) 96 | } 97 | 98 | func wrapErr(err error) error { 99 | if _, ok := err.(*Error); ok { 100 | return err 101 | } 102 | 103 | return &Error{inner: err, stack: debug.Stack()} 104 | } 105 | 106 | func wrapErrorNoPanic(err error) error { 107 | return processErrorNoPanic(wrapErr(err)) 108 | } 109 | 110 | func wrapError(err error) error { 111 | return processError(wrapErr(err)) 112 | } 113 | 114 | func toErrorNoPanic(x interface{}) error { 115 | switch x := x.(type) { 116 | case *Error: 117 | return x 118 | 119 | case error: 120 | return wrapErrorNoPanic(x) 121 | 122 | case string: 123 | return newErrorNoPanic(x) 124 | } 125 | 126 | return newErrorNoPanic(fmt.Sprintf("Error: %v", x)) 127 | } 128 | 129 | func toError(x interface{}) error { 130 | err := toErrorNoPanic(x) 131 | 132 | if panicOnError { 133 | panic(err) 134 | } 135 | 136 | return err 137 | } 138 | -------------------------------------------------------------------------------- /event.go: -------------------------------------------------------------------------------- 1 | package xcgui 2 | 3 | // import ( 4 | // "fmt" 5 | // ) 6 | 7 | import ( 8 | "github.com/codyguo/xcgui/xc" 9 | ) 10 | 11 | type EventHandler func() 12 | 13 | type Event struct { 14 | hEle xc.HELE 15 | handlers []EventHandler 16 | } 17 | 18 | func (e *Event) Attach(handler EventHandler) int { 19 | 20 | for i, h := range e.handlers { 21 | if h == nil { 22 | e.handlers[i] = handler 23 | return i 24 | } 25 | 26 | } 27 | 28 | e.handlers = append(e.handlers, handler) 29 | return len(e.handlers) - 1 30 | } 31 | 32 | func (e *Event) Detach(handle int) { 33 | e.handlers[handle] = nil 34 | } 35 | 36 | type EventPublisher struct { 37 | event Event 38 | } 39 | 40 | func (p *EventPublisher) Event(hEle xc.HELE) *Event { 41 | p.event.hEle = hEle 42 | return &p.event 43 | } 44 | 45 | func (p *EventPublisher) Publish() { 46 | for _, handler := range p.event.handlers { 47 | if handler != nil { 48 | handler() 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /examples/button/button_animation/animation.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | xcgui "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | type my_image_info struct { 8 | hImage1 xcgui.HIMAGE 9 | hImage2 xcgui.HIMAGE 10 | hImage3 xcgui.HIMAGE 11 | hImage4 xcgui.HIMAGE 12 | hImage5 xcgui.HIMAGE 13 | hImage6 xcgui.HIMAGE 14 | } 15 | 16 | func main() { 17 | hWindow := xcgui.XWnd_Create(0, 0, 300, 200, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 18 | xcgui.CloseBtn(hWindow) 19 | 20 | info := new(my_image_info) 21 | 22 | info.hImage1 = xcgui.XImage_LoadFile("../../img/1.png", false) 23 | info.hImage2 = xcgui.XImage_LoadFile("../../img/2.png", false) 24 | info.hImage3 = xcgui.XImage_LoadFile("../../img/3.png", false) 25 | info.hImage4 = xcgui.XImage_LoadFile("../../img/4.png", false) 26 | info.hImage5 = xcgui.XImage_LoadFile("../../img/5.png", false) 27 | info.hImage6 = xcgui.XImage_LoadFile("../../img/6.png", false) 28 | 29 | left, top := 20, 50 30 | for i := 0; i < 5; i++ { 31 | CreateButton(left, top, info, hWindow) 32 | left += 50 33 | } 34 | 35 | left, top = 20, 100 36 | for i := 0; i < 5; i++ { 37 | CreateButtonLoop(left, top, info, hWindow) 38 | left += 50 39 | } 40 | 41 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 42 | xcgui.XRunXCGUI() 43 | xcgui.XExitXCGUI() 44 | 45 | } 46 | 47 | func CreateButton(left, top int, pInfo *my_image_info, hWindow xcgui.HWINDOW) { 48 | hButton := xcgui.XBtn_Create(left, top, 37, 42, "A", xcgui.HXCGUI(hWindow)) 49 | xcgui.XBtn_AddAnimationFrame(hButton, pInfo.hImage1, 100) 50 | xcgui.XBtn_AddAnimationFrame(hButton, pInfo.hImage2, 100) 51 | xcgui.XBtn_AddAnimationFrame(hButton, pInfo.hImage3, 100) 52 | xcgui.XBtn_AddAnimationFrame(hButton, pInfo.hImage4, 100) 53 | xcgui.XBtn_AddAnimationFrame(hButton, pInfo.hImage5, 100) 54 | xcgui.XBtn_AddAnimationFrame(hButton, pInfo.hImage6, 100) 55 | 56 | xcgui.XBtn_EnableAnimation(hButton, true, false) 57 | } 58 | 59 | func CreateButtonLoop(left, top int, pInfo *my_image_info, hWindow xcgui.HWINDOW) { 60 | hButton := xcgui.XBtn_Create(left, top, 37, 42, "B", xcgui.HXCGUI(hWindow)) 61 | xcgui.XBtn_AddAnimationFrame(hButton, pInfo.hImage1, 100) 62 | xcgui.XBtn_AddAnimationFrame(hButton, pInfo.hImage2, 100) 63 | xcgui.XBtn_AddAnimationFrame(hButton, pInfo.hImage3, 100) 64 | xcgui.XBtn_AddAnimationFrame(hButton, pInfo.hImage4, 100) 65 | xcgui.XBtn_AddAnimationFrame(hButton, pInfo.hImage5, 100) 66 | xcgui.XBtn_AddAnimationFrame(hButton, pInfo.hImage6, 100) 67 | 68 | xcgui.XBtn_EnableAnimation(hButton, true, true) 69 | } 70 | -------------------------------------------------------------------------------- /examples/button/button_animation/notifyicon.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | true 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/button/button_animation/rsrc.syso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/button/button_animation/rsrc.syso -------------------------------------------------------------------------------- /examples/button/button_simple/build.bat: -------------------------------------------------------------------------------- 1 | @if exist "rsrc.syso" ( 2 | @del "rsrc.syso" 3 | ) 4 | 5 | set GOARCH=386 6 | set GOGCCFLAGS=-m32 -mthreads -fmessage-length=0 7 | 8 | go build -ldflags="-H windowsgui" 9 | pause 10 | exit 11 | 12 | -ldflags "-s -w" 13 | 14 | rsrc -manifest main.manifest -o rsrc.syso 15 | set GOARCH=386 16 | set GOBIN=D:\go\bin 17 | set GOEXE=.exe 18 | set GOHOSTARCH=386 19 | set GOHOSTOS=windows 20 | set GOOS=windows 21 | set GOPATH=D:\go\gopath 22 | set GORACE= 23 | set GOROOT=D:\go 24 | set GOTOOLDIR=D:\go\pkg\tool\windows_386 25 | set GO15VENDOREXPERIMENT= 26 | set CC=gcc 27 | set GOGCCFLAGS=-m32 -mthreads -fmessage-length=0 28 | set CXX=g++ 29 | set CGO_ENABLED=1 -------------------------------------------------------------------------------- /examples/button/button_simple/button_example.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | ) 6 | import ( 7 | "github.com/codyguo/xcgui" 8 | // "github.com/codyguo/xcgui/xc" 9 | ) 10 | 11 | func main() { 12 | mw, _ := xcgui.NewMainWindow(xcgui.Size{800, 600}, "测试") 13 | mw.SetMinimumSize(xcgui.Size{500, 300}) 14 | 15 | button1, _ := xcgui.NewButton(mw, xcgui.Rectangle{300, 180, 100, 25}) 16 | button1.SetText("提示信息") 17 | 18 | button2, _ := xcgui.NewButton(mw, xcgui.Rectangle{300, 235, 100, 30}) 19 | button2.SetText("警告信息") 20 | 21 | button1.OnBtnClick(func() { 22 | xcgui.MsgBox(mw, "提示", "这是一条提示信息...", xcgui.MsgBoxIconInformation) 23 | }) 24 | 25 | button2.OnBtnClick(func() { 26 | text := button2.GetText() 27 | log.Println("button2 - text:", text) 28 | xcgui.MsgBox(mw, "警告", "这是一条警告信息!", xcgui.MsgBoxIconWarning) 29 | }) 30 | 31 | img, _ := xcgui.NewImageFromFile("../../img/open.png") 32 | 33 | button1.SetIcon(img) 34 | button2.SetIcon(img) 35 | 36 | button1.SetIconAlign(xcgui.BUTTON_ICON_ALIGN_RIGHT) 37 | button2.SetIconAlign(xcgui.BUTTON_ICON_ALIGN_RIGHT) 38 | 39 | color := xcgui.RGB(255, 0, 0) 40 | button1.AddBkBorder(xcgui.BUTTON_STATE_LEAVE, color, 255, 2) 41 | button2.AddBkFill(xcgui.BUTTON_STATE_LEAVE, color, 255) 42 | 43 | img_buy, _ := xcgui.NewImageFromFile("../../img/buy.png") 44 | 45 | button1.AddBkImage(xcgui.BUTTON_STATE_LEAVE, img_buy) 46 | err := mw.Show() 47 | if err != nil { 48 | log.Fatalln(err) 49 | } 50 | 51 | xcgui.DebugToFileInfo("中文写入debug文件.") 52 | 53 | mw.Run() 54 | 55 | mw.Close() 56 | } 57 | -------------------------------------------------------------------------------- /examples/button/button_simple/notifyicon.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | true 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/button/button_simple/rsrc.syso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/button/button_simple/rsrc.syso -------------------------------------------------------------------------------- /examples/check/check.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | xcgui "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | func main() { 8 | hWindow := xcgui.XWnd_Create(0, 0, 300, 200, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 9 | xcgui.CloseBtn(hWindow) 10 | 11 | hCheck1 := xcgui.XBtn_Create(20, 40, 100, 20, "Check1", xcgui.HXCGUI(hWindow)) 12 | hCheck2 := xcgui.XBtn_Create(20, 70, 100, 20, "Check2", xcgui.HXCGUI(hWindow)) 13 | hCheck3 := xcgui.XBtn_Create(20, 100, 100, 20, "Check3", xcgui.HXCGUI(hWindow)) 14 | xcgui.XBtn_SetType(hCheck1, xcgui.BUTTON_TYPE_CHECK) 15 | xcgui.XBtn_SetType(hCheck2, xcgui.BUTTON_TYPE_CHECK) 16 | xcgui.XBtn_SetType(hCheck3, xcgui.BUTTON_TYPE_CHECK) 17 | 18 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 19 | xcgui.XRunXCGUI() 20 | xcgui.XExitXCGUI() 21 | } 22 | -------------------------------------------------------------------------------- /examples/comboBox/comboBox.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | import ( 8 | xcgui "github.com/codyguo/xcgui/xc" 9 | ) 10 | 11 | func main() { 12 | hWindow := xcgui.XWnd_Create(0, 0, 300, 200, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 13 | xcgui.CloseBtn(hWindow) 14 | 15 | hComboBox := xcgui.XComboBox_Create(20, 40, 120, 20, xcgui.HXCGUI(hWindow)) 16 | xcgui.XComboBox_SetItemTemplateXML(hComboBox, "../xml-template/ComboBox_ListBox_Item.xml") 17 | xcgui.XRichEdit_SetText(hComboBox, "123") 18 | 19 | hAdapter := xcgui.XAdapterTable_Create() 20 | xcgui.XComboBox_BindApapter(hComboBox, hAdapter) 21 | xcgui.XAdapterTable_AddColumn(hAdapter, "name") 22 | 23 | for i := 0; i < 20; i++ { 24 | xcgui.XAdapterTable_AddItemText(hAdapter, "name-"+fmt.Sprint(i)+"-0") 25 | } 26 | 27 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 28 | xcgui.XRunXCGUI() 29 | xcgui.XExitXCGUI() 30 | } 31 | -------------------------------------------------------------------------------- /examples/element/element.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | xcgui "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | func main() { 8 | hWindow := xcgui.XWnd_Create(0, 0, 300, 200, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 9 | xcgui.XBtn_SetType(xcgui.XBtn_Create(10, 5, 60, 20, "Close", xcgui.HXCGUI(hWindow)), xcgui.BUTTON_TYPE_CLOSE) 10 | 11 | xcgui.XEle_Create(20, 50, 100, 100, xcgui.HXCGUI(hWindow)) 12 | 13 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 14 | 15 | xcgui.XRunXCGUI() 16 | xcgui.XExitXCGUI() 17 | } 18 | -------------------------------------------------------------------------------- /examples/frame/frame.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | xcgui "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | var ( 8 | mw xcgui.HWINDOW 9 | ) 10 | 11 | func main() { 12 | mw = xcgui.XFrameWnd_Create(0, 0, 600, 400, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 13 | xcgui.XBtn_SetType(xcgui.XBtn_Create(3, 3, 20, 20, "X", xcgui.HXCGUI(mw)), xcgui.BUTTON_TYPE_CLOSE) 14 | 15 | hPane1 := xcgui.XPane_Create("111", 200, 200, mw) 16 | hPane2 := xcgui.XPane_Create("2222222222", 200, 200, mw) 17 | hPane3 := xcgui.XPane_Create("333", 200, 200, mw) 18 | 19 | xcgui.XFrameWnd_AddPane(mw, 0, hPane1, xcgui.Align_left) 20 | 21 | xcgui.XFrameWnd_AddPane(mw, 0, hPane2, xcgui.Align_bottom) 22 | 23 | xcgui.XFrameWnd_AddPane(mw, 0, hPane3, xcgui.Align_right) 24 | 25 | xcgui.XWnd_RegEventC(mw, xcgui.WM_RBUTTONUP, xcgui.CallBack(OnWndButtonUp)) 26 | 27 | xcgui.XWnd_AdjustLayout(mw) 28 | xcgui.XWnd_ShowWindow(mw, xcgui.SW_SHOW) 29 | xcgui.XRunXCGUI() 30 | xcgui.XExitXCGUI() 31 | } 32 | 33 | func OnWndButtonUp(nFlags uint32, pPt *xcgui.POINT, pbHandled *bool) int { 34 | pt := *pPt 35 | 36 | hMenu := xcgui.XMenu_Create() 37 | xcgui.XMenu_AddItem(hMenu, 201, "窗格1", 0, 0) 38 | xcgui.XMenu_AddItem(hMenu, 202, "窗格2", 0, 0) 39 | xcgui.XMenu_AddItem(hMenu, 203, "窗格3", 0, 0) 40 | 41 | xcgui.ClientToScreen(xcgui.XWnd_GetHWND(mw), &pt) 42 | xcgui.XMenu_Popup(hMenu, xcgui.XWnd_GetHWND(mw), pt.X, pt.Y, 0, 0) 43 | 44 | return 0 45 | } 46 | -------------------------------------------------------------------------------- /examples/hello/build.bat: -------------------------------------------------------------------------------- 1 | @if exist "rsrc.syso" ( 2 | @del "rsrc.syso" 3 | ) 4 | 5 | set GOARCH=386 6 | set GOGCCFLAGS=-m32 -mthreads -fmessage-length=0 7 | 8 | go build -ldflags="-H windowsgui" 9 | pause 10 | exit 11 | 12 | -ldflags "-s -w" 13 | 14 | rsrc -manifest main.manifest -o rsrc.syso 15 | set GOARCH=386 16 | set GOBIN=D:\go\bin 17 | set GOEXE=.exe 18 | set GOHOSTARCH=386 19 | set GOHOSTOS=windows 20 | set GOOS=windows 21 | set GOPATH=D:\go\gopath 22 | set GORACE= 23 | set GOROOT=D:\go 24 | set GOTOOLDIR=D:\go\pkg\tool\windows_386 25 | set GO15VENDOREXPERIMENT= 26 | set CC=gcc 27 | set GOGCCFLAGS=-m32 -mthreads -fmessage-length=0 28 | set CXX=g++ 29 | set CGO_ENABLED=1 -------------------------------------------------------------------------------- /examples/hello/hello.go: -------------------------------------------------------------------------------- 1 | /** 2 | 直接使用api 3 | */ 4 | package main 5 | 6 | import ( 7 | "fmt" 8 | xcgui "github.com/CodyGuo/xcgui/xc" 9 | "syscall" 10 | ) 11 | 12 | func main() { 13 | xcgui.XInitXCGUI() 14 | hwnd := xcgui.XWnd_Create(400, 200, 300, 200, "标题", xcgui.NULL, xcgui.XC_WINDOW_STYLE_DEFAULT) 15 | 16 | parent := xcgui.HXCGUI(hwnd) 17 | //button 18 | btn := xcgui.XBtn_Create(10, 5, 80, 22, "关闭", parent) 19 | xcgui.XBtn_SetType(btn, xcgui.BUTTON_TYPE_CLOSE) 20 | //监听btn事件 21 | xcgui.XEle_RegEventC(btn, xcgui.XE_BNCLICK, syscall.NewCallback(OnBtnClick)) 22 | //label 23 | lb := xcgui.XShapeText_Create(50, 100, 100, 22, "hello world!", parent) 24 | xcgui.XShapeText_SetText(lb, "hello 世界!") 25 | xcgui.XShapeText_SetTextColor(lb, 0xff0000, 255) 26 | 27 | //取text及长度 28 | str := xcgui.XShapeText_GetTextGo(lb) 29 | fmt.Println(str) 30 | fmt.Println(xcgui.XShapeText_GetTextLength(lb)) 31 | 32 | xcgui.XWnd_ShowWindow(hwnd, xcgui.SW_SHOW) 33 | xcgui.XRunXCGUI() 34 | xcgui.XExitXCGUI() 35 | } 36 | 37 | func OnBtnClick() int { 38 | fmt.Println("你点了按钮") 39 | return 0 40 | } 41 | -------------------------------------------------------------------------------- /examples/imageviewer/imageviewer.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | ) 6 | 7 | import ( 8 | xcgui "github.com/codyguo/xcgui/xc" 9 | "github.com/lxn/walk" 10 | "github.com/lxn/win" 11 | ) 12 | 13 | func main() { 14 | mw := new(MyMainWindow) 15 | 16 | mw.hWindow = xcgui.XWnd_Create(0, 0, 800, 600, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 17 | xcgui.CloseBtn(mw.hWindow) 18 | 19 | hButton := xcgui.XBtn_Create(50, 100, 100, 30, "浏览图片", xcgui.HXCGUI(mw.hWindow)) 20 | hButtonAbout := xcgui.XBtn_Create(200, 100, 100, 30, "关于", xcgui.HXCGUI(mw.hWindow)) 21 | 22 | xcgui.XEle_RegEventC1(hButton, xcgui.XE_BNCLICK, xcgui.CallBack(mw.openAction_Triggered)) 23 | xcgui.XEle_RegEventC1(hButtonAbout, xcgui.XE_BNCLICK, xcgui.CallBack(mw.aboutAction_Triggered)) 24 | 25 | xcgui.XWnd_ShowWindow(mw.hWindow, xcgui.SW_SHOW) 26 | xcgui.XRunXCGUI() 27 | xcgui.XExitXCGUI() 28 | 29 | } 30 | 31 | type MyMainWindow struct { 32 | hWindow xcgui.HWINDOW 33 | *walk.MainWindow 34 | prevFilePath string 35 | } 36 | 37 | func (mw *MyMainWindow) openAction_Triggered() int { 38 | if err := mw.openImage(); err != nil { 39 | log.Print(err) 40 | } 41 | 42 | return 0 43 | } 44 | 45 | func (mw *MyMainWindow) openImage() error { 46 | dlg := new(walk.FileDialog) 47 | 48 | dlg.FilePath = mw.prevFilePath 49 | dlg.Filter = "Image Files (*.emf;*.bmp;*.exif;*.gif;*.jpeg;*.jpg;*.png;*.tiff)|*.emf;*.bmp;*.exif;*.gif;*.jpeg;*.jpg;*.png;*.tiff" 50 | dlg.Title = "选择图片" 51 | 52 | if ok, err := dlg.ShowOpen(mw); err != nil { 53 | return err 54 | } else if !ok { 55 | return nil 56 | } 57 | 58 | mw.prevFilePath = dlg.FilePath 59 | 60 | return nil 61 | } 62 | 63 | func (mw *MyMainWindow) aboutAction_Triggered() int { 64 | walk.MsgBox(mw, "关于", "walk 的msgbox 与 xcgui的混写."+mw.prevFilePath, walk.MsgBoxIconInformation) 65 | 66 | return 0 67 | } 68 | 69 | // 重载,返回炫彩窗口句柄 70 | func (mw *MyMainWindow) Handle() win.HWND { 71 | return win.HWND(xcgui.XWnd_GetHWND(mw.hWindow)) 72 | } 73 | -------------------------------------------------------------------------------- /examples/imageviewer/imageviewer.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | true 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/imageviewer/rsrc.syso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/imageviewer/rsrc.syso -------------------------------------------------------------------------------- /examples/img/001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/001.png -------------------------------------------------------------------------------- /examples/img/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/1.png -------------------------------------------------------------------------------- /examples/img/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/2.png -------------------------------------------------------------------------------- /examples/img/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/3.png -------------------------------------------------------------------------------- /examples/img/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/4.png -------------------------------------------------------------------------------- /examples/img/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/5.png -------------------------------------------------------------------------------- /examples/img/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/6.png -------------------------------------------------------------------------------- /examples/img/README: -------------------------------------------------------------------------------- 1 | Most image files in this directory are from the base icon theme of the 2 | Tango Desktop Project at http://tango.freedesktop.org. 3 | 4 | Thanks for releasing those to the Public Domain. 5 | -------------------------------------------------------------------------------- /examples/img/arrow_divide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/arrow_divide.png -------------------------------------------------------------------------------- /examples/img/bro.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/bro.ico -------------------------------------------------------------------------------- /examples/img/buy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/buy.png -------------------------------------------------------------------------------- /examples/img/comma_face_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_01.png -------------------------------------------------------------------------------- /examples/img/comma_face_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_02.png -------------------------------------------------------------------------------- /examples/img/comma_face_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_03.png -------------------------------------------------------------------------------- /examples/img/comma_face_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_04.png -------------------------------------------------------------------------------- /examples/img/comma_face_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_05.png -------------------------------------------------------------------------------- /examples/img/comma_face_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_06.png -------------------------------------------------------------------------------- /examples/img/comma_face_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_07.png -------------------------------------------------------------------------------- /examples/img/comma_face_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_08.png -------------------------------------------------------------------------------- /examples/img/comma_face_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_09.png -------------------------------------------------------------------------------- /examples/img/comma_face_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_10.png -------------------------------------------------------------------------------- /examples/img/comma_face_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_11.png -------------------------------------------------------------------------------- /examples/img/comma_face_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_12.png -------------------------------------------------------------------------------- /examples/img/comma_face_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_13.png -------------------------------------------------------------------------------- /examples/img/comma_face_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_14.png -------------------------------------------------------------------------------- /examples/img/comma_face_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_15.png -------------------------------------------------------------------------------- /examples/img/comma_face_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_16.png -------------------------------------------------------------------------------- /examples/img/comma_face_17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_17.png -------------------------------------------------------------------------------- /examples/img/comma_face_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/comma_face_18.png -------------------------------------------------------------------------------- /examples/img/document-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/document-new.png -------------------------------------------------------------------------------- /examples/img/document-properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/document-properties.png -------------------------------------------------------------------------------- /examples/img/folder_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/folder_add.png -------------------------------------------------------------------------------- /examples/img/girl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/girl.jpg -------------------------------------------------------------------------------- /examples/img/main.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/main.ico -------------------------------------------------------------------------------- /examples/img/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/main.png -------------------------------------------------------------------------------- /examples/img/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/open.png -------------------------------------------------------------------------------- /examples/img/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/plus.png -------------------------------------------------------------------------------- /examples/img/pumpkin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/pumpkin.png -------------------------------------------------------------------------------- /examples/img/system-shutdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/system-shutdown.png -------------------------------------------------------------------------------- /examples/img/upload.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/upload.ico -------------------------------------------------------------------------------- /examples/img/x.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/img/x.ico -------------------------------------------------------------------------------- /examples/list/list.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | import ( 8 | xcgui "github.com/codyguo/xcgui/xc" 9 | ) 10 | 11 | func main() { 12 | hWindow := xcgui.XWnd_Create(0, 0, 550, 380, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 13 | xcgui.CloseBtn(hWindow) 14 | 15 | hList := xcgui.XList_Create(20, 40, 500, 300, xcgui.HXCGUI(hWindow)) 16 | xcgui.XList_SetItemTemplateXML(hList, "../xml-template/List_Item.xml") 17 | xcgui.XSView_SetLineSize(hList, 20, 20) 18 | 19 | for i := 0; i < 3; i++ { 20 | xcgui.XList_AddColumn(hList, 100) 21 | } 22 | 23 | hAdapterHeader := xcgui.XAdapterMap_Create() 24 | xcgui.XList_BindAdapterHeader(hList, hAdapterHeader) 25 | 26 | xcgui.XAdapterMap_AddItemText(hAdapterHeader, "name", "aaa") 27 | xcgui.XAdapterMap_AddItemText(hAdapterHeader, "name2", "bbb") 28 | xcgui.XAdapterMap_AddItemText(hAdapterHeader, "name3", "ccc") 29 | xcgui.XAdapterMap_AddItemText(hAdapterHeader, "name4", "test") 30 | 31 | hAdapter := xcgui.XAdapterTable_Create() 32 | xcgui.XList_BindAdapter(hList, hAdapter) 33 | xcgui.XAdapterTable_AddColumn(hAdapter, "name") 34 | xcgui.XAdapterTable_AddColumn(hAdapter, "name2") 35 | xcgui.XAdapterTable_AddColumn(hAdapter, "name3") 36 | 37 | xcgui.XList_SetColumnWidth(hList, 0, 150) 38 | xcgui.XList_SetColumnWidth(hList, 1, 150) 39 | xcgui.XList_SetColumnWidth(hList, 2, 150) 40 | 41 | for i := 0; i < 20; i++ { 42 | xcgui.XAdapterTable_AddItemText(hAdapter, "item-"+fmt.Sprint(i)) 43 | 44 | xcgui.XAdapterTable_SetItemText(hAdapter, i, 1, "child-"+fmt.Sprint(i)+"-1") 45 | xcgui.XAdapterTable_SetItemText(hAdapter, i, 2, "child-"+fmt.Sprint(i)+"-2") 46 | } 47 | 48 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 49 | xcgui.XRunXCGUI() 50 | xcgui.XExitXCGUI() 51 | } 52 | -------------------------------------------------------------------------------- /examples/listView/listView.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | import ( 8 | xcgui "github.com/codyguo/xcgui/xc" 9 | ) 10 | 11 | type template_info_i struct { 12 | info int 13 | } 14 | 15 | type listView_item_i struct { 16 | iGroup int // 项所述组索引 -1没有组 17 | iItem int // 项在数组中位置索引,如果此致为-1,那么为组 18 | nUserData int // 用户绑定数据 19 | nState xcgui.List_item_state_ // 状态 20 | rcItem xcgui.RECT // 整个区域,包含边框 21 | hLayout xcgui.HXCGUI // 布局对象 22 | pInfo *template_info_i // 模板信息 23 | } 24 | 25 | func main() { 26 | hWindow := xcgui.XWnd_Create(0, 0, 500, 400, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 27 | xcgui.CloseBtn(hWindow) 28 | 29 | hListView := xcgui.XListView_Create(20, 40, 450, 300, xcgui.HXCGUI(hWindow)) 30 | xcgui.XListView_SetItemTemplateXML(hListView, "../xml-template/ListView_Item.xml") 31 | 32 | hAdapter := xcgui.XAdapterListView_Create() 33 | xcgui.XAdapterListView_GroupAddColumn(hAdapter, "name3") 34 | xcgui.XAdapterListView_ItemAddColumn(hAdapter, "name") 35 | xcgui.XAdapterListView_ItemAddColumn(hAdapter, "name2") 36 | 37 | xcgui.XListView_BindAdapter(hListView, hAdapter) 38 | 39 | group1 := xcgui.XAdapterListView_GroupAddItemText(hAdapter, "group1") 40 | group2 := xcgui.XAdapterListView_GroupAddItemText(hAdapter, "group2") 41 | 42 | hImage := xcgui.XImage_LoadFile("../img/comma_face_01.png", false) 43 | 44 | for i := 0; i < 20; i++ { 45 | index1 := xcgui.XAdapterListView_ItemAddItemImage(hAdapter, group1, hImage) 46 | xcgui.XAdapterListView_ItemSetText(hAdapter, group1, index1, 1, "group1-item-"+fmt.Sprint(i)) 47 | 48 | index2 := xcgui.XAdapterListView_ItemAddItemImage(hAdapter, group2, hImage) 49 | xcgui.XAdapterListView_ItemSetText(hAdapter, group2, index2, 1, "group2-item-"+fmt.Sprint(i)) 50 | } 51 | 52 | xcgui.XEle_RegEventC(hListView, xcgui.XE_LISTVIEW_SELECT, xcgui.CallBack(OnListViewSelect)) 53 | xcgui.XEle_RegEventC(hListView, xcgui.XE_LISTVIEW_EXPAND, xcgui.CallBack(OnListViewExpand)) 54 | 55 | xcgui.XEle_RegEventC(hListView, xcgui.XE_LISTVIEW_TEMP_CREATE, xcgui.CallBack(OnTemplateCreate)) 56 | xcgui.XEle_RegEventC(hListView, xcgui.XE_LISTVIEW_TEMP_DESTROY, xcgui.CallBack(OnTemplateDestroy)) 57 | xcgui.XEle_RegEventC(hListView, xcgui.XE_LISTVIEW_TEMP_ADJUST_COORDINATE, xcgui.CallBack(OnTemplateAdjustCoordinate)) 58 | 59 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 60 | xcgui.XRunXCGUI() 61 | xcgui.XExitXCGUI() 62 | } 63 | 64 | func OnListViewSelect(iGroup int, iItem int, pbHandled *bool) int { 65 | *pbHandled = true 66 | 67 | return 0 68 | } 69 | 70 | func OnListViewExpand(iGroup int, bExpand bool, pbHandled *bool) int { 71 | *pbHandled = true 72 | 73 | return 0 74 | } 75 | 76 | func OnTemplateCreate(pItem *listView_item_i, pbHandled *bool) int { 77 | *pbHandled = true 78 | 79 | return 0 80 | } 81 | 82 | func OnTemplateDestroy(pItem *listView_item_i, pbHandled *bool) int { 83 | *pbHandled = true 84 | 85 | return 0 86 | } 87 | 88 | func OnTemplateAdjustCoordinate(pItem *listView_item_i, pbHandled *bool) int { 89 | *pbHandled = true 90 | 91 | return 0 92 | } 93 | -------------------------------------------------------------------------------- /examples/menu/menu.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | ) 6 | import ( 7 | xcgui "github.com/codyguo/xcgui/xc" 8 | ) 9 | 10 | var ( 11 | hWindow xcgui.HWINDOW 12 | ) 13 | 14 | type menu_popupWnd_i struct { 15 | hWindow xcgui.HWINDOW 16 | nParentID int 17 | } 18 | 19 | type menu_drawBackground_i struct { 20 | hMenu xcgui.HMENUX 21 | hWindow xcgui.HWINDOW 22 | nParentID int 23 | } 24 | 25 | type menu_drawItem_i struct { 26 | hMenu xcgui.HMENUX 27 | hWindow xcgui.HWINDOW 28 | nID int 29 | nState int 30 | rcItem xcgui.RECT 31 | hIcon xcgui.HIMAGE 32 | pText string 33 | } 34 | 35 | func main() { 36 | hWindow = xcgui.XWnd_Create(0, 0, 300, 200, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 37 | xcgui.CloseBtn(hWindow) 38 | 39 | hButton := xcgui.XBtn_Create(20, 50, 80, 20, "弹出菜单", xcgui.HXCGUI(hWindow)) 40 | xcgui.XEle_RegEventC1(hButton, xcgui.XE_BNCLICK, xcgui.CallBack(OnbtnClick)) 41 | 42 | xcgui.XWnd_RegEventC(hWindow, xcgui.XWM_MENU_POPUP, xcgui.CallBack(OnWndMenuPopup)) 43 | xcgui.XWnd_RegEventC(hWindow, xcgui.XWM_MENU_POPUP_WND, xcgui.CallBack(OnWndMenuPopupWnd)) 44 | xcgui.XWnd_RegEventC(hWindow, xcgui.XWM_MENU_SELECT, xcgui.CallBack(OnWndMenuSelect)) 45 | xcgui.XWnd_RegEventC(hWindow, xcgui.XWM_MENU_EXIT, xcgui.CallBack(OnWndMenuExit)) 46 | 47 | xcgui.XWnd_RegEventC(hWindow, xcgui.XWM_MENU_DRAW_BACKGROUND, xcgui.CallBack(OnWndMenuDrawBackground)) 48 | 49 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 50 | xcgui.XRunXCGUI() 51 | xcgui.XExitXCGUI() 52 | 53 | } 54 | 55 | func OnbtnClick(hEventEle xcgui.HELE, pbHandled *bool) int { 56 | hMenu := xcgui.XMenu_Create() 57 | xcgui.XMenu_SetBkImage(hMenu, xcgui.XImage_LoadFile("../img/comma_face_12.png", true)) 58 | 59 | xcgui.XMenu_AddItemIcon(hMenu, 201, "111", xcgui.XC_ID_ROOT, xcgui.XImage_LoadFile("../img/plus.png", false), xcgui.MENU_ITEM_FLAGS_CHECK) 60 | xcgui.XMenu_AddItem(hMenu, 202, "222", 0, 0) 61 | xcgui.XMenu_AddItem(hMenu, 203, "333", 0, 0) 62 | 63 | xcgui.XMenu_AddItem(hMenu, 204, "444", 203, 0) 64 | xcgui.XMenu_AddItem(hMenu, 205, "555", 203, 0) 65 | 66 | rcButton := new(xcgui.RECT) 67 | xcgui.XEle_GetRect(hEventEle, rcButton) 68 | pt := xcgui.POINT{int(rcButton.Left), int(rcButton.Bottom)} 69 | xcgui.ClientToScreen(xcgui.XWnd_GetHWND(hWindow), &pt) 70 | xcgui.XMenu_Popup(hMenu, xcgui.XWnd_GetHWND(hWindow), pt.X, pt.Y, 0, 0) 71 | 72 | return 0 73 | } 74 | 75 | func OnWndMenuPopup(hMenu xcgui.HMENUX, pbHandled *bool) int { 76 | log.Println("menu-XWM_MENU_POPU.") 77 | 78 | return 0 79 | } 80 | 81 | func OnWndMenuPopupWnd(hMenu xcgui.HMENUX, pInfo *menu_popupWnd_i, pbHandled *bool) int { 82 | log.Printf("menu-XWM_MENU_PUPUP_WND nParent=%d \n", pInfo.nParentID) 83 | 84 | return 0 85 | } 86 | 87 | func OnWndMenuSelect(nID int, pBool *bool) int { 88 | log.Println("menu-XWM_MENU_SELECT item: ", nID) 89 | 90 | return 0 91 | } 92 | 93 | func OnWndMenuExit(pbHandled *bool) int { 94 | log.Println("menu-XWM_MENU_EXIT exit.") 95 | 96 | return 0 97 | } 98 | 99 | func OnWndMenuDrawBackground(hDraw xcgui.HDRAW, pInfo *menu_drawBackground_i, pbHandled *bool) int { 100 | *pbHandled = true 101 | 102 | return 0 103 | } 104 | -------------------------------------------------------------------------------- /examples/menuBar/menuBar.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | ) 6 | 7 | import ( 8 | xcgui "github.com/codyguo/xcgui/xc" 9 | ) 10 | 11 | func main() { 12 | hWindow := xcgui.XWnd_Create(0, 0, 300, 200, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 13 | xcgui.CloseBtn(hWindow) 14 | 15 | MenuBar := xcgui.XMenuBar_Create(20, 40, 260, 28, xcgui.HXCGUI(hWindow)) 16 | xcgui.XMenuBar_AddButton(MenuBar, "文件") 17 | xcgui.XMenuBar_AddButton(MenuBar, "编辑") 18 | xcgui.XMenuBar_AddButton(MenuBar, "视图") 19 | xcgui.XMenuBar_AddButton(MenuBar, "aaa") 20 | 21 | hMenu := xcgui.XMenuBar_GetMenu(MenuBar, 0) 22 | if hMenu != 0 { 23 | xcgui.XMenu_AddItem(hMenu, 101, "101", 0, 0) 24 | xcgui.XMenu_AddItem(hMenu, 102, "102", 0, 0) 25 | xcgui.XMenu_AddItem(hMenu, 103, "103", 0, 0) 26 | xcgui.XMenu_AddItem(hMenu, 1031, "3-1", 103, 0) 27 | } 28 | 29 | hMenu = xcgui.XMenuBar_GetMenu(MenuBar, 1) 30 | if hMenu != 0 { 31 | xcgui.XMenu_AddItem(hMenu, 201, "201", 0, 0) 32 | xcgui.XMenu_AddItem(hMenu, 202, "202", 0, 0) 33 | xcgui.XMenu_AddItem(hMenu, 203, "203", 0, 0) 34 | } 35 | 36 | hMenu = xcgui.XMenuBar_GetMenu(MenuBar, 2) 37 | if hMenu != 0 { 38 | xcgui.XMenu_AddItem(hMenu, 301, "301", 0, 0) 39 | } 40 | 41 | xcgui.XEle_RegEventC(MenuBar, xcgui.XE_MENU_SELECT, xcgui.CallBack(OnWndMenuSelet)) 42 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 43 | xcgui.XRunXCGUI() 44 | xcgui.XExitXCGUI() 45 | } 46 | 47 | func OnWndMenuSelet(nID int, pbHandled *bool) int { 48 | log.Printf("select item %d \n", nID) 49 | 50 | return 0 51 | } 52 | -------------------------------------------------------------------------------- /examples/modal/modal.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | ) 6 | 7 | import ( 8 | xcgui "github.com/codyguo/xcgui/xc" 9 | ) 10 | 11 | var ( 12 | hWindow xcgui.HWINDOW 13 | ) 14 | 15 | func main() { 16 | hWindow = xcgui.XWnd_Create(100, 100, 400, 300, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 17 | xcgui.XBtn_SetType(xcgui.XBtn_Create(5, 3, 60, 20, "Close", xcgui.HXCGUI(hWindow)), xcgui.BUTTON_TYPE_CLOSE) 18 | 19 | hButton := xcgui.XBtn_Create(20, 50, 120, 20, "popu-modalWindow", xcgui.HXCGUI(hWindow)) 20 | xcgui.XEle_RegEventC(hButton, xcgui.XE_BNCLICK, xcgui.CallBack(OnBtnClick)) 21 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 22 | 23 | xcgui.XRunXCGUI() 24 | xcgui.XExitXCGUI() 25 | } 26 | 27 | func OnBtnClick(pbHandled *bool) int { 28 | hWindowModal := xcgui.XModalWnd_Create(200, 200, "炫彩界面窗口", xcgui.XWnd_GetHWND(hWindow), xcgui.XC_WINDOW_STYLE_MODAL) 29 | xcgui.XBtn_SetType(xcgui.XBtn_Create(5, 3, 60, 20, "Close", xcgui.HXCGUI(hWindowModal)), xcgui.BUTTON_TYPE_CLOSE) 30 | 31 | nResult := xcgui.XModalWnd_DoModal(hWindowModal) 32 | 33 | log.Println("exit modal ", nResult) 34 | 35 | *pbHandled = true 36 | 37 | return 0 38 | } 39 | -------------------------------------------------------------------------------- /examples/notifyicon/walk_menu/notifyicon.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | ) 6 | 7 | import ( 8 | xcgui "github.com/codyguo/xcgui/xc" 9 | "github.com/lxn/walk" 10 | ) 11 | 12 | func main() { 13 | xcgui.XWnd_Create(0, 0, 0, 0, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_NOTHING) 14 | 15 | // We load our icon from a file. 16 | icon, err := walk.NewIconFromFile("../../img/x.ico") 17 | if err != nil { 18 | log.Fatal(err) 19 | } 20 | 21 | // Create the notify icon and make sure we clean it up on exit. 22 | ni, err := walk.NewNotifyIcon() 23 | if err != nil { 24 | log.Fatal(err) 25 | } 26 | defer ni.Dispose() 27 | 28 | // Set the icon and a tool tip text. 29 | if err := ni.SetIcon(icon); err != nil { 30 | log.Fatal(err) 31 | } 32 | if err := ni.SetToolTip("托盘"); err != nil { 33 | log.Fatal(err) 34 | } 35 | 36 | // When the left mouse button is pressed, bring up our balloon. 37 | ni.MouseDown().Attach(func(x, y int, button walk.MouseButton) { 38 | if button != walk.LeftButton { 39 | return 40 | } 41 | 42 | if err := ni.ShowCustom( 43 | "自定义消息", 44 | "这是一个带图标的自定义消息."); err != nil { 45 | log.Fatal(err) 46 | } 47 | }) 48 | 49 | // 菜单使用walk的,主程序为xcgui. 50 | exitAction := walk.NewAction() 51 | if err := exitAction.SetText("退出"); err != nil { 52 | log.Fatal(err) 53 | } 54 | exitAction.Triggered().Attach(func() { 55 | ni.Dispose() 56 | walk.App().Exit(0) 57 | xcgui.XExitXCGUI() 58 | }) 59 | 60 | if err := ni.ContextMenu().Actions().Add(exitAction); err != nil { 61 | log.Fatal(err) 62 | } 63 | 64 | // 托盘图标默认为隐藏状态,需设置为显示。 65 | if err := ni.SetVisible(true); err != nil { 66 | log.Fatal(err) 67 | } 68 | 69 | // Now that the icon is visible, we can bring up an info balloon. 70 | if err := ni.ShowInfo("托盘", "正在运行中."); err != nil { 71 | log.Fatal(err) 72 | } 73 | 74 | // Run the message loop. 75 | xcgui.XRunXCGUI() 76 | } 77 | -------------------------------------------------------------------------------- /examples/notifyicon/walk_menu/notifyicon.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | true 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/notifyicon/walk_menu/rsrc.syso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/notifyicon/walk_menu/rsrc.syso -------------------------------------------------------------------------------- /examples/notifyicon/xcgui_menu/main.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | true 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/notifyicon/xcgui_menu/notifyicon.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | ) 7 | 8 | import ( 9 | xcgui "github.com/codyguo/xcgui/xc" 10 | "github.com/lxn/walk" 11 | ) 12 | 13 | var ( 14 | hWindow xcgui.HWINDOW 15 | ni *walk.NotifyIcon 16 | ) 17 | 18 | func main() { 19 | hWindow = xcgui.XWnd_Create(0, 0, 0, 0, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_NOTHING) 20 | 21 | // We load our icon from a file. 22 | icon, err := walk.NewIconFromFile("../../img/x.ico") 23 | if err != nil { 24 | log.Fatal(err) 25 | } 26 | 27 | // Create the notify icon and make sure we clean it up on exit. 28 | ni, err = walk.NewNotifyIcon() 29 | if err != nil { 30 | log.Fatal(err) 31 | } 32 | defer ni.Dispose() 33 | 34 | // Set the icon and a tool tip text. 35 | if err := ni.SetIcon(icon); err != nil { 36 | log.Fatal(err) 37 | } 38 | if err := ni.SetToolTip("托盘"); err != nil { 39 | log.Fatal(err) 40 | } 41 | 42 | // When the left mouse button is pressed, bring up our balloon. 43 | ni.MouseDown().Attach(func(x, y int, button walk.MouseButton) { 44 | if button == walk.LeftButton { 45 | if err := ni.ShowCustom( 46 | "自定义消息", 47 | "这是一个带图标的自定义消息."); err != nil { 48 | log.Fatal(err) 49 | } 50 | } else { 51 | RunXCMenu() 52 | } 53 | 54 | }) 55 | 56 | // 托盘图标默认为隐藏状态,需设置为显示。 57 | if err := ni.SetVisible(true); err != nil { 58 | log.Fatal(err) 59 | } 60 | 61 | // Now that the icon is visible, we can bring up an info balloon. 62 | if err := ni.ShowInfo("托盘", "正在运行中."); err != nil { 63 | log.Fatal(err) 64 | } 65 | 66 | // 注册菜单选择事件 67 | xcgui.XWnd_RegEventC(hWindow, xcgui.XWM_MENU_SELECT, xcgui.CallBack(OnWndMenuSelect)) 68 | 69 | // Run the message loop. 70 | xcgui.XRunXCGUI() 71 | } 72 | 73 | func RunXCMenu() { 74 | var p xcgui.POINT 75 | xcgui.GetCursorPos(&p) 76 | hMenu := xcgui.XMenu_Create() 77 | xcgui.XMenu_AddItem(hMenu, 101, "炫彩菜单101", 0, xcgui.MENU_ITEM_FLAGS_POPUP) 78 | xcgui.XMenu_AddItem(hMenu, 102, "炫彩菜单102", 0, 0) 79 | xcgui.XMenu_AddItem(hMenu, 103, "炫彩菜单103", 0, 0) 80 | xcgui.XMenu_AddItem(hMenu, 104, "炫彩菜单104", 0, 0) 81 | xcgui.XMenu_AddItem(hMenu, 105, "炫彩菜单105", 0, 0) 82 | xcgui.XMenu_AddItem(hMenu, 106, "退出程序", 0, 0) 83 | 84 | xcgui.XMenu_AddItem(hMenu, 1011, "炫彩菜单101-1", 101, 0) 85 | xcgui.XMenu_AddItem(hMenu, 1012, "炫彩菜单101-2", 101, 0) 86 | 87 | xcgui.SetForegroundWindow(xcgui.XWnd_GetHWND(hWindow)) 88 | xcgui.XMenu_Popup(hMenu, xcgui.XWnd_GetHWND(hWindow), p.X, p.Y, 0, 0) 89 | } 90 | 91 | func OnWndMenuSelect(nID int, pBool bool) int { 92 | switch nID { 93 | case 1011: 94 | ni.ShowInfo("提示信息", "炫彩菜单101-1") 95 | xcgui.MessageBox(xcgui.XWnd_GetHWND(hWindow), "提示信息", "炫彩菜单101-1", xcgui.MB_ICONINFORMATION) 96 | case 1012: 97 | ni.ShowWarning("警告信息", "炫彩菜单101-2") 98 | xcgui.MessageBox(xcgui.XWnd_GetHWND(hWindow), "警告信息", "炫彩菜单101-2", xcgui.MB_ICONWARNING) 99 | case 102: 100 | ni.ShowError("错误信息", "炫彩菜单102") 101 | xcgui.MessageBox(xcgui.XWnd_GetHWND(hWindow), "错误信息", "炫彩菜单102", xcgui.MB_ICONERROR) 102 | case 106: 103 | ni.ShowMessage("退出程序", "正在退出程序...") 104 | ni.Dispose() 105 | walk.App().Exit(0) 106 | xcgui.XExitXCGUI() 107 | default: 108 | ni.ShowMessage("其他信息", "您选择的菜单:"+fmt.Sprint(nID)) 109 | xcgui.MessageBox(xcgui.XWnd_GetHWND(hWindow), "其他信息", "您选择了其他菜单.", xcgui.MB_USERICON) 110 | } 111 | 112 | return 0 113 | } 114 | -------------------------------------------------------------------------------- /examples/notifyicon/xcgui_menu/rsrc.syso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/notifyicon/xcgui_menu/rsrc.syso -------------------------------------------------------------------------------- /examples/progressBar/progressBar.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | import ( 8 | xcgui "github.com/codyguo/xcgui/xc" 9 | ) 10 | 11 | var ( 12 | hButtonAdd xcgui.HELE 13 | hProgressBar xcgui.HELE 14 | ) 15 | 16 | func main() { 17 | hWindow := xcgui.XWnd_Create(0, 0, 300, 200, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 18 | xcgui.CloseBtn(hWindow) 19 | 20 | hProgressBar = xcgui.XProgBar_Create(20, 40, 260, 20, xcgui.HXCGUI(hWindow)) 21 | xcgui.XProgBar_SetRange(hProgressBar, 100) 22 | xcgui.XProgBar_SetPos(hProgressBar, 50) 23 | xcgui.XProgBar_SetSpaceTwo(hProgressBar, 10, 10) 24 | 25 | hButtonAdd = xcgui.XBtn_Create(20, 70, 50, 18, "+", xcgui.HXCGUI(hWindow)) 26 | hButtonMunus := xcgui.XBtn_Create(80, 70, 50, 18, "-", xcgui.HXCGUI(hWindow)) 27 | 28 | xcgui.XEle_RegEventC1(hButtonAdd, xcgui.XE_BNCLICK, xcgui.CallBack(OnBtnClick)) 29 | xcgui.XEle_RegEventC1(hButtonMunus, xcgui.XE_BNCLICK, xcgui.CallBack(OnBtnClick)) 30 | xcgui.XEle_RegEventC(hProgressBar, xcgui.XE_PROGRESSBAR_CHANGE, xcgui.CallBack(OnProgressBarChange)) 31 | 32 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 33 | xcgui.XRunXCGUI() 34 | xcgui.XExitXCGUI() 35 | 36 | } 37 | 38 | func OnBtnClick(hEventEle xcgui.HELE, pbHandled *bool) int { 39 | if hButtonAdd == hEventEle { 40 | xcgui.XProgBar_SetPos(hProgressBar, xcgui.XProgBar_GetPos(hProgressBar)+1) 41 | } else { 42 | xcgui.XProgBar_SetPos(hProgressBar, xcgui.XProgBar_GetPos(hProgressBar)-1) 43 | } 44 | xcgui.XEle_RedrawEle(hProgressBar) 45 | 46 | return 0 47 | } 48 | 49 | func OnProgressBarChange(pos int, pbHandled *bool) int { 50 | fmt.Println("ProgressBar 进度改变中: ", pos) 51 | 52 | return 0 53 | } 54 | -------------------------------------------------------------------------------- /examples/radio/radio.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | xcgui "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | func main() { 8 | hWindow := xcgui.XWnd_Create(0, 0, 300, 200, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 9 | xcgui.XBtn_SetType(xcgui.XBtn_Create(5, 3, 60, 20, "Close", xcgui.HXCGUI(hWindow)), xcgui.BUTTON_TYPE_CLOSE) 10 | 11 | hCheck1 := xcgui.XBtn_Create(20, 40, 100, 20, "Radio1", xcgui.HXCGUI(hWindow)) 12 | hCheck2 := xcgui.XBtn_Create(20, 70, 100, 20, "Radio2", xcgui.HXCGUI(hWindow)) 13 | hCheck3 := xcgui.XBtn_Create(20, 100, 100, 20, "Radio3", xcgui.HXCGUI(hWindow)) 14 | 15 | xcgui.XBtn_SetGroupID(hCheck1, 1) 16 | xcgui.XBtn_SetGroupID(hCheck2, 1) 17 | xcgui.XBtn_SetGroupID(hCheck3, 1) 18 | 19 | xcgui.XBtn_SetType(hCheck1, xcgui.BUTTON_TYPE_RADIO) 20 | xcgui.XBtn_SetType(hCheck2, xcgui.BUTTON_TYPE_RADIO) 21 | xcgui.XBtn_SetType(hCheck3, xcgui.BUTTON_TYPE_RADIO) 22 | 23 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 24 | xcgui.XRunXCGUI() 25 | xcgui.XExitXCGUI() 26 | } 27 | -------------------------------------------------------------------------------- /examples/richedit/richedit.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/codyguo/xcgui" 5 | 6 | "github.com/codyguo/xcgui/xc" 7 | ) 8 | 9 | func main() { 10 | mw, _ := xcgui.NewMainWindow(xcgui.Size{300, 200}, "富文本") 11 | 12 | hEle := xc.XRichEdit_Create(20, 40, 150, 120, xc.HXCGUI(mw.GetHWindow())) 13 | xc.XRichEdit_EnableAutoWrap(hEle, true) 14 | 15 | mw.Show() 16 | mw.Run() 17 | } 18 | -------------------------------------------------------------------------------- /examples/scrollBar/scrollBar.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | ) 6 | 7 | import ( 8 | xcgui "github.com/codyguo/xcgui/xc" 9 | ) 10 | 11 | func main() { 12 | hWindow := xcgui.XWnd_Create(0, 0, 300, 300, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 13 | xcgui.CloseBtn(hWindow) 14 | 15 | hSBar1 := xcgui.XSBar_Create(20, 50, 200, 20, xcgui.HXCGUI(hWindow)) 16 | xcgui.XEle_RegEventC(hSBar1, xcgui.XE_SBAR_SCROLL, xcgui.CallBack(OnSBarScroll)) 17 | 18 | hSBar2 := xcgui.XSBar_Create(230, 50, 20, 200, xcgui.HXCGUI(hWindow)) 19 | xcgui.XSBar_SetHorizon(hSBar2, false) 20 | 21 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 22 | xcgui.XRunXCGUI() 23 | xcgui.XExitXCGUI() 24 | } 25 | 26 | func OnSBarScroll(pos int, pbHandled *bool) int { 27 | log.Printf("pos=%d \n", pos) 28 | *pbHandled = true 29 | return 0 30 | } 31 | -------------------------------------------------------------------------------- /examples/scrollView/scrollView.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | ) 6 | 7 | import ( 8 | xcgui "github.com/codyguo/xcgui/xc" 9 | ) 10 | 11 | func main() { 12 | hWindow := xcgui.XWnd_Create(0, 0, 300, 300, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 13 | xcgui.CloseBtn(hWindow) 14 | 15 | hScrollView := xcgui.XSView_Create(20, 50, 200, 200, xcgui.HXCGUI(hWindow)) 16 | xcgui.XSView_SetTotalSize(hScrollView, 300, 300) 17 | 18 | xcgui.XBtn_Create(10, 10, 100, 20, "Button1", xcgui.HXCGUI(hScrollView)) 19 | xcgui.XBtn_Create(10, 40, 100, 20, "Button2", xcgui.HXCGUI(hScrollView)) 20 | xcgui.XBtn_Create(10, 70, 100, 20, "Button3", xcgui.HXCGUI(hScrollView)) 21 | 22 | xcgui.XEle_RegEventC(hScrollView, xcgui.XE_SCROLLVIEW_SCROLL_H, xcgui.CallBack(OnScrollViewScrollH)) 23 | xcgui.XEle_RegEventC(hScrollView, xcgui.XE_SCROLLVIEW_SCROLL_V, xcgui.CallBack(OnScrollViewScrollV)) 24 | 25 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 26 | xcgui.XRunXCGUI() 27 | xcgui.XExitXCGUI() 28 | } 29 | 30 | func OnScrollViewScrollH(pos int, pbHandled *bool) int { 31 | log.Printf("XE_SCROLLVIEW_SCROLL_H %d\n", pos) 32 | 33 | return 0 34 | } 35 | 36 | func OnScrollViewScrollV(pos int, pbHandled *bool) int { 37 | log.Printf("XE_SCROLLVIEW_SCROLL_V %d\n", pos) 38 | 39 | return 0 40 | } 41 | -------------------------------------------------------------------------------- /examples/shapeLine/shapeLine.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | xcgui "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | func main() { 8 | hWindow := xcgui.XWnd_Create(0, 0, 400, 300, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 9 | xcgui.CloseBtn(hWindow) 10 | 11 | // hShapeLine 12 | xcgui.XShapeLine_Create(20, 50, 100, 100, xcgui.HXCGUI(hWindow)) 13 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 14 | xcgui.XRunXCGUI() 15 | xcgui.XExitXCGUI() 16 | } 17 | -------------------------------------------------------------------------------- /examples/shapePicture/shapePicture.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | xcgui "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | func main() { 8 | hWindow := xcgui.XWnd_Create(0, 0, 400, 400, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 9 | xcgui.CloseBtn(hWindow) 10 | 11 | hPicture := xcgui.XShapePic_Create(20, 50, 100, 100, xcgui.HXCGUI(hWindow)) 12 | xcgui.XShapePic_SetImage(hPicture, xcgui.XImage_LoadFile("../img/comma_face_02.png", false)) 13 | 14 | xcgui.XWnd_AdjustLayout(hWindow) 15 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 16 | xcgui.XRunXCGUI() 17 | xcgui.XExitXCGUI() 18 | } 19 | -------------------------------------------------------------------------------- /examples/shapeRect/shapeRect.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | xcgui "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | func main() { 8 | hWindow := xcgui.XWnd_Create(0, 0, 400, 300, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 9 | xcgui.CloseBtn(hWindow) 10 | 11 | // hShapeRect 12 | xcgui.XShapeRect_Create(20, 50, 100, 100, xcgui.HXCGUI(hWindow)) 13 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 14 | xcgui.XRunXCGUI() 15 | xcgui.XExitXCGUI() 16 | } 17 | -------------------------------------------------------------------------------- /examples/shapeText/shapeText.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | xcgui "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | func main() { 8 | hWindow := xcgui.XWnd_Create(0, 0, 400, 300, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 9 | xcgui.CloseBtn(hWindow) 10 | 11 | hEle := xcgui.XEle_Create(60, 60, 200, 200, xcgui.HXCGUI(hWindow)) 12 | hTextBlock := xcgui.XShapeText_Create(0, 0, 100, 20, "123456", xcgui.HXCGUI(hEle)) 13 | 14 | xcgui.XShapeText_SetLayoutWidth(hTextBlock, xcgui.LAYOUT_SIZE_TYPE_AUTO, 0) 15 | xcgui.XShapeText_SetLayoutHeight(hTextBlock, xcgui.LAYOUT_SIZE_TYPE_AUTO, 0) 16 | 17 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 18 | xcgui.XRunXCGUI() 19 | xcgui.XExitXCGUI() 20 | } 21 | -------------------------------------------------------------------------------- /examples/sliderBar/sliderBar.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | xcgui "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | func main() { 8 | hWindow := xcgui.XWnd_Create(0, 0, 300, 200, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 9 | xcgui.CloseBtn(hWindow) 10 | 11 | hSliderBar := xcgui.XSliderBar_Create(20, 40, 260, 60, xcgui.HXCGUI(hWindow)) 12 | xcgui.XSliderBar_SetRange(hSliderBar, 10) 13 | xcgui.XSliderBar_SetButtonHeight(hSliderBar, 27) 14 | xcgui.XSliderBar_SetButtonWidth(hSliderBar, 27) 15 | xcgui.XSliderBar_SetSpaceTwo(hSliderBar, 10, 10) 16 | 17 | xcgui.XEle_RegEventC(hSliderBar, xcgui.XE_SLIDERBAR_CHANGE, xcgui.CallBack(OnSliderBarChange)) 18 | 19 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 20 | xcgui.XRunXCGUI() 21 | xcgui.XExitXCGUI() 22 | 23 | } 24 | 25 | func OnSliderBarChange(pos int, pbHandled *bool) int { 26 | *pbHandled = true 27 | 28 | return 0 29 | } 30 | -------------------------------------------------------------------------------- /examples/toolBar/toolBar.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | xcgui "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | func main() { 8 | hWindow := xcgui.XWnd_Create(0, 0, 500, 200, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 9 | xcgui.CloseBtn(hWindow) 10 | 11 | hToolBar := xcgui.XToolBar_Create(20, 40, 320, 28, xcgui.HXCGUI(hWindow)) 12 | 13 | hButton1 := xcgui.XBtn_Create(0, 0, 60, 20, "Button1", xcgui.HXCGUI(hToolBar)) 14 | hButton2 := xcgui.XBtn_Create(0, 0, 60, 20, "Button2", xcgui.HXCGUI(hToolBar)) 15 | hButton3 := xcgui.XBtn_Create(0, 0, 60, 20, "Button3", xcgui.HXCGUI(hToolBar)) 16 | hButton4 := xcgui.XBtn_Create(0, 0, 60, 20, "Button4", xcgui.HXCGUI(hToolBar)) 17 | hButton5 := xcgui.XBtn_Create(0, 0, 60, 20, "Button5", xcgui.HXCGUI(hToolBar)) 18 | xcgui.XToolBar_InsertEle(hToolBar, hButton1, -1) 19 | xcgui.XToolBar_InsertEle(hToolBar, hButton2, -1) 20 | xcgui.XToolBar_InsertEle(hToolBar, hButton3, -1) 21 | xcgui.XToolBar_InsertEle(hToolBar, hButton4, -1) 22 | xcgui.XToolBar_InsertEle(hToolBar, hButton5, -1) 23 | 24 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 25 | xcgui.XRunXCGUI() 26 | xcgui.XExitXCGUI() 27 | } 28 | -------------------------------------------------------------------------------- /examples/tree/tree.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | import ( 8 | xcgui "github.com/codyguo/xcgui/xc" 9 | ) 10 | 11 | //模板项 12 | type template_info_i struct { 13 | info int 14 | } 15 | 16 | type tree_item_i struct { 17 | nID int 18 | nDepth int 19 | nState xcgui.Tree_item_state_ 20 | nHeight int 21 | nSelHeight int 22 | nUserData int 23 | bExpand bool 24 | rcItem xcgui.RECT 25 | hLayout xcgui.HXCGUI ///<布局对象 26 | pInfo *template_info_i ///<模板信息 27 | } 28 | 29 | func main() { 30 | hWindow := xcgui.XWnd_Create(0, 0, 350, 400, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 31 | xcgui.CloseBtn(hWindow) 32 | 33 | hTree := xcgui.XTree_Create(20, 40, 300, 300, xcgui.HXCGUI(hWindow)) 34 | xcgui.XTree_SetItemTemplateXML(hTree, "../xml-template/Tree_Item.xml") 35 | 36 | hAdapter := xcgui.XAdapterTree_Create() 37 | xcgui.XTree_BindAdapter(hTree, hAdapter) 38 | xcgui.XAdapterTree_AddColumn(hAdapter, "name") 39 | 40 | for i := 0; i < 20; i++ { 41 | xcgui.XAdapterTree_InsertItemText(hAdapter, "name-"+fmt.Sprint(i)+"-0", xcgui.XC_ID_ROOT, xcgui.XC_ID_LAST) 42 | } 43 | 44 | xcgui.XAdapterTree_InsertItemText(hAdapter, "Item1-----1", 1, xcgui.XC_ID_LAST) // idc1 45 | idc2 := xcgui.XAdapterTree_InsertItemText(hAdapter, "Item1-----2", 1, xcgui.XC_ID_LAST) // idc2 46 | xcgui.XAdapterTree_InsertItemText(hAdapter, "Item1-----2--1", idc2, xcgui.XC_ID_LAST) // idc2-1 47 | 48 | xcgui.XEle_RegEventC(hTree, xcgui.XE_TREE_SELECT, xcgui.CallBack(OnTreeSelect)) 49 | xcgui.XEle_RegEventC(hTree, xcgui.XE_TREE_EXPAND, xcgui.CallBack(OnTreeExpand)) 50 | 51 | xcgui.XEle_RegEventC(hTree, xcgui.XE_TREE_TEMP_CREATE, xcgui.CallBack(OnTemplateCreate)) 52 | xcgui.XEle_RegEventC(hTree, xcgui.XE_TREE_TEMP_DESTROY, xcgui.CallBack(OnTemplateDestroy)) 53 | xcgui.XEle_RegEventC(hTree, xcgui.XE_TREE_TEMP_ADJUST_COORDINATE, xcgui.CallBack(OnTemplateAdjustCoordinate)) 54 | 55 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 56 | xcgui.XRunXCGUI() 57 | xcgui.XExitXCGUI() 58 | } 59 | 60 | func OnTreeSelect(nItemID int, pbHandled *bool) int { 61 | *pbHandled = true 62 | fmt.Println("选择的 ItemID 为: ", nItemID) 63 | 64 | return 0 65 | } 66 | 67 | func OnTreeExpand(id int, bExpand bool, pbHandled *bool) int { 68 | *pbHandled = true 69 | fmt.Printf("ID 为 %d, 是否展开: %v \n", id, bExpand) 70 | 71 | return 0 72 | } 73 | 74 | func OnTemplateCreate(pItem *tree_item_i, pbHandled *bool) int { 75 | *pbHandled = true 76 | fmt.Println("OnTemplateCreate -> tree_item_i: ", pItem.nID, pItem.nDepth, pItem.nHeight, 77 | pItem.nSelHeight, pItem.nUserData, pItem.bExpand, pItem.rcItem, 78 | pItem.nState, pItem.hLayout, pItem.pInfo.info) 79 | 80 | return 0 81 | } 82 | 83 | func OnTemplateDestroy(pItem *tree_item_i, pbHandled *bool) int { 84 | *pbHandled = true 85 | fmt.Println("OnTemplateDestroy -> tree_item_i: ", pItem.nID, pItem.nDepth, pItem.nHeight, 86 | pItem.nSelHeight, pItem.nUserData, pItem.bExpand, pItem.rcItem, 87 | pItem.nState, pItem.hLayout) 88 | 89 | return 0 90 | } 91 | 92 | func OnTemplateAdjustCoordinate(pItem *tree_item_i, pbHandled *bool) int { 93 | *pbHandled = true 94 | fmt.Println("OnTemplateAdjustCoordinate -> tree_item_i: ", pItem.nID, pItem.nDepth, pItem.nHeight, 95 | pItem.nSelHeight, pItem.nUserData, pItem.bExpand, pItem.rcItem, 96 | pItem.nState, pItem.hLayout) 97 | 98 | return 0 99 | } 100 | -------------------------------------------------------------------------------- /examples/ui/QQTest1/QQImage/QQZone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/QQImage/QQZone.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/QQImage/SuperVIP_LIGHT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/QQImage/SuperVIP_LIGHT.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/QQImage/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/QQImage/avatar.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/QQImage/avatar_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/QQImage/avatar_large.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/ArrowBottomHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/ArrowBottomHover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/ArrowBottomNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/ArrowBottomNormal.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/ArrowTopHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/ArrowTopHover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/ArrowTopNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/ArrowTopNormal.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/MainPanel_FolderNode_expandTextureHighlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/MainPanel_FolderNode_expandTextureHighlight.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/Messagebox18_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/Messagebox18_highlight.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/PopTipsTestIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/PopTipsTestIcon.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/QQZone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/QQZone.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/ShadowBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/ShadowBorder.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/StatusSucceeded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/StatusSucceeded.gif -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/SuperVIP_LIGHT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/SuperVIP_LIGHT.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/VASFlagEnable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/VASFlagEnable.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/avatar.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/btn_MedalWall_Down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/btn_MedalWall_Down.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/btn_MedalWall_Hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/btn_MedalWall_Hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/btn_Skin_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/btn_Skin_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/btn_Skin_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/btn_Skin_highlight.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/btn_home_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/btn_home_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/btn_home_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/btn_home_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/btn_medalwall_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/btn_medalwall_dark.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/btn_medalwall_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/btn_medalwall_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/btn_skin_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/btn_skin_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/expand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/expand.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/expandno.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/expandno.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/filemanager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/filemanager.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/filemanager_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/filemanager_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/filemanager_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/filemanager_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/find.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/find_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/find_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/find_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/find_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/finger_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/finger_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/icon.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/icon_contacts_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/icon_contacts_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/icon_contacts_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/icon_contacts_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/icon_contacts_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/icon_contacts_selected.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/icon_group_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/icon_group_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/icon_group_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/icon_group_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/icon_group_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/icon_group_selected.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/icon_last_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/icon_last_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/icon_last_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/icon_last_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/icon_last_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/icon_last_selected.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/main_musicbtn20_music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/main_musicbtn20_music.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/mainmenu_allservices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/mainmenu_allservices.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/mainpanel_foldernode_collapsetexture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/mainpanel_foldernode_collapsetexture.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/mainpanel_foldernode_collapsetexturehighlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/mainpanel_foldernode_collapsetexturehighlight.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/mainpanel_foldernode_expandtexture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/mainpanel_foldernode_expandtexture.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/medalwall_ani.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/medalwall_ani.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/menu_btn_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/menu_btn_highlight.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/menu_btn_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/menu_btn_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/menu_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/menu_help.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/message.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/message_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/message_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/message_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/message_highlight.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/messagebox16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/messagebox16.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/myCollection_mainpanel_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/myCollection_mainpanel_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/myCollection_mainpanel_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/myCollection_mainpanel_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/mycollection_mainpanel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/mycollection_mainpanel.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/note1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/note1.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/openchat_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/openchat_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/openchat_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/openchat_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/openchat_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/openchat_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/qqlogoclassic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/qqlogoclassic.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/school_joinclass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/school_joinclass.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/skin1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/skin1.jpg -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/success.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/sysbtn_close_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/sysbtn_close_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/sysbtn_close_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/sysbtn_close_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/sysbtn_close_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/sysbtn_close_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/sysbtn_max_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/sysbtn_max_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/sysbtn_max_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/sysbtn_max_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/sysbtn_max_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/sysbtn_max_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/sysbtn_min_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/sysbtn_min_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/sysbtn_min_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/sysbtn_min_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/sysbtn_min_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/sysbtn_min_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/sysbtn_restore_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/sysbtn_restore_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/sysbtn_restore_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/sysbtn_restore_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/sysbtn_restore_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/sysbtn_restore_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/tools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/tools.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/tools_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/tools_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/tools_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/tools_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/vip0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/vip0.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/warning.png -------------------------------------------------------------------------------- /examples/ui/QQTest1/image/wrong.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/image/wrong.bmp -------------------------------------------------------------------------------- /examples/ui/QQTest1/layout.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/layout.xml -------------------------------------------------------------------------------- /examples/ui/QQTest1/main.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | true 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/ui/QQTest1/resource.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/resource.xml -------------------------------------------------------------------------------- /examples/ui/QQTest1/rsrc.syso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest1/rsrc.syso -------------------------------------------------------------------------------- /examples/ui/QQTest1/ui.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | xcgui "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | func main() { 8 | xcgui.XC_LoadResource("resource.xml", "") 9 | 10 | hxCGUI := xcgui.XC_LoadLayout("layout.xml", 0) 11 | 12 | xcgui.XWnd_AdjustLayout(xcgui.HWINDOW(hxCGUI)) 13 | xcgui.XWnd_ShowWindow(xcgui.HWINDOW(hxCGUI), xcgui.SW_SHOW) 14 | 15 | xcgui.XRunXCGUI() 16 | xcgui.XExitXCGUI() 17 | } 18 | -------------------------------------------------------------------------------- /examples/ui/QQTest1/xml-template-test/Tree_Item_friend.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/ui/QQTest1/xml-template-test/Tree_Item_friend_sel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/ui/QQTest1/xml-template-test/Tree_Item_group.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/ui/QQTest2/QQTest.xcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/QQTest.xcproj -------------------------------------------------------------------------------- /examples/ui/QQTest2/data.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /examples/ui/QQTest2/image/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/0.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/90.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/ArrowBottomHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/ArrowBottomHover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/ArrowBottomNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/ArrowBottomNormal.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/ArrowTopHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/ArrowTopHover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/ArrowTopNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/ArrowTopNormal.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/MainPanel_FolderNode_expandTextureHighlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/MainPanel_FolderNode_expandTextureHighlight.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/Messagebox18_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/Messagebox18_highlight.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/PopTipsTestIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/PopTipsTestIcon.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/QQZone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/QQZone.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/ShadowBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/ShadowBorder.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/StatusSucceeded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/StatusSucceeded.gif -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/SuperVIP_LIGHT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/SuperVIP_LIGHT.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/VASFlagEnable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/VASFlagEnable.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/avatar.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/btn_MedalWall_Down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/btn_MedalWall_Down.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/btn_MedalWall_Hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/btn_MedalWall_Hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/btn_Skin_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/btn_Skin_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/btn_Skin_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/btn_Skin_highlight.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/btn_home_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/btn_home_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/btn_home_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/btn_home_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/btn_medalwall_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/btn_medalwall_dark.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/btn_medalwall_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/btn_medalwall_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/btn_skin_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/btn_skin_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/filemanager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/filemanager.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/filemanager_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/filemanager_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/filemanager_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/filemanager_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/find.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/find_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/find_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/find_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/find_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/finger_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/finger_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/icon.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/icon_contacts_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/icon_contacts_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/icon_contacts_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/icon_contacts_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/icon_contacts_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/icon_contacts_selected.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/icon_group_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/icon_group_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/icon_group_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/icon_group_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/icon_group_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/icon_group_selected.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/icon_last_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/icon_last_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/icon_last_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/icon_last_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/icon_last_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/icon_last_selected.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/main_musicbtn20_music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/main_musicbtn20_music.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/mainmenu_allservices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/mainmenu_allservices.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/mainpanel_foldernode_collapsetexture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/mainpanel_foldernode_collapsetexture.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/mainpanel_foldernode_collapsetexturehighlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/mainpanel_foldernode_collapsetexturehighlight.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/mainpanel_foldernode_expandtexture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/mainpanel_foldernode_expandtexture.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/medalwall_ani.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/medalwall_ani.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/menu_btn_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/menu_btn_highlight.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/menu_btn_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/menu_btn_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/menu_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/menu_help.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/message.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/message_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/message_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/message_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/message_highlight.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/messagebox16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/messagebox16.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/myCollection_mainpanel_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/myCollection_mainpanel_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/myCollection_mainpanel_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/myCollection_mainpanel_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/mycollection_mainpanel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/mycollection_mainpanel.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/note1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/note1.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/openchat_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/openchat_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/openchat_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/openchat_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/openchat_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/openchat_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/qqlogoclassic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/qqlogoclassic.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/school_joinclass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/school_joinclass.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/skin1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/skin1.jpg -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/success.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/sysbtn_close_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/sysbtn_close_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/sysbtn_close_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/sysbtn_close_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/sysbtn_close_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/sysbtn_close_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/sysbtn_max_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/sysbtn_max_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/sysbtn_max_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/sysbtn_max_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/sysbtn_max_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/sysbtn_max_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/sysbtn_min_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/sysbtn_min_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/sysbtn_min_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/sysbtn_min_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/sysbtn_min_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/sysbtn_min_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/sysbtn_restore_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/sysbtn_restore_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/sysbtn_restore_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/sysbtn_restore_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/sysbtn_restore_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/sysbtn_restore_normal.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/tools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/tools.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/tools_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/tools_down.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/tools_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/tools_hover.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/vip0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/vip0.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/warning.png -------------------------------------------------------------------------------- /examples/ui/QQTest2/image/wrong.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/image/wrong.bmp -------------------------------------------------------------------------------- /examples/ui/QQTest2/layout.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/layout.xml -------------------------------------------------------------------------------- /examples/ui/QQTest2/layoutTest.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/layoutTest.xml -------------------------------------------------------------------------------- /examples/ui/QQTest2/main.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | true 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/ui/QQTest2/qq.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | xcgui "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | func main() { 8 | xcgui.XC_LoadResource("resource.xml", "") 9 | 10 | hxCGUI := xcgui.XC_LoadLayout("layout.xml", 0) 11 | 12 | xcgui.XWnd_AdjustLayout(xcgui.HWINDOW(hxCGUI)) 13 | xcgui.XWnd_ShowWindow(xcgui.HWINDOW(hxCGUI), xcgui.SW_SHOW) 14 | 15 | xcgui.XRunXCGUI() 16 | xcgui.XExitXCGUI() 17 | } 18 | -------------------------------------------------------------------------------- /examples/ui/QQTest2/resource.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/resource.xml -------------------------------------------------------------------------------- /examples/ui/QQTest2/rsrc.syso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/rsrc.syso -------------------------------------------------------------------------------- /examples/ui/QQTest2/style.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/ui/QQTest2/style.xml -------------------------------------------------------------------------------- /examples/web/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | import ( 7 | web "github.com/codyguo/xcgui/wke" 8 | xcgui "github.com/codyguo/xcgui/xc" 9 | ) 10 | 11 | var ( 12 | hWeb uintptr 13 | ) 14 | 15 | func main() { 16 | hWindow := xcgui.XWnd_Create(0, 0, 820, 700, "测试", 0, xcgui.XC_WINDOW_STYLE_DEFAULT) 17 | xcgui.CloseBtn(hWindow) 18 | 19 | button := xcgui.XBtn_Create(300, 35, 50, 30, "执行js", xcgui.HXCGUI(hWindow)) 20 | 21 | hWeb = web.XWeb_Create(20, 100, 750, 550, xcgui.HXCGUI(hWindow)) 22 | web.XWeb_SetCookieEnabled(hWeb, true) 23 | 24 | version := web.XWeb_GetVersionString() 25 | fmt.Println(version) 26 | 27 | web.XWeb_SetUserAgentA(hWeb, "Mozilla/5.0 (Windows NT 12.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Codyguo/45.0.2454.101 Safari/537.36") 28 | 29 | version2 := web.XWeb_GetVersion() 30 | fmt.Println(version2) 31 | 32 | web.XWeb_LoadUrl(hWeb, "http://www.xcgui.com/bbs/forum.php") 33 | 34 | xcgui.XEle_RegEventC1(button, xcgui.XE_BNCLICK, xcgui.CallBack(RunJS)) 35 | xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW) 36 | xcgui.XRunXCGUI() 37 | web.XWeb_UnInit() 38 | xcgui.XExitXCGUI() 39 | } 40 | 41 | func RunJS() int { 42 | str := web.XWeb_GetCookie(hWeb) 43 | ok := web.XWeb_IsCookieEnabled(hWeb) 44 | fmt.Println(str, ok) 45 | 46 | web.XWeb_GoBack(hWeb) 47 | js := `alert(navigator.userAgent +'\n golang wke Run JS. \n` + str + `');` 48 | web.XWeb_RunJs(hWeb, "javascript: "+js) 49 | 50 | return 0 51 | } 52 | -------------------------------------------------------------------------------- /examples/wke/image/skin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/skin.jpg -------------------------------------------------------------------------------- /examples/wke/image/skin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/skin.png -------------------------------------------------------------------------------- /examples/wke/image/skin2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/skin2.jpg -------------------------------------------------------------------------------- /examples/wke/image/skin2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/skin2.png -------------------------------------------------------------------------------- /examples/wke/image/sysbtn_close_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/sysbtn_close_down.png -------------------------------------------------------------------------------- /examples/wke/image/sysbtn_close_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/sysbtn_close_hover.png -------------------------------------------------------------------------------- /examples/wke/image/sysbtn_close_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/sysbtn_close_normal.png -------------------------------------------------------------------------------- /examples/wke/image/sysbtn_max_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/sysbtn_max_down.png -------------------------------------------------------------------------------- /examples/wke/image/sysbtn_max_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/sysbtn_max_hover.png -------------------------------------------------------------------------------- /examples/wke/image/sysbtn_max_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/sysbtn_max_normal.png -------------------------------------------------------------------------------- /examples/wke/image/sysbtn_min_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/sysbtn_min_down.png -------------------------------------------------------------------------------- /examples/wke/image/sysbtn_min_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/sysbtn_min_hover.png -------------------------------------------------------------------------------- /examples/wke/image/sysbtn_min_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/sysbtn_min_normal.png -------------------------------------------------------------------------------- /examples/wke/image/sysbtn_restore_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/sysbtn_restore_down.png -------------------------------------------------------------------------------- /examples/wke/image/sysbtn_restore_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/sysbtn_restore_hover.png -------------------------------------------------------------------------------- /examples/wke/image/sysbtn_restore_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/image/sysbtn_restore_normal.png -------------------------------------------------------------------------------- /examples/wke/jsCallFunction.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | js调用vc函数演示 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/wke/xml/good.xcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/good.xcproj -------------------------------------------------------------------------------- /examples/wke/xml/image/skin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/skin.jpg -------------------------------------------------------------------------------- /examples/wke/xml/image/skin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/skin.png -------------------------------------------------------------------------------- /examples/wke/xml/image/skin2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/skin2.jpg -------------------------------------------------------------------------------- /examples/wke/xml/image/skin2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/skin2.png -------------------------------------------------------------------------------- /examples/wke/xml/image/sysbtn_close_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/sysbtn_close_down.png -------------------------------------------------------------------------------- /examples/wke/xml/image/sysbtn_close_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/sysbtn_close_hover.png -------------------------------------------------------------------------------- /examples/wke/xml/image/sysbtn_close_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/sysbtn_close_normal.png -------------------------------------------------------------------------------- /examples/wke/xml/image/sysbtn_max_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/sysbtn_max_down.png -------------------------------------------------------------------------------- /examples/wke/xml/image/sysbtn_max_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/sysbtn_max_hover.png -------------------------------------------------------------------------------- /examples/wke/xml/image/sysbtn_max_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/sysbtn_max_normal.png -------------------------------------------------------------------------------- /examples/wke/xml/image/sysbtn_min_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/sysbtn_min_down.png -------------------------------------------------------------------------------- /examples/wke/xml/image/sysbtn_min_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/sysbtn_min_hover.png -------------------------------------------------------------------------------- /examples/wke/xml/image/sysbtn_min_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/sysbtn_min_normal.png -------------------------------------------------------------------------------- /examples/wke/xml/image/sysbtn_restore_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/sysbtn_restore_down.png -------------------------------------------------------------------------------- /examples/wke/xml/image/sysbtn_restore_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/sysbtn_restore_hover.png -------------------------------------------------------------------------------- /examples/wke/xml/image/sysbtn_restore_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/image/sysbtn_restore_normal.png -------------------------------------------------------------------------------- /examples/wke/xml/layout.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/layout.xml -------------------------------------------------------------------------------- /examples/wke/xml/resource.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/resource.xml -------------------------------------------------------------------------------- /examples/wke/xml/style.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml/style.xml -------------------------------------------------------------------------------- /examples/wke/xml2/good.xcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/good.xcproj -------------------------------------------------------------------------------- /examples/wke/xml2/image/skin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/skin.jpg -------------------------------------------------------------------------------- /examples/wke/xml2/image/skin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/skin.png -------------------------------------------------------------------------------- /examples/wke/xml2/image/skin2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/skin2.jpg -------------------------------------------------------------------------------- /examples/wke/xml2/image/skin2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/skin2.png -------------------------------------------------------------------------------- /examples/wke/xml2/image/sysbtn_close_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/sysbtn_close_down.png -------------------------------------------------------------------------------- /examples/wke/xml2/image/sysbtn_close_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/sysbtn_close_hover.png -------------------------------------------------------------------------------- /examples/wke/xml2/image/sysbtn_close_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/sysbtn_close_normal.png -------------------------------------------------------------------------------- /examples/wke/xml2/image/sysbtn_max_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/sysbtn_max_down.png -------------------------------------------------------------------------------- /examples/wke/xml2/image/sysbtn_max_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/sysbtn_max_hover.png -------------------------------------------------------------------------------- /examples/wke/xml2/image/sysbtn_max_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/sysbtn_max_normal.png -------------------------------------------------------------------------------- /examples/wke/xml2/image/sysbtn_min_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/sysbtn_min_down.png -------------------------------------------------------------------------------- /examples/wke/xml2/image/sysbtn_min_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/sysbtn_min_hover.png -------------------------------------------------------------------------------- /examples/wke/xml2/image/sysbtn_min_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/sysbtn_min_normal.png -------------------------------------------------------------------------------- /examples/wke/xml2/image/sysbtn_restore_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/sysbtn_restore_down.png -------------------------------------------------------------------------------- /examples/wke/xml2/image/sysbtn_restore_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/sysbtn_restore_hover.png -------------------------------------------------------------------------------- /examples/wke/xml2/image/sysbtn_restore_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/image/sysbtn_restore_normal.png -------------------------------------------------------------------------------- /examples/wke/xml2/layout.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/layout.xml -------------------------------------------------------------------------------- /examples/wke/xml2/resource.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/resource.xml -------------------------------------------------------------------------------- /examples/wke/xml2/style.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/wke/xml2/style.xml -------------------------------------------------------------------------------- /examples/xml-template/ComboBox_ListBox_Item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/xml-template/ListBox_Item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/xml-template/ListView_Item.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/examples/xml-template/ListView_Item.xml -------------------------------------------------------------------------------- /examples/xml-template/List_Item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples/xml-template/Tree_Item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /image.go: -------------------------------------------------------------------------------- 1 | package xcgui 2 | 3 | import ( 4 | // "fmt" 5 | "path/filepath" 6 | "strings" 7 | ) 8 | import ( 9 | "github.com/codyguo/xcgui/xc" 10 | ) 11 | 12 | type Image interface { 13 | Size() Size 14 | } 15 | 16 | func NewImageFromFile(filePath string) (xc.HIMAGE, error) { 17 | if strings.HasSuffix(filePath, ".ico") { 18 | return NewIconFromFile(filePath) 19 | } 20 | 21 | return NewIconFromFile(filePath) 22 | } 23 | 24 | func NewIconFromFile(filePath string) (hIcon xc.HIMAGE, err error) { 25 | absFilePath, err := filepath.Abs(filePath) 26 | if err != nil { 27 | return 0, wrapError(err) 28 | } 29 | 30 | hIcon = xc.HIMAGE(xc.XImage_LoadFile( 31 | absFilePath, 32 | // xc.StringToUTF16Ptr(absFilePath), 33 | false)) 34 | 35 | if hIcon == 0 { 36 | return 0, lastError("LoadImage") 37 | } 38 | 39 | return hIcon, nil 40 | } 41 | -------------------------------------------------------------------------------- /lib/XCGUI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/lib/XCGUI.dll -------------------------------------------------------------------------------- /lib/XCGUI.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/lib/XCGUI.lib -------------------------------------------------------------------------------- /lib/last/wke.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/lib/last/wke.dll -------------------------------------------------------------------------------- /lib/last/wkeBrowser.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/lib/last/wkeBrowser.dll -------------------------------------------------------------------------------- /lib/last/xcgui.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/lib/last/xcgui.h -------------------------------------------------------------------------------- /lib/wke.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/lib/wke.dll -------------------------------------------------------------------------------- /lib/wkeBrowser.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/lib/wkeBrowser.dll -------------------------------------------------------------------------------- /lib/wkeBrowser.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/lib/wkeBrowser.lib -------------------------------------------------------------------------------- /lib/xcgui.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodyGuo/xcgui/efb496d231dbfa037ab5de401b3413c91696d407/lib/xcgui.h -------------------------------------------------------------------------------- /mainwindow.go: -------------------------------------------------------------------------------- 1 | package xcgui 2 | 3 | import ( 4 | "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | var ( 8 | winStyle xc.Xc_window_style_ = xc.XC_WINDOW_STYLE_DEFAULT 9 | ) 10 | 11 | type MainWindow struct { 12 | WindowBase 13 | } 14 | 15 | func NewMainWindow(szie Size, title string) (*MainWindow, error) { 16 | mw := new(MainWindow) 17 | 18 | if err := InitWindow( 19 | mw, 20 | nil, 21 | szie.Width, 22 | szie.Height, 23 | title, 24 | winStyle); err != nil { 25 | return nil, err 26 | } 27 | 28 | succeeded := false 29 | 30 | go func() { 31 | if !succeeded { 32 | newErrorNoPanic("NewMainWindow") 33 | } 34 | }() 35 | 36 | succeeded = true 37 | 38 | return mw, nil 39 | } 40 | -------------------------------------------------------------------------------- /messagebox.go: -------------------------------------------------------------------------------- 1 | package xcgui 2 | 3 | import ( 4 | "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | type MsgBoxStyle uint 8 | 9 | const ( 10 | MsgBoxOK MsgBoxStyle = xc.MB_OK 11 | MsgBoxOKCancel MsgBoxStyle = xc.MB_OKCANCEL 12 | MsgBoxAbortRetryIgnore MsgBoxStyle = xc.MB_ABORTRETRYIGNORE 13 | MsgBoxYesNoCancel MsgBoxStyle = xc.MB_YESNOCANCEL 14 | MsgBoxYesNo MsgBoxStyle = xc.MB_YESNO 15 | MsgBoxRetryCancel MsgBoxStyle = xc.MB_RETRYCANCEL 16 | MsgBoxCancelTryContinue MsgBoxStyle = xc.MB_CANCELTRYCONTINUE 17 | MsgBoxIconHand MsgBoxStyle = xc.MB_ICONHAND 18 | MsgBoxIconQuestion MsgBoxStyle = xc.MB_ICONQUESTION 19 | MsgBoxIconExclamation MsgBoxStyle = xc.MB_ICONEXCLAMATION 20 | MsgBoxIconAsterisk MsgBoxStyle = xc.MB_ICONASTERISK 21 | MsgBoxUserIcon MsgBoxStyle = xc.MB_USERICON 22 | MsgBoxIconWarning MsgBoxStyle = xc.MB_ICONWARNING 23 | MsgBoxIconError MsgBoxStyle = xc.MB_ICONERROR 24 | MsgBoxIconInformation MsgBoxStyle = xc.MB_ICONINFORMATION 25 | MsgBoxIconStop MsgBoxStyle = xc.MB_ICONSTOP 26 | MsgBoxDefButton1 MsgBoxStyle = xc.MB_DEFBUTTON1 27 | MsgBoxDefButton2 MsgBoxStyle = xc.MB_DEFBUTTON2 28 | MsgBoxDefButton3 MsgBoxStyle = xc.MB_DEFBUTTON3 29 | MsgBoxDefButton4 MsgBoxStyle = xc.MB_DEFBUTTON4 30 | ) 31 | 32 | func MsgBox(owner Window, title, message string, style MsgBoxStyle) int { 33 | var ownerHWnd xc.HWND 34 | 35 | if owner != nil { 36 | ownerHWnd = owner.Handle() 37 | } 38 | 39 | return int(xc.MessageBox( 40 | ownerHWnd, 41 | title, 42 | message, 43 | uint32(style))) 44 | } 45 | -------------------------------------------------------------------------------- /point.go: -------------------------------------------------------------------------------- 1 | package xcgui 2 | 3 | type Point struct { 4 | X, Y int 5 | } 6 | -------------------------------------------------------------------------------- /rectangle.go: -------------------------------------------------------------------------------- 1 | package xcgui 2 | 3 | import ( 4 | "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | type Rectangle struct { 8 | X, Y, Width, Height int 9 | } 10 | 11 | func rectangleFromRECT(r xc.RECT) Rectangle { 12 | return Rectangle{ 13 | X: int(r.Left), 14 | Y: int(r.Top), 15 | Width: int(r.Right - r.Left), 16 | Height: int(r.Bottom - r.Top), 17 | } 18 | } 19 | 20 | func (r Rectangle) Left() int { 21 | return r.X 22 | } 23 | 24 | func (r Rectangle) Top() int { 25 | return r.Y 26 | } 27 | 28 | func (r Rectangle) Right() int { 29 | return r.X + r.Width - 1 30 | } 31 | 32 | func (r Rectangle) Bottom() int { 33 | return r.Y + r.Height - 1 34 | } 35 | 36 | func (r Rectangle) Location() xc.POINT { 37 | return xc.POINT{r.X, r.Y} 38 | } 39 | 40 | func (r *Rectangle) SetLocation(p xc.POINT) Rectangle { 41 | r.X = p.X 42 | r.Y = p.Y 43 | 44 | return *r 45 | } 46 | 47 | func (r Rectangle) Size() Size { 48 | return Size{r.Width, r.Height} 49 | } 50 | 51 | func (r *Rectangle) SetSize(s Size) Rectangle { 52 | r.Width = s.Width 53 | r.Height = s.Height 54 | 55 | return *r 56 | } 57 | 58 | func (r Rectangle) toRECT() xc.RECT { 59 | return xc.RECT{ 60 | int32(r.X), 61 | int32(r.Y), 62 | int32(r.X + r.Width), 63 | int32(r.Y + r.Height), 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /size.go: -------------------------------------------------------------------------------- 1 | package xcgui 2 | 3 | type Size struct { 4 | Width, Height int 5 | } 6 | 7 | func minSize(a, b Size) Size { 8 | var s Size 9 | 10 | if a.Width < b.Width { 11 | s.Width = a.Width 12 | } else { 13 | s.Width = b.Width 14 | } 15 | 16 | if a.Height < b.Height { 17 | s.Height = a.Height 18 | } else { 19 | s.Height = b.Height 20 | } 21 | 22 | return s 23 | } 24 | 25 | func maxSize(a, b Size) Size { 26 | var s Size 27 | 28 | if a.Width > b.Width { 29 | s.Width = a.Width 30 | } else { 31 | s.Width = b.Width 32 | } 33 | 34 | if a.Height > b.Height { 35 | s.Height = a.Height 36 | } else { 37 | s.Height = b.Height 38 | } 39 | 40 | return s 41 | } 42 | -------------------------------------------------------------------------------- /widget.go: -------------------------------------------------------------------------------- 1 | package xcgui 2 | 3 | import ( 4 | // "github.com/codyguo/xcgui/xc" 5 | ) 6 | 7 | type Widget interface { 8 | Window 9 | } 10 | 11 | type WidgetBase struct { 12 | WindowBase 13 | } 14 | -------------------------------------------------------------------------------- /wke/api.go: -------------------------------------------------------------------------------- 1 | package wke 2 | 3 | import ( 4 | "os" 5 | "runtime" 6 | "syscall" 7 | ) 8 | 9 | const ( 10 | wkeBroDll = "wkeBrowser.dll" 11 | wkeDll = "wke.dll" 12 | ) 13 | 14 | var ( 15 | wkeWebDLL *syscall.DLL 16 | ) 17 | 18 | func init() { 19 | runtime.GOMAXPROCS(runtime.NumCPU()) 20 | 21 | if FileExist(wkeBroDll) { 22 | syscall.MustLoadDLL(wkeDll) 23 | wkeWebDLL = syscall.MustLoadDLL(wkeBroDll) 24 | } else if FileExist("lib/" + wkeBroDll) { 25 | syscall.MustLoadDLL("lib/" + wkeDll) 26 | wkeWebDLL = syscall.MustLoadDLL("lib/" + wkeBroDll) 27 | } else if FileExist("../lib/" + wkeBroDll) { 28 | syscall.MustLoadDLL("../lib/" + wkeDll) 29 | wkeWebDLL = syscall.MustLoadDLL("../lib/" + wkeBroDll) 30 | } else if FileExist("../../lib/" + wkeBroDll) { 31 | syscall.MustLoadDLL("../../lib/" + wkeDll) 32 | wkeWebDLL = syscall.MustLoadDLL("../../lib/" + wkeBroDll) 33 | } else { 34 | panic("wkeBrowser library not found,wkeBrowser.dll or ./lib/wkeBrowser.dll or ../lib/wkeBrowser.dll.") 35 | } 36 | } 37 | 38 | func FileExist(path string) bool { 39 | _, err := os.Stat(path) 40 | if err != nil { 41 | return false 42 | } else { 43 | return true 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /wke/define.go: -------------------------------------------------------------------------------- 1 | package wke 2 | 3 | type WkeProxyType uint32 4 | 5 | const ( 6 | WKE_PROXY_NONE WkeProxyType = iota 7 | WKE_PROXY_HTTP 8 | WKE_PROXY_SOCKS4 9 | WKE_PROXY_SOCKS4A 10 | WKE_PROXY_SOCKS5 11 | WKE_PROXY_SOCKS5HOSTNAME 12 | ) 13 | 14 | type WkeLoadingResult uint32 15 | 16 | const ( 17 | WKE_LOADING_SUCCEEDED WkeLoadingResult = iota 18 | WKE_LOADING_FAILED 19 | WKE_LOADING_CANCELED 20 | ) 21 | -------------------------------------------------------------------------------- /xc/adapterMap.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | var ( 9 | // Functions 10 | xAdapterMap_Create *syscall.Proc 11 | xAdapterMap_AddItemText *syscall.Proc 12 | xAdapterMap_AddItemImage *syscall.Proc 13 | xAdapterMap_DeleteItem *syscall.Proc 14 | xAdapterMap_GetCount *syscall.Proc 15 | xAdapterMap_GetItemText *syscall.Proc 16 | xAdapterMap_GetItemImage *syscall.Proc 17 | ) 18 | 19 | func init() { 20 | // Funtions 21 | xAdapterMap_Create = xcDLL.MustFindProc("XAdapterMap_Create") 22 | xAdapterMap_AddItemText = xcDLL.MustFindProc("XAdapterMap_AddItemText") 23 | xAdapterMap_AddItemImage = xcDLL.MustFindProc("XAdapterMap_AddItemImage") 24 | xAdapterMap_DeleteItem = xcDLL.MustFindProc("XAdapterMap_DeleteItem") 25 | xAdapterMap_GetCount = xcDLL.MustFindProc("XAdapterMap_GetCount") 26 | xAdapterMap_GetItemText = xcDLL.MustFindProc("XAdapterMap_GetItemText") 27 | xAdapterMap_GetItemImage = xcDLL.MustFindProc("XAdapterMap_GetItemImage") 28 | } 29 | 30 | /* 31 | 创建数据适配器,单列数据. 32 | 33 | 返回: 34 | 返回数据适配器句柄. 35 | */ 36 | func XAdapterMap_Create() HXCGUI { 37 | ret, _, _ := xAdapterMap_Create.Call() 38 | 39 | return HXCGUI(ret) 40 | } 41 | 42 | /* 43 | 增加数据项. 44 | 45 | 参数: 46 | hAdapter 数据适配器句柄. 47 | pName 项名称. 48 | pValue 值.*uint16 49 | 返回: 50 | 成功返回TRUE否则返回FALSE. 51 | */ 52 | func XAdapterMap_AddItemText(hAdapter HXCGUI, pName, pValue string) bool { 53 | ret, _, _ := xAdapterMap_AddItemText.Call( 54 | uintptr(hAdapter), 55 | StringToUintPtr(pName), 56 | StringToUintPtr(pValue)) 57 | // uintptr(unsafe.Pointer(pName)), 58 | // uintptr(unsafe.Pointer(pValue))) 59 | 60 | return ret == TRUE 61 | } 62 | 63 | /* 64 | 增加数据项. 65 | 66 | 参数: 67 | hAdapter 数据适配器句柄. 68 | pName 项名称.*uint16 69 | hImage 图片句柄. 70 | 返回: 71 | 成功返回TRUE否则返回FALSE. 72 | */ 73 | func XAdapterMap_AddItemImage(hAdapter HXCGUI, pName string, hImage HIMAGE) bool { 74 | ret, _, _ := xAdapterMap_AddItemImage.Call( 75 | uintptr(hAdapter), 76 | StringToUintPtr(pName), 77 | // uintptr(unsafe.Pointer(pName)), 78 | uintptr(hImage)) 79 | 80 | return ret == TRUE 81 | } 82 | 83 | /* 84 | 删除数据项. 85 | 86 | 参数: 87 | hAdapter 数据适配器句柄. 88 | pName 项名称.*uint16 89 | 返回: 90 | 成功返回TRUE否则返回FALSE. 91 | */ 92 | func XAdapterMap_DeleteItem(hAdapter HXCGUI, pName string) bool { 93 | ret, _, _ := xAdapterMap_DeleteItem.Call( 94 | uintptr(hAdapter), 95 | StringToUintPtr(pName)) 96 | // uintptr(unsafe.Pointer(pName))) 97 | 98 | return ret == TRUE 99 | } 100 | 101 | /* 102 | 获取项数量. 103 | 104 | 参数: 105 | hAdapter 数据适配器句柄. 106 | 返回: 107 | 返回项数量. 108 | */ 109 | func XAdapterMap_GetCount(hAdapter HXCGUI) int { 110 | ret, _, _ := xAdapterMap_GetCount.Call(uintptr(hAdapter)) 111 | 112 | return int(ret) 113 | } 114 | 115 | /* 116 | 获取项内容,如果内容为文本. 117 | 118 | 参数: 119 | hAdapter 数据适配器句柄. 120 | pName 项名称. 121 | pOut 接收返回文本缓冲区. 122 | nOutLen 缓冲区长度,字符为单位. 123 | 返回: 124 | 成功返回TRUE否则返回FALSE. 125 | */ 126 | func XAdapterMap_GetItemText(hAdapter HXCGUI, pName, pOut *uint16, nOutLen int) bool { 127 | ret, _, _ := xAdapterMap_GetItemText.Call( 128 | uintptr(hAdapter), 129 | uintptr(unsafe.Pointer(pName)), 130 | uintptr(unsafe.Pointer(pOut)), 131 | uintptr(nOutLen)) 132 | 133 | return ret == TRUE 134 | } 135 | 136 | /* 137 | 获取项内容,如果内容为图片句柄. 138 | 139 | 参数: 140 | hAdapter 数据适配器句柄. 141 | pName 项名称.*uint16 142 | 返回: 143 | 返回图片句柄. 144 | */ 145 | func XAdapterMap_GetItemImage(hAdapter HXCGUI, pName string) HIMAGE { 146 | ret, _, _ := xAdapterMap_GetItemImage.Call( 147 | uintptr(hAdapter), 148 | StringToUintPtr(pName)) 149 | // uintptr(unsafe.Pointer(pName))) 150 | 151 | return HIMAGE(ret) 152 | } 153 | -------------------------------------------------------------------------------- /xc/bkInfoManager.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | var ( 9 | // Functions 10 | xBkInfoM_Create *syscall.Proc 11 | xBkInfoM_Destroy *syscall.Proc 12 | xBkInfoM_SetBkInfo *syscall.Proc 13 | xBkInfoM_AddBorder *syscall.Proc 14 | xBkInfoM_AddFill *syscall.Proc 15 | xBkInfoM_AddImage *syscall.Proc 16 | xBkInfoM_GetCount *syscall.Proc 17 | xBkInfoM_Clear *syscall.Proc 18 | xBkInfoM_Draw *syscall.Proc 19 | xBkInfoM_DrawEx *syscall.Proc 20 | ) 21 | 22 | func init() { 23 | // Functions 24 | xBkInfoM_Create = xcDLL.MustFindProc("XBkInfoM_Create") 25 | xBkInfoM_Destroy = xcDLL.MustFindProc("XBkInfoM_Destroy") 26 | xBkInfoM_SetBkInfo = xcDLL.MustFindProc("XBkInfoM_SetBkInfo") 27 | xBkInfoM_AddBorder = xcDLL.MustFindProc("XBkInfoM_AddBorder") 28 | xBkInfoM_AddFill = xcDLL.MustFindProc("XBkInfoM_AddFill") 29 | xBkInfoM_AddImage = xcDLL.MustFindProc("XBkInfoM_AddImage") 30 | xBkInfoM_GetCount = xcDLL.MustFindProc("XBkInfoM_GetCount") 31 | xBkInfoM_Clear = xcDLL.MustFindProc("XBkInfoM_Clear") 32 | xBkInfoM_Draw = xcDLL.MustFindProc("XBkInfoM_Draw") 33 | } 34 | 35 | /* 36 | 创建背景内容管理器. 37 | 38 | 返回: 39 | 背景内容管理器句柄. 40 | */ 41 | func XBkInfoM_Create() HBKINFOM { 42 | ret, _, _ := xBkInfoM_Create.Call() 43 | 44 | return HBKINFOM(ret) 45 | } 46 | 47 | /* 48 | 销毁. 49 | 50 | 参数: 51 | hBkInfoM 背景内容管理器句柄. 52 | */ 53 | func XBkInfoM_Destroy(hBkInfoM HBKINFOM) { 54 | xBkInfoM_Destroy.Call(uintptr(hBkInfoM)) 55 | } 56 | 57 | /* 58 | 设置背景内容. 59 | 60 | 参数: 61 | hBkInfoM 背景内容管理器句柄. 62 | pText 背景内容字符串.*uint16 63 | 返回: 64 | 返回添加的背景内容数量. 65 | */ 66 | func XBkInfoM_SetBkInfo(hBkInfoM HBKINFOM, pText string) int { 67 | ret, _, _ := xBkInfoM_SetBkInfo.Call( 68 | uintptr(hBkInfoM), 69 | StringToUintPtr(pText)) 70 | // uintptr(unsafe.Pointer(pText))) 71 | 72 | return int(ret) 73 | } 74 | 75 | /* 76 | 添加背景内容边框. 77 | 78 | 参数: 79 | hBkInfoM 背景内容管理器句柄. 80 | color RGB颜色. 81 | alpha 透明度. 82 | width 线宽. 83 | */ 84 | func XBkInfoM_AddBorder(hBkInfoM HBKINFOM, color COLORREF, alpha byte, width int) { 85 | xBkInfoM_AddBorder.Call( 86 | uintptr(hBkInfoM), 87 | uintptr(color), 88 | uintptr(alpha), 89 | uintptr(width)) 90 | } 91 | 92 | /* 93 | 添加背景内容填充. 94 | 95 | 参数: 96 | hBkInfoM 背景内容管理器句柄. 97 | color RGB颜色. 98 | alpha 透明度. 99 | */ 100 | func XBkInfoM_AddFill(hBkInfoM HBKINFOM, color COLORREF, alpha byte) { 101 | xBkInfoM_AddFill.Call( 102 | uintptr(hBkInfoM), 103 | uintptr(color), 104 | uintptr(alpha)) 105 | } 106 | 107 | /* 108 | 添加背景内容图片. 109 | 110 | 参数: 111 | hBkInfoM 背景内容管理器句柄. 112 | hImage 图片句柄. 113 | */ 114 | func XBkInfoM_AddImage(hBkInfoM HBKINFOM, hImage HIMAGE) { 115 | xBkInfoM_AddImage.Call( 116 | uintptr(hBkInfoM), 117 | uintptr(hImage)) 118 | } 119 | 120 | /* 121 | 获取背景内容数量. 122 | 123 | 参数: 124 | hBkInfoM 背景内容管理器句柄. 125 | 返回: 126 | 背景内容数量. 127 | */ 128 | func XBkInfoM_GetCount(hBkInfoM HBKINFOM) int { 129 | ret, _, _ := xBkInfoM_GetCount.Call(uintptr(hBkInfoM)) 130 | 131 | return int(ret) 132 | } 133 | 134 | /* 135 | 清空背景内容. 136 | 137 | 参数: 138 | hBkInfoM 背景内容管理器句柄. 139 | */ 140 | func XBkInfoM_Clear(hBkInfoM HBKINFOM) { 141 | xBkInfoM_Clear.Call(uintptr(hBkInfoM)) 142 | } 143 | 144 | /* 145 | 绘制背景内容. 146 | 147 | 参数: 148 | hBkInfoM 背景内容管理器句柄. 149 | hDraw 图形绘制句柄. 150 | pRect 区域坐标. 151 | 返回: 152 | 成功返回TRUE否则返回FALSE. 153 | */ 154 | func XBkInfoM_Draw(hBkInfoM HBKINFOM, hDraw HDRAW, pRect *RECT) bool { 155 | ret, _, _ := xBkInfoM_Draw.Call( 156 | uintptr(hBkInfoM), 157 | uintptr(hDraw), 158 | uintptr(unsafe.Pointer(pRect))) 159 | 160 | return ret == TRUE 161 | } 162 | 163 | /* 164 | 绘制背景内容, 设置条件. 165 | 166 | 参数: 167 | hBkInfoM 背景内容管理器句柄. 168 | nState 组合状态. 169 | hDraw 图形绘制句柄. 170 | pRect 区域坐标. 171 | nStateFilter 当状态组合大于或等于该值时有效. 172 | 返回: 173 | 成功返回TRUE否则返回FALSE. 注解:组合状态大于或等于nStateFilter时才有效 , 174 | 例如用来绘制列表项,过滤掉元素的背景绘制,避免列表项与元素背景叠加. 175 | */ 176 | func XBkInfoM_DrawEx(hBkInfoM HBKINFOM, nState int, hDraw HDRAW, pRect *RECT, nStateFilter int) bool { 177 | ret, _, _ := xBkInfoM_DrawEx.Call( 178 | uintptr(hBkInfoM), 179 | uintptr(nState), 180 | uintptr(hDraw), 181 | uintptr(unsafe.Pointer(pRect)), 182 | uintptr(nStateFilter)) 183 | 184 | return ret == TRUE 185 | } 186 | -------------------------------------------------------------------------------- /xc/color.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | type COLORREF uint32 4 | 5 | func RGB(r, g, b byte) COLORREF { 6 | return COLORREF(uint32(r) | uint32(g)<<8 | uint32(b)<<16) 7 | } 8 | 9 | func (c COLORREF) R() byte { 10 | return byte(c & 0xff) 11 | } 12 | 13 | func (c COLORREF) G() byte { 14 | return byte((c >> 8) & 0xff) 15 | } 16 | 17 | func (c COLORREF) B() byte { 18 | return byte((c >> 16) & 0xff) 19 | } 20 | -------------------------------------------------------------------------------- /xc/dateTime.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | var ( 9 | // Functions 10 | xDateTime_Create *syscall.Proc 11 | xDateTime_SetStyle *syscall.Proc 12 | xDateTime_GetStyle *syscall.Proc 13 | xDateTime_GetButton *syscall.Proc 14 | xDateTime_GetSelBkColor *syscall.Proc 15 | xDateTime_SetSelBkColor *syscall.Proc 16 | xDateTime_GetDate *syscall.Proc 17 | xDateTime_SetDate *syscall.Proc 18 | xDateTime_GetTime *syscall.Proc 19 | xDateTime_SetTime *syscall.Proc 20 | ) 21 | 22 | func init() { 23 | // Functions 24 | xDateTime_Create = xcDLL.MustFindProc("XDateTime_Create") 25 | xDateTime_SetStyle = xcDLL.MustFindProc("XDateTime_SetStyle") 26 | xDateTime_GetStyle = xcDLL.MustFindProc("XDateTime_GetStyle") 27 | xDateTime_GetButton = xcDLL.MustFindProc("XDateTime_GetButton") 28 | xDateTime_GetSelBkColor = xcDLL.MustFindProc("XDateTime_GetSelBkColor") 29 | xDateTime_SetSelBkColor = xcDLL.MustFindProc("XDateTime_SetSelBkColor") 30 | xDateTime_GetDate = xcDLL.MustFindProc("XDateTime_GetDate") 31 | xDateTime_SetDate = xcDLL.MustFindProc("XDateTime_SetDate") 32 | xDateTime_GetTime = xcDLL.MustFindProc("XDateTime_GetTime") 33 | xDateTime_SetTime = xcDLL.MustFindProc("XDateTime_SetTime") 34 | } 35 | 36 | /* 37 | 创建日期时间元素 38 | 39 | 参数: 40 | x x坐标 41 | y y坐标 42 | cx 宽度 43 | cy 高度 44 | hParent 父为窗口句柄或元素句柄. 45 | 返回: 46 | 元素句柄. 47 | */ 48 | func XDateTime_Create(x, y, cx, cy int, hParent HXCGUI) HELE { 49 | ret, _, _ := xDateTime_Create.Call( 50 | uintptr(x), 51 | uintptr(y), 52 | uintptr(cx), 53 | uintptr(cy), 54 | uintptr(hParent)) 55 | 56 | return HELE(ret) 57 | } 58 | 59 | /* 60 | 设置样式. 61 | 62 | 参数: 63 | hEle 元素句柄. 64 | nStyle 样式, 0为日期元素,1为时间元素. 65 | */ 66 | func XDateTime_SetStyle(hEle HELE, nStyle int) { 67 | xDateTime_SetStyle.Call( 68 | uintptr(hEle), 69 | uintptr(nStyle)) 70 | } 71 | 72 | /* 73 | 获取样式. 74 | 75 | 参数: 76 | hEle 元素句柄. 77 | 返回: 78 | 元素样式. 79 | */ 80 | func XDateTime_GetStyle(hEle HELE) int { 81 | ret, _, _ := xDateTime_GetStyle.Call(uintptr(hEle)) 82 | 83 | return int(ret) 84 | } 85 | 86 | /* 87 | 获取内部按钮元素. 88 | 89 | 参数: 90 | hEle 元素句柄. 91 | nType 按钮类型. 92 | 返回: 93 | 元素样式. 94 | */ 95 | func XDateTime_GetButton(hEle HELE, nType int) HELE { 96 | ret, _, _ := xDateTime_GetButton.Call( 97 | uintptr(hEle), 98 | uintptr(nType)) 99 | 100 | return HELE(ret) 101 | } 102 | 103 | /* 104 | 获取被选择文字的背景颜色. 105 | 106 | 参数: 107 | hEle 元素句柄. 108 | 返回: 109 | 元素样式. 110 | */ 111 | func XDateTime_GetSelBkColor(hEle HELE) COLORREF { 112 | ret, _, _ := xDateTime_GetSelBkColor.Call(uintptr(hEle)) 113 | 114 | return COLORREF(ret) 115 | } 116 | 117 | /* 118 | 设置被选择文字的背景颜色. 119 | 120 | 参数: 121 | hEle 元素句柄. 122 | crSelectBk 文字被选中背景色. 123 | alpha 透明度 124 | */ 125 | func XDateTime_SetSelBkColor(hEle HELE, crSelectBk COLORREF, alpha byte) { 126 | xDateTime_SetSelBkColor.Call( 127 | uintptr(hEle), 128 | uintptr(crSelectBk), 129 | uintptr(alpha)) 130 | } 131 | 132 | /* 133 | 获取当前日期. 134 | 135 | 参数: 136 | hEle 元素句柄. 137 | pnYear 年.[IN,OUT] 138 | pnMonth 月.[IN,OUT] 139 | pnDay 日.[IN,OUT] 140 | */ 141 | func XDateTime_GetDate(hEle HELE, pnYear, pnMonth, pnDay *int) { 142 | xDateTime_GetDate.Call( 143 | uintptr(hEle), 144 | uintptr(unsafe.Pointer(pnYear)), 145 | uintptr(unsafe.Pointer(pnMonth)), 146 | uintptr(unsafe.Pointer(pnDay))) 147 | } 148 | 149 | /* 150 | 设置当前日期. 151 | 152 | 参数: 153 | hEle 元素句柄. 154 | nYear 年. 155 | nMonth 月. 156 | nDay 日. 157 | */ 158 | func XDateTime_SetDate(hEle HELE, nYear, nMonth, nDay int) { 159 | xDateTime_SetDate.Call( 160 | uintptr(hEle), 161 | uintptr(nYear), 162 | uintptr(nMonth), 163 | uintptr(nDay)) 164 | } 165 | 166 | /* 167 | 获取当前时间. 168 | 169 | 参数: 170 | hEle 元素句柄. 171 | pnHour 时.[IN,OUT] 172 | pnMinute 分.[IN,OUT] 173 | pnSecond 秒.[IN,OUT] 174 | */ 175 | func XDateTime_GetTime(hEle HELE, pnHour, pnMinute, pnSecond *int) { 176 | xDateTime_GetTime.Call( 177 | uintptr(hEle), 178 | uintptr(unsafe.Pointer(pnHour)), 179 | uintptr(unsafe.Pointer(pnMinute)), 180 | uintptr(unsafe.Pointer(pnSecond))) 181 | } 182 | 183 | /* 184 | 设置当前时分秒. 185 | 186 | 参数: 187 | hEle 元素句柄. 188 | nHour 时. 189 | nMinute 分. 190 | nSecond 秒. 191 | */ 192 | func XDateTime_SetTime(hEle HELE, nHour, nMinute, nSecond int) { 193 | xDateTime_SetTime.Call( 194 | uintptr(hEle), 195 | uintptr(nHour), 196 | uintptr(nMinute), 197 | uintptr(nSecond)) 198 | } 199 | -------------------------------------------------------------------------------- /xc/download.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | "io/ioutil" 7 | "log" 8 | "net/http" 9 | "os" 10 | ) 11 | 12 | import ( 13 | "github.com/lxn/walk" 14 | ) 15 | 16 | func downLoadXCGUIDll() { 17 | mw, _ := walk.NewMainWindow() 18 | ret := walk.MsgBox(mw, "下载提示", "没有找到XCGUI.dll,是否要联网下载?", walk.MsgBoxIconQuestion+walk.MsgBoxOKCancel) 19 | if ret != 1 { 20 | walk.MsgBox(mw, "警告信息", "请在重新运行程序前将XCGUI.dll放到运行目录.", walk.MsgBoxIconWarning) 21 | mw.Close() 22 | os.Exit(1) 23 | } 24 | 25 | resp, err := http.Get("http://git.oschina.net/CodyGuo/xcgui/raw/master/lib/XCGUI.dll") 26 | if err != nil { 27 | log.Println("[ERROR] 下载失败,请检查网络.") 28 | walk.MsgBox(mw, "错误信息", "XCGUI.dll 下载失败,请检查网络.", walk.MsgBoxIconError) 29 | mw.Close() 30 | } 31 | 32 | if resp.StatusCode == http.StatusOK { 33 | log.Println("[INFO] 正在下载 XCGUI.dll .") 34 | 35 | downFile, err := os.Create("XCGUI.dll") 36 | if err != nil { 37 | log.Fatal(err) 38 | } 39 | // 不要忘记关闭打开的文件. 40 | defer downFile.Close() 41 | 42 | body, err := ioutil.ReadAll(resp.Body) 43 | io.Copy(downFile, bytes.NewReader(body)) 44 | log.Println("[INFO] XCGUI.dll 下载成功.正在运行主程序.") 45 | 46 | walk.MsgBox(mw, "提示信息", "下载成功, 请点击确定继续运行程序.", walk.MsgBoxIconInformation) 47 | mw.Close() 48 | } else { 49 | log.Printf("[ERROR] 下载失败,%s.\n", resp.Status) 50 | 51 | walk.MsgBox(mw, "错误信息", "[ERROR] 下载失败,请检查网络.", walk.MsgBoxIconError) 52 | mw.Close() 53 | } 54 | 55 | mw.Run() 56 | } 57 | -------------------------------------------------------------------------------- /xc/fontX.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | var ( 9 | // Functions 10 | xFont_Create *syscall.Proc 11 | xFont_Create2 *syscall.Proc 12 | xFont_CreateEx *syscall.Proc 13 | xFont_CreateFromHFONT *syscall.Proc 14 | xFont_EnableAutoDestroy *syscall.Proc 15 | xFont_Destroy *syscall.Proc 16 | xFont_GetFont *syscall.Proc 17 | ) 18 | 19 | func init() { 20 | // Functions 21 | xFont_Create = xcDLL.MustFindProc("XFont_Create") 22 | xFont_Create2 = xcDLL.MustFindProc("XFont_Create2") 23 | xFont_CreateEx = xcDLL.MustFindProc("XFont_CreateEx") 24 | xFont_CreateFromHFONT = xcDLL.MustFindProc("XFont_CreateFromHFONT") 25 | xFont_EnableAutoDestroy = xcDLL.MustFindProc("XFont_EnableAutoDestroy") 26 | xFont_Destroy = xcDLL.MustFindProc("XFont_Destroy") 27 | xFont_GetFont = xcDLL.MustFindProc("XFont_GetFont") 28 | } 29 | 30 | /* 31 | 创建炫彩字体,当字体句柄与元素关联后,会自动释放. 32 | 33 | 参数: 34 | size 字体大小. 35 | 返回: 36 | 字体句柄. 37 | */ 38 | func XFont_Create(size int) HFONTX { 39 | ret, _, _ := xFont_Create.Call(uintptr(size)) 40 | 41 | return HFONTX(ret) 42 | } 43 | 44 | /* 45 | 创建炫彩字体. 46 | 47 | 参数: 48 | pName 字体名称.*uint16 49 | size 字体大小. 50 | bBold 是否为粗体. 51 | bItalic 是否为斜体. 52 | bUnderline 是否有下划线. 53 | bStrikeOut 是否有删除线. 54 | 返回: 55 | 字体句柄. 56 | */ 57 | func XFont_Create2(pName string, size int, bBold, bItalic, bUnderline, bStrikeOut bool) HFONTX { 58 | ret, _, _ := xFont_Create2.Call( 59 | StringToUintPtr(pName), 60 | // uintptr(unsafe.Pointer(pName)), 61 | uintptr(size), 62 | uintptr(BoolToBOOL(bBold)), 63 | uintptr(BoolToBOOL(bItalic)), 64 | uintptr(BoolToBOOL(bUnderline)), 65 | uintptr(BoolToBOOL(bStrikeOut))) 66 | 67 | return HFONTX(ret) 68 | } 69 | 70 | /* 71 | 创建炫彩字体. 72 | 73 | 参数: 74 | pFontInfo 字体信息. 75 | 返回: 76 | 字体句柄. 77 | */ 78 | func XFont_CreateEx(pFontInfo *LOGFONTW) HFONTX { 79 | ret, _, _ := xFont_CreateEx.Call(uintptr(unsafe.Pointer(pFontInfo))) 80 | 81 | return HFONTX(ret) 82 | } 83 | 84 | /* 85 | 创建炫彩字体从现有HFONT字体. 86 | 87 | 参数: 88 | hFont 字体句柄. 89 | 返回: 90 | 返回炫彩字体. 91 | */ 92 | func XFont_CreateFromHFONT(hFont HFONT) HFONTX { 93 | ret, _, _ := xFont_CreateFromHFONT.Call(uintptr(hFont)) 94 | 95 | return HFONTX(ret) 96 | } 97 | 98 | /* 99 | 是否自动销毁. 100 | 101 | 参数: 102 | hFontX 字体句柄. 103 | bEnable 是否启用. 104 | */ 105 | func XFont_EnableAutoDestroy(hFontX HFONTX, bEnable bool) { 106 | xFont_EnableAutoDestroy.Call( 107 | uintptr(hFontX), 108 | uintptr(BoolToBOOL(bEnable))) 109 | } 110 | 111 | /* 112 | 销毁炫彩字体. 113 | 114 | 参数: 115 | hFontX 字体句柄. 116 | */ 117 | func XFont_Destroy(hFontX HFONTX) { 118 | xFont_Destroy.Call(uintptr(hFontX)) 119 | } 120 | 121 | /* 122 | 获取字体HFONT句柄.. 123 | 124 | 参数: 125 | hFontX 字体句柄. 126 | 返回: 127 | 返回HFONT句柄. 128 | */ 129 | func XFont_GetFont(hFontX HFONTX) uintptr { 130 | ret, _, _ := xFont_GetFont.Call(uintptr(hFontX)) 131 | 132 | return uintptr(ret) 133 | } 134 | -------------------------------------------------------------------------------- /xc/layoutAlign.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | // 对齐方式 4 | type Layout_align_ int 5 | 6 | /* 7 | 对齐方式 8 | layout_align_left 左对齐 9 | layout_align_top 上对齐 10 | layout_align_right 右对齐 11 | layout_align_bottom 下对齐 12 | layout_align_center 居中对齐 13 | layout_align_equidistant 等距 14 | */ 15 | const ( 16 | Layout_align_left Layout_align_ = iota 17 | Layout_align_top 18 | Layout_align_right 19 | Layout_align_bottom 20 | Layout_align_center 21 | Layout_align_equidistant 22 | ) 23 | -------------------------------------------------------------------------------- /xc/menuBar.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | // "unsafe" 6 | ) 7 | 8 | var ( 9 | xMenuBar_Create *syscall.Proc 10 | xMenuBar_AddButton *syscall.Proc 11 | xMenuBar_SetButtonHeight *syscall.Proc 12 | xMenuBar_GetMenu *syscall.Proc 13 | xMenuBar_DeleteButton *syscall.Proc 14 | ) 15 | 16 | func init() { 17 | xMenuBar_Create = xcDLL.MustFindProc("XMenuBar_Create") 18 | xMenuBar_AddButton = xcDLL.MustFindProc("XMenuBar_AddButton") 19 | xMenuBar_SetButtonHeight = xcDLL.MustFindProc("XMenuBar_SetButtonHeight") 20 | xMenuBar_GetMenu = xcDLL.MustFindProc("XMenuBar_GetMenu") 21 | xMenuBar_DeleteButton = xcDLL.MustFindProc("XMenuBar_DeleteButton") 22 | } 23 | 24 | /* 25 | 创建菜单条元素;如果指定了父为窗口,默认调用XWnd_AddMenuBar()函数,将菜单条添加到窗口非客户区. 26 | 27 | 参数: 28 | x 元素x坐标. 29 | y 元素y坐标. 30 | cx 宽度. 31 | cy 高度. 32 | hParent 父是窗口资源句柄或U I元素资源句柄.如果是窗口资源句柄将被添加到窗口, 如果是元素资源句柄将被添加到元素. 33 | 返回: 34 | 元素句柄. 35 | */ 36 | func XMenuBar_Create(x, y, cx, cy int, hParent HXCGUI) HELE { 37 | ret, _, _ := xMenuBar_Create.Call( 38 | uintptr(x), 39 | uintptr(y), 40 | uintptr(cx), 41 | uintptr(cy), 42 | uintptr(hParent)) 43 | 44 | return HELE(ret) 45 | } 46 | 47 | /* 48 | 添加弹出菜单按钮. 49 | 50 | 参数: 51 | hEle 元素句柄. 52 | pText 文本内容.*uint16 53 | 返回: 54 | 返回菜单按钮索引. 55 | */ 56 | func XMenuBar_AddButton(hEle HELE, pText string) int { 57 | ret, _, _ := xMenuBar_AddButton.Call( 58 | uintptr(hEle), 59 | StringToUintPtr(pText)) 60 | // uintptr(unsafe.Pointer(pText))) 61 | 62 | return int(ret) 63 | } 64 | 65 | /* 66 | 设置菜单按钮高度. 67 | 68 | 参数: 69 | hEle 元素句柄. 70 | height 高度. 71 | */ 72 | func XMenuBar_SetButtonHeight(hEle HELE, height int) { 73 | xMenuBar_SetButtonHeight.Call( 74 | uintptr(hEle), 75 | uintptr(height)) 76 | } 77 | 78 | /* 79 | 获取菜单. 80 | 81 | 参数: 82 | hEle 元素句柄. 83 | nIndex 菜单条上菜单按钮的索引. 84 | 返回: 85 | 返回菜单句柄. 86 | */ 87 | func XMenuBar_GetMenu(hEle HELE, nIndex int) HMENUX { 88 | ret, _, _ := xMenuBar_GetMenu.Call( 89 | uintptr(hEle), 90 | uintptr(nIndex)) 91 | return HMENUX(ret) 92 | } 93 | 94 | /* 95 | 删除菜单条上的菜单按钮,同时该按钮下的弹出菜单也被销毁. 96 | 97 | 参数: 98 | hEle 元素句柄. 99 | nIndex 菜单条按钮索引. 100 | 返回: 101 | 成功返回TRUE否则返回FALSE. 102 | */ 103 | func XMenuBar_DeleteButton(hEle HELE, nIndex int) bool { 104 | ret, _, _ := xMenuBar_GetMenu.Call( 105 | uintptr(hEle), 106 | uintptr(nIndex)) 107 | 108 | return ret == TRUE 109 | } 110 | -------------------------------------------------------------------------------- /xc/modalWindow.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | // "unsafe" 6 | ) 7 | 8 | var ( 9 | // Functions 10 | xModalWnd_Create *syscall.Proc 11 | xModalWnd_CreateEx *syscall.Proc 12 | xModalWnd_EnableAutoClose *syscall.Proc 13 | xModalWnd_DoModal *syscall.Proc 14 | xModalWnd_EndModal *syscall.Proc 15 | ) 16 | 17 | func init() { 18 | // Funtions 19 | xModalWnd_Create = xcDLL.MustFindProc("XModalWnd_Create") 20 | xModalWnd_CreateEx = xcDLL.MustFindProc("XModalWnd_CreateEx") 21 | xModalWnd_EnableAutoClose = xcDLL.MustFindProc("XModalWnd_EnableAutoClose") 22 | xModalWnd_DoModal = xcDLL.MustFindProc("XModalWnd_DoModal") 23 | xModalWnd_EndModal = xcDLL.MustFindProc("XModalWnd_EndModal") 24 | } 25 | 26 | /* 27 | 创建模态窗口;当模态窗口关闭时,会自动销毁模态窗口资源句柄. 28 | 29 | 参数: 30 | nWidth 宽度. 31 | nHeight 高度. 32 | pTitle 窗口标题内容. *uint16 33 | hWndParent 父窗口句柄. 34 | XCStyle 炫彩窗口样式,样式请参见宏定义. 35 | 返回: 36 | 模态窗口句柄. 37 | */ 38 | func XModalWnd_Create(bWidth, nHeight int, pTitle string, hWndParent HWND, XCStyle Xc_window_style_) HWINDOW { 39 | ret, _, _ := xModalWnd_Create.Call( 40 | uintptr(bWidth), 41 | uintptr(nHeight), 42 | StringToUintPtr(pTitle), 43 | // uintptr(unsafe.Pointer(pTitle)), 44 | uintptr(hWndParent), 45 | uintptr(XCStyle)) 46 | 47 | return HWINDOW(ret) 48 | } 49 | 50 | /* 51 | 创建模态窗口,增强功能. 52 | 53 | 参数: 54 | dwExStyle 窗口扩展样式. 55 | lpClassName 窗口类名.*uint16 56 | lpWindowName 窗口名.*uint16 57 | dwStyle 窗口样式. 58 | x 窗口左上角x坐标. 59 | y 窗口左上角y坐标. 60 | cx 窗口宽度. 61 | cy 窗口高度. 62 | hWndParent 父窗口. 63 | XCStyle GUI库窗口样式,样式请参见宏定义 xc_window_style_. 64 | 返回: 65 | GUI库窗口资源句柄. 66 | */ 67 | func XModalWnd_CreateEx(dwExStyle uint32, lpClassName, lpWindowName string, dwStyle uint32, x, y, cx, cy int, hWndParent HWND, XCStyle int) HWINDOW { 68 | ret, _, _ := xModalWnd_CreateEx.Call( 69 | uintptr(dwExStyle), 70 | StringToUintPtr(lpClassName), 71 | StringToUintPtr(lpWindowName), 72 | // uintptr(unsafe.Pointer(lpClassName)), 73 | // uintptr(unsafe.Pointer(lpWindowName)), 74 | uintptr(dwStyle), 75 | uintptr(x), 76 | uintptr(y), 77 | uintptr(cx), 78 | uintptr(cy), 79 | uintptr(hWndParent), 80 | uintptr(XCStyle)) 81 | 82 | return HWINDOW(ret) 83 | } 84 | 85 | /* 86 | 是否自动关闭窗口,当窗口失去焦点时. 87 | 88 | 参数: 89 | hWindow 模态窗口句柄. 90 | bEnable 开启开关. 91 | */ 92 | func XModalWnd_EnableAutoClose(hWindow HWINDOW, bEnable bool) { 93 | xModalWnd_EnableAutoClose.Call( 94 | uintptr(hWindow), 95 | uintptr(BoolToBOOL(bEnable))) 96 | } 97 | 98 | /* 99 | 启动显示模态窗口,当窗口关闭时返回. 100 | 101 | 参数: 102 | hWindow 模态窗口句柄. 103 | 返回: 104 | XMB_OK:点击确定按钮退出.XMB_CANCEL:点击取消按钮退出.如果返回0,其他方式退出. 105 | */ 106 | func XModalWnd_DoModal(hWindow HWINDOW) int { 107 | ret, _, _ := xModalWnd_DoModal.Call(uintptr(hWindow)) 108 | 109 | return int(ret) 110 | } 111 | 112 | /* 113 | 结束模态窗口. 114 | 115 | 参数: 116 | hWindow 窗口句柄. 117 | nResult XModalWnd_DoModal() 返回值. 118 | */ 119 | func XModalWnd_EndModal(hWindow HWINDOW, nResult int) { 120 | xModalWnd_EndModal.Call( 121 | uintptr(hWindow), 122 | uintptr(nResult)) 123 | } 124 | -------------------------------------------------------------------------------- /xc/monthCal.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | var ( 9 | // Functions 10 | xMonthCal_Create *syscall.Proc 11 | xMonthCal_GetButton *syscall.Proc 12 | xMonthCal_SetToday *syscall.Proc 13 | xMonthCal_GetToday *syscall.Proc 14 | xMonthCal_SeSelDate *syscall.Proc 15 | xMonthCal_GetSelDate *syscall.Proc 16 | ) 17 | 18 | func init() { 19 | // Functions 20 | xMonthCal_Create = xcDLL.MustFindProc("XMonthCal_Create") 21 | xMonthCal_GetButton = xcDLL.MustFindProc("XMonthCal_GetButton") 22 | xMonthCal_SetToday = xcDLL.MustFindProc("XMonthCal_SetToday") 23 | xMonthCal_GetToday = xcDLL.MustFindProc("XMonthCal_GetToday") 24 | xMonthCal_SeSelDate = xcDLL.MustFindProc("XMonthCal_SeSelDate") 25 | xMonthCal_GetSelDate = xcDLL.MustFindProc("XMonthCal_GetSelDate") 26 | } 27 | 28 | /* 29 | 创建日期时间元素 30 | 31 | 参数: 32 | x x坐标 33 | y y坐标 34 | cx 宽度 35 | cy 高度 36 | hParent 父为窗口句柄或元素句柄. 37 | 返回: 38 | 元素句柄. 39 | */ 40 | func XMonthCal_Create(x, y, cx, cy int, hParent HXCGUI) HELE { 41 | ret, _, _ := xMonthCal_Create.Call( 42 | uintptr(x), 43 | uintptr(y), 44 | uintptr(cx), 45 | uintptr(cy), 46 | uintptr(hParent)) 47 | 48 | return HELE(ret) 49 | } 50 | 51 | /* 52 | 获取内部按钮元素. 53 | 54 | 参数: 55 | hEle 元素句柄. 56 | nType 按钮类型. 57 | 返回: 58 | 元素样式. 59 | */ 60 | func XMonthCal_GetButton(hEle HELE, nType MonthCal_button_type_) HELE { 61 | ret, _, _ := xMonthCal_GetButton.Call( 62 | uintptr(hEle), 63 | uintptr(nType)) 64 | 65 | return HELE(ret) 66 | } 67 | 68 | /* 69 | 设置月历当前年月日. 70 | 71 | 参数: 72 | hEle 元素句柄. 73 | nYear 年. 74 | nMonth 月. 75 | nDay 日. 76 | */ 77 | func XMonthCal_SetToday(hEle HELE, nYear, nMonth, nDay int) { 78 | xMonthCal_SetToday.Call( 79 | uintptr(hEle), 80 | uintptr(nYear), 81 | uintptr(nMonth), 82 | uintptr(nDay)) 83 | } 84 | 85 | /* 86 | 获取月历当前年月日. 87 | 88 | 参数: 89 | hEle 元素句柄. 90 | pnYear 年.[INT,OUT] 91 | pnMonth 月.[INT,OUT] 92 | pnDay 日.[INT,OUT] 93 | */ 94 | func XMonthCal_GetToday(hEle HELE, pnYear, pnMonth, pnDay *int) { 95 | xMonthCal_GetToday.Call( 96 | uintptr(hEle), 97 | uintptr(unsafe.Pointer(pnYear)), 98 | uintptr(unsafe.Pointer(pnMonth)), 99 | uintptr(unsafe.Pointer(pnDay))) 100 | } 101 | 102 | /* 103 | 设置月历选中的年月日. 104 | 105 | 参数: 106 | hEle 元素句柄. 107 | nYear 年. 108 | nMonth 月. 109 | nDay 日. 110 | */ 111 | func XMonthCal_SeSelDate(hEle HELE, nYear, nMonth, nDay int) { 112 | xMonthCal_SeSelDate.Call( 113 | uintptr(hEle), 114 | uintptr(nYear), 115 | uintptr(nMonth), 116 | uintptr(nDay)) 117 | } 118 | 119 | /* 120 | 获取月历选中的年月日. 121 | 122 | 参数: 123 | hEle 元素句柄. 124 | pnYear 年.[INT,OUT] 125 | pnMonth 月.[INT,OUT] 126 | pnDay 日.[INT,OUT] 127 | */ 128 | func XMonthCal_GetSelDate(hEle HELE, pnYear, pnMonth, pnDay *int) { 129 | xMonthCal_GetSelDate.Call( 130 | uintptr(hEle), 131 | uintptr(unsafe.Pointer(pnYear)), 132 | uintptr(unsafe.Pointer(pnMonth)), 133 | uintptr(unsafe.Pointer(pnDay))) 134 | } 135 | -------------------------------------------------------------------------------- /xc/pane.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | var ( 9 | xPane_Create *syscall.Proc 10 | xPane_SetView *syscall.Proc 11 | xPane_GetTitle *syscall.Proc 12 | xPane_IsShowPane *syscall.Proc 13 | xPane_HidePane *syscall.Proc 14 | xPane_ShowPane *syscall.Proc 15 | xPane_DockPane *syscall.Proc 16 | xPane_LockPane *syscall.Proc 17 | xPane_FloatPane *syscall.Proc 18 | ) 19 | 20 | func init() { 21 | xPane_Create = xcDLL.MustFindProc("XPane_Create") 22 | xPane_SetView = xcDLL.MustFindProc("XPane_SetView") 23 | xPane_GetTitle = xcDLL.MustFindProc("XPane_GetTitle") 24 | xPane_IsShowPane = xcDLL.MustFindProc("XPane_IsShowPane") 25 | xPane_HidePane = xcDLL.MustFindProc("XPane_HidePane") 26 | xPane_ShowPane = xcDLL.MustFindProc("XPane_ShowPane") 27 | xPane_DockPane = xcDLL.MustFindProc("XPane_DockPane") 28 | xPane_LockPane = xcDLL.MustFindProc("XPane_LockPane") 29 | xPane_FloatPane = xcDLL.MustFindProc("XPane_FloatPane") 30 | 31 | } 32 | 33 | /* 34 | 创建窗格元素. 35 | 36 | 参数: 37 | pName 窗格标题.*uint16 38 | nWidth 宽度. 39 | nHeight 高度. 40 | hFrameWnd 框架窗口. 41 | 返回: 42 | 元素句柄. 43 | */ 44 | func XPane_Create(pName string, nWidth int, nHeight int, hFrameWnd HWINDOW) HELE { 45 | ret, _, _ := xPane_Create.Call( 46 | StringToUintPtr(pName), 47 | // uintptr(unsafe.Pointer(pName)), 48 | uintptr(nWidth), 49 | uintptr(nHeight), 50 | uintptr(hFrameWnd)) 51 | 52 | return HELE(ret) 53 | } 54 | 55 | /* 56 | 设置窗格视图元素. 57 | 58 | 参数: 59 | hEle 元素句柄. 60 | hView 视图颜色. 61 | */ 62 | func XPane_SetView(hEle HELE, hView HELE) { 63 | xPane_SetView.Call( 64 | uintptr(hEle), 65 | uintptr(hView)) 66 | } 67 | 68 | /* 69 | 获取标题. 70 | 71 | 参数: 72 | hEle 元素句柄. 73 | pOut 接收内容缓冲区. 74 | nOutLen 缓冲区长度,字符为单位. 75 | */ 76 | func XPane_GetTitle(hEle HELE, pOut *uint16, nOutLen int) { 77 | xPane_GetTitle.Call( 78 | uintptr(hEle), 79 | uintptr(unsafe.Pointer(pOut)), 80 | uintptr(nOutLen)) 81 | } 82 | 83 | /* 84 | 判断窗格是否显示. 85 | 86 | 参数: 87 | hEle 元素句柄. 88 | 返回: 89 | 如果显示返回TRUE否则返回FALSE. 90 | */ 91 | func XPane_IsShowPane(hEle HELE) bool { 92 | ret, _, _ := xPane_IsShowPane.Call(uintptr(hEle)) 93 | 94 | return ret == TRUE 95 | } 96 | 97 | /* 98 | 隐藏窗格. 99 | 100 | 参数: 101 | hEle 元素句柄. 102 | */ 103 | func XPane_HidePane(hEle HELE) { 104 | xPane_HidePane.Call(uintptr(hEle)) 105 | } 106 | 107 | /* 108 | 显示窗格. 109 | 110 | 参数: 111 | hEle 元素句柄. 112 | */ 113 | func XPane_ShowPane(hEle HELE) { 114 | xPane_ShowPane.Call(uintptr(hEle)) 115 | } 116 | 117 | /* 118 | 窗格停靠到码头. 119 | 120 | 参数: 121 | hEle 元素句柄. 122 | */ 123 | func XPane_DockPane(hEle HELE) { 124 | xPane_DockPane.Call(uintptr(hEle)) 125 | } 126 | 127 | /* 128 | 锁定窗格. 129 | 130 | 参数: 131 | hEle 元素句柄. 132 | */ 133 | func XPane_LockPane(hEle HELE) { 134 | xPane_LockPane.Call(uintptr(hEle)) 135 | } 136 | 137 | /* 138 | 浮动窗格. 139 | 140 | 参数: 141 | hEle 元素句柄. 142 | */ 143 | func XPane_FloatPane(hEle HELE) { 144 | xPane_FloatPane.Call(uintptr(hEle)) 145 | } 146 | 147 | func XPane_GetTitleGo(hEle HELE) string { 148 | buf_szize := 256 149 | buf := make([]uint16, buf_szize) 150 | XPane_GetTitle(hEle, &buf[0], buf_szize) 151 | 152 | return syscall.UTF16ToString(buf) 153 | } 154 | -------------------------------------------------------------------------------- /xc/progressBar.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | var ( 8 | xProgBar_Create *syscall.Proc 9 | xProgBar_SetRange *syscall.Proc 10 | xProgBar_GetRange *syscall.Proc 11 | xProgBar_SetImageLoad *syscall.Proc 12 | xProgBar_SetSpaceTwo *syscall.Proc 13 | xProgBar_SetPos *syscall.Proc 14 | xProgBar_GetPos *syscall.Proc 15 | xProgBar_SetHorizon *syscall.Proc 16 | ) 17 | 18 | func init() { 19 | xProgBar_Create = xcDLL.MustFindProc("XProgBar_Create") 20 | xProgBar_SetRange = xcDLL.MustFindProc("XProgBar_SetRange") 21 | xProgBar_GetRange = xcDLL.MustFindProc("XProgBar_GetRange") 22 | xProgBar_SetImageLoad = xcDLL.MustFindProc("XProgBar_SetImageLoad") 23 | xProgBar_SetSpaceTwo = xcDLL.MustFindProc("XProgBar_SetSpaceTwo") 24 | xProgBar_SetPos = xcDLL.MustFindProc("XProgBar_SetPos") 25 | xProgBar_GetPos = xcDLL.MustFindProc("XProgBar_GetPos") 26 | xProgBar_SetHorizon = xcDLL.MustFindProc("XProgBar_SetHorizon") 27 | } 28 | 29 | /* 30 | 创建进度条元素. 31 | 32 | 参数: 33 | x 元素x坐标. 34 | y 元素y坐标. 35 | cx 宽度. 36 | cy 高度. 37 | hParent 父是窗口资源句柄或UI元素资源句柄.如果是窗口资源句柄将被添加到窗口, 如果是元素资源句柄将被添加到元素. 38 | 返回: 39 | 元素句柄. 40 | */ 41 | func XProgBar_Create(x int, y int, cx int, cy int, hParent HXCGUI) HELE { 42 | ret, _, _ := xProgBar_Create.Call( 43 | uintptr(x), 44 | uintptr(y), 45 | uintptr(cx), 46 | uintptr(cy), 47 | uintptr(hParent)) 48 | 49 | return HELE(ret) 50 | } 51 | 52 | /* 53 | 设置范围. 54 | 55 | 参数: 56 | hEle 元句柄. 57 | range 范围. 58 | */ 59 | func XProgBar_SetRange(hEle HELE, barRange int) { 60 | xProgBar_SetRange.Call( 61 | uintptr(hEle), 62 | uintptr(barRange)) 63 | } 64 | 65 | /* 66 | 获取范围. 67 | 68 | 参数: 69 | hEle 元句柄. 70 | 返回: 71 | 返回范围. 72 | */ 73 | func XProgBar_GetRange(hEle HELE) int { 74 | ret, _, _ := xProgBar_GetRange.Call(uintptr(hEle)) 75 | 76 | return int(ret) 77 | } 78 | 79 | /* 80 | 设置进度贴图. 81 | 82 | 参数: 83 | hEle 元句柄. 84 | hImage 图片句柄. 85 | */ 86 | func XProgBar_SetImageLoad(hEle HELE, hImage HIMAGE) { 87 | xProgBar_SetImageLoad.Call( 88 | uintptr(hEle), 89 | uintptr(hImage)) 90 | } 91 | 92 | /* 93 | 设置两端间隔大小. 94 | 95 | 参数: 96 | hEle 元句柄. 97 | leftSize 左边间隔大小. 98 | rightSize 右边间隔大小. 99 | */ 100 | func XProgBar_SetSpaceTwo(hEle HELE, leftSize int, rightSize int) { 101 | xProgBar_SetSpaceTwo.Call( 102 | uintptr(hEle), 103 | uintptr(leftSize), 104 | uintptr(rightSize)) 105 | } 106 | 107 | /* 108 | 设置位置点. 109 | 110 | 参数: 111 | hEle 元句柄. 112 | pos 位置点. 113 | */ 114 | func XProgBar_SetPos(hEle HELE, pos int) { 115 | xProgBar_SetPos.Call( 116 | uintptr(hEle), 117 | uintptr(pos)) 118 | } 119 | 120 | /* 121 | 获取当前位置点. 122 | 123 | 参数: 124 | hEle 元句柄. 125 | 返回: 126 | 返回当前位置点. 127 | */ 128 | func XProgBar_GetPos(hEle HELE) int { 129 | ret, _, _ := xProgBar_GetPos.Call(uintptr(hEle)) 130 | 131 | return int(ret) 132 | } 133 | 134 | /* 135 | 设置水平或垂直. 136 | 137 | 参数: 138 | hEle 元句柄. 139 | bHorizon 水平或垂直. 140 | */ 141 | func XProgBar_SetHorizon(hEle HELE, bHorizon bool) { 142 | xProgBar_SetPos.Call( 143 | uintptr(hEle), 144 | uintptr(BoolToBOOL(bHorizon))) 145 | } 146 | -------------------------------------------------------------------------------- /xc/shapeEllipse.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | var ( 8 | xShapeEllipse_Create *syscall.Proc 9 | xShapeEllipse_SetBorderColor *syscall.Proc 10 | xShapeEllipse_SetFillColor *syscall.Proc 11 | xShapeEllipse_EnableBorder *syscall.Proc 12 | xShapeEllipse_EnableFill *syscall.Proc 13 | ) 14 | 15 | func init() { 16 | xShapeEllipse_Create = xcDLL.MustFindProc("XShapeEllipse_Create") 17 | xShapeEllipse_SetBorderColor = xcDLL.MustFindProc("XShapeEllipse_SetBorderColor") 18 | xShapeEllipse_SetFillColor = xcDLL.MustFindProc("XShapeEllipse_SetFillColor") 19 | xShapeEllipse_EnableBorder = xcDLL.MustFindProc("XShapeEllipse_EnableBorder") 20 | xShapeEllipse_EnableFill = xcDLL.MustFindProc("XShapeEllipse_EnableFill") 21 | } 22 | 23 | /* 24 | 创建圆形形状对象. 25 | 26 | 参数: 27 | x X坐标. 28 | y Y坐标. 29 | cx 宽度. 30 | cy 高度. 31 | hParent 父对象句柄. 32 | 返回: 33 | 返回句柄. 34 | */ 35 | func XShapeEllipse_Create(x, y, cx, cy int, hParent HXCGUI) HXCGUI { 36 | ret, _, _ := xShapeEllipse_Create.Call( 37 | uintptr(x), 38 | uintptr(y), 39 | uintptr(cx), 40 | uintptr(cy), 41 | uintptr(hParent)) 42 | 43 | return HXCGUI(ret) 44 | } 45 | 46 | /* 47 | 设置边框颜色. 48 | 49 | 参数: 50 | hShape 形状对象句柄. 51 | color RGB颜色值. 52 | alpha 透明度. 53 | */ 54 | func XShapeEllipse_SetBorderColor(hShape HXCGUI, color COLORREF, alpha byte) { 55 | xShapeEllipse_SetBorderColor.Call( 56 | uintptr(hShape), 57 | uintptr(color), 58 | uintptr(alpha)) 59 | } 60 | 61 | /* 62 | 设置填充颜色. 63 | 64 | 参数: 65 | hShape 形状对象句柄. 66 | color RGB颜色值. 67 | alpha 透明度. 68 | */ 69 | func XShapeEllipse_SetFillColor(hShape HXCGUI, color COLORREF, alpha byte) { 70 | xShapeEllipse_SetFillColor.Call( 71 | uintptr(hShape), 72 | uintptr(color), 73 | uintptr(alpha)) 74 | } 75 | 76 | /* 77 | 启用绘制圆边框. 78 | 79 | 参数: 80 | hShape 形状对象句柄. 81 | bEnable 是否启用. 82 | */ 83 | func XShapeEllipse_EnableBorder(hShape HXCGUI, bEnable bool) { 84 | xShapeEllipse_EnableBorder.Call( 85 | uintptr(hShape), 86 | uintptr(BoolToBOOL(bEnable))) 87 | } 88 | 89 | /* 90 | 启用填充圆. 91 | 92 | 参数: 93 | hShape 形状对象句柄. 94 | bEnable 是否启用. 95 | */ 96 | func XShapeEllipse_EnableFill(hShape HXCGUI, bEnable bool) { 97 | xShapeEllipse_EnableFill.Call( 98 | uintptr(hShape), 99 | uintptr(BoolToBOOL(bEnable))) 100 | } 101 | -------------------------------------------------------------------------------- /xc/shapeGif.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | var ( 9 | xShapeGif_Create *syscall.Proc 10 | xShapeGif_SetImage *syscall.Proc 11 | xShapeGif_SetLayoutWidth *syscall.Proc 12 | xShapeGif_SetLayoutHeight *syscall.Proc 13 | xShapeGif_GetLayoutWidth *syscall.Proc 14 | xShapeGif_GetLayoutHeight *syscall.Proc 15 | ) 16 | 17 | func init() { 18 | xShapeGif_Create = xcDLL.MustFindProc("XShapeGif_Create") 19 | xShapeGif_SetImage = xcDLL.MustFindProc("XShapeGif_SetImage") 20 | xShapeGif_SetLayoutWidth = xcDLL.MustFindProc("XShapeGif_SetLayoutWidth") 21 | xShapeGif_SetLayoutHeight = xcDLL.MustFindProc("XShapeGif_SetLayoutHeight") 22 | xShapeGif_GetLayoutWidth = xcDLL.MustFindProc("XShapeGif_GetLayoutWidth") 23 | xShapeGif_GetLayoutHeight = xcDLL.MustFindProc("XShapeGif_GetLayoutHeight") 24 | } 25 | 26 | /* 27 | 创建形状对象GIF. 28 | 29 | 参数: 30 | x X坐标. 31 | y Y坐标. 32 | cx 宽度. 33 | cy 高度. 34 | hParent 父对象句柄. 35 | 返回: 36 | 成功返回形状对象GIF句柄,否则返回NULL. 37 | */ 38 | func XShapeGif_Create(x, y, cx, cy int, hParent HXCGUI) HXCGUI { 39 | ret, _, _ := xShapeGif_Create.Call( 40 | uintptr(x), 41 | uintptr(y), 42 | uintptr(cx), 43 | uintptr(cy), 44 | uintptr(hParent)) 45 | 46 | return HXCGUI(ret) 47 | } 48 | 49 | /* 50 | 设置GIF图片. 51 | 52 | 参数: 53 | hShape 形状对象句柄. 54 | hImage 图片句柄. 55 | */ 56 | func XShapeGif_SetImage(hShape HXCGUI, hImage HIMAGE) { 57 | xShapeGif_SetImage.Call( 58 | uintptr(hShape), 59 | uintptr(hImage)) 60 | } 61 | 62 | /* 63 | 设置布局宽度. 64 | 65 | 参数: 66 | hShape 形状对象句柄. 67 | nType 属性类型. 68 | width 宽度. 69 | */ 70 | func XShapeGif_SetLayoutWidth(hShape HXCGUI, nType Layout_size_type_, width int) { 71 | xShapeGif_SetLayoutWidth.Call( 72 | uintptr(hShape), 73 | uintptr(nType), 74 | uintptr(width)) 75 | } 76 | 77 | /* 78 | 设置布局高度. 79 | 80 | 参数: 81 | hShape 形状对象句柄. 82 | nType 属性类型. 83 | height 高度. 84 | */ 85 | func XShapeGif_SetLayoutHeight(hShape HXCGUI, nType Layout_size_type_, height int) { 86 | xShapeGif_SetLayoutHeight.Call( 87 | uintptr(hShape), 88 | uintptr(nType), 89 | uintptr(height)) 90 | } 91 | 92 | /* 93 | 获取布局宽度. 94 | 95 | 参数: 96 | hShape 形状对象句柄. 97 | pType 属性类型. 98 | pWidth 宽度. 99 | */ 100 | func XShapeGif_GetLayoutWidth(hShape HXCGUI, nType Layout_size_type_, pWidth *int) { 101 | xShapeGif_GetLayoutWidth.Call( 102 | uintptr(hShape), 103 | uintptr(nType), 104 | uintptr(unsafe.Pointer(pWidth))) 105 | } 106 | 107 | /* 108 | 获取布局高度. 109 | 110 | 参数: 111 | hShape 形状对象句柄. 112 | pType 属性类型. 113 | pHeight 高度. 114 | */ 115 | func XShapeGif_GetLayoutHeight(hShape HXCGUI, nType Layout_size_type_, pHeight *int) { 116 | xShapeGif_GetLayoutHeight.Call( 117 | uintptr(hShape), 118 | uintptr(nType), 119 | uintptr(unsafe.Pointer(pHeight))) 120 | } 121 | -------------------------------------------------------------------------------- /xc/shapeLine.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | var ( 8 | xShapeLine_Create *syscall.Proc 9 | xShapeLine_SetPosition *syscall.Proc 10 | xShapeLine_SetColor *syscall.Proc 11 | ) 12 | 13 | func init() { 14 | xShapeLine_Create = xcDLL.MustFindProc("XShapeLine_Create") 15 | xShapeLine_SetPosition = xcDLL.MustFindProc("XShapeLine_SetPosition") 16 | xShapeLine_SetColor = xcDLL.MustFindProc("XShapeLine_SetColor") 17 | } 18 | 19 | /* 20 | 创建矩形形状对象. 21 | 22 | 参数: 23 | x1 坐标. 24 | y1 坐标. 25 | x2 坐标. 26 | y2 坐标. 27 | hParent 父对象句柄. 28 | 返回: 29 | 返回句柄. 30 | */ 31 | func XShapeLine_Create(x1, y1, x2, y2 int, hParent HXCGUI) HXCGUI { 32 | ret, _, _ := xShapeLine_Create.Call( 33 | uintptr(x1), 34 | uintptr(y1), 35 | uintptr(x2), 36 | uintptr(y2), 37 | uintptr(hParent)) 38 | 39 | return HXCGUI(ret) 40 | } 41 | 42 | /* 43 | 设置位置. 44 | 45 | 参数: 46 | hShape 形状对象句柄. 47 | x1 坐标. 48 | y1 坐标. 49 | x2 坐标. 50 | y2 坐标. 51 | */ 52 | func XShapeLine_SetPosition(hShape HXCGUI, x1, y1, x2, y2 int) { 53 | xShapeLine_SetPosition.Call( 54 | uintptr(hShape), 55 | uintptr(x1), 56 | uintptr(y1), 57 | uintptr(x2), 58 | uintptr(y2)) 59 | } 60 | 61 | /* 62 | 设置直线颜色. 63 | 64 | 参数: 65 | hShape 形状对象句柄. 66 | color RGB颜色值. 67 | alpha 透明度. 68 | */ 69 | func XShapeLine_SetColor(hShape HXCGUI, color COLORREF, alpha byte) { 70 | xShapeLine_SetColor.Call( 71 | uintptr(hShape), 72 | uintptr(color), 73 | uintptr(alpha)) 74 | } 75 | -------------------------------------------------------------------------------- /xc/shapePicture.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | var ( 9 | xShapePic_Create *syscall.Proc 10 | xShapePic_SetImage *syscall.Proc 11 | xShapePic_SetLayoutWidth *syscall.Proc 12 | xShapePic_SetLayoutHeight *syscall.Proc 13 | xShapePic_GetLayoutWidth *syscall.Proc 14 | xShapePic_GetLayoutHeight *syscall.Proc 15 | ) 16 | 17 | func init() { 18 | xShapePic_Create = xcDLL.MustFindProc("XShapePic_Create") 19 | xShapePic_SetImage = xcDLL.MustFindProc("XShapePic_SetImage") 20 | xShapePic_SetLayoutWidth = xcDLL.MustFindProc("XShapePic_SetLayoutWidth") 21 | xShapePic_SetLayoutHeight = xcDLL.MustFindProc("XShapePic_SetLayoutHeight") 22 | xShapePic_GetLayoutWidth = xcDLL.MustFindProc("XShapePic_GetLayoutWidth") 23 | xShapePic_GetLayoutHeight = xcDLL.MustFindProc("XShapePic_GetLayoutHeight") 24 | } 25 | 26 | /* 27 | 创建形状对象-图片. 28 | 29 | 参数: 30 | x x坐标. 31 | y y坐标. 32 | cx 宽度. 33 | cy 高度. 34 | hParent 父对象句柄. 35 | 返回: 36 | 成功返回图片对象句柄,否则返回NULL. 37 | */ 38 | func XShapePic_Create(x, y, cx, cy int, hParent HXCGUI) HXCGUI { 39 | ret, _, _ := xShapePic_Create.Call( 40 | uintptr(x), 41 | uintptr(y), 42 | uintptr(cx), 43 | uintptr(cy), 44 | uintptr(hParent)) 45 | 46 | return HXCGUI(ret) 47 | } 48 | 49 | /* 50 | 设置图片. 51 | 52 | 参数: 53 | hShape 形状对象句柄. 54 | hImage 图片句柄. 55 | */ 56 | func XShapePic_SetImage(hShape HXCGUI, hImage HIMAGE) { 57 | xShapePic_SetImage.Call( 58 | uintptr(hShape), 59 | uintptr(hImage)) 60 | } 61 | 62 | /* 63 | 设置布局宽度. 64 | 65 | 参数: 66 | hShape 形状对象句柄. 67 | nType 标识. 68 | width 宽度. 69 | */ 70 | func XShapePic_SetLayoutWidth(hShape HXCGUI, nType Layout_size_type_, width int) { 71 | xShapePic_SetLayoutWidth.Call( 72 | uintptr(hShape), 73 | uintptr(nType), 74 | uintptr(width)) 75 | } 76 | 77 | /* 78 | 设置布局高度. 79 | 80 | 参数: 81 | hShape 形状对象句柄. 82 | nType 标识. 83 | height 高度. 84 | */ 85 | func XShapePic_SetLayoutHeight(hShape HXCGUI, nType Layout_size_type_, height int) { 86 | xShapePic_SetLayoutHeight.Call( 87 | uintptr(hShape), 88 | uintptr(nType), 89 | uintptr(height)) 90 | } 91 | 92 | /* 93 | 获取布局宽度. 94 | 95 | 参数: 96 | hShape 形状对象句柄. 97 | pType 属性标识. 98 | pWidth 宽度. 99 | */ 100 | func XShapePic_GetLayoutWidth(hShape HXCGUI, nType Layout_size_type_, pWidth *int) { 101 | xShapePic_GetLayoutWidth.Call( 102 | uintptr(hShape), 103 | uintptr(nType), 104 | uintptr(unsafe.Pointer(pWidth))) 105 | } 106 | 107 | /* 108 | 获取布局高度. 109 | 110 | 参数: 111 | hShape 形状对象句柄. 112 | pType 属性标识. 113 | pHeight 高度. 114 | */ 115 | func XShapePic_GetLayoutHeight(hShape HXCGUI, nType Layout_size_type_, pHeight *int) { 116 | xShapePic_GetLayoutHeight.Call( 117 | uintptr(hShape), 118 | uintptr(nType), 119 | uintptr(unsafe.Pointer(pHeight))) 120 | } 121 | -------------------------------------------------------------------------------- /xc/shapeRect.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | var ( 9 | xShapeRect_Create *syscall.Proc 10 | xShapeRect_SetBorderColor *syscall.Proc 11 | xShapeRect_SetFillColor *syscall.Proc 12 | xShapeRect_SetRoundAngle *syscall.Proc 13 | xShapeRect_GetRoundAngle *syscall.Proc 14 | xShapeRect_EnableBorder *syscall.Proc 15 | xShapeRect_EnableFill *syscall.Proc 16 | xShapeRect_EnableRoundAngle *syscall.Proc 17 | ) 18 | 19 | func init() { 20 | xShapeRect_Create = xcDLL.MustFindProc("XShapeRect_Create") 21 | xShapeRect_SetBorderColor = xcDLL.MustFindProc("XShapeRect_SetBorderColor") 22 | xShapeRect_SetFillColor = xcDLL.MustFindProc("XShapeRect_SetFillColor") 23 | xShapeRect_SetRoundAngle = xcDLL.MustFindProc("XShapeRect_SetRoundAngle") 24 | xShapeRect_GetRoundAngle = xcDLL.MustFindProc("XShapeRect_GetRoundAngle") 25 | xShapeRect_EnableBorder = xcDLL.MustFindProc("XShapeRect_EnableBorder") 26 | xShapeRect_Create = xcDLL.MustFindProc("XShapeRect_Create") 27 | xShapeRect_EnableFill = xcDLL.MustFindProc("XShapeRect_EnableFill") 28 | xShapeRect_EnableRoundAngle = xcDLL.MustFindProc("XShapeRect_EnableRoundAngle") 29 | } 30 | 31 | /* 32 | 创建矩形形状对象. 33 | 34 | 参数: 35 | x X坐标. 36 | y Y坐标. 37 | cx 宽度. 38 | cy 高度. 39 | hParent 父对象句柄. 40 | 返回: 41 | 返回句柄. 42 | */ 43 | func XShapeRect_Create(x, y, cx, cy int, hParent HXCGUI) HXCGUI { 44 | ret, _, _ := xShapeRect_Create.Call( 45 | uintptr(x), 46 | uintptr(y), 47 | uintptr(cx), 48 | uintptr(cy), 49 | uintptr(hParent)) 50 | 51 | return HXCGUI(ret) 52 | } 53 | 54 | /* 55 | 设置边框颜色. 56 | 57 | 参数: 58 | hShape 形状对象句柄. 59 | color RGB颜色值. 60 | alpha 透明度. 61 | */ 62 | func XShapeRect_SetBorderColor(hShape HXCGUI, color COLORREF, alpha byte) { 63 | xShapeRect_SetBorderColor.Call( 64 | uintptr(hShape), 65 | uintptr(color), 66 | uintptr(alpha)) 67 | } 68 | 69 | /* 70 | 设置填充颜色. 71 | 72 | 参数: 73 | hShape 形状对象句柄. 74 | color RGB颜色值. 75 | alpha 透明度. 76 | */ 77 | func XShapeRect_SetFillColor(hShape HXCGUI, color COLORREF, alpha byte) { 78 | xShapeRect_SetFillColor.Call( 79 | uintptr(hShape), 80 | uintptr(color), 81 | uintptr(alpha)) 82 | } 83 | 84 | /* 85 | 设置圆角大小. 86 | 87 | 参数: 88 | hShape 形状对象句柄. 89 | nWidth 圆角宽度. 90 | nHeight 圆角高度. 91 | 返回: 92 | 成功返回TRUE否则返回FALSE. 93 | */ 94 | func XShapeRect_SetRoundAngle(hShape HXCGUI, nWidth, nHeight int) { 95 | xShapeRect_SetRoundAngle.Call( 96 | uintptr(hShape), 97 | uintptr(nWidth), 98 | uintptr(nHeight)) 99 | } 100 | 101 | /* 102 | 获取圆角大小. 103 | 104 | 参数: 105 | hShape 形状对象句柄. 106 | pWidth 圆角宽度. 107 | pHeight 圆角高度. 108 | */ 109 | func XShapeRect_GetRoundAngle(hShape HXCGUI, pWidth, pHeight *int) { 110 | xShapeRect_GetRoundAngle.Call( 111 | uintptr(hShape), 112 | uintptr(unsafe.Pointer(pWidth)), 113 | uintptr(unsafe.Pointer(pHeight))) 114 | } 115 | 116 | /* 117 | 启用绘制矩形边框. 118 | 119 | 参数: 120 | hShape 形状对象句柄. 121 | bEnable 是否启用. 122 | */ 123 | func XShapeRect_EnableBorder(hShape HXCGUI, bEnable bool) { 124 | xShapeRect_EnableBorder.Call( 125 | uintptr(hShape), 126 | uintptr(BoolToBOOL(bEnable))) 127 | } 128 | 129 | /* 130 | 启用填充矩形. 131 | 132 | 参数: 133 | hShape 形状对象句柄. 134 | bEnable 是否启用. 135 | */ 136 | func XShapeRect_EnableFill(hShape HXCGUI, bEnable bool) { 137 | xShapeRect_EnableFill.Call( 138 | uintptr(hShape), 139 | uintptr(BoolToBOOL(bEnable))) 140 | } 141 | 142 | /* 143 | 启用圆角. 144 | 145 | 参数: 146 | hShape 形状对象句柄. 147 | bEnable 是否启用. 148 | */ 149 | func XShapeRect_EnableRoundAngle(hShape HXCGUI, bEnable bool) { 150 | xShapeRect_EnableRoundAngle.Call( 151 | uintptr(hShape), 152 | uintptr(BoolToBOOL(bEnable))) 153 | } 154 | -------------------------------------------------------------------------------- /xc/sliderBar.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | var ( 8 | xSliderBar_Create *syscall.Proc 9 | xSliderBar_SetRange *syscall.Proc 10 | xSliderBar_GetRange *syscall.Proc 11 | xSliderBar_SetImageLoad *syscall.Proc 12 | xSliderBar_SetButtonWidth *syscall.Proc 13 | xSliderBar_SetButtonHeight *syscall.Proc 14 | xSliderBar_SetSpaceTwo *syscall.Proc 15 | xSliderBar_SetPos *syscall.Proc 16 | xSliderBar_GetPos *syscall.Proc 17 | xSliderBar_GetButton *syscall.Proc 18 | xSliderBar_SetHorizon *syscall.Proc 19 | ) 20 | 21 | func init() { 22 | xSliderBar_Create = xcDLL.MustFindProc("XSliderBar_Create") 23 | xSliderBar_SetRange = xcDLL.MustFindProc("XSliderBar_SetRange") 24 | xSliderBar_GetRange = xcDLL.MustFindProc("XSliderBar_GetRange") 25 | xSliderBar_SetImageLoad = xcDLL.MustFindProc("XSliderBar_SetImageLoad") 26 | xSliderBar_SetButtonWidth = xcDLL.MustFindProc("XSliderBar_SetButtonWidth") 27 | xSliderBar_SetButtonHeight = xcDLL.MustFindProc("XSliderBar_SetButtonHeight") 28 | xSliderBar_SetSpaceTwo = xcDLL.MustFindProc("XSliderBar_SetSpaceTwo") 29 | xSliderBar_SetPos = xcDLL.MustFindProc("XSliderBar_SetPos") 30 | xSliderBar_GetPos = xcDLL.MustFindProc("XSliderBar_GetPos") 31 | xSliderBar_GetButton = xcDLL.MustFindProc("XSliderBar_GetButton") 32 | xSliderBar_SetHorizon = xcDLL.MustFindProc("XSliderBar_SetHorizon") 33 | } 34 | 35 | /* 36 | 创建滑动条元素. 37 | 38 | 参数: 39 | x 元素x坐标. 40 | y 元素y坐标. 41 | cx 宽度. 42 | cy 高度. 43 | hParent 父是窗口资源句柄或UI元素资源句柄.如果是窗口资源句柄将被添加到窗口, 如果是元素资源句柄将被添加到元素. 44 | 返回: 45 | 元素句柄. 46 | */ 47 | func XSliderBar_Create(x, y, cx, cy int, hParent HXCGUI) HELE { 48 | ret, _, _ := xSliderBar_Create.Call( 49 | uintptr(x), 50 | uintptr(y), 51 | uintptr(cx), 52 | uintptr(cy), 53 | uintptr(hParent)) 54 | 55 | return HELE(ret) 56 | } 57 | 58 | /* 59 | 设置滑动范围. 60 | 61 | 参数: 62 | hEle 元素句柄. 63 | range 范围. 64 | */ 65 | func XSliderBar_SetRange(hEle HELE, irange int) { 66 | xSliderBar_SetRange.Call( 67 | uintptr(hEle), 68 | uintptr(irange)) 69 | } 70 | 71 | /* 72 | 获取滚动范围. 73 | 74 | 参数: 75 | hEle 元素句柄. 76 | 返回: 77 | 返回滚动范围. 78 | */ 79 | func XSliderBar_GetRange(hEle HELE) int { 80 | ret, _, _ := xSliderBar_GetRange.Call(uintptr(hEle)) 81 | 82 | return int(ret) 83 | } 84 | 85 | /* 86 | 设置进度贴图. 87 | 88 | 参数: 89 | hEle 元素句柄. 90 | hImage 图片句柄. 91 | */ 92 | func XSliderBar_SetImageLoad(hEle HELE, hImage HIMAGE) { 93 | xSliderBar_SetImageLoad.Call( 94 | uintptr(hEle), 95 | uintptr(hImage)) 96 | } 97 | 98 | /* 99 | 设置滑块按钮宽度. 100 | 101 | 参数: 102 | hEle 元素句柄. 103 | width 宽度. 104 | */ 105 | func XSliderBar_SetButtonWidth(hEle HELE, width int) { 106 | xSliderBar_SetButtonWidth.Call( 107 | uintptr(hEle), 108 | uintptr(width)) 109 | } 110 | 111 | /* 112 | 设置滑块按钮高度. 113 | 114 | 参数: 115 | hEle 元素句柄. 116 | height 高度. 117 | */ 118 | func XSliderBar_SetButtonHeight(hEle HELE, height int) { 119 | xSliderBar_SetButtonHeight.Call( 120 | uintptr(hEle), 121 | uintptr(height)) 122 | } 123 | 124 | /* 125 | 设置两端间隔大小. 126 | 127 | 参数: 128 | hEle 元素句柄. 129 | leftSize 左边间隔大小. 130 | rightSize 右边间隔大小. 131 | */ 132 | func XSliderBar_SetSpaceTwo(hEle HELE, leftSize, rightSize int) { 133 | xSliderBar_SetSpaceTwo.Call( 134 | uintptr(hEle), 135 | uintptr(leftSize), 136 | uintptr(rightSize)) 137 | 138 | } 139 | 140 | /* 141 | 设置当前进度点. 142 | 143 | 参数: 144 | hEle 元素句柄. 145 | pos 进度点. 146 | */ 147 | func XSliderBar_SetPos(hEle HELE, pos int) { 148 | xSliderBar_SetPos.Call( 149 | uintptr(hEle), 150 | uintptr(pos)) 151 | } 152 | 153 | /* 154 | 获取当前进度点. 155 | 156 | 参数: 157 | hEle 元素句柄. 158 | 返回: 159 | 返回当前进度点. 160 | */ 161 | func XSliderBar_GetPos(hEle HELE) int { 162 | ret, _, _ := xSliderBar_GetPos.Call(uintptr(hEle)) 163 | 164 | return int(ret) 165 | } 166 | 167 | /* 168 | 获取滑块按钮. 169 | 170 | 参数: 171 | hEle 元素句柄. 172 | 返回: 173 | 按钮句柄. 174 | */ 175 | func XSliderBar_GetButton(hEle HELE) HELE { 176 | ret, _, _ := xSliderBar_GetButton.Call(uintptr(hEle)) 177 | 178 | return HELE(ret) 179 | } 180 | 181 | /* 182 | 设置水平或垂直. 183 | 184 | 参数: 185 | hEle 元素句柄. 186 | bHorizon 水平或垂直. 187 | */ 188 | func XSliderBar_SetHorizon(hEle HELE, bHorizon bool) { 189 | xSliderBar_SetHorizon.Call( 190 | uintptr(hEle), 191 | uintptr(BoolToBOOL(bHorizon))) 192 | } 193 | -------------------------------------------------------------------------------- /xc/textLink.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | // "unsafe" 6 | ) 7 | 8 | var ( 9 | xTextLink_Create *syscall.Proc 10 | xTextLink_EnableUnderlineLeave *syscall.Proc 11 | xTextLink_EnableUnderlineStay *syscall.Proc 12 | xTextLink_SetTextColorStay *syscall.Proc 13 | xTextLink_SetUnderlineColorLeave *syscall.Proc 14 | xTextLink_SetUnderlineColorStay *syscall.Proc 15 | ) 16 | 17 | func init() { 18 | xTextLink_Create = xcDLL.MustFindProc("XTextLink_Create") 19 | xTextLink_EnableUnderlineLeave = xcDLL.MustFindProc("XTextLink_EnableUnderlineLeave") 20 | xTextLink_EnableUnderlineStay = xcDLL.MustFindProc("XTextLink_EnableUnderlineStay") 21 | xTextLink_SetTextColorStay = xcDLL.MustFindProc("XTextLink_SetTextColorStay") 22 | xTextLink_SetUnderlineColorLeave = xcDLL.MustFindProc("XTextLink_SetUnderlineColorLeave") 23 | xTextLink_SetUnderlineColorStay = xcDLL.MustFindProc("XTextLink_SetUnderlineColorStay") 24 | } 25 | 26 | /* 27 | 创建静态文本连接元素. 28 | 29 | 参数: 30 | x 元素x坐标. 31 | y 元素y坐标. 32 | cx 宽度. 33 | cy 高度. 34 | pName 文本内容.*uint16 35 | hParent 父是窗口资源句柄或UI元素资源句柄.如果是窗口资源句柄将被添加到窗口, 如果是元素资源句柄将被添加到元素. 36 | 返回: 37 | 元素句柄. 38 | */ 39 | func XTextLink_Create(x, y, cx, cy int, pName string, hParent HXCGUI) HELE { 40 | ret, _, _ := xTextLink_Create.Call( 41 | uintptr(x), 42 | uintptr(y), 43 | uintptr(cx), 44 | uintptr(cy), 45 | StringToUintPtr(pName), 46 | // uintptr(unsafe.Pointer(pName)), 47 | uintptr(hParent)) 48 | 49 | return HELE(ret) 50 | } 51 | 52 | /* 53 | 启用下划线,鼠标离开状态. 54 | 55 | 参数: 56 | hEle 元素句柄. 57 | bEnable 是否启用. 58 | */ 59 | func XTextLink_EnableUnderlineLeave(hEle HELE, bEnable bool) { 60 | xTextLink_EnableUnderlineLeave.Call( 61 | uintptr(hEle), 62 | uintptr(BoolToBOOL(bEnable))) 63 | } 64 | 65 | /* 66 | 启用下划线,鼠标停留状态. 67 | 68 | 参数: 69 | hEle 元素句柄. 70 | bEnable 是否启用. 71 | */ 72 | func XTextLink_EnableUnderlineStay(hEle HELE, bEnable bool) { 73 | xTextLink_EnableUnderlineStay.Call( 74 | uintptr(hEle), 75 | uintptr(BoolToBOOL(bEnable))) 76 | } 77 | 78 | /* 79 | 设置文本颜色,鼠标停留状态. 80 | 81 | 参数: 82 | hEle 元素句柄. 83 | color RGB颜色值. 84 | alpha 透明度. 85 | */ 86 | func XTextLink_SetTextColorStay(hEle HELE, color COLORREF, alpha byte) { 87 | xTextLink_SetTextColorStay.Call( 88 | uintptr(hEle), 89 | uintptr(color), 90 | uintptr(alpha)) 91 | 92 | } 93 | 94 | /* 95 | 设置下划线颜色,鼠标离开状态. 96 | 97 | 参数: 98 | hEle 元素句柄. 99 | color RGB颜色值. 100 | alpha 透明度. 101 | */ 102 | func XTextLink_SetUnderlineColorLeave(hEle HELE, color COLORREF, alpha byte) { 103 | xTextLink_SetUnderlineColorLeave.Call( 104 | uintptr(hEle), 105 | uintptr(color), 106 | uintptr(alpha)) 107 | } 108 | 109 | /* 110 | 设置下划线颜色,鼠标停留状态. 111 | 112 | 参数: 113 | hEle 元素句柄. 114 | color RGB颜色值. 115 | alpha 透明度. 116 | */ 117 | func XTextLink_SetUnderlineColorStay(hEle HELE, color COLORREF, alpha byte) { 118 | xTextLink_SetUnderlineColorStay.Call( 119 | uintptr(hEle), 120 | uintptr(color), 121 | uintptr(alpha)) 122 | } 123 | -------------------------------------------------------------------------------- /xc/user32.go: -------------------------------------------------------------------------------- 1 | package xc 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | // MessageBox constants 9 | const ( 10 | MB_OK = 0x00000000 11 | MB_OKCANCEL = 0x00000001 12 | MB_ABORTRETRYIGNORE = 0x00000002 13 | MB_YESNOCANCEL = 0x00000003 14 | MB_YESNO = 0x00000004 15 | MB_RETRYCANCEL = 0x00000005 16 | MB_CANCELTRYCONTINUE = 0x00000006 17 | MB_ICONHAND = 0x00000010 18 | MB_ICONQUESTION = 0x00000020 19 | MB_ICONEXCLAMATION = 0x00000030 20 | MB_ICONASTERISK = 0x00000040 21 | MB_USERICON = 0x00000080 22 | MB_ICONWARNING = MB_ICONEXCLAMATION 23 | MB_ICONERROR = MB_ICONHAND 24 | MB_ICONINFORMATION = MB_ICONASTERISK 25 | MB_ICONSTOP = MB_ICONHAND 26 | MB_DEFBUTTON1 = 0x00000000 27 | MB_DEFBUTTON2 = 0x00000100 28 | MB_DEFBUTTON3 = 0x00000200 29 | MB_DEFBUTTON4 = 0x00000300 30 | ) 31 | 32 | type MSG struct { 33 | HWnd HWND 34 | Message uint32 35 | WParam uintptr 36 | LParam uintptr 37 | Time uint32 38 | Pt POINT 39 | } 40 | 41 | var ( 42 | user32 *syscall.DLL 43 | ) 44 | 45 | var ( 46 | // Functions 47 | clientToScreen *syscall.Proc 48 | messageBox *syscall.Proc 49 | sendMessage *syscall.Proc 50 | getMessage *syscall.Proc 51 | translateMessage *syscall.Proc 52 | dispatchMessage *syscall.Proc 53 | getCursorPos *syscall.Proc 54 | setForegroundWindow *syscall.Proc 55 | ) 56 | 57 | func init() { 58 | user32 = syscall.MustLoadDLL("User32.dll") 59 | 60 | clientToScreen = user32.MustFindProc("ClientToScreen") 61 | messageBox = user32.MustFindProc("MessageBoxW") 62 | sendMessage = user32.MustFindProc("SendMessageW") 63 | getMessage = user32.MustFindProc("GetMessageW") 64 | translateMessage = user32.MustFindProc("TranslateMessage") 65 | dispatchMessage = user32.MustFindProc("DispatchMessageW") 66 | getCursorPos = user32.MustFindProc("GetCursorPos") 67 | setForegroundWindow = user32.MustFindProc("SetForegroundWindow") 68 | } 69 | 70 | func ClientToScreen(hwnd HWND, lpPoint *POINT) bool { 71 | ret, _, _ := clientToScreen.Call( 72 | uintptr(hwnd), 73 | uintptr(unsafe.Pointer(lpPoint))) 74 | 75 | return ret != 0 76 | } 77 | 78 | func MessageBox(hWnd HWND, lpCaption, lpText string, uType uint32) int32 { 79 | ret, _, _ := messageBox.Call( 80 | uintptr(hWnd), 81 | StringToUintPtr(lpText), 82 | StringToUintPtr(lpCaption), 83 | uintptr(uType)) 84 | 85 | return int32(ret) 86 | } 87 | 88 | func SendMessage(hWnd HWND, msg uint32, wParam, lParam uintptr) uintptr { 89 | ret, _, _ := sendMessage.Call( 90 | uintptr(hWnd), 91 | uintptr(msg), 92 | wParam, 93 | lParam, 94 | ) 95 | 96 | return ret 97 | } 98 | 99 | func GetMessage(msg *MSG, hWnd HWND, msgFilterMin, msgFilterMax uint32) BOOL { 100 | ret, _, _ := getMessage.Call( 101 | uintptr(unsafe.Pointer(msg)), 102 | uintptr(hWnd), 103 | uintptr(msgFilterMin), 104 | uintptr(msgFilterMax)) 105 | 106 | return BOOL(ret) 107 | } 108 | 109 | func TranslateMessage(msg *MSG) bool { 110 | ret, _, _ := translateMessage.Call(uintptr(unsafe.Pointer(msg))) 111 | 112 | return ret != 0 113 | } 114 | 115 | func DispatchMessage(msg *MSG) uintptr { 116 | ret, _, _ := dispatchMessage.Call( 117 | uintptr(unsafe.Pointer(msg))) 118 | 119 | return ret 120 | } 121 | 122 | func GetCursorPos(lpPoint *POINT) bool { 123 | ret, _, _ := getCursorPos.Call(uintptr(unsafe.Pointer(lpPoint))) 124 | 125 | return ret != 0 126 | } 127 | 128 | func SetForegroundWindow(hWnd HWND) bool { 129 | ret, _, _ := setForegroundWindow.Call(uintptr(hWnd)) 130 | 131 | return ret != 0 132 | } 133 | -------------------------------------------------------------------------------- /xc/xc.go: -------------------------------------------------------------------------------- 1 | // 炫彩界面库,用的免费版dll。 2 | // 3 | // 有钱的朋友可以去官方网站购买正式版,支持正版将有更多功能。 4 | // 5 | // 官方网站:http://www.xcgui.com 6 | package xc 7 | --------------------------------------------------------------------------------