From e96d5cf391cf5eac28b4c552862c9dfc663322d6 Mon Sep 17 00:00:00 2001 From: twgh Date: Fri, 3 May 2024 20:40:00 +0800 Subject: [PATCH] update --- README-en.md | 13 +- README.md | 17 +- adapter/adapter.go | 18 +- adapter/adapterlistview.go | 96 ++++---- adapter/adaptermap.go | 2 +- adapter/adaptertable.go | 143 +++++------ adapter/adaptertree.go | 44 ++-- adapter/deprecated.go | 89 +++++++ ani/anima.go | 36 +-- ani/anima_base.go | 22 +- ani/anima_group.go | 7 +- ani/anima_item.go | 20 +- ani/anima_rotate.go | 5 +- ani/anima_scale.go | 5 +- app/app.go | 159 +++++++----- bkmanager/bkmanager.go | 67 +++--- bkmanager/deprecated.go | 12 + bkobj/bkobj.go | 97 ++++---- drawx/draw.go | 478 ++++++++++++++++++++++--------------- font/font.go | 54 +++-- imagex/image.go | 36 ++- objectbase/objectbase.go | 10 +- objectbase/ui.go | 28 ++- objectbase/widget.go | 85 ++++--- res/resource.go | 10 +- svg/svg.go | 56 +++-- tmpl/node.go | 3 +- wapi/wutil/common_test.go | 2 +- widget/button.go | 78 +++--- widget/combobox.go | 67 +++--- widget/datetime.go | 42 ++-- widget/deprecated.go | 194 +++++++++++++++ widget/edit.go | 252 +++++++++++-------- widget/element.go | 381 +++++++++++++++++++---------- widget/layoutele.go | 54 +++-- widget/layoutframe.go | 45 ++-- widget/list.go | 355 +++++++++++++++------------ widget/listbox.go | 223 ++++++++++------- widget/listview.go | 129 ++++++---- widget/menu.go | 41 ++-- widget/menubar.go | 3 +- widget/monthcal.go | 36 +-- widget/pane.go | 57 +++-- widget/progressbar.go | 22 +- widget/scrollbar.go | 25 +- widget/scrollview.go | 35 +-- widget/shape.go | 75 +++--- widget/shapeellipse.go | 24 +- widget/shapegif.go | 5 +- widget/shapegroupbox.go | 49 ++-- widget/shapeline.go | 12 +- widget/shapepicture.go | 5 +- widget/shaperect.go | 39 +-- widget/shapetext.go | 27 ++- widget/sliderbar.go | 30 ++- widget/tabbar.go | 60 +++-- widget/table.go | 80 ++++--- widget/textlink.go | 33 +-- widget/toolbar.go | 24 +- widget/tree.go | 74 ++++-- window/framewindow.go | 42 +++- window/modalwindow.go | 15 +- window/windowbase.go | 421 +++++++++++++++++++++----------- xc/adapter.go | 22 +- xc/adapterlistview.go | 118 +++++---- xc/adaptermap.go | 4 +- xc/adaptertable.go | 171 +++++++------ xc/adaptertree.go | 60 +++-- xc/animation.go | 116 ++++----- xc/bkmanager.go | 76 +++--- xc/bkobj.go | 91 +++---- xc/button.go | 9 + xc/combobox.go | 4 +- xc/common.go | 142 +++++------ xc/common_test.go | 18 ++ xc/datetime.go | 2 +- xc/deprecated.go | 317 ++++++++++++++++++++++++ xc/draw.go | 478 +++++++++++++++---------------------- xc/edit.go | 30 ++- xc/element.go | 17 +- xc/{fontx.go => font.go} | 45 ++-- xc/framewindow.go | 17 +- xc/globalapi.go | 132 +++++----- xc/image.go | 4 +- xc/list.go | 221 +++++++++-------- xc/listbox.go | 261 ++++++++++---------- xc/listview.go | 2 +- xc/menu.go | 2 +- xc/monthcal.go | 14 +- xc/objectbase.go | 4 +- xc/progressbar.go | 2 +- xc/resource.go | 17 +- xc/shapeellipse.go | 4 +- xc/shapegroupbox.go | 4 +- xc/shapeline.go | 2 +- xc/shaperect.go | 4 +- xc/shapetext.go | 2 +- xc/textlink.go | 6 +- xc/toolbar.go | 2 +- xc/tree.go | 6 +- xc/ui.go | 16 +- xc/window.go | 33 ++- xc/xcgui.go | 442 ++++++++++++++++++---------------- xc/xcgui_test.go | 43 ---- xc/xcstruct.go | 16 +- xcc/xcconst.go | 10 +- 106 files changed, 4577 insertions(+), 3077 deletions(-) create mode 100644 adapter/deprecated.go create mode 100644 bkmanager/deprecated.go create mode 100644 widget/deprecated.go create mode 100644 xc/deprecated.go rename xc/{fontx.go => font.go} (80%) diff --git a/README-en.md b/README-en.md index b8165a2..d61bc75 100644 --- a/README-en.md +++ b/README-en.md @@ -1,7 +1,7 @@

XCGUI

- release - XCGUI + release + XCGUI golang GoDoc License @@ -19,6 +19,7 @@ + ## Introduction English | [简体中文](./README.md) @@ -28,7 +29,7 @@ English | [简体中文](./README.md) - DirectUI design idea: there is no sub-window in the window, the interface elements are all logical areas (no HWND handle, safe, flexible), all UI elements are developed independently (not restricted by the system), more flexible to achieve various Program interface to meet the needs of different users. - Has a free UI designer tool: rapid development tools, what you see is what you get, a highly customizable system (DIY), making UI development easier. - Support Direct2D, hardware acceleration, can make full use of hardware features to create high-performance, high-quality 2D graphics. -- [wiki](https://github.com/twgh/xcgui/wiki) There is a simple introductory tutorial, you can take a look when you have time. +- [WIKI](https://github.com/twgh/xcgui/wiki) There is a simple introductory tutorial, you can take a look when you have time. ## Get @@ -98,13 +99,13 @@ It is best to put it in the `C:\Windows\System32` directory during development, 64bit ```bash -curl -fL "https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui.dll?version=latest" -o xcgui.dll +iwr https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui.dll?version=latest -OutFile xcgui.dll ``` 32bit ```bash -curl -fL "https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui-32.dll?version=latest" -o xcgui.dll +iwr https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui-32.dll?version=latest -OutFile xcgui.dll ``` #### (3)Download using the getxcgui tool @@ -196,7 +197,7 @@ In some cases, it is more convenient to mix the native functions in the xc packa All the structures of xcgui are also in the xc package. - [Goland](https://www.jetbrains.com/go/?from=xcgui) is recommended for development for the best development experience. The comment format I'm using looks the best in Goland. + [Goland](https://www.jetbrains.com/go/?from=xcgui) is recommended for development for the best development experience. ## Event diff --git a/README.md b/README.md index 1ddd2da..c0185d2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

XCGUI

- release - XCGUI + release + XCGUI golang GoDoc License @@ -20,6 +20,7 @@ + ## 介绍 [English](./README-en.md) | 简体中文 @@ -29,7 +30,7 @@ - DirectUI设计思想:在窗口内没有子窗口,界面元素都是逻辑上的区域(无HWND句柄,安全,灵活),所有UI元素都是自主开发(不受系统限制),更加灵活的实现各种程序界面,满足不同用户的需求。 - 拥有免费的UI设计器:快速开发工具,所见即所得,高度自定义系统(DIY),让UI开发变的更加简单。 - 支持Direct2D,硬件加速,能更大程度的发挥硬件特性,创建高性能,高质量的2D图形。 -- [wiki](https://github.com/twgh/xcgui/wiki) 里有简单的入门教程,有空可以看一下,少走弯路。 +- [WIKI](https://github.com/twgh/xcgui/wiki) 里有简单的入门教程,有空可以看一下,少走弯路。 - 有完善的 [中文官方文档](http://www.xcgui.com/doc-ui/),[官方资源社区](http://mall.xcgui.com)。 - 官方QQ群(人多用各种语言的都有):[2283812](https://jq.qq.com/?_wv=1027&k=AiXY4uMc),只聊Go语言版的QQ群:[793788011](https://jq.qq.com/?_wv=1027&k=bkKgsYYk) @@ -101,13 +102,13 @@ func main() { 64位 ```bash -curl -fL "https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui.dll?version=latest" -o xcgui.dll +iwr https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui.dll?version=latest -OutFile xcgui.dll ``` 32位 ```bash -curl -fL "https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui-32.dll?version=latest" -o xcgui.dll +iwr https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui-32.dll?version=latest -OutFile xcgui.dll ``` #### (3)使用getxcgui工具下载 @@ -191,19 +192,19 @@ var svgIcon = `终点->起点. -func (a *Anima) Move(duration int, x float32, y float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { +func (a *Anima) Move(duration uint32, x float32, y float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { p := &AnimaItem{} p.SetHandle(xc.XAnima_Move(a.Handle, duration, x, y, nLoopCount, ease_flag, bGoBack)) return p @@ -57,7 +57,7 @@ func (a *Anima) Move(duration int, x float32, y float32, nLoopCount int, ease_fl // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func (a *Anima) MoveEx(duration int, from_x float32, from_y float32, to_x float32, to_y float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { +func (a *Anima) MoveEx(duration uint32, from_x float32, from_y float32, to_x float32, to_y float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { p := &AnimaItem{} p.SetHandle(xc.XAnima_MoveEx(a.Handle, duration, from_x, from_y, to_x, to_y, nLoopCount, ease_flag, bGoBack)) return p @@ -74,7 +74,7 @@ func (a *Anima) MoveEx(duration int, from_x float32, from_y float32, to_x float3 // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func (a *Anima) Rotate(duration int, angle float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaRotate { +func (a *Anima) Rotate(duration uint32, angle float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaRotate { p := &AnimaRotate{} p.SetHandle(xc.XAnima_Rotate(a.Handle, duration, angle, nLoopCount, ease_flag, bGoBack)) return p @@ -93,7 +93,7 @@ func (a *Anima) Rotate(duration int, angle float32, nLoopCount int, ease_flag xc // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func (a *Anima) RotateEx(duration int, from float32, to float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaRotate { +func (a *Anima) RotateEx(duration uint32, from float32, to float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaRotate { p := &AnimaRotate{} p.SetHandle(xc.XAnima_RotateEx(a.Handle, duration, from, to, nLoopCount, ease_flag, bGoBack)) return p @@ -112,7 +112,7 @@ func (a *Anima) RotateEx(duration int, from float32, to float32, nLoopCount int, // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func (a *Anima) Scale(duration int, scaleX float32, scaleY float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaScale { +func (a *Anima) Scale(duration uint32, scaleX float32, scaleY float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaScale { p := &AnimaScale{} p.SetHandle(xc.XAnima_Scale(a.Handle, duration, scaleX, scaleY, nLoopCount, ease_flag, bGoBack)) return p @@ -131,7 +131,7 @@ func (a *Anima) Scale(duration int, scaleX float32, scaleY float32, nLoopCount i // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func (a *Anima) ScaleSize(duration int, width float32, height float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaScale { +func (a *Anima) ScaleSize(duration uint32, width float32, height float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaScale { p := &AnimaScale{} p.SetHandle(xc.XAnima_ScaleSize(a.Handle, duration, width, height, nLoopCount, ease_flag, bGoBack)) return p @@ -148,7 +148,7 @@ func (a *Anima) ScaleSize(duration int, width float32, height float32, nLoopCoun // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func (a *Anima) Alpha(duration int, alpha uint8, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { +func (a *Anima) Alpha(duration uint32, alpha uint8, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { p := &AnimaItem{} p.SetHandle(xc.XAnima_Alpha(a.Handle, duration, alpha, nLoopCount, ease_flag, bGoBack)) return p @@ -167,7 +167,7 @@ func (a *Anima) Alpha(duration int, alpha uint8, nLoopCount int, ease_flag xcc.E // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func (a *Anima) AlphaEx(duration int, from_alpha uint8, to_alpha uint8, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { +func (a *Anima) AlphaEx(duration uint32, from_alpha uint8, to_alpha uint8, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { p := &AnimaItem{} p.SetHandle(xc.XAnima_AlphaEx(a.Handle, duration, from_alpha, to_alpha, nLoopCount, ease_flag, bGoBack)) return p @@ -177,14 +177,14 @@ func (a *Anima) AlphaEx(duration int, from_alpha uint8, to_alpha uint8, nLoopCou // // duration: 持续时间. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // nLoopCount: 动画循环次数, 0: 无限循环. // // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func (a *Anima) Color(duration int, color int, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { +func (a *Anima) Color(duration uint32, color int, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { p := &AnimaItem{} p.SetHandle(xc.XAnima_Color(a.Handle, duration, color, nLoopCount, ease_flag, bGoBack)) return p @@ -194,16 +194,16 @@ func (a *Anima) Color(duration int, color int, nLoopCount int, ease_flag xcc.Eas // // duration: 持续时间. // -// from: 起点颜色, ABGR 颜色. +// from: 起点颜色, ARGB 颜色. // -// to: 终点颜色, ABGR 颜色. +// to: 终点颜色, ARGB 颜色. // // nLoopCount: 动画循环次数, 0: 无限循环. // // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func (a *Anima) ColorEx(duration int, from int, to int, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { +func (a *Anima) ColorEx(duration uint32, from int, to int, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { p := &AnimaItem{} p.SetHandle(xc.XAnima_ColorEx(a.Handle, duration, from, to, nLoopCount, ease_flag, bGoBack)) return p @@ -222,7 +222,7 @@ func (a *Anima) ColorEx(duration int, from int, to int, nLoopCount int, ease_fla // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func (a *Anima) LayoutWidth(duration int, nType xcc.Layout_Size_, width float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { +func (a *Anima) LayoutWidth(duration uint32, nType xcc.Layout_Size_, width float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { p := &AnimaItem{} p.SetHandle(xc.XAnima_LayoutWidth(a.Handle, duration, nType, width, nLoopCount, ease_flag, bGoBack)) return p @@ -241,7 +241,7 @@ func (a *Anima) LayoutWidth(duration int, nType xcc.Layout_Size_, width float32, // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func (a *Anima) LayoutHeight(duration int, nType xcc.Layout_Size_, height float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { +func (a *Anima) LayoutHeight(duration uint32, nType xcc.Layout_Size_, height float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { p := &AnimaItem{} p.SetHandle(xc.XAnima_LayoutHeight(a.Handle, duration, nType, height, nLoopCount, ease_flag, bGoBack)) return p @@ -264,7 +264,7 @@ func (a *Anima) LayoutHeight(duration int, nType xcc.Layout_Size_, height float3 // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func (a *Anima) LayoutSize(duration int, nWidthType xcc.Layout_Size_, width float32, nHeightType xcc.Layout_Size_, height float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { +func (a *Anima) LayoutSize(duration uint32, nWidthType xcc.Layout_Size_, width float32, nHeightType xcc.Layout_Size_, height float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem { p := &AnimaItem{} p.SetHandle(xc.XAnima_LayoutSize(a.Handle, duration, nWidthType, width, nHeightType, height, nLoopCount, ease_flag, bGoBack)) return p @@ -308,6 +308,6 @@ func (a *Anima) DestroyObjectUI(duration float32) *AnimaItem { // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func (a *Anima) DelayEx(duration float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func (a *Anima) DelayEx(duration float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { return xc.XAnima_DelayEx(a.Handle, duration, nLoopCount, ease_flag, bGoBack) } diff --git a/ani/anima_base.go b/ani/anima_base.go index 9def1fa..4a5fcda 100644 --- a/ani/anima_base.go +++ b/ani/anima_base.go @@ -13,8 +13,9 @@ type animaBase struct { // 动画_运行, 并且增加引用计数. // // hRedrawObjectUI: 当更新UI时重绘的UI层. UI对象句柄: 窗口句柄, 元素句柄, 形状句柄, SVG句柄. -func (a *animaBase) Run(hRedrawObjectUI int) int { - return xc.XAnima_Run(a.Handle, hRedrawObjectUI) +func (a *animaBase) Run(hRedrawObjectUI int) *animaBase { + xc.XAnima_Run(a.Handle, hRedrawObjectUI) + return a } // 动画_释放, 停止动画, 并释放引用, 当引用计数为0时自动销毁. @@ -27,7 +28,7 @@ func (a *animaBase) Release(bEnd bool) bool { // 动画_释放扩展, 释放与指定UI对象关联的所有动画, 返回释放动画数量. // // bEnd: 是否立即执行到终点. -func (a *animaBase) ReleaseEx(bEnd bool) int { +func (a *animaBase) ReleaseEx(bEnd bool) int32 { return xc.XAnima_ReleaseEx(a.Handle, bEnd) } @@ -39,22 +40,25 @@ func (a *animaBase) GetObjectUI() int { // 动画_启用自动销毁, TRUE: 当引用计数为0时自动销毁, FALSE: 手动销毁. // // bEnable: 是否启用. -func (a *animaBase) EnableAutoDestroy(bEnable bool) int { - return xc.XAnima_EnableAutoDestroy(a.Handle, bEnable) +func (a *animaBase) EnableAutoDestroy(bEnable bool) *animaBase { + xc.XAnima_EnableAutoDestroy(a.Handle, bEnable) + return a } // 动画_置回调. // // callback: 回调函数. -func (a *animaBase) SetCallBack(callback interface{}) int { - return xc.XAnima_SetCallBack(a.Handle, callback) +func (a *animaBase) SetCallBack(callback xc.FunAnimation) *animaBase { + xc.XAnima_SetCallBack(a.Handle, callback) + return a } // 动画_置用户数据. // // nUserData: 用户数据. -func (a *animaBase) SetUserData(nUserData int) int { - return xc.XAnima_SetUserData(a.Handle, nUserData) +func (a *animaBase) SetUserData(nUserData int) *animaBase { + xc.XAnima_SetUserData(a.Handle, nUserData) + return a } // 动画_取用户数据, 返回用户数据. diff --git a/ani/anima_group.go b/ani/anima_group.go index 218507a..408ad8d 100644 --- a/ani/anima_group.go +++ b/ani/anima_group.go @@ -14,7 +14,7 @@ type AnimaGroup struct { // 当遇到无限循环项时, 直至其他序列完成后终止循环, 避免出现无法到达终点, 无法返回头部进行同步, 返回动画组句柄. // // nLoopCount: 动画循环次数, 0: 无限循环. -func NewAnimaGroup(nLoopCount int) *AnimaGroup { +func NewAnimaGroup(nLoopCount int32) *AnimaGroup { p := &AnimaGroup{} p.SetHandle(xc.XAnimaGroup_Create(nLoopCount)) return p @@ -23,6 +23,7 @@ func NewAnimaGroup(nLoopCount int) *AnimaGroup { // 动画组_添加项, 将动画序列添加到组中. // // hSequence: 动画序列句柄. -func (a *AnimaGroup) AddItem(hSequence int) int { - return xc.XAnimaGroup_AddItem(a.Handle, hSequence) +func (a *AnimaGroup) AddItem(hSequence int) *AnimaGroup { + xc.XAnimaGroup_AddItem(a.Handle, hSequence) + return a } diff --git a/ani/anima_item.go b/ani/anima_item.go index 7c570a3..1600b0d 100644 --- a/ani/anima_item.go +++ b/ani/anima_item.go @@ -15,22 +15,25 @@ type AnimaItem struct { // 例如对多个动画序列进行渐近式延迟, 在动画序列头标添加延时项(时间差), 当延时项完成时自动释放, 后续动画循环就形成一种时间差(因为对齐的时间差销毁了, 他们永远无法对齐时间). // // bEnable: 是否启用. -func (a *AnimaItem) EnableCompleteRelease(bEnable bool) int { - return xc.XAnimaItem_EnableCompleteRelease(a.Handle, bEnable) +func (a *AnimaItem) EnableCompleteRelease(bEnable bool) *AnimaItem { + xc.XAnimaItem_EnableCompleteRelease(a.Handle, bEnable) + return a } // 动画项_置回调. // // callback: 回调函数. -func (a *AnimaItem) SetCallback(callback interface{}) int { - return xc.XAnimaItem_SetCallback(a.Handle, callback) +func (a *AnimaItem) SetCallback(callback xc.FunAnimationItem) *AnimaItem { + xc.XAnimaItem_SetCallback(a.Handle, callback) + return a } // 动画项_置用户数据. // // nUserData: 用户数据. -func (a *AnimaItem) SetUserData(nUserData int) int { - return xc.XAnimaItem_SetUserData(a.Handle, nUserData) +func (a *AnimaItem) SetUserData(nUserData int) *AnimaItem { + xc.XAnimaItem_SetUserData(a.Handle, nUserData) + return a } // 动画项_取用户数据, 返回用户数据. @@ -41,6 +44,7 @@ func (a *AnimaItem) GetUserData() int { // 动画项_启用自动销毁. // // bEnable: 是否启用. -func (a *AnimaItem) EnableAutoDestroy(bEnable bool) int { - return xc.XAnimaItem_EnableAutoDestroy(a.Handle, bEnable) +func (a *AnimaItem) EnableAutoDestroy(bEnable bool) *AnimaItem { + xc.XAnimaItem_EnableAutoDestroy(a.Handle, bEnable) + return a } diff --git a/ani/anima_rotate.go b/ani/anima_rotate.go index e204246..08a004a 100644 --- a/ani/anima_rotate.go +++ b/ani/anima_rotate.go @@ -17,6 +17,7 @@ type AnimaRotate struct { // y: 坐标Y. // // bOffset: TRUE: 相对于自身中心点偏移, FALSE: 绝对坐标. -func (a *AnimaRotate) SetCenter(x float32, y float32, bOffset bool) bool { - return xc.XAnimaRotate_SetCenter(a.Handle, x, y, bOffset) +func (a *AnimaRotate) SetCenter(x float32, y float32, bOffset bool) *AnimaRotate { + xc.XAnimaRotate_SetCenter(a.Handle, x, y, bOffset) + return a } diff --git a/ani/anima_scale.go b/ani/anima_scale.go index 94b0d60..1a98431 100644 --- a/ani/anima_scale.go +++ b/ani/anima_scale.go @@ -14,6 +14,7 @@ type AnimaScale struct { // 动画缩放_置延伸位置, 设置缩放起点, 确定延伸方向. // // position: 位置, Position_Flag_. -func (a *AnimaScale) SetPosition(position xcc.Position_Flag_) bool { - return xc.XAnimaScale_SetPosition(a.Handle, position) +func (a *AnimaScale) SetPosition(position xcc.Position_Flag_) *AnimaScale { + xc.XAnimaScale_SetPosition(a.Handle, position) + return a } diff --git a/app/app.go b/app/app.go index 023953e..01348b5 100644 --- a/app/app.go +++ b/app/app.go @@ -29,32 +29,32 @@ func New(bD2D bool) *App { } // Run 炫彩_运行. 运行消息循环, 当炫彩窗口数量为0时退出. -// -// @return int -func (a *App) Run() int { - return xc.XRunXCGUI() +func (a *App) Run() *App { + xc.XRunXCGUI() + return a } // Exit 炫彩_退出, 退出界面库释放资源. -// -// @return int -func (a *App) Exit() int { - return xc.XExitXCGUI() +func (a *App) Exit() *App { + xc.XExitXCGUI() + return a } // ShowAndRun 显示窗口并调用炫彩_运行. // // @param hWindow 炫彩窗口句柄. -func (a *App) ShowAndRun(hWindow int) { +func (a *App) ShowAndRun(hWindow int) *App { xc.XWnd_ShowWindow(hWindow, xcc.SW_SHOW) xc.XRunXCGUI() + return a } // DebugToFileInfo 炫彩_输出调试信息到文件, 打印调试信息到文件xcgui_debug.txt. // // @param pInfo 文本. -func (a *App) DebugToFileInfo(pInfo string) { +func (a *App) DebugToFileInfo(pInfo string) *App { xc.XC_DebugToFileInfo(pInfo) + return a } // SetActivateTopWindow 炫彩_激活窗口, 激活当前进程最上层窗口. @@ -295,22 +295,25 @@ func (a *App) GetObjectByName(pName string) int { // 炫彩_置绘制频率, 设置UI的最小重绘频率. // // nMilliseconds: 重绘最小时间间隔, 单位毫秒. -func (a *App) SetPaintFrequency(nMilliseconds int) { +func (a *App) SetPaintFrequency(nMilliseconds int) *App { xc.XC_SetPaintFrequency(nMilliseconds) + return a } // 炫彩_置文本渲染质量, 设置文本渲染质量. // // nType: 参见GDI+ TextRenderingHint 定义. -func (a *App) SetTextRenderingHint(nType int) { +func (a *App) SetTextRenderingHint(nType int) *App { xc.XC_SetTextRenderingHint(nType) + return a } // 炫彩_启用GDI绘制文本, 将影响到以下函数: XDraw_TextOut, XDraw_TextOutEx, XDraw_TextOutA. // // bEnable: 是否启用. -func (a *App) EnableGdiDrawText(bEnable bool) { +func (a *App) EnableGdiDrawText(bEnable bool) *App { xc.XC_EnableGdiDrawText(bEnable) + return a } // 炫彩_判断矩形相交, 判断两个矩形是否相交及重叠. @@ -329,50 +332,57 @@ func (a *App) RectInRect(pRect1 *xc.RECT, pRect2 *xc.RECT) bool { // pSrc1: 源矩形1. // // pSrc2: 源矩形2. -func (a *App) CombineRect(pDest *xc.RECT, pSrc1 *xc.RECT, pSrc2 *xc.RECT) { +func (a *App) CombineRect(pDest *xc.RECT, pSrc1 *xc.RECT, pSrc2 *xc.RECT) *App { xc.XC_CombineRect(pDest, pSrc1, pSrc2) + return a } // 炫彩_显示布局边界, 显示布局对象边界. // // bShow: 是否显示. -func (a *App) ShowLayoutFrame(bShow bool) { +func (a *App) ShowLayoutFrame(bShow bool) *App { xc.XC_ShowLayoutFrame(bShow) + return a } // 炫彩_启用debug文件. // // bEnable: 是否启用. -func (a *App) EnableDebugFile(bEnable bool) { +func (a *App) EnableDebugFile(bEnable bool) *App { xc.XC_EnableDebugFile(bEnable) + return a } // 炫彩_启用资源监视器. // // bEnable: 是否启用. -func (a *App) EnableResMonitor(bEnable bool) { +func (a *App) EnableResMonitor(bEnable bool) *App { xc.XC_EnableResMonitor(bEnable) + return a } // 炫彩_置布局边界颜色. // -// color: ABGR 颜色值. -func (a *App) SetLayoutFrameColor(color int) int { - return xc.XC_SetLayoutFrameColor(color) +// color: ARGB 颜色值. +func (a *App) SetLayoutFrameColor(color int) *App { + xc.XC_SetLayoutFrameColor(color) + return a } // 炫彩_启用错误弹窗, 启用错误弹出, 通过该接口可以设置遇到严重错误时不弹出消息提示框. // // bEnabel: 是否启用. -func (a *App) EnableErrorMessageBox(bEnabel bool) int { - return xc.XC_EnableErrorMessageBox(bEnabel) +func (a *App) EnableErrorMessageBox(bEnabel bool) *App { + xc.XC_EnableErrorMessageBox(bEnabel) + return a } // 炫彩_启用自动退出程序, 启动或禁用自动退出程序, 当检测到所有用户创建的窗口都关闭时, 自动退出程序; 可调用 XC_PostQuitMessage() 手动退出程序. // // bEnabel: 是否启用. -func (a *App) EnableAutoExitApp(bEnabel bool) int { - return xc.XC_EnableAutoExitApp(bEnabel) +func (a *App) EnableAutoExitApp(bEnabel bool) *App { + xc.XC_EnableAutoExitApp(bEnabel) + return a } // 炫彩_取文本绘制大小. @@ -384,8 +394,9 @@ func (a *App) EnableAutoExitApp(bEnabel bool) int { // hFontX: 字体. // // pOutSize: 接收返回大小. -func (a *App) GetTextSize(pString string, length int, hFontX int, pOutSize *xc.SIZE) int { - return xc.XC_GetTextSize(pString, length, hFontX, pOutSize) +func (a *App) GetTextSize(pString string, length int, hFontX int, pOutSize *xc.SIZE) *App { + xc.XC_GetTextSize(pString, length, hFontX, pOutSize) + return a } // 炫彩_取文本显示大小. @@ -397,8 +408,9 @@ func (a *App) GetTextSize(pString string, length int, hFontX int, pOutSize *xc.S // hFontX: 字体. // // pOutSize: 接收返回大小. -func (a *App) GetTextShowSize(pString string, length int, hFontX int, pOutSize *xc.SIZE) int { - return xc.XC_GetTextShowSize(pString, length, hFontX, pOutSize) +func (a *App) GetTextShowSize(pString string, length int, hFontX int, pOutSize *xc.SIZE) *App { + xc.XC_GetTextShowSize(pString, length, hFontX, pOutSize) + return a } // 炫彩_取文本显示大小扩展. @@ -412,8 +424,9 @@ func (a *App) GetTextShowSize(pString string, length int, hFontX int, pOutSize * // nTextAlign: 文本对齐方式, TextFormatFlag_, TextAlignFlag_, TextTrimming_. // // pOutSize: 接收返回大小. -func (a *App) GetTextShowSizeEx(pString string, length int, hFontX int, nTextAlign xcc.TextFormatFlag_, pOutSize *xc.SIZE) int { - return xc.XC_GetTextShowSizeEx(pString, length, hFontX, nTextAlign, pOutSize) +func (a *App) GetTextShowSizeEx(pString string, length int, hFontX int, nTextAlign xcc.TextFormatFlag_, pOutSize *xc.SIZE) *App { + xc.XC_GetTextShowSizeEx(pString, length, hFontX, nTextAlign, pOutSize) + return a } // GetTextShowRect 炫彩_取文本显示矩形. @@ -425,22 +438,25 @@ func (a *App) GetTextShowSizeEx(pString string, length int, hFontX int, nTextAli // @param width 最大宽度. // @param pOutSize 接收返回大小. // @return int -func (a *App) GetTextShowRect(pString string, length int, hFontX int, nTextAlign xcc.TextFormatFlag_, width int, pOutSize *xc.SIZE) int { - return xc.XC_GetTextShowRect(pString, length, hFontX, nTextAlign, width, pOutSize) +func (a *App) GetTextShowRect(pString string, length int, hFontX int, nTextAlign xcc.TextFormatFlag_, width int, pOutSize *xc.SIZE) *App { + xc.XC_GetTextShowRect(pString, length, hFontX, nTextAlign, width, pOutSize) + return a } // 炫彩_置默认字体. // // hFontX: 炫彩字体句柄. -func (a *App) SetDefaultFont(hFontX int) int { - return xc.XC_SetDefaultFont(hFontX) +func (a *App) SetDefaultFont(hFontX int) *App { + xc.XC_SetDefaultFont(hFontX) + return a } // 炫彩_添加搜索路径, 添加文件搜索路径, 默认路径为exe目录和程序当前运行目录. // // pPath: 文件夹. -func (a *App) AddFileSearchPath(pPath string) int { - return xc.XC_AddFileSearchPath(pPath) +func (a *App) AddFileSearchPath(pPath string) *App { + xc.XC_AddFileSearchPath(pPath) + return a } // 炫彩_初始化字体, 初始化LOGFONTW结构体. @@ -458,22 +474,25 @@ func (a *App) AddFileSearchPath(pPath string) int { // bUnderline: 是否有下划线. // // bStrikeOut: 是否有删除线. -func (a *App) InitFont(pFont *xc.LOGFONTW, pName string, size int, bBold bool, bItalic bool, bUnderline bool, bStrikeOut bool) int { - return xc.XC_InitFont(pFont, pName, size, bBold, bItalic, bUnderline, bStrikeOut) +func (a *App) InitFont(pFont *xc.LOGFONTW, pName string, size int, bBold bool, bItalic bool, bUnderline bool, bStrikeOut bool) *App { + xc.XC_InitFont(pFont, pName, size, bBold, bItalic, bUnderline, bStrikeOut) + return a } // 炫彩_分配内存, 在UI库中申请内存, 返回: 内存首地址. // // size: 大小, 字节为单位. -func (a *App) Malloc(size int) int { - return xc.XC_Malloc(size) +func (a *App) Malloc(size int32) *App { + xc.XC_Malloc(size) + return a } // 炫彩_释放内存, 在UI库中释放内存. // // p: 内存首地址. -func (a *App) Free(p int) int { - return xc.XC_Free(p) +func (a *App) Free(p uintptr) *App { + xc.XC_Free(p) + return a } // 炫彩_弹框, 弹出提示框. @@ -481,8 +500,9 @@ func (a *App) Free(p int) int { // pTitle: 提示框标题. // // pText: 提示内容. -func (a *App) Alert(pTitle string, pText string) int { - return xc.XC_Alert(pTitle, pText) +func (a *App) Alert(pTitle string, pText string) *App { + xc.XC_Alert(pTitle, pText) + return a } // 对指定文件执行操作. 如果函数成功,则返回大于 32 的值。如果函数失败,则返回指示失败原因的错误值. @@ -535,8 +555,9 @@ func (a *App) LoadDll(pDllFileName string) uintptr { // 炫彩_PostQuitMessage, 发送WM_QUIT消息退出消息循环. // // nExitCode: 退出码. -func (a *App) PostQuitMessage(nExitCode int) int { - return xc.XC_PostQuitMessage(nExitCode) +func (a *App) PostQuitMessage(nExitCode int) *App { + xc.XC_PostQuitMessage(nExitCode) + return a } // 炫彩_加载布局文件, 返回窗口句柄或布局句柄或元素句柄. @@ -877,8 +898,9 @@ func (a *App) AnsiToUnicode(pIn uintptr, inLen int, pOut *string, outLen int) in // level: 级别. // // pInfo: 信息. -func (a *App) Print(level int, pInfo string) int { - return xc.XDebug_Print(level, pInfo) +func (a *App) Print(level int, pInfo string) *App { + xc.XDebug_Print(level, pInfo) + return a } /* @@ -918,8 +940,9 @@ func (a *App) GetWicFactory() int { // 炫彩_置D2D文本渲染模式. // // mode: 渲染模式, XC_DWRITE_RENDERING_MODE_ . -func (a *App) SetD2dTextRenderingMode(mode xcc.XC_DWRITE_RENDERING_MODE_) int { - return xc.XC_SetD2dTextRenderingMode(mode) +func (a *App) SetD2dTextRenderingMode(mode xcc.XC_DWRITE_RENDERING_MODE_) *App { + xc.XC_SetD2dTextRenderingMode(mode) + return a } // 炫彩_是否启用了D2D. @@ -939,8 +962,9 @@ func (a *App) LoadStyleFromStringW(pFileName string, pString string) bool { // 炫彩_显示边界. // // bShow: 是否显示. -func (a *App) ShowSvgFrame(bShow bool) int { - return xc.XC_ShowSvgFrame(bShow) +func (a *App) ShowSvgFrame(bShow bool) *App { + xc.XC_ShowSvgFrame(bShow) + return a } // 通知消息_弹出, 未实现, 预留接口. @@ -1050,23 +1074,25 @@ func (a *App) NotifyMsg_SetBorderSize(hWindow, left, top, right, bottom int) int // 炫彩_启用自动DPI. 当启用后, 创建窗口时自动检测DPI调整UI缩放, 处理DPI改变消息; 禁用后,当DPI改变,需要手动设置窗口DPI. // // bEnabel: 是否启用. -func (a *App) EnableAutoDPI(bEnabel bool) int { - return xc.XC_EnableAutoDPI(bEnabel) +func (a *App) EnableAutoDPI(bEnabel bool) *App { + xc.XC_EnableAutoDPI(bEnabel) + return a } // 炫彩_置窗口图标. 全局窗口图标, 所有未设置图标的窗口, 都将使用此默认图标. // // hImage: 图标句柄. -func (a *App) SetWindowIcon(hImage int) int { - return xc.XC_SetWindowIcon(hImage) +func (a *App) SetWindowIcon(hImage int) *App { + xc.XC_SetWindowIcon(hImage) + return a } // 炫彩_启用DPI. // // 为go程序启用DPI的几种方式: -// 1. 使用程序清单文件. -// 2. 调用此函数. -// 3. 自己调用DPI函数. +// 1. 调用此函数. +// 2. 使用程序清单文件. +// 3. 自行调用Windows DPI命令. // // 参考[MSDN](https://learn.microsoft.com/zh-cn/windows/win32/hidpi/setting-the-default-dpi-awareness-for-a-process) // @@ -1074,3 +1100,18 @@ func (a *App) SetWindowIcon(hImage int) int { func (a *App) EnableDPI(bEnabel bool) bool { return xc.XC_EnableDPI(bEnabel) } + +// 炫彩_启用自动重绘UI. 当修改UI后将自动调用重绘函数更新UI. +// +// 例如改变了按钮标题后, 将自动调用 xc.XEle_Redraw 更新UI, 默认不启用, 手动和自动各有优势. +// +// bEnabel: 是否启用. +func (a *App) EnableAutoRedrawUI(bEnabel bool) *App { + xc.XC_EnableAutoRedrawUI(bEnabel) + return a +} + +// 炫彩_取句柄总数. 获取当前所使用的句柄总数量, 返回当前所使用的句柄总数量. +func (a *App) GetHandleCount() int32 { + return xc.XC_GetHandleCount() +} diff --git a/bkmanager/bkmanager.go b/bkmanager/bkmanager.go index beb258e..89e8d55 100644 --- a/bkmanager/bkmanager.go +++ b/bkmanager/bkmanager.go @@ -37,26 +37,16 @@ func NewByName(name string) *BkManager { return nil } -// Deprecated -// -// !废弃函数, 保留为了兼容旧版; 请使用 SetInfo(). -// -// 背景_置内容, 设置背景内容, 返回设置的背景对象数量. -// -// pText: 背景内容字符串. -func (b *BkManager) SetBkInfo(pText string) int { - return xc.XBkM_SetBkInfo(b.Handle, pText) -} - // 背景_销毁. -func (b *BkManager) Destroy() int { - return xc.XBkM_Destroy(b.Handle) +func (b *BkManager) Destroy() *BkManager { + xc.XBkM_Destroy(b.Handle) + return b } // 背景_添加内容, 添加背景内容, 返回添加的背景对象数量. // // pText: 背景内容字符串. -func (b *BkManager) AddInfo(pText string) int { +func (b *BkManager) AddInfo(pText string) int32 { return xc.XBkM_AddInfo(b.Handle, pText) } @@ -64,24 +54,26 @@ func (b *BkManager) AddInfo(pText string) int { // // nState: 组合状态. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // width: 线宽. // // id: 背景对象ID, 可忽略(填0). -func (b *BkManager) AddBorder(nState xcc.CombinedState, color, width, id int) int { - return xc.XBkM_AddBorder(b.Handle, nState, color, width, id) +func (b *BkManager) AddBorder(nState xcc.CombinedState, color int, width, id int32) *BkManager { + xc.XBkM_AddBorder(b.Handle, nState, color, width, id) + return b } // 背景_添加填充, 添加背景内容填充. // // nState: 组合状态. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // id: 背景对象ID, 可忽略(填0). -func (b *BkManager) AddFill(nState xcc.CombinedState, color, id int) int { - return xc.XBkM_AddFill(b.Handle, nState, color, id) +func (b *BkManager) AddFill(nState xcc.CombinedState, color int, id int32) *BkManager { + xc.XBkM_AddFill(b.Handle, nState, color, id) + return b } // 背景_添加图片, 添加背景内容图片. @@ -91,18 +83,20 @@ func (b *BkManager) AddFill(nState xcc.CombinedState, color, id int) int { // hImage: 图片句柄. // // id: 背景对象ID, 可忽略(填0). -func (b *BkManager) AddImage(nState xcc.CombinedState, hImage, id int) int { - return xc.XBkM_AddImage(b.Handle, nState, hImage, id) +func (b *BkManager) AddImage(nState xcc.CombinedState, hImage int, id int32) *BkManager { + xc.XBkM_AddImage(b.Handle, nState, hImage, id) + return b } // 背景_取数量, 获取背景内容数量. -func (b *BkManager) GetCount() int { +func (b *BkManager) GetCount() int32 { return xc.XBkM_GetCount(b.Handle) } // 背景_清空, 清空背景内容. -func (b *BkManager) Clear() int { - return xc.XBkM_Clear(b.Handle) +func (b *BkManager) Clear() *BkManager { + xc.XBkM_Clear(b.Handle) + return b } // 背景_绘制, 绘制背景内容. @@ -134,29 +128,32 @@ func (b *BkManager) DrawEx(nState xcc.CombinedState, hDraw int, pRect *xc.RECT, // 背景_启用自动销毁, 是否自动销毁. // // bEnable: 是否启用. -func (b *BkManager) EnableAutoDestroy(bEnable bool) int { - return xc.XBkM_EnableAutoDestroy(b.Handle, bEnable) +func (b *BkManager) EnableAutoDestroy(bEnable bool) *BkManager { + xc.XBkM_EnableAutoDestroy(b.Handle, bEnable) + return b } // 背景_增加引用计数. -func (b *BkManager) AddRef() int { - return xc.XBkM_AddRef(b.Handle) +func (b *BkManager) AddRef() *BkManager { + xc.XBkM_AddRef(b.Handle) + return b } // 背景_释放引用计数. -func (b *BkManager) Release() int { - return xc.XBkM_Release(b.Handle) +func (b *BkManager) Release() *BkManager { + xc.XBkM_Release(b.Handle) + return b } // 背景_取引用计数. -func (b *BkManager) GetRefCount() int { +func (b *BkManager) GetRefCount() int32 { return xc.XBkM_GetRefCount(b.Handle) } // 背景_取引用计数, 设置背景内容, 返回设置的背景对象数量. // // pText: 背景内容字符串. -func (b *BkManager) SetInfo(pText string) int { +func (b *BkManager) SetInfo(pText string) int32 { return xc.XBkM_SetInfo(b.Handle, pText) } @@ -164,7 +161,7 @@ func (b *BkManager) SetInfo(pText string) int { // // nState: 组合状态. // -// color: 接收返回的ABGR 颜色. +// color: 接收返回的ARGB 颜色. func (b *BkManager) GetStateTextColor(nState xcc.CombinedState, color *int) bool { return xc.XBkM_GetStateTextColor(b.Handle, nState, color) } @@ -172,6 +169,6 @@ func (b *BkManager) GetStateTextColor(nState xcc.CombinedState, color *int) bool // 背景_取背景对象, 返回BkObj对象句柄. // // id: 背景对象ID. -func (b *BkManager) GetObject(id int) int { +func (b *BkManager) GetObject(id int32) int { return xc.XBkM_GetObject(b.Handle, id) } diff --git a/bkmanager/deprecated.go b/bkmanager/deprecated.go new file mode 100644 index 0000000..e091f70 --- /dev/null +++ b/bkmanager/deprecated.go @@ -0,0 +1,12 @@ +package bkmanager + +/* +// //////////////////////////////////// 旧版函数 ////////////////////////////////////// +*/ + +// Deprecated +// +// !这是旧版函数, 请使用 SetInfo +func (b *BkManager) SetBkInfo(pText string) int32 { + return b.SetInfo(pText) +} diff --git a/bkobj/bkobj.go b/bkobj/bkobj.go index 99ba86d..83dcd03 100644 --- a/bkobj/bkobj.go +++ b/bkobj/bkobj.go @@ -24,7 +24,7 @@ func NewByHandle(handle int) *BkObj { // bkm: 背景管理器对象. // // id: 背景对象ID. -func NewByBkm(bkm *bkmanager.BkManager, id int) *BkObj { +func NewByBkm(bkm *bkmanager.BkManager, id int32) *BkObj { handle := bkm.GetObject(id) if handle == 0 { return nil @@ -39,7 +39,7 @@ func NewByBkm(bkm *bkmanager.BkManager, id int) *BkObj { // hBkm: 背景管理器句柄. // // id: 背景对象ID. -func NewByBkmHandle(hBkm, id int) *BkObj { +func NewByBkmHandle(hBkm int, id int32) *BkObj { handle := xc.XBkM_GetObject(hBkm, id) if handle == 0 { return nil @@ -58,50 +58,57 @@ func NewByBkmHandle(hBkm, id int) *BkObj { // right: 右边间距. // // bottom: 底部间距. -func (b *BkObj) SetMargin(left int, top int, right int, bottom int) int { - return xc.XBkObj_SetMargin(b.Handle, left, top, right, bottom) +func (b *BkObj) SetMargin(left, top, right, bottom int32) *BkObj { + xc.XBkObj_SetMargin(b.Handle, left, top, right, bottom) + return b } // 背景对象_置对齐. // // nFlags: 对齐方式: xcc.BkObject_Align_Flag_. -func (b *BkObj) SetAlign(nFlags xcc.BkObject_Align_Flag_) int { - return xc.XBkObj_SetAlign(b.Handle, nFlags) +func (b *BkObj) SetAlign(nFlags xcc.BkObject_Align_Flag_) *BkObj { + xc.XBkObj_SetAlign(b.Handle, nFlags) + return b } // 背景对象_置图片. // // hImage: 图片句柄. -func (b *BkObj) SetImage(hImage int) int { - return xc.XBkObj_SetImage(b.Handle, hImage) +func (b *BkObj) SetImage(hImage int) *BkObj { + xc.XBkObj_SetImage(b.Handle, hImage) + return b } // 背景对象_置旋转. // // angle: 旋转角度. -func (b *BkObj) SetRotate(angle float32) int { - return xc.XBkObj_SetRotate(b.Handle, angle) +func (b *BkObj) SetRotate(angle float32) *BkObj { + xc.XBkObj_SetRotate(b.Handle, angle) + return b } // 背景对象_置填充颜色. // -// color: ABGR 颜色值. -func (b *BkObj) SetFillColor(color int) int { - return xc.XBkObj_SetFillColor(b.Handle, color) +// color: ARGB 颜色值. +func (b *BkObj) SetFillColor(color int) *BkObj { + xc.XBkObj_SetFillColor(b.Handle, color) + return b } // 背景对象_置边框宽度. // // width: 宽度. -func (b *BkObj) SetBorderWidth(width int) int { - return xc.XBkObj_SetBorderWidth(b.Handle, width) +func (b *BkObj) SetBorderWidth(width int32) *BkObj { + xc.XBkObj_SetBorderWidth(b.Handle, width) + return b } // 背景对象_置边框颜色. // -// color: ABGR 颜色值. -func (b *BkObj) SetBorderColor(color int) int { - return xc.XBkObj_SetBorderColor(b.Handle, color) +// color: xc.ARGB 颜色值. +func (b *BkObj) SetBorderColor(color int) *BkObj { + xc.XBkObj_SetBorderColor(b.Handle, color) + return b } // 背景对象_置矩形圆角. @@ -113,50 +120,57 @@ func (b *BkObj) SetBorderColor(color int) int { // rightTop: 右上角. // // rightBottom: 右下角. -func (b *BkObj) SetRectRoundAngle(leftTop int, leftBottom int, rightTop int, rightBottom int) int { - return xc.XBkObj_SetRectRoundAngle(b.Handle, leftTop, leftBottom, rightTop, rightBottom) +func (b *BkObj) SetRectRoundAngle(leftTop, leftBottom, rightTop, rightBottom int32) *BkObj { + xc.XBkObj_SetRectRoundAngle(b.Handle, leftTop, leftBottom, rightTop, rightBottom) + return b } // 背景对象_启用填充, 启用绘制填充. // // bEnable: 是否启用. -func (b *BkObj) EnableFill(bEnable bool) int { - return xc.XBkObj_EnableFill(b.Handle, bEnable) +func (b *BkObj) EnableFill(bEnable bool) *BkObj { + xc.XBkObj_EnableFill(b.Handle, bEnable) + return b } // 背景对象_启用边框, 启用绘制边框. // // bEnable: 是否启用. -func (b *BkObj) EnableBorder(bEnable bool) int { - return xc.XBkObj_EnableBorder(b.Handle, bEnable) +func (b *BkObj) EnableBorder(bEnable bool) *BkObj { + xc.XBkObj_EnableBorder(b.Handle, bEnable) + return b } // 背景对象_置文本. // // pText: 文本字符串. -func (b *BkObj) SetText(pText string) int { - return xc.XBkObj_SetText(b.Handle, pText) +func (b *BkObj) SetText(pText string) *BkObj { + xc.XBkObj_SetText(b.Handle, pText) + return b } // 背景对象_置字体. // // hFont: 字体句柄. -func (b *BkObj) SetFont(hFont int) int { - return xc.XBkObj_SetFont(b.Handle, hFont) +func (b *BkObj) SetFont(hFont int) *BkObj { + xc.XBkObj_SetFont(b.Handle, hFont) + return b } // 背景对象_置文本对齐. // // nAlign: 文本对齐方式: xcc.TextFormatFlag_, xcc.TextAlignFlag_, xcc.TextTrimming_. -func (b *BkObj) SetTextAlign(nAlign xcc.TextFormatFlag_) int { - return xc.XBkObj_SetTextAlign(b.Handle, nAlign) +func (b *BkObj) SetTextAlign(nAlign xcc.TextFormatFlag_) *BkObj { + xc.XBkObj_SetTextAlign(b.Handle, nAlign) + return b } // 背景对象_取外间距. // // pMargin: 接收返回外间距. -func (b *BkObj) GetMargin(pMargin *xc.RECT) int { - return xc.XBkObj_GetMargin(b.Handle, pMargin) +func (b *BkObj) GetMargin(pMargin *xc.RECT) *BkObj { + xc.XBkObj_GetMargin(b.Handle, pMargin) + return b } // 背景对象_取对齐, 返回对齐标识: xcc.BkObject_Align_Flag_. @@ -170,30 +184,33 @@ func (b *BkObj) GetImage() int { } // 背景对象_取旋转角度, 返回旋转角度. -func (b *BkObj) GetRotate() int { - return xc.XBkObj_GetRotate(b.Handle) +func (b *BkObj) GetRotate() *BkObj { + xc.XBkObj_GetRotate(b.Handle) + return b } -// 背景对象_取填充色, 返回ABGR填充色. +// 背景对象_取填充色, 返回ARGB填充色. func (b *BkObj) GetFillColor() int { return xc.XBkObj_GetFillColor(b.Handle) } -// 背景对象_取边框色, 返回ABGR边框色. +// 背景对象_取边框色, 返回ARGB边框色. func (b *BkObj) GetBorderColor() int { return xc.XBkObj_GetBorderColor(b.Handle) } // 背景对象_取边框宽度, 返回边框宽度. -func (b *BkObj) GetBorderWidth() int { - return xc.XBkObj_GetBorderWidth(b.Handle) +func (b *BkObj) GetBorderWidth() *BkObj { + xc.XBkObj_GetBorderWidth(b.Handle) + return b } // 背景对象_取矩形圆角. // // pRect: 接收返回圆角大小. -func (b *BkObj) GetRectRoundAngle(pRect *xc.RECT) int { - return xc.XBkObj_GetRectRoundAngle(b.Handle, pRect) +func (b *BkObj) GetRectRoundAngle(pRect *xc.RECT) *BkObj { + xc.XBkObj_GetRectRoundAngle(b.Handle, pRect) + return b } // 背景对象_是否填充. diff --git a/drawx/draw.go b/drawx/draw.go index e2210df..32e457a 100644 --- a/drawx/draw.go +++ b/drawx/draw.go @@ -39,8 +39,9 @@ func NewByHandle(handle int) *Draw { } // 绘制_销毁, 销毁图形绘制模块实例句柄. -func (d *Draw) Destroy() int { - return xc.XDraw_Destroy(d.Handle) +func (d *Draw) Destroy() *Draw { + xc.XDraw_Destroy(d.Handle) + return d } // 绘制_虚线, 绘制水平或垂直虚线. @@ -52,8 +53,9 @@ func (d *Draw) Destroy() int { // x2: 结束点x坐标. // // y2: 结束点y坐标. -func (d *Draw) Dottedline(x1 int, y1 int, x2 int, y2 int) int { - return xc.XDraw_Dottedline(d.Handle, x1, y1, x2, y2) +func (d *Draw) Dottedline(x1, y1, x2, y2 int32) *Draw { + xc.XDraw_Dottedline(d.Handle, x1, y1, x2, y2) + return d } // 绘制_虚线F, 绘制水平或垂直虚线. @@ -65,8 +67,9 @@ func (d *Draw) Dottedline(x1 int, y1 int, x2 int, y2 int) int { // x2: 结束点x坐标. // // y2: 结束点y坐标. -func (d *Draw) DottedlineF(x1, y1, x2, y2 float32) int { - return xc.XDraw_DottedlineF(d.Handle, x1, y1, x2, y2) +func (d *Draw) DottedlineF(x1, y1, x2, y2 float32) *Draw { + xc.XDraw_DottedlineF(d.Handle, x1, y1, x2, y2) + return d } // 绘制_圆弧. @@ -82,8 +85,9 @@ func (d *Draw) DottedlineF(x1, y1, x2, y2 float32) int { // startAngle: 起始角度. // // sweepAngle: 绘制角度, 从起始角度开始计算. -func (d *Draw) DrawArc(x, y int, nWidth int, nHeight int, startAngle float32, sweepAngle float32) int { - return xc.XDraw_DrawArc(d.Handle, x, y, nWidth, nHeight, startAngle, sweepAngle) +func (d *Draw) DrawArc(x, y, nWidth, nHeight int32, startAngle float32, sweepAngle float32) *Draw { + xc.XDraw_DrawArc(d.Handle, x, y, nWidth, nHeight, startAngle, sweepAngle) + return d } // 绘制_圆弧F. @@ -99,8 +103,9 @@ func (d *Draw) DrawArc(x, y int, nWidth int, nHeight int, startAngle float32, sw // startAngle: 起始角度. // // sweepAngle: 绘制角度, 从起始角度开始计算. -func (d *Draw) DrawArcF(x, y, nWidth, nHeight, startAngle, sweepAngle float32) int { - return xc.XDraw_DrawArcF(d.Handle, x, y, nWidth, nHeight, startAngle, sweepAngle) +func (d *Draw) DrawArcF(x, y, nWidth, nHeight, startAngle, sweepAngle float32) *Draw { + xc.XDraw_DrawArcF(d.Handle, x, y, nWidth, nHeight, startAngle, sweepAngle) + return d } // 绘制_曲线, D2D暂时留空. @@ -110,8 +115,9 @@ func (d *Draw) DrawArcF(x, y, nWidth, nHeight, startAngle, sweepAngle float32) i // count: 数组大小. // // tension: 大于或等于0.0F的值,指定曲线的张力, D2D 忽略此参数。. -func (d *Draw) DrawCurve(points []xc.POINT, count int, tension float32) int { - return xc.XDraw_DrawCurve(d.Handle, points, count, tension) +func (d *Draw) DrawCurve(points []xc.POINT, count int32, tension float32) *Draw { + xc.XDraw_DrawCurve(d.Handle, points, count, tension) + return d } // 绘制_曲线F, D2D暂时留空. @@ -121,8 +127,9 @@ func (d *Draw) DrawCurve(points []xc.POINT, count int, tension float32) int { // count: 数组大小. // // tension: 大于或等于0.0F的值,指定曲线的张力, D2D 忽略此参数。. -func (d *Draw) DrawCurveF(points []xc.POINTF, count int, tension float32) int { - return xc.XDraw_DrawCurveF(d.Handle, points, count, tension) +func (d *Draw) DrawCurveF(points []xc.POINTF, count int32, tension float32) *Draw { + xc.XDraw_DrawCurveF(d.Handle, points, count, tension) + return d } // 绘制_线条. @@ -134,8 +141,9 @@ func (d *Draw) DrawCurveF(points []xc.POINTF, count int, tension float32) int { // x2: 坐标. // // y2: 坐标. -func (d *Draw) DrawLine(x1 int, y1 int, x2 int, y2 int) int { - return xc.XDraw_DrawLine(d.Handle, x1, y1, x2, y2) +func (d *Draw) DrawLine(x1, y1, x2, y2 int32) *Draw { + xc.XDraw_DrawLine(d.Handle, x1, y1, x2, y2) + return d } // 绘制_线条F. @@ -147,8 +155,9 @@ func (d *Draw) DrawLine(x1 int, y1 int, x2 int, y2 int) int { // x2: 坐标. // // y2: 坐标. -func (d *Draw) DrawLineF(x1, y1, x2, y2 float32) int { - return xc.XDraw_DrawLineF(d.Handle, x1, y1, x2, y2) +func (d *Draw) DrawLineF(x1, y1, x2, y2 float32) *Draw { + xc.XDraw_DrawLineF(d.Handle, x1, y1, x2, y2) + return d } // 绘制_多边形, 绘制多边形. @@ -156,8 +165,9 @@ func (d *Draw) DrawLineF(x1, y1, x2, y2 float32) int { // points: 顶点坐标数组. // // nCount: 顶点数量. -func (d *Draw) DrawPolygon(points []xc.POINT, nCount int) int { - return xc.XDraw_DrawPolygon(d.Handle, points, nCount) +func (d *Draw) DrawPolygon(points []xc.POINT, nCount int32) *Draw { + xc.XDraw_DrawPolygon(d.Handle, points, nCount) + return d } // 绘制_多边形F, 绘制多边形. @@ -165,22 +175,25 @@ func (d *Draw) DrawPolygon(points []xc.POINT, nCount int) int { // points: 顶点坐标数组. // // nCount: 顶点数量. -func (d *Draw) DrawPolygonF(points []xc.POINTF, nCount int) int { - return xc.XDraw_DrawPolygonF(d.Handle, points, nCount) +func (d *Draw) DrawPolygonF(points []xc.POINTF, nCount int32) *Draw { + xc.XDraw_DrawPolygonF(d.Handle, points, nCount) + return d } // 绘制_矩形, 绘制矩形边框. // // pRect: 矩形坐标 . -func (d *Draw) DrawRect(pRect *xc.RECT) int { - return xc.XDraw_DrawRect(d.Handle, pRect) +func (d *Draw) DrawRect(pRect *xc.RECT) *Draw { + xc.XDraw_DrawRect(d.Handle, pRect) + return d } // 绘制_矩形F, 绘制矩形边框. // // pRect: 矩形坐标 . -func (d *Draw) DrawRectF(pRect *xc.RECTF) int { - return xc.XDraw_DrawRectF(d.Handle, pRect) +func (d *Draw) DrawRectF(pRect *xc.RECTF) *Draw { + xc.XDraw_DrawRectF(d.Handle, pRect) + return d } // 绘制_置偏移, 设置坐标偏移量, X向左偏移为负数, 向右偏移为正数. @@ -188,8 +201,9 @@ func (d *Draw) DrawRectF(pRect *xc.RECTF) int { // x: X轴偏移量. // // y: Y轴偏移量. -func (d *Draw) SetOffset(x, y int32) int { - return xc.XDraw_SetOffset(d.Handle, x, y) +func (d *Draw) SetOffset(x, y int32) *Draw { + xc.XDraw_SetOffset(d.Handle, x, y) + return d } // 绘制_取偏移, 获取坐标偏移量, X向左偏移为负数, 向右偏移为正数. @@ -197,13 +211,15 @@ func (d *Draw) SetOffset(x, y int32) int { // pX: 接收X轴偏移量. // // pY: 接收Y轴偏移量. -func (d *Draw) GetOffset(pX, pY *int32) int { - return xc.XDraw_GetOffset(d.Handle, pX, pY) +func (d *Draw) GetOffset(pX, pY *int32) *Draw { + xc.XDraw_GetOffset(d.Handle, pX, pY) + return d } // 绘制_还原状态, 还原状态, 释放用户绑定的GDI对象, 例如画刷, 画笔. -func (d *Draw) GDI_RestoreGDIOBJ() int { - return xc.XDraw_GDI_RestoreGDIOBJ(d.Handle) +func (d *Draw) GDI_RestoreGDIOBJ() *Draw { + xc.XDraw_GDI_RestoreGDIOBJ(d.Handle) + return d } // 绘制_取HDC, 获取绑定的设备上下文HDC, 返回HDC句柄. @@ -213,84 +229,96 @@ func (d *Draw) GetHDC() uintptr { // 绘制_置画刷颜色, 设置画刷颜色. // -// color: ABGR 颜色值. -func (d *Draw) SetBrushColor(color int) int { - return xc.XDraw_SetBrushColor(d.Handle, color) +// color: ARGB 颜色值. +func (d *Draw) SetBrushColor(color int) *Draw { + xc.XDraw_SetBrushColor(d.Handle, color) + return d } // 绘制_置文本垂直, 设置文本垂直显示. // // bVertical: 是否垂直显示文本. -func (d *Draw) SetTextVertical(bVertical bool) int { - return xc.XDraw_SetTextVertical(d.Handle, bVertical) +func (d *Draw) SetTextVertical(bVertical bool) *Draw { + xc.XDraw_SetTextVertical(d.Handle, bVertical) + return d } // 绘制_置文本对齐, 设置文本对齐. // // nFlags: 对齐标识, TextFormatFlag_, TextAlignFlag_, TextTrimming_. -func (d *Draw) SetTextAlign(nFlags xcc.TextFormatFlag_) int { - return xc.XDraw_SetTextAlign(d.Handle, nFlags) +func (d *Draw) SetTextAlign(nFlags xcc.TextFormatFlag_) *Draw { + xc.XDraw_SetTextAlign(d.Handle, nFlags) + return d } // 绘制_置字体. // // hFontx: 炫彩字体. -func (d *Draw) SetFont(hFontx int) int { - return xc.XDraw_SetFont(d.Handle, hFontx) +func (d *Draw) SetFont(hFontx int) *Draw { + xc.XDraw_SetFont(d.Handle, hFontx) + return d } // 绘制_置线宽. // // nWidth: 宽度. -func (d *Draw) SetLineWidth(nWidth int) int { - return xc.XDraw_SetLineWidth(d.Handle, nWidth) +func (d *Draw) SetLineWidth(nWidth int32) *Draw { + xc.XDraw_SetLineWidth(d.Handle, nWidth) + return d } // 绘制_置线宽F. // // nWidth: 宽度. -func (d *Draw) SetLineWidthF(nWidth float32) int { - return xc.XDraw_SetLineWidthF(d.Handle, nWidth) +func (d *Draw) SetLineWidthF(nWidth float32) *Draw { + xc.XDraw_SetLineWidthF(d.Handle, nWidth) + return d } // 绘制_置背景模式, SetBkMode() 参见MSDN. // // bTransparent: 参见MSDN. -func (d *Draw) GDI_SetBkMode(bTransparent bool) int { - return xc.XDraw_GDI_SetBkMode(d.Handle, bTransparent) +func (d *Draw) GDI_SetBkMode(bTransparent bool) *Draw { + xc.XDraw_GDI_SetBkMode(d.Handle, bTransparent) + return d } // 绘制_置裁剪区域, 设置裁剪区域. // // pRect: 区域坐标. -func (d *Draw) SetClipRect(pRect *xc.RECT) int { - return xc.XDraw_SetClipRect(d.Handle, pRect) +func (d *Draw) SetClipRect(pRect *xc.RECT) *Draw { + xc.XDraw_SetClipRect(d.Handle, pRect) + return d } // 绘制_置D2D文本渲染模式. // // mode 渲染模式 XC_DWRITE_RENDERING_MODE_. -func (d *Draw) SetD2dTextRenderingMode(mode xcc.XC_DWRITE_RENDERING_MODE_) int { - return xc.XDraw_SetD2dTextRenderingMode(d.Handle, mode) +func (d *Draw) SetD2dTextRenderingMode(mode xcc.XC_DWRITE_RENDERING_MODE_) *Draw { + xc.XDraw_SetD2dTextRenderingMode(d.Handle, mode) + return d } // 绘制_清除裁剪区域. -func (d *Draw) ClearClip() int { - return xc.XDraw_ClearClip(d.Handle) +func (d *Draw) ClearClip() *Draw { + xc.XDraw_ClearClip(d.Handle) + return d } // 绘制_启用平滑模式. // // bEnable: 是否启用. -func (d *Draw) EnableSmoothingMode(bEnable bool) int { - return xc.XDraw_EnableSmoothingMode(d.Handle, bEnable) +func (d *Draw) EnableSmoothingMode(bEnable bool) *Draw { + xc.XDraw_EnableSmoothingMode(d.Handle, bEnable) + return d } // 绘制_启用窗口透明判断, 当启用之后, 调用GDI+函数时, 如果参数alpha=255, 将自动修改为254, 应对GDI+的bug, 否则透明通道异常. // // bTransparent: 是否启用. -func (d *Draw) EnableWndTransparent(bTransparent bool) int { - return xc.XDraw_EnableWndTransparent(d.Handle, bTransparent) +func (d *Draw) EnableWndTransparent(bTransparent bool) *Draw { + xc.XDraw_EnableWndTransparent(d.Handle, bTransparent) + return d } // 绘制_创建实心画刷, GDI创建具有指定的纯色逻辑刷. @@ -306,8 +334,8 @@ func (d *Draw) GDI_CreateSolidBrush(crColor int) int { // // nWidth: 画笔宽度. // -// crColor: ABGR 颜色. -func (d *Draw) GDI_CreatePen(fnPenStyle int, nWidth int, crColor int) int { +// crColor: ARGB 颜色. +func (d *Draw) GDI_CreatePen(fnPenStyle, nWidth int32, crColor int) int { return xc.XDraw_GDI_CreatePen(d.Handle, fnPenStyle, nWidth, crColor) } @@ -320,7 +348,7 @@ func (d *Draw) GDI_CreatePen(fnPenStyle int, nWidth int, crColor int) int { // nRightRect: 右下角X坐标. // // nBottomRect: 右下角Y坐标. -func (d *Draw) GDI_CreateRectRgn(nLeftRect int, nTopRect int, nRightRect int, nBottomRect int) int { +func (d *Draw) GDI_CreateRectRgn(nLeftRect, nTopRect, nRightRect, nBottomRect int32) int { return xc.XDraw_GDI_CreateRectRgn(d.Handle, nLeftRect, nTopRect, nRightRect, nBottomRect) } @@ -337,7 +365,7 @@ func (d *Draw) GDI_CreateRectRgn(nLeftRect int, nTopRect int, nRightRect int, nB // nWidthEllipse: 椭圆的宽度. // // nHeightEllipse: 椭圆的高度. -func (d *Draw) GDI_CreateRoundRectRgn(nLeftRect int, nTopRect int, nRightRect int, nBottomRect int, nWidthEllipse int, nHeightEllipse int) int { +func (d *Draw) GDI_CreateRoundRectRgn(nLeftRect, nTopRect, nRightRect, nBottomRect, nWidthEllipse, nHeightEllipse int32) int { return xc.XDraw_GDI_CreateRoundRectRgn(d.Handle, nLeftRect, nTopRect, nRightRect, nBottomRect, nWidthEllipse, nHeightEllipse) } @@ -352,7 +380,7 @@ func (d *Draw) GDI_CreateRoundRectRgn(nLeftRect int, nTopRect int, nRightRect in // ALTERNATE Selects alternate mode (fills area between odd-numbered and even-numbered polygon sides on each scan line). // // WINDING Selects winding mode (fills any region with a nonzero winding value). -func (d *Draw) GDI_CreatePolygonRgn(pPt []xc.POINT, cPoints, fnPolyFillMode int) int { +func (d *Draw) GDI_CreatePolygonRgn(pPt []xc.POINT, cPoints, fnPolyFillMode int32) int { return xc.XDraw_GDI_CreatePolygonRgn(d.Handle, pPt, cPoints, fnPolyFillMode) } @@ -376,40 +404,45 @@ func (d *Draw) GDI_Ellipse(pRect *xc.RECT) bool { // COMPLEXREGION Region is more than one rectangle. // // ERROR An error occurred. (The previous clipping region is unaffected). -func (d *Draw) GDI_SelectClipRgn(hRgn int) int { - return xc.XDraw_GDI_SelectClipRgn(d.Handle, hRgn) +func (d *Draw) GDI_SelectClipRgn(hRgn int) *Draw { + xc.XDraw_GDI_SelectClipRgn(d.Handle, hRgn) + return d } // 绘制_填充矩形, 通过使用指定的刷子填充一个矩形, 此功能包括左侧和顶部的边界, 但不包括矩形的右边和底部边界. // // pRect: 矩形区域. -func (d *Draw) FillRect(pRect *xc.RECT) int { - return xc.XDraw_FillRect(d.Handle, pRect) +func (d *Draw) FillRect(pRect *xc.RECT) *Draw { + xc.XDraw_FillRect(d.Handle, pRect) + return d } // 绘制_填充矩形F, 通过使用指定的刷子填充一个矩形, 此功能包括左侧和顶部的边界, 但不包括矩形的右边和底部边界. // // pRect: 矩形区域. -func (d *Draw) FillRectF(pRect *xc.RECTF) int { - return xc.XDraw_FillRectF(d.Handle, pRect) +func (d *Draw) FillRectF(pRect *xc.RECTF) *Draw { + xc.XDraw_FillRectF(d.Handle, pRect) + return d } // 绘制_填充矩形指定颜色. // // pRect: 矩形区域. // -// color: ABGR 颜色. -func (d *Draw) FillRectColor(pRect *xc.RECT, color int) int { - return xc.XDraw_FillRectColor(d.Handle, pRect, color) +// color: ARGB 颜色. +func (d *Draw) FillRectColor(pRect *xc.RECT, color int) *Draw { + xc.XDraw_FillRectColor(d.Handle, pRect, color) + return d } // 绘制_填充矩形指定颜色F. // // pRect: 矩形区域. // -// color: ABGR 颜色. -func (d *Draw) FillRectColorF(pRect *xc.RECTF, color int) int { - return xc.XDraw_FillRectColorF(d.Handle, pRect, color) +// color: ARGB 颜色. +func (d *Draw) FillRectColorF(pRect *xc.RECTF, color int) *Draw { + xc.XDraw_FillRectColorF(d.Handle, pRect, color) + return d } // 绘制_填充区域, 通过使用指定的画刷填充一个区域. @@ -424,22 +457,25 @@ func (d *Draw) GDI_FillRgn(hrgn int, hbr int) bool { // 绘制_填充圆形. // // pRect: 矩形区域. -func (d *Draw) FillEllipse(pRect *xc.RECT) int { - return xc.XDraw_FillEllipse(d.Handle, pRect) +func (d *Draw) FillEllipse(pRect *xc.RECT) *Draw { + xc.XDraw_FillEllipse(d.Handle, pRect) + return d } // 绘制_填充圆形F. // // pRect: 矩形区域. -func (d *Draw) FillEllipseF(pRect *xc.RECTF) int { - return xc.XDraw_FillEllipseF(d.Handle, pRect) +func (d *Draw) FillEllipseF(pRect *xc.RECTF) *Draw { + xc.XDraw_FillEllipseF(d.Handle, pRect) + return d } // 绘制_圆形, 绘制圆边框. // // pRect: 矩形区域. -func (d *Draw) DrawEllipse(pRect *xc.RECT) int { - return xc.XDraw_DrawEllipse(d.Handle, pRect) +func (d *Draw) DrawEllipse(pRect *xc.RECT) *Draw { + xc.XDraw_DrawEllipse(d.Handle, pRect) + return d } // 绘制_填充圆角矩形. @@ -449,8 +485,9 @@ func (d *Draw) DrawEllipse(pRect *xc.RECT) int { // nWidth: 圆角宽度. // // nHeight: 圆角高度. -func (d *Draw) FillRoundRect(pRect *xc.RECT, nWidth, nHeight int) int { - return xc.XDraw_FillRoundRect(d.Handle, pRect, nWidth, nHeight) +func (d *Draw) FillRoundRect(pRect *xc.RECT, nWidth, nHeight int32) *Draw { + xc.XDraw_FillRoundRect(d.Handle, pRect, nWidth, nHeight) + return d } // 绘制_填充圆角矩形F. @@ -460,8 +497,9 @@ func (d *Draw) FillRoundRect(pRect *xc.RECT, nWidth, nHeight int) int { // nWidth: 圆角宽度. // // nHeight: 圆角高度. -func (d *Draw) FillRoundRectF(pRect *xc.RECTF, nWidth, nHeight float32) int { - return xc.XDraw_FillRoundRectF(d.Handle, pRect, nWidth, nHeight) +func (d *Draw) FillRoundRectF(pRect *xc.RECTF, nWidth, nHeight float32) *Draw { + xc.XDraw_FillRoundRectF(d.Handle, pRect, nWidth, nHeight) + return d } // 绘制_圆角矩形, 绘制圆角矩形边框. @@ -471,8 +509,9 @@ func (d *Draw) FillRoundRectF(pRect *xc.RECTF, nWidth, nHeight float32) int { // nWidth: 圆角宽度. // // nHeight: 圆角高度. -func (d *Draw) DrawRoundRect(pRect *xc.RECT, nWidth int, nHeight int) int { - return xc.XDraw_DrawRoundRect(d.Handle, pRect, nWidth, nHeight) +func (d *Draw) DrawRoundRect(pRect *xc.RECT, nWidth, nHeight int32) *Draw { + xc.XDraw_DrawRoundRect(d.Handle, pRect, nWidth, nHeight) + return d } // 绘制_圆角矩形F, 绘制圆角矩形边框. @@ -482,8 +521,9 @@ func (d *Draw) DrawRoundRect(pRect *xc.RECT, nWidth int, nHeight int) int { // nWidth: 圆角宽度. // // nHeight: 圆角高度. -func (d *Draw) DrawRoundRectF(pRect *xc.RECT, nWidth, nHeight float32) int { - return xc.XDraw_DrawRoundRectF(d.Handle, pRect, nWidth, nHeight) +func (d *Draw) DrawRoundRectF(pRect *xc.RECT, nWidth, nHeight float32) *Draw { + xc.XDraw_DrawRoundRectF(d.Handle, pRect, nWidth, nHeight) + return d } // 绘制_填充圆角矩形扩展. @@ -497,8 +537,9 @@ func (d *Draw) DrawRoundRectF(pRect *xc.RECT, nWidth, nHeight float32) int { // nRightBottom: 圆角大小. // // nLeftBottom: 圆角大小. -func (d *Draw) FillRoundRectEx(pRect *xc.RECT, nLeftTop, nRightTop, nRightBottom, nLeftBottom int) int { - return xc.XDraw_FillRoundRectEx(d.Handle, pRect, nLeftTop, nRightTop, nRightBottom, nLeftBottom) +func (d *Draw) FillRoundRectEx(pRect *xc.RECT, nLeftTop, nRightTop, nRightBottom, nLeftBottom int32) *Draw { + xc.XDraw_FillRoundRectEx(d.Handle, pRect, nLeftTop, nRightTop, nRightBottom, nLeftBottom) + return d } // 绘制_填充圆角矩形扩展F. @@ -512,8 +553,9 @@ func (d *Draw) FillRoundRectEx(pRect *xc.RECT, nLeftTop, nRightTop, nRightBottom // nRightBottom: 圆角大小. // // nLeftBottom: 圆角大小. -func (d *Draw) FillRoundRectExF(pRect *xc.RECTF, nLeftTop, nRightTop, nRightBottom, nLeftBottom float32) int { - return xc.XDraw_FillRoundRectExF(d.Handle, pRect, nLeftTop, nRightTop, nRightBottom, nLeftBottom) +func (d *Draw) FillRoundRectExF(pRect *xc.RECTF, nLeftTop, nRightTop, nRightBottom, nLeftBottom float32) *Draw { + xc.XDraw_FillRoundRectExF(d.Handle, pRect, nLeftTop, nRightTop, nRightBottom, nLeftBottom) + return d } // 绘制_圆角矩形扩展, 绘制圆角矩形边框. @@ -527,8 +569,9 @@ func (d *Draw) FillRoundRectExF(pRect *xc.RECTF, nLeftTop, nRightTop, nRightBott // nRightBottom: 圆角大小. // // nLeftBottom: 圆角大小. -func (d *Draw) DrawRoundRectEx(pRect *xc.RECT, nLeftTop int, nRightTop int, nRightBottom int, nLeftBottom int) int { - return xc.XDraw_DrawRoundRectEx(d.Handle, pRect, nLeftTop, nRightTop, nRightBottom, nLeftBottom) +func (d *Draw) DrawRoundRectEx(pRect *xc.RECT, nLeftTop, nRightTop, nRightBottom, nLeftBottom int32) *Draw { + xc.XDraw_DrawRoundRectEx(d.Handle, pRect, nLeftTop, nRightTop, nRightBottom, nLeftBottom) + return d } // 绘制_圆角矩形扩展F, 绘制圆角矩形边框. @@ -542,8 +585,9 @@ func (d *Draw) DrawRoundRectEx(pRect *xc.RECT, nLeftTop int, nRightTop int, nRig // nRightBottom: 圆角大小. // // nLeftBottom: 圆角大小. -func (d *Draw) DrawRoundRectExF(pRect *xc.RECT, nLeftTop, nRightTop, nRightBottom, nLeftBottom float32) int { - return xc.XDraw_DrawRoundRectExF(d.Handle, pRect, nLeftTop, nRightTop, nRightBottom, nLeftBottom) +func (d *Draw) DrawRoundRectExF(pRect *xc.RECT, nLeftTop, nRightTop, nRightBottom, nLeftBottom float32) *Draw { + xc.XDraw_DrawRoundRectExF(d.Handle, pRect, nLeftTop, nRightTop, nRightBottom, nLeftBottom) + return d } // 绘制_矩形, 绘制矩形, 使用当前的画刷和画笔. 如果函数成功, 返回非零值, 如果函数失败, 返回值是零. @@ -555,7 +599,7 @@ func (d *Draw) DrawRoundRectExF(pRect *xc.RECT, nLeftTop, nRightTop, nRightBotto // nRightRect: 右下角X坐标. // // nBottomRect: 右下角Y坐标. -func (d *Draw) GDI_Rectangle(nLeftRect int, nTopRect int, nRightRect int, nBottomRect int) bool { +func (d *Draw) GDI_Rectangle(nLeftRect, nTopRect, nRightRect, nBottomRect int32) bool { return xc.XDraw_GDI_Rectangle(d.Handle, nLeftRect, nTopRect, nRightRect, nBottomRect) } @@ -563,60 +607,64 @@ func (d *Draw) GDI_Rectangle(nLeftRect int, nTopRect int, nRightRect int, nBotto // // pRect: 矩形坐标. // -// color1: 开始颜色, ABGR 颜色. +// color1: 开始颜色, ARGB 颜色. // -// color2: 结束颜色, ABGR 颜色. +// color2: 结束颜色, ARGB 颜色. // // mode: 模式, GRADIENT_FILL_. -func (d *Draw) GradientFill2(pRect *xc.RECT, color1 int, color2 int, mode xcc.GRADIENT_FILL_) int { - return xc.XDraw_GradientFill2(d.Handle, pRect, color1, color2, mode) +func (d *Draw) GradientFill2(pRect *xc.RECT, color1 int, color2 int, mode xcc.GRADIENT_FILL_) *Draw { + xc.XDraw_GradientFill2(d.Handle, pRect, color1, color2, mode) + return d } // 绘制_渐变填充2F, 渐变填充, 从一种颜色过渡到另一种颜色. // // pRect: 矩形坐标. // -// color1: 开始颜色, ABGR 颜色. +// color1: 开始颜色, ARGB 颜色. // -// color2: 结束颜色, ABGR 颜色. +// color2: 结束颜色, ARGB 颜色. // // mode: 模式, GRADIENT_FILL_. -func (d *Draw) GradientFill2F(pRect *xc.RECTF, color1 int, color2 int, mode xcc.GRADIENT_FILL_) int { - return xc.XDraw_GradientFill2F(d.Handle, pRect, color1, color2, mode) +func (d *Draw) GradientFill2F(pRect *xc.RECTF, color1 int, color2 int, mode xcc.GRADIENT_FILL_) *Draw { + xc.XDraw_GradientFill2F(d.Handle, pRect, color1, color2, mode) + return d } // 绘制_渐变填充4, 渐变填充,从一种颜色过渡到另一种颜色. // // pRect: 矩形坐标. // -// color1: 开始颜色, ABGR 颜色. +// color1: 开始颜色, ARGB 颜色. // -// color2: 结束颜色, ABGR 颜色. +// color2: 结束颜色, ARGB 颜色. // -// color3: 开始颜色, ABGR 颜色. +// color3: 开始颜色, ARGB 颜色. // -// color4: 结束颜色, ABGR 颜色. +// color4: 结束颜色, ARGB 颜色. // // mode: 模式, GRADIENT_FILL_. -func (d *Draw) GradientFill4(pRect *xc.RECT, color1 int, color2 int, color3 int, color4 int, mode xcc.GRADIENT_FILL_) bool { - return xc.XDraw_GradientFill4(d.Handle, pRect, color1, color2, color3, color4, mode) +func (d *Draw) GradientFill4(pRect *xc.RECT, color1 int, color2 int, color3 int, color4 int, mode xcc.GRADIENT_FILL_) *Draw { + xc.XDraw_GradientFill4(d.Handle, pRect, color1, color2, color3, color4, mode) + return d } // 绘制_渐变填充4F, 渐变填充,从一种颜色过渡到另一种颜色. // // pRect: 矩形坐标. // -// color1: 开始颜色, ABGR 颜色. +// color1: 开始颜色, ARGB 颜色. // -// color2: 结束颜色, ABGR 颜色. +// color2: 结束颜色, ARGB 颜色. // -// color3: 开始颜色, ABGR 颜色. +// color3: 开始颜色, ARGB 颜色. // -// color4: 结束颜色, ABGR 颜色. +// color4: 结束颜色, ARGB 颜色. // // mode: 模式, GRADIENT_FILL_. -func (d *Draw) GradientFill4F(pRect *xc.RECTF, color1 int, color2 int, color3 int, color4 int, mode xcc.GRADIENT_FILL_) bool { - return xc.XDraw_GradientFill4F(d.Handle, pRect, color1, color2, color3, color4, mode) +func (d *Draw) GradientFill4F(pRect *xc.RECTF, color1 int, color2 int, color3 int, color4 int, mode xcc.GRADIENT_FILL_) *Draw { + xc.XDraw_GradientFill4F(d.Handle, pRect, color1, color2, color3, color4, mode) + return d } // 绘制_边框区域, 绘制边框, 使用指定的画刷绘制指定的区域的边框. 如果函数成功, 返回非零值, 如果函数失败, 返回值是零. @@ -628,22 +676,24 @@ func (d *Draw) GradientFill4F(pRect *xc.RECTF, color1 int, color2 int, color3 in // nWidth: 边框宽度, 垂直边. // // nHeight: 边框高度, 水平边. -func (d *Draw) GDI_FrameRgn(hrgn int, hbr int, nWidth int, nHeight int) bool { +func (d *Draw) GDI_FrameRgn(hrgn int, hbr int, nWidth, nHeight int32) bool { return xc.XDraw_GDI_FrameRgn(d.Handle, hrgn, hbr, nWidth, nHeight) } // 绘制_焦点矩形. // // pRect: 矩形坐标. -func (d *Draw) FocusRect(pRect *xc.RECT) int { - return xc.XDraw_FocusRect(d.Handle, pRect) +func (d *Draw) FocusRect(pRect *xc.RECT) *Draw { + xc.XDraw_FocusRect(d.Handle, pRect) + return d } // 绘制_焦点矩形F. // // pRect: 矩形坐标. -func (d *Draw) FocusRectF(pRect *xc.RECTF) int { - return xc.XDraw_FocusRectF(d.Handle, pRect) +func (d *Draw) FocusRectF(pRect *xc.RECTF) *Draw { + xc.XDraw_FocusRectF(d.Handle, pRect) + return d } // 绘制_移动到起点, 更新当前位置到指定点,并返回以前的位置. 如果函数成功, 返回非零值. @@ -653,7 +703,7 @@ func (d *Draw) FocusRectF(pRect *xc.RECTF) int { // Y: 坐标. // // pPoint: 接收以前的当前位置到一个POINT结构的指针, 如果这个参数是NULL指针, 没有返回原来的位置. -func (d *Draw) GDI_MoveToEx(X int, Y int, pPoint *xc.POINT) bool { +func (d *Draw) GDI_MoveToEx(X, Y int32, pPoint *xc.POINT) bool { return xc.XDraw_GDI_MoveToEx(d.Handle, X, Y, pPoint) } @@ -662,7 +712,7 @@ func (d *Draw) GDI_MoveToEx(X int, Y int, pPoint *xc.POINT) bool { // nXEnd: X坐标, 线结束点. // // nYEnd: Y坐标, 线结束点. -func (d *Draw) GDI_LineTo(nXEnd int, nYEnd int) bool { +func (d *Draw) GDI_LineTo(nXEnd, nYEnd int32) bool { return xc.XDraw_GDI_LineTo(d.Handle, nXEnd, nYEnd) } @@ -671,7 +721,7 @@ func (d *Draw) GDI_LineTo(nXEnd int, nYEnd int) bool { // pArrayPt: 参见MSDN. // // arrayPtSize: 参见MSDN. -func (d *Draw) GDI_Polyline(pArrayPt []xc.POINT, arrayPtSize int) bool { +func (d *Draw) GDI_Polyline(pArrayPt []xc.POINT, arrayPtSize int32) bool { return xc.XDraw_GDI_Polyline(d.Handle, pArrayPt, arrayPtSize) } @@ -682,7 +732,7 @@ func (d *Draw) GDI_Polyline(pArrayPt []xc.POINT, arrayPtSize int) bool { // Y: 坐标. // // crColor: RGB颜色值. -func (d *Draw) GDI_SetPixel(X int, Y int, crColor int) int { +func (d *Draw) GDI_SetPixel(X, Y int32, crColor int) int { return xc.XDraw_GDI_SetPixel(d.Handle, X, Y, crColor) } @@ -708,7 +758,7 @@ func (d *Draw) XDraw_GetD2dRenderTarget() int { // hbrFlickerFreeDraw: . // // diFlags: . -func (d *Draw) GDI_DrawIconEx(xLeft int, yTop int, hIcon uintptr, cxWidth int, cyWidth int, istepIfAniCur int, hbrFlickerFreeDraw int, diFlags int) bool { +func (d *Draw) GDI_DrawIconEx(xLeft, yTop int32, hIcon uintptr, cxWidth, cyWidth int32, istepIfAniCur uint32, hbrFlickerFreeDraw int, diFlags uint32) bool { return xc.XDraw_GDI_DrawIconEx(d.Handle, xLeft, yTop, hIcon, cxWidth, cyWidth, istepIfAniCur, hbrFlickerFreeDraw, diFlags) } @@ -784,8 +834,9 @@ func (d *Draw) GDI_AlphaBlend(nXOriginDest, nYOriginDest, nWidthDest, nHeightDes // points: 顶点坐标数组. // // nCount: 顶点数量. -func (d *Draw) FillPolygon(points []xc.POINT, nCount int) int { - return xc.XDraw_FillPolygon(d.Handle, points, nCount) +func (d *Draw) FillPolygon(points []xc.POINT, nCount int32) *Draw { + xc.XDraw_FillPolygon(d.Handle, points, nCount) + return d } // 绘制_填充多边形F, 填充多边形. @@ -793,8 +844,9 @@ func (d *Draw) FillPolygon(points []xc.POINT, nCount int) int { // points: 顶点坐标数组. // // nCount: 顶点数量. -func (d *Draw) FillPolygonF(points []xc.POINTF, nCount int) int { - return xc.XDraw_FillPolygonF(d.Handle, points, nCount) +func (d *Draw) FillPolygonF(points []xc.POINTF, nCount int32) *Draw { + xc.XDraw_FillPolygonF(d.Handle, points, nCount) + return d } // 绘制_图片. @@ -815,8 +867,9 @@ func (d *Draw) Image(hImageFrame int, x, y int32) { // x: x坐标. // // y: y坐标. -func (d *Draw) ImageF(hImageFrame int, x, y float32) int { - return xc.XDraw_ImageF(d.Handle, hImageFrame, x, y) +func (d *Draw) ImageF(hImageFrame int, x, y float32) *Draw { + xc.XDraw_ImageF(d.Handle, hImageFrame, x, y) + return d } // 绘制_图片自适应. @@ -826,8 +879,9 @@ func (d *Draw) ImageF(hImageFrame int, x, y float32) int { // pRect: 坐标. // // bOnlyBorder: 是否只绘制边缘区域. -func (d *Draw) ImageAdaptive(hImageFrame int, pRect *xc.RECT, bOnlyBorder bool) int { - return xc.XDraw_ImageAdaptive(d.Handle, hImageFrame, pRect, bOnlyBorder) +func (d *Draw) ImageAdaptive(hImageFrame int, pRect *xc.RECT, bOnlyBorder bool) *Draw { + xc.XDraw_ImageAdaptive(d.Handle, hImageFrame, pRect, bOnlyBorder) + return d } // 绘制_图片自适应F. @@ -837,8 +891,9 @@ func (d *Draw) ImageAdaptive(hImageFrame int, pRect *xc.RECT, bOnlyBorder bool) // pRect: 坐标. // // bOnlyBorder: 是否只绘制边缘区域. -func (d *Draw) ImageAdaptiveF(hImageFrame int, pRect *xc.RECTF, bOnlyBorder bool) int { - return xc.XDraw_ImageAdaptiveF(d.Handle, hImageFrame, pRect, bOnlyBorder) +func (d *Draw) ImageAdaptiveF(hImageFrame int, pRect *xc.RECTF, bOnlyBorder bool) *Draw { + xc.XDraw_ImageAdaptiveF(d.Handle, hImageFrame, pRect, bOnlyBorder) + return d } // 绘制_图片扩展, 绘制图片. @@ -852,8 +907,9 @@ func (d *Draw) ImageAdaptiveF(hImageFrame int, pRect *xc.RECTF, bOnlyBorder bool // width: 宽度. // // height: 高度. -func (d *Draw) XDraw_ImageEx(hImageFrame int, x, y, width, height int) int { - return xc.XDraw_ImageEx(d.Handle, hImageFrame, x, y, width, height) +func (d *Draw) XDraw_ImageEx(hImageFrame int, x, y, width, height int32) *Draw { + xc.XDraw_ImageEx(d.Handle, hImageFrame, x, y, width, height) + return d } // 绘制_图片扩展F, 绘制图片. @@ -867,8 +923,9 @@ func (d *Draw) XDraw_ImageEx(hImageFrame int, x, y, width, height int) int { // width: 宽度. // // height: 高度. -func (d *Draw) XDraw_ImageExF(hImageFrame int, x, y, width, height float32) int { - return xc.XDraw_ImageExF(d.Handle, hImageFrame, x, y, width, height) +func (d *Draw) XDraw_ImageExF(hImageFrame int, x, y, width, height float32) *Draw { + xc.XDraw_ImageExF(d.Handle, hImageFrame, x, y, width, height) + return d } // 绘制_图片增强. @@ -878,8 +935,9 @@ func (d *Draw) XDraw_ImageExF(hImageFrame int, x, y, width, height float32) int // pRect: 坐标. // // bClip: 是否裁剪区域. -func (d *Draw) ImageSuper(hImageFrame int, pRect *xc.RECT, bClip bool) int { - return xc.XDraw_ImageSuper(d.Handle, hImageFrame, pRect, bClip) +func (d *Draw) ImageSuper(hImageFrame int, pRect *xc.RECT, bClip bool) *Draw { + xc.XDraw_ImageSuper(d.Handle, hImageFrame, pRect, bClip) + return d } // 绘制_图片增强F. @@ -889,8 +947,9 @@ func (d *Draw) ImageSuper(hImageFrame int, pRect *xc.RECT, bClip bool) int { // pRect: 坐标. // // bClip: 是否裁剪区域. -func (d *Draw) ImageSuperF(hImageFrame int, pRect *xc.RECTF, bClip bool) int { - return xc.XDraw_ImageSuperF(d.Handle, hImageFrame, pRect, bClip) +func (d *Draw) ImageSuperF(hImageFrame int, pRect *xc.RECTF, bClip bool) *Draw { + xc.XDraw_ImageSuperF(d.Handle, hImageFrame, pRect, bClip) + return d } // 绘制_图片增强扩展. @@ -900,8 +959,9 @@ func (d *Draw) ImageSuperF(hImageFrame int, pRect *xc.RECTF, bClip bool) int { // prcDest: 目标坐标. // // prcSrc: 源坐标. -func (d *Draw) ImageSuperEx(hImageFrame int, prcDest *xc.RECT, prcSrc *xc.RECT) int { - return xc.XDraw_ImageSuperEx(d.Handle, hImageFrame, prcDest, prcSrc) +func (d *Draw) ImageSuperEx(hImageFrame int, prcDest *xc.RECT, prcSrc *xc.RECT) *Draw { + xc.XDraw_ImageSuperEx(d.Handle, hImageFrame, prcDest, prcSrc) + return d } // 绘制_图片增强扩展F. @@ -911,8 +971,9 @@ func (d *Draw) ImageSuperEx(hImageFrame int, prcDest *xc.RECT, prcSrc *xc.RECT) // prcDest: 目标坐标. // // prcSrc: 源坐标. -func (d *Draw) ImageSuperExF(hImageFrame int, prcDest *xc.RECTF, prcSrc *xc.RECT) int { - return xc.XDraw_ImageSuperExF(d.Handle, hImageFrame, prcDest, prcSrc) +func (d *Draw) ImageSuperExF(hImageFrame int, prcDest *xc.RECTF, prcSrc *xc.RECT) *Draw { + xc.XDraw_ImageSuperExF(d.Handle, hImageFrame, prcDest, prcSrc) + return d } // 绘制_图片增强遮盖, 绘制带遮盖的图片. D2D留空. @@ -926,8 +987,9 @@ func (d *Draw) ImageSuperExF(hImageFrame int, prcDest *xc.RECTF, prcSrc *xc.RECT // pRectMask: 坐标, 遮盖. // // bClip: 是否裁剪区域. -func (d *Draw) ImageSuperMask(hImageFrame int, hImageFrameMask int, pRect *xc.RECT, pRectMask *xc.RECT, bClip bool) int { - return xc.XDraw_ImageSuperMask(d.Handle, hImageFrame, hImageFrameMask, pRect, pRectMask, bClip) +func (d *Draw) ImageSuperMask(hImageFrame int, hImageFrameMask int, pRect *xc.RECT, pRectMask *xc.RECT, bClip bool) *Draw { + xc.XDraw_ImageSuperMask(d.Handle, hImageFrame, hImageFrameMask, pRect, pRectMask, bClip) + return d } // 绘制_图片平铺, 绘制图片. @@ -937,8 +999,9 @@ func (d *Draw) ImageSuperMask(hImageFrame int, hImageFrameMask int, pRect *xc.RE // pRect: 坐标. // // flag: 标识, 0:从左上角开始平铺, 1:从左下角开始平铺. -func (d *Draw) ImageTile(hImageFrame int, hImageFrameMask int, pRect *xc.RECT, flag int) int { - return xc.XDraw_ImageTile(d.Handle, hImageFrame, hImageFrameMask, pRect, flag) +func (d *Draw) ImageTile(hImageFrame int, hImageFrameMask int, pRect *xc.RECT, flag int32) *Draw { + xc.XDraw_ImageTile(d.Handle, hImageFrame, hImageFrameMask, pRect, flag) + return d } // 绘制_图片平铺F, 绘制图片. @@ -948,8 +1011,9 @@ func (d *Draw) ImageTile(hImageFrame int, hImageFrameMask int, pRect *xc.RECT, f // pRect: 坐标. // // flag: 标识, 0:从左上角开始平铺, 1:从左下角开始平铺. -func (d *Draw) ImageTileF(hImageFrame int, hImageFrameMask int, pRect *xc.RECTF, flag int) int { - return xc.XDraw_ImageTileF(d.Handle, hImageFrame, hImageFrameMask, pRect, flag) +func (d *Draw) ImageTileF(hImageFrame int, hImageFrameMask int, pRect *xc.RECTF, flag int32) *Draw { + xc.XDraw_ImageTileF(d.Handle, hImageFrame, hImageFrameMask, pRect, flag) + return d } // 绘制_图片遮盖, 绘制带遮盖的图片, D2D留空. @@ -958,15 +1022,14 @@ func (d *Draw) ImageTileF(hImageFrame int, hImageFrameMask int, pRect *xc.RECTF, // // hImageFrameMask: 图片句柄, 遮盖. // -// x: hImageFrame X坐标. -// -// y: hImageFrame Y坐标. +// pRect: 坐标. // -// x2: hImageFrameMask X坐标. +// x: 目标X坐标. // -// y2: hImageFrameMask Y坐标. -func (d *Draw) ImageMask(hImageFrame int, hImageFrameMask int, x int, y int, x2 int, y2 int) int { - return xc.XDraw_ImageMask(d.Handle, hImageFrame, hImageFrameMask, x, y, x2, y2) +// y: 目标Y坐标. +func (d *Draw) ImageMask(hImageFrame int, hImageFrameMask int, pRect *xc.RECT, x, y int32) *Draw { + xc.XDraw_ImageMask(d.Handle, hImageFrame, hImageFrameMask, pRect, x, y) + return d } // 绘制_文本指定矩形, DrawText() 参见MSDN. @@ -974,8 +1037,9 @@ func (d *Draw) ImageMask(hImageFrame int, hImageFrameMask int, x int, y int, x2 // lpString: 字符串. // // lpRect: 坐标. -func (d *Draw) DrawText(lpString string, lpRect *xc.RECT) int { - return xc.XDraw_DrawText(d.Handle, lpString, lpRect) +func (d *Draw) DrawText(lpString string, lpRect *xc.RECT) *Draw { + xc.XDraw_DrawText(d.Handle, lpString, lpRect) + return d } // 绘制_文本指定矩形F, DrawText() 参见MSDN. @@ -983,8 +1047,9 @@ func (d *Draw) DrawText(lpString string, lpRect *xc.RECT) int { // lpString: 字符串. // // lpRect: 坐标. -func (d *Draw) DrawTextF(lpString string, lpRect *xc.RECTF) int { - return xc.XDraw_DrawTextF(d.Handle, lpString, lpRect) +func (d *Draw) DrawTextF(lpString string, lpRect *xc.RECTF) *Draw { + xc.XDraw_DrawTextF(d.Handle, lpString, lpRect) + return d } // 绘制_文本下划线. @@ -993,9 +1058,10 @@ func (d *Draw) DrawTextF(lpString string, lpRect *xc.RECTF) int { // // lpRect: 坐标. // -// colorLine: 下划线颜色, ABGR 颜色. -func (d *Draw) DrawTextUnderline(lpString string, lpRect *xc.RECT, colorLine int) int { - return xc.XDraw_DrawTextUnderline(d.Handle, lpString, lpRect, colorLine) +// colorLine: 下划线颜色, ARGB 颜色. +func (d *Draw) DrawTextUnderline(lpString string, lpRect *xc.RECT, colorLine int) *Draw { + xc.XDraw_DrawTextUnderline(d.Handle, lpString, lpRect, colorLine) + return d } // 绘制_文本下划线F. @@ -1004,9 +1070,10 @@ func (d *Draw) DrawTextUnderline(lpString string, lpRect *xc.RECT, colorLine int // // lpRect: 坐标. // -// colorLine: 下划线颜色, ABGR 颜色. -func (d *Draw) DrawTextUnderlineF(lpString string, lpRect *xc.RECTF, colorLine int) int { - return xc.XDraw_DrawTextUnderlineF(d.Handle, lpString, lpRect, colorLine) +// colorLine: 下划线颜色, ARGB 颜色. +func (d *Draw) DrawTextUnderlineF(lpString string, lpRect *xc.RECTF, colorLine int) *Draw { + xc.XDraw_DrawTextUnderlineF(d.Handle, lpString, lpRect, colorLine) + return d } // 绘制_文本, TextOut() 参见MSDN. @@ -1018,8 +1085,9 @@ func (d *Draw) DrawTextUnderlineF(lpString string, lpRect *xc.RECTF, colorLine i // lpString: XX. // // cbString: XX. -func (d *Draw) TextOut(nXStart int, nYStart int, lpString string, cbString string) int { - return xc.XDraw_TextOut(d.Handle, nXStart, nYStart, lpString, cbString) +func (d *Draw) TextOut(nXStart, nYStart int32, lpString string, cbString string) *Draw { + xc.XDraw_TextOut(d.Handle, nXStart, nYStart, lpString, cbString) + return d } // 绘制_文本F, TextOut() 参见MSDN. @@ -1042,8 +1110,9 @@ func (d *Draw) TextOutF(nXStart, nYStart float32, lpString string, cbString stri // nYStart: XX. // // lpString: XX. -func (d *Draw) TextOutEx(nXStart int, nYStart int, lpString string) int { - return xc.XDraw_TextOutEx(d.Handle, nXStart, nYStart, lpString) +func (d *Draw) TextOutEx(nXStart, nYStart int32, lpString string) *Draw { + xc.XDraw_TextOutEx(d.Handle, nXStart, nYStart, lpString) + return d } // 绘制_文本扩展F, TextOut() 参见MSDN. @@ -1053,8 +1122,9 @@ func (d *Draw) TextOutEx(nXStart int, nYStart int, lpString string) int { // nYStart: XX. // // lpString: XX. -func (d *Draw) TextOutExF(nXStart, nYStart float32, lpString string) int { - return xc.XDraw_TextOutExF(d.Handle, nXStart, nYStart, lpString) +func (d *Draw) TextOutExF(nXStart, nYStart float32, lpString string) *Draw { + xc.XDraw_TextOutExF(d.Handle, nXStart, nYStart, lpString) + return d } // 绘制_文本A, TextOut() 参见MSDN. @@ -1064,8 +1134,9 @@ func (d *Draw) TextOutExF(nXStart, nYStart float32, lpString string) int { // nYStart: XX. // // lpString: XX. -func (d *Draw) TextOutA(nXStart int, nYStart int, lpString string) int { - return xc.XDraw_TextOutA(d.Handle, nXStart, nYStart, lpString) +func (d *Draw) TextOutA(nXStart, nYStart int32, lpString string) *Draw { + xc.XDraw_TextOutA(d.Handle, nXStart, nYStart, lpString) + return d } // 绘制_文本AF, TextOut() 参见MSDN. @@ -1075,22 +1146,25 @@ func (d *Draw) TextOutA(nXStart int, nYStart int, lpString string) int { // nYStart: XX. // // lpString: XX. -func (d *Draw) TextOutAF(nXStart, nYStart float32, lpString string) int { - return xc.XDraw_TextOutAF(d.Handle, nXStart, nYStart, lpString) +func (d *Draw) TextOutAF(nXStart, nYStart float32, lpString string) *Draw { + xc.XDraw_TextOutAF(d.Handle, nXStart, nYStart, lpString) + return d } // 绘制_设置文本渲染提示. // // nType: XX. -func (d *Draw) SetTextRenderingHint(nType int) int { - return xc.XDraw_SetTextRenderingHint(d.Handle, nType) +func (d *Draw) SetTextRenderingHint(nType int32) *Draw { + xc.XDraw_SetTextRenderingHint(d.Handle, nType) + return d } // 绘制_SVG源. // // hSvg: SVG句柄. -func (d *Draw) DrawSvgSrc(hSvg int) int { - return xc.XDraw_DrawSvgSrc(d.Handle, hSvg) +func (d *Draw) DrawSvgSrc(hSvg int) *Draw { + xc.XDraw_DrawSvgSrc(d.Handle, hSvg) + return d } // 绘制_SVG. @@ -1100,8 +1174,9 @@ func (d *Draw) DrawSvgSrc(hSvg int) int { // x: x坐标. // // y: y坐标. -func (d *Draw) DrawSvg(hSvg int, x int, y int) int { - return xc.XDraw_DrawSvg(d.Handle, hSvg, x, y) +func (d *Draw) DrawSvg(hSvg int, x, y int32) *Draw { + xc.XDraw_DrawSvg(d.Handle, hSvg, x, y) + return d } // 绘制_SVG扩展. @@ -1115,8 +1190,9 @@ func (d *Draw) DrawSvg(hSvg int, x int, y int) int { // nWidth: 宽度. // // nHeight: 高度. -func (d *Draw) DrawSvgEx(hSvg int, x int, y int, nWidth int, nHeight int) int { - return xc.XDraw_DrawSvgEx(d.Handle, hSvg, x, y, nWidth, nHeight) +func (d *Draw) DrawSvgEx(hSvg int, x, y, nWidth, nHeight int32) *Draw { + xc.XDraw_DrawSvgEx(d.Handle, hSvg, x, y, nWidth, nHeight) + return d } // 绘制_SVG大小. @@ -1126,15 +1202,17 @@ func (d *Draw) DrawSvgEx(hSvg int, x int, y int, nWidth int, nHeight int) int { // nWidth: 宽度. // // nHeight: 高度. -func (d *Draw) DrawSvgSize(hSvg int, nWidth int, nHeight int) int { - return xc.XDraw_DrawSvgSize(d.Handle, hSvg, nWidth, nHeight) +func (d *Draw) DrawSvgSize(hSvg int, nWidth, nHeight int32) *Draw { + xc.XDraw_DrawSvgSize(d.Handle, hSvg, nWidth, nHeight) + return d } // 绘制_D2D_清理, 使用指定颜色清理画布. // -// color: ABGR 颜色值. -func (d *Draw) D2D_Clear(color int) int { - return xc.XDraw_D2D_Clear(d.Handle, color) +// color: ARGB 颜色值. +func (d *Draw) D2D_Clear(color int) *Draw { + xc.XDraw_D2D_Clear(d.Handle, color) + return d } // 绘制_图片遮盖矩形, 使用矩形作为遮罩. @@ -1146,8 +1224,9 @@ func (d *Draw) D2D_Clear(color int) int { // pRcMask: 遮罩坐标. // // pRcRoundAngle: 遮罩圆角. -func (d *Draw) ImageMaskRect(hImageFrame int, pRect *xc.RECT, pRcMask *xc.RECT, pRcRoundAngle *xc.RECT) int { - return xc.XDraw_ImageMaskRect(d.Handle, hImageFrame, pRect, pRcMask, pRcRoundAngle) +func (d *Draw) ImageMaskRect(hImageFrame int, pRect *xc.RECT, pRcMask *xc.RECT, pRcRoundAngle *xc.RECT) *Draw { + xc.XDraw_ImageMaskRect(d.Handle, hImageFrame, pRect, pRcMask, pRcRoundAngle) + return d } // 绘制_图片遮盖圆型, 使用圆形作为遮罩. @@ -1157,8 +1236,9 @@ func (d *Draw) ImageMaskRect(hImageFrame int, pRect *xc.RECT, pRcMask *xc.RECT, // pRect: 矩形坐标. // // pRcMask: 遮罩坐标. -func (d *Draw) ImageMaskEllipse(hImageFrame int, pRect *xc.RECT, pRcMask *xc.RECT) int { - return xc.XDraw_ImageMaskEllipse(d.Handle, hImageFrame, pRect, pRcMask) +func (d *Draw) ImageMaskEllipse(hImageFrame int, pRect *xc.RECT, pRcMask *xc.RECT) *Draw { + xc.XDraw_ImageMaskEllipse(d.Handle, hImageFrame, pRect, pRcMask) + return d } // 绘制_取字体, 返回字体句柄. diff --git a/font/font.go b/font/font.go index fea36c4..1dac72a 100644 --- a/font/font.go +++ b/font/font.go @@ -38,9 +38,9 @@ func NewEX(pName string, size int32, style xcc.FontStyle_) *Font { // // @param pFontInfo 字体信息. // @return *Font 返回字体对象. -func NewLOGFONTW(pFontInfo *xc.LOGFONTW) *Font { +func NewByLOGFONTW(pFontInfo *xc.LOGFONTW) *Font { p := &Font{} - p.SetHandle(xc.XFont_CreateLOGFONTW(pFontInfo)) + p.SetHandle(xc.XFont_CreateFromLOGFONTW(pFontInfo)) return p } @@ -157,24 +157,24 @@ func NewByName(name string) *Font { // EnableAutoDestroy 字体_启用自动销毁. 是否自动销毁. // // @param bEnable 是否启用. -// @return int -func (f *Font) EnableAutoDestroy(bEnable bool) int { - return xc.XFont_EnableAutoDestroy(f.Handle, bEnable) +func (f *Font) EnableAutoDestroy(bEnable bool) *Font { + xc.XFont_EnableAutoDestroy(f.Handle, bEnable) + return f } // GetFont 字体_取Font. 获取字体. // -// @return int 返回GDI+ Font指针 -func (f *Font) GetFont() int { +// @return GDI+ Font指针 +func (f *Font) GetFont() uintptr { return xc.XFont_GetFont(f.Handle) } // GetFontInfo 字体_取信息. 获取字体信息. // // @param pInfo 接收返回的字体信息. -// @return int -func (f *Font) GetFontInfo(pInfo *xc.Font_Info_) int { - return xc.XFont_GetFontInfo(f.Handle, pInfo) +func (f *Font) GetFontInfo(pInfo *xc.Font_Info_) *Font { + xc.XFont_GetFontInfo(f.Handle, pInfo) + return f } // GetLOGFONTW 字体_取LOGFONTW. 获取字体LOGFONTW. @@ -187,29 +187,41 @@ func (f *Font) GetLOGFONTW(hdc uintptr, pOut *xc.LOGFONTW) bool { } // Destroy 字体_销毁. 强制销毁炫彩字体, 谨慎使用, 建议使用 Release() 释放. -// -// @return int -func (f *Font) Destroy() { +func (f *Font) Destroy() *Font { xc.XFont_Destroy(f.Handle) + return f } // AddRef 字体_增加引用计数. -// -// @return int -func (f *Font) AddRef() { +func (f *Font) AddRef() *Font { xc.XFont_AddRef(f.Handle) + return f } // GetRefCount 字体_取引用计数. -// -// @return int func (f *Font) GetRefCount() int32 { return xc.XFont_GetRefCount(f.Handle) } // Release 字体_释放引用计数. 释放引用计数, 当引用计数为0时自动销毁. -// -// @return int -func (f *Font) Release() { +func (f *Font) Release() *Font { xc.XFont_Release(f.Handle) + return f +} + +// GetUnderlineEdit 字体_取下划线. 仅供edit字体使用, 因为edit不支持下划线字体, 所以需要单独设置. +// +// @return bUnderline 是否启用下划线. +// @return bStrikeout 是否启用删除线. +func (f *Font) GetUnderlineEdit() (bUnderline, bStrikeout bool) { + return xc.XFont_GetUnderlineEdit(f.Handle) +} + +// SetUnderlineEdit 字体_置下划线. 仅供edit字体使用, 因为edit不支持下划线字体, 所以需要单独设置. +// +// @param bUnderline 是否启用下划线. +// @param bStrikeout 是否启用删除线. +func (f *Font) SetUnderlineEdit(bUnderline, bStrikeout bool) *Font { + xc.XFont_SetUnderlineEdit(f.Handle, bUnderline, bStrikeout) + return f } diff --git a/imagex/image.go b/imagex/image.go index 6cf8189..68426ff 100644 --- a/imagex/image.go +++ b/imagex/image.go @@ -7,7 +7,7 @@ import ( "github.com/twgh/xcgui/xcc" ) -// Image 图片操作. +// Image 炫彩图片操作. type Image struct { objectbase.ObjectBase } @@ -386,18 +386,20 @@ func (i *Image) SetDrawTypeAdaptive(leftSize, topSize, rightSize, bottomSize int // 图片_置透明色, 指定图片透明颜色. // -// color: ABGR 颜色. -func (i *Image) SetTranColor(color int) { +// color: ARGB 颜色. +func (i *Image) SetTranColor(color int) *Image { xc.XImage_SetTranColor(i.Handle, color) + return i } // 图片_置透明色扩展, 指定图片透明颜色及透明度. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // tranColor: 透明色的透明度. -func (i *Image) SetTranColorEx(color int, tranColor byte) { +func (i *Image) SetTranColorEx(color int, tranColor byte) *Image { xc.XImage_SetTranColorEx(i.Handle, color, tranColor) + return i } // 图片_置旋转角度, 设置旋转角度, 返回先前角度. @@ -412,29 +414,33 @@ func (i *Image) SetRotateAngle(fAngle float32) float32 { // nCount: 等分数量. // // iIndex: 索引. -func (i *Image) SetSplitEqual(nCount, iIndex int32) { +func (i *Image) SetSplitEqual(nCount, iIndex int32) *Image { xc.XImage_SetSplitEqual(i.Handle, nCount, iIndex) + return i } // 图片_启用透明色, 启用或关闭图片透明色. // // bEnable: 启用TRUE. -func (i *Image) EnableTranColor(bEnable bool) { +func (i *Image) EnableTranColor(bEnable bool) *Image { xc.XImage_EnableTranColor(i.Handle, bEnable) + return i } // 图片_启用自动销毁, 启用或关闭自动销毁, 当与UI元素关联时有效. // // bEnable: 启用自动销毁TRUE. -func (i *Image) EnableAutoDestroy(bEnable bool) { +func (i *Image) EnableAutoDestroy(bEnable bool) *Image { xc.XImage_EnableAutoDestroy(i.Handle, bEnable) + return i } // 图片_启用居中, 启用或关闭图片居中显示,默认属性图片有效. // // bCenter: 是否居中显示. -func (i *Image) EnableCenter(bCenter bool) { +func (i *Image) EnableCenter(bCenter bool) *Image { xc.XImage_EnableCenter(i.Handle, bCenter) + return i } // 图片_判断居中, 判断图片是否居中显示. @@ -463,13 +469,15 @@ func (i *Image) GetImageSrc() int { } // 图片_增加引用计数. -func (i *Image) AddRef() { +func (i *Image) AddRef() *Image { xc.XImage_AddRef(i.Handle) + return i } // 图片_释放引用计数, 释放引用计数, 当引用计数为0时, 自动销毁. -func (i *Image) Release() { +func (i *Image) Release() *Image { xc.XImage_Release(i.Handle) + return i } // 图片_取引用计数. @@ -478,8 +486,9 @@ func (i *Image) GetRefCount() int32 { } // 图片_销毁, 强制销毁图片, 谨慎使用, 建议使用 XImage_Release() 释放. -func (i *Image) Destroy() { +func (i *Image) Destroy() *Image { xc.XImage_Destroy(i.Handle) + return i } // 图片_置缩放大小, 启用缩放属性后有效, 值大于0有效. @@ -487,6 +496,7 @@ func (i *Image) Destroy() { // width: 宽度. // // height: 高度. -func (i *Image) SetScaleSize(width, height int32) { +func (i *Image) SetScaleSize(width, height int32) *Image { xc.XImage_SetScaleSize(i.Handle, width, height) + return i } diff --git a/objectbase/objectbase.go b/objectbase/objectbase.go index a831817..28f6166 100644 --- a/objectbase/objectbase.go +++ b/objectbase/objectbase.go @@ -11,8 +11,9 @@ type ObjectBase struct { } // 给本类的Handle赋值. -func (o *ObjectBase) SetHandle(handle int) { +func (o *ObjectBase) SetHandle(handle int) *ObjectBase { o.Handle = handle + return o } // 炫彩对象_取类型, 获取对象最终类型, 返回对象类型: XC_. @@ -21,7 +22,7 @@ func (o *ObjectBase) GetType() xcc.XC_OBJECT_TYPE { } // 炫彩对象_取基础类型, 获取对象的基础类型, 返回对象类型, 以下类型之一: XC_ERROR, XC_WINDOW, XC_ELE, XC_SHAPE, XC_ADAPTER. -func (o *ObjectBase) GetTypeBase() int { +func (o *ObjectBase) GetTypeBase() xcc.XC_OBJECT_TYPE { return xc.XObj_GetTypeBase(o.Handle) } @@ -33,8 +34,9 @@ func (o *ObjectBase) GetTypeEx() xcc.XC_OBJECT_TYPE_EX { // 炫彩对象_置类型扩展, 如果是按钮, 请使用按钮的增强接口 XBtn_SetTypeEx(). // // nType: 对象扩展类型: button_type_ , element_type_ , xc_ex_error. -func (o *ObjectBase) SetTypeEx(nType xcc.XC_OBJECT_TYPE_EX) int { - return xc.XObj_SetTypeEx(o.Handle, nType) +func (o *ObjectBase) SetTypeEx(nType xcc.XC_OBJECT_TYPE_EX) *ObjectBase { + xc.XObj_SetTypeEx(o.Handle, nType) + return o } // 炫彩_置属性, 设置对象属性. diff --git a/objectbase/ui.go b/objectbase/ui.go index b61291f..1720ac7 100644 --- a/objectbase/ui.go +++ b/objectbase/ui.go @@ -13,9 +13,9 @@ type UI struct { // SetStyle 可视对象_置样式, 设置UI对象样式. // // @param nStyle xcc.XC_OBJECT_STYLE, 样式值: xcc.Button_Style_ , xcc.Element_Style_ , xcc.ListBox_Style_. -// @return int -func (u *UI) SetStyle(nStyle xcc.XC_OBJECT_STYLE) int { - return xc.XUI_SetStyle(u.Handle, nStyle) +func (u *UI) SetStyle(nStyle xcc.XC_OBJECT_STYLE) *UI { + xc.XUI_SetStyle(u.Handle, nStyle) + return u } // GetStyle 可视对象_取样式, 获取UI对象样式. @@ -25,20 +25,28 @@ func (u *UI) GetStyle() xcc.XC_OBJECT_STYLE { return xc.XUI_GetStyle(u.Handle) } -// EnableCSS 可视对象_启用CSS, 启用或禁用样式. +// EnableCSS 可视对象_启用CSS. 启用或禁用样式, 并且覆盖内嵌子元素属性, 例如: 滚动视图上的滚动条, 滚动条上的按钮. // // @param bEnable 是否启用. -// @return int -func (u *UI) EnableCSS(bEnable bool) int { - return xc.XUI_EnableCSS(u.Handle, bEnable) +func (u *UI) EnableCSS(bEnable bool) *UI { + xc.XUI_EnableCSS(u.Handle, bEnable) + return u +} + +// EnableCssEx 可视对象_启用CSS. 启用或禁用样式, 仅设置自身属性, 不包含内嵌子元素属性, 例如:滚动视图上的滚动条, 滚动条上的按钮 +// +// @param bEnable 是否启用. +func (u *UI) EnableCssEx(bEnable bool) *UI { + xc.XUI_EnableCssEx(u.Handle, bEnable) + return u } // SetCssName 可视对象_置CSS名称, 设置CSS[套用样式]名称. // // @param pName 套用样式名称. -// @return int -func (u *UI) SetCssName(pName string) int { - return xc.XUI_SetCssName(u.Handle, pName) +func (u *UI) SetCssName(pName string) *UI { + xc.XUI_SetCssName(u.Handle, pName) + return u } // GetCssName 可视对象_取CSS名称, 获取CSS样式名称. diff --git a/objectbase/widget.go b/objectbase/widget.go index f02c9db..502f1dc 100644 --- a/objectbase/widget.go +++ b/objectbase/widget.go @@ -18,15 +18,17 @@ func (w *Widget) IsShow() bool { // 窗口组件_显示. // // bShow: 是否显示. -func (w *Widget) Show(bShow bool) int { - return xc.XWidget_Show(w.Handle, bShow) +func (w *Widget) Show(bShow bool) *Widget { + xc.XWidget_Show(w.Handle, bShow) + return w } // 窗口组件_启用布局控制. // // bEnable:. -func (w *Widget) EnableLayoutControl(bEnable bool) int { - return xc.XWidget_EnableLayoutControl(w.Handle, bEnable) +func (w *Widget) EnableLayoutControl(bEnable bool) *Widget { + xc.XWidget_EnableLayoutControl(w.Handle, bEnable) + return w } // 窗口组件_是否布局控制. @@ -57,22 +59,25 @@ func (w *Widget) GetHWINDOW() int { // 窗口组件_布局项_启用换行, 强制换行. // // bWrap: 是否换行. -func (w *Widget) LayoutItem_EnableWrap(bWrap bool) int { - return xc.XWidget_LayoutItem_EnableWrap(w.Handle, bWrap) +func (w *Widget) LayoutItem_EnableWrap(bWrap bool) *Widget { + xc.XWidget_LayoutItem_EnableWrap(w.Handle, bWrap) + return w } // 窗口组件_布局项_启用交换, 根据水平垂直布局变换, 交换属性(宽度,高度,最小宽度,最小高度). // // bEnable: 是否启用. -func (w *Widget) LayoutItem_EnableSwap(bEnable bool) int { - return xc.XWidget_LayoutItem_EnableSwap(w.Handle, bEnable) +func (w *Widget) LayoutItem_EnableSwap(bEnable bool) *Widget { + xc.XWidget_LayoutItem_EnableSwap(w.Handle, bEnable) + return w } // 窗口组件_布局项_启用浮动, 向反方向对齐. // // bFloat: 是否浮动. -func (w *Widget) LayoutItem_EnableFloat(bFloat bool) int { - return xc.XWidget_LayoutItem_EnableFloat(w.Handle, bFloat) +func (w *Widget) LayoutItem_EnableFloat(bFloat bool) *Widget { + xc.XWidget_LayoutItem_EnableFloat(w.Handle, bFloat) + return w } // 窗口组件_布局项_置宽度. @@ -80,8 +85,9 @@ func (w *Widget) LayoutItem_EnableFloat(bFloat bool) int { // nType: 类型: xcc.Layout_Size_. // // nWidth: 宽度. -func (w *Widget) LayoutItem_SetWidth(nType xcc.Layout_Size_, nWidth int32) int { - return xc.XWidget_LayoutItem_SetWidth(w.Handle, nType, nWidth) +func (w *Widget) LayoutItem_SetWidth(nType xcc.Layout_Size_, nWidth int32) *Widget { + xc.XWidget_LayoutItem_SetWidth(w.Handle, nType, nWidth) + return w } // 窗口组件_布局项_置高度. @@ -89,8 +95,9 @@ func (w *Widget) LayoutItem_SetWidth(nType xcc.Layout_Size_, nWidth int32) int { // nType: 类型: xcc.Layout_Size_. // // nHeight: 高度. -func (w *Widget) LayoutItem_SetHeight(nType xcc.Layout_Size_, nHeight int32) int { - return xc.XWidget_LayoutItem_SetHeight(w.Handle, nType, nHeight) +func (w *Widget) LayoutItem_SetHeight(nType xcc.Layout_Size_, nHeight int32) *Widget { + xc.XWidget_LayoutItem_SetHeight(w.Handle, nType, nHeight) + return w } // 窗口组件_布局项_取宽度. @@ -98,8 +105,9 @@ func (w *Widget) LayoutItem_SetHeight(nType xcc.Layout_Size_, nHeight int32) int // pType: 返回类型. // // pWidth: 返回宽度. -func (w *Widget) LayoutItem_GetWidth(pType *xcc.Layout_Size_, pWidth *int32) int { - return xc.XWidget_LayoutItem_GetWidth(w.Handle, pType, pWidth) +func (w *Widget) LayoutItem_GetWidth(pType *xcc.Layout_Size_, pWidth *int32) *Widget { + xc.XWidget_LayoutItem_GetWidth(w.Handle, pType, pWidth) + return w } // 窗口组件_布局项_取高度. @@ -107,27 +115,31 @@ func (w *Widget) LayoutItem_GetWidth(pType *xcc.Layout_Size_, pWidth *int32) int // pType: 返回类型. // // pHeight: 返回高度. -func (w *Widget) LayoutItem_GetHeight(pType *xcc.Layout_Size_, pHeight *int32) int { - return xc.XWidget_LayoutItem_GetHeight(w.Handle, pType, pHeight) +func (w *Widget) LayoutItem_GetHeight(pType *xcc.Layout_Size_, pHeight *int32) *Widget { + xc.XWidget_LayoutItem_GetHeight(w.Handle, pType, pHeight) + return w } // 窗口组件_布局项_置对齐, 根据水平垂直轴变化对齐. // // nAlign: 对齐方式: xcc.Layout_Align_Axis_. -func (w *Widget) LayoutItem_SetAlign(nAlign xcc.Layout_Align_Axis_) int { - return xc.XWidget_LayoutItem_SetAlign(w.Handle, nAlign) +func (w *Widget) LayoutItem_SetAlign(nAlign xcc.Layout_Align_Axis_) *Widget { + xc.XWidget_LayoutItem_SetAlign(w.Handle, nAlign) + return w } // 窗口组件_布局项_置外间距. -func (w *Widget) LayoutItem_SetMargin(left, top, right, bottom int) int { - return xc.XWidget_LayoutItem_SetMargin(w.Handle, left, top, right, bottom) +func (w *Widget) LayoutItem_SetMargin(left, top, right, bottom int) *Widget { + xc.XWidget_LayoutItem_SetMargin(w.Handle, left, top, right, bottom) + return w } // 窗口组件_布局项_置对齐. // // pMargin: 接收返回. -func (w *Widget) LayoutItem_GetMargin(pMargin *xc.RECT) int { - return xc.XWidget_LayoutItem_GetMargin(w.Handle, pMargin) +func (w *Widget) LayoutItem_GetMargin(pMargin *xc.RECT) *Widget { + xc.XWidget_LayoutItem_GetMargin(w.Handle, pMargin) + return w } // 窗口组件_布局项_置最小大小, 限制大小仅针对缩放有效(自动, 填充父, 比例, 百分比). @@ -135,8 +147,9 @@ func (w *Widget) LayoutItem_GetMargin(pMargin *xc.RECT) int { // width: 最小宽度. // // height: 最小高度. -func (w *Widget) LayoutItem_SetMinSize(width, height int) int { - return xc.XWidget_LayoutItem_SetMinSize(w.Handle, width, height) +func (w *Widget) LayoutItem_SetMinSize(width, height int) *Widget { + xc.XWidget_LayoutItem_SetMinSize(w.Handle, width, height) + return w } // 窗口组件_布局项_置位置, 相对位置, 值大于等于0有效. @@ -148,29 +161,33 @@ func (w *Widget) LayoutItem_SetMinSize(width, height int) int { // right: 右边距离. // // bottom: 下边距离. -func (w *Widget) LayoutItem_SetPosition(left, top, right, bottom int) int { - return xc.XWidget_LayoutItem_SetPosition(w.Handle, left, top, right, bottom) +func (w *Widget) LayoutItem_SetPosition(left, top, right, bottom int) *Widget { + xc.XWidget_LayoutItem_SetPosition(w.Handle, left, top, right, bottom) + return w } // 窗口组件_置ID, 设置元素ID. // // nID: ID值. -func (w *Widget) SetID(nID int32) int { - return xc.XWidget_SetID(w.Handle, nID) +func (w *Widget) SetID(nID int32) *Widget { + xc.XWidget_SetID(w.Handle, nID) + return w } // 窗口组件_置UID, 设置元素UID, 全局唯一标识符. // // nUID: UID值. -func (w *Widget) SetUID(nUID int32) int { - return xc.XWidget_SetUID(w.Handle, nUID) +func (w *Widget) SetUID(nUID int32) *Widget { + xc.XWidget_SetUID(w.Handle, nUID) + return w } // 窗口组件_置名称 设置元素name. // // pName: name值. -func (w *Widget) SetName(pName string) int { - return xc.XWidget_SetName(w.Handle, pName) +func (w *Widget) SetName(pName string) *Widget { + xc.XWidget_SetName(w.Handle, pName) + return w } // 窗口组件_取ID, 获取元素ID. diff --git a/res/resource.go b/res/resource.go index f9e9ae9..afcf47b 100644 --- a/res/resource.go +++ b/res/resource.go @@ -5,21 +5,21 @@ import "github.com/twgh/xcgui/xc" // 资源_启用延迟加载, 启用延迟加载; 图片文件, 列表项模板文件. // // bEnable: 是否启用. -func EnableDelayLoad(bEnable bool) int { - return xc.XRes_EnableDelayLoad(bEnable) +func EnableDelayLoad(bEnable bool) { + xc.XRes_EnableDelayLoad(bEnable) } // 资源_置文件加载回调, 设置文件加载回调函数. // // pFun: 回调函数. -func SetLoadFileCallback(pFun interface{}) int { - return xc.XRes_SetLoadFileCallback(pFun) +func SetLoadFileCallback(pFun xc.FunLoadFile) { + xc.XRes_SetLoadFileCallback(pFun) } // 资源_取ID值, 获取资源ID整型值. // // pName: 资源ID名称. -func GetIDValue(pName string) int { +func GetIDValue(pName string) int32 { return xc.XRes_GetIDValue(pName) } diff --git a/svg/svg.go b/svg/svg.go index 2a5c996..e5d7bb3 100644 --- a/svg/svg.go +++ b/svg/svg.go @@ -5,7 +5,7 @@ import ( "github.com/twgh/xcgui/xc" ) -// SVG矢量图形. +// Svg SVG矢量图形. type Svg struct { objectbase.ObjectBase } @@ -105,8 +105,9 @@ func NewByRes(id int32, pType string, hModule uintptr) *Svg { // nWidth: 宽度. // // nHeight: 高度. -func (s *Svg) SetSize(nWidth, nHeight int32) { +func (s *Svg) SetSize(nWidth, nHeight int32) *Svg { xc.XSvg_SetSize(s.Handle, nWidth, nHeight) + return s } // SVG_取大小. @@ -114,8 +115,9 @@ func (s *Svg) SetSize(nWidth, nHeight int32) { // pWidth: 接收返回宽度. // // pHeight: 接收返回高度. -func (s *Svg) GetSize(pWidth, pHeight *int32) { +func (s *Svg) GetSize(pWidth, pHeight *int32) *Svg { xc.XSvg_GetSize(s.Handle, pWidth, pHeight) + return s } // SVG_取宽度. @@ -133,8 +135,9 @@ func (s *Svg) GetHeight() int32 { // x: x轴偏移. // // y: y轴偏移. -func (s *Svg) SetPosition(x, y int32) { +func (s *Svg) SetPosition(x, y int32) *Svg { xc.XSvg_SetPosition(s.Handle, x, y) + return s } // SVG_取偏移. @@ -142,8 +145,9 @@ func (s *Svg) SetPosition(x, y int32) { // pX: x轴偏移. // // pY: y轴偏移. -func (s *Svg) GetPosition(pX, pY *int32) { +func (s *Svg) GetPosition(pX, pY *int32) *Svg { xc.XSvg_GetPosition(s.Handle, pX, pY) + return s } // SVG_置偏移F. @@ -151,8 +155,9 @@ func (s *Svg) GetPosition(pX, pY *int32) { // x: x轴偏移. // // y: y轴偏移. -func (s *Svg) SetPositionF(x, y float32) { +func (s *Svg) SetPositionF(x, y float32) *Svg { xc.XSvg_SetPositionF(s.Handle, x, y) + return s } // SVG_取偏移F. @@ -160,32 +165,37 @@ func (s *Svg) SetPositionF(x, y float32) { // pX: x轴偏移. // // pY: y轴偏移. -func (s *Svg) GetPositionF(pX, pY *float32) { +func (s *Svg) GetPositionF(pX, pY *float32) *Svg { xc.XSvg_GetPositionF(s.Handle, pX, pY) + return s } // SVG_取视图框. // // pViewBox: 接收返回视图框. -func (s *Svg) GetViewBox(pViewBox *xc.RECT) { +func (s *Svg) GetViewBox(pViewBox *xc.RECT) *Svg { xc.XSvg_GetViewBox(s.Handle, pViewBox) + return s } // SVG_启用自动销毁. // // bEnable: 是否自动销毁. -func (s *Svg) EnableAutoDestroy(bEnable bool) { +func (s *Svg) EnableAutoDestroy(bEnable bool) *Svg { xc.XSvg_EnableAutoDestroy(s.Handle, bEnable) + return s } // SVG_增加引用计数. -func (s *Svg) AddRef() { +func (s *Svg) AddRef() *Svg { xc.XSvg_AddRef(s.Handle) + return s } // SVG_释放引用计数. -func (s *Svg) Release() { +func (s *Svg) Release() *Svg { xc.XSvg_Release(s.Handle) + return s } // SVG_取引用计数. @@ -194,15 +204,17 @@ func (s *Svg) GetRefCount() int32 { } // SVG_销毁. -func (s *Svg) Destroy() { +func (s *Svg) Destroy() *Svg { xc.XSvg_Destroy(s.Handle) + return s } // SVG_置透明度. // // alpha: 透明度. -func (s *Svg) SetAlpha(alpha byte) { +func (s *Svg) SetAlpha(alpha byte) *Svg { xc.XSvg_SetAlpha(s.Handle, alpha) + return s } // SVG_取透明度, 返回透明度. @@ -215,8 +227,9 @@ func (s *Svg) GetAlpha() byte { // color: 颜色, AGBR颜色. // // bEnable: 是否有效. -func (s *Svg) SetUserFillColor(color int, bEnable bool) { +func (s *Svg) SetUserFillColor(color int, bEnable bool) *Svg { xc.XSvg_SetUserFillColor(s.Handle, color, bEnable) + return s } // SVG_置用户笔触颜色, 用户颜色将覆盖默认样式. @@ -226,8 +239,9 @@ func (s *Svg) SetUserFillColor(color int, bEnable bool) { // strokeWidth: 笔触宽度. // // bEnable: 是否有效. -func (s *Svg) SetUserStrokeColor(color int, strokeWidth float32, bEnable bool) { +func (s *Svg) SetUserStrokeColor(color int, strokeWidth float32, bEnable bool) *Svg { xc.XSvg_SetUserStrokeColor(s.Handle, color, strokeWidth, bEnable) + return s } // SVG_取用户填充颜色. @@ -249,8 +263,9 @@ func (s *Svg) GetUserStrokeColor(pColor *int, pStrokeWidth *float32) bool { // SVG_置旋转角度, 默认以自身中心点旋转. // // angle: 转角度. -func (s *Svg) SetRotateAngle(angle float32) { +func (s *Svg) SetRotateAngle(angle float32) *Svg { xc.XSvg_SetRotateAngle(s.Handle, angle) + return s } // SVG_取旋转角度, 返回旋转角度. @@ -267,8 +282,9 @@ func (s *Svg) GetRotateAngle() float32 { // y: 旋转中心点Y. // // bOffset: TRUE: 旋转中心点相对于自身中心偏移, FALSE:使用绝对坐标. -func (s *Svg) SetRotate(angle float32, x float32, y float32, bOffset bool) { +func (s *Svg) SetRotate(angle float32, x float32, y float32, bOffset bool) *Svg { xc.XSvg_SetRotate(s.Handle, angle, x, y, bOffset) + return s } // SVG_取旋转. @@ -280,13 +296,15 @@ func (s *Svg) SetRotate(angle float32, x float32, y float32, bOffset bool) { // pY: 返回 旋转中心点Y. // // pbOffset: 返回TRUE: 旋转中心点相对于自身中心偏移, FALSE:使用绝对坐标. -func (s *Svg) GetRotate(pAngle *float32, pX *float32, pY *float32, pbOffset *bool) { +func (s *Svg) GetRotate(pAngle *float32, pX *float32, pY *float32, pbOffset *bool) *Svg { xc.XSvg_GetRotate(s.Handle, pAngle, pX, pY, pbOffset) + return s } // SVG_显示, 显示或隐藏. // // bShow: 是否显示. -func (s *Svg) Show(bShow bool) { +func (s *Svg) Show(bShow bool) *Svg { xc.XSvg_Show(s.Handle, bShow) + return s } diff --git a/tmpl/node.go b/tmpl/node.go index a060e7c..617d8ea 100644 --- a/tmpl/node.go +++ b/tmpl/node.go @@ -21,8 +21,9 @@ func NewNode(nType xcc.XC_OBJECT_TYPE) *Node { } // 给本类的Handle赋值. -func (n *Node) SetHandle(handle int) { +func (n *Node) SetHandle(handle int) *Node { n.Handle = handle + return n } // 模板_取节点, 获取节点, 根据itemID. 返回节点对象. diff --git a/wapi/wutil/common_test.go b/wapi/wutil/common_test.go index 8dd9e25..96f4590 100644 --- a/wapi/wutil/common_test.go +++ b/wapi/wutil/common_test.go @@ -41,5 +41,5 @@ func TestSaveFile(t *testing.T) { func TestChooseColor(t *testing.T) { rgb := wutil.ChooseColor(0) fmt.Println("rgb颜色", rgb) - fmt.Println("abgr颜色", xc.RGB2ABGR(rgb, 255)) + fmt.Println("ARGB颜色", xc.RGB2ARGB(rgb, 255)) } diff --git a/widget/button.go b/widget/button.go index d51568e..083a352 100644 --- a/widget/button.go +++ b/widget/button.go @@ -85,8 +85,9 @@ func (b *Button) SetCheck(bCheck bool) bool { // // @param nState 按钮状态: xcc.Common_State3_. // @return int -func (b *Button) SetState(nState xcc.Common_State3_) int { - return xc.XBtn_SetState(b.Handle, nState) +func (b *Button) SetState(nState xcc.Common_State3_) *Button { + xc.XBtn_SetState(b.Handle, nState) + return b } // GetState 按钮_取状态. @@ -106,15 +107,17 @@ func (b *Button) GetStateEx() xcc.Button_State_ { // 按钮_置类型扩展, 设置按钮类型并自动修改样式和文本对齐方式. // // nType: 按钮类型, Button_Type_ , element_type_ , xc_ex_error. -func (b *Button) SetTypeEx(nType xcc.XC_OBJECT_TYPE_EX) int { - return xc.XBtn_SetTypeEx(b.Handle, nType) +func (b *Button) SetTypeEx(nType xcc.XC_OBJECT_TYPE_EX) *Button { + xc.XBtn_SetTypeEx(b.Handle, nType) + return b } // 按钮_置组ID. // // nID: 组ID. -func (b *Button) SetGroupID(nID int32) int { - return xc.XBtn_SetGroupID(b.Handle, nID) +func (b *Button) SetGroupID(nID int32) *Button { + xc.XBtn_SetGroupID(b.Handle, nID) + return b } // 按钮_取组ID. @@ -125,8 +128,9 @@ func (b *Button) GetGroupID() int32 { // 按钮_置绑定元素. // // hBindEle: 将要绑定的元素. -func (b *Button) SetBindEle(hBindEle int) int { - return xc.XBtn_SetBindEle(b.Handle, hBindEle) +func (b *Button) SetBindEle(hBindEle int) *Button { + xc.XBtn_SetBindEle(b.Handle, hBindEle) + return b } // 按钮_取绑定元素, 返回: 绑定的元素句柄. @@ -137,8 +141,9 @@ func (b *Button) GetBindEle() int { // 按钮_置文本对齐. // // nFlags: 对齐方式, TextFormatFlag_ , TextAlignFlag_ , TextTrimming_. -func (b *Button) SetTextAlign(nFlags xcc.TextFormatFlag_) int { - return xc.XBtn_SetTextAlign(b.Handle, nFlags) +func (b *Button) SetTextAlign(nFlags xcc.TextFormatFlag_) *Button { + xc.XBtn_SetTextAlign(b.Handle, nFlags) + return b } // 按钮_取文本对齐方式, 返回: TextFormatFlag_ , TextAlignFlag_ , TextTrimming_. @@ -149,8 +154,9 @@ func (b *Button) GetTextAlign() xcc.TextFormatFlag_ { // 按钮_置图标对齐. // // align: 对齐方式, Button_Icon_Align_. -func (b *Button) SetIconAlign(align xcc.Button_Icon_Align_) int { - return xc.XBtn_SetIconAlign(b.Handle, align) +func (b *Button) SetIconAlign(align xcc.Button_Icon_Align_) *Button { + xc.XBtn_SetIconAlign(b.Handle, align) + return b } // 按钮_置偏移, 设置按钮文本坐标偏移量. @@ -158,8 +164,9 @@ func (b *Button) SetIconAlign(align xcc.Button_Icon_Align_) int { // x: 偏移量. // // y: 偏移量. -func (b *Button) SetOffset(x int, y int) int { - return xc.XBtn_SetOffset(b.Handle, x, y) +func (b *Button) SetOffset(x int, y int) *Button { + xc.XBtn_SetOffset(b.Handle, x, y) + return b } // 按钮_置图标偏移, 设置按钮图标坐标偏移量. @@ -167,22 +174,25 @@ func (b *Button) SetOffset(x int, y int) int { // x: 偏移量. // // y: 偏移量. -func (b *Button) SetOffsetIcon(x int, y int) int { - return xc.XBtn_SetOffsetIcon(b.Handle, x, y) +func (b *Button) SetOffsetIcon(x int, y int) *Button { + xc.XBtn_SetOffsetIcon(b.Handle, x, y) + return b } // 按钮_置图标间隔, 设置图标与文本间隔大小. // // size: 间隔大小. -func (b *Button) SetIconSpace(size int) int { - return xc.XBtn_SetIconSpace(b.Handle, size) +func (b *Button) SetIconSpace(size int) *Button { + xc.XBtn_SetIconSpace(b.Handle, size) + return b } // 按钮_置文本. // // pName: 文本内容. -func (b *Button) SetText(pName string) int { - return xc.XBtn_SetText(b.Handle, pName) +func (b *Button) SetText(pName string) *Button { + xc.XBtn_SetText(b.Handle, pName) + return b } // 按钮_取文本. @@ -193,15 +203,17 @@ func (b *Button) GetText() string { // 按钮_置图标. // // hImage: 图片句柄. -func (b *Button) SetIcon(hImage int) int { - return xc.XBtn_SetIcon(b.Handle, hImage) +func (b *Button) SetIcon(hImage int) *Button { + xc.XBtn_SetIcon(b.Handle, hImage) + return b } // 按钮_置禁用图标. // // hImage: 图片句柄. -func (b *Button) SetIconDisable(hImage int) int { - return xc.XBtn_SetIconDisable(b.Handle, hImage) +func (b *Button) SetIconDisable(hImage int) *Button { + xc.XBtn_SetIconDisable(b.Handle, hImage) + return b } // 按钮_取图标, 返回图标句柄. @@ -216,8 +228,9 @@ func (b *Button) GetIcon(nType int) int { // hImage: 图片句柄. // // uElapse: 图片帧延时, 单位毫秒. -func (b *Button) AddAnimationFrame(hImage int, uElapse int) int { - return xc.XBtn_AddAnimationFrame(b.Handle, hImage, uElapse) +func (b *Button) AddAnimationFrame(hImage int, uElapse int) *Button { + xc.XBtn_AddAnimationFrame(b.Handle, hImage, uElapse) + return b } // 按钮_启用动画, 开始或关闭图片动画的播放. @@ -225,8 +238,17 @@ func (b *Button) AddAnimationFrame(hImage int, uElapse int) int { // bEnable: 开始播放动画TRUE, 关闭播放动画FALSE. // // bLoopPlay: 是否循环播放. -func (b *Button) EnableAnimation(bEnable bool, bLoopPlay bool) int { - return xc.XBtn_EnableAnimation(b.Handle, bEnable, bLoopPlay) +func (b *Button) EnableAnimation(bEnable bool, bLoopPlay bool) *Button { + xc.XBtn_EnableAnimation(b.Handle, bEnable, bLoopPlay) + return b +} + +// 按钮_启用热键前缀. 对当前文本内容处理, 将&符号后面的一个字符加上下划线. +// +// bEnable: 是否启用. +func (b *Button) EnableHotkeyPrefix(bEnable bool) *Button { + xc.XBtn_EnableHotkeyPrefix(b.Handle, bEnable) + return b } /* diff --git a/widget/combobox.go b/widget/combobox.go index 61ea86b..863fd8a 100644 --- a/widget/combobox.go +++ b/widget/combobox.go @@ -82,8 +82,9 @@ func (c *ComboBox) CreateAdapter() int { // 组合框_绑定数据适配器. // // hAdapter: 适配器句柄. -func (c *ComboBox) BindAdapter(hAdapter int) int { - return xc.XComboBox_BindAdapter(c.Handle, hAdapter) +func (c *ComboBox) BindAdapter(hAdapter int) *ComboBox { + xc.XComboBox_BindAdapter(c.Handle, hAdapter) + return c } // 组合框_取数据适配器, 获取绑定的数据适配器. @@ -94,29 +95,33 @@ func (c *ComboBox) GetAdapter() int { // 组合框_置绑定名称. // // pName: 字段名. -func (c *ComboBox) SetBindName(pName string) int { - return xc.XComboBox_SetBindName(c.Handle, pName) +func (c *ComboBox) SetBindName(pName string) *ComboBox { + xc.XComboBox_SetBindName(c.Handle, pName) + return c } // 组合框_取下拉按钮坐标. // // pRect: 坐标. -func (c *ComboBox) GetButtonRect(pRect *xc.RECT) int { - return xc.XComboBox_GetButtonRect(c.Handle, pRect) +func (c *ComboBox) GetButtonRect(pRect *xc.RECT) *ComboBox { + xc.XComboBox_GetButtonRect(c.Handle, pRect) + return c } // 组合框_置下拉按钮大小. // // size: 大小. -func (c *ComboBox) SetButtonSize(size int) int { - return xc.XComboBox_SetButtonSize(c.Handle, size) +func (c *ComboBox) SetButtonSize(size int) *ComboBox { + xc.XComboBox_SetButtonSize(c.Handle, size) + return c } // 组合框_置下拉列表高度. // // height: 高度, -1自动计算高度. -func (c *ComboBox) SetDropHeight(height int) int { - return xc.XComboBox_SetDropHeight(c.Handle, height) +func (c *ComboBox) SetDropHeight(height int) *ComboBox { + xc.XComboBox_SetDropHeight(c.Handle, height) + return c } // 组合框_取下拉列表高度. @@ -127,36 +132,41 @@ func (c *ComboBox) GetDropHeight() int { // 组合框_置项模板, 设置下拉列表项模板文件. // // pXmlFile: 项模板文件. -func (c *ComboBox) SetItemTemplateXML(pXmlFile string) int { - return xc.XComboBox_SetItemTemplateXML(c.Handle, pXmlFile) +func (c *ComboBox) SetItemTemplateXML(pXmlFile string) *ComboBox { + xc.XComboBox_SetItemTemplateXML(c.Handle, pXmlFile) + return c } // 组合框_置项模板从字符串, 设置下拉列表项模板. // // pStringXML: 字符串. -func (c *ComboBox) SetItemTemplateXMLFromString(pStringXML string) int { - return xc.XComboBox_SetItemTemplateXMLFromString(c.Handle, pStringXML) +func (c *ComboBox) SetItemTemplateXMLFromString(pStringXML string) *ComboBox { + xc.XComboBox_SetItemTemplateXMLFromString(c.Handle, pStringXML) + return c } // 组合框_启用绘制下拉按钮, 是否绘制下拉按钮. // // bEnable: 是否绘制. -func (c *ComboBox) EnableDrawButton(bEnable bool) int { - return xc.XComboBox_EnableDrawButton(c.Handle, bEnable) +func (c *ComboBox) EnableDrawButton(bEnable bool) *ComboBox { + xc.XComboBox_EnableDrawButton(c.Handle, bEnable) + return c } // 组合框_启用编辑, 启用可编辑显示的文本内容. // // bEdit: TRUE可编辑. -func (c *ComboBox) EnableEdit(bEdit bool) int { - return xc.XComboBox_EnableEdit(c.Handle, bEdit) +func (c *ComboBox) EnableEdit(bEdit bool) *ComboBox { + xc.XComboBox_EnableEdit(c.Handle, bEdit) + return c } // 组合框_启用下拉列表高度固定大小, 启用/关闭下拉列表高度固定大小. // // bEnable: 是否启用. -func (c *ComboBox) EnableDropHeightFixed(bEnable bool) int { - return xc.XComboBox_EnableDropHeightFixed(c.Handle, bEnable) +func (c *ComboBox) EnableDropHeightFixed(bEnable bool) *ComboBox { + xc.XComboBox_EnableDropHeightFixed(c.Handle, bEnable) + return c } // 组合框_取选择项, 获取组合框下拉列表中选择项索引. @@ -426,13 +436,15 @@ func (c *ComboBox) DeleteItemEx(iItem int, nCount int) bool { } // 组合框_删除项全部. -func (c *ComboBox) DeleteItemAll() int { - return xc.XComboBox_DeleteItemAll(c.Handle) +func (c *ComboBox) DeleteItemAll() *ComboBox { + xc.XComboBox_DeleteItemAll(c.Handle) + return c } // 组合框_删除列全部. -func (c *ComboBox) DeleteColumnAll() int { - return xc.XComboBox_DeleteColumnAll(c.Handle) +func (c *ComboBox) DeleteColumnAll() *ComboBox { + xc.XComboBox_DeleteColumnAll(c.Handle) + return c } // 组合框_取项数量. @@ -446,14 +458,15 @@ func (c *ComboBox) GetCountColumn() int { } // 组合框_弹出下拉列表. -func (c *ComboBox) PopupDropList() int { - return xc.XComboBox_PopupDropList(c.Handle) +func (c *ComboBox) PopupDropList() *ComboBox { + xc.XComboBox_PopupDropList(c.Handle) + return c } // 组合框_设置项模板. // // hTemp: 模板句柄. -func (c *ComboBox) SetItemTemplate(hTemp int) int { +func (c *ComboBox) SetItemTemplate(hTemp int) bool { return xc.XComboBox_SetItemTemplate(c.Handle, hTemp) } diff --git a/widget/datetime.go b/widget/datetime.go index 53a48b7..be42aac 100644 --- a/widget/datetime.go +++ b/widget/datetime.go @@ -70,8 +70,9 @@ func NewDateTimeByUIDName(name string) *DateTime { // 日期_置样式, 设置样式. // // nStyle: 样式: 0为日期元素, 1为时间元素. -func (d *DateTime) SetStyle(nStyle int) int { - return xc.XDateTime_SetStyle(d.Handle, nStyle) +func (d *DateTime) SetStyle(nStyle int) *DateTime { + xc.XDateTime_SetStyle(d.Handle, nStyle) + return d } // 日期_取样式, 返回元素样式. @@ -82,8 +83,9 @@ func (d *DateTime) GetStyle() int { // 日期_启用分割栏为斜线, 切换分割栏为: 斜线或横线. // // bSlash: TRUE: 斜线, FALSE: 横线. -func (d *DateTime) EnableSplitSlash(bSlash bool) int { - return xc.XDateTime_EnableSplitSlash(d.Handle, bSlash) +func (d *DateTime) EnableSplitSlash(bSlash bool) *DateTime { + xc.XDateTime_EnableSplitSlash(d.Handle, bSlash) + return d } // 日期_取内部按钮, 获取内部按钮元素. @@ -100,9 +102,10 @@ func (d *DateTime) GetSelBkColor() int { // 日期_置选择日期背景颜色, 设置被选择文字的背景颜色. // -// crSelectBk: 文字被选中背景色, ABGR 颜色. -func (d *DateTime) SetSelBkColor(crSelectBk int) int { - return xc.XDateTime_SetSelBkColor(d.Handle, crSelectBk) +// crSelectBk: 文字被选中背景色, ARGB 颜色. +func (d *DateTime) SetSelBkColor(crSelectBk int) *DateTime { + xc.XDateTime_SetSelBkColor(d.Handle, crSelectBk) + return d } // 日期_取当前日期. @@ -112,8 +115,9 @@ func (d *DateTime) SetSelBkColor(crSelectBk int) int { // pnMonth: 月.[OUT]. // // pnDay: 日.[OUT]. -func (d *DateTime) GetDate(pnYear *int32, pnMonth *int32, pnDay *int32) int { - return xc.XDateTime_GetDate(d.Handle, pnYear, pnMonth, pnDay) +func (d *DateTime) GetDate(pnYear *int32, pnMonth *int32, pnDay *int32) *DateTime { + xc.XDateTime_GetDate(d.Handle, pnYear, pnMonth, pnDay) + return d } // 日期_置当前日期. @@ -123,8 +127,9 @@ func (d *DateTime) GetDate(pnYear *int32, pnMonth *int32, pnDay *int32) int { // nMonth: 月. // // nDay: 日. -func (d *DateTime) SetDate(nYear int32, nMonth int32, nDay int32) int { - return xc.XDateTime_SetDate(d.Handle, nYear, nMonth, nDay) +func (d *DateTime) SetDate(nYear int32, nMonth int32, nDay int32) *DateTime { + xc.XDateTime_SetDate(d.Handle, nYear, nMonth, nDay) + return d } // 日期_取当前时间. @@ -134,8 +139,9 @@ func (d *DateTime) SetDate(nYear int32, nMonth int32, nDay int32) int { // pnMinute: 分.[OUT]. // // pnSecond: 秒.[OUT]. -func (d *DateTime) GetTime(pnHour *int32, pnMinute *int32, pnSecond *int32) int { - return xc.XDateTime_GetTime(d.Handle, pnHour, pnMinute, pnSecond) +func (d *DateTime) GetTime(pnHour *int32, pnMinute *int32, pnSecond *int32) *DateTime { + xc.XDateTime_GetTime(d.Handle, pnHour, pnMinute, pnSecond) + return d } // 日期_社区当前时间, 设置当前时分秒. @@ -145,13 +151,15 @@ func (d *DateTime) GetTime(pnHour *int32, pnMinute *int32, pnSecond *int32) int // nMinute: 分. // // nSecond: 秒. -func (d *DateTime) SetTime(nHour int32, nMinute int32, nSecond int32) int { - return xc.XDateTime_SetTime(d.Handle, nHour, nMinute, nSecond) +func (d *DateTime) SetTime(nHour int32, nMinute int32, nSecond int32) *DateTime { + xc.XDateTime_SetTime(d.Handle, nHour, nMinute, nSecond) + return d } // 日期_弹出, 弹出月历卡片. -func (d *DateTime) Popup() int { - return xc.XDateTime_Popup(d.Handle) +func (d *DateTime) Popup() *DateTime { + xc.XDateTime_Popup(d.Handle) + return d } /* diff --git a/widget/deprecated.go b/widget/deprecated.go new file mode 100644 index 0000000..75252d1 --- /dev/null +++ b/widget/deprecated.go @@ -0,0 +1,194 @@ +package widget + +import ( + "github.com/twgh/xcgui/xcc" +) + +/* +// //////////////////////////////////// 旧版函数 ////////////////////////////////////// +*/ + +// Deprecated +// +// !这是旧版函数, 请使用 AddRowText +func (l *List) AddItemText(pText string) int { + return l.AddRowText(pText) +} + +// Deprecated +// +// !这是旧版函数, 请使用 AddRowTextEx +func (l *List) AddItemTextEx(pName string, pText string) int { + return l.AddRowTextEx(pName, pText) +} + +// Deprecated +// +// !这是旧版函数, 请使用 AddRowImage +func (l *List) AddItemImage(hImage int) int { + return l.AddRowImage(hImage) +} + +// Deprecated +// +// !这是旧版函数, 请使用 AddRowImageEx +func (l *List) AddItemImageEx(pName string, hImage int) int { + return l.AddRowImageEx(pName, hImage) +} + +// Deprecated +// +// !这是旧版函数, 请使用 InsertRowText +func (l *List) InsertItemText(iItem int, pValue string) int { + return l.InsertRowText(iItem, pValue) +} + +// Deprecated +// +// !这是旧版函数, 请使用 InsertRowTextEx +func (l *List) InsertItemTextEx(iItem int, pName string, pValue string) int { + return l.InsertRowTextEx(iItem, pName, pValue) +} + +// Deprecated +// +// !这是旧版函数, 请使用 InsertRowImage +func (l *List) InsertItemImage(iItem int, hImage int) int { + return l.InsertRowImage(iItem, hImage) +} + +// Deprecated +// +// !这是旧版函数, 请使用 InsertRowImageEx +func (l *List) InsertItemImageEx(iItem int, pName string, hImage int) int { + return l.InsertRowImageEx(iItem, pName, hImage) +} + +// Deprecated +// +// !这是旧版函数, 请使用 DeleteRow +func (l *List) DeleteItem(iItem int) bool { + return l.DeleteRow(iItem) +} + +// Deprecated +// +// !这是旧版函数, 请使用 DeleteRowEx +func (l *List) DeleteItemEx(iItem int, nCount int) bool { + return l.DeleteRowEx(iItem, nCount) +} + +// Deprecated +// +// !这是旧版函数, 请使用 DeleteRowAll +func (l *List) DeleteItemAll() *List { + return l.DeleteRowAll() +} + +// Deprecated +// +// !这是旧版函数, 请使用 SetSelectRow +func (l *List) SetSelectItem(iItem int) bool { + return l.SetSelectRow(iItem) +} + +// Deprecated +// +// !这是旧版函数, 请使用 GetSelectRow +func (l *List) GetSelectItem() int { + return l.GetSelectRow() +} + +// Deprecated +// +// !这是旧版函数, 请使用 GetSelectRowCount +func (l *List) GetSelectItemCount() int { + return l.GetSelectRowCount() +} + +// Deprecated +// +// !这是旧版函数, 请使用 AddSelectRow +func (l *List) AddSelectItem(iItem int) bool { + return l.AddSelectRow(iItem) +} + +// Deprecated +// +// !这是旧版函数, 请使用 VisibleRow +func (l *List) VisibleItem(iItem int) *List { + return l.VisibleRow(iItem) +} + +// Deprecated +// +// !这是旧版函数, 请使用 CancelSelectRow +func (l *List) CancelSelectItem(iItem int) bool { + return l.CancelSelectRow(iItem) +} + +// Deprecated +// +// !这是旧版函数, 请使用 GetHeaderColumnIndexFromHXCGUI +func (l *List) GetHeaderItemIndexFromHXCGUI(hXCGUI int) int { + return l.GetHeaderColumnIndexFromHXCGUI(hXCGUI) +} + +// Deprecated +// +// !这是旧版函数, 请使用 GetRowIndexFromHXCGUI +func (l *List) GetItemIndexFromHXCGUI(hXCGUI int) int { + return l.GetRowIndexFromHXCGUI(hXCGUI) +} + +// Deprecated +// +// !这是旧版函数, 请使用 SetRowHeightDefault +func (l *List) SetItemHeightDefault(nHeight int32, nSelHeight int32) *List { + return l.SetRowHeightDefault(nHeight, nSelHeight) +} + +// Deprecated +// +// !这是旧版函数, 请使用 GetRowHeightDefault +func (l *List) GetItemHeightDefault(pHeight *int32, pSelHeight *int32) *List { + return l.GetRowHeightDefault(pHeight, pSelHeight) +} + +// Deprecated +// +// !这是旧版函数, 请使用 SetRowHeight +func (l *List) SetItemHeight(iRow int, nHeight, nSelHeight int32) *List { + return l.SetRowHeight(iRow, nHeight, nSelHeight) +} + +// Deprecated +// +// !这是旧版函数, 请使用 GetRowHeight +func (l *List) GetItemHeight(iRow int, pHeight, pSelHeight *int32) *List { + return l.GetRowHeight(iRow, pHeight, pSelHeight) +} + +// Deprecated +// +// !这是旧版函数, 请使用 EnableRowBkFull +func (l *List) EnableItemBkFullRow(bFull bool) *List { + l.EnableRowBkFull(bFull) + return l +} + +// Deprecated +// +// !这是旧版函数, 请使用 SetDrawRowBkFlags +func (l *List) SetDrawItemBkFlags(nFlags xcc.List_DrawItemBk_Flag_) *List { + l.SetDrawRowBkFlags(nFlags) + return l +} + +// Deprecated +// +// !这是旧版函数, 请使用 RefreshRow +func (l *List) RefreshItem(iRow int) *List { + l.RefreshRow(iRow) + return l +} diff --git a/widget/edit.go b/widget/edit.go index afabf19..3e38837 100644 --- a/widget/edit.go +++ b/widget/edit.go @@ -89,43 +89,49 @@ func NewEditByUIDName(name string) *Edit { // 编辑框_启用自动换行. // // bEnable: 是否启用. -func (e *Edit) EnableAutoWrap(bEnable bool) int { - return xc.XEdit_EnableAutoWrap(e.Handle, bEnable) +func (e *Edit) EnableAutoWrap(bEnable bool) *Edit { + xc.XEdit_EnableAutoWrap(e.Handle, bEnable) + return e } // 编辑框_启用只读. // // bEnable: 是否启用. -func (e *Edit) EnableReadOnly(bEnable bool) int { - return xc.XEdit_EnableReadOnly(e.Handle, bEnable) +func (e *Edit) EnableReadOnly(bEnable bool) *Edit { + xc.XEdit_EnableReadOnly(e.Handle, bEnable) + return e } // 编辑框_启用多行. // // bEnable:. -func (e *Edit) EnableMultiLine(bEnable bool) int { - return xc.XEdit_EnableMultiLine(e.Handle, bEnable) +func (e *Edit) EnableMultiLine(bEnable bool) *Edit { + xc.XEdit_EnableMultiLine(e.Handle, bEnable) + return e } // 编辑框_启用密码, 启用密码模式(只支持默认类型编辑框). // // bEnable: 是否启用. -func (e *Edit) EnablePassword(bEnable bool) int { - return xc.XEdit_EnablePassword(e.Handle, bEnable) +func (e *Edit) EnablePassword(bEnable bool) *Edit { + xc.XEdit_EnablePassword(e.Handle, bEnable) + return e } // 编辑框_启用自动选择, 当获得焦点时,自动选择所有内容. // // bEnable: 是否启用. -func (e *Edit) EnableAutoSelAll(bEnable bool) int { - return xc.XEdit_EnableAutoSelAll(e.Handle, bEnable) +func (e *Edit) EnableAutoSelAll(bEnable bool) *Edit { + xc.XEdit_EnableAutoSelAll(e.Handle, bEnable) + return e } // 编辑框_启用自动取消选择, 当失去焦点时自动取消选择. // // bEnable: 是否启用. -func (e *Edit) EnableAutoCancelSel(bEnable bool) int { - return xc.XEdit_EnableAutoCancelSel(e.Handle, bEnable) +func (e *Edit) EnableAutoCancelSel(bEnable bool) *Edit { + xc.XEdit_EnableAutoCancelSel(e.Handle, bEnable) + return e } // 编辑框_是否只读. @@ -179,62 +185,71 @@ func (e *Edit) GetData() xc.Edit_Data_Copy_ { // styleTable: 样式表. // // nStyleCount: 样式数量. -func (e *Edit) AddData(pData *xc.Edit_Data_Copy_, styleTable []uint16, nStyleCount int) int { - return xc.XEdit_AddData(e.Handle, pData, styleTable, nStyleCount) +func (e *Edit) AddData(pData *xc.Edit_Data_Copy_, styleTable []uint16, nStyleCount int) *Edit { + xc.XEdit_AddData(e.Handle, pData, styleTable, nStyleCount) + return e } // 编辑框_释放数据. -func (e *Edit) FreeData(pData *xc.Edit_Data_Copy_) int { - return xc.XEdit_FreeData(pData) +func (e *Edit) FreeData(pData *xc.Edit_Data_Copy_) *Edit { + xc.XEdit_FreeData(pData) + return e } // 编辑框_置默认文本, 当内容为空时, 显示默认文本. // // pString: 文本内容. -func (e *Edit) SetDefaultText(pString string) int { - return xc.XEdit_SetDefaultText(e.Handle, pString) +func (e *Edit) SetDefaultText(pString string) *Edit { + xc.XEdit_SetDefaultText(e.Handle, pString) + return e } // 编辑框_置默认文本颜色. // -// color: ABGR 颜色值. -func (e *Edit) SetDefaultTextColor(color int) int { - return xc.XEdit_SetDefaultTextColor(e.Handle, color) +// color: ARGB 颜色值. +func (e *Edit) SetDefaultTextColor(color int) *Edit { + xc.XEdit_SetDefaultTextColor(e.Handle, color) + return e } // 编辑框_置密码字符. // // ch: 字符. -func (e *Edit) SetPasswordCharacter(ch int) int { - return xc.XEdit_SetPasswordCharacter(e.Handle, ch) +func (e *Edit) SetPasswordCharacter(ch int) *Edit { + xc.XEdit_SetPasswordCharacter(e.Handle, ch) + return e } // 编辑框_置文本对齐, 单行模式下有效. // // align: 对齐方式, Edit_TextAlign_Flag_. -func (e *Edit) SetTextAlign(align xcc.Edit_TextAlign_Flag_) int { - return xc.XEdit_SetTextAlign(e.Handle, align) +func (e *Edit) SetTextAlign(align xcc.Edit_TextAlign_Flag_) *Edit { + xc.XEdit_SetTextAlign(e.Handle, align) + return e } // 编辑框_置TAB空格. // // nSpace: 空格数量. -func (e *Edit) SetTabSpace(nSpace int) int { - return xc.XEdit_SetTabSpace(e.Handle, nSpace) +func (e *Edit) SetTabSpace(nSpace int) *Edit { + xc.XEdit_SetTabSpace(e.Handle, nSpace) + return e } // 编辑框_置文本. // // pString: 字符串. -func (e *Edit) SetText(pString string) int { - return xc.XEdit_SetText(e.Handle, pString) +func (e *Edit) SetText(pString string) *Edit { + xc.XEdit_SetText(e.Handle, pString) + return e } // 编辑框_置文本整数. // // nValue: 整数值. -func (e *Edit) SetTextInt(nValue int) int { - return xc.XEdit_SetTextInt(e.Handle, nValue) +func (e *Edit) SetTextInt(nValue int) *Edit { + xc.XEdit_SetTextInt(e.Handle, nValue) + return e } // 编辑框_取文本, 不包含非文本内容, 返回实际接收文本长度. @@ -242,7 +257,7 @@ func (e *Edit) SetTextInt(nValue int) int { // pOut: 接收文本内存指针. // // nOutlen: 内存大小. 例: GetLength()+1 . -func (e *Edit) GetText(pOut *string, nOutlen int) int { +func (e *Edit) GetText(pOut *string, nOutlen int) int32 { return xc.XEdit_GetText(e.Handle, pOut, nOutlen) } @@ -308,23 +323,26 @@ func (e *Edit) GetAt(iRow int, iCol int) int { // iCol: 列索引. // // pString: 字符串. -func (e *Edit) InsertText(iRow int, iCol int, pString string) int { - return xc.XEdit_InsertText(e.Handle, iRow, iCol, pString) +func (e *Edit) InsertText(iRow int, iCol int, pString string) *Edit { + xc.XEdit_InsertText(e.Handle, iRow, iCol, pString) + return e } // AddTextUser 编辑框_插入文本模拟用户操作, 自动刷新UI, 支持撤销/恢复. // // @param pString 字符串. // @return int -func (e *Edit) AddTextUser(pString string) int { - return xc.XEdit_AddTextUser(e.Handle, pString) +func (e *Edit) AddTextUser(pString string) *Edit { + xc.XEdit_AddTextUser(e.Handle, pString) + return e } // 编辑框_添加文本. // // pString: 字符串. -func (e *Edit) AddText(pString string) int { - return xc.XEdit_AddText(e.Handle, pString) +func (e *Edit) AddText(pString string) *Edit { + xc.XEdit_AddText(e.Handle, pString) + return e } // 编辑框_添加文本扩展. @@ -332,8 +350,9 @@ func (e *Edit) AddText(pString string) int { // pString: 字符串. // // iStyle: 样式索引. -func (e *Edit) AddTextEx(pString string, iStyle int) int { - return xc.XEdit_AddTextEx(e.Handle, pString, iStyle) +func (e *Edit) AddTextEx(pString string, iStyle int) *Edit { + xc.XEdit_AddTextEx(e.Handle, pString, iStyle) + return e } // 编辑框_添加对象, 例如: 字体, 图片, UI对象, 返回样式索引. @@ -346,8 +365,9 @@ func (e *Edit) AddObject(hObj int) int { // 编辑框_添加对象从样式, 当样式为图片时有效. // // iStyle: 样式索引. -func (e *Edit) AddByStyle(iStyle int) int { - return xc.XEdit_AddByStyle(e.Handle, iStyle) +func (e *Edit) AddByStyle(iStyle int) *Edit { + xc.XEdit_AddByStyle(e.Handle, iStyle) + return e } // 编辑框_添加样式, 返回样式索引. @@ -388,36 +408,41 @@ func (e *Edit) GetStyleInfo(iStyle int, info *xc.Edit_Style_Info_) bool { // 编辑框_置当前样式. // // iStyle: 样式索引. -func (e *Edit) SetCurStyle(iStyle int) int { - return xc.XEdit_SetCurStyle(e.Handle, iStyle) +func (e *Edit) SetCurStyle(iStyle int) *Edit { + xc.XEdit_SetCurStyle(e.Handle, iStyle) + return e } // 编辑框_置插入符颜色. // // color: 颜色. -func (e *Edit) SetCaretColor(color int) int { - return xc.XEdit_SetCaretColor(e.Handle, color) +func (e *Edit) SetCaretColor(color int) *Edit { + xc.XEdit_SetCaretColor(e.Handle, color) + return e } // 编辑框_置插入符宽度. // // nWidth: 宽度. -func (e *Edit) SetCaretWidth(nWidth int) int { - return xc.XEdit_SetCaretWidth(e.Handle, nWidth) +func (e *Edit) SetCaretWidth(nWidth int) *Edit { + xc.XEdit_SetCaretWidth(e.Handle, nWidth) + return e } // 编辑框_置选择背景颜色. // -// color: ABGR 颜色. -func (e *Edit) SetSelectBkColor(color int) int { - return xc.XEdit_SetSelectBkColor(e.Handle, color) +// color: ARGB 颜色. +func (e *Edit) SetSelectBkColor(color int) *Edit { + xc.XEdit_SetSelectBkColor(e.Handle, color) + return e } // 编辑框_置默认行高. // // nHeight: 行高. -func (e *Edit) SetRowHeight(nHeight int) int { - return xc.XEdit_SetRowHeight(e.Handle, nHeight) +func (e *Edit) SetRowHeight(nHeight int) *Edit { + xc.XEdit_SetRowHeight(e.Handle, nHeight) + return e } // 编辑框_置指定行高度, 类型为 Edit_Type_Richedit 支持指定不同行高. @@ -425,15 +450,16 @@ func (e *Edit) SetRowHeight(nHeight int) int { // iRow: 行索引. // // nHeight: 高度. -func (e *Edit) SetRowHeightEx(iRow int, nHeight int) int { - return xc.XEdit_SetRowHeightEx(e.Handle, iRow, nHeight) +func (e *Edit) SetRowHeightEx(iRow int, nHeight int) *Edit { + xc.XEdit_SetRowHeightEx(e.Handle, iRow, nHeight) + return e } // SetCurPos 编辑框_置当前位置. // // @param iRow 行索引. -// @return int -func (e *Edit) SetCurPos(iRow int) int { +// @return bool +func (e *Edit) SetCurPos(iRow int) bool { return xc.XEdit_SetCurPos(e.Handle, iRow) } @@ -459,8 +485,20 @@ func (e *Edit) GetCurCol() int { // iCol: 列索引. // // pOut: 接收返回坐标点. -func (e *Edit) GetPoint(iRow int, iCol int, pOut *xc.POINT) int { - return xc.XEdit_GetPoint(e.Handle, iRow, iCol, pOut) +func (e *Edit) GetPoint(iRow int, iCol int, pOut *xc.POINT) *Edit { + xc.XEdit_GetPoint(e.Handle, iRow, iCol, pOut) + return e +} + +// 编辑框_取坐标点Ex. +// +// iRow: 行索引. +// +// iCol: 列索引. +func (e *Edit) GetPointEx(iRow int, iCol int) xc.POINT { + var pt xc.POINT + xc.XEdit_GetPoint(e.Handle, iRow, iCol, &pt) + return pt } // 编辑框_自动滚动, 视图自动滚动到当前插入符位置. @@ -481,9 +519,9 @@ func (e *Edit) AutoScrollEx(iRow int, iCol int) bool { // // @param iPos 位置点. // @param pInfo 行列. -// @return int -func (e *Edit) PosToRowCol(iPos int, pInfo *xc.Position_) int { - return xc.XEdit_PosToRowCol(e.Handle, iPos, pInfo) +func (e *Edit) PosToRowCol(iPos int, pInfo *xc.Position_) *Edit { + xc.XEdit_PosToRowCol(e.Handle, iPos, pInfo) + return e } // 编辑框_选择全部. @@ -537,8 +575,9 @@ func (e *Edit) GetSelectRange(pBegin *xc.Position_, pEnd *xc.Position_) bool { // piStart: 起始行索引. // // piEnd: 结束行索引. -func (e *Edit) GetVisibleRowRange(piStart *int32, piEnd *int32) int { - return xc.XEdit_GetVisibleRowRange(e.Handle, piStart, piEnd) +func (e *Edit) GetVisibleRowRange(piStart *int32, piEnd *int32) *Edit { + xc.XEdit_GetVisibleRowRange(e.Handle, piStart, piEnd) + return e } // 编辑框_删除, 删除指定范围内容. @@ -593,27 +632,31 @@ func (e *Edit) Redo() bool { // hImageBubble: 气泡背景. // // nFlag: 标志, Chat_Flag_. -func (e *Edit) AddChatBegin(hImageAvatar int, hImageBubble int, nFlag xcc.Chat_Flag_) int { - return xc.XEdit_AddChatBegin(e.Handle, hImageAvatar, hImageBubble, nFlag) +func (e *Edit) AddChatBegin(hImageAvatar int, hImageBubble int, nFlag xcc.Chat_Flag_) *Edit { + xc.XEdit_AddChatBegin(e.Handle, hImageAvatar, hImageBubble, nFlag) + return e } // 编辑框_添加气泡结束, 当前行结束. -func (e *Edit) AddChatEnd() int { - return xc.XEdit_AddChatEnd(e.Handle) +func (e *Edit) AddChatEnd() *Edit { + xc.XEdit_AddChatEnd(e.Handle) + return e } // 编辑框_置气泡缩进, 设置聊天气泡内容缩进. // // nIndentation: 缩进值. -func (e *Edit) SetChatIndentation(nIndentation int) int { - return xc.XEdit_SetChatIndentation(e.Handle, nIndentation) +func (e *Edit) SetChatIndentation(nIndentation int) *Edit { + xc.XEdit_SetChatIndentation(e.Handle, nIndentation) + return e } // 编辑框_置行间隔, 设置行间隔大小, 多行模式有效. // // nSpace: 行间隔大小. -func (e *Edit) SetRowSpace(nSpace int) int { - return xc.XEdit_SetRowSpace(e.Handle, nSpace) +func (e *Edit) SetRowSpace(nSpace int) *Edit { + xc.XEdit_SetRowSpace(e.Handle, nSpace) + return e } // 编辑框_置当前位置扩展. @@ -621,8 +664,9 @@ func (e *Edit) SetRowSpace(nSpace int) int { // iRow: 行索引. // // iCol: 列索引. -func (e *Edit) SetCurPosEx(iRow, iCol int32) int { - return xc.XEdit_SetCurPosEx(e.Handle, iRow, iCol) +func (e *Edit) SetCurPosEx(iRow, iCol int32) *Edit { + xc.XEdit_SetCurPosEx(e.Handle, iRow, iCol) + return e } // 编辑框_取当前位置扩展. @@ -630,13 +674,15 @@ func (e *Edit) SetCurPosEx(iRow, iCol int32) int { // iRow: 返回行索引. // // iCol: 返回列索引. -func (e *Edit) GetCurPosEx(iRow, iCol *int32) int { - return xc.XEdit_GetCurPosEx(e.Handle, iRow, iCol) +func (e *Edit) GetCurPosEx(iRow, iCol *int32) *Edit { + xc.XEdit_GetCurPosEx(e.Handle, iRow, iCol) + return e } // 编辑框_移动到末尾. -func (e *Edit) MoveEnd() int { - return xc.XEdit_MoveEnd(e.Handle) +func (e *Edit) MoveEnd() *Edit { + xc.XEdit_MoveEnd(e.Handle) + return e } // 编辑框_行列到位置, 返回位置点. @@ -651,8 +697,9 @@ func (e *Edit) RowColToPos(iRow int, iCol int) int { // 编辑框_置后备字体, 置中文字体. 如果已设置, 当遇到中文字符时使用后备字体, 解决不支持中文的字体的问题 // // hFont: 字体. -func (e *Edit) SetBackFont(hFont int) int { - return xc.XEdit_SetBackFont(e.Handle, hFont) +func (e *Edit) SetBackFont(hFont int) *Edit { + xc.XEdit_SetBackFont(e.Handle, hFont) + return e } // 编辑框_释放样式. @@ -668,7 +715,7 @@ func (e *Edit) ReleaseStyle(iStyle int) bool { // // hFont: 字体句柄. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // bColor: 是否使用颜色. func (e *Edit) ModifyStyle(iStyle int, hFont int, color int, bColor bool) bool { @@ -678,8 +725,9 @@ func (e *Edit) ModifyStyle(iStyle int, hFont int, color int, bColor bool) bool { // 编辑框_置空格大小. // // size: 空格大小. -func (e *Edit) SetSpaceSize(size int) int { - return xc.XEdit_SetSpaceSize(e.Handle, size) +func (e *Edit) SetSpaceSize(size int) *Edit { + xc.XEdit_SetSpaceSize(e.Handle, size) + return e } // 编辑框_置字符间距. @@ -687,8 +735,9 @@ func (e *Edit) SetSpaceSize(size int) int { // size: 英文字符间距大小. // // sizeZh: 中文字符间距大小. -func (e *Edit) SetCharSpaceSize(size int, sizeZh int) int { - return xc.XEdit_SetCharSpaceSize(e.Handle, size, sizeZh) +func (e *Edit) SetCharSpaceSize(size, sizeZh int) *Edit { + xc.XEdit_SetCharSpaceSize(e.Handle, size, sizeZh) + return e } // 编辑框_取选择文本长度, 不包括非文本内容, 返回文本内容长度. @@ -699,8 +748,9 @@ func (e *Edit) GetSelectTextLength() int { // 编辑框_置选择文本样式. // // iStyle: 样式索引. -func (e *Edit) SetSelectTextStyle(iStyle int) int { - return xc.XEdit_SetSelectTextStyle(e.Handle, iStyle) +func (e *Edit) SetSelectTextStyle(iStyle int) *Edit { + xc.XEdit_SetSelectTextStyle(e.Handle, iStyle) + return e } // 编辑框_取文本_临时, 不包含非文本内容. 返回临时文本, 临时缓存区大小: xcc.Text_Buffer_Size . @@ -727,8 +777,9 @@ func (e *Edit) GetSelectText_Temp() string { // hImageBubble: 气泡背景图片句柄. // // nFlag: 聊天气泡对齐方式: xcc.Chat_Flag_ . -func (e *Edit) InsertChatBegin(hImageAvatar int, hImageBubble int, nFlag xcc.Chat_Flag_) int { - return xc.XEdit_InsertChatBegin(e.Handle, hImageAvatar, hImageBubble, nFlag) +func (e *Edit) InsertChatBegin(hImageAvatar int, hImageBubble int, nFlag xcc.Chat_Flag_) *Edit { + xc.XEdit_InsertChatBegin(e.Handle, hImageAvatar, hImageBubble, nFlag) + return e } // 编辑框_取指定行气泡标识. 返回行标识: xcc.Chat_Flag_ @@ -747,8 +798,9 @@ func (e *Edit) GetChatFlags(iRow int) xcc.Chat_Flag_ { // pString: 字符串. // // iStyle: 样式. -func (e *Edit) InsertTextEx(iRow int, iCol int, pString string, iStyle int) int { - return xc.XEdit_InsertTextEx(e.Handle, iRow, iCol, pString, iStyle) +func (e *Edit) InsertTextEx(iRow int, iCol int, pString string, iStyle int) *Edit { + xc.XEdit_InsertTextEx(e.Handle, iRow, iCol, pString, iStyle) + return e } // 编辑框_插入对象. @@ -758,15 +810,27 @@ func (e *Edit) InsertTextEx(iRow int, iCol int, pString string, iStyle int) int // iCol: 列索引. // // hObj: 对象句柄. -func (e *Edit) InsertObject(iRow int, iCol int, hObj int) int { - return xc.XEdit_InsertObject(e.Handle, iRow, iCol, hObj) +func (e *Edit) InsertObject(iRow int, iCol int, hObj int) *Edit { + xc.XEdit_InsertObject(e.Handle, iRow, iCol, hObj) + return e } // 编辑框_置气泡最大宽度. 当值为0时代表不限制宽度. // // nWidth: 最大宽度. -func (e *Edit) SetChatMaxWidth(nWidth int32) { +func (e *Edit) SetChatMaxWidth(nWidth int32) *Edit { xc.XEdit_SetChatMaxWidth(e.Handle, nWidth) + return e +} + +// 编辑框_取总行数扩展. 包含自动换行数量, 返回总行数. +func (e *Edit) GetRowCountEx() int32 { + return xc.XEdit_GetRowCountEx(e.Handle) +} + +// 编辑框_剪贴板复制. 复制全部内容. +func (e *Edit) ClipboardCopyAll() bool { + return xc.XEdit_ClipboardCopyAll(e.Handle) } /* diff --git a/widget/element.go b/widget/element.go index d626793..411921e 100644 --- a/widget/element.go +++ b/widget/element.go @@ -145,36 +145,62 @@ func (e *Element) PostEvent(nEvent xcc.XE_, wParam, lParam uint) int { // 元素_取坐标. // // pRect: 坐标. -func (e *Element) GetRect(pRect *xc.RECT) int { - return xc.XEle_GetRect(e.Handle, pRect) +func (e *Element) GetRect(pRect *xc.RECT) *Element { + xc.XEle_GetRect(e.Handle, pRect) + return e +} + +// 元素_取坐标ex. +func (e *Element) GetRectEx() xc.RECT { + var pRect *xc.RECT + xc.XEle_GetRect(e.Handle, pRect) + return *pRect } // 元素_取逻辑坐标, 获取元素坐标, 逻辑坐标, 包含滚动视图偏移. // // pRect: 坐标. -func (e *Element) GetRectLogic(pRect *xc.RECT) int { - return xc.XEle_GetRectLogic(e.Handle, pRect) +func (e *Element) GetRectLogic(pRect *xc.RECT) *Element { + xc.XEle_GetRectLogic(e.Handle, pRect) + return e +} + +// 元素_取逻辑坐标ex, 获取元素坐标, 逻辑坐标, 包含滚动视图偏移. +func (e *Element) GetRectLogicEx() xc.RECT { + var pRect *xc.RECT + xc.XEle_GetRectLogic(e.Handle, pRect) + return *pRect } // 元素_取客户区坐标. // // pRect: 坐标. -func (e *Element) GetClientRect(pRect *xc.RECT) int { - return xc.XEle_GetClientRect(e.Handle, pRect) +func (e *Element) GetClientRect(pRect *xc.RECT) *Element { + xc.XEle_GetClientRect(e.Handle, pRect) + return e +} + +// 元素_取客户区坐标ex. +func (e *Element) GetClientRectEx() xc.RECT { + var pRect *xc.RECT + xc.XEle_GetClientRect(e.Handle, pRect) + return *pRect } // 元素_置宽度. // // nWidth: 宽度. -func (e *Element) SetWidth(nWidth int) int { - return xc.XEle_SetWidth(e.Handle, nWidth) +func (e *Element) SetWidth(nWidth int) *Element { + xc.XEle_SetWidth(e.Handle, nWidth) + return e } // 元素_置高度. // // nHeight: 高度. -func (e *Element) SetHeight(nHeight int) int { - return xc.XEle_SetHeight(e.Handle, nHeight) +func (e *Element) SetHeight(nHeight int) *Element { + xc.XEle_SetHeight(e.Handle, nHeight) + return e } // 元素_取宽度. @@ -190,36 +216,48 @@ func (e *Element) GetHeight() int { // 元素_窗口客户区坐标到元素客户区坐标, 窗口客户区坐标转换到元素客户区坐标. // // pRect: 坐标. -func (e *Element) RectWndClientToEleClient(pRect *xc.RECT) int { - return xc.XEle_RectWndClientToEleClient(e.Handle, pRect) +func (e *Element) RectWndClientToEleClient(pRect *xc.RECT) *Element { + xc.XEle_RectWndClientToEleClient(e.Handle, pRect) + return e } // 元素_窗口客户区点到元素客户区, 窗口客户区坐标转换到元素客户区坐标. // // pPt: 坐标. -func (e *Element) PointWndClientToEleClient(pPt *xc.POINT) int { - return xc.XEle_PointWndClientToEleClient(e.Handle, pPt) +func (e *Element) PointWndClientToEleClient(pPt *xc.POINT) *Element { + xc.XEle_PointWndClientToEleClient(e.Handle, pPt) + return e } // 元素_客户区坐标到窗口客户区, 元素客户区坐标转换到窗口客户区坐标. // // pRect: 坐标. -func (e *Element) RectClientToWndClient(pRect *xc.RECT) int { - return xc.XEle_RectClientToWndClient(e.Handle, pRect) +func (e *Element) RectClientToWndClient(pRect *xc.RECT) *Element { + xc.XEle_RectClientToWndClient(e.Handle, pRect) + return e } // 元素_客户区点到窗口客户区, 元素客户区坐标转换到窗口客户区坐标. // // pPt: 坐标. -func (e *Element) PointClientToWndClient(pPt *xc.POINT) int { - return xc.XEle_PointClientToWndClient(e.Handle, pPt) +func (e *Element) PointClientToWndClient(pPt *xc.POINT) *Element { + xc.XEle_PointClientToWndClient(e.Handle, pPt) + return e } // 元素_基于窗口客户区坐标. // // pRect: 坐标. -func (e *Element) GetWndClientRect(pRect *xc.RECT) int { - return xc.XEle_GetWndClientRect(e.Handle, pRect) +func (e *Element) GetWndClientRect(pRect *xc.RECT) *Element { + xc.XEle_GetWndClientRect(e.Handle, pRect) + return e +} + +// 元素_基于窗口客户区坐标ex. +func (e *Element) GetWndClientRectEx() xc.RECT { + var pRect *xc.RECT + xc.XEle_GetWndClientRect(e.Handle, pRect) + return *pRect } // 元素_取光标, 获取元素鼠标光标, 返回光标句柄. @@ -230,8 +268,9 @@ func (e *Element) GetCursor() int { // 元素_置光标, 设置元素鼠标光标. // // hCursor: 光标句柄. -func (e *Element) SetCursor(hCursor int) int { - return xc.XEle_SetCursor(e.Handle, hCursor) +func (e *Element) SetCursor(hCursor int) *Element { + xc.XEle_SetCursor(e.Handle, hCursor) + return e } // 元素_添加子对象. @@ -345,7 +384,7 @@ func (e *Element) IsMouseThrough() bool { return xc.XEle_IsMouseThrough(e.Handle) } -// 元素_测试点击元素, 检测坐标点所在元素, 包含子元素的子元素. +// 元素_测试点击元素, 检测坐标点所在元素, 包含子元素的子元素. 成功时返回元素句柄. // // pPt: 坐标点. func (e *Element) HitChildEle(pPt *xc.POINT) int { @@ -402,83 +441,95 @@ func (e *Element) IsFocusEx() bool { // 元素_启用, 启用或禁用元素. // // bEnable: 启用或禁用. -func (e *Element) Enable(bEnable bool) int { - return xc.XEle_Enable(e.Handle, bEnable) +func (e *Element) Enable(bEnable bool) *Element { + xc.XEle_Enable(e.Handle, bEnable) + return e } // 元素_启用焦点, 启用焦点. // // bEnable: 是否启用. -func (e *Element) EnableFocus(bEnable bool) int { - return xc.XEle_EnableFocus(e.Handle, bEnable) +func (e *Element) EnableFocus(bEnable bool) *Element { + xc.XEle_EnableFocus(e.Handle, bEnable) + return e } // 元素_启用绘制焦点. // // bEnable: 是否启用. -func (e *Element) EnableDrawFocus(bEnable bool) int { - return xc.XEle_EnableDrawFocus(e.Handle, bEnable) +func (e *Element) EnableDrawFocus(bEnable bool) *Element { + xc.XEle_EnableDrawFocus(e.Handle, bEnable) + return e } // 元素_启用绘制边框, 启用或禁用绘制默认边框. // // bEnable: 是否启用. -func (e *Element) EnableDrawBorder(bEnable bool) int { - return xc.XEle_EnableDrawBorder(e.Handle, bEnable) +func (e *Element) EnableDrawBorder(bEnable bool) *Element { + xc.XEle_EnableDrawBorder(e.Handle, bEnable) + return e } // 元素_启用画布, 启用或禁用背景画布; 如果禁用那么将绘制在父的画布之上, 也就是说他没有自己的画布. // // bEnable: 是否启用. -func (e *Element) EnableCanvas(bEnable bool) int { - return xc.XEle_EnableCanvas(e.Handle, bEnable) +func (e *Element) EnableCanvas(bEnable bool) *Element { + xc.XEle_EnableCanvas(e.Handle, bEnable) + return e } // 元素_启用事件_XE_PAINT_END. // // bEnable: 是否启用. -func (e *Element) EnableEvent_XE_PAINT_END(bEnable bool) int { - return xc.XEle_EnableEvent_XE_PAINT_END(e.Handle, bEnable) +func (e *Element) EnableEvent_XE_PAINT_END(bEnable bool) *Element { + xc.XEle_EnableEvent_XE_PAINT_END(e.Handle, bEnable) + return e } // 元素_启用背景透明. // // bEnable: 是否启用. -func (e *Element) EnableBkTransparent(bEnable bool) int { - return xc.XEle_EnableBkTransparent(e.Handle, bEnable) +func (e *Element) EnableBkTransparent(bEnable bool) *Element { + xc.XEle_EnableBkTransparent(e.Handle, bEnable) + return e } // 元素_启用鼠标穿透. 启用鼠标穿透, 如果启用, 那么该元素不能接收到鼠标事件, 但是他的子元素不受影响, 任然可以接收鼠标事件. // // bEnable: 是否启用. -func (e *Element) EnableMouseThrough(bEnable bool) int { - return xc.XEle_EnableMouseThrough(e.Handle, bEnable) +func (e *Element) EnableMouseThrough(bEnable bool) *Element { + xc.XEle_EnableMouseThrough(e.Handle, bEnable) + return e } // 元素_启用接收TAB, 启用接收Tab输入. // // bEnable: 是否启用. -func (e *Element) EnableKeyTab(bEnable bool) int { - return xc.XEle_EnableKeyTab(e.Handle, bEnable) +func (e *Element) EnableKeyTab(bEnable bool) *Element { + xc.XEle_EnableKeyTab(e.Handle, bEnable) + return e } // 元素_启用切换焦点, 启用接受通过键盘切换焦点. // // bEnable: 是否启用. -func (e *Element) EnableSwitchFocus(bEnable bool) int { - return xc.XEle_EnableSwitchFocus(e.Handle, bEnable) +func (e *Element) EnableSwitchFocus(bEnable bool) *Element { + xc.XEle_EnableSwitchFocus(e.Handle, bEnable) + return e } // 元素_启用事件_XE_MOUSEWHEEL, 启用接收鼠标滚动事件, 如果禁用那么事件会传递给父元素. // // bEnable: 是否启用. -func (e *Element) EnableEvent_XE_MOUSEWHEEL(bEnable bool) int { - return xc.XEle_EnableEvent_XE_MOUSEWHEEL(e.Handle, bEnable) +func (e *Element) EnableEvent_XE_MOUSEWHEEL(bEnable bool) *Element { + xc.XEle_EnableEvent_XE_MOUSEWHEEL(e.Handle, bEnable) + return e } // 元素_移除, 移除元素, 但不销毁. -func (e *Element) Remove() int { - return xc.XEle_Remove(e.Handle) +func (e *Element) Remove() *Element { + xc.XEle_Remove(e.Handle) + return e } // 元素_置Z序, 设置元素Z序. @@ -512,8 +563,9 @@ func (e *Element) EnableTopmost(bTopmost bool) bool { // 元素_重绘. // // bImmediate: 是否立即重绘. -func (e *Element) Redraw(bImmediate bool) int { - return xc.XEle_Redraw(e.Handle, bImmediate) +func (e *Element) Redraw(bImmediate bool) *Element { + xc.XEle_Redraw(e.Handle, bImmediate) + return e } // 元素_重绘指定区域. @@ -521,8 +573,9 @@ func (e *Element) Redraw(bImmediate bool) int { // pRect: 相对于元素客户区坐标. // // bImmediate: 是否立即重绘. -func (e *Element) RedrawRect(pRect *xc.RECT, bImmediate bool) int { - return xc.XEle_RedrawRect(e.Handle, pRect, bImmediate) +func (e *Element) RedrawRect(pRect *xc.RECT, bImmediate bool) *Element { + xc.XEle_RedrawRect(e.Handle, pRect, bImmediate) + return e } // 元素_取子对象数量, 获取子对象(UI元素和形状对象)数量, 只检测当前层子对象. @@ -553,15 +606,24 @@ func (e *Element) GetChildByID(nID int) int { // right: 右边大小. // // bottom: 下边大小. -func (e *Element) SetBorderSize(left int, top int, right int, bottom int) int { - return xc.XEle_SetBorderSize(e.Handle, left, top, right, bottom) +func (e *Element) SetBorderSize(left int, top int, right int, bottom int) *Element { + xc.XEle_SetBorderSize(e.Handle, left, top, right, bottom) + return e } // 元素_取边框大小. // // pBorder: 大小. -func (e *Element) GetBorderSize(pBorder *xc.RECT) int { - return xc.XEle_GetBorderSize(e.Handle, pBorder) +func (e *Element) GetBorderSize(pBorder *xc.RECT) *Element { + xc.XEle_GetBorderSize(e.Handle, pBorder) + return e +} + +// 元素_取边框大小ex. +func (e *Element) GetBorderSizeEx() xc.RECT { + var pBorder *xc.RECT + xc.XEle_GetBorderSize(e.Handle, pBorder) + return *pBorder } // 元素_置内填充大小. @@ -573,33 +635,44 @@ func (e *Element) GetBorderSize(pBorder *xc.RECT) int { // right: 右边大小. // // bottom: 下边大小. -func (e *Element) SetPadding(left int, top int, right int, bottom int) int { - return xc.XEle_SetPadding(e.Handle, left, top, right, bottom) +func (e *Element) SetPadding(left int, top int, right int, bottom int) *Element { + xc.XEle_SetPadding(e.Handle, left, top, right, bottom) + return e } // 元素_取内填充大小. // // pPadding: 大小. -func (e *Element) GetPadding(pPadding *xc.RECT) int { - return xc.XEle_GetPadding(e.Handle, pPadding) +func (e *Element) GetPadding(pPadding *xc.RECT) *Element { + xc.XEle_GetPadding(e.Handle, pPadding) + return e +} + +// 元素_取内填充大小ex. +func (e *Element) GetPaddingEx() xc.RECT { + var pPadding *xc.RECT + xc.XEle_GetPadding(e.Handle, pPadding) + return *pPadding } // 元素_置拖动边框. // -// nFlags: 边框位置组合, Element_Position_. -func (e *Element) SetDragBorder(nFlags xcc.Element_Position_) int { - return xc.XEle_SetDragBorder(e.Handle, nFlags) +// nFlags: 边框位置组合, xcc.Element_Position_. +func (e *Element) SetDragBorder(nFlags xcc.Element_Position_) *Element { + xc.XEle_SetDragBorder(e.Handle, nFlags) + return e } // 元素_置拖动边框绑定元素, 设置拖动边框绑定元素, 当拖动边框时, 自动调整绑定元素的大小. // -// nFlags: 边框位置标识, Element_Position_. +// nFlags: 边框位置标识, xcc.Element_Position_. // // hBindEle: 绑定元素. // // nSpace: 元素间隔大小. -func (e *Element) SetDragBorderBindEle(nFlags xcc.Element_Position_, hBindEle int, nSpace int) int { - return xc.XEle_SetDragBorderBindEle(e.Handle, nFlags, hBindEle, nSpace) +func (e *Element) SetDragBorderBindEle(nFlags xcc.Element_Position_, hBindEle int, nSpace int) *Element { + xc.XEle_SetDragBorderBindEle(e.Handle, nFlags, hBindEle, nSpace) + return e } // 元素_置最小大小. @@ -607,8 +680,9 @@ func (e *Element) SetDragBorderBindEle(nFlags xcc.Element_Position_, hBindEle in // nWidth: 最小宽度. // // nHeight: 最小高度. -func (e *Element) SetMinSize(nWidth int, nHeight int) int { - return xc.XEle_SetMinSize(e.Handle, nWidth, nHeight) +func (e *Element) SetMinSize(nWidth int, nHeight int) *Element { + xc.XEle_SetMinSize(e.Handle, nWidth, nHeight) + return e } // 元素_置最大大小. @@ -616,8 +690,9 @@ func (e *Element) SetMinSize(nWidth int, nHeight int) int { // nWidth: 最大宽度. // // nHeight: 最大高度. -func (e *Element) SetMaxSize(nWidth int, nHeight int) int { - return xc.XEle_SetMaxSize(e.Handle, nWidth, nHeight) +func (e *Element) SetMaxSize(nWidth int, nHeight int) *Element { + xc.XEle_SetMaxSize(e.Handle, nWidth, nHeight) + return e } // 元素_置锁定滚动, 设置锁定元素在滚动视图中跟随滚动, 如果设置TRUE将不跟随滚动. @@ -625,15 +700,17 @@ func (e *Element) SetMaxSize(nWidth int, nHeight int) int { // bHorizon: 是否锁定水平滚动. // // bVertical: 是否锁定垂直滚动. -func (e *Element) SetLockScroll(bHorizon bool, bVertical bool) int { - return xc.XEle_SetLockScroll(e.Handle, bHorizon, bVertical) +func (e *Element) SetLockScroll(bHorizon bool, bVertical bool) *Element { + xc.XEle_SetLockScroll(e.Handle, bHorizon, bVertical) + return e } // 元素_置文本颜色. // -// color: ABGR 颜色值. -func (e *Element) SetTextColor(color int) int { - return xc.XEle_SetTextColor(e.Handle, color) +// color: ARGB 颜色值. +func (e *Element) SetTextColor(color int) *Element { + xc.XEle_SetTextColor(e.Handle, color) + return e } // 元素_取文本颜色. @@ -648,9 +725,10 @@ func (e *Element) GetTextColorEx() int { // 元素_置焦点边框颜色. // -// color: ABGR 颜色值. -func (e *Element) SetFocusBorderColor(color int) int { - return xc.XEle_SetFocusBorderColor(e.Handle, color) +// color: ARGB 颜色值. +func (e *Element) SetFocusBorderColor(color int) *Element { + xc.XEle_SetFocusBorderColor(e.Handle, color) + return e } // 元素_取焦点边框颜色. @@ -661,8 +739,9 @@ func (e *Element) GetFocusBorderColor() int { // 元素_置字体. // // hFontx: 炫彩字体. -func (e *Element) SetFont(hFontx int) int { - return xc.XEle_SetFont(e.Handle, hFontx) +func (e *Element) SetFont(hFontx int) *Element { + xc.XEle_SetFont(e.Handle, hFontx) + return e } // 元素_取字体. @@ -676,33 +755,37 @@ func (e *Element) GetFontEx() int { } // 元素_置透明度. -func (e *Element) SetAlpha(alpha uint8) int { - return xc.XEle_SetAlpha(e.Handle, alpha) +func (e *Element) SetAlpha(alpha byte) *Element { + xc.XEle_SetAlpha(e.Handle, alpha) + return e } // 元素_销毁. -func (e *Element) Destroy() int { - return xc.XEle_Destroy(e.Handle) +func (e *Element) Destroy() *Element { + xc.XEle_Destroy(e.Handle) + return e } // 元素_添加背景边框, 添加背景内容边框. // // nState: 组合状态. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // width: 线宽. -func (e *Element) AddBkBorder(nState xcc.CombinedState, color int, width int) int { - return xc.XEle_AddBkBorder(e.Handle, nState, color, width) +func (e *Element) AddBkBorder(nState xcc.CombinedState, color int, width int) *Element { + xc.XEle_AddBkBorder(e.Handle, nState, color, width) + return e } // 元素_添加背景填充, 添加背景内容填充. // // nState: 组合状态. // -// color: ABGR 颜色. -func (e *Element) AddBkFill(nState xcc.CombinedState, color int) int { - return xc.XEle_AddBkFill(e.Handle, nState, color) +// color: ARGB 颜色. +func (e *Element) AddBkFill(nState xcc.CombinedState, color int) *Element { + xc.XEle_AddBkFill(e.Handle, nState, color) + return e } // 元素_添加背景图片, 添加背景内容图片. @@ -710,8 +793,9 @@ func (e *Element) AddBkFill(nState xcc.CombinedState, color int) int { // nState: 组合状态. // // hImage: 图片句柄. -func (e *Element) AddBkImage(nState xcc.CombinedState, hImage int) int { - return xc.XEle_AddBkImage(e.Handle, nState, hImage) +func (e *Element) AddBkImage(nState xcc.CombinedState, hImage int) *Element { + xc.XEle_AddBkImage(e.Handle, nState, hImage) + return e } // 元素_取背景对象数量, 获取背景内容数量. @@ -720,8 +804,9 @@ func (e *Element) GetBkInfoCount() int { } // 元素_清空背景对象, 清空背景内容; 如果背景没有内容, 将使用系统默认内容, 以便保证背景正确. -func (e *Element) ClearBkInfo() int { - return xc.XEle_ClearBkInfo(e.Handle) +func (e *Element) ClearBkInfo() *Element { + xc.XEle_ClearBkInfo(e.Handle) + return e } // 元素_取背景管理器, 获取元素背景管理器. @@ -737,8 +822,9 @@ func (e *Element) GetBkManagerEx() int { // 元素_置背景管理器. // // hBkInfoM: 背景管理器. -func (e *Element) SetBkManager(hBkInfoM int) int { - return xc.XEle_SetBkManager(e.Handle, hBkInfoM) +func (e *Element) SetBkManager(hBkInfoM int) *Element { + xc.XEle_SetBkManager(e.Handle, hBkInfoM) + return e } // 元素_取状态, 获取组合状态. @@ -758,15 +844,17 @@ func (e *Element) DrawFocus(hDraw int, pRect *xc.RECT) bool { // 元素_绘制, 在自绘事件函数中, 用户手动调用绘制元素, 以便控制绘制顺序. // // hDraw: 图形绘制句柄. -func (e *Element) DrawEle(hDraw int) int { - return xc.XEle_DrawEle(e.Handle, hDraw) +func (e *Element) DrawEle(hDraw int) *Element { + xc.XEle_DrawEle(e.Handle, hDraw) + return e } // 元素_置用户数据. // // nData: 用户数据. -func (e *Element) SetUserData(nData int) int { - return xc.XEle_SetUserData(e.Handle, nData) +func (e *Element) SetUserData(nData int) *Element { + xc.XEle_SetUserData(e.Handle, nData) + return e } // 元素_取用户数据. @@ -783,22 +871,25 @@ func (e *Element) GetUserData() int { // cy: 高度. // // pSize: 返回大小. -func (e *Element) GetContentSize(bHorizon bool, cx int, cy int, pSize *xc.SIZE) int { - return xc.XEle_GetContentSize(e.Handle, bHorizon, cx, cy, pSize) +func (e *Element) GetContentSize(bHorizon bool, cx int, cy int, pSize *xc.SIZE) *Element { + xc.XEle_GetContentSize(e.Handle, bHorizon, cx, cy, pSize) + return e } // 元素_置鼠标捕获. // // b: TRUE设置. -func (e *Element) SetCapture(b bool) int { - return xc.XEle_SetCapture(e.Handle, b) +func (e *Element) SetCapture(b bool) *Element { + xc.XEle_SetCapture(e.Handle, b) + return e } // 元素_启用透明通道, 启用或关闭元素透明通道, 如果启用, 将强制设置元素背景不透明, 默认为启用, 此功能是为了兼容GDI不支持透明通道问题. // // bEnable: 启用或关闭. -func (e *Element) EnableTransparentChannel(bEnable bool) int { - return xc.XEle_EnableTransparentChannel(e.Handle, bEnable) +func (e *Element) EnableTransparentChannel(bEnable bool) *Element { + xc.XEle_EnableTransparentChannel(e.Handle, bEnable) + return e } // 元素_置炫彩定时器, 设置元素定时器. @@ -820,8 +911,9 @@ func (e *Element) KillXCTimer(nIDEvent int) bool { // 元素_置工具提示, 设置工具提示内容. // // pText: 工具提示内容. -func (e *Element) SetToolTip(pText string) int { - return xc.XEle_SetToolTip(e.Handle, pText) +func (e *Element) SetToolTip(pText string) *Element { + xc.XEle_SetToolTip(e.Handle, pText) + return e } // 元素_置工具提示扩展, 设置工具提示内容. @@ -829,8 +921,9 @@ func (e *Element) SetToolTip(pText string) int { // pText: 工具提示内容. // // nTextAlign: 文本对齐方式, TextFormatFlag_, TextAlignFlag_, TextTrimming_. -func (e *Element) SetToolTipEx(pText string, nTextAlign xcc.TextFormatFlag_) int { - return xc.XEle_SetToolTipEx(e.Handle, pText, nTextAlign) +func (e *Element) SetToolTipEx(pText string, nTextAlign xcc.TextFormatFlag_) *Element { + xc.XEle_SetToolTipEx(e.Handle, pText, nTextAlign) + return e } // 元素_取工具提示, 获取工具提示内容. @@ -843,15 +936,17 @@ func (e *Element) GetToolTip() int { // x: X坐标. // // y: Y坐标. -func (e *Element) PopupToolTip(x int, y int) int { - return xc.XEle_PopupToolTip(e.Handle, x, y) +func (e *Element) PopupToolTip(x int, y int) *Element { + xc.XEle_PopupToolTip(e.Handle, x, y) + return e } // 元素_调整布局. // // nAdjustNo: 调整布局流水号, 可填0. -func (e *Element) AdjustLayout(nAdjustNo uint32) int { - return xc.XEle_AdjustLayout(e.Handle, nAdjustNo) +func (e *Element) AdjustLayout(nAdjustNo uint32) *Element { + xc.XEle_AdjustLayout(e.Handle, nAdjustNo) + return e } // 元素_调整布局扩展. @@ -859,8 +954,9 @@ func (e *Element) AdjustLayout(nAdjustNo uint32) int { // nFlags: 调整布局标识位: xcc.AdjustLayout_. // // nAdjustNo: 调整布局流水号, 可填0. -func (e *Element) AdjustLayoutEx(nFlags xcc.AdjustLayout_, nAdjustNo uint32) int { - return xc.XEle_AdjustLayoutEx(e.Handle, nFlags, nAdjustNo) +func (e *Element) AdjustLayoutEx(nFlags xcc.AdjustLayout_, nAdjustNo uint32) *Element { + xc.XEle_AdjustLayoutEx(e.Handle, nFlags, nAdjustNo) + return e } // 元素_取透明度, 返回透明度. @@ -873,8 +969,16 @@ func (e *Element) GetAlpha() byte { // pOutX: 返回X坐标. // // pOutY: 返回Y坐标. -func (e *Element) GetPosition(pOutX, pOutY *int32) int { - return xc.XEle_GetPosition(e.Handle, pOutX, pOutY) +func (e *Element) GetPosition(pOutX, pOutY *int32) *Element { + xc.XEle_GetPosition(e.Handle, pOutX, pOutY) + return e +} + +// 元素_取位置ex. +func (e *Element) GetPositionEx() xc.POINT { + var pOutX, pOutY *int32 + xc.XEle_GetPosition(e.Handle, pOutX, pOutY) + return xc.POINT{X: *pOutX, Y: *pOutY} } // 元素_置大小. @@ -897,8 +1001,16 @@ func (e *Element) SetSize(nWidth, nHeight int32, bRedraw bool, nFlags xcc.Adjust // pOutWidth: 返回宽度. // // pOutHeight: 返回高度. -func (e *Element) GetSize(pOutWidth, pOutHeight *int32) int { - return xc.XEle_GetSize(e.Handle, pOutWidth, pOutHeight) +func (e *Element) GetSize(pOutWidth, pOutHeight *int32) *Element { + xc.XEle_GetSize(e.Handle, pOutWidth, pOutHeight) + return e +} + +// 元素_取大小ex. +func (e *Element) GetSizeEx() xc.POINT { + var pOutWidth, pOutHeight *int32 + xc.XEle_GetSize(e.Handle, pOutWidth, pOutHeight) + return xc.POINT{X: *pOutWidth, Y: *pOutHeight} } // 元素_置背景, 设置背景内容, 返回设置的背景对象数量. @@ -911,22 +1023,41 @@ func (e *Element) SetBkInfo(pText string) int { // 元素_取窗口客户区坐标DPI. 基于DPI缩放后的坐标. // // pRect: 接收返回坐标. -func (e *Element) GetWndClientRectDPI(pRect *xc.RECT) int { - return xc.XEle_GetWndClientRectDPI(e.Handle, pRect) +func (e *Element) GetWndClientRectDPI(pRect *xc.RECT) *Element { + xc.XEle_GetWndClientRectDPI(e.Handle, pRect) + return e +} + +// 元素_取窗口客户区坐标DPIex. 基于DPI缩放后的坐标. +func (e *Element) GetWndClientRectDPIEx() xc.RECT { + var pRect *xc.RECT + xc.XEle_GetWndClientRectDPI(e.Handle, pRect) + return *pRect } // 元素_取窗口客户区坐标DPI. 基于DPI缩放后的坐标. // // pPt: 接收返回坐标点. -func (e *Element) PointClientToWndClientDPI(pPt *xc.POINT) int { - return xc.XEle_PointClientToWndClientDPI(e.Handle, pPt) +func (e *Element) PointClientToWndClientDPI(pPt *xc.POINT) *Element { + xc.XEle_PointClientToWndClientDPI(e.Handle, pPt) + return e +} + +// 元素_取窗口客户区坐标DPIex. 基于DPI缩放后的坐标. +// +// pPt: 接收返回坐标点. +func (e *Element) PointClientToWndClientDPIEx() xc.POINT { + var pPt *xc.POINT + xc.XEle_PointClientToWndClientDPI(e.Handle, pPt) + return *pPt } // 元素_客户区坐标到窗口客户区DPI. 基于DPI缩放后的坐标. // // pRect: 接收返回坐标. -func (e *Element) RectClientToWndClientDPI(pRect *xc.RECT) int { - return xc.XEle_RectClientToWndClientDPI(e.Handle, pRect) +func (e *Element) RectClientToWndClientDPI(pRect *xc.RECT) *Element { + xc.XEle_RectClientToWndClientDPI(e.Handle, pRect) + return e } // SetFocus 元素_置焦点. diff --git a/widget/layoutele.go b/widget/layoutele.go index 672ea6a..3f53b9f 100644 --- a/widget/layoutele.go +++ b/widget/layoutele.go @@ -292,26 +292,28 @@ func (l *LayoutEle) IsEnableLayout() bool { // // @param bEnable 是否启用. // @return int -func (l *LayoutEle) EnableLayout(bEnable bool) int { - return xc.XLayout_EnableLayout(l.Handle, bEnable) +func (l *LayoutEle) EnableLayout(bEnable bool) *LayoutEle { + xc.XLayout_EnableLayout(l.Handle, bEnable) + return l } // ShowLayoutFrame 布局_显示布局边界, 显示布局边界. // // @param bEnable 是否显示. // @return int -func (l *LayoutEle) ShowLayoutFrame(bEnable bool) int { - return xc.XLayout_ShowLayoutFrame(l.Handle, bEnable) +func (l *LayoutEle) ShowLayoutFrame(bEnable bool) *LayoutEle { + xc.XLayout_ShowLayoutFrame(l.Handle, bEnable) + return l } -// GetWidthIn 布局_取内宽度, 获取宽度,不包含内边距大小. +// GetWidthIn 布局_取内宽度, 获取宽度, 不包含内边距大小. // // @return int func (l *LayoutEle) GetWidthIn() int { return xc.XLayout_GetWidthIn(l.Handle) } -// GetHeightIn 布局_取内高度, 获取高度,不包含内边距大小. +// GetHeightIn 布局_取内高度, 获取高度, 不包含内边距大小. // // @return int func (l *LayoutEle) GetHeightIn() int { @@ -326,62 +328,70 @@ LayoutBox-布局盒子 // // @param bEnable 是否启用. // @return int -func (l *LayoutEle) EnableHorizon(bEnable bool) int { - return xc.XLayoutBox_EnableHorizon(l.Handle, bEnable) +func (l *LayoutEle) EnableHorizon(bEnable bool) *LayoutEle { + xc.XLayoutBox_EnableHorizon(l.Handle, bEnable) + return l } // EnableAutoWrap 布局盒子_启用自动换行. // // @param bEnable 是否启用. // @return int -func (l *LayoutEle) EnableAutoWrap(bEnable bool) int { - return xc.XLayoutBox_EnableAutoWrap(l.Handle, bEnable) +func (l *LayoutEle) EnableAutoWrap(bEnable bool) *LayoutEle { + xc.XLayoutBox_EnableAutoWrap(l.Handle, bEnable) + return l } // EnableOverflowHide 布局盒子_启用溢出隐藏. // // @param bEnable 是否启用. // @return int -func (l *LayoutEle) EnableOverflowHide(bEnable bool) int { - return xc.XLayoutBox_EnableOverflowHide(l.Handle, bEnable) +func (l *LayoutEle) EnableOverflowHide(bEnable bool) *LayoutEle { + xc.XLayoutBox_EnableOverflowHide(l.Handle, bEnable) + return l } // SetAlignH 布局盒子_置水平对齐. // // @param nAlign 对齐方式: xcc.Layout_Align_. // @return int -func (l *LayoutEle) SetAlignH(nAlign xcc.Layout_Align_) int { - return xc.XLayoutBox_SetAlignH(l.Handle, nAlign) +func (l *LayoutEle) SetAlignH(nAlign xcc.Layout_Align_) *LayoutEle { + xc.XLayoutBox_SetAlignH(l.Handle, nAlign) + return l } // SetAlignV 布局盒子_置垂直对齐. // // @param nAlign 对齐方式: xcc.Layout_Align_. // @return int -func (l *LayoutEle) SetAlignV(nAlign xcc.Layout_Align_) int { - return xc.XLayoutBox_SetAlignV(l.Handle, nAlign) +func (l *LayoutEle) SetAlignV(nAlign xcc.Layout_Align_) *LayoutEle { + xc.XLayoutBox_SetAlignV(l.Handle, nAlign) + return l } // SetAlignBaseline 布局盒子_置对齐基线. // // @param nAlign 对齐方式: xcc.Layout_Align_Axis_. // @return int -func (l *LayoutEle) SetAlignBaseline(nAlign xcc.Layout_Align_Axis_) int { - return xc.XLayoutBox_SetAlignBaseline(l.Handle, nAlign) +func (l *LayoutEle) SetAlignBaseline(nAlign xcc.Layout_Align_Axis_) *LayoutEle { + xc.XLayoutBox_SetAlignBaseline(l.Handle, nAlign) + return l } // SetSpace 布局盒子_置间距. // // @param nSpace 项间距大小. // @return int -func (l *LayoutEle) SetSpace(nSpace int) int { - return xc.XLayoutBox_SetSpace(l.Handle, nSpace) +func (l *LayoutEle) SetSpace(nSpace int) *LayoutEle { + xc.XLayoutBox_SetSpace(l.Handle, nSpace) + return l } // SetSpaceRow 布局盒子_置行距. // // @param nSpace 行间距大小. // @return int -func (l *LayoutEle) SetSpaceRow(nSpace int) int { - return xc.XLayoutBox_SetSpaceRow(l.Handle, nSpace) +func (l *LayoutEle) SetSpaceRow(nSpace int) *LayoutEle { + xc.XLayoutBox_SetSpaceRow(l.Handle, nSpace) + return l } diff --git a/widget/layoutframe.go b/widget/layoutframe.go index c151895..ced1479 100644 --- a/widget/layoutframe.go +++ b/widget/layoutframe.go @@ -80,8 +80,9 @@ func NewLayoutFrameByUIDName(name string) *LayoutFrame { // // @param bEnable 是否启用. // @return int -func (l *LayoutFrame) ShowLayoutFrame(bEnable bool) int { - return xc.XLayoutFrame_ShowLayoutFrame(l.Handle, bEnable) +func (l *LayoutFrame) ShowLayoutFrame(bEnable bool) *LayoutFrame { + xc.XLayoutFrame_ShowLayoutFrame(l.Handle, bEnable) + return l } /* @@ -92,62 +93,70 @@ LayoutBox-布局盒子 // // @param bEnable 是否启用. // @return int -func (l *LayoutFrame) EnableHorizon(bEnable bool) int { - return xc.XLayoutBox_EnableHorizon(l.Handle, bEnable) +func (l *LayoutFrame) EnableHorizon(bEnable bool) *LayoutFrame { + xc.XLayoutBox_EnableHorizon(l.Handle, bEnable) + return l } // EnableAutoWrap 布局盒子_启用自动换行. // // @param bEnable 是否启用. // @return int -func (l *LayoutFrame) EnableAutoWrap(bEnable bool) int { - return xc.XLayoutBox_EnableAutoWrap(l.Handle, bEnable) +func (l *LayoutFrame) EnableAutoWrap(bEnable bool) *LayoutFrame { + xc.XLayoutBox_EnableAutoWrap(l.Handle, bEnable) + return l } // EnableOverflowHide 布局盒子_启用溢出隐藏. // // @param bEnable 是否启用. // @return int -func (l *LayoutFrame) EnableOverflowHide(bEnable bool) int { - return xc.XLayoutBox_EnableOverflowHide(l.Handle, bEnable) +func (l *LayoutFrame) EnableOverflowHide(bEnable bool) *LayoutFrame { + xc.XLayoutBox_EnableOverflowHide(l.Handle, bEnable) + return l } // SetAlignH 布局盒子_置水平对齐. // // @param nAlign 对齐方式: xcc.Layout_Align_. // @return int -func (l *LayoutFrame) SetAlignH(nAlign xcc.Layout_Align_) int { - return xc.XLayoutBox_SetAlignH(l.Handle, nAlign) +func (l *LayoutFrame) SetAlignH(nAlign xcc.Layout_Align_) *LayoutFrame { + xc.XLayoutBox_SetAlignH(l.Handle, nAlign) + return l } // SetAlignV 布局盒子_置垂直对齐. // // @param nAlign 对齐方式: xcc.Layout_Align_. // @return int -func (l *LayoutFrame) SetAlignV(nAlign xcc.Layout_Align_) int { - return xc.XLayoutBox_SetAlignV(l.Handle, nAlign) +func (l *LayoutFrame) SetAlignV(nAlign xcc.Layout_Align_) *LayoutFrame { + xc.XLayoutBox_SetAlignV(l.Handle, nAlign) + return l } // SetAlignBaseline 布局盒子_置对齐基线. // // @param nAlign 对齐方式: xcc.Layout_Align_Axis_. // @return int -func (l *LayoutFrame) SetAlignBaseline(nAlign xcc.Layout_Align_Axis_) int { - return xc.XLayoutBox_SetAlignBaseline(l.Handle, nAlign) +func (l *LayoutFrame) SetAlignBaseline(nAlign xcc.Layout_Align_Axis_) *LayoutFrame { + xc.XLayoutBox_SetAlignBaseline(l.Handle, nAlign) + return l } // SetSpace 布局盒子_置间距. // // @param nSpace 项间距大小. // @return int -func (l *LayoutFrame) SetSpace(nSpace int) int { - return xc.XLayoutBox_SetSpace(l.Handle, nSpace) +func (l *LayoutFrame) SetSpace(nSpace int) *LayoutFrame { + xc.XLayoutBox_SetSpace(l.Handle, nSpace) + return l } // SetSpaceRow 布局盒子_置行距. // // @param nSpace 行间距大小. // @return int -func (l *LayoutFrame) SetSpaceRow(nSpace int) int { - return xc.XLayoutBox_SetSpaceRow(l.Handle, nSpace) +func (l *LayoutFrame) SetSpaceRow(nSpace int) *LayoutFrame { + xc.XLayoutBox_SetSpaceRow(l.Handle, nSpace) + return l } diff --git a/widget/list.go b/widget/list.go index 2e056ec..2b6e91a 100644 --- a/widget/list.go +++ b/widget/list.go @@ -105,57 +105,65 @@ func (l *List) InsertColumn(width int, iItem int) int { // 列表_启用多选, 启用或关闭多选功能. // // bEnable: 是否启用. -func (l *List) EnableMultiSel(bEnable bool) int { - return xc.XList_EnableMultiSel(l.Handle, bEnable) +func (l *List) EnableMultiSel(bEnable bool) *List { + xc.XList_EnableMultiSel(l.Handle, bEnable) + return l } // 列表_启用拖动更改列宽, 启用拖动改变列宽度. // // bEnable: 是否启用. -func (l *List) EnableDragChangeColumnWidth(bEnable bool) int { - return xc.XList_EnableDragChangeColumnWidth(l.Handle, bEnable) +func (l *List) EnableDragChangeColumnWidth(bEnable bool) *List { + xc.XList_EnableDragChangeColumnWidth(l.Handle, bEnable) + return l } // 列表_启用垂直滚动条顶部对齐. // // bTop: 是否启用. -func (l *List) EnableVScrollBarTop(bTop bool) int { - return xc.XList_EnableVScrollBarTop(l.Handle, bTop) +func (l *List) EnableVScrollBarTop(bTop bool) *List { + xc.XList_EnableVScrollBarTop(l.Handle, bTop) + return l } -// 列表_启用项背景全行模式, 启用项背景全行填充模式. +// 列表_启用行背景铺满. // // bFull: 是否启用. -func (l *List) EnableItemBkFullRow(bFull bool) int { - return xc.XList_EnableItemBkFullRow(l.Handle, bFull) +func (l *List) EnableRowBkFull(bFull bool) *List { + xc.XList_EnableRowBkFull(l.Handle, bFull) + return l } // 列表_启用固定行高. // // bEnable: 是否启用. -func (l *List) EnableFixedRowHeight(bEnable bool) int { - return xc.XList_EnableFixedRowHeight(l.Handle, bEnable) +func (l *List) EnableFixedRowHeight(bEnable bool) *List { + xc.XList_EnableFixedRowHeight(l.Handle, bEnable) + return l } // 列表_启用模板复用. // // bEnable: 是否启用. -func (l *List) EnableTemplateReuse(bEnable bool) int { - return xc.XList_EnableTemplateReuse(l.Handle, bEnable) +func (l *List) EnableTemplateReuse(bEnable bool) *List { + xc.XList_EnableTemplateReuse(l.Handle, bEnable) + return l } // 列表_启用虚表. // // bEnable: 是否启用. -func (l *List) EnableVirtualTable(bEnable bool) int { - return xc.XList_EnableVirtualTable(l.Handle, bEnable) +func (l *List) EnableVirtualTable(bEnable bool) *List { + xc.XList_EnableVirtualTable(l.Handle, bEnable) + return l } // 列表_置虚表行数. // // nRowCount: 行数. -func (l *List) SetVirtualRowCount(nRowCount int) int { - return xc.XList_SetVirtualRowCount(l.Handle, nRowCount) +func (l *List) SetVirtualRowCount(nRowCount int) *List { + xc.XList_SetVirtualRowCount(l.Handle, nRowCount) + return l } // 列表_置排序, 设置排序属性. @@ -165,15 +173,17 @@ func (l *List) SetVirtualRowCount(nRowCount int) int { // iColumnAdapter: 需要排序的数据在数据适配器中的列索引. // // bEnable: 是否启用排序功能. -func (l *List) SetSort(iColumn int, iColumnAdapter int, bEnable bool) int { - return xc.XList_SetSort(l.Handle, iColumn, iColumnAdapter, bEnable) +func (l *List) SetSort(iColumn int, iColumnAdapter int, bEnable bool) *List { + xc.XList_SetSort(l.Handle, iColumn, iColumnAdapter, bEnable) + return l } -// 列表_置绘制项背景标志, 设置是否绘制指定状态下项的背景. +// 列表_置行背景绘制标志. 设置是否绘制指定状态下行的背景. // -// nFlags: 标志位, List_DrawItemBk_Flag_. -func (l *List) SetDrawItemBkFlags(nFlags xcc.List_DrawItemBk_Flag_) int { - return xc.XList_SetDrawItemBkFlags(l.Handle, nFlags) +// nFlags: 标志位, xcc.List_DrawItemBk_Flag_. +func (l *List) SetDrawRowBkFlags(nFlags xcc.List_DrawItemBk_Flag_) *List { + xc.XList_SetDrawRowBkFlags(l.Handle, nFlags) + return l } // 列表_置列宽. @@ -181,8 +191,9 @@ func (l *List) SetDrawItemBkFlags(nFlags xcc.List_DrawItemBk_Flag_) int { // iItem: 列索引. // // width: 宽度. -func (l *List) SetColumnWidth(iItem int, width int) int { - return xc.XList_SetColumnWidth(l.Handle, iItem, width) +func (l *List) SetColumnWidth(iItem int, width int) *List { + xc.XList_SetColumnWidth(l.Handle, iItem, width) + return l } // 列表_置列最小宽度. @@ -190,8 +201,9 @@ func (l *List) SetColumnWidth(iItem int, width int) int { // iItem: 列索引. // // width: 宽度. -func (l *List) SetColumnMinWidth(iItem int, width int) int { - return xc.XList_SetColumnMinWidth(l.Handle, iItem, width) +func (l *List) SetColumnMinWidth(iItem int, width int) *List { + xc.XList_SetColumnMinWidth(l.Handle, iItem, width) + return l } // 列表_置列宽度固定. @@ -199,8 +211,9 @@ func (l *List) SetColumnMinWidth(iItem int, width int) int { // iColumn: 列索引. // // bFixed: 是否固定宽度. -func (l *List) SetColumnWidthFixed(iColumn int, bFixed bool) int { - return xc.XList_SetColumnWidthFixed(l.Handle, iColumn, bFixed) +func (l *List) SetColumnWidthFixed(iColumn int, bFixed bool) *List { + xc.XList_SetColumnWidthFixed(l.Handle, iColumn, bFixed) + return l } // 列表_取列宽度. @@ -235,33 +248,34 @@ func (l *List) GetItemData(iItem int, iSubItem int) int { return xc.XList_GetItemData(l.Handle, iItem, iSubItem) } -// 列表_置选择项. +// 列表_置选择行. // -// iItem: 项索引. -func (l *List) SetSelectItem(iItem int) bool { - return xc.XList_SetSelectItem(l.Handle, iItem) +// iRow: 行索引. +func (l *List) SetSelectRow(iRow int) bool { + return xc.XList_SetSelectRow(l.Handle, iRow) } -// 列表_取选择项, 返回项索引. -func (l *List) GetSelectItem() int { - return xc.XList_GetSelectItem(l.Handle) +// 列表_取选择行, 返回行索引. +func (l *List) GetSelectRow() int { + return xc.XList_GetSelectRow(l.Handle) } -// 列表_取选择项数量, 获取选择项数量. -func (l *List) GetSelectItemCount() int { - return xc.XList_GetSelectItemCount(l.Handle) +// 列表_取选择行数量, 获取选择行数量. +func (l *List) GetSelectRowCount() int { + return xc.XList_GetSelectRowCount(l.Handle) } -// 列表_添加选择项. +// 列表_添加选择行. // -// iItem: 项索引. -func (l *List) AddSelectItem(iItem int) bool { - return xc.XList_AddSelectItem(l.Handle, iItem) +// iRow: 行索引. +func (l *List) AddSelectRow(iRow int) bool { + return xc.XList_AddSelectRow(l.Handle, iRow) } // 列表_置选择全部, 选择全部行. -func (l *List) SetSelectAll() int { - return xc.XList_SetSelectAll(l.Handle) +func (l *List) SetSelectAll() *List { + xc.XList_SetSelectAll(l.Handle) + return l } // 列表_取全部选择, 获取全部选择的行, 返回行数量. @@ -273,23 +287,25 @@ func (l *List) GetSelectAll(pArray *[]int32, nArraySize int) int { return xc.XList_GetSelectAll(l.Handle, pArray, nArraySize) } -// 列表_显示指定项, 滚动视图让指定项可见. +// 列表_显示指定行, 滚动视图让指定行可见. // -// iItem: 项索引. -func (l *List) VisibleItem(iItem int) int { - return xc.XList_VisibleItem(l.Handle, iItem) +// iRow: 行索引. +func (l *List) VisibleRow(iRow int) *List { + xc.XList_VisibleRow(l.Handle, iRow) + return l } -// 列表_取消选择项, 取消选择指定项(这里的项可以理解为行). +// 列表_取消选择行, 取消选择指定行. // -// iItem: 项索引. -func (l *List) CancelSelectItem(iItem int) bool { - return xc.XList_CancelSelectItem(l.Handle, iItem) +// iRow: 行索引. +func (l *List) CancelSelectRow(iRow int) bool { + return xc.XList_CancelSelectRow(l.Handle, iRow) } // 列表_取消全部选择项, 取消选择所有项(这里的项可以理解为行). -func (l *List) CancelSelectAll() int { - return xc.XList_CancelSelectAll(l.Handle) +func (l *List) CancelSelectAll() *List { + xc.XList_CancelSelectAll(l.Handle) + return l } // 列表_取列表头, 获取列表头元素, 返回列表头元素句柄. @@ -305,22 +321,25 @@ func (l *List) DeleteColumn(iItem int) bool { } // 列表_删除全部列, 删除所有的列, 仅删除List的, 数据适配器的列不变. -func (l *List) DeleteColumnAll() int { - return xc.XList_DeleteColumnAll(l.Handle) +func (l *List) DeleteColumnAll() *List { + xc.XList_DeleteColumnAll(l.Handle) + return l } // 列表_绑定数据适配器. // // hAdapter: 数据适配器句柄 XAdTable. -func (l *List) BindAdapter(hAdapter int) int { - return xc.XList_BindAdapter(l.Handle, hAdapter) +func (l *List) BindAdapter(hAdapter int) *List { + xc.XList_BindAdapter(l.Handle, hAdapter) + return l } // 列表_列表头绑定数据适配器. // // hAdapter: 数据适配器句柄 XAdMap. -func (l *List) BindAdapterHeader(hAdapter int) int { - return xc.XList_BindAdapterHeader(l.Handle, hAdapter) +func (l *List) BindAdapterHeader(hAdapter int) *List { + xc.XList_BindAdapterHeader(l.Handle, hAdapter) + return l } // 列表_创建数据适配器, 创建数据适配器,根据绑定的项模板初始化数据适配器的列, 返回适配器句柄. @@ -377,11 +396,11 @@ func (l *List) GetTemplateObject(iItem int, iSubItem int, nTempItemID int) int { return xc.XList_GetTemplateObject(l.Handle, iItem, iSubItem, nTempItemID) } -// 列表_取对象所在行, 获取当前对象所在模板实例, 属于列表中哪一个项. 成功返回项索引, 否则返回XC_ID_ERROR. +// 列表_取对象所在行. 获取当前对象所在模板实例, 属于列表中哪一行. 成功返回行索引, 否则返回 xcc.XC_ID_ERROR. // // hXCGUI: 对象句柄, UI元素句柄或形状对象句柄. -func (l *List) GetItemIndexFromHXCGUI(hXCGUI int) int { - return xc.XList_GetItemIndexFromHXCGUI(l.Handle, hXCGUI) +func (l *List) GetRowIndexFromHXCGUI(hXCGUI int) int { + return xc.XList_GetRowIndexFromHXCGUI(l.Handle, hXCGUI) } // 列表_取列表头模板对象, 列表头, 通过模板项ID, 获取实例化模板项ID对应的对象句柄. @@ -393,18 +412,19 @@ func (l *List) GetHeaderTemplateObject(iItem int, nTempItemID int) int { return xc.XList_GetHeaderTemplateObject(l.Handle, iItem, nTempItemID) } -// 列表_取列表头对象所在行, 列表头, 获取当前对象所在模板实例, 属于列表头中哪一个项. 成功返回项索引, 否则返回XC_ID_ERROR. +// 列表_取列表头对象所在列. 列表头, 获取当前对象所在模板实例, 属于列表头中哪一个列. 成功返回列索引, 否则返回 xcc.XC_ID_ERROR. // // hXCGUI: 对象句柄. -func (l *List) GetHeaderItemIndexFromHXCGUI(hXCGUI int) int { - return xc.XList_GetHeaderItemIndexFromHXCGUI(l.Handle, hXCGUI) +func (l *List) GetHeaderColumnIndexFromHXCGUI(hXCGUI int) int { + return xc.XList_GetHeaderColumnIndexFromHXCGUI(l.Handle, hXCGUI) } // 列表_置列表头高度. // // height: 高度. -func (l *List) SetHeaderHeight(height int) int { - return xc.XList_SetHeaderHeight(l.Handle, height) +func (l *List) SetHeaderHeight(height int) *List { + xc.XList_SetHeaderHeight(l.Handle, height) + return l } // 列表_取列表头高度. @@ -417,33 +437,37 @@ func (l *List) GetHeaderHeight() int { // piStart: 开始行索引. // // piEnd: 结束行索引. -func (l *List) GetVisibleRowRange(piStart *int32, piEnd *int32) int { - return xc.XList_GetVisibleRowRange(l.Handle, piStart, piEnd) +func (l *List) GetVisibleRowRange(piStart *int32, piEnd *int32) *List { + xc.XList_GetVisibleRowRange(l.Handle, piStart, piEnd) + return l } -// 列表_置项默认高度. +// 列表_置行默认高度. // // nHeight: 高度. // // nSelHeight: 选中时高度. -func (l *List) SetItemHeightDefault(nHeight int32, nSelHeight int32) int { - return xc.XList_SetItemHeightDefault(l.Handle, nHeight, nSelHeight) +func (l *List) SetRowHeightDefault(nHeight int32, nSelHeight int32) *List { + xc.XList_SetRowHeightDefault(l.Handle, nHeight, nSelHeight) + return l } -// 列表_取项默认高度. +// 列表_取行默认高度. // // pHeight: 高度. // // pSelHeight: 选中时高度. -func (l *List) GetItemHeightDefault(pHeight *int32, pSelHeight *int32) int { - return xc.XList_GetItemHeightDefault(l.Handle, pHeight, pSelHeight) +func (l *List) GetRowHeightDefault(pHeight *int32, pSelHeight *int32) *List { + xc.XList_GetRowHeightDefault(l.Handle, pHeight, pSelHeight) + return l } // 列表_置行间距. // // nSpace: 行间距大小. -func (l *List) SetRowSpace(nSpace int) int { - return xc.XList_SetRowSpace(l.Handle, nSpace) +func (l *List) SetRowSpace(nSpace int) *List { + xc.XList_SetRowSpace(l.Handle, nSpace) + return l } // 列表_取行间距. @@ -454,29 +478,33 @@ func (l *List) GetRowSpace() int { // 列表_置锁定列左侧, 锁定列, 设置左侧锁定列分界列索引. // // iColumn: 列索引, -1代表不锁定. -func (l *List) SetLockColumnLeft(iColumn int) int { - return xc.XList_SetLockColumnLeft(l.Handle, iColumn) +func (l *List) SetLockColumnLeft(iColumn int) *List { + xc.XList_SetLockColumnLeft(l.Handle, iColumn) + return l } // 列表_置锁定列右侧. // // iColumn: 列索引, -1代表不锁定. 暂时只支持锁定末尾列. -func (l *List) SetLockColumnRight(iColumn int) int { - return xc.XList_SetLockColumnRight(l.Handle, iColumn) +func (l *List) SetLockColumnRight(iColumn int) *List { + xc.XList_SetLockColumnRight(l.Handle, iColumn) + return l } // 列表_置锁定行底部, 设置是否锁定末尾行. // // bLock: 是否锁定. -func (l *List) SetLockRowBottom(bLock bool) int { - return xc.XList_SetLockRowBottom(l.Handle, bLock) +func (l *List) SetLockRowBottom(bLock bool) *List { + xc.XList_SetLockRowBottom(l.Handle, bLock) + return l } // 列表_置锁定行底部重叠. // // bOverlap: 是否重叠. -func (l *List) SetLockRowBottomOverlap(bOverlap bool) int { - return xc.XList_SetLockRowBottomOverlap(l.Handle, bOverlap) +func (l *List) SetLockRowBottomOverlap(bOverlap bool) *List { + xc.XList_SetLockRowBottomOverlap(l.Handle, bOverlap) + return l } // 列表_测试点击项, 检测坐标点所在项. @@ -506,11 +534,12 @@ func (l *List) RefreshData() int { return xc.XList_RefreshData(l.Handle) } -// 列表_刷新指定项, 刷新指定项模板, 以便更新UI. +// 列表_刷新指定行. 修改数据后, 刷新指定行模板, 以便更新数据到模板(如果当前行可见). // -// iItem: 项索引. -func (l *List) RefreshItem(iItem int) int { - return xc.XList_RefreshItem(l.Handle, iItem) +// iRow: 行索引. +func (l *List) RefreshRow(iRow int) *List { + xc.XList_RefreshRow(l.Handle, iRow) + return l } // 列表_添加列文本. @@ -535,76 +564,76 @@ func (l *List) AddColumnImage(nWidth int, pName string, hImage int) int { return xc.XList_AddColumnImage(l.Handle, nWidth, pName, hImage) } -// 列表_添加项文本. +// 列表_添加行文本. // // pText:. -func (l *List) AddItemText(pText string) int { - return xc.XList_AddItemText(l.Handle, pText) +func (l *List) AddRowText(pText string) int { + return xc.XList_AddRowText(l.Handle, pText) } -// 列表_添加项文本扩展. +// 列表_添加行文本扩展. // // pName:. // // pText:. -func (l *List) AddItemTextEx(pName string, pText string) int { - return xc.XList_AddItemTextEx(l.Handle, pName, pText) +func (l *List) AddRowTextEx(pName string, pText string) int { + return xc.XList_AddRowTextEx(l.Handle, pName, pText) } -// 列表_添加项图片. +// 列表_添加行图片. // // hImage:. -func (l *List) AddItemImage(hImage int) int { - return xc.XList_AddItemImage(l.Handle, hImage) +func (l *List) AddRowImage(hImage int) int { + return xc.XList_AddRowImage(l.Handle, hImage) } -// 列表_添加项图片扩展. +// 列表_添加行图片扩展. // // pName:. // // hImage:. -func (l *List) AddItemImageEx(pName string, hImage int) int { - return xc.XList_AddItemImageEx(l.Handle, pName, hImage) +func (l *List) AddRowImageEx(pName string, hImage int) int { + return xc.XList_AddRowImageEx(l.Handle, pName, hImage) } -// 列表_插入项文本. +// 列表_插入行文本. // -// iItem:. +// iRow:. // // pValue:. -func (l *List) InsertItemText(iItem int, pValue string) int { - return xc.XList_InsertItemText(l.Handle, iItem, pValue) +func (l *List) InsertRowText(iRow int, pValue string) int { + return xc.XList_InsertRowText(l.Handle, iRow, pValue) } -// 列表_插入项文本扩展. +// 列表_插入行文本扩展. // -// iItem:. +// iRow:. // // pName:. // // pValue:. -func (l *List) InsertItemTextEx(iItem int, pName string, pValue string) int { - return xc.XList_InsertItemTextEx(l.Handle, iItem, pName, pValue) +func (l *List) InsertRowTextEx(iRow int, pName string, pValue string) int { + return xc.XList_InsertRowTextEx(l.Handle, iRow, pName, pValue) } -// 列表_插入项图片. +// 列表_插入行图片. // -// iItem:. +// iRow:. // // hImage:. -func (l *List) InsertItemImage(iItem int, hImage int) int { - return xc.XList_InsertItemImage(l.Handle, iItem, hImage) +func (l *List) InsertRowImage(iRow int, hImage int) int { + return xc.XList_InsertRowImage(l.Handle, iRow, hImage) } -// 列表_插入项图片扩展. +// 列表_插入行图片扩展. // -// iItem:. +// iRow:. // // pName:. // // hImage:. -func (l *List) InsertItemImageEx(iItem int, pName string, hImage int) int { - return xc.XList_InsertItemImageEx(l.Handle, iItem, pName, hImage) +func (l *List) InsertRowImageEx(iRow int, pName string, hImage int) int { + return xc.XList_InsertRowImageEx(l.Handle, iRow, pName, hImage) } // 列表_置项文本. @@ -775,30 +804,32 @@ func (l *List) GetItemFloatEx(iItem int, pName string, pOutValue *float32) bool return xc.XList_GetItemFloatEx(l.Handle, iItem, pName, pOutValue) } -// 列表_删除项. +// 列表_删除行. // -// iItem:. -func (l *List) DeleteItem(iItem int) bool { - return xc.XList_DeleteItem(l.Handle, iItem) +// iRow:. +func (l *List) DeleteRow(iRow int) bool { + return xc.XList_DeleteRow(l.Handle, iRow) } -// 列表_删除项扩展. +// 列表_删除行扩展. // -// iItem:. +// iRow:. // // nCount:. -func (l *List) DeleteItemEx(iItem int, nCount int) bool { - return xc.XList_DeleteItemEx(l.Handle, iItem, nCount) +func (l *List) DeleteRowEx(iRow int, nCount int) bool { + return xc.XList_DeleteRowEx(l.Handle, iRow, nCount) } -// 列表_删除项全部. -func (l *List) DeleteItemAll() int { - return xc.XList_DeleteItemAll(l.Handle) +// 列表_删除行全部. +func (l *List) DeleteRowAll() *List { + xc.XList_DeleteRowAll(l.Handle) + return l } // 列表_删除列全部AD. -func (l *List) DeleteColumnAll_AD() int { - return xc.XList_DeleteColumnAll_AD(l.Handle) +func (l *List) DeleteColumnAll_AD() *List { + xc.XList_DeleteColumnAll_AD(l.Handle) + return l } // 列表_取项数量AD. @@ -813,40 +844,44 @@ func (l *List) GetCountColumn_AD() int { // 列表_置分割线颜色. // -// color: ABGR 颜色值. -func (l *List) SetSplitLineColor(color int) int { - return xc.XList_SetSplitLineColor(l.Handle, color) +// color: ARGB 颜色值. +func (l *List) SetSplitLineColor(color int) *List { + xc.XList_SetSplitLineColor(l.Handle, color) + return l } -// 列表_置项高度. +// 列表_置行高度. // // iRow: 行索引. // // nHeight: 高度. // // nSelHeight: 选中时高度. -func (l *List) SetItemHeight(iRow int, nHeight, nSelHeight int32) int { - return xc.XList_SetItemHeight(l.Handle, iRow, nHeight, nSelHeight) +func (l *List) SetRowHeight(iRow int, nHeight, nSelHeight int32) *List { + xc.XList_SetRowHeight(l.Handle, iRow, nHeight, nSelHeight) + return l } -// 列表_取项高度. +// 列表_取行高度. // // iRow: 行索引. // // pHeight: 高度. // // pSelHeight: 选中时高度. -func (l *List) GetItemHeight(iRow int, pHeight, pSelHeight *int32) int { - return xc.XList_GetItemHeight(l.Handle, iRow, pHeight, pSelHeight) +func (l *List) GetRowHeight(iRow int, pHeight, pSelHeight *int32) *List { + xc.XList_GetRowHeight(l.Handle, iRow, pHeight, pSelHeight) + return l } // 列表_置拖动矩形颜色. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. // // width: 线宽度. -func (l *List) SetDragRectColor(color, width int) int { - return xc.XList_SetDragRectColor(l.Handle, color, width) +func (l *List) SetDragRectColor(color, width int) *List { + xc.XList_SetDragRectColor(l.Handle, color, width) + return l } // 列表_取项模板. 返回列表项模板句柄. @@ -860,8 +895,9 @@ func (l *List) GetItemTemplateHeader() int { } // 列表_刷新项数据列表头. -func (l *List) RefreshDataHeader() int { - return xc.XList_RefreshDataHeader(l.Handle) +func (l *List) RefreshDataHeader() *List { + xc.XList_RefreshDataHeader(l.Handle) + return l } // 列表_置项模板从内存. @@ -884,8 +920,33 @@ func (l *List) SetItemTemplateXMLFromZipRes(id int32, pFileName string, pPasswor return xc.XList_SetItemTemplateXMLFromZipRes(l.Handle, id, pFileName, pPassword, hModule) } +// 列表_添加列文本2, 返回列索引. 简化版本. +// +// nWidth: 列宽度. +// +// pText: 标题文本. +func (l *List) AddColumnText2(nWidth int32, pText string) int32 { + return xc.XList_AddColumnText2(l.Handle, nWidth, pText) +} + +// 列表_添加列图片2, 返回列索引. 简化版本. +// +// nWidth: 列宽度. +// +// hImage: 图片句柄. +func (l *List) AddColumnImage2(nWidth int32, hImage int) int32 { + return xc.XList_AddColumnImage2(l.Handle, nWidth, hImage) +} + +// 列表_创建数据适配器2. 创建数据适配器,根据绑定的项模板初始化数据适配器的列(字段名); 数据适配器存储数据, UI对象根据绑定的字段名显示数据适配器中对应的数据; 此接口是简化接口, 合并了 xc.XList_CreateAdapter() 和 xc.XList_CreateAdapterHeader() 接口; +// +// col_extend_count: 列延伸-预计列表总列数, 默认值0; 限制最大延伸范围, 避免超出范围, 增加不必要的字段. 例如默认模板是1列, 但是数据有5列,那么列延伸填5. +func (l *List) CreateAdapters(col_extend_count int32) bool { + return xc.XList_CreateAdapters(l.Handle, col_extend_count) +} + /* -以下都是事件 +// //////////////////////////////////// 以下是事件 ////////////////////////////////////// */ // 列表元素-项模板创建事件,模板复用机制需先启用;替换模板无效判断nFlag,因为内部会检查模板是否改变,不用担心重复. diff --git a/widget/listbox.go b/widget/listbox.go index ff3da92..785c220 100644 --- a/widget/listbox.go +++ b/widget/listbox.go @@ -5,7 +5,7 @@ import ( "github.com/twgh/xcgui/xcc" ) -// 列表框. +// ListBox 列表框. type ListBox struct { ScrollView } @@ -89,36 +89,41 @@ func NewListBoxByUIDName(name string) *ListBox { // 列表框_启用固定行高. // // bEnable: 是否启用. -func (l *ListBox) EnableFixedRowHeight(bEnable bool) int { - return xc.XListBox_EnableFixedRowHeight(l.Handle, bEnable) +func (l *ListBox) EnableFixedRowHeight(bEnable bool) *ListBox { + xc.XListBox_EnableFixedRowHeight(l.Handle, bEnable) + return l } // 列表框_启用模板复用. // // bEnable: 是否启用. -func (l *ListBox) EnableTemplateReuse(bEnable bool) int { - return xc.XListBox_EnableTemplateReuse(l.Handle, bEnable) +func (l *ListBox) EnableTemplateReuse(bEnable bool) *ListBox { + xc.XListBox_EnableTemplateReuse(l.Handle, bEnable) + return l } // 列表框_启用虚表. // // bEnable: 是否启用. -func (l *ListBox) EnableVirtualTable(bEnable bool) int { - return xc.XListBox_EnableVirtualTable(l.Handle, bEnable) +func (l *ListBox) EnableVirtualTable(bEnable bool) *ListBox { + xc.XListBox_EnableVirtualTable(l.Handle, bEnable) + return l } // 列表框_置虚表行数. // // nRowCount: 行数. -func (l *ListBox) SetVirtualRowCount(nRowCount int) int { - return xc.XListBox_SetVirtualRowCount(l.Handle, nRowCount) +func (l *ListBox) SetVirtualRowCount(nRowCount int32) *ListBox { + xc.XListBox_SetVirtualRowCount(l.Handle, nRowCount) + return l } // 列表框_置绘制项背景标志, 设置是否绘制指定状态下项的背景. // // nFlags: 标志位, List_DrawItemBk_Flag_. -func (l *ListBox) SetDrawItemBkFlags(nFlags xcc.List_DrawItemBk_Flag_) int { - return xc.XListBox_SetDrawItemBkFlags(l.Handle, nFlags) +func (l *ListBox) SetDrawItemBkFlags(nFlags xcc.List_DrawItemBk_Flag_) *ListBox { + xc.XListBox_SetDrawItemBkFlags(l.Handle, nFlags) + return l } // 列表框_置项数据, 设置项用户数据. @@ -126,14 +131,14 @@ func (l *ListBox) SetDrawItemBkFlags(nFlags xcc.List_DrawItemBk_Flag_) int { // iItem: 想索引. // // nUserData: 用户数据. -func (l *ListBox) SetItemData(iItem int, nUserData int) bool { +func (l *ListBox) SetItemData(iItem int32, nUserData int) bool { return xc.XListBox_SetItemData(l.Handle, iItem, nUserData) } // 列表框_取项数据, 获取项用户数据. // // iItem: 项索引. -func (l *ListBox) GetItemData(iItem int) int { +func (l *ListBox) GetItemData(iItem int32) int { return xc.XListBox_GetItemData(l.Handle, iItem) } @@ -142,7 +147,7 @@ func (l *ListBox) GetItemData(iItem int) int { // iItem: 项索引. // // pItem: 项信息. -func (l *ListBox) SetItemInfo(iItem int, pItem *xc.ListBox_Item_Info_) bool { +func (l *ListBox) SetItemInfo(iItem int32, pItem *xc.ListBox_Item_Info_) bool { return xc.XListBox_SetItemInfo(l.Handle, iItem, pItem) } @@ -151,33 +156,33 @@ func (l *ListBox) SetItemInfo(iItem int, pItem *xc.ListBox_Item_Info_) bool { // iItem: 项索引. // // pItem: 项信息. -func (l *ListBox) GetItemInfo(iItem int, pItem *xc.ListBox_Item_Info_) bool { +func (l *ListBox) GetItemInfo(iItem int32, pItem *xc.ListBox_Item_Info_) bool { return xc.XListBox_GetItemInfo(l.Handle, iItem, pItem) } // 列表框_置选择项, 设置选择选. // // iItem: 项索引. -func (l *ListBox) SetSelectItem(iItem int) bool { +func (l *ListBox) SetSelectItem(iItem int32) bool { return xc.XListBox_SetSelectItem(l.Handle, iItem) } // 列表框_取选择项, 返回项索引. -func (l *ListBox) GetSelectItem() int { +func (l *ListBox) GetSelectItem() int32 { return xc.XListBox_GetSelectItem(l.Handle) } // 列表框_添加选择项. // // iItem: 项索引. -func (l *ListBox) AddSelectItem(iItem int) bool { +func (l *ListBox) AddSelectItem(iItem int32) bool { return xc.XListBox_AddSelectItem(l.Handle, iItem) } // 列表框_取消选择项. // // iItem: 项索引. -func (l *ListBox) CancelSelectItem(iItem int) bool { +func (l *ListBox) CancelSelectItem(iItem int32) bool { return xc.XListBox_CancelSelectItem(l.Handle, iItem) } @@ -191,17 +196,17 @@ func (l *ListBox) CancelSelectAll() bool { // pArray: 数组缓冲区. // // nArraySize: 数组大小. -func (l *ListBox) GetSelectAll(pArray *[]int32, nArraySize int) int { +func (l *ListBox) GetSelectAll(pArray *[]int32, nArraySize int32) int32 { return xc.XListBox_GetSelectAll(l.Handle, pArray, nArraySize) } // 列表框_取选择项数量, 获取选择项数量. -func (l *ListBox) GetSelectCount() int { +func (l *ListBox) GetSelectCount() int32 { return xc.XListBox_GetSelectCount(l.Handle) } // 列表框_取鼠标停留项, 返回鼠标所在项. -func (l *ListBox) GetItemMouseStay() int { +func (l *ListBox) GetItemMouseStay() int32 { return xc.XListBox_GetItemMouseStay(l.Handle) } @@ -213,8 +218,9 @@ func (l *ListBox) SelectAll() bool { // 列表框_显示指定项, 滚动视图让指定项可见. // // iItem: 项索引. -func (l *ListBox) VisibleItem(iItem int) int { - return xc.XListBox_VisibleItem(l.Handle, iItem) +func (l *ListBox) VisibleItem(iItem int32) *ListBox { + xc.XListBox_VisibleItem(l.Handle, iItem) + return l } // 列表框_取可视行范围, 获取当前可见行范围. @@ -222,8 +228,9 @@ func (l *ListBox) VisibleItem(iItem int) int { // piStart: 开始行索引. // // piEnd: 结束行索引. -func (l *ListBox) GetVisibleRowRange(piStart *int32, piEnd *int32) int { - return xc.XListBox_GetVisibleRowRange(l.Handle, piStart, piEnd) +func (l *ListBox) GetVisibleRowRange(piStart *int32, piEnd *int32) *ListBox { + xc.XListBox_GetVisibleRowRange(l.Handle, piStart, piEnd) + return l } // 列表框_置项默认高度. @@ -231,8 +238,9 @@ func (l *ListBox) GetVisibleRowRange(piStart *int32, piEnd *int32) int { // nHeight: 项高度. // // nSelHeight: 选中项高度. -func (l *ListBox) SetItemHeightDefault(nHeight int32, nSelHeight int32) int { - return xc.XListBox_SetItemHeightDefault(l.Handle, nHeight, nSelHeight) +func (l *ListBox) SetItemHeightDefault(nHeight int32, nSelHeight int32) *ListBox { + xc.XListBox_SetItemHeightDefault(l.Handle, nHeight, nSelHeight) + return l } // 列表框_取项默认高度. @@ -240,40 +248,42 @@ func (l *ListBox) SetItemHeightDefault(nHeight int32, nSelHeight int32) int { // pHeight: 高度. // // pSelHeight: 选中时高度. -func (l *ListBox) GetItemHeightDefault(pHeight *int32, pSelHeight *int32) int { - return xc.XListBox_GetItemHeightDefault(l.Handle, pHeight, pSelHeight) +func (l *ListBox) GetItemHeightDefault(pHeight *int32, pSelHeight *int32) *ListBox { + xc.XListBox_GetItemHeightDefault(l.Handle, pHeight, pSelHeight) + return l } // 列表框_取所在行索引, 获取当前对象所在模板实例, 属于列表中哪一个项(行). 成功返回项索引, 否则返回XC_ID_ERROR. // // hXCGUI: 对象句柄, UI元素句柄或形状对象句柄. -func (l *ListBox) GetItemIndexFromHXCGUI(hXCGUI int) int { +func (l *ListBox) GetItemIndexFromHXCGUI(hXCGUI int) int32 { return xc.XListBox_GetItemIndexFromHXCGUI(l.Handle, hXCGUI) } // 列表框_置行间距. // // nSpace: 间距大小. -func (l *ListBox) SetRowSpace(nSpace int) int { - return xc.XListBox_SetRowSpace(l.Handle, nSpace) +func (l *ListBox) SetRowSpace(nSpace int32) *ListBox { + xc.XListBox_SetRowSpace(l.Handle, nSpace) + return l } // 列表框_取行间距. -func (l *ListBox) GetRowSpace() int { +func (l *ListBox) GetRowSpace() int32 { return xc.XListBox_GetRowSpace(l.Handle) } // 列表框_测试点击项, 检测坐标点所在项, 返回项索引. // // pPt: 坐标点. -func (l *ListBox) HitTest(pPt *xc.POINT) int { +func (l *ListBox) HitTest(pPt *xc.POINT) int32 { return xc.XListBox_HitTest(l.Handle, pPt) } // 列表框_测试点击项扩展, 检测坐标点所在项, 自动添加滚动视图偏移量, 返回项索引. // // pPt: 坐标点. -func (l *ListBox) HitTestOffset(pPt *xc.POINT) int { +func (l *ListBox) HitTestOffset(pPt *xc.POINT) int32 { return xc.XListBox_HitTestOffset(l.Handle, pPt) } @@ -303,15 +313,16 @@ func (l *ListBox) SetItemTemplateXMLFromString(pStringXML string) bool { // iItem: 项索引. // // nTempItemID: 模板项ID. -func (l *ListBox) GetTemplateObject(iItem int, nTempItemID int) int { +func (l *ListBox) GetTemplateObject(iItem, nTempItemID int32) int { return xc.XListBox_GetTemplateObject(l.Handle, iItem, nTempItemID) } // 列表框_启用多选, 是否启用多行选择功能. // // bEnable: 是否启用. -func (l *ListBox) EnableMultiSel(bEnable bool) int { - return xc.XListBox_EnableMultiSel(l.Handle, bEnable) +func (l *ListBox) EnableMultiSel(bEnable bool) *ListBox { + xc.XListBox_EnableMultiSel(l.Handle, bEnable) + return l } // 列表框_创建数据适配器, 创建数据适配器并绑定, 根据绑定的项模板初始化数据适配器的列, 返回适配器句柄. @@ -322,8 +333,9 @@ func (l *ListBox) CreateAdapter() int { // 列表框_绑定数据适配器, 绑定数据适配器. // // hAdapter: 数据适配器句柄 XAdTable. -func (l *ListBox) BindAdapter(hAdapter int) int { - return xc.XListBox_BindAdapter(l.Handle, hAdapter) +func (l *ListBox) BindAdapter(hAdapter int) *ListBox { + xc.XListBox_BindAdapter(l.Handle, hAdapter) + return l } // 列表框_取数据适配器, 获取绑定的数据适配器, 返回数据适配器句柄. @@ -336,51 +348,54 @@ func (l *ListBox) GetAdapter() int { // iColumnAdapter: 需要排序的数据在数据适配器中所属列索引. // // bAscending: 升序(TRUE)或降序(FALSE). -func (l *ListBox) Sort(iColumnAdapter int, bAscending bool) int { - return xc.XListBox_Sort(l.Handle, iColumnAdapter, bAscending) +func (l *ListBox) Sort(iColumnAdapter int32, bAscending bool) *ListBox { + xc.XListBox_Sort(l.Handle, iColumnAdapter, bAscending) + return l } // 列表框_刷新数据. -func (l *ListBox) RefreshData() int { - return xc.XListBox_RefreshData(l.Handle) +func (l *ListBox) RefreshData() *ListBox { + xc.XListBox_RefreshData(l.Handle) + return l } // 列表框_刷新指定项, 刷新指定项模板, 以便更新UI. // // iItem: 项索引. -func (l *ListBox) RefreshItem(iItem int) int { - return xc.XListBox_RefreshItem(l.Handle, iItem) +func (l *ListBox) RefreshItem(iItem int32) *ListBox { + xc.XListBox_RefreshItem(l.Handle, iItem) + return l } -// 列表框_添加项文本, XAdTable_AddItemText, 返回项索引. +// 列表框_添加项文本, XAdTable_AddRowText, 返回项索引. // // pText:. -func (l *ListBox) AddItemText(pText string) int { +func (l *ListBox) AddItemText(pText string) int32 { return xc.XListBox_AddItemText(l.Handle, pText) } -// 列表框_添加项文本扩展, XAdTable_AddItemTextEx. +// 列表框_添加项文本扩展, XAdTable_AddRowTextEx. // // pName:. // // pText:. -func (l *ListBox) AddItemTextEx(pName string, pText string) int { +func (l *ListBox) AddItemTextEx(pName string, pText string) int32 { return xc.XListBox_AddItemTextEx(l.Handle, pName, pText) } -// 列表框_添加项图片, XAdTable_AddItemImage. +// 列表框_添加项图片, XAdTable_AddRowImage. // // hImage:. -func (l *ListBox) AddItemImage(hImage int) int { +func (l *ListBox) AddItemImage(hImage int) int32 { return xc.XListBox_AddItemImage(l.Handle, hImage) } -// 列表框_添加项图片扩展, XAdTable_AddItemImageEx. +// 列表框_添加项图片扩展, XAdTable_AddRowImageEx. // // pName:. // // hImage:. -func (l *ListBox) AddItemImageEx(pName string, hImage int) int { +func (l *ListBox) AddItemImageEx(pName string, hImage int) int32 { return xc.XListBox_AddItemImageEx(l.Handle, pName, hImage) } @@ -389,7 +404,7 @@ func (l *ListBox) AddItemImageEx(pName string, hImage int) int { // iItem:. // // pValue:. -func (l *ListBox) InsertItemText(iItem int, pValue string) int { +func (l *ListBox) InsertItemText(iItem int32, pValue string) int32 { return xc.XListBox_InsertItemText(l.Handle, iItem, pValue) } @@ -400,7 +415,7 @@ func (l *ListBox) InsertItemText(iItem int, pValue string) int { // pName:. // // pValue:. -func (l *ListBox) InsertItemTextEx(iItem int, pName string, pValue string) int { +func (l *ListBox) InsertItemTextEx(iItem int32, pName string, pValue string) int32 { return xc.XListBox_InsertItemTextEx(l.Handle, iItem, pName, pValue) } @@ -409,7 +424,7 @@ func (l *ListBox) InsertItemTextEx(iItem int, pName string, pValue string) int { // iItem:. // // hImage:. -func (l *ListBox) InsertItemImage(iItem int, hImage int) int { +func (l *ListBox) InsertItemImage(iItem int32, hImage int) int32 { return xc.XListBox_InsertItemImage(l.Handle, iItem, hImage) } @@ -420,7 +435,7 @@ func (l *ListBox) InsertItemImage(iItem int, hImage int) int { // pName:. // // hImage:. -func (l *ListBox) InsertItemImageEx(iItem int, pName string, hImage int) int { +func (l *ListBox) InsertItemImageEx(iItem int32, pName string, hImage int) int32 { return xc.XListBox_InsertItemImageEx(l.Handle, iItem, pName, hImage) } @@ -431,7 +446,7 @@ func (l *ListBox) InsertItemImageEx(iItem int, pName string, hImage int) int { // iColumn:. // // pText:. -func (l *ListBox) SetItemText(iItem int, iColumn int, pText string) bool { +func (l *ListBox) SetItemText(iItem, iColumn int32, pText string) bool { return xc.XListBox_SetItemText(l.Handle, iItem, iColumn, pText) } @@ -442,7 +457,7 @@ func (l *ListBox) SetItemText(iItem int, iColumn int, pText string) bool { // pName:. // // pText:. -func (l *ListBox) SetItemTextEx(iItem int, pName string, pText string) bool { +func (l *ListBox) SetItemTextEx(iItem int32, pName string, pText string) bool { return xc.XListBox_SetItemTextEx(l.Handle, iItem, pName, pText) } @@ -453,7 +468,7 @@ func (l *ListBox) SetItemTextEx(iItem int, pName string, pText string) bool { // iColumn:. // // hImage:. -func (l *ListBox) SetItemImage(iItem int, iColumn int, hImage int) bool { +func (l *ListBox) SetItemImage(iItem, iColumn int32, hImage int) bool { return xc.XListBox_SetItemImage(l.Handle, iItem, iColumn, hImage) } @@ -464,7 +479,7 @@ func (l *ListBox) SetItemImage(iItem int, iColumn int, hImage int) bool { // pName:. // // hImage:. -func (l *ListBox) SetItemImageEx(iItem int, pName string, hImage int) bool { +func (l *ListBox) SetItemImageEx(iItem int32, pName string, hImage int) bool { return xc.XListBox_SetItemImageEx(l.Handle, iItem, pName, hImage) } @@ -475,7 +490,7 @@ func (l *ListBox) SetItemImageEx(iItem int, pName string, hImage int) bool { // iColumn:. // // nValue:. -func (l *ListBox) SetItemInt(iItem int, iColumn int, nValue int) bool { +func (l *ListBox) SetItemInt(iItem, iColumn int32, nValue int32) bool { return xc.XListBox_SetItemInt(l.Handle, iItem, iColumn, nValue) } @@ -486,7 +501,7 @@ func (l *ListBox) SetItemInt(iItem int, iColumn int, nValue int) bool { // pName:. // // nValue:. -func (l *ListBox) SetItemIntEx(iItem int, pName string, nValue int) bool { +func (l *ListBox) SetItemIntEx(iItem int32, pName string, nValue int32) bool { return xc.XListBox_SetItemIntEx(l.Handle, iItem, pName, nValue) } @@ -497,7 +512,7 @@ func (l *ListBox) SetItemIntEx(iItem int, pName string, nValue int) bool { // iColumn:. // // fFloat:. -func (l *ListBox) SetItemFloat(iItem int, iColumn int, fFloat float32) bool { +func (l *ListBox) SetItemFloat(iItem, iColumn int32, fFloat float32) bool { return xc.XListBox_SetItemFloat(l.Handle, iItem, iColumn, fFloat) } @@ -508,7 +523,7 @@ func (l *ListBox) SetItemFloat(iItem int, iColumn int, fFloat float32) bool { // pName:. // // fFloat:. -func (l *ListBox) SetItemFloatEx(iItem int, pName string, fFloat float32) bool { +func (l *ListBox) SetItemFloatEx(iItem int32, pName string, fFloat float32) bool { return xc.XListBox_SetItemFloatEx(l.Handle, iItem, pName, fFloat) } @@ -517,7 +532,7 @@ func (l *ListBox) SetItemFloatEx(iItem int, pName string, fFloat float32) bool { // iItem:. // // iColumn:. -func (l *ListBox) GetItemText(iItem int, iColumn int) string { +func (l *ListBox) GetItemText(iItem, iColumn int32) string { return xc.XListBox_GetItemText(l.Handle, iItem, iColumn) } @@ -526,7 +541,7 @@ func (l *ListBox) GetItemText(iItem int, iColumn int) string { // iItem:. // // pName:. -func (l *ListBox) GetItemTextEx(iItem int, pName string) string { +func (l *ListBox) GetItemTextEx(iItem int32, pName string) string { return xc.XListBox_GetItemTextEx(l.Handle, iItem, pName) } @@ -535,7 +550,7 @@ func (l *ListBox) GetItemTextEx(iItem int, pName string) string { // iItem:. // // iColumn:. -func (l *ListBox) GetItemImage(iItem int, iColumn int) int { +func (l *ListBox) GetItemImage(iItem, iColumn int32) int { return xc.XListBox_GetItemImage(l.Handle, iItem, iColumn) } @@ -544,7 +559,7 @@ func (l *ListBox) GetItemImage(iItem int, iColumn int) int { // iItem:. // // pName:. -func (l *ListBox) GetItemImageEx(iItem int, pName string) int { +func (l *ListBox) GetItemImageEx(iItem int32, pName string) int { return xc.XListBox_GetItemImageEx(l.Handle, iItem, pName) } @@ -555,7 +570,7 @@ func (l *ListBox) GetItemImageEx(iItem int, pName string) int { // iColumn:. // // pOutValue:. -func (l *ListBox) GetItemInt(iItem int, iColumn int, pOutValue *int32) bool { +func (l *ListBox) GetItemInt(iItem, iColumn int32, pOutValue *int32) bool { return xc.XListBox_GetItemInt(l.Handle, iItem, iColumn, pOutValue) } @@ -566,7 +581,7 @@ func (l *ListBox) GetItemInt(iItem int, iColumn int, pOutValue *int32) bool { // pName:. // // pOutValue:. -func (l *ListBox) GetItemIntEx(iItem int, pName string, pOutValue *int32) bool { +func (l *ListBox) GetItemIntEx(iItem int32, pName string, pOutValue *int32) bool { return xc.XListBox_GetItemIntEx(l.Handle, iItem, pName, pOutValue) } @@ -577,7 +592,7 @@ func (l *ListBox) GetItemIntEx(iItem int, pName string, pOutValue *int32) bool { // iColumn:. // // pOutValue:. -func (l *ListBox) GetItemFloat(iItem int, iColumn int, pOutValue *float32) bool { +func (l *ListBox) GetItemFloat(iItem, iColumn int32, pOutValue *float32) bool { return xc.XListBox_GetItemFloat(l.Handle, iItem, iColumn, pOutValue) } @@ -588,14 +603,14 @@ func (l *ListBox) GetItemFloat(iItem int, iColumn int, pOutValue *float32) bool // pName:. // // pOutValue:. -func (l *ListBox) GetItemFloatEx(iItem int, pName string, pOutValue *float32) bool { +func (l *ListBox) GetItemFloatEx(iItem int32, pName string, pOutValue *float32) bool { return xc.XListBox_GetItemFloatEx(l.Handle, iItem, pName, pOutValue) } // 列表框_删除项. // // iItem:. -func (l *ListBox) DeleteItem(iItem int) bool { +func (l *ListBox) DeleteItem(iItem int32) bool { return xc.XListBox_DeleteItem(l.Handle, iItem) } @@ -604,44 +619,48 @@ func (l *ListBox) DeleteItem(iItem int) bool { // iItem:. // // nCount:. -func (l *ListBox) DeleteItemEx(iItem int, nCount int) bool { +func (l *ListBox) DeleteItemEx(iItem int32, nCount int32) bool { return xc.XListBox_DeleteItemEx(l.Handle, iItem, nCount) } // 列表框_删除项全部. -func (l *ListBox) DeleteItemAll() int { - return xc.XListBox_DeleteItemAll(l.Handle) +func (l *ListBox) DeleteItemAll() *ListBox { + xc.XListBox_DeleteItemAll(l.Handle) + return l } // 列表框_删除列全部. -func (l *ListBox) DeleteColumnAll() int { - return xc.XListBox_DeleteColumnAll(l.Handle) +func (l *ListBox) DeleteColumnAll() *ListBox { + xc.XListBox_DeleteColumnAll(l.Handle) + return l } // 列表框_取项数量AD. -func (l *ListBox) GetCount_AD() int { +func (l *ListBox) GetCount_AD() int32 { return xc.XListBox_GetCount_AD(l.Handle) } // 列表框_取列数量AD. -func (l *ListBox) GetCountColumn_AD() int { +func (l *ListBox) GetCountColumn_AD() int32 { return xc.XListBox_GetCountColumn_AD(l.Handle) } // 列表框_置分割线颜色. // -// color: ABGR 颜色值. -func (l *ListBox) SetSplitLineColor(color int) int { - return xc.XListBox_SetSplitLineColor(l.Handle, color) +// color: ARGB 颜色值. +func (l *ListBox) SetSplitLineColor(color int) *ListBox { + xc.XListBox_SetSplitLineColor(l.Handle, color) + return l } // 列表框_置拖动矩形颜色. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. // // width: 线宽度. -func (l *ListBox) SetDragRectColor(color, width int) int { - return xc.XListBox_SetDragRectColor(l.Handle, color, width) +func (l *ListBox) SetDragRectColor(color int, width int32) *ListBox { + xc.XListBox_SetDragRectColor(l.Handle, color, width) + return l } // 列表框_置项模板从内存. 设置项模板文件. @@ -660,7 +679,7 @@ func (l *ListBox) SetItemTemplateXMLFromMem(data []byte) bool { // pPassword: zip密码. // // hModule: 模块句柄, 可填0. -func (l *ListBox) SetItemTemplateXMLFromZipRes(id int, pFileName string, pPassword string, hModule uintptr) bool { +func (l *ListBox) SetItemTemplateXMLFromZipRes(id int32, pFileName string, pPassword string, hModule uintptr) bool { return xc.XListBox_SetItemTemplateXMLFromZipRes(l.Handle, id, pFileName, pPassword, hModule) } @@ -669,6 +688,30 @@ func (l *ListBox) GetItemTemplate() int { return xc.XListBox_GetItemTemplate(l.Handle) } +// 列表框_置项高度. 注意:为了提高性能, 默认使用列表框的全局项高度, 如果需要指定项单独高度, 需要关闭固定行高: xc.XListBox_EnableFixedRowHeight +// +// iItem: 项索引. +// +// nHeight: 项高度. +// +// nSelHeight: 项选中时高度. +func (l *ListBox) SetItemHeight(iItem, nHeight, nSelHeight int32) *ListBox { + xc.XListBox_SetItemHeight(l.Handle, iItem, nHeight, nSelHeight) + return l +} + +// 列表框_取项高度. +// +// iItem: 项索引. +// +// pHeight: 高度. +// +// pSelHeight: 选中时高度. +func (l *ListBox) GetItemHeight(iItem int32, pHeight, pSelHeight *int32) *ListBox { + xc.XListBox_GetItemHeight(l.Handle, iItem, pHeight, pSelHeight) + return l +} + /* 以下都是事件 */ diff --git a/widget/listview.go b/widget/listview.go index a3699bf..c5dee09 100644 --- a/widget/listview.go +++ b/widget/listview.go @@ -5,7 +5,7 @@ import ( "github.com/twgh/xcgui/xcc" ) -// 列表视图. +// ListView 列表视图. type ListView struct { ScrollView } @@ -94,8 +94,9 @@ func (l *ListView) CreateAdapter() int { // 列表视_绑定数据适配器. // // hAdapter: 数据适配器XAdListView. -func (l *ListView) BindAdapter(hAdapter int) int { - return xc.XListView_BindAdapter(l.Handle, hAdapter) +func (l *ListView) BindAdapter(hAdapter int) *ListView { + xc.XListView_BindAdapter(l.Handle, hAdapter) + return l } // 列表视_取数据适配器, 返回数据适配器句柄. @@ -180,22 +181,25 @@ func (l *ListView) HitTestOffset(pPt *xc.POINT, pOutGroup *int32, pOutItem *int3 // 列表视_启用多选. // // bEnable: 是否启用. -func (l *ListView) EnableMultiSel(bEnable bool) int { - return xc.XListView_EnableMultiSel(l.Handle, bEnable) +func (l *ListView) EnableMultiSel(bEnable bool) *ListView { + xc.XListView_EnableMultiSel(l.Handle, bEnable) + return l } // 列表视_启用模板复用. // // bEnable: 是否启用. -func (l *ListView) EnableTemplateReuse(bEnable bool) int { - return xc.XListView_EnableTemplateReuse(l.Handle, bEnable) +func (l *ListView) EnableTemplateReuse(bEnable bool) *ListView { + xc.XListView_EnableTemplateReuse(l.Handle, bEnable) + return l } // 列表视_启用虚表. // // bEnable: 是否启用. -func (l *ListView) EnableVirtualTable(bEnable bool) int { - return xc.XListView_EnableVirtualTable(l.Handle, bEnable) +func (l *ListView) EnableVirtualTable(bEnable bool) *ListView { + xc.XListView_EnableVirtualTable(l.Handle, bEnable) + return l } // 列表视_置虚表项数量. @@ -210,8 +214,9 @@ func (l *ListView) SetVirtualItemCount(iGroup int, nCount int) bool { // 列表视_置项背景绘制标志, 置是否绘制指定状态下项的背景. // // nFlags: 标志位: List_DrawItemBk_Flag_. -func (l *ListView) SetDrawItemBkFlags(nFlags xcc.List_DrawItemBk_Flag_) int { - return xc.XListView_SetDrawItemBkFlags(l.Handle, nFlags) +func (l *ListView) SetDrawItemBkFlags(nFlags xcc.List_DrawItemBk_Flag_) *ListView { + xc.XListView_SetDrawItemBkFlags(l.Handle, nFlags) + return l } // 列表视_置选择项. @@ -246,8 +251,9 @@ func (l *ListView) AddSelectItem(iGroup int, iItem int) bool { // iGroup: 组索引. // // iItem: 项索引. -func (l *ListView) VisibleItem(iGroup int, iItem int) int { - return xc.XListView_VisibleItem(l.Handle, iGroup, iItem) +func (l *ListView) VisibleItem(iGroup int, iItem int) *ListView { + xc.XListView_VisibleItem(l.Handle, iGroup, iItem) + return l } // 列表视_取可视项范围, 获取当前可见项范围. @@ -263,8 +269,9 @@ func (l *ListView) VisibleItem(iGroup int, iItem int) int { // piEndGroup: 可视结束组. // // piEndItem: 可视结束项. -func (l *ListView) GetVisibleItemRange(piGroup1 *int32, piGroup2 *int32, piStartGroup *int32, piStartItem *int32, piEndGroup *int32, piEndItem *int32) int { - return xc.XListView_GetVisibleItemRange(l.Handle, piGroup1, piGroup2, piStartGroup, piStartItem, piEndGroup, piEndItem) +func (l *ListView) GetVisibleItemRange(piGroup1 *int32, piGroup2 *int32, piStartGroup *int32, piStartItem *int32, piEndGroup *int32, piEndItem *int32) *ListView { + xc.XListView_GetVisibleItemRange(l.Handle, piGroup1, piGroup2, piStartGroup, piStartItem, piEndGroup, piEndItem) + return l } // 列表视_取选择项数量. @@ -282,27 +289,31 @@ func (l *ListView) GetSelectAll(pArray *[]xc.ListView_Item_Id_, nArraySize int) } // 列表视_置选择项全部, 选择所有的项. -func (l *ListView) SetSelectAll() int { - return xc.XListView_SetSelectAll(l.Handle) +func (l *ListView) SetSelectAll() *ListView { + xc.XListView_SetSelectAll(l.Handle) + return l } // 列表视_取消选择项全部, 取消选择所有项. -func (l *ListView) CancelSelectAll() int { - return xc.XListView_CancelSelectAll(l.Handle) +func (l *ListView) CancelSelectAll() *ListView { + xc.XListView_CancelSelectAll(l.Handle) + return l } // 列表视_置列间隔, 置列间隔大小. // // space: 间隔大小. -func (l *ListView) SetColumnSpace(space int) int { - return xc.XListView_SetColumnSpace(l.Handle, space) +func (l *ListView) SetColumnSpace(space int) *ListView { + xc.XListView_SetColumnSpace(l.Handle, space) + return l } // 列表视_置行间隔, 置行间隔大小. // // space: 间隔大小. -func (l *ListView) SetRowSpace(space int) int { - return xc.XListView_SetRowSpace(l.Handle, space) +func (l *ListView) SetRowSpace(space int) *ListView { + xc.XListView_SetRowSpace(l.Handle, space) + return l } // 列表视_置项大小. @@ -310,22 +321,25 @@ func (l *ListView) SetRowSpace(space int) int { // width: 宽度. // // height: 高度. -func (l *ListView) SetItemSize(width int, height int) int { - return xc.XListView_SetItemSize(l.Handle, width, height) +func (l *ListView) SetItemSize(width int, height int) *ListView { + xc.XListView_SetItemSize(l.Handle, width, height) + return l } // 列表视_取项大小. // // pSize: 接收返回大小. -func (l *ListView) GetItemSize(pSize *xc.SIZE) int { - return xc.XListView_GetItemSize(l.Handle, pSize) +func (l *ListView) GetItemSize(pSize *xc.SIZE) *ListView { + xc.XListView_GetItemSize(l.Handle, pSize) + return l } // 列表视_置组高度. // // height: 高度. -func (l *ListView) SetGroupHeight(height int) int { - return xc.XListView_SetGroupHeight(l.Handle, height) +func (l *ListView) SetGroupHeight(height int) *ListView { + xc.XListView_SetGroupHeight(l.Handle, height) + return l } // 列表视_取组高度. @@ -338,8 +352,9 @@ func (l *ListView) GetGroupHeight() int { // iGroup: 组索引. // // nData: 数据. -func (l *ListView) SetGroupUserData(iGroup int, nData int) int { - return xc.XListView_SetGroupUserData(l.Handle, iGroup, nData) +func (l *ListView) SetGroupUserData(iGroup int, nData int) *ListView { + xc.XListView_SetGroupUserData(l.Handle, iGroup, nData) + return l } // 列表视_置项用户数据. @@ -349,8 +364,9 @@ func (l *ListView) SetGroupUserData(iGroup int, nData int) int { // iItem: 项索引. // // nData: 数据. -func (l *ListView) SetItemUserData(iGroup int, iItem int, nData int) int { - return xc.XListView_SetItemUserData(l.Handle, iGroup, iItem, nData) +func (l *ListView) SetItemUserData(iGroup int, iItem int, nData int) *ListView { + xc.XListView_SetItemUserData(l.Handle, iGroup, iItem, nData) + return l } // 列表视_取组用户数据. @@ -370,8 +386,9 @@ func (l *ListView) GetItemUserData(iGroup int, iItem int) int { } // 列表视_刷新项数据. -func (l *ListView) RefreshData() int { - return xc.XListView_RefreshData(l.Handle) +func (l *ListView) RefreshData() *ListView { + xc.XListView_RefreshData(l.Handle) + return l } // 列表视_刷新指定项, 刷新指定项模板, 以便更新UI. @@ -379,8 +396,9 @@ func (l *ListView) RefreshData() int { // iGroup: 组索引. // // iItem: 项索引, 如果为-1, 代表为组. -func (l *ListView) RefreshItem(iGroup int, iItem int) int { - return xc.XListView_RefreshItem(l.Handle, iGroup, iItem) +func (l *ListView) RefreshItem(iGroup int, iItem int) *ListView { + xc.XListView_RefreshItem(l.Handle, iGroup, iItem) + return l } // 列表视_展开组, 成功返回TRUE否则返回FALSE, 如果状态没有改变返回FALSE. @@ -612,8 +630,9 @@ func (l *ListView) Group_DeleteItem(iGroup int) bool { // 列表视_组删除全部子项. // // iGroup: 组索引. -func (l *ListView) Group_DeleteAllChildItem(iGroup int) int { - return xc.XListView_Group_DeleteAllChildItem(l.Handle, iGroup) +func (l *ListView) Group_DeleteAllChildItem(iGroup int) *ListView { + xc.XListView_Group_DeleteAllChildItem(l.Handle, iGroup) + return l } // 列表视_项删除. @@ -626,32 +645,37 @@ func (l *ListView) Item_DeleteItem(iGroup int, iItem int) bool { } // 列表视_删除全部. -func (l *ListView) DeleteAll() int { - return xc.XListView_DeleteAll(l.Handle) +func (l *ListView) DeleteAll() *ListView { + xc.XListView_DeleteAll(l.Handle) + return l } // 列表视_删除全部组. -func (l *ListView) DeleteAllGroup() int { - return xc.XListView_DeleteAllGroup(l.Handle) +func (l *ListView) DeleteAllGroup() *ListView { + xc.XListView_DeleteAllGroup(l.Handle) + return l } // 列表视_删除全部项. -func (l *ListView) DeleteAllItem() int { - return xc.XListView_DeleteAllItem(l.Handle) +func (l *ListView) DeleteAllItem() *ListView { + xc.XListView_DeleteAllItem(l.Handle) + return l } // 列表视_组删除列. // // iColumn: 列索引. -func (l *ListView) DeleteColumnGroup(iColumn int) int { - return xc.XListView_DeleteColumnGroup(l.Handle, iColumn) +func (l *ListView) DeleteColumnGroup(iColumn int) *ListView { + xc.XListView_DeleteColumnGroup(l.Handle, iColumn) + return l } // 列表视_项删除列. // // iColumn: 列索引. -func (l *ListView) DeleteColumnItem(iColumn int) int { - return xc.XListView_DeleteColumnItem(l.Handle, iColumn) +func (l *ListView) DeleteColumnItem(iColumn int) *ListView { + xc.XListView_DeleteColumnItem(l.Handle, iColumn) + return l } // 列表视_项获取文本. @@ -736,11 +760,12 @@ func (l *ListView) Item_GetImage(iGroup int, iItem int, iColumn int) int { // 列表视_置拖动矩形颜色. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // width: 线宽度. -func (l *ListView) SetDragRectColor(color int, width int) int { - return xc.XListView_SetDragRectColor(l.Handle, color, width) +func (l *ListView) SetDragRectColor(color int, width int) *ListView { + xc.XListView_SetDragRectColor(l.Handle, color, width) + return l } // 列表视_置项模板从内存. diff --git a/widget/menu.go b/widget/menu.go index 39a357d..ef2485f 100644 --- a/widget/menu.go +++ b/widget/menu.go @@ -67,8 +67,9 @@ func NewMenuByUIDName(name string) *Menu { // nParentID: 父项ID. // // nFlags: 标识, Menu_Item_Flag_. -func (m *Menu) AddItem(nID int32, pText string, nParentID int32, nFlags xcc.Menu_Item_Flag_) { +func (m *Menu) AddItem(nID int32, pText string, nParentID int32, nFlags xcc.Menu_Item_Flag_) *Menu { xc.XMenu_AddItem(m.Handle, nID, pText, nParentID, nFlags) + return m } // 菜单_添加项图标. @@ -82,8 +83,9 @@ func (m *Menu) AddItem(nID int32, pText string, nParentID int32, nFlags xcc.Menu // hIcon: 菜单项图标句柄. // // nFlags: 标识, Menu_Item_Flag_. -func (m *Menu) AddItemIcon(nID int32, pText string, nParentID int32, hIcon int, nFlags xcc.Menu_Item_Flag_) { +func (m *Menu) AddItemIcon(nID int32, pText string, nParentID int32, hIcon int, nFlags xcc.Menu_Item_Flag_) *Menu { xc.XMenu_AddItemIcon(m.Handle, nID, pText, nParentID, hIcon, nFlags) + return m } // 菜单_插入项. @@ -95,8 +97,9 @@ func (m *Menu) AddItemIcon(nID int32, pText string, nParentID int32, hIcon int, // nFlags: 标识, Menu_Item_Flag_. // // insertID: 插入位置ID. -func (m *Menu) InsertItem(nID int32, pText string, nFlags xcc.Menu_Item_Flag_, insertID int32) { +func (m *Menu) InsertItem(nID int32, pText string, nFlags xcc.Menu_Item_Flag_, insertID int32) *Menu { xc.XMenu_InsertItem(m.Handle, nID, pText, nFlags, insertID) + return m } // 菜单_插入项图标. @@ -110,8 +113,9 @@ func (m *Menu) InsertItem(nID int32, pText string, nFlags xcc.Menu_Item_Flag_, i // nFlags: 标识, Menu_Item_Flag_. // // insertID: 插入位置ID. -func (m *Menu) InsertItemIcon(nID int32, pText string, hIcon int, nFlags xcc.Menu_Item_Flag_, insertID int32) { +func (m *Menu) InsertItemIcon(nID int32, pText string, hIcon int, nFlags xcc.Menu_Item_Flag_, insertID int32) *Menu { xc.XMenu_InsertItemIcon(m.Handle, nID, pText, hIcon, nFlags, insertID) + return m } // 菜单_取第一个子项, 返回项ID. @@ -152,22 +156,25 @@ func (m *Menu) GetParentItem(nID int32) int32 { // 菜单_置自动销毁, 设置是否自动销毁菜单. // // bAuto: 是否自动销毁. -func (m *Menu) SetAutoDestroy(bAuto bool) { +func (m *Menu) SetAutoDestroy(bAuto bool) *Menu { xc.XMenu_SetAutoDestroy(m.Handle, bAuto) + return m } // 菜单_启用用户绘制背景, 是否有用户绘制菜单背景, 如果启用XWM_MENU_DRAW_BACKGROUND和XE_MENU_DRAW_BACKGROUND事件有效. // // bEnable: 是否启用. -func (m *Menu) EnableDrawBackground(bEnable bool) { +func (m *Menu) EnableDrawBackground(bEnable bool) *Menu { xc.XMenu_EnableDrawBackground(m.Handle, bEnable) + return m } // 菜单_启用用户绘制项, 是否有用户绘制菜单项, 如果启用XWM_MENU_DRAWITEM和XE_MENU_DRAWITEM事件有效. // // bEnable: 是否启用. -func (m *Menu) EnableDrawItem(bEnable bool) { +func (m *Menu) EnableDrawItem(bEnable bool) *Menu { xc.XMenu_EnableDrawItem(m.Handle, bEnable) + return m } // 菜单_弹出. @@ -186,20 +193,23 @@ func (m *Menu) Popup(hParentWnd uintptr, x, y int32, hParentEle int, nPosition x } // 菜单_销毁. -func (m *Menu) DestroyMenu() { +func (m *Menu) DestroyMenu() *Menu { xc.XMenu_DestroyMenu(m.Handle) + return m } // 菜单_关闭. -func (m *Menu) CloseMenu() { +func (m *Menu) CloseMenu() *Menu { xc.XMenu_CloseMenu(m.Handle) + return m } // 菜单_置背景图片. // // hImage: 图片句柄. -func (m *Menu) SetBkImage(hImage int) { +func (m *Menu) SetBkImage(hImage int) *Menu { xc.XMenu_SetBkImage(m.Handle, hImage) + return m } // 菜单_置项文本. @@ -246,8 +256,9 @@ func (m *Menu) SetItemFlags(nID int32, uFlags xcc.Menu_Item_Flag_) bool { // 菜单_置项高度. // // height: 高度. -func (m *Menu) SetItemHeight(height int32) { +func (m *Menu) SetItemHeight(height int32) *Menu { xc.XMenu_SetItemHeight(m.Handle, height) + return m } // 菜单_取项高度. @@ -257,9 +268,10 @@ func (m *Menu) GetItemHeight() int32 { // 菜单_置边框颜色, 设置菜单边框颜色. // -// crColor: ABGR 颜色. -func (m *Menu) SetBorderColor(crColor int) { +// crColor: ARGB 颜色. +func (m *Menu) SetBorderColor(crColor int) *Menu { xc.XMenu_SetBorderColor(m.Handle, crColor) + return m } // 菜单_置边框大小, 设置弹出菜单窗口边框大小. @@ -271,8 +283,9 @@ func (m *Menu) SetBorderColor(crColor int) { // nRight: 边大小. // // nBottom: 边大小. -func (m *Menu) SetBorderSize(nLeft, nTop, nRight, nBottom int32) { +func (m *Menu) SetBorderSize(nLeft, nTop, nRight, nBottom int32) *Menu { xc.XMenu_SetBorderSize(m.Handle, nLeft, nTop, nRight, nBottom) + return m } // 菜单_取左侧宽度, 获取左侧区域宽度. diff --git a/widget/menubar.go b/widget/menubar.go index 54610ea..b06fb57 100644 --- a/widget/menubar.go +++ b/widget/menubar.go @@ -74,8 +74,9 @@ func (m *MenuBar) AddButton(pText string) int32 { // 菜单条_置按钮高度, 根据内容自动调整宽度. // // height: 高度. -func (m *MenuBar) SetButtonHeight(height int32) { +func (m *MenuBar) SetButtonHeight(height int32) *MenuBar { xc.XMenuBar_SetButtonHeight(m.Handle, height) + return m } // 菜单条_取菜单, 返回菜单句柄. diff --git a/widget/monthcal.go b/widget/monthcal.go index 0737030..0698218 100644 --- a/widget/monthcal.go +++ b/widget/monthcal.go @@ -5,7 +5,7 @@ import ( "github.com/twgh/xcgui/xcc" ) -// 月历卡片. +// MonthCal 月历卡片. type MonthCal struct { Element } @@ -81,39 +81,43 @@ func (m *MonthCal) GetButton(nType int) int { // nMonth: 月. // // nDay: 日. -func (m *MonthCal) SetToday(nYear int32, nMonth int32, nDay int32) int { - return xc.XMonthCal_SetToday(m.Handle, nYear, nMonth, nDay) +func (m *MonthCal) SetToday(nYear int32, nMonth int32, nDay int32) *MonthCal { + xc.XMonthCal_SetToday(m.Handle, nYear, nMonth, nDay) + return m } // 月历_取当前日期, 获取月历当前年月日. // -// pnYear: 年.[INT. +// pnYear: 年. // -// pnMonth: 月.[INT. +// pnMonth: 月. // -// pnDay: 日.[INT. -func (m *MonthCal) GetToday(pnYear *int32, pnMonth *int32, pnDay *int32) int { - return xc.XMonthCal_GetToday(m.Handle, pnYear, pnMonth, pnDay) +// pnDay: 日. +func (m *MonthCal) GetToday(pnYear *int32, pnMonth *int32, pnDay *int32) *MonthCal { + xc.XMonthCal_GetToday(m.Handle, pnYear, pnMonth, pnDay) + return m } // 月历_取选择日期, 获取月历选中的年月日. // -// pnYear: 年.[INT. +// pnYear: 年. // -// pnMonth: 月.[INT. +// pnMonth: 月. // -// pnDay: 日.[INT. -func (m *MonthCal) GetSelDate(pnYear *int32, pnMonth *int32, pnDay *int32) int { - return xc.XMonthCal_GetSelDate(m.Handle, pnYear, pnMonth, pnDay) +// pnDay: 日. +func (m *MonthCal) GetSelDate(pnYear *int32, pnMonth *int32, pnDay *int32) *MonthCal { + xc.XMonthCal_GetSelDate(m.Handle, pnYear, pnMonth, pnDay) + return m } // 月历_置文本颜色. // // nFlag: 1:周六, 周日文字颜色, 2:日期文字的颜色; 其它周文字颜色, 使用元素自身颜色. // -// color: ABGR 颜色值. -func (m *MonthCal) SetTextColor(nFlag int32, color int) int { - return xc.XMonthCal_SetTextColor(m.Handle, nFlag, color) +// color: ARGB 颜色值. +func (m *MonthCal) SetTextColor(nFlag int32, color int) *MonthCal { + xc.XMonthCal_SetTextColor(m.Handle, nFlag, color) + return m } /* diff --git a/widget/pane.go b/widget/pane.go index 9fd7798..5e95487 100644 --- a/widget/pane.go +++ b/widget/pane.go @@ -68,15 +68,17 @@ func NewPaneByUIDName(name string) *Pane { // 窗格_置视图, 设置窗格视图元素. // // hView: 绑定视图元素. -func (p *Pane) SetView(hView int) int { - return xc.XPane_SetView(p.Handle, hView) +func (p *Pane) SetView(hView int) *Pane { + xc.XPane_SetView(p.Handle, hView) + return p } // 窗格_置标题, 设置标题文本. // // pTitle: 文本内容. -func (p *Pane) SetTitle(pTitle string) int { - return xc.XPane_SetTitle(p.Handle, pTitle) +func (p *Pane) SetTitle(pTitle string) *Pane { + xc.XPane_SetTitle(p.Handle, pTitle) + return p } // 窗格_取标题, 获取标题文本. @@ -87,8 +89,9 @@ func (p *Pane) GetTitle() string { // 窗格_置标题栏高度, 设置标题栏高度. // // nHeight: 高度. -func (p *Pane) SetCaptionHeight(nHeight int) int { - return xc.XPane_SetCaptionHeight(p.Handle, nHeight) +func (p *Pane) SetCaptionHeight(nHeight int) *Pane { + xc.XPane_SetCaptionHeight(p.Handle, nHeight) + return p } // 窗格_取标题栏高度, 获取标题栏高度. @@ -106,8 +109,9 @@ func (p *Pane) IsShowPane() bool { // nWidth: 宽度. // // nHeight: 高度. -func (p *Pane) SetSize(nWidth int, nHeight int) int { - return xc.XPane_SetSize(p.Handle, nWidth, nHeight) +func (p *Pane) SetSize(nWidth int, nHeight int) *Pane { + xc.XPane_SetSize(p.Handle, nWidth, nHeight) + return p } // 窗格_取状态, 获取窗格停靠状态, 返回: Pane_State_. @@ -118,46 +122,51 @@ func (p *Pane) GetState() xcc.Pane_State_ { // 窗格_取视图坐标, 获取窗格视图坐标. // // pRect: 接收返回的坐标值. -func (p *Pane) GetViewRect(pRect *xc.RECT) int { - return xc.XPane_GetViewRect(p.Handle, pRect) +func (p *Pane) GetViewRect(pRect *xc.RECT) *Pane { + xc.XPane_GetViewRect(p.Handle, pRect) + return p } // HidePane 窗格_隐藏. // // @param bGroupActivate 当为窗格组成员时, 延迟处理窗格组成员激活的切换. -// @return int -func (p *Pane) HidePane(bGroupActivate bool) int { - return xc.XPane_HidePane(p.Handle, bGroupActivate) +func (p *Pane) HidePane(bGroupActivate bool) *Pane { + xc.XPane_HidePane(p.Handle, bGroupActivate) + return p } // ShowPane 窗格_显示. // // @param bGroupActivate 如果是窗格组成员, 那么窗格组切换当前窗格为显示状态. -// @return int -func (p *Pane) ShowPane(bGroupActivate bool) int { - return xc.XPane_ShowPane(p.Handle, bGroupActivate) +func (p *Pane) ShowPane(bGroupActivate bool) *Pane { + xc.XPane_ShowPane(p.Handle, bGroupActivate) + return p } // 窗格_停靠, 窗格停靠到码头. -func (p *Pane) DockPane() int { - return xc.XPane_DockPane(p.Handle) +func (p *Pane) DockPane() *Pane { + xc.XPane_DockPane(p.Handle) + return p } // 窗格_锁定, 锁定窗格. -func (p *Pane) LockPane() int { - return xc.XPane_LockPane(p.Handle) +func (p *Pane) LockPane() *Pane { + xc.XPane_LockPane(p.Handle) + return p } // 窗格_浮动. -func (p *Pane) FloatPane() int { - return xc.XPane_FloatPane(p.Handle) +func (p *Pane) FloatPane() *Pane { + xc.XPane_FloatPane(p.Handle) + return p } // 窗格_绘制, 手动调用该函数绘制窗格, 以便控制绘制顺序. // // hDraw: 图形绘制句柄. -func (p *Pane) DrawPane(hDraw int) int { - return xc.XPane_DrawPane(p.Handle, hDraw) +func (p *Pane) DrawPane(hDraw int) *Pane { + xc.XPane_DrawPane(p.Handle, hDraw) + return p } // 窗口_置选中, 如果窗格是组成员, 设置选中当前窗格可见. diff --git a/widget/progressbar.go b/widget/progressbar.go index 7a42921..73c4e67 100644 --- a/widget/progressbar.go +++ b/widget/progressbar.go @@ -70,8 +70,9 @@ func NewProgressBarByUIDName(name string) *ProgressBar { // 进度条_置范围, 设置范围. // // range_: 范围. -func (p *ProgressBar) SetRange(range_ int) int { - return xc.XProgBar_SetRange(p.Handle, range_) +func (p *ProgressBar) SetRange(range_ int) *ProgressBar { + xc.XProgBar_SetRange(p.Handle, range_) + return p } // 进度条_取范围. @@ -82,15 +83,17 @@ func (p *ProgressBar) GetRange() int { // 进度条_置进度图片. // // hImage: 图片句柄. -func (p *ProgressBar) SetImageLoad(hImage int) int { - return xc.XProgBar_SetImageLoad(p.Handle, hImage) +func (p *ProgressBar) SetImageLoad(hImage int) *ProgressBar { + xc.XProgBar_SetImageLoad(p.Handle, hImage) + return p } // 进度条_置进度, 设置位置点. // // pos: 位置点. -func (p *ProgressBar) SetPos(pos int) int { - return xc.XProgBar_SetPos(p.Handle, pos) +func (p *ProgressBar) SetPos(pos int) *ProgressBar { + xc.XProgBar_SetPos(p.Handle, pos) + return p } // 进度条_取进度, 获取当前位置点. @@ -101,8 +104,9 @@ func (p *ProgressBar) GetPos() int { // 进度条_置水平, 设置水平或垂直. // // bHorizon: 水平或垂直. -func (p *ProgressBar) EnableHorizon(bHorizon bool) int { - return xc.XProgBar_EnableHorizon(p.Handle, bHorizon) +func (p *ProgressBar) EnableHorizon(bHorizon bool) *ProgressBar { + xc.XProgBar_EnableHorizon(p.Handle, bHorizon) + return p } // 进度条_启用缩放, 缩放进度贴图为当前进度区域(当前进度所显示区域), 否则为整体100进度区域. @@ -121,7 +125,7 @@ func (p *ProgressBar) EnableShowText(bShow bool) bool { // 进度条_置进度颜色. 设置进度颜色. // -// color: ABGR 颜色. +// color: ARGB 颜色. func (p *ProgressBar) SetColorLoad(color int) bool { return xc.XProgBar_SetColorLoad(p.Handle, color) } diff --git a/widget/scrollbar.go b/widget/scrollbar.go index f101620..5f0d2e2 100644 --- a/widget/scrollbar.go +++ b/widget/scrollbar.go @@ -70,8 +70,9 @@ func NewScrollBarByUIDName(name string) *ScrollBar { // 滚动条_置范围, 设置滚动范围. // // range_: 范围. -func (s *ScrollBar) SetRange(range_ int) int { - return xc.XSBar_SetRange(s.Handle, range_) +func (s *ScrollBar) SetRange(range_ int) *ScrollBar { + xc.XSBar_SetRange(s.Handle, range_) + return s } // 滚动条_取范围, 获取滚动范围. @@ -82,29 +83,33 @@ func (s *ScrollBar) GetRange() int { // 滚动条_显示上下按钮, 显示隐藏滚动条上下按钮. // // bShow: 是否显示. -func (s *ScrollBar) ShowButton(bShow bool) int { - return xc.XSBar_ShowButton(s.Handle, bShow) +func (s *ScrollBar) ShowButton(bShow bool) *ScrollBar { + xc.XSBar_ShowButton(s.Handle, bShow) + return s } // 滚动条_置滑块长度. // // length: 长度. -func (s *ScrollBar) SetSliderLength(length int) int { - return xc.XSBar_SetSliderLength(s.Handle, length) +func (s *ScrollBar) SetSliderLength(length int) *ScrollBar { + xc.XSBar_SetSliderLength(s.Handle, length) + return s } // 滚动条_置滑块最小长度. // // minLength: 长度. -func (s *ScrollBar) SetSliderMinLength(minLength int) int { - return xc.XSBar_SetSliderMinLength(s.Handle, minLength) +func (s *ScrollBar) SetSliderMinLength(minLength int) *ScrollBar { + xc.XSBar_SetSliderMinLength(s.Handle, minLength) + return s } // 滚动条_置滑块两边间隔, 设置滑块两边的间隔大小. // // nPadding: 间隔大小. -func (s *ScrollBar) SetSliderPadding(nPadding int) int { - return xc.XSBar_SetSliderPadding(s.Handle, nPadding) +func (s *ScrollBar) SetSliderPadding(nPadding int) *ScrollBar { + xc.XSBar_SetSliderPadding(s.Handle, nPadding) + return s } // 滚动条_置水平, 设置水平或者垂直. diff --git a/widget/scrollview.go b/widget/scrollview.go index 8cb1619..74f0501 100644 --- a/widget/scrollview.go +++ b/widget/scrollview.go @@ -79,8 +79,9 @@ func (s *ScrollView) SetTotalSize(cx int, cy int) bool { // 滚动视_取视图大小, 获取内容总大小. // // pSize: 大小. -func (s *ScrollView) GetTotalSize(pSize *xc.SIZE) int { - return xc.XSView_GetTotalSize(s.Handle, pSize) +func (s *ScrollView) GetTotalSize(pSize *xc.SIZE) *ScrollView { + xc.XSView_GetTotalSize(s.Handle, pSize) + return s } // 滚动视_置滚动单位大小, 设置滚动单位大小, 如果内容改变返回TRUE否则返回FALSE. @@ -95,15 +96,17 @@ func (s *ScrollView) SetLineSize(nWidth int, nHeight int) bool { // 滚动视_取滚动单位大小, 获取滚动单位大小. // // pSize: 返回大小. -func (s *ScrollView) GetLineSize(pSize *xc.SIZE) int { - return xc.XSView_GetLineSize(s.Handle, pSize) +func (s *ScrollView) GetLineSize(pSize *xc.SIZE) *ScrollView { + xc.XSView_GetLineSize(s.Handle, pSize) + return s } // 滚动视_置滚动条大小. // // size: 滚动条大小. -func (s *ScrollView) SetScrollBarSize(size int) int { - return xc.XSView_SetScrollBarSize(s.Handle, size) +func (s *ScrollView) SetScrollBarSize(size int) *ScrollView { + xc.XSView_SetScrollBarSize(s.Handle, size) + return s } // 滚动视_取视口原点X, 获取视口原点X坐标. @@ -129,8 +132,9 @@ func (s *ScrollView) GetViewHeight() int { // 滚动视_取视口坐标. // // pRect: 坐标. -func (s *ScrollView) GetViewRect(pRect *xc.RECT) int { - return xc.XSView_GetViewRect(s.Handle, pRect) +func (s *ScrollView) GetViewRect(pRect *xc.RECT) *ScrollView { + xc.XSView_GetViewRect(s.Handle, pRect) + return s } // 滚动视_取水平滚动条, 返回滚动条句柄. @@ -174,22 +178,25 @@ func (s *ScrollView) ScrollPosYV(posY int) bool { // 滚动视_显示水平滚动条. // // bShow: 是否显示. -func (s *ScrollView) ShowSBarH(bShow bool) int { - return xc.XSView_ShowSBarH(s.Handle, bShow) +func (s *ScrollView) ShowSBarH(bShow bool) *ScrollView { + xc.XSView_ShowSBarH(s.Handle, bShow) + return s } // 滚动视_显示垂直滚动条. // // bShow: 是否显示. -func (s *ScrollView) ShowSBarV(bShow bool) int { - return xc.XSView_ShowSBarV(s.Handle, bShow) +func (s *ScrollView) ShowSBarV(bShow bool) *ScrollView { + xc.XSView_ShowSBarV(s.Handle, bShow) + return s } // 滚动视_启用自动显示滚动条. // // bEnable: 是否启用. -func (s *ScrollView) EnableAutoShowScrollBar(bEnable bool) int { - return xc.XSView_EnableAutoShowScrollBar(s.Handle, bEnable) +func (s *ScrollView) EnableAutoShowScrollBar(bEnable bool) *ScrollView { + xc.XSView_EnableAutoShowScrollBar(s.Handle, bEnable) + return s } // 滚动视_向左滚动. diff --git a/widget/shape.go b/widget/shape.go index cc317a3..7eab1dc 100644 --- a/widget/shape.go +++ b/widget/shape.go @@ -51,8 +51,9 @@ func NewShapeByUIDName(name string) *Shape { } // 形状_移除, 从父UI元素或窗口,和父布局对象中移除. -func (s *Shape) RemoveShape() int { - return xc.XShape_RemoveShape(s.Handle) +func (s *Shape) RemoveShape() *Shape { + xc.XShape_RemoveShape(s.Handle) + return s } // 形状_取Z序, 获取形状对象Z序, 成功返回索引值, 否则返回 XC_ID_ERROR. @@ -61,8 +62,9 @@ func (s *Shape) GetZOrder() int { } // 形状_重绘, 重绘形状对象. -func (s *Shape) Redraw() int { - return xc.XShape_Redraw(s.Handle) +func (s *Shape) Redraw() *Shape { + xc.XShape_Redraw(s.Handle) + return s } // 形状_取宽度, 获取内容宽度. @@ -80,22 +82,25 @@ func (s *Shape) GetHeight() int32 { // x: x坐标. // // y: y坐标. -func (s *Shape) SetPosition(x, y int32) int { - return xc.XShape_SetPosition(s.Handle, x, y) +func (s *Shape) SetPosition(x, y int32) *Shape { + xc.XShape_SetPosition(s.Handle, x, y) + return s } // 形状_取坐标. // // pRect: 接收返回坐标. -func (s *Shape) GetRect(pRect *xc.RECT) int { - return xc.XShape_GetRect(s.Handle, pRect) +func (s *Shape) GetRect(pRect *xc.RECT) *Shape { + xc.XShape_GetRect(s.Handle, pRect) + return s } // 形状_置坐标. // // pRect: 坐标. -func (s *Shape) SetRect(pRect *xc.RECT) int { - return xc.XShape_SetRect(s.Handle, pRect) +func (s *Shape) SetRect(pRect *xc.RECT) *Shape { + xc.XShape_SetRect(s.Handle, pRect) + return s } // 形状_置逻辑坐标, 设置元素坐标, 逻辑坐标, 包含滚动视图偏移. @@ -110,39 +115,45 @@ func (s *Shape) SetRectLogic(pRect *xc.RECT, bRedraw bool) bool { // 形状_取逻辑坐标, 获取元素坐标, 逻辑坐标, 包含滚动视图偏移. // // pRect: 坐标. -func (s *Shape) GetRectLogic(pRect *xc.RECT) int { - return xc.XShape_GetRectLogic(s.Handle, pRect) +func (s *Shape) GetRectLogic(pRect *xc.RECT) *Shape { + xc.XShape_GetRectLogic(s.Handle, pRect) + return s } // 形状_取基于窗口客户区坐标, 基于窗口客户区坐标. // // pRect: 坐标. -func (s *Shape) GetWndClientRect(pRect *xc.RECT) int { - return xc.XShape_GetWndClientRect(s.Handle, pRect) +func (s *Shape) GetWndClientRect(pRect *xc.RECT) *Shape { + xc.XShape_GetWndClientRect(s.Handle, pRect) + return s } // 形状_取内容大小 ,仅计算有效内容, 填充父, 权重依赖父级所以无法计算. // // pSize: 接收返回内容大小值. -func (s *Shape) GetContentSize(pSize *xc.SIZE) int { - return xc.XShape_GetContentSize(s.Handle, pSize) +func (s *Shape) GetContentSize(pSize *xc.SIZE) *Shape { + xc.XShape_GetContentSize(s.Handle, pSize) + return s } // 形状_显示布局边界, 是否显示布局边界. // // bShow: 是否显示. -func (s *Shape) ShowLayout(bShow bool) int { - return xc.XShape_ShowLayout(s.Handle, bShow) +func (s *Shape) ShowLayout(bShow bool) *Shape { + xc.XShape_ShowLayout(s.Handle, bShow) + return s } // 形状_调整布局. -func (s *Shape) AdjustLayout() int { - return xc.XShape_AdjustLayout(s.Handle) +func (s *Shape) AdjustLayout() *Shape { + xc.XShape_AdjustLayout(s.Handle) + return s } // 形状_销毁, 销毁形状对象. -func (s *Shape) Destroy() int { - return xc.XShape_Destroy(s.Handle) +func (s *Shape) Destroy() *Shape { + xc.XShape_Destroy(s.Handle) + return s } // 形状_取位置. @@ -150,8 +161,9 @@ func (s *Shape) Destroy() int { // pOutX: 返回X坐标. // // pOutY: 返回Y坐标. -func (s *Shape) GetPosition(pOutX, pOutY *int32) int { - return xc.XShape_GetPosition(s.Handle, pOutX, pOutY) +func (s *Shape) GetPosition(pOutX, pOutY *int32) *Shape { + xc.XShape_GetPosition(s.Handle, pOutX, pOutY) + return s } // 形状_置大小. @@ -159,8 +171,9 @@ func (s *Shape) GetPosition(pOutX, pOutY *int32) int { // nWidth: 宽度. // // nHeight: 高度. -func (s *Shape) SetSize(nWidth, nHeight int32) int { - return xc.XShape_SetSize(s.Handle, nWidth, nHeight) +func (s *Shape) SetSize(nWidth, nHeight int32) *Shape { + xc.XShape_SetSize(s.Handle, nWidth, nHeight) + return s } // 形状_取大小. @@ -168,15 +181,17 @@ func (s *Shape) SetSize(nWidth, nHeight int32) int { // pOutWidth: 返回宽度. // // pOutHeight: 返回高度. -func (s *Shape) GetSize(pOutWidth, pOutHeight *int32) int { - return xc.XShape_GetSize(s.Handle, pOutWidth, pOutHeight) +func (s *Shape) GetSize(pOutWidth, pOutHeight *int32) *Shape { + xc.XShape_GetSize(s.Handle, pOutWidth, pOutHeight) + return s } // 形状_置透明度. // // alpha: 透明度. -func (s *Shape) SetAlpha(alpha uint8) int { - return xc.XShape_SetAlpha(s.Handle, alpha) +func (s *Shape) SetAlpha(alpha uint8) *Shape { + xc.XShape_SetAlpha(s.Handle, alpha) + return s } // 形状_取透明度, 返回透明度. diff --git a/widget/shapeellipse.go b/widget/shapeellipse.go index e023270..6e0736d 100644 --- a/widget/shapeellipse.go +++ b/widget/shapeellipse.go @@ -68,28 +68,32 @@ func NewShapeEllipseByUIDName(name string) *ShapeEllipse { // 形状圆_置边框色. // -// color: ABGR 颜色值. -func (s *ShapeEllipse) SetBorderColor(color int) int { - return xc.XShapeEllipse_SetBorderColor(s.Handle, color) +// color: ARGB 颜色值. +func (s *ShapeEllipse) SetBorderColor(color int) *ShapeEllipse { + xc.XShapeEllipse_SetBorderColor(s.Handle, color) + return s } // 形状圆_置填充色. // -// color: ABGR 颜色值. -func (s *ShapeEllipse) SetFillColor(color int) int { - return xc.XShapeEllipse_SetFillColor(s.Handle, color) +// color: ARGB 颜色值. +func (s *ShapeEllipse) SetFillColor(color int) *ShapeEllipse { + xc.XShapeEllipse_SetFillColor(s.Handle, color) + return s } // 形状圆_启用边框, 启用绘制圆边框. // // bEnable: 是否启用. -func (s *ShapeEllipse) EnableBorder(bEnable bool) int { - return xc.XShapeEllipse_EnableBorder(s.Handle, bEnable) +func (s *ShapeEllipse) EnableBorder(bEnable bool) *ShapeEllipse { + xc.XShapeEllipse_EnableBorder(s.Handle, bEnable) + return s } // 形状圆_启用填充, 启用填充圆. // // bEnable: 是否启用. -func (s *ShapeEllipse) EnableFill(bEnable bool) int { - return xc.XShapeEllipse_EnableFill(s.Handle, bEnable) +func (s *ShapeEllipse) EnableFill(bEnable bool) *ShapeEllipse { + xc.XShapeEllipse_EnableFill(s.Handle, bEnable) + return s } diff --git a/widget/shapegif.go b/widget/shapegif.go index e37e482..0762418 100644 --- a/widget/shapegif.go +++ b/widget/shapegif.go @@ -69,8 +69,9 @@ func NewShapeGifByUIDName(name string) *ShapeGif { // 形状GIF_置图片, 设置GIF图片. // // hImage: 图片句柄. -func (s *ShapeGif) SetImage(hImage int) int { - return xc.XShapeGif_SetImage(s.Handle, hImage) +func (s *ShapeGif) SetImage(hImage int) *ShapeGif { + xc.XShapeGif_SetImage(s.Handle, hImage) + return s } // 形状GIF_取图片, 获取图片句柄. diff --git a/widget/shapegroupbox.go b/widget/shapegroupbox.go index d9ed5a4..8118e4c 100644 --- a/widget/shapegroupbox.go +++ b/widget/shapegroupbox.go @@ -70,23 +70,26 @@ func NewShapeGroupBoxByUIDName(name string) *ShapeGroupBox { // 形状组框_置边框颜色. // -// color: ABGR 颜色值. -func (s *ShapeGroupBox) SetBorderColor(color int) int { - return xc.XShapeGroupBox_SetBorderColor(s.Handle, color) +// color: ARGB 颜色值. +func (s *ShapeGroupBox) SetBorderColor(color int) *ShapeGroupBox { + xc.XShapeGroupBox_SetBorderColor(s.Handle, color) + return s } // 形状组框_置文本颜色. // -// color: ABGR 颜色值. -func (s *ShapeGroupBox) SetTextColor(color int) int { - return xc.XShapeGroupBox_SetTextColor(s.Handle, color) +// color: ARGB 颜色值. +func (s *ShapeGroupBox) SetTextColor(color int) *ShapeGroupBox { + xc.XShapeGroupBox_SetTextColor(s.Handle, color) + return s } // 形状组框_置字体. // // hFontX: 炫彩字体. -func (s *ShapeGroupBox) SetFontX(hFontX int) int { - return xc.XShapeGroupBox_SetFontX(s.Handle, hFontX) +func (s *ShapeGroupBox) SetFontX(hFontX int) *ShapeGroupBox { + xc.XShapeGroupBox_SetFontX(s.Handle, hFontX) + return s } // 形状组框_置文本偏移, 设置文本偏移量. @@ -94,8 +97,9 @@ func (s *ShapeGroupBox) SetFontX(hFontX int) int { // offsetX: 水平偏移. // // offsetY: 垂直偏移. -func (s *ShapeGroupBox) SetTextOffset(offsetX int32, offsetY int32) int { - return xc.XShapeGroupBox_SetTextOffset(s.Handle, offsetX, offsetY) +func (s *ShapeGroupBox) SetTextOffset(offsetX int32, offsetY int32) *ShapeGroupBox { + xc.XShapeGroupBox_SetTextOffset(s.Handle, offsetX, offsetY) + return s } // 形状组框_置圆角大小. @@ -103,15 +107,17 @@ func (s *ShapeGroupBox) SetTextOffset(offsetX int32, offsetY int32) int { // nWidth: 圆角宽度. // // nHeight: 圆角高度. -func (s *ShapeGroupBox) SetRoundAngle(nWidth int32, nHeight int32) int { - return xc.XShapeGroupBox_SetRoundAngle(s.Handle, nWidth, nHeight) +func (s *ShapeGroupBox) SetRoundAngle(nWidth int32, nHeight int32) *ShapeGroupBox { + xc.XShapeGroupBox_SetRoundAngle(s.Handle, nWidth, nHeight) + return s } // 形状组框_置文本. // // pText: 文本内容. -func (s *ShapeGroupBox) SetText(pText string) int { - return xc.XShapeGroupBox_SetText(s.Handle, pText) +func (s *ShapeGroupBox) SetText(pText string) *ShapeGroupBox { + xc.XShapeGroupBox_SetText(s.Handle, pText) + return s } // 形状组框_取文本偏移, 获取文本偏移量. @@ -119,8 +125,9 @@ func (s *ShapeGroupBox) SetText(pText string) int { // pOffsetX: X坐标偏移量. // // pOffsetY: Y坐标偏移量. -func (s *ShapeGroupBox) GetTextOffset(pOffsetX *int32, pOffsetY *int32) int { - return xc.XShapeGroupBox_GetTextOffset(s.Handle, pOffsetX, pOffsetY) +func (s *ShapeGroupBox) GetTextOffset(pOffsetX *int32, pOffsetY *int32) *ShapeGroupBox { + xc.XShapeGroupBox_GetTextOffset(s.Handle, pOffsetX, pOffsetY) + return s } // 形状组框_取圆角大小. @@ -128,13 +135,15 @@ func (s *ShapeGroupBox) GetTextOffset(pOffsetX *int32, pOffsetY *int32) int { // pWidth: 返回圆角宽度. // // pHeight: 返回圆角高度. -func (s *ShapeGroupBox) GetRoundAngle(pWidth *int32, pHeight *int32) int { - return xc.XShapeGroupBox_GetRoundAngle(s.Handle, pWidth, pHeight) +func (s *ShapeGroupBox) GetRoundAngle(pWidth *int32, pHeight *int32) *ShapeGroupBox { + xc.XShapeGroupBox_GetRoundAngle(s.Handle, pWidth, pHeight) + return s } // 形状组框_启用圆角. // // bEnable: 是否启用. -func (s *ShapeGroupBox) EnableRoundAngle(bEnable bool) int { - return xc.XShapeGroupBox_EnableRoundAngle(s.Handle, bEnable) +func (s *ShapeGroupBox) EnableRoundAngle(bEnable bool) *ShapeGroupBox { + xc.XShapeGroupBox_EnableRoundAngle(s.Handle, bEnable) + return s } diff --git a/widget/shapeline.go b/widget/shapeline.go index 4777475..0bc3658 100644 --- a/widget/shapeline.go +++ b/widget/shapeline.go @@ -75,13 +75,15 @@ func NewShapeLineByUIDName(name string) *ShapeLine { // x2: 坐标. // // y2: 坐标. -func (s *ShapeLine) SetPosition(x1 int, y1 int, x2 int, y2 int) int { - return xc.XShapeLine_SetPosition(s.Handle, x1, y1, x2, y2) +func (s *ShapeLine) SetPosition(x1 int, y1 int, x2 int, y2 int) *ShapeLine { + xc.XShapeLine_SetPosition(s.Handle, x1, y1, x2, y2) + return s } // 形状线_置颜色, 设置直线颜色. // -// color: ABGR 颜色值. -func (s *ShapeLine) SetColor(color int) int { - return xc.XShapeLine_SetColor(s.Handle, color) +// color: ARGB 颜色值. +func (s *ShapeLine) SetColor(color int) *ShapeLine { + xc.XShapeLine_SetColor(s.Handle, color) + return s } diff --git a/widget/shapepicture.go b/widget/shapepicture.go index 0ff736d..f34adc7 100644 --- a/widget/shapepicture.go +++ b/widget/shapepicture.go @@ -69,8 +69,9 @@ func NewShapePictureByUIDName(name string) *ShapePicture { // 形状图片_置图片, 设置图片. // // hImage: 图片句柄. -func (s *ShapePicture) SetImage(hImage int) int { - return xc.XShapePic_SetImage(s.Handle, hImage) +func (s *ShapePicture) SetImage(hImage int) *ShapePicture { + xc.XShapePic_SetImage(s.Handle, hImage) + return s } // 形状图片_取图片, 获取图片句柄. diff --git a/widget/shaperect.go b/widget/shaperect.go index c7ffbc9..8945fc5 100644 --- a/widget/shaperect.go +++ b/widget/shaperect.go @@ -68,16 +68,18 @@ func NewShapeRectByUIDName(name string) *ShapeRect { // 形状矩形_置边框色, 设置边框颜色. // -// color: ABGR 颜色值. -func (s *ShapeRect) SetBorderColor(color int) int { - return xc.XShapeRect_SetBorderColor(s.Handle, color) +// color: ARGB 颜色值. +func (s *ShapeRect) SetBorderColor(color int) *ShapeRect { + xc.XShapeRect_SetBorderColor(s.Handle, color) + return s } // 形状矩形_置填充色, 设置填充颜色. // -// color: ABGR 颜色值. -func (s *ShapeRect) SetFillColor(color int) int { - return xc.XShapeRect_SetFillColor(s.Handle, color) +// color: ARGB 颜色值. +func (s *ShapeRect) SetFillColor(color int) *ShapeRect { + xc.XShapeRect_SetFillColor(s.Handle, color) + return s } // 形状矩形_置圆角大小, 设置圆角大小. @@ -85,8 +87,9 @@ func (s *ShapeRect) SetFillColor(color int) int { // nWidth: 圆角宽度. // // nHeight: 圆角高度. -func (s *ShapeRect) SetRoundAngle(nWidth int, nHeight int32) int { - return xc.XShapeRect_SetRoundAngle(s.Handle, nWidth, nHeight) +func (s *ShapeRect) SetRoundAngle(nWidth int, nHeight int32) *ShapeRect { + xc.XShapeRect_SetRoundAngle(s.Handle, nWidth, nHeight) + return s } // 形状矩形_取圆角大小, 获取圆角大小. @@ -94,27 +97,31 @@ func (s *ShapeRect) SetRoundAngle(nWidth int, nHeight int32) int { // pWidth: 圆角宽度. // // pHeight: 圆角高度. -func (s *ShapeRect) GetRoundAngle(pWidth *int, pHeight *int32) int { - return xc.XShapeRect_GetRoundAngle(s.Handle, pWidth, pHeight) +func (s *ShapeRect) GetRoundAngle(pWidth *int, pHeight *int32) *ShapeRect { + xc.XShapeRect_GetRoundAngle(s.Handle, pWidth, pHeight) + return s } // 形状矩形_启用边框, 启用绘制矩形边框. // // bEnable: 是否启用. -func (s *ShapeRect) EnableBorder(bEnable bool) int { - return xc.XShapeRect_EnableBorder(s.Handle, bEnable) +func (s *ShapeRect) EnableBorder(bEnable bool) *ShapeRect { + xc.XShapeRect_EnableBorder(s.Handle, bEnable) + return s } // 形状矩形_启用填充, 启用填充矩形. // // bEnable: 是否启用. -func (s *ShapeRect) EnableFill(bEnable bool) int { - return xc.XShapeRect_EnableFill(s.Handle, bEnable) +func (s *ShapeRect) EnableFill(bEnable bool) *ShapeRect { + xc.XShapeRect_EnableFill(s.Handle, bEnable) + return s } // 形状矩形_启用圆角. // // bEnable: 是否启用. -func (s *ShapeRect) EnableRoundAngle(bEnable bool) int { - return xc.XShapeRect_EnableRoundAngle(s.Handle, bEnable) +func (s *ShapeRect) EnableRoundAngle(bEnable bool) *ShapeRect { + xc.XShapeRect_EnableRoundAngle(s.Handle, bEnable) + return s } diff --git a/widget/shapetext.go b/widget/shapetext.go index 93e29c9..b2fccf3 100644 --- a/widget/shapetext.go +++ b/widget/shapetext.go @@ -72,8 +72,9 @@ func NewShapeTextByUIDName(name string) *ShapeText { // 形状文本_置文本, 设置文本内容. // // pName: 文本内容. -func (s *ShapeText) SetText(pName string) int { - return xc.XShapeText_SetText(s.Handle, pName) +func (s *ShapeText) SetText(pName string) *ShapeText { + xc.XShapeText_SetText(s.Handle, pName) + return s } // 形状文本_取文本, 获取文本内容. @@ -89,8 +90,9 @@ func (s *ShapeText) GetTextLength() int { // 形状文本_置字体. // // hFontx: 字体句柄. -func (s *ShapeText) SetFont(hFontx int) int { - return xc.XShapeText_SetFont(s.Handle, hFontx) +func (s *ShapeText) SetFont(hFontx int) *ShapeText { + xc.XShapeText_SetFont(s.Handle, hFontx) + return s } // 形状文本_取字体, 返回字体句柄. @@ -100,9 +102,10 @@ func (s *ShapeText) GetFont() int { // 形状文本_置文本颜色, 设置文本颜色. // -// color: ABGR 颜色值. -func (s *ShapeText) SetTextColor(color int) int { - return xc.XShapeText_SetTextColor(s.Handle, color) +// color: ARGB 颜色值. +func (s *ShapeText) SetTextColor(color int) *ShapeText { + xc.XShapeText_SetTextColor(s.Handle, color) + return s } // 形状文本_取文本颜色. @@ -113,8 +116,9 @@ func (s *ShapeText) GetTextColor() int { // 形状文本_置文本对齐. // // align: 文本对齐方式, TextFormatFlag_, TextAlignFlag_, TextTrimming_. -func (s *ShapeText) SetTextAlign(align xcc.TextFormatFlag_) int { - return xc.XShapeText_SetTextAlign(s.Handle, align) +func (s *ShapeText) SetTextAlign(align xcc.TextFormatFlag_) *ShapeText { + xc.XShapeText_SetTextAlign(s.Handle, align) + return s } // 形状文本_置偏移, 设置内容偏移. @@ -122,6 +126,7 @@ func (s *ShapeText) SetTextAlign(align xcc.TextFormatFlag_) int { // x: X坐标. // // y: Y坐标. -func (s *ShapeText) SetOffset(x int, y int) int { - return xc.XShapeText_SetOffset(s.Handle, x, y) +func (s *ShapeText) SetOffset(x int, y int) *ShapeText { + xc.XShapeText_SetOffset(s.Handle, x, y) + return s } diff --git a/widget/sliderbar.go b/widget/sliderbar.go index 7b54f89..4ec3723 100644 --- a/widget/sliderbar.go +++ b/widget/sliderbar.go @@ -70,8 +70,9 @@ func NewSliderBarByUIDName(name string) *SliderBar { // 滑动条_置范围, 设置滑动范围. // // range_: 范围. -func (s *SliderBar) SetRange(range_ int) int { - return xc.XSliderBar_SetRange(s.Handle, range_) +func (s *SliderBar) SetRange(range_ int) *SliderBar { + xc.XSliderBar_SetRange(s.Handle, range_) + return s } // 滑动条_取范围, 获取滚动范围. @@ -82,29 +83,33 @@ func (s *SliderBar) GetRange() int { // 滑动条_置进度图片, 设置进度贴图. // // hImage: 图片句柄. -func (s *SliderBar) SetImageLoad(hImage int) int { - return xc.XSliderBar_SetImageLoad(s.Handle, hImage) +func (s *SliderBar) SetImageLoad(hImage int) *SliderBar { + xc.XSliderBar_SetImageLoad(s.Handle, hImage) + return s } // 滑动条_置滑块宽度, 设置滑块按钮宽度. // // width: 宽度. -func (s *SliderBar) SetButtonWidth(width int) int { - return xc.XSliderBar_SetButtonWidth(s.Handle, width) +func (s *SliderBar) SetButtonWidth(width int) *SliderBar { + xc.XSliderBar_SetButtonWidth(s.Handle, width) + return s } // 滑动条_置滑块高度, 设置滑块按钮高度. // // height: 高度. -func (s *SliderBar) SetButtonHeight(height int) int { - return xc.XSliderBar_SetButtonHeight(s.Handle, height) +func (s *SliderBar) SetButtonHeight(height int) *SliderBar { + xc.XSliderBar_SetButtonHeight(s.Handle, height) + return s } // 滑动条_置当前位置, 设置当前进度点. // // pos: 进度点. -func (s *SliderBar) SetPos(pos int) int { - return xc.XSliderBar_SetPos(s.Handle, pos) +func (s *SliderBar) SetPos(pos int) *SliderBar { + xc.XSliderBar_SetPos(s.Handle, pos) + return s } // 滑动条_取当前位置, 获取当前进度点. @@ -120,8 +125,9 @@ func (s *SliderBar) GetButton() int { // 滑动条_置水平, 设置水平或垂直. // // bHorizon: 水平或垂直. -func (s *SliderBar) EnableHorizon(bHorizon bool) int { - return xc.XSliderBar_EnableHorizon(s.Handle, bHorizon) +func (s *SliderBar) EnableHorizon(bHorizon bool) *SliderBar { + xc.XSliderBar_EnableHorizon(s.Handle, bHorizon) + return s } /* diff --git a/widget/tabbar.go b/widget/tabbar.go index 846db51..cbec675 100644 --- a/widget/tabbar.go +++ b/widget/tabbar.go @@ -100,8 +100,9 @@ func (t *TabBar) DeleteLabel(index int) bool { } // TAB条_删除全部, 删除所有标签. -func (t *TabBar) DeleteLabelAll() int { - return xc.XTabBar_DeleteLabelAll(t.Handle) +func (t *TabBar) DeleteLabelAll() *TabBar { + xc.XTabBar_DeleteLabelAll(t.Handle) + return t } // TAB条_取标签, 获取标签按钮句柄. @@ -158,8 +159,9 @@ func (t *TabBar) GetindexByEle(hLabel int) int { // TAB条_置间隔, 设置标签间距, 0没有间距. // // spacing: 标签间隔大小. -func (t *TabBar) SetLabelSpacing(spacing int) int { - return xc.XTabBar_SetLabelSpacing(t.Handle, spacing) +func (t *TabBar) SetLabelSpacing(spacing int) *TabBar { + xc.XTabBar_SetLabelSpacing(t.Handle, spacing) + return t } // TAB条_置边距, 设置内容与边框的间隔大小. @@ -171,60 +173,69 @@ func (t *TabBar) SetLabelSpacing(spacing int) int { // right: 右边间隔大小. // // bottom: 下边间隔大小. -func (t *TabBar) SetPadding(left int, top int, right int, bottom int) int { - return xc.XTabBar_SetPadding(t.Handle, left, top, right, bottom) +func (t *TabBar) SetPadding(left int, top int, right int, bottom int) *TabBar { + xc.XTabBar_SetPadding(t.Handle, left, top, right, bottom) + return t } // TAB条_置选择, 设置选择标签. // // index: 标签位置索引. -func (t *TabBar) SetSelect(index int) int { - return xc.XTabBar_SetSelect(t.Handle, index) +func (t *TabBar) SetSelect(index int) *TabBar { + xc.XTabBar_SetSelect(t.Handle, index) + return t } // TAB条_左滚动, 左按钮滚动. -func (t *TabBar) SetUp() int { - return xc.XTabBar_SetUp(t.Handle) +func (t *TabBar) SetUp() *TabBar { + xc.XTabBar_SetUp(t.Handle) + return t } // TAB条_右滚动, 右按钮滚动. -func (t *TabBar) SetDown() int { - return xc.XTabBar_SetDown(t.Handle) +func (t *TabBar) SetDown() *TabBar { + xc.XTabBar_SetDown(t.Handle) + return t } // TAB条_启用平铺, 平铺标签, 每个标签显示相同大小. // // bTile: 是否启用. -func (t *TabBar) EnableTile(bTile bool) int { - return xc.XTabBar_EnableTile(t.Handle, bTile) +func (t *TabBar) EnableTile(bTile bool) *TabBar { + xc.XTabBar_EnableTile(t.Handle, bTile) + return t } // TAB条_启用下拉菜单按钮. // // bEnable:. -func (t *TabBar) EnableDropMenu(bEnable bool) int { - return xc.XTabBar_EnableDropMenu(t.Handle, bEnable) +func (t *TabBar) EnableDropMenu(bEnable bool) *TabBar { + xc.XTabBar_EnableDropMenu(t.Handle, bEnable) + return t } // TAB条_启用标签带关闭按钮, 启用关闭标签功能. // // bEnable: 是否启用. -func (t *TabBar) EnableClose(bEnable bool) int { - return xc.XTabBar_EnableClose(t.Handle, bEnable) +func (t *TabBar) EnableClose(bEnable bool) *TabBar { + xc.XTabBar_EnableClose(t.Handle, bEnable) + return t } // TAB条_置关闭按钮大小, 设置关闭按钮大小. // // pSize: 大小值, 宽度和高度可以为-1, -1代表默认值. -func (t *TabBar) SetCloseSize(pSize *xc.SIZE) int { - return xc.XTabBar_SetCloseSize(t.Handle, pSize) +func (t *TabBar) SetCloseSize(pSize *xc.SIZE) *TabBar { + xc.XTabBar_SetCloseSize(t.Handle, pSize) + return t } // TAB条_置滚动按钮大小. // // pSize: 大小值, 宽度和高度可以为-1, -1代表默认值. -func (t *TabBar) SetTurnButtonSize(pSize *xc.SIZE) int { - return xc.XTabBar_SetTurnButtonSize(t.Handle, pSize) +func (t *TabBar) SetTurnButtonSize(pSize *xc.SIZE) *TabBar { + xc.XTabBar_SetTurnButtonSize(t.Handle, pSize) + return t } // TAB条_置指定标签固定宽度. @@ -232,8 +243,9 @@ func (t *TabBar) SetTurnButtonSize(pSize *xc.SIZE) int { // index: 索引. // // nWidth: 宽度, , 如果值为-1, 那么自动计算宽度. -func (t *TabBar) SetLabelWidth(index int, nWidth int) int { - return xc.XTabBar_SetLabelWidth(t.Handle, index, nWidth) +func (t *TabBar) SetLabelWidth(index int, nWidth int) *TabBar { + xc.XTabBar_SetLabelWidth(t.Handle, index, nWidth) + return t } // TAB条_显示标签, 显示或隐藏指定标签. diff --git a/widget/table.go b/widget/table.go index 4e60047..3a13f16 100644 --- a/widget/table.go +++ b/widget/table.go @@ -72,8 +72,9 @@ func NewTableByUIDName(name string) *Table { // nRow: 行数量. // // nCol: 列数量. -func (t *Table) Reset(nRow int, nCol int) int { - return xc.XTable_Reset(t.Handle, nRow, nCol) +func (t *Table) Reset(nRow int, nCol int) *Table { + xc.XTable_Reset(t.Handle, nRow, nCol) + return t } // 表格_组合行. @@ -83,8 +84,9 @@ func (t *Table) Reset(nRow int, nCol int) int { // iCol: 列索引. // // count: 数量. -func (t *Table) ComboRow(iRow int, iCol int, count int) int { - return xc.XTable_ComboRow(t.Handle, iRow, iCol, count) +func (t *Table) ComboRow(iRow int, iCol int, count int) *Table { + xc.XTable_ComboRow(t.Handle, iRow, iCol, count) + return t } // 表格_组合列. @@ -94,8 +96,9 @@ func (t *Table) ComboRow(iRow int, iCol int, count int) int { // iCol: 列索引. // // count: 数量. -func (t *Table) ComboCol(iRow int, iCol int, count int) int { - return xc.XTable_ComboCol(t.Handle, iRow, iCol, count) +func (t *Table) ComboCol(iRow int, iCol int, count int) *Table { + xc.XTable_ComboCol(t.Handle, iRow, iCol, count) + return t } // 表格_置列宽. @@ -103,8 +106,9 @@ func (t *Table) ComboCol(iRow int, iCol int, count int) int { // iCol: 列索引. // // width: 宽度. -func (t *Table) SetColWidth(iCol int, width int) int { - return xc.XTable_SetColWidth(t.Handle, iCol, width) +func (t *Table) SetColWidth(iCol int, width int) *Table { + xc.XTable_SetColWidth(t.Handle, iCol, width) + return t } // 表格_置行高. @@ -112,29 +116,33 @@ func (t *Table) SetColWidth(iCol int, width int) int { // iRow: 行索引. // // height: 高度. -func (t *Table) SetRowHeight(iRow int, height int) int { - return xc.XTable_SetRowHeight(t.Handle, iRow, height) +func (t *Table) SetRowHeight(iRow int, height int) *Table { + xc.XTable_SetRowHeight(t.Handle, iRow, height) + return t } // 表格_置边颜色. // // color: 颜色. -func (t *Table) SetBorderColor(color int) int { - return xc.XTable_SetBorderColor(t.Handle, color) +func (t *Table) SetBorderColor(color int) *Table { + xc.XTable_SetBorderColor(t.Handle, color) + return t } // 表格_置文本颜色. // // color: 颜色. -func (t *Table) SetTextColor(color int) int { - return xc.XTable_SetTextColor(t.Handle, color) +func (t *Table) SetTextColor(color int) *Table { + xc.XTable_SetTextColor(t.Handle, color) + return t } // 表格_置字体. // // hFont: 字体句柄. -func (t *Table) SetFont(hFont int) int { - return xc.XTable_SetFont(t.Handle, hFont) +func (t *Table) SetFont(hFont int) *Table { + xc.XTable_SetFont(t.Handle, hFont) + return t } // 表格_置项内填充. @@ -146,8 +154,9 @@ func (t *Table) SetFont(hFont int) int { // rightSize: 内填充大小. // // bottomSize: 内填充大小. -func (t *Table) SetItemPadding(leftSize int, topSize int, rightSize int, bottomSize int) int { - return xc.XTable_SetItemPadding(t.Handle, leftSize, topSize, rightSize, bottomSize) +func (t *Table) SetItemPadding(leftSize int, topSize int, rightSize int, bottomSize int) *Table { + xc.XTable_SetItemPadding(t.Handle, leftSize, topSize, rightSize, bottomSize) + return t } // 表格_置项文本. @@ -157,8 +166,9 @@ func (t *Table) SetItemPadding(leftSize int, topSize int, rightSize int, bottomS // iCol: 列索引. // // pText: 文本. -func (t *Table) SetItemText(iRow int, iCol int, pText string) int { - return xc.XTable_SetItemText(t.Handle, iRow, iCol, pText) +func (t *Table) SetItemText(iRow int, iCol int, pText string) *Table { + xc.XTable_SetItemText(t.Handle, iRow, iCol, pText) + return t } // 表格_置项字体. @@ -168,8 +178,9 @@ func (t *Table) SetItemText(iRow int, iCol int, pText string) int { // iCol: 列索引. // // hFont: 字体句柄. -func (t *Table) SetItemFont(iRow int, iCol int, hFont int) int { - return xc.XTable_SetItemFont(t.Handle, iRow, iCol, hFont) +func (t *Table) SetItemFont(iRow int, iCol int, hFont int) *Table { + xc.XTable_SetItemFont(t.Handle, iRow, iCol, hFont) + return t } // 表格_置项文本对齐. @@ -179,8 +190,9 @@ func (t *Table) SetItemFont(iRow int, iCol int, hFont int) int { // iCol: 列索引. // // nAlign: 对齐方式, TextFormatFlag_, TextAlignFlag_, TextTrimming_. -func (t *Table) SetItemTextAlign(iRow int, iCol int, nAlign xcc.TextFormatFlag_) int { - return xc.XTable_SetItemTextAlign(t.Handle, iRow, iCol, nAlign) +func (t *Table) SetItemTextAlign(iRow int, iCol int, nAlign xcc.TextFormatFlag_) *Table { + xc.XTable_SetItemTextAlign(t.Handle, iRow, iCol, nAlign) + return t } // 表格_置项文本色. @@ -192,8 +204,9 @@ func (t *Table) SetItemTextAlign(iRow int, iCol int, nAlign xcc.TextFormatFlag_) // color: 颜色. // // bColor: 是否使用. -func (t *Table) SetItemTextColor(iRow int, iCol int, color int, bColor bool) int { - return xc.XTable_SetItemTextColor(t.Handle, iRow, iCol, color, bColor) +func (t *Table) SetItemTextColor(iRow int, iCol int, color int, bColor bool) *Table { + xc.XTable_SetItemTextColor(t.Handle, iRow, iCol, color, bColor) + return t } // 表格_置项背景色. @@ -205,8 +218,9 @@ func (t *Table) SetItemTextColor(iRow int, iCol int, color int, bColor bool) int // color: 颜色. // // bColor: 是否使用. -func (t *Table) SetItemBkColor(iRow int, iCol int, color int, bColor bool) int { - return xc.XTable_SetItemBkColor(t.Handle, iRow, iCol, color, bColor) +func (t *Table) SetItemBkColor(iRow int, iCol int, color int, bColor bool) *Table { + xc.XTable_SetItemBkColor(t.Handle, iRow, iCol, color, bColor) + return t } // 表格_置项线. @@ -222,8 +236,9 @@ func (t *Table) SetItemBkColor(iRow int, iCol int, color int, bColor bool) int { // nFlag: 标识, Table_Line_Flag_, 暂时没有, 填0. // // color: 颜色. -func (t *Table) SetItemLine(iRow1 int, iCol1 int, iRow2 int, iCol2 int, nFlag int, color int) int { - return xc.XTable_SetItemLine(t.Handle, iRow1, iCol1, iRow2, iCol2, nFlag, color) +func (t *Table) SetItemLine(iRow1 int, iCol1 int, iRow2 int, iCol2 int, nFlag int, color int) *Table { + xc.XTable_SetItemLine(t.Handle, iRow1, iCol1, iRow2, iCol2, nFlag, color) + return t } // 表格_置项标识. @@ -233,8 +248,9 @@ func (t *Table) SetItemLine(iRow1 int, iCol1 int, iRow2 int, iCol2 int, nFlag in // iCol: 列索引. // // flag: 标识, Table_Flag_. -func (t *Table) SetItemFlag(iRow int, iCol int, flag xcc.Table_Flag_) int { - return xc.XTable_SetItemFlag(t.Handle, iRow, iCol, flag) +func (t *Table) SetItemFlag(iRow int, iCol int, flag xcc.Table_Flag_) *Table { + xc.XTable_SetItemFlag(t.Handle, iRow, iCol, flag) + return t } // 表格_取项坐标. diff --git a/widget/textlink.go b/widget/textlink.go index 8651a12..688ffb1 100644 --- a/widget/textlink.go +++ b/widget/textlink.go @@ -4,7 +4,7 @@ import ( "github.com/twgh/xcgui/xc" ) -// 静态文本链接按钮. +// TextLink 静态文本链接按钮. type TextLink struct { Button } @@ -71,34 +71,39 @@ func NewTextLinkByUIDName(name string) *TextLink { // 文本链接_启用离开状态下划线, 启用下划线, 鼠标离开状态. // // bEnable: 是否启用. -func (t *TextLink) EnableUnderlineLeave(bEnable bool) int { - return xc.XTextLink_EnableUnderlineLeave(t.Handle, bEnable) +func (t *TextLink) EnableUnderlineLeave(bEnable bool) *TextLink { + xc.XTextLink_EnableUnderlineLeave(t.Handle, bEnable) + return t } // 文本链接_停留状态下划线, 启用下划线, 鼠标停留状态. // // bEnable: 是否启用. -func (t *TextLink) EnableUnderlineStay(bEnable bool) int { - return xc.XTextLink_EnableUnderlineStay(t.Handle, bEnable) +func (t *TextLink) EnableUnderlineStay(bEnable bool) *TextLink { + xc.XTextLink_EnableUnderlineStay(t.Handle, bEnable) + return t } // 文本链接_置停留状态文本颜色, 设置文本颜色, 鼠标停留状态. // -// color: ABGR 颜色值. -func (t *TextLink) SetTextColorStay(color int) int { - return xc.XTextLink_SetTextColorStay(t.Handle, color) +// color: ARGB 颜色值. +func (t *TextLink) SetTextColorStay(color int) *TextLink { + xc.XTextLink_SetTextColorStay(t.Handle, color) + return t } // 文本链接_置离开状态下划线颜色, 设置下划线颜色, 鼠标离开状态. // -// color: ABGR 颜色值. -func (t *TextLink) SetUnderlineColorLeave(color int) int { - return xc.XTextLink_SetUnderlineColorLeave(t.Handle, color) +// color: ARGB 颜色值. +func (t *TextLink) SetUnderlineColorLeave(color int) *TextLink { + xc.XTextLink_SetUnderlineColorLeave(t.Handle, color) + return t } // 文本链接_置停留状态下划线颜色, 置下划线颜色, 鼠标停留状态. // -// color: ABGR 颜色值. -func (t *TextLink) SetUnderlineColorStay(color int) int { - return xc.XTextLink_SetUnderlineColorStay(t.Handle, color) +// color: ARGB 颜色值. +func (t *TextLink) SetUnderlineColorStay(color int) *TextLink { + xc.XTextLink_SetUnderlineColorStay(t.Handle, color) + return t } diff --git a/widget/toolbar.go b/widget/toolbar.go index 4d1d535..8a7ee9d 100644 --- a/widget/toolbar.go +++ b/widget/toolbar.go @@ -2,7 +2,7 @@ package widget import "github.com/twgh/xcgui/xc" -// 工具条. +// ToolBar 工具条. type ToolBar struct { Element } @@ -77,7 +77,7 @@ func (t *ToolBar) InsertEle(hNewEle int, index int) int { // // index: 插入位置索引, (-1)插入末尾. // -// color: ABGR 颜色. +// color: ARGB 颜色. func (t *ToolBar) InsertSeparator(index int, color int) int { return xc.XToolBar_InsertSeparator(t.Handle, index, color) } @@ -85,8 +85,9 @@ func (t *ToolBar) InsertSeparator(index int, color int) int { // 工具条_启用下拉菜单, 启用下拉菜单, 显示隐藏的项. // // bEnable: 是否启用. -func (t *ToolBar) EnableButtonMenu(bEnable bool) int { - return xc.XToolBar_EnableButtonMenu(t.Handle, bEnable) +func (t *ToolBar) EnableButtonMenu(bEnable bool) *ToolBar { + xc.XToolBar_EnableButtonMenu(t.Handle, bEnable) + return t } // 工具条_取元素, 获取工具条上指定元素, 返回元素句柄. @@ -114,18 +115,21 @@ func (t *ToolBar) GetButtonMenu() int { // 工具条_置间距, 设置对象之间的间距. // // nSize: 间距大小. -func (t *ToolBar) SetSpace(nSize int) int { - return xc.XToolBar_SetSpace(t.Handle, nSize) +func (t *ToolBar) SetSpace(nSize int) *ToolBar { + xc.XToolBar_SetSpace(t.Handle, nSize) + return t } // 工具条_删除元素, 删除元素, 并且销毁. // // index: 索引值. -func (t *ToolBar) DeleteEle(index int) int { - return xc.XToolBar_DeleteEle(t.Handle, index) +func (t *ToolBar) DeleteEle(index int) *ToolBar { + xc.XToolBar_DeleteEle(t.Handle, index) + return t } // 工具条_删除全部, 删除所有元素, 并且销毁. -func (t *ToolBar) DeleteAllEle() int { - return xc.XToolBar_DeleteAllEle(t.Handle) +func (t *ToolBar) DeleteAllEle() *ToolBar { + xc.XToolBar_DeleteAllEle(t.Handle) + return t } diff --git a/widget/tree.go b/widget/tree.go index 6954141..5608da0 100644 --- a/widget/tree.go +++ b/widget/tree.go @@ -5,7 +5,7 @@ import ( "github.com/twgh/xcgui/xcc" ) -// 列表树元素. +// Tree 列表树元素. type Tree struct { ScrollView } @@ -89,8 +89,9 @@ func NewTreeByUIDName(name string) *Tree { // 列表树_启用拖动项, 启用拖动项功能. // // bEnable: 是否启用. -func (t *Tree) EnableDragItem(bEnable bool) { +func (t *Tree) EnableDragItem(bEnable bool) *Tree { xc.XTree_EnableDragItem(t.Handle, bEnable) + return t } // 列表树_启用连接线, 启用或禁用显示项的连接线. @@ -98,29 +99,33 @@ func (t *Tree) EnableDragItem(bEnable bool) { // bEnable: 是否启用. // // bSolid: 实线或虚线; TRUE: 实线, FALSE: 虚线. -func (t *Tree) EnableConnectLine(bEnable bool, bSolid bool) { +func (t *Tree) EnableConnectLine(bEnable bool, bSolid bool) *Tree { xc.XTree_EnableConnectLine(t.Handle, bEnable, bSolid) + return t } // 列表树_启用展开, 启动或关闭默认展开功能, 如果开启新插入的项将自动展开. // // bEnable: 是否启用. -func (t *Tree) EnableExpand(bEnable bool) { +func (t *Tree) EnableExpand(bEnable bool) *Tree { xc.XTree_EnableExpand(t.Handle, bEnable) + return t } // 列表树_启用模板复用. // // bEnable: 是否启用. -func (t *Tree) EnableTemplateReuse(bEnable bool) { +func (t *Tree) EnableTemplateReuse(bEnable bool) *Tree { xc.XTree_EnableTemplateReuse(t.Handle, bEnable) + return t } // 列表树_置连接线颜色. // -// color: ABGR 颜色. -func (t *Tree) SetConnectLineColor(color int) { +// color: ARGB 颜色. +func (t *Tree) SetConnectLineColor(color int) *Tree { xc.XTree_SetConnectLineColor(t.Handle, color) + return t } // 列表树_置展开按钮大小, 设置展开按钮占用空间大小. @@ -128,22 +133,25 @@ func (t *Tree) SetConnectLineColor(color int) { // nWidth: 宽度. // // nHeight: 高度. -func (t *Tree) SetExpandButtonSize(nWidth, nHeight int32) { +func (t *Tree) SetExpandButtonSize(nWidth, nHeight int32) *Tree { xc.XTree_SetExpandButtonSize(t.Handle, nWidth, nHeight) + return t } // 列表树_置连接线长度, 设置连线绘制长度, 展开按钮与项内容之间的连线. // // nLength: 连线绘制长度. -func (t *Tree) SetConnectLineLength(nLength int32) { +func (t *Tree) SetConnectLineLength(nLength int32) *Tree { xc.XTree_SetConnectLineLength(t.Handle, nLength) + return t } // 列表树_置拖动项插入位置颜色, 设置拖动项插入位置颜色提示. // -// color: ABGR 颜色. -func (t *Tree) SetDragInsertPositionColor(color int) { +// color: ARGB 颜色. +func (t *Tree) SetDragInsertPositionColor(color int) *Tree { xc.XTree_SetDragInsertPositionColor(t.Handle, color) + return t } // 列表树_置项模板文件. @@ -191,8 +199,9 @@ func (t *Tree) SetItemTemplateXMLSelFromString(pStringXML string) bool { // 列表树_置项背景绘制标志, 设置是否绘制指定状态下项的背景. // // nFlags: 标志位: xcc.List_DrawItemBk_Flag_. -func (t *Tree) SetDrawItemBkFlags(nFlags xcc.List_DrawItemBk_Flag_) { +func (t *Tree) SetDrawItemBkFlags(nFlags xcc.List_DrawItemBk_Flag_) *Tree { xc.XTree_SetDrawItemBkFlags(t.Handle, nFlags) + return t } // 列表树_置项数据, 设置项用户数据. @@ -226,8 +235,9 @@ func (t *Tree) GetSelectItem() int32 { // 列表树_可视指定项, 滚动视图让指定项可见. // // nID: 项索引. -func (t *Tree) VisibleItem(nID int32) { +func (t *Tree) VisibleItem(nID int32) *Tree { xc.XTree_VisibleItem(t.Handle, nID) + return t } // 列表树_判断展开. @@ -312,8 +322,9 @@ func (t *Tree) CreateAdapter() int { // 列表树_绑定数据适配器. // // hAdapter: 数据适配器句柄, XAdTree. -func (t *Tree) BindAdapter(hAdapter int) { +func (t *Tree) BindAdapter(hAdapter int) *Tree { xc.XTree_BindAdapter(t.Handle, hAdapter) + return t } // 列表树_取数据适配器, 返回数据适配器句柄. @@ -322,22 +333,25 @@ func (t *Tree) GetAdapter() int { } // 列表树_刷新数据, 刷新所有项模板, 以便更新UI. -func (t *Tree) RefreshData() { +func (t *Tree) RefreshData() *Tree { xc.XTree_RefreshData(t.Handle) + return t } // 列表树_刷新指定项, 刷新指定项模板, 以便更新UI. // // nID: 项ID. -func (t *Tree) RefreshItem(nID int32) { +func (t *Tree) RefreshItem(nID int32) *Tree { xc.XTree_RefreshItem(t.Handle, nID) + return t } // 列表树_置缩进, 设置缩进大小. // // nWidth: 缩进宽度. -func (t *Tree) SetIndentation(nWidth int32) { +func (t *Tree) SetIndentation(nWidth int32) *Tree { xc.XTree_SetIndentation(t.Handle, nWidth) + return t } // 列表树_取缩进, 返回缩进值大小. @@ -350,8 +364,9 @@ func (t *Tree) GetIndentation() int32 { // nHeight: 高度. // // nSelHeight: 选中时高度. -func (t *Tree) SetItemHeightDefault(nHeight, nSelHeight int32) { +func (t *Tree) SetItemHeightDefault(nHeight, nSelHeight int32) *Tree { xc.XTree_SetItemHeightDefault(t.Handle, nHeight, nSelHeight) + return t } // 列表树_取项默认高度. @@ -359,8 +374,9 @@ func (t *Tree) SetItemHeightDefault(nHeight, nSelHeight int32) { // pHeight: 接收返回高度. // // pSelHeight: 接收返回值, 当项选中时的高度. -func (t *Tree) GetItemHeightDefault(pHeight, pSelHeight *int32) { +func (t *Tree) GetItemHeightDefault(pHeight, pSelHeight *int32) *Tree { xc.XTree_GetItemHeightDefault(t.Handle, pHeight, pSelHeight) + return t } // 列表树_置项高度. @@ -370,8 +386,9 @@ func (t *Tree) GetItemHeightDefault(pHeight, pSelHeight *int32) { // nHeight: 高度. // // nSelHeight: 选中时高度. -func (t *Tree) SetItemHeight(nID, nHeight, nSelHeight int32) { +func (t *Tree) SetItemHeight(nID, nHeight, nSelHeight int32) *Tree { xc.XTree_SetItemHeight(t.Handle, nID, nHeight, nSelHeight) + return t } // 列表树_取项高度. @@ -381,15 +398,17 @@ func (t *Tree) SetItemHeight(nID, nHeight, nSelHeight int32) { // pHeight: 接收返回高度. // // pSelHeight: 接收返回值, 当项选中时的高度. -func (t *Tree) GetItemHeight(nID int32, pHeight, pSelHeight *int32) { +func (t *Tree) GetItemHeight(nID int32, pHeight, pSelHeight *int32) *Tree { xc.XTree_GetItemHeight(t.Handle, nID, pHeight, pSelHeight) + return t } // 列表树_置行间距. // // nSpace: 行间隔大小. -func (t *Tree) SetRowSpace(nSpace int32) { +func (t *Tree) SetRowSpace(nSpace int32) *Tree { xc.XTree_SetRowSpace(t.Handle, nSpace) + return t } // 列表树_取行间距. @@ -570,20 +589,23 @@ func (t *Tree) DeleteItem(nID int32) bool { } // 列表树_删除全部项. -func (t *Tree) DeleteItemAll() { +func (t *Tree) DeleteItemAll() *Tree { xc.XTree_DeleteItemAll(t.Handle) + return t } // 列表树_删除列全部. -func (t *Tree) DeleteColumnAll() { +func (t *Tree) DeleteColumnAll() *Tree { xc.XTree_DeleteColumnAll(t.Handle) + return t } // 列表树_置分割线颜色. // -// color: ABGR 颜色值. -func (t *Tree) SetSplitLineColor(color int) { +// color: ARGB 颜色值. +func (t *Tree) SetSplitLineColor(color int) *Tree { xc.XTree_SetSplitLineColor(t.Handle, color) + return t } // 列表树_置项模板从内存. diff --git a/window/framewindow.go b/window/framewindow.go index dc4f955..695822f 100644 --- a/window/framewindow.go +++ b/window/framewindow.go @@ -101,29 +101,33 @@ func NewFrameWindowByUIDName(name string) *FrameWindow { // 框架窗口_取布局区域坐标, 用来布局窗格的区域坐标, 不包含码头. // // pRect: 返回坐标. -func (fw *FrameWindow) GetLayoutAreaRect(pRect *xc.RECT) int { - return xc.XFrameWnd_GetLayoutAreaRect(fw.Handle, pRect) +func (fw *FrameWindow) GetLayoutAreaRect(pRect *xc.RECT) *FrameWindow { + xc.XFrameWnd_GetLayoutAreaRect(fw.Handle, pRect) + return fw } // 框架窗口_置视图, 设置窗格组TabBar高度. // // hEle: 元素句柄. -func (fw *FrameWindow) SetView(hEle int) int { - return xc.XFrameWnd_SetView(fw.Handle, hEle) +func (fw *FrameWindow) SetView(hEle int) *FrameWindow { + xc.XFrameWnd_SetView(fw.Handle, hEle) + return fw } // 框架窗口_置窗格分隔条颜色. // -// color: ABGR 颜色值. -func (fw *FrameWindow) SetPaneSplitBarColor(color int) int { - return xc.XFrameWnd_SetPaneSplitBarColor(fw.Handle, color) +// color: ARGB 颜色值. +func (fw *FrameWindow) SetPaneSplitBarColor(color int) *FrameWindow { + xc.XFrameWnd_SetPaneSplitBarColor(fw.Handle, color) + return fw } // 框架窗口_置TabBar条高度, 设置窗格组TabBar高度. // // nHeight: 高度. -func (fw *FrameWindow) SetTabBarHeight(nHeight int32) int { - return xc.XFrameWnd_SetTabBarHeight(fw.Handle, nHeight) +func (fw *FrameWindow) SetTabBarHeight(nHeight int32) *FrameWindow { + xc.XFrameWnd_SetTabBarHeight(fw.Handle, nHeight) + return fw } // 框架窗口_保存布局到文件, 保存布局信息到文件. @@ -183,18 +187,34 @@ func FrameWnd_Attach(hWnd uintptr, XCStyle int) *Window { // 框架窗口_取主视图坐标. 获取框架窗口主视图区域坐标. // // pRect: 返回坐标. -func (fw *FrameWindow) GetViewRect(pRect *xc.RECT) { +func (fw *FrameWindow) GetViewRect(pRect *xc.RECT) *FrameWindow { xc.XFrameWnd_GetViewRect(fw.Handle, pRect) + return fw } // 框架窗口_置窗格分隔条宽度. // // nWidth: 宽度. -func (fw *FrameWindow) SetPaneSplitBarWidth(nWidth int32) { +func (fw *FrameWindow) SetPaneSplitBarWidth(nWidth int32) *FrameWindow { xc.XFrameWnd_SetPaneSplitBarWidth(fw.Handle, nWidth) + return fw } // 框架窗口_取窗格分隔条宽度. func (fw *FrameWindow) GetPaneSplitBarWidth() int32 { return xc.XFrameWnd_GetPaneSplitBarWidth(fw.Handle) } + +// 框架窗口_置布局外间距. 设置框架窗口, 窗格区域布局的外间距. +// +// left: 左边间隔. +// +// top: 顶边间隔. +// +// right: 右边间隔. +// +// bottom: 底边间隔. +func (fw *FrameWindow) SetLayoutMargin(left, top, right, bottom int32) *FrameWindow { + xc.XFrameWnd_SetLayoutMargin(fw.Handle, left, top, right, bottom) + return fw +} diff --git a/window/modalwindow.go b/window/modalwindow.go index 1e32075..2518c39 100644 --- a/window/modalwindow.go +++ b/window/modalwindow.go @@ -273,15 +273,17 @@ func NewModalWindowByUIDName(name string) *ModalWindow { // 模态窗口_启用自动关闭, 是否自动关闭窗口, 当窗口失去焦点时. // // bEnable: 开启开关. -func (m *ModalWindow) EnableAutoClose(bEnable bool) int { - return xc.XModalWnd_EnableAutoClose(m.Handle, bEnable) +func (m *ModalWindow) EnableAutoClose(bEnable bool) *ModalWindow { + xc.XModalWnd_EnableAutoClose(m.Handle, bEnable) + return m } // 模态窗口_启用ESC关闭, 当用户按ESC键时自动关闭模态窗口. // // bEnable: 是否启用. -func (m *ModalWindow) EnableEscClose(bEnable bool) int { - return xc.XModalWnd_EnableEscClose(m.Handle, bEnable) +func (m *ModalWindow) EnableEscClose(bEnable bool) *ModalWindow { + xc.XModalWnd_EnableEscClose(m.Handle, bEnable) + return m } // 模态窗口_启动, 启动显示模态窗口, 当窗口关闭时返回: MessageBox_Flag_Ok: 点击确定按钮退出, MessageBox_Flag_Cancel: 点击取消按钮退出, MessageBox_Flag_Other: 其他方式退出. @@ -292,6 +294,7 @@ func (m *ModalWindow) DoModal() xcc.MessageBox_Flag_ { // 模态窗口_结束, 结束模态窗口. // // nResult: 用作XModalWnd_DoModal()的返回值. MessageBox_Flag_Ok: 点击确定按钮退出, MessageBox_Flag_Cancel: 点击取消按钮退出, MessageBox_Flag_Other: 其他方式退出. -func (m *ModalWindow) EndModal(nResult xcc.MessageBox_Flag_) int { - return xc.XModalWnd_EndModal(m.Handle, nResult) +func (m *ModalWindow) EndModal(nResult xcc.MessageBox_Flag_) *ModalWindow { + xc.XModalWnd_EndModal(m.Handle, nResult) + return m } diff --git a/window/windowbase.go b/window/windowbase.go index a6d8741..dd4f5d9 100644 --- a/window/windowbase.go +++ b/window/windowbase.go @@ -101,8 +101,9 @@ func (w *windowBase) ShowWindow(nCmdShow xcc.SW_) int { } // 窗口_置顶. -func (w *windowBase) SetTop() int { - return xc.XWnd_SetTop(w.Handle) +func (w *windowBase) SetTop() *windowBase { + xc.XWnd_SetTop(w.Handle) + return w } // 窗口_注册事件C. @@ -165,8 +166,9 @@ func (w *windowBase) GetHWND() uintptr { // 窗口_重绘. // // bImmediate: 是否立即重绘, 默认为否. -func (w *windowBase) Redraw(bImmediate bool) int { - return xc.XWnd_Redraw(w.Handle, bImmediate) +func (w *windowBase) Redraw(bImmediate bool) *windowBase { + xc.XWnd_Redraw(w.Handle, bImmediate) + return w } // 窗口_重绘指定区域. @@ -174,22 +176,25 @@ func (w *windowBase) Redraw(bImmediate bool) int { // pRect: 需要重绘的区域坐标. // // bImmediate: TRUE立即重绘, FALSE放入消息队列延迟重绘. -func (w *windowBase) RedrawRect(pRect *xc.RECT, bImmediate bool) int { - return xc.XWnd_RedrawRect(w.Handle, pRect, bImmediate) +func (w *windowBase) RedrawRect(pRect *xc.RECT, bImmediate bool) *windowBase { + xc.XWnd_RedrawRect(w.Handle, pRect, bImmediate) + return w } // 窗口_置坐标. // // pRect: 坐标. -func (w *windowBase) SetRect(pRect *xc.RECT) bool { - return xc.XWnd_SetRect(w.Handle, pRect) +func (w *windowBase) SetRect(pRect *xc.RECT) *windowBase { + xc.XWnd_SetRect(w.Handle, pRect) + return w } // 窗口_置焦点. // // hFocusEle: 将获得焦点的元素. -func (w *windowBase) SetFocusEle(hFocusEle int) bool { - return xc.XWnd_SetFocusEle(w.Handle, hFocusEle) +func (w *windowBase) SetFocusEle(hFocusEle int) *windowBase { + xc.XWnd_SetFocusEle(w.Handle, hFocusEle) + return w } // 窗口_取焦点. @@ -205,13 +210,15 @@ func (w *windowBase) GetStayEle() int { // 窗口_绘制, 在自绘事件函数中,用户手动调用绘制窗口, 以便控制绘制顺序. // // hDraw: 图形绘制句柄. -func (w *windowBase) DrawWindow(hDraw int) int { - return xc.XWnd_DrawWindow(w.Handle, hDraw) +func (w *windowBase) DrawWindow(hDraw int) *windowBase { + xc.XWnd_DrawWindow(w.Handle, hDraw) + return w } // 窗口_居中. -func (w *windowBase) Center() int { - return xc.XWnd_Center(w.Handle) +func (w *windowBase) Center() *windowBase { + xc.XWnd_Center(w.Handle) + return w } // 窗口_居中扩展. @@ -219,15 +226,17 @@ func (w *windowBase) Center() int { // width: 窗口宽度. // // height: 窗口高度. -func (w *windowBase) CenterEx(width, height int) int { - return xc.XWnd_CenterEx(w.Handle, width, height) +func (w *windowBase) CenterEx(width, height int) *windowBase { + xc.XWnd_CenterEx(w.Handle, width, height) + return w } // 窗口_置光标. // // hCursor: 鼠标光标句柄. -func (w *windowBase) SetCursor(hCursor int) int { - return xc.XWnd_SetCursor(w.Handle, hCursor) +func (w *windowBase) SetCursor(hCursor int) *windowBase { + xc.XWnd_SetCursor(w.Handle, hCursor) + return w } // 窗口_取光标. @@ -238,71 +247,81 @@ func (w *windowBase) GetCursor() int { // 窗口_启用拖动边框. // // bEnable: 是否启用. -func (w *windowBase) EnableDragBorder(bEnable bool) int { - return xc.XWnd_EnableDragBorder(w.Handle, bEnable) +func (w *windowBase) EnableDragBorder(bEnable bool) *windowBase { + xc.XWnd_EnableDragBorder(w.Handle, bEnable) + return w } // 窗口_启用拖动窗口. // // bEnable: 是否启用. -func (w *windowBase) EnableDragWindow(bEnable bool) int { - return xc.XWnd_EnableDragWindow(w.Handle, bEnable) +func (w *windowBase) EnableDragWindow(bEnable bool) *windowBase { + xc.XWnd_EnableDragWindow(w.Handle, bEnable) + return w } // 窗口_启用拖动标题栏. // // bEnable: 是否启用. -func (w *windowBase) EnableDragCaption(bEnable bool) int { - return xc.XWnd_EnableDragCaption(w.Handle, bEnable) +func (w *windowBase) EnableDragCaption(bEnable bool) *windowBase { + xc.XWnd_EnableDragCaption(w.Handle, bEnable) + return w } // 窗口_启用绘制背景. // // bEnable: 是否启用. -func (w *windowBase) EnableDrawBk(bEnable bool) int { - return xc.XWnd_EnableDrawBk(w.Handle, bEnable) +func (w *windowBase) EnableDrawBk(bEnable bool) *windowBase { + xc.XWnd_EnableDrawBk(w.Handle, bEnable) + return w } // 窗口_启用自动焦点. // // bEnable: 是否启用. -func (w *windowBase) EnableAutoFocus(bEnable bool) int { - return xc.XWnd_EnableAutoFocus(w.Handle, bEnable) +func (w *windowBase) EnableAutoFocus(bEnable bool) *windowBase { + xc.XWnd_EnableAutoFocus(w.Handle, bEnable) + return w } // 窗口_启用允许最大化. // // bEnable: 是否启用. -func (w *windowBase) EnableMaxWindow(bEnable bool) int { - return xc.XWnd_EnableMaxWindow(w.Handle, bEnable) +func (w *windowBase) EnableMaxWindow(bEnable bool) *windowBase { + xc.XWnd_EnableMaxWindow(w.Handle, bEnable) + return w } // 窗口_启用限制窗口大小. // // bEnable: 是否启用. -func (w *windowBase) EnableLimitWindowSize(bEnable bool) int { - return xc.XWnd_EnableLimitWindowSize(w.Handle, bEnable) +func (w *windowBase) EnableLimitWindowSize(bEnable bool) *windowBase { + xc.XWnd_EnableLimitWindowSize(w.Handle, bEnable) + return w } // 窗口_启用布局. // // bEnable: 是否启用. -func (w *windowBase) EnableLayout(bEnable bool) int { - return xc.XWnd_EnableLayout(w.Handle, bEnable) +func (w *windowBase) EnableLayout(bEnable bool) *windowBase { + xc.XWnd_EnableLayout(w.Handle, bEnable) + return w } // 窗口_启用布局覆盖边框. // // bEnable: 是否启用. -func (w *windowBase) EnableLayoutOverlayBorder(bEnable bool) int { - return xc.XWnd_EnableLayoutOverlayBorder(w.Handle, bEnable) +func (w *windowBase) EnableLayoutOverlayBorder(bEnable bool) *windowBase { + xc.XWnd_EnableLayoutOverlayBorder(w.Handle, bEnable) + return w } // 窗口_显示布局边界. // // bEnable: 是否启用. -func (w *windowBase) ShowLayoutFrame(bEnable bool) int { - return xc.XWnd_ShowLayoutFrame(w.Handle, bEnable) +func (w *windowBase) ShowLayoutFrame(bEnable bool) *windowBase { + xc.XWnd_ShowLayoutFrame(w.Handle, bEnable) + return w } // 窗口_判断启用布局. @@ -318,8 +337,9 @@ func (w *windowBase) IsMaxWindow() bool { // 窗口_置鼠标捕获元素. // // hEle: 元素句柄. -func (w *windowBase) SetCaptureEle(hEle int) int { - return xc.XWnd_SetCaptureEle(w.Handle, hEle) +func (w *windowBase) SetCaptureEle(hEle int) *windowBase { + xc.XWnd_SetCaptureEle(w.Handle, hEle) + return w } // 窗口_取鼠标捕获元素. @@ -330,8 +350,16 @@ func (w *windowBase) GetCaptureEle() int { // 窗口_取绘制矩形. // // pRcPaint: 重绘区域坐标. -func (w *windowBase) GetDrawRect(pRcPaint *xc.RECT) int { - return xc.XWnd_GetDrawRect(w.Handle, pRcPaint) +func (w *windowBase) GetDrawRect(pRcPaint *xc.RECT) *windowBase { + xc.XWnd_GetDrawRect(w.Handle, pRcPaint) + return w +} + +// 窗口_取绘制矩形ex. +func (w *windowBase) GetDrawRectEx() xc.RECT { + var pRcPaint *xc.RECT + xc.XWnd_GetDrawRect(w.Handle, pRcPaint) + return *pRcPaint } // 窗口_置系统光标. @@ -344,23 +372,25 @@ func (w *windowBase) SetCursorSys(hCursor int) int { // 窗口_置字体. // // hFontx: 炫彩字体句柄. -func (w *windowBase) SetFont(hFontx int) int { - return xc.XWnd_SetFont(w.Handle, hFontx) +func (w *windowBase) SetFont(hFontx int) *windowBase { + xc.XWnd_SetFont(w.Handle, hFontx) + return w } // 窗口_置文本颜色. // -// color: ABGR 颜色值. -func (w *windowBase) SetTextColor(color int) int { - return xc.XWnd_SetTextColor(w.Handle, color) +// color: ARGB 颜色值. +func (w *windowBase) SetTextColor(color int) *windowBase { + xc.XWnd_SetTextColor(w.Handle, color) + return w } -// 窗口_取文本颜色, 返回ABGR 颜色. +// 窗口_取文本颜色, 返回ARGB 颜色. func (w *windowBase) GetTextColor() int { return xc.XWnd_GetTextColor(w.Handle) } -// 窗口_取文本颜色扩展, 返回ABGR 颜色. +// 窗口_取文本颜色扩展, 返回ARGB 颜色. func (w *windowBase) GetTextColorEx() int { return xc.XWnd_GetTextColorEx(w.Handle) } @@ -368,8 +398,9 @@ func (w *windowBase) GetTextColorEx() int { // 窗口_置ID. // // nID: ID值. -func (w *windowBase) SetID(nID int) int { - return xc.XWnd_SetID(w.Handle, nID) +func (w *windowBase) SetID(nID int) *windowBase { + xc.XWnd_SetID(w.Handle, nID) + return w } // 窗口_取ID. @@ -380,8 +411,9 @@ func (w *windowBase) GetID() int { // 窗口_置名称. // // pName: name值, 字符串. -func (w *windowBase) SetName(pName string) int { - return xc.XWnd_SetName(w.Handle, pName) +func (w *windowBase) SetName(pName string) *windowBase { + xc.XWnd_SetName(w.Handle, pName) + return w } // 窗口_取名称. @@ -398,13 +430,24 @@ func (w *windowBase) GetName() string { // right: 窗口右边大小. // // bottom: 窗口底部大小. -func (w *windowBase) SetBorderSize(left, top, right, bottom int) int { - return xc.XWnd_SetBorderSize(w.Handle, left, top, right, bottom) +func (w *windowBase) SetBorderSize(left, top, right, bottom int) *windowBase { + xc.XWnd_SetBorderSize(w.Handle, left, top, right, bottom) + return w } // 窗口_取边大小. -func (w *windowBase) GetBorderSize(pBorder *xc.RECT) int { - return xc.XWnd_GetBorderSize(w.Handle, pBorder) +// +// pBorder: 返回边大小. +func (w *windowBase) GetBorderSize(pBorder *xc.RECT) *windowBase { + xc.XWnd_GetBorderSize(w.Handle, pBorder) + return w +} + +// 窗口_取边大小ex. +func (w *windowBase) GetBorderSizeEx() xc.RECT { + var pBorder *xc.RECT + xc.XWnd_GetBorderSize(w.Handle, pBorder) + return *pBorder } // 窗口_置布局内填充大小. @@ -416,8 +459,24 @@ func (w *windowBase) GetBorderSize(pBorder *xc.RECT) int { // right: 右边大小. // // bottom: 下边大小. -func (w *windowBase) SetPadding(left, top, right, bottom int) int { - return xc.XWnd_SetPadding(w.Handle, left, top, right, bottom) +func (w *windowBase) SetPadding(left, top, right, bottom int) *windowBase { + xc.XWnd_SetPadding(w.Handle, left, top, right, bottom) + return w +} + +// 窗口_取布局内填充大小. +// +// pPadding: 返回布局内填充大小. +func (w *windowBase) GetPadding(pPadding *xc.RECT) *windowBase { + xc.XWnd_GetPadding(w.Handle, pPadding) + return w +} + +// 窗口_取布局内填充大小ex. +func (w *windowBase) GetPaddingEx() xc.RECT { + var pPadding *xc.RECT + xc.XWnd_GetPadding(w.Handle, pPadding) + return *pPadding } // 窗口_置拖动边框大小. @@ -429,15 +488,24 @@ func (w *windowBase) SetPadding(left, top, right, bottom int) int { // right: 窗口右边大小. // // bottom: 窗口底边大小. -func (w *windowBase) SetDragBorderSize(left, top, right, bottom int) int { - return xc.XWnd_SetDragBorderSize(w.Handle, left, top, right, bottom) +func (w *windowBase) SetDragBorderSize(left, top, right, bottom int) *windowBase { + xc.XWnd_SetDragBorderSize(w.Handle, left, top, right, bottom) + return w } // 窗口_取拖动边框大小. // // pSize: 拖动边框大小. -func (w *windowBase) GetDragBorderSize(pBorder *xc.RECT) int { - return xc.XWnd_GetDragBorderSize(w.Handle, pBorder) +func (w *windowBase) GetDragBorderSize(pBorder *xc.RECT) *windowBase { + xc.XWnd_GetDragBorderSize(w.Handle, pBorder) + return w +} + +// 窗口_取拖动边框大小ex. +func (w *windowBase) GetDragBorderSizeEx() xc.RECT { + var pBorder *xc.RECT + xc.XWnd_GetDragBorderSize(w.Handle, pBorder) + return *pBorder } // 窗口_置最小大小. @@ -445,11 +513,12 @@ func (w *windowBase) GetDragBorderSize(pBorder *xc.RECT) int { // width: 最小宽度. // // height: 最小高度. -func (w *windowBase) SetMinimumSize(width, height int) int { - return xc.XWnd_SetMinimumSize(w.Handle, width, height) +func (w *windowBase) SetMinimumSize(width, height int) *windowBase { + xc.XWnd_SetMinimumSize(w.Handle, width, height) + return w } -// 窗口_测试点击子元素. +// 窗口_测试点击子元素. 成功则返回元素句柄. // // pPt: 左边点. func (w *windowBase) HitChildEle(pPt *xc.POINT) int { @@ -483,20 +552,23 @@ func (w *windowBase) GetChild(nID int) int { } // 窗口_关闭. -func (w *windowBase) CloseWindow() int { - return xc.XWnd_CloseWindow(w.Handle) +func (w *windowBase) CloseWindow() *windowBase { + xc.XWnd_CloseWindow(w.Handle) + return w } // 窗口_调整布局. -func (w *windowBase) AdjustLayout() int { - return xc.XWnd_AdjustLayout(w.Handle) +func (w *windowBase) AdjustLayout() *windowBase { + xc.XWnd_AdjustLayout(w.Handle) + return w } // 窗口_调整布局扩展. // // nFlags: 调整布局标识位: xcc.AdjustLayout_. -func (w *windowBase) AdjustLayoutEx(nFlags xcc.AdjustLayout_) int { - return xc.XWnd_AdjustLayoutEx(w.Handle, nFlags) +func (w *windowBase) AdjustLayoutEx(nFlags xcc.AdjustLayout_) *windowBase { + xc.XWnd_AdjustLayoutEx(w.Handle, nFlags) + return w } // 窗口_创建插入符. @@ -510,8 +582,9 @@ func (w *windowBase) AdjustLayoutEx(nFlags xcc.AdjustLayout_) int { // width: 宽度. // // height: 高度. -func (w *windowBase) CreateCaret(hEle, x, y, width, height int) int { - return xc.XWnd_CreateCaret(w.Handle, hEle, x, y, width, height) +func (w *windowBase) CreateCaret(hEle, x, y, width, height int) *windowBase { + xc.XWnd_CreateCaret(w.Handle, hEle, x, y, width, height) + return w } // 窗口_置插入符位置, 设置插入符位置. @@ -525,27 +598,31 @@ func (w *windowBase) CreateCaret(hEle, x, y, width, height int) int { // height: 高度. // // bUpdate: 是否立即更新UI. -func (w *windowBase) SetCaretPos(x, y, width, height int, bUpdate bool) int { - return xc.XWnd_SetCaretPos(w.Handle, x, y, width, height, bUpdate) +func (w *windowBase) SetCaretPos(x, y, width, height int, bUpdate bool) *windowBase { + xc.XWnd_SetCaretPos(w.Handle, x, y, width, height, bUpdate) + return w } // 窗口_置插入符颜色. // -// color: 颜色值, ABGR 颜色. -func (w *windowBase) SetCaretColor(color int) int { - return xc.XWnd_SetCaretColor(w.Handle, color) +// color: 颜色值, ARGB 颜色. +func (w *windowBase) SetCaretColor(color int) *windowBase { + xc.XWnd_SetCaretColor(w.Handle, color) + return w } // 窗口_显示插入符. // // bShow: 是否显示. -func (w *windowBase) ShowCaret(bShow bool) int { - return xc.XWnd_ShowCaret(w.Handle, bShow) +func (w *windowBase) ShowCaret(bShow bool) *windowBase { + xc.XWnd_ShowCaret(w.Handle, bShow) + return w } // 窗口_销毁插入符. -func (w *windowBase) DestroyCaret() int { - return xc.XWnd_DestroyCaret(w.Handle) +func (w *windowBase) DestroyCaret() *windowBase { + xc.XWnd_DestroyCaret(w.Handle) + return w } // 窗口_取插入符元素. @@ -560,18 +637,41 @@ func (w *windowBase) GetClientRect(pRect *xc.RECT) int { return xc.XWnd_GetClientRect(w.Handle, pRect) } +// 窗口_取客户区坐标ex. +func (w *windowBase) GetClientRectEx() xc.RECT { + var pRect *xc.RECT + xc.XWnd_GetClientRect(w.Handle, pRect) + return *pRect +} + // 窗口_取Body坐标. // // pRect: 坐标. -func (w *windowBase) GetBodyRect(pRect *xc.RECT) int { - return xc.XWnd_GetBodyRect(w.Handle, pRect) +func (w *windowBase) GetBodyRect(pRect *xc.RECT) *windowBase { + xc.XWnd_GetBodyRect(w.Handle, pRect) + return w +} + +// 窗口_取Body坐标ex. +func (w *windowBase) GetBodyRectEx() xc.RECT { + var pRect *xc.RECT + xc.XWnd_GetBodyRect(w.Handle, pRect) + return *pRect } // 窗口_取布局坐标. // // pRect: 接收返回坐标. -func (w *windowBase) GetLayoutRect(pRect *xc.RECT) int { - return xc.XWnd_GetLayoutRect(w.Handle, pRect) +func (w *windowBase) GetLayoutRect(pRect *xc.RECT) *windowBase { + xc.XWnd_GetLayoutRect(w.Handle, pRect) + return w +} + +// 窗口_取布局坐标ex. +func (w *windowBase) GetLayoutRectEx() xc.RECT { + var pRect *xc.RECT + xc.XWnd_GetLayoutRect(w.Handle, pRect) + return *pRect } // 窗口_移动窗口. @@ -579,22 +679,32 @@ func (w *windowBase) GetLayoutRect(pRect *xc.RECT) int { // x: X坐标. // // y: Y坐标. -func (w *windowBase) SetPosition(x, y int32) { +func (w *windowBase) SetPosition(x, y int32) *windowBase { xc.XWnd_SetPosition(w.Handle, x, y) + return w } // 窗口_取坐标. // // pRect: 坐标. -func (w *windowBase) GetRect(pRect *xc.RECT) int { - return xc.XWnd_GetRect(w.Handle, pRect) +func (w *windowBase) GetRect(pRect *xc.RECT) *windowBase { + xc.XWnd_GetRect(w.Handle, pRect) + return w +} + +// 窗口_取坐标ex. +func (w *windowBase) GetRectEx() xc.RECT { + var pRect *xc.RECT + xc.XWnd_GetRect(w.Handle, pRect) + return *pRect } // 窗口_最大化. // // bMaximize: 是否最大化. -func (w *windowBase) MaxWindow(bMaximize bool) int { - return xc.XWnd_MaxWindow(w.Handle, bMaximize) +func (w *windowBase) MaxWindow(bMaximize bool) *windowBase { + xc.XWnd_MaxWindow(w.Handle, bMaximize) + return w } // 窗口_置定时器. @@ -642,29 +752,33 @@ func (w *windowBase) GetBkManagerEx() int { // 窗口_置背景管理器. // // hBkInfoM: 背景管理器. -func (w *windowBase) SetBkMagager(hBkInfoM int) int { - return xc.XWnd_SetBkMagager(w.Handle, hBkInfoM) +func (w *windowBase) SetBkMagager(hBkInfoM int) *windowBase { + xc.XWnd_SetBkMagager(w.Handle, hBkInfoM) + return w } // 窗口_置透明类型. // // nType: 窗口透明类型: xcc.Window_Transparent_. -func (w *windowBase) SetTransparentType(nType xcc.Window_Transparent_) int { - return xc.XWnd_SetTransparentType(w.Handle, nType) +func (w *windowBase) SetTransparentType(nType xcc.Window_Transparent_) *windowBase { + xc.XWnd_SetTransparentType(w.Handle, nType) + return w } // 窗口_置透明度. // // alpha: 窗口透明度, 范围0-255之间, 0透明, 255不透明. -func (w *windowBase) SetTransparentAlpha(alpha byte) int { - return xc.XWnd_SetTransparentAlpha(w.Handle, alpha) +func (w *windowBase) SetTransparentAlpha(alpha byte) *windowBase { + xc.XWnd_SetTransparentAlpha(w.Handle, alpha) + return w } // 窗口_置透明色. // -// color: 窗口透明色, ABGR 颜色. -func (w *windowBase) SetTransparentColor(color int) int { - return xc.XWnd_SetTransparentColor(w.Handle, color) +// color: 窗口透明色, ARGB 颜色. +func (w *windowBase) SetTransparentColor(color int) *windowBase { + xc.XWnd_SetTransparentColor(w.Handle, color) + return w } // 窗口_置阴影信息. @@ -677,9 +791,10 @@ func (w *windowBase) SetTransparentColor(color int) int { // // bRightAngle: 是否强制直角. // -// color: 阴影颜色, ABGR 颜色. -func (w *windowBase) SetShadowInfo(nSize int, nDepth byte, nAngeleSize int, bRightAngle bool, color int) int { - return xc.XWnd_SetShadowInfo(w.Handle, nSize, nDepth, nAngeleSize, bRightAngle, color) +// color: 阴影颜色, ARGB 颜色. +func (w *windowBase) SetShadowInfo(nSize int, nDepth byte, nAngeleSize int, bRightAngle bool, color int) *windowBase { + xc.XWnd_SetShadowInfo(w.Handle, nSize, nDepth, nAngeleSize, bRightAngle, color) + return w } // 窗口_取阴影信息. @@ -692,9 +807,10 @@ func (w *windowBase) SetShadowInfo(nSize int, nDepth byte, nAngeleSize int, bRig // // pbRightAngle: 是否强制直角. // -// pColor: 阴影颜色, ABGR 颜色. -func (w *windowBase) GetShadowInfo(pnSize, pnDepth, pnAngeleSize *int32, pbRightAngle *bool, pColor *int) int { - return xc.XWnd_GetShadowInfo(w.Handle, pnSize, pnDepth, pnAngeleSize, pbRightAngle, pColor) +// pColor: 阴影颜色, ARGB 颜色. +func (w *windowBase) GetShadowInfo(pnSize, pnDepth, pnAngeleSize *int32, pbRightAngle *bool, pColor *int) *windowBase { + xc.XWnd_GetShadowInfo(w.Handle, pnSize, pnDepth, pnAngeleSize, pbRightAngle, pColor) + return w } // 窗口_取透明类型, 返回: xcc.Window_Transparent_. @@ -705,15 +821,17 @@ func (w *windowBase) GetTransparentType() xcc.Window_Transparent_ { // 窗口_启用拖放文件. // // bEnable: 是否启用. -func (w *windowBase) EnableDragFiles(bEnable bool) bool { - return xc.XWnd_EnableDragFiles(w.Handle, bEnable) +func (w *windowBase) EnableDragFiles(bEnable bool) *windowBase { + xc.XWnd_EnableDragFiles(w.Handle, bEnable) + return w } // 窗口_显示 显示隐藏窗口. // // bShow: 是否显示. -func (w *windowBase) Show(bShow bool) int { - return xc.XWnd_Show(w.Handle, bShow) +func (w *windowBase) Show(bShow bool) *windowBase { + xc.XWnd_Show(w.Handle, bShow) + return w } // 窗口_取插入符信息, 获取插入符信息, 返回: 插入符元素句柄. @@ -734,22 +852,25 @@ func (w *windowBase) GetCaretInfo(pX, pY, pWidth, pHeight *int32) int { // 窗口_置图标. // // hImage: 图标句柄. -func (w *windowBase) SetIcon(hImage int) int { - return xc.XWnd_SetIcon(w.Handle, hImage) +func (w *windowBase) SetIcon(hImage int) *windowBase { + xc.XWnd_SetIcon(w.Handle, hImage) + return w } // 窗口_置标题. // // pTitle: 标题文本. -func (w *windowBase) SetTitle(pTitle string) int { - return xc.XWnd_SetTitle(w.Handle, pTitle) +func (w *windowBase) SetTitle(pTitle string) *windowBase { + xc.XWnd_SetTitle(w.Handle, pTitle) + return w } // 窗口_置标题颜色. // -// color: ABGR 颜色. -func (w *windowBase) SetTitleColor(color int) int { - return xc.XWnd_SetTitleColor(w.Handle, color) +// color: ARGB 颜色. +func (w *windowBase) SetTitleColor(color int) *windowBase { + xc.XWnd_SetTitleColor(w.Handle, color) + return w } // 窗口_取控制按钮, 返回按钮句柄. @@ -769,7 +890,7 @@ func (w *windowBase) GetTitle() string { return xc.XWnd_GetTitle(w.Handle) } -// 窗口_取标题颜色, 返回ABGR 颜色. +// 窗口_取标题颜色, 返回ARGB 颜色. func (w *windowBase) GetTitleColor() int { return xc.XWnd_GetTitleColor(w.Handle) } @@ -778,20 +899,22 @@ func (w *windowBase) GetTitleColor() int { // // nState: 组合状态. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // width: 线宽. -func (w *windowBase) AddBkBorder(nState xcc.Window_State_Flag_, color int, width int) int { - return xc.XWnd_AddBkBorder(w.Handle, nState, color, width) +func (w *windowBase) AddBkBorder(nState xcc.Window_State_Flag_, color int, width int) *windowBase { + xc.XWnd_AddBkBorder(w.Handle, nState, color, width) + return w } // 窗口_添加背景填充. // // nState: 组合状态. // -// color: ABGR 颜色. -func (w *windowBase) AddBkFill(nState xcc.Window_State_Flag_, color int) int { - return xc.XWnd_AddBkFill(w.Handle, nState, color) +// color: ARGB 颜色. +func (w *windowBase) AddBkFill(nState xcc.Window_State_Flag_, color int) *windowBase { + xc.XWnd_AddBkFill(w.Handle, nState, color) + return w } // 窗口_添加背景图片. @@ -799,8 +922,9 @@ func (w *windowBase) AddBkFill(nState xcc.Window_State_Flag_, color int) int { // nState: 组合状态. // // hImage: 图片句柄. -func (w *windowBase) AddBkImage(nState xcc.Window_State_Flag_, hImage int) int { - return xc.XWnd_AddBkImage(w.Handle, nState, hImage) +func (w *windowBase) AddBkImage(nState xcc.Window_State_Flag_, hImage int) *windowBase { + xc.XWnd_AddBkImage(w.Handle, nState, hImage) + return w } // 窗口_取背景对象数量. @@ -809,8 +933,9 @@ func (w *windowBase) GetBkInfoCount() int { } // 窗口_清空背景对象. -func (w *windowBase) ClearBkInfo() int { - return xc.XWnd_ClearBkInfo(w.Handle) +func (w *windowBase) ClearBkInfo() *windowBase { + xc.XWnd_ClearBkInfo(w.Handle) + return w } // 通知消息_窗口中弹出, 使用基础元素作为面板, 弹出一个通知消息, 返回元素句柄, 通过此句柄可对其操作. @@ -936,8 +1061,9 @@ func (w *windowBase) IsDragBorder() bool { // right: 右边间距. // // bottom: 下边间距. -func (w *windowBase) SetCaptionMargin(left int, top int, right int, bottom int) int { - return xc.XWnd_SetCaptionMargin(w.Handle, left, top, right, bottom) +func (w *windowBase) SetCaptionMargin(left int, top int, right int, bottom int) *windowBase { + xc.XWnd_SetCaptionMargin(w.Handle, left, top, right, bottom) + return w } // SetTopEx 窗口_置顶Ex. @@ -973,15 +1099,17 @@ func (w *windowBase) GetDPI() int { // 窗口_坐标转换DPI. 窗口客户区坐标转换到缩放后DPI坐标. // // pRect: 接收返回坐标. -func (w *windowBase) RectToDPI(pRect *xc.RECT) int { - return xc.XWnd_RectToDPI(w.Handle, pRect) +func (w *windowBase) RectToDPI(pRect *xc.RECT) *windowBase { + xc.XWnd_RectToDPI(w.Handle, pRect) + return w } // 窗口_坐标点转换DPI. 窗口客户区坐标点转换到缩放后. // // pPt: 接收返回坐标点. -func (w *windowBase) PointToDPI(pPt *xc.POINT) int { - return xc.XWnd_PointToDPI(w.Handle, pPt) +func (w *windowBase) PointToDPI(pPt *xc.POINT) *windowBase { + xc.XWnd_PointToDPI(w.Handle, pPt) + return w } // 窗口_取光标位置. 封装的系统API: GetCursorPos(), 内部做了DPI适配. @@ -1008,8 +1136,9 @@ func (w *windowBase) ScreenToClient(pPt *xc.POINT) bool { // 窗口_置DPI. 设置当前窗口DPI, 默认DPI为96. // // nDPI: DPI值. -func (w *windowBase) SetDPI(nDPI int) int { - return xc.XWnd_SetDPI(w.Handle, nDPI) +func (w *windowBase) SetDPI(nDPI int) *windowBase { + xc.XWnd_SetDPI(w.Handle, nDPI) + return w } // 窗口_置大小. 设置窗口宽高. @@ -1017,32 +1146,32 @@ func (w *windowBase) SetDPI(nDPI int) int { // 宽: width. // // 高: height. -func (w *windowBase) SetSize(width, height int32) bool { +func (w *windowBase) SetSize(width, height int32) { var rc xc.RECT xc.XWnd_GetRect(w.Handle, &rc) rc.Right = rc.Left + width rc.Bottom = rc.Top + height - return xc.XWnd_SetRect(w.Handle, &rc) + xc.XWnd_SetRect(w.Handle, &rc) } // 窗口_置宽度. // // 宽: width. -func (w *windowBase) SetWidth(width int32) bool { +func (w *windowBase) SetWidth(width int32) { var rc xc.RECT xc.XWnd_GetRect(w.Handle, &rc) rc.Right = rc.Left + width - return xc.XWnd_SetRect(w.Handle, &rc) + xc.XWnd_SetRect(w.Handle, &rc) } // 窗口_置高度. // // 高: height. -func (w *windowBase) SetHeight(height int32) bool { +func (w *windowBase) SetHeight(height int32) { var rc xc.RECT xc.XWnd_GetRect(w.Handle, &rc) rc.Bottom = rc.Top + height - return xc.XWnd_SetRect(w.Handle, &rc) + xc.XWnd_SetRect(w.Handle, &rc) } // 窗口_取宽度. @@ -1090,15 +1219,17 @@ func (w *windowBase) GetBottom() int32 { // 窗口_置左边. // // x: 左边x坐标. -func (w *windowBase) SetLeft(x int32) { +func (w *windowBase) SetLeft(x int32) *windowBase { xc.XWnd_SetPosition(w.Handle, x, w.GetTop()) + return w } // 窗口_置顶边. // // y: 顶边y坐标. -func (w *windowBase) SetTopEdge(y int32) { +func (w *windowBase) SetTopEdge(y int32) *windowBase { xc.XWnd_SetPosition(w.Handle, w.GetLeft(), y) + return w } /* diff --git a/xc/adapter.go b/xc/adapter.go index 409e886..d0f3a76 100644 --- a/xc/adapter.go +++ b/xc/adapter.go @@ -5,33 +5,32 @@ import "github.com/twgh/xcgui/common" // 数据适配器_增加引用计数. // // hAdapter: 数据适配器句柄. -func XAd_AddRef(hAdapter int) int { +func XAd_AddRef(hAdapter int) int32 { r, _, _ := xAd_AddRef.Call(uintptr(hAdapter)) - return int(r) + return int32(r) } // 数据适配器_释放引用计数. // // hAdapter: 数据适配器句柄. -func XAd_Release(hAdapter int) int { +func XAd_Release(hAdapter int) int32 { r, _, _ := xAd_Release.Call(uintptr(hAdapter)) - return int(r) + return int32(r) } // 数据适配器_取引用计数. // // hAdapter: 数据适配器句柄. -func XAd_GetRefCount(hAdapter int) int { +func XAd_GetRefCount(hAdapter int) int32 { r, _, _ := xAd_GetRefCount.Call(uintptr(hAdapter)) - return int(r) + return int32(r) } // 数据适配器_销毁. // // hAdapter: 数据适配器句柄. -func XAd_Destroy(hAdapter int) int { - r, _, _ := xAd_Destroy.Call(uintptr(hAdapter)) - return int(r) +func XAd_Destroy(hAdapter int) { + xAd_Destroy.Call(uintptr(hAdapter)) } // 数据适配器_启用自动销毁. @@ -39,7 +38,6 @@ func XAd_Destroy(hAdapter int) int { // hAdapter: 数据适配器句柄. // // bEnable: 是否启用. -func XAd_EnableAutoDestroy(hAdapter int, bEnable bool) int { - r, _, _ := xAd_EnableAutoDestroy.Call(uintptr(hAdapter), common.BoolPtr(bEnable)) - return int(r) +func XAd_EnableAutoDestroy(hAdapter int, bEnable bool) { + xAd_EnableAutoDestroy.Call(uintptr(hAdapter), common.BoolPtr(bEnable)) } diff --git a/xc/adapterlistview.go b/xc/adapterlistview.go index e8f755f..fcc47ca 100644 --- a/xc/adapterlistview.go +++ b/xc/adapterlistview.go @@ -13,9 +13,9 @@ func XAdListView_Create() int { // hAdapter: 数据适配器句柄. // // pName: 字段称. -func XAdListView_Group_AddColumn(hAdapter int, pName string) int { +func XAdListView_Group_AddColumn(hAdapter int, pName string) int32 { r, _, _ := xAdListView_Group_AddColumn.Call(uintptr(hAdapter), common.StrPtr(pName)) - return int(r) + return int32(r) } // 数据适配器列表视_添加组文本, 组操作, 添加组, 数据默认填充到第一列, 返回组索引. @@ -25,9 +25,9 @@ func XAdListView_Group_AddColumn(hAdapter int, pName string) int { // pValue: 值. // // iPos: 插入位置, 可为-1. -func XAdListView_Group_AddItemText(hAdapter int, pValue string, iPos int) int { +func XAdListView_Group_AddItemText(hAdapter int, pValue string, iPos int32) int32 { r, _, _ := xAdListView_Group_AddItemText.Call(uintptr(hAdapter), common.StrPtr(pValue), uintptr(iPos)) - return int(r) + return int32(r) } // 数据适配器列表视_添加组文本扩展, 组操作, 添加组, 数据填充指定列, 返回组索引. @@ -39,9 +39,9 @@ func XAdListView_Group_AddItemText(hAdapter int, pValue string, iPos int) int { // pValue: 值. // // iPos: 插入位置, 可为-1. -func XAdListView_Group_AddItemTextEx(hAdapter int, pName string, pValue string, iPos int) int { +func XAdListView_Group_AddItemTextEx(hAdapter int, pName string, pValue string, iPos int32) int32 { r, _, _ := xAdListView_Group_AddItemTextEx.Call(uintptr(hAdapter), common.StrPtr(pName), common.StrPtr(pValue), uintptr(iPos)) - return int(r) + return int32(r) } // 数据适配器列表视_添加组图片, 组操作, 添加组, 数据默认填充第一列. @@ -51,9 +51,9 @@ func XAdListView_Group_AddItemTextEx(hAdapter int, pName string, pValue string, // hImage: 图片句柄. // // iPos: 插入位置, 可为-1. -func XAdListView_Group_AddItemImage(hAdapter int, hImage int, iPos int) int { +func XAdListView_Group_AddItemImage(hAdapter int, hImage int, iPos int32) int32 { r, _, _ := xAdListView_Group_AddItemImage.Call(uintptr(hAdapter), uintptr(hImage), uintptr(iPos)) - return int(r) + return int32(r) } // 数据适配器列表视_添加组图片扩展, 组操作, 添加组, 数据填充指定列. @@ -65,9 +65,9 @@ func XAdListView_Group_AddItemImage(hAdapter int, hImage int, iPos int) int { // hImage: 图片句柄. // // iPos: 插入位置, 可为-1. -func XAdListView_Group_AddItemImageEx(hAdapter int, pName string, hImage int, iPos int) int { +func XAdListView_Group_AddItemImageEx(hAdapter int, pName string, hImage int, iPos int32) int32 { r, _, _ := xAdListView_Group_AddItemImageEx.Call(uintptr(hAdapter), common.StrPtr(pName), uintptr(hImage), uintptr(iPos)) - return int(r) + return int32(r) } // 数据适配器列表视_组设置文本, 组操作, 设置指定项数据. @@ -79,7 +79,7 @@ func XAdListView_Group_AddItemImageEx(hAdapter int, pName string, hImage int, iP // iColumn: 列索引. // // pValue: 值. -func XAdListView_Group_SetText(hAdapter int, iGroup int, iColumn int, pValue string) bool { +func XAdListView_Group_SetText(hAdapter int, iGroup, iColumn int32, pValue string) bool { r, _, _ := xAdListView_Group_SetText.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(iColumn), common.StrPtr(pValue)) return r != 0 } @@ -93,7 +93,7 @@ func XAdListView_Group_SetText(hAdapter int, iGroup int, iColumn int, pValue str // pName: 字段名. // // pValue: 值. -func XAdListView_Group_SetTextEx(hAdapter int, iGroup int, pName string, pValue string) bool { +func XAdListView_Group_SetTextEx(hAdapter int, iGroup int32, pName string, pValue string) bool { r, _, _ := xAdListView_Group_SetTextEx.Call(uintptr(hAdapter), uintptr(iGroup), common.StrPtr(pName), common.StrPtr(pValue)) return r != 0 } @@ -107,7 +107,7 @@ func XAdListView_Group_SetTextEx(hAdapter int, iGroup int, pName string, pValue // iColumn: 列索引. // // hImage: 图片句柄. -func XAdListView_Group_SetImage(hAdapter int, iGroup int, iColumn int, hImage int) bool { +func XAdListView_Group_SetImage(hAdapter int, iGroup, iColumn int32, hImage int) bool { r, _, _ := xAdListView_Group_SetImage.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(iColumn), uintptr(hImage)) return r != 0 } @@ -121,7 +121,7 @@ func XAdListView_Group_SetImage(hAdapter int, iGroup int, iColumn int, hImage in // pName: 字段名. // // hImage: 图片句柄. -func XAdListView_Group_SetImageEx(hAdapter int, iGroup int, pName string, hImage int) bool { +func XAdListView_Group_SetImageEx(hAdapter int, iGroup int32, pName string, hImage int) bool { r, _, _ := xAdListView_Group_SetImageEx.Call(uintptr(hAdapter), uintptr(iGroup), common.StrPtr(pName), uintptr(hImage)) return r != 0 } @@ -131,17 +131,17 @@ func XAdListView_Group_SetImageEx(hAdapter int, iGroup int, pName string, hImage // hAdapter: 数据适配器句柄. // // pName: 字段称. -func XAdListView_Item_AddColumn(hAdapter int, pName string) int { +func XAdListView_Item_AddColumn(hAdapter int, pName string) int32 { r, _, _ := xAdListView_Item_AddColumn.Call(uintptr(hAdapter), common.StrPtr(pName)) - return int(r) + return int32(r) } // 数据适配器列表视_取组数量, 组操作, 获取组数量. // // hAdapter: 数据适配器句柄. -func XAdListView_Group_GetCount(hAdapter int) int { +func XAdListView_Group_GetCount(hAdapter int) int32 { r, _, _ := xAdListView_Group_GetCount.Call(uintptr(hAdapter)) - return int(r) + return int32(r) } // 数据适配器列表视_取组中项数量, 项操作, 获取指定组中项数量. @@ -149,9 +149,9 @@ func XAdListView_Group_GetCount(hAdapter int) int { // hAdapter: 数据适配器句柄. // // iGroup: 组索引. -func XAdListView_Item_GetCount(hAdapter int, iGroup int) int { +func XAdListView_Item_GetCount(hAdapter int, iGroup int32) int32 { r, _, _ := xAdListView_Item_GetCount.Call(uintptr(hAdapter), uintptr(iGroup)) - return int(r) + return int32(r) } // 数据适配器列表视_添加项文本, 项操作, 添加项. @@ -163,9 +163,9 @@ func XAdListView_Item_GetCount(hAdapter int, iGroup int) int { // pValue: 值. // // iPos: 插入位置, 可为-1. -func XAdListView_Item_AddItemText(hAdapter int, iGroup int, pValue string, iPos int) int { +func XAdListView_Item_AddItemText(hAdapter int, iGroup int32, pValue string, iPos int32) int32 { r, _, _ := xAdListView_Item_AddItemText.Call(uintptr(hAdapter), uintptr(iGroup), common.StrPtr(pValue), uintptr(iPos)) - return int(r) + return int32(r) } // 数据适配器列表视_添加项文本扩展, 项操作, 添加项, 数据填充指定列. @@ -179,9 +179,9 @@ func XAdListView_Item_AddItemText(hAdapter int, iGroup int, pValue string, iPos // pValue: 值. // // iPos: 插入位置, 可为-1. -func XAdListView_Item_AddItemTextEx(hAdapter int, iGroup int, pName string, pValue string, iPos int) int { +func XAdListView_Item_AddItemTextEx(hAdapter int, iGroup int32, pName string, pValue string, iPos int32) int32 { r, _, _ := xAdListView_Item_AddItemTextEx.Call(uintptr(hAdapter), uintptr(iGroup), common.StrPtr(pName), common.StrPtr(pValue), uintptr(iPos)) - return int(r) + return int32(r) } // 数据适配器列表视_添加项图片, 项操作, 添加项. @@ -193,9 +193,9 @@ func XAdListView_Item_AddItemTextEx(hAdapter int, iGroup int, pName string, pVal // hImage: 图片句柄. // // iPos: 插入位置, 可为-1. -func XAdListView_Item_AddItemImage(hAdapter int, iGroup int, hImage int, iPos int) int { +func XAdListView_Item_AddItemImage(hAdapter int, iGroup int32, hImage int, iPos int32) int32 { r, _, _ := xAdListView_Item_AddItemImage.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(hImage), uintptr(iPos)) - return int(r) + return int32(r) } // 数据适配器列表视_添加项图片扩展, 项操作, 添加项, 填充指定列数据. @@ -209,9 +209,9 @@ func XAdListView_Item_AddItemImage(hAdapter int, iGroup int, hImage int, iPos in // hImage: 图片句柄. // // iPos: 插入位置, 可为-1. -func XAdListView_Item_AddItemImageEx(hAdapter int, iGroup int, pName string, hImage int, iPos int) int { +func XAdListView_Item_AddItemImageEx(hAdapter int, iGroup int32, pName string, hImage int, iPos int32) int32 { r, _, _ := xAdListView_Item_AddItemImageEx.Call(uintptr(hAdapter), uintptr(iGroup), common.StrPtr(pName), uintptr(hImage), uintptr(iPos)) - return int(r) + return int32(r) } // 数据适配器列表视_组删除项, 删除组, 自动删除子项. @@ -219,7 +219,7 @@ func XAdListView_Item_AddItemImageEx(hAdapter int, iGroup int, pName string, hIm // hAdapter: 数据适配器句柄. // // iGroup: 组索引. -func XAdListView_Group_DeleteItem(hAdapter int, iGroup int) bool { +func XAdListView_Group_DeleteItem(hAdapter int, iGroup int32) bool { r, _, _ := xAdListView_Group_DeleteItem.Call(uintptr(hAdapter), uintptr(iGroup)) return r != 0 } @@ -229,9 +229,8 @@ func XAdListView_Group_DeleteItem(hAdapter int, iGroup int) bool { // hAdapter: 数据适配器句柄. // // iGroup: 组索引. -func XAdListView_Group_DeleteAllChildItem(hAdapter int, iGroup int) int { - r, _, _ := xAdListView_Group_DeleteAllChildItem.Call(uintptr(hAdapter), uintptr(iGroup)) - return int(r) +func XAdListView_Group_DeleteAllChildItem(hAdapter int, iGroup int32) { + xAdListView_Group_DeleteAllChildItem.Call(uintptr(hAdapter), uintptr(iGroup)) } // 数据适配器列表视_删除项, 删除项. @@ -241,7 +240,7 @@ func XAdListView_Group_DeleteAllChildItem(hAdapter int, iGroup int) int { // iGroup: 组索引. // // iItem: 项索引. -func XAdListView_Item_DeleteItem(hAdapter int, iGroup int, iItem int) bool { +func XAdListView_Item_DeleteItem(hAdapter int, iGroup, iItem int32) bool { r, _, _ := xAdListView_Item_DeleteItem.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(iItem)) return r != 0 } @@ -249,25 +248,22 @@ func XAdListView_Item_DeleteItem(hAdapter int, iGroup int, iItem int) bool { // 数据适配器列表视_删除全部, 删除所有(组,项,列). // // hAdapter: 数据适配器句柄. -func XAdListView_DeleteAll(hAdapter int) int { - r, _, _ := xAdListView_DeleteAll.Call(uintptr(hAdapter)) - return int(r) +func XAdListView_DeleteAll(hAdapter int) { + xAdListView_DeleteAll.Call(uintptr(hAdapter)) } // 数据适配器列表视_删除全部组, 删除所有的组. // // hAdapter: 数据适配器句柄. -func XAdListView_DeleteAllGroup(hAdapter int) int { - r, _, _ := xAdListView_DeleteAllGroup.Call(uintptr(hAdapter)) - return int(r) +func XAdListView_DeleteAllGroup(hAdapter int) { + xAdListView_DeleteAllGroup.Call(uintptr(hAdapter)) } // 数据适配器列表视_删除全部项, 删除所有的项. // // hAdapter: 数据适配器句柄. -func XAdListView_DeleteAllItem(hAdapter int) int { - r, _, _ := xAdListView_DeleteAllItem.Call(uintptr(hAdapter)) - return int(r) +func XAdListView_DeleteAllItem(hAdapter int) { + xAdListView_DeleteAllItem.Call(uintptr(hAdapter)) } // 数据适配器列表视_组删除列, 删除组的列. @@ -275,9 +271,8 @@ func XAdListView_DeleteAllItem(hAdapter int) int { // hAdapter: 数据适配器句柄. // // iColumn: 列索引. -func XAdListView_DeleteColumnGroup(hAdapter int, iColumn int) int { - r, _, _ := xAdListView_DeleteColumnGroup.Call(uintptr(hAdapter), uintptr(iColumn)) - return int(r) +func XAdListView_DeleteColumnGroup(hAdapter int, iColumn int32) { + xAdListView_DeleteColumnGroup.Call(uintptr(hAdapter), uintptr(iColumn)) } // 数据适配器列表视_项删除列, 删除项的列. @@ -285,9 +280,8 @@ func XAdListView_DeleteColumnGroup(hAdapter int, iColumn int) int { // hAdapter: 数据适配器句柄. // // iColumn: 列索引. -func XAdListView_DeleteColumnItem(hAdapter int, iColumn int) int { - r, _, _ := xAdListView_DeleteColumnItem.Call(uintptr(hAdapter), uintptr(iColumn)) - return int(r) +func XAdListView_DeleteColumnItem(hAdapter int, iColumn int32) { + xAdListView_DeleteColumnItem.Call(uintptr(hAdapter), uintptr(iColumn)) } // 数据适配器列表视_项获取文本扩展, 项操作, 获取项文本内容. @@ -299,7 +293,7 @@ func XAdListView_DeleteColumnItem(hAdapter int, iColumn int) int { // iItem: 项索引. // // pName: 字段称. -func XAdListView_Item_GetTextEx(hAdapter int, iGroup int, iItem int, pName string) string { +func XAdListView_Item_GetTextEx(hAdapter int, iGroup, iItem int32, pName string) string { r, _, _ := xAdListView_Item_GetTextEx.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(iItem), common.StrPtr(pName)) return common.UintPtrToString(r) } @@ -313,7 +307,7 @@ func XAdListView_Item_GetTextEx(hAdapter int, iGroup int, iItem int, pName strin // iItem: 项索引. // // pName: 字段称. -func XAdListView_Item_GetImageEx(hAdapter int, iGroup int, iItem int, pName string) int { +func XAdListView_Item_GetImageEx(hAdapter int, iGroup, iItem int32, pName string) int { r, _, _ := xAdListView_Item_GetImageEx.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(iItem), common.StrPtr(pName)) return int(r) } @@ -329,7 +323,7 @@ func XAdListView_Item_GetImageEx(hAdapter int, iGroup int, iItem int, pName stri // iColumn: 列索引. // // pValue: 值. -func XAdListView_Item_SetText(hAdapter int, iGroup int, iItem int, iColumn int, pValue string) bool { +func XAdListView_Item_SetText(hAdapter int, iGroup, iItem, iColumn int32, pValue string) bool { r, _, _ := xAdListView_Item_SetText.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(iItem), uintptr(iColumn), common.StrPtr(pValue)) return r != 0 } @@ -345,7 +339,7 @@ func XAdListView_Item_SetText(hAdapter int, iGroup int, iItem int, iColumn int, // pName: 字段称. // // pValue: 值. -func XAdListView_Item_SetTextEx(hAdapter int, iGroup int, iItem int, pName string, pValue string) bool { +func XAdListView_Item_SetTextEx(hAdapter int, iGroup, iItem int32, pName string, pValue string) bool { r, _, _ := xAdListView_Item_SetTextEx.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(iItem), common.StrPtr(pName), common.StrPtr(pValue)) return r != 0 } @@ -361,7 +355,7 @@ func XAdListView_Item_SetTextEx(hAdapter int, iGroup int, iItem int, pName strin // iColumn: 列索引. // // hImage: 图片句柄. -func XAdListView_Item_SetImage(hAdapter int, iGroup int, iItem int, iColumn int, hImage int) bool { +func XAdListView_Item_SetImage(hAdapter int, iGroup, iItem, iColumn int32, hImage int) bool { r, _, _ := xAdListView_Item_SetImage.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(iItem), uintptr(iColumn), uintptr(hImage)) return r != 0 } @@ -377,7 +371,7 @@ func XAdListView_Item_SetImage(hAdapter int, iGroup int, iItem int, iColumn int, // pName: 字段称. // // hImage: 图片句柄. -func XAdListView_Item_SetImageEx(hAdapter int, iGroup int, iItem int, pName string, hImage int) bool { +func XAdListView_Item_SetImageEx(hAdapter int, iGroup, iItem int32, pName string, hImage int) bool { r, _, _ := xAdListView_Item_SetImageEx.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(iItem), common.StrPtr(pName), uintptr(hImage)) return r != 0 } @@ -389,7 +383,7 @@ func XAdListView_Item_SetImageEx(hAdapter int, iGroup int, iItem int, pName stri // iGroup: 组索引. // // iColumn: 列索引. -func XAdListView_Group_GetText(hAdapter int, iGroup int, iColumn int) string { +func XAdListView_Group_GetText(hAdapter int, iGroup, iColumn int32) string { r, _, _ := xAdListView_Group_GetText.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(iColumn)) return common.UintPtrToString(r) } @@ -401,7 +395,7 @@ func XAdListView_Group_GetText(hAdapter int, iGroup int, iColumn int) string { // iGroup: 组索引. // // pName: 字段名称. -func XAdListView_Group_GetTextEx(hAdapter int, iGroup int, pName string) string { +func XAdListView_Group_GetTextEx(hAdapter int, iGroup int32, pName string) string { r, _, _ := xAdListView_Group_GetTextEx.Call(uintptr(hAdapter), uintptr(iGroup), common.StrPtr(pName)) return common.UintPtrToString(r) } @@ -413,7 +407,7 @@ func XAdListView_Group_GetTextEx(hAdapter int, iGroup int, pName string) string // iGroup: 组索引. // // iColumn: 列索引. -func XAdListView_Group_GetImage(hAdapter int, iGroup int, iColumn int) int { +func XAdListView_Group_GetImage(hAdapter int, iGroup, iColumn int32) int { r, _, _ := xAdListView_Group_GetImage.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(iColumn)) return int(r) } @@ -425,7 +419,7 @@ func XAdListView_Group_GetImage(hAdapter int, iGroup int, iColumn int) int { // iGroup: 组索引. // // pName: 字段名称. -func XAdListView_Group_GetImageEx(hAdapter int, iGroup int, pName string) int { +func XAdListView_Group_GetImageEx(hAdapter int, iGroup int32, pName string) int { r, _, _ := xAdListView_Group_GetImageEx.Call(uintptr(hAdapter), uintptr(iGroup), common.StrPtr(pName)) return int(r) } @@ -439,7 +433,7 @@ func XAdListView_Group_GetImageEx(hAdapter int, iGroup int, pName string) int { // iItem: 项索引. // // iColumn: 列索引. -func XAdListView_Item_GetText(hAdapter int, iGroup int, iItem int, iColumn int) string { +func XAdListView_Item_GetText(hAdapter int, iGroup, iItem, iColumn int32) string { r, _, _ := xAdListView_Item_GetText.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(iItem), uintptr(iColumn)) return common.UintPtrToString(r) } @@ -452,8 +446,8 @@ func XAdListView_Item_GetText(hAdapter int, iGroup int, iItem int, iColumn int) // // iItem: 项索引. // -// iColumn: 列索引. -func XAdListView_Item_GetImage(hAdapter int, iGroup int, iItem int, iColumn int) int { - r, _, _ := xAdListView_Item_GetImage.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(iItem), uintptr(iColumn)) +// pName: 字段名称. +func XAdListView_Item_GetImage(hAdapter int, iGroup, iItem int32, pName string) int { + r, _, _ := xAdListView_Item_GetImage.Call(uintptr(hAdapter), uintptr(iGroup), uintptr(iItem), common.StrPtr(pName)) return int(r) } diff --git a/xc/adaptermap.go b/xc/adaptermap.go index 9c22b84..9810872 100644 --- a/xc/adaptermap.go +++ b/xc/adaptermap.go @@ -45,9 +45,9 @@ func XAdMap_DeleteItem(hAdapter int, pName string) bool { // 数据适配器MAP_取项数量, 返回项数量. // // hAdapter: 数据适配器句柄. -func XAdMap_GetCount(hAdapter int) int { +func XAdMap_GetCount(hAdapter int) int32 { r, _, _ := xAdMap_GetCount.Call(uintptr(hAdapter)) - return int(r) + return int32(r) } // 数据适配器MAP_取项文本, 获取项内容, 如果内容为文本. diff --git a/xc/adaptertable.go b/xc/adaptertable.go index beabe33..6b06284 100644 --- a/xc/adaptertable.go +++ b/xc/adaptertable.go @@ -20,9 +20,8 @@ func XAdTable_Create() int { // iColumn: 要排序的列索引。. // // bAscending: 是否按照升序方式排序. -func XAdTable_Sort(hAdapter int, iColumn int, bAscending bool) int { - r, _, _ := xAdTable_Sort.Call(uintptr(hAdapter), uintptr(iColumn), common.BoolPtr(bAscending)) - return int(r) +func XAdTable_Sort(hAdapter int, iColumn int32, bAscending bool) { + xAdTable_Sort.Call(uintptr(hAdapter), uintptr(iColumn), common.BoolPtr(bAscending)) } // 数据适配器表_取项数据类型, 获取项数据类型, 返回: Adapter_Date_Type_. @@ -32,7 +31,7 @@ func XAdTable_Sort(hAdapter int, iColumn int, bAscending bool) int { // iItem: 项索引. // // iColumn: 列索引. -func XAdTable_GetItemDataType(hAdapter int, iItem int, iColumn int) xcc.Adapter_Date_Type_ { +func XAdTable_GetItemDataType(hAdapter int, iItem, iColumn int32) xcc.Adapter_Date_Type_ { r, _, _ := xAdTable_GetItemDataType.Call(uintptr(hAdapter), uintptr(iItem), uintptr(iColumn)) return xcc.Adapter_Date_Type_(r) } @@ -44,7 +43,7 @@ func XAdTable_GetItemDataType(hAdapter int, iItem int, iColumn int) xcc.Adapter_ // iItem: 项索引. // // pName: 字段称. -func XAdTable_GetItemDataTypeEx(hAdapter int, iItem int, pName string) xcc.Adapter_Date_Type_ { +func XAdTable_GetItemDataTypeEx(hAdapter int, iItem int32, pName string) xcc.Adapter_Date_Type_ { r, _, _ := xAdTable_GetItemDataTypeEx.Call(uintptr(hAdapter), uintptr(iItem), common.StrPtr(pName)) return xcc.Adapter_Date_Type_(r) } @@ -54,9 +53,9 @@ func XAdTable_GetItemDataTypeEx(hAdapter int, iItem int, pName string) xcc.Adapt // hAdapter: 数据适配器句柄. // // pName: 字段称. -func XAdTable_AddColumn(hAdapter int, pName string) int { +func XAdTable_AddColumn(hAdapter int, pName string) int32 { r, _, _ := xAdTable_AddColumn.Call(uintptr(hAdapter), common.StrPtr(pName)) - return int(r) + return int32(r) } // 数据适配器表_置列, 设置列, 返回列数量. @@ -64,105 +63,105 @@ func XAdTable_AddColumn(hAdapter int, pName string) int { // hAdapter: 数据适配器句柄. // // pColName: 列名, 多个列名用逗号分开. -func XAdTable_SetColumn(hAdapter int, pColName string) int { +func XAdTable_SetColumn(hAdapter int, pColName string) int32 { r, _, _ := xAdTable_SetColumn.Call(uintptr(hAdapter), common.StrPtr(pColName)) - return int(r) + return int32(r) } -// 数据适配器表_添加项文本, 添加数据项, 默认值放到第一列, 返回项索引值. +// 数据适配器表_添加行文本, 添加数据行, 默认值放到第一列, 返回行索引值. // // hAdapter: 数据适配器句柄. // // pValue: 值. -func XAdTable_AddItemText(hAdapter int, pValue string) int { - r, _, _ := xAdTable_AddItemText.Call(uintptr(hAdapter), common.StrPtr(pValue)) - return int(r) +func XAdTable_AddRowText(hAdapter int, pValue string) int32 { + r, _, _ := xAdTable_AddRowText.Call(uintptr(hAdapter), common.StrPtr(pValue)) + return int32(r) } -// 数据适配器表_添加项文本扩展, 添加数据项, 填充指定列数据, 返回项索引. +// 数据适配器表_添加行文本扩展, 添加数据行, 填充指定列数据, 返回行索引. // // hAdapter: 数据适配器句柄. // // pName: 字段称. // // pValue: 值. -func XAdTable_AddItemTextEx(hAdapter int, pName string, pValue string) int { - r, _, _ := xAdTable_AddItemTextEx.Call(uintptr(hAdapter), common.StrPtr(pName), common.StrPtr(pValue)) - return int(r) +func XAdTable_AddRowTextEx(hAdapter int, pName string, pValue string) int32 { + r, _, _ := xAdTable_AddRowTextEx.Call(uintptr(hAdapter), common.StrPtr(pName), common.StrPtr(pValue)) + return int32(r) } -// 数据适配器表_添加项图片, 添加数据项, 默认值放到第一列, 返回项索引值. +// 数据适配器表_添加行图片, 添加数据行, 默认值放到第一列, 返回行索引值. // // hAdapter: 数据适配器句柄. // // hImage: 图片句柄. -func XAdTable_AddItemImage(hAdapter int, hImage int) int { - r, _, _ := xAdTable_AddItemImage.Call(uintptr(hAdapter), uintptr(hImage)) - return int(r) +func XAdTable_AddRowImage(hAdapter int, hImage int) int32 { + r, _, _ := xAdTable_AddRowImage.Call(uintptr(hAdapter), uintptr(hImage)) + return int32(r) } -// 数据适配器表_添加项图片扩展, 添加数据项, 并填充指定列数据. +// 数据适配器表_添加行图片扩展, 添加数据行, 并填充指定列数据. // // hAdapter: 数据适配器句柄. // // pName: 字段称. // // hImage: 图片句柄. -func XAdTable_AddItemImageEx(hAdapter int, pName string, hImage int) int { - r, _, _ := xAdTable_AddItemImageEx.Call(uintptr(hAdapter), common.StrPtr(pName), uintptr(hImage)) - return int(r) +func XAdTable_AddRowImageEx(hAdapter int, pName string, hImage int) int32 { + r, _, _ := xAdTable_AddRowImageEx.Call(uintptr(hAdapter), common.StrPtr(pName), uintptr(hImage)) + return int32(r) } -// 数据适配器表_插入项文本, 插入数据项, 填充第一列数据, 返回项索引. +// 数据适配器表_插入行文本, 插入数据行, 填充第一列数据, 返回行索引. // // hAdapter: 数据适配器句柄. // -// iItem: 插入位置索引. +// iRow: 插入位置索引. // // pValue: 值. -func XAdTable_InsertItemText(hAdapter int, iItem int, pValue string) int { - r, _, _ := xAdTable_InsertItemText.Call(uintptr(hAdapter), uintptr(iItem), common.StrPtr(pValue)) - return int(r) +func XAdTable_InsertRowText(hAdapter int, iRow int32, pValue string) int32 { + r, _, _ := xAdTable_InsertRowText.Call(uintptr(hAdapter), uintptr(iRow), common.StrPtr(pValue)) + return int32(r) } -// 数据适配器表_插入项文本扩展, 插入数据项, 并填充指定列数据, 返回项索引. +// 数据适配器表_插入行文本扩展, 插入数据行, 并填充指定列数据, 返回行索引. // // hAdapter: 数据适配器句柄. // -// iItem: 插入位置索引. +// iRow: 插入位置索引. // // pName: 字段称. // // pValue: 值. -func XAdTable_InsertItemTextEx(hAdapter int, iItem int, pName string, pValue string) int { - r, _, _ := xAdTable_InsertItemTextEx.Call(uintptr(hAdapter), uintptr(iItem), common.StrPtr(pName), common.StrPtr(pValue)) - return int(r) +func XAdTable_InsertRowTextEx(hAdapter int, iRow int32, pName string, pValue string) int32 { + r, _, _ := xAdTable_InsertRowTextEx.Call(uintptr(hAdapter), uintptr(iRow), common.StrPtr(pName), common.StrPtr(pValue)) + return int32(r) } -// 数据适配器表_插入项图片, 插入数据项, 填充第一列数据, 返回项索引. +// 数据适配器表_插入行图片, 插入数据行, 填充第一列数据, 返回行索引. // // hAdapter: 数据适配器句柄. // -// iItem: 插入位置索引. +// iRow: 插入位置索引. // // hImage: 图片句柄. -func XAdTable_InsertItemImage(hAdapter int, iItem int, hImage int) int { - r, _, _ := xAdTable_InsertItemImage.Call(uintptr(hAdapter), uintptr(iItem), uintptr(hImage)) - return int(r) +func XAdTable_InsertRowImage(hAdapter int, iRow int32, hImage int) int32 { + r, _, _ := xAdTable_InsertRowImage.Call(uintptr(hAdapter), uintptr(iRow), uintptr(hImage)) + return int32(r) } -// 数据适配器表_插入项图片扩展, 插入数据项, 并填充指定列数据, 返回项索引. +// 数据适配器表_插入行图片扩展, 插入数据行, 并填充指定列数据, 返回行索引. // // hAdapter: 数据适配器句柄. // -// iItem: 插入位置索引. +// iRow: 插入位置索引. // // pName: 字段称. // // hImage: 图片句柄. -func XAdTable_InsertItemImageEx(hAdapter int, iItem int, pName string, hImage int) int { - r, _, _ := xAdTable_InsertItemImageEx.Call(uintptr(hAdapter), uintptr(iItem), common.StrPtr(pName), uintptr(hImage)) - return int(r) +func XAdTable_InsertRowImageEx(hAdapter int, iRow int32, pName string, hImage int) int32 { + r, _, _ := xAdTable_InsertRowImageEx.Call(uintptr(hAdapter), uintptr(iRow), common.StrPtr(pName), uintptr(hImage)) + return int32(r) } // 数据适配器表_置项文本, 设置项数据. @@ -174,7 +173,7 @@ func XAdTable_InsertItemImageEx(hAdapter int, iItem int, pName string, hImage in // iColumn: 列索引. // // pValue: 值. -func XAdTable_SetItemText(hAdapter int, iItem int, iColumn int, pValue string) bool { +func XAdTable_SetItemText(hAdapter int, iItem, iColumn int32, pValue string) bool { r, _, _ := xAdTable_SetItemText.Call(uintptr(hAdapter), uintptr(iItem), uintptr(iColumn), common.StrPtr(pValue)) return r != 0 } @@ -188,7 +187,7 @@ func XAdTable_SetItemText(hAdapter int, iItem int, iColumn int, pValue string) b // pName: 字段称. // // pValue: 值. -func XAdTable_SetItemTextEx(hAdapter int, iItem int, pName string, pValue string) bool { +func XAdTable_SetItemTextEx(hAdapter int, iItem int32, pName string, pValue string) bool { r, _, _ := xAdTable_SetItemTextEx.Call(uintptr(hAdapter), uintptr(iItem), common.StrPtr(pName), common.StrPtr(pValue)) return r != 0 } @@ -202,7 +201,7 @@ func XAdTable_SetItemTextEx(hAdapter int, iItem int, pName string, pValue string // iColumn: 列索引. // // nValue: 值. -func XAdTable_SetItemInt(hAdapter int, iItem int, iColumn int, nValue int32) bool { +func XAdTable_SetItemInt(hAdapter int, iItem, iColumn int32, nValue int32) bool { r, _, _ := xAdTable_SetItemInt.Call(uintptr(hAdapter), uintptr(iItem), uintptr(iColumn), uintptr(nValue)) return r != 0 } @@ -216,7 +215,7 @@ func XAdTable_SetItemInt(hAdapter int, iItem int, iColumn int, nValue int32) boo // pName: 字段称. // // nValue: 值. -func XAdTable_SetItemIntEx(hAdapter int, iItem int, pName string, nValue int32) bool { +func XAdTable_SetItemIntEx(hAdapter int, iItem int32, pName string, nValue int32) bool { r, _, _ := xAdTable_SetItemIntEx.Call(uintptr(hAdapter), uintptr(iItem), common.StrPtr(pName), uintptr(nValue)) return r != 0 } @@ -230,7 +229,7 @@ func XAdTable_SetItemIntEx(hAdapter int, iItem int, pName string, nValue int32) // iColumn: 列索引. // // fValue: 值. -func XAdTable_SetItemFloat(hAdapter int, iItem int, iColumn int, fValue float32) bool { +func XAdTable_SetItemFloat(hAdapter int, iItem, iColumn int32, fValue float32) bool { r, _, _ := xAdTable_SetItemFloat.Call(uintptr(hAdapter), uintptr(iItem), uintptr(iColumn), common.Float32Ptr(fValue)) return r != 0 } @@ -244,7 +243,7 @@ func XAdTable_SetItemFloat(hAdapter int, iItem int, iColumn int, fValue float32) // pName: 字段称. // // fValue: 值. -func XAdTable_SetItemFloatEx(hAdapter int, iItem int, pName string, fValue float32) bool { +func XAdTable_SetItemFloatEx(hAdapter int, iItem int32, pName string, fValue float32) bool { r, _, _ := xAdTable_SetItemFloatEx.Call(uintptr(hAdapter), uintptr(iItem), common.StrPtr(pName), common.Float32Ptr(fValue)) return r != 0 } @@ -258,7 +257,7 @@ func XAdTable_SetItemFloatEx(hAdapter int, iItem int, pName string, fValue float // iColumn: 列索引. // // hImage: 图片句柄. -func XAdTable_SetItemImage(hAdapter int, iItem int, iColumn int, hImage int) bool { +func XAdTable_SetItemImage(hAdapter int, iItem, iColumn int32, hImage int) bool { r, _, _ := xAdTable_SetItemImage.Call(uintptr(hAdapter), uintptr(iItem), uintptr(iColumn), uintptr(hImage)) return r != 0 } @@ -272,63 +271,53 @@ func XAdTable_SetItemImage(hAdapter int, iItem int, iColumn int, hImage int) boo // pName: 字段称. // // hImage: 图片句柄. -func XAdTable_SetItemImageEx(hAdapter int, iItem int, pName string, hImage int) bool { +func XAdTable_SetItemImageEx(hAdapter int, iItem int32, pName string, hImage int) bool { r, _, _ := xAdTable_SetItemImageEx.Call(uintptr(hAdapter), uintptr(iItem), common.StrPtr(pName), uintptr(hImage)) return r != 0 } -// 数据适配器表_删除项, 删除项. +// 数据适配器表_删除行. // // hAdapter: 数据适配器句柄. // -// iItem: 项索引. -func XAdTable_DeleteItem(hAdapter int, iItem int) bool { - r, _, _ := xAdTable_DeleteItem.Call(uintptr(hAdapter), uintptr(iItem)) +// iRow: 行索引. +func XAdTable_DeleteRow(hAdapter int, iRow int32) bool { + r, _, _ := xAdTable_DeleteRow.Call(uintptr(hAdapter), uintptr(iRow)) return r != 0 } -// 数据适配器表_删除项扩展, 删除多个项. +// 数据适配器表_删除行扩展, 删除多个行. // // hAdapter: 数据适配器句柄. // -// iItem: 项起始索引. +// iRow: 行起始索引. // -// nCount: 删除项数量. -func XAdTable_DeleteItemEx(hAdapter int, iItem int, nCount int) bool { - r, _, _ := xAdTable_DeleteItemEx.Call(uintptr(hAdapter), uintptr(iItem), uintptr(nCount)) +// nCount: 删除行数量. +func XAdTable_DeleteRowEx(hAdapter int, iRow int32, nCount int32) bool { + r, _, _ := xAdTable_DeleteRowEx.Call(uintptr(hAdapter), uintptr(iRow), uintptr(nCount)) return r != 0 } -// 数据适配器表_删除项全部, 删除所有项. +// 数据适配器表_删除行全部, 删除所有行. // // hAdapter: 数据适配器句柄. -func XAdTable_DeleteItemAll(hAdapter int) int { - r, _, _ := xAdTable_DeleteItemAll.Call(uintptr(hAdapter)) - return int(r) +func XAdTable_DeleteRowAll(hAdapter int) { + xAdTable_DeleteRowAll.Call(uintptr(hAdapter)) } // 数据适配器表_删除列全部, 删除所有列, 并且清空所有数据. // // hAdapter: 数据适配器句柄. -func XAdTable_DeleteColumnAll(hAdapter int) int { - r, _, _ := xAdTable_DeleteColumnAll.Call(uintptr(hAdapter)) - return int(r) -} - -// 数据适配器表_取项数量, 获取项数量. -// -// hAdapter: 数据适配器句柄. -func XAdTable_GetCount(hAdapter int) int { - r, _, _ := xAdTable_GetCount.Call(uintptr(hAdapter)) - return int(r) +func XAdTable_DeleteColumnAll(hAdapter int) { + xAdTable_DeleteColumnAll.Call(uintptr(hAdapter)) } // 数据适配器表_取列数量, 获取列数量. // // hAdapter: 数据适配器句柄. -func XAdTable_GetCountColumn(hAdapter int) int { +func XAdTable_GetCountColumn(hAdapter int) int32 { r, _, _ := xAdTable_GetCountColumn.Call(uintptr(hAdapter)) - return int(r) + return int32(r) } // 数据适配器表_取项文本, 获取项文本内容. @@ -338,7 +327,7 @@ func XAdTable_GetCountColumn(hAdapter int) int { // iItem: 项索引. // // iColumn: 列索引. -func XAdTable_GetItemText(hAdapter int, iItem int, iColumn int) string { +func XAdTable_GetItemText(hAdapter int, iItem, iColumn int32) string { r, _, _ := xAdTable_GetItemText.Call(uintptr(hAdapter), uintptr(iItem), uintptr(iColumn)) return common.UintPtrToString(r) } @@ -350,7 +339,7 @@ func XAdTable_GetItemText(hAdapter int, iItem int, iColumn int) string { // iItem: 项索引. // // pName: 字段称. -func XAdTable_GetItemTextEx(hAdapter int, iItem int, pName string) string { +func XAdTable_GetItemTextEx(hAdapter int, iItem int32, pName string) string { r, _, _ := xAdTable_GetItemTextEx.Call(uintptr(hAdapter), uintptr(iItem), common.StrPtr(pName)) return common.UintPtrToString(r) } @@ -362,7 +351,7 @@ func XAdTable_GetItemTextEx(hAdapter int, iItem int, pName string) string { // iItem: 项索引. // // iColumn: 列索引. -func XAdTable_GetItemImage(hAdapter int, iItem int, iColumn int) int { +func XAdTable_GetItemImage(hAdapter int, iItem, iColumn int32) int { r, _, _ := xAdTable_GetItemImage.Call(uintptr(hAdapter), uintptr(iItem), uintptr(iColumn)) return int(r) } @@ -374,7 +363,7 @@ func XAdTable_GetItemImage(hAdapter int, iItem int, iColumn int) int { // iItem: 项索引. // // pName: 字段称. -func XAdTable_GetItemImageEx(hAdapter int, iItem int, pName string) int { +func XAdTable_GetItemImageEx(hAdapter int, iItem int32, pName string) int { r, _, _ := xAdTable_GetItemImageEx.Call(uintptr(hAdapter), uintptr(iItem), common.StrPtr(pName)) return int(r) } @@ -388,7 +377,7 @@ func XAdTable_GetItemImageEx(hAdapter int, iItem int, pName string) int { // iColumn: 列索引. // // pOutValue: 接收返还值. -func XAdTable_GetItemInt(hAdapter int, iItem int, iColumn int, pOutValue *int32) bool { +func XAdTable_GetItemInt(hAdapter int, iItem, iColumn int32, pOutValue *int32) bool { r, _, _ := xAdTable_GetItemInt.Call(uintptr(hAdapter), uintptr(iItem), uintptr(iColumn), uintptr(unsafe.Pointer(pOutValue))) return r != 0 } @@ -402,7 +391,7 @@ func XAdTable_GetItemInt(hAdapter int, iItem int, iColumn int, pOutValue *int32) // pName: 字段称. // // pOutValue: 接收返还值. -func XAdTable_GetItemIntEx(hAdapter int, iItem int, pName string, pOutValue *int32) bool { +func XAdTable_GetItemIntEx(hAdapter int, iItem int32, pName string, pOutValue *int32) bool { r, _, _ := xAdTable_GetItemIntEx.Call(uintptr(hAdapter), uintptr(iItem), common.StrPtr(pName), uintptr(unsafe.Pointer(pOutValue))) return r != 0 } @@ -416,7 +405,7 @@ func XAdTable_GetItemIntEx(hAdapter int, iItem int, pName string, pOutValue *int // iColumn: 列索引. // // pOutValue: 接收返还值. -func XAdTable_GetItemFloat(hAdapter int, iItem int, iColumn int, pOutValue *float32) bool { +func XAdTable_GetItemFloat(hAdapter int, iItem, iColumn int32, pOutValue *float32) bool { r, _, _ := xAdTable_GetItemFloat.Call(uintptr(hAdapter), uintptr(iItem), uintptr(iColumn), uintptr(unsafe.Pointer(pOutValue))) return r != 0 } @@ -430,7 +419,15 @@ func XAdTable_GetItemFloat(hAdapter int, iItem int, iColumn int, pOutValue *floa // pName: 字段称. // // pOutValue: 接收返还值. -func XAdTable_GetItemFloatEx(hAdapter int, iItem int, pName string, pOutValue *float32) bool { +func XAdTable_GetItemFloatEx(hAdapter int, iItem int32, pName string, pOutValue *float32) bool { r, _, _ := xAdTable_GetItemFloatEx.Call(uintptr(hAdapter), uintptr(iItem), common.StrPtr(pName), uintptr(unsafe.Pointer(pOutValue))) return r != 0 } + +// 数据适配器表_取行数量, 获取行数量. +// +// hAdapter: 数据适配器句柄. +func XAdTable_GetCountRow(hAdapter int) int32 { + r, _, _ := xAdTable_GetCountRow.Call(uintptr(hAdapter)) + return int32(r) +} diff --git a/xc/adaptertree.go b/xc/adaptertree.go index efcc742..4b69174 100644 --- a/xc/adaptertree.go +++ b/xc/adaptertree.go @@ -13,9 +13,9 @@ func XAdTree_Create() int { // hAdapter: 数据适配器句柄. // // pName: 字段称. -func XAdTree_AddColumn(hAdapter int, pName string) int { +func XAdTree_AddColumn(hAdapter int, pName string) int32 { r, _, _ := xAdTree_AddColumn.Call(uintptr(hAdapter), common.StrPtr(pName)) - return int(r) + return int32(r) } // 数据适配器树_置列, 设置列, 返回列数量. @@ -23,9 +23,9 @@ func XAdTree_AddColumn(hAdapter int, pName string) int { // hAdapter: 数据适配器句柄. // // pColName: 列名, 列名, 多个列名用逗号分开. -func XAdTree_SetColumn(hAdapter int, pColName string) int { +func XAdTree_SetColumn(hAdapter int, pColName string) int32 { r, _, _ := xAdTree_SetColumn.Call(uintptr(hAdapter), common.StrPtr(pColName)) - return int(r) + return int32(r) } // 数据适配器树_插入项文本, 插入项, 数据填充到第一列, 返回项ID值. @@ -37,9 +37,9 @@ func XAdTree_SetColumn(hAdapter int, pColName string) int { // nParentID: 父ID. // // insertID: 插入位置ID. -func XAdTree_InsertItemText(hAdapter int, pValue string, nParentID int, insertID int) int { +func XAdTree_InsertItemText(hAdapter int, pValue string, nParentID, insertID int32) int32 { r, _, _ := xAdTree_InsertItemText.Call(uintptr(hAdapter), common.StrPtr(pValue), uintptr(nParentID), uintptr(insertID)) - return int(r) + return int32(r) } // 数据适配器树_插入项文本扩展, 插入项, 数据填充到指定列, 返回项ID值. @@ -53,9 +53,9 @@ func XAdTree_InsertItemText(hAdapter int, pValue string, nParentID int, insertID // nParentID: 父ID. // // insertID: 插入位置ID. -func XAdTree_InsertItemTextEx(hAdapter int, pName string, pValue string, nParentID int, insertID int) int { +func XAdTree_InsertItemTextEx(hAdapter int, pName string, pValue string, nParentID, insertID int32) int32 { r, _, _ := xAdTree_InsertItemTextEx.Call(uintptr(hAdapter), common.StrPtr(pName), common.StrPtr(pValue), uintptr(nParentID), uintptr(insertID)) - return int(r) + return int32(r) } // 数据适配器树_插入项图片, 插入项, 数据填充到第一列, 返回项ID值. @@ -67,9 +67,9 @@ func XAdTree_InsertItemTextEx(hAdapter int, pName string, pValue string, nParent // nParentID: 父ID. // // insertID: 插入位置ID. -func XAdTree_InsertItemImage(hAdapter int, hImage int, nParentID int, insertID int) int { +func XAdTree_InsertItemImage(hAdapter int, hImage int, nParentID, insertID int32) int32 { r, _, _ := xAdTree_InsertItemImage.Call(uintptr(hAdapter), uintptr(hImage), uintptr(nParentID), uintptr(insertID)) - return int(r) + return int32(r) } // 数据适配器树_插入项图片扩展, 插入项, 数据填充到指定列, 返回项ID值. @@ -83,25 +83,25 @@ func XAdTree_InsertItemImage(hAdapter int, hImage int, nParentID int, insertID i // nParentID: 父ID. // // insertID: 插入位置ID. -func XAdTree_InsertItemImageEx(hAdapter int, pName string, hImage int, nParentID int, insertID int) int { +func XAdTree_InsertItemImageEx(hAdapter int, pName string, hImage int, nParentID, insertID int32) int32 { r, _, _ := xAdTree_InsertItemImageEx.Call(uintptr(hAdapter), common.StrPtr(pName), uintptr(hImage), uintptr(nParentID), uintptr(insertID)) - return int(r) + return int32(r) } // 数据适配器树_取项数量, 获取项数量. // // hAdapter: 数据适配器句柄. -func XAdTree_GetCount(hAdapter int) int { +func XAdTree_GetCount(hAdapter int) int32 { r, _, _ := xAdTree_GetCount.Call(uintptr(hAdapter)) - return int(r) + return int32(r) } // 数据适配器树_取列数量, 获取列数量. // // hAdapter: 数据适配器句柄. -func XAdTree_GetCountColumn(hAdapter int) int { +func XAdTree_GetCountColumn(hAdapter int) int32 { r, _, _ := xAdTree_GetCountColumn.Call(uintptr(hAdapter)) - return int(r) + return int32(r) } // 数据适配器树_置项文本, 设置项数据. @@ -113,7 +113,7 @@ func XAdTree_GetCountColumn(hAdapter int) int { // iColumn: 列索引. // // pValue: 值. -func XAdTree_SetItemText(hAdapter int, nID int, iColumn int, pValue string) bool { +func XAdTree_SetItemText(hAdapter int, nID, iColumn int32, pValue string) bool { r, _, _ := xAdTree_SetItemText.Call(uintptr(hAdapter), uintptr(nID), uintptr(iColumn), common.StrPtr(pValue)) return r != 0 } @@ -127,7 +127,7 @@ func XAdTree_SetItemText(hAdapter int, nID int, iColumn int, pValue string) bool // pName: 字段称. // // pValue: 值. -func XAdTree_SetItemTextEx(hAdapter int, nID int, pName string, pValue string) bool { +func XAdTree_SetItemTextEx(hAdapter int, nID int32, pName string, pValue string) bool { r, _, _ := xAdTree_SetItemTextEx.Call(uintptr(hAdapter), uintptr(nID), common.StrPtr(pName), common.StrPtr(pValue)) return r != 0 } @@ -141,7 +141,7 @@ func XAdTree_SetItemTextEx(hAdapter int, nID int, pName string, pValue string) b // iColumn: 列索引. // // hImage: 图片句柄. -func XAdTree_SetItemImage(hAdapter int, nID int, iColumn int, hImage int) bool { +func XAdTree_SetItemImage(hAdapter int, nID, iColumn int32, hImage int) bool { r, _, _ := xAdTree_SetItemImage.Call(uintptr(hAdapter), uintptr(nID), uintptr(iColumn), uintptr(hImage)) return r != 0 } @@ -155,7 +155,7 @@ func XAdTree_SetItemImage(hAdapter int, nID int, iColumn int, hImage int) bool { // pName: 字段称. // // hImage: 图片句柄. -func XAdTree_SetItemImageEx(hAdapter int, nID int, pName string, hImage int) bool { +func XAdTree_SetItemImageEx(hAdapter int, nID int32, pName string, hImage int) bool { r, _, _ := xAdTree_SetItemImageEx.Call(uintptr(hAdapter), uintptr(nID), common.StrPtr(pName), uintptr(hImage)) return r != 0 } @@ -167,7 +167,7 @@ func XAdTree_SetItemImageEx(hAdapter int, nID int, pName string, hImage int) boo // nID: 项ID. // // iColumn: 列索引. -func XAdTree_GetItemText(hAdapter int, nID int, iColumn int) string { +func XAdTree_GetItemText(hAdapter int, nID, iColumn int32) string { r, _, _ := xAdTree_GetItemText.Call(uintptr(hAdapter), uintptr(nID), uintptr(iColumn)) return common.UintPtrToString(r) } @@ -179,7 +179,7 @@ func XAdTree_GetItemText(hAdapter int, nID int, iColumn int) string { // nID: 项ID. // // pName: 字段称. -func XAdTree_GetItemTextEx(hAdapter int, nID int, pName string) string { +func XAdTree_GetItemTextEx(hAdapter int, nID int32, pName string) string { r, _, _ := xAdTree_GetItemTextEx.Call(uintptr(hAdapter), uintptr(nID), common.StrPtr(pName)) return common.UintPtrToString(r) } @@ -191,7 +191,7 @@ func XAdTree_GetItemTextEx(hAdapter int, nID int, pName string) string { // nID: 项ID. // // iColumn: 列索引. -func XAdTree_GetItemImage(hAdapter int, nID int, iColumn int) int { +func XAdTree_GetItemImage(hAdapter int, nID, iColumn int32) int { r, _, _ := xAdTree_GetItemImage.Call(uintptr(hAdapter), uintptr(nID), uintptr(iColumn)) return int(r) } @@ -203,7 +203,7 @@ func XAdTree_GetItemImage(hAdapter int, nID int, iColumn int) int { // nID: 项ID. // // pName: 字段称. -func XAdTree_GetItemImageEx(hAdapter int, nID int, pName string) int { +func XAdTree_GetItemImageEx(hAdapter int, nID int32, pName string) int { r, _, _ := xAdTree_GetItemImageEx.Call(uintptr(hAdapter), uintptr(nID), common.StrPtr(pName)) return int(r) } @@ -213,7 +213,7 @@ func XAdTree_GetItemImageEx(hAdapter int, nID int, pName string) int { // hAdapter: 数据适配器句柄. // // nID: 项ID. -func XAdTree_DeleteItem(hAdapter int, nID int) bool { +func XAdTree_DeleteItem(hAdapter int, nID int32) bool { r, _, _ := xAdTree_DeleteItem.Call(uintptr(hAdapter), uintptr(nID)) return r != 0 } @@ -221,15 +221,13 @@ func XAdTree_DeleteItem(hAdapter int, nID int) bool { // 数据适配器树_删除项全部, 删除所有项. // // hAdapter: 数据适配器句柄. -func XAdTree_DeleteItemAll(hAdapter int) int { - r, _, _ := xAdTree_DeleteItemAll.Call(uintptr(hAdapter)) - return int(r) +func XAdTree_DeleteItemAll(hAdapter int) { + xAdTree_DeleteItemAll.Call(uintptr(hAdapter)) } // 数据适配器树_删除列全部, 删除所有列, 并且清空数据. // // hAdapter: 数据适配器句柄. -func XAdTree_DeleteColumnAll(hAdapter int) int { - r, _, _ := xAdTree_DeleteColumnAll.Call(uintptr(hAdapter)) - return int(r) +func XAdTree_DeleteColumnAll(hAdapter int) { + xAdTree_DeleteColumnAll.Call(uintptr(hAdapter)) } diff --git a/xc/animation.go b/xc/animation.go index 65de968..be0e8e0 100644 --- a/xc/animation.go +++ b/xc/animation.go @@ -12,9 +12,8 @@ import ( // hAnimation: 动画序列或动画组句柄. // // hRedrawObjectUI: 当更新UI时重绘的UI层. UI对象句柄: 窗口句柄, 元素句柄, 形状句柄, SVG句柄. -func XAnima_Run(hAnimation int, hRedrawObjectUI int) int { - r, _, _ := xAnima_Run.Call(uintptr(hAnimation), uintptr(hRedrawObjectUI)) - return int(r) +func XAnima_Run(hAnimation int, hRedrawObjectUI int) { + xAnima_Run.Call(uintptr(hAnimation), uintptr(hRedrawObjectUI)) } // 动画_释放, 停止动画, 并释放引用, 当引用计数为0时自动销毁. @@ -32,9 +31,9 @@ func XAnima_Release(hAnimation int, bEnd bool) bool { // hObjectUI: 指定UI对象句柄. // // bEnd: 是否立即执行到终点. -func XAnima_ReleaseEx(hObjectUI int, bEnd bool) int { +func XAnima_ReleaseEx(hObjectUI int, bEnd bool) int32 { r, _, _ := xAnima_ReleaseEx.Call(uintptr(hObjectUI), common.BoolPtr(bEnd)) - return int(r) + return int32(r) } // 动画_创建动画序列, 按顺序执行的动画列表, 返回动画序列句柄. @@ -42,7 +41,7 @@ func XAnima_ReleaseEx(hObjectUI int, bEnd bool) int { // hObjectUI: 绑定的UI对象. UI对象句柄: 窗口句柄, 元素句柄, 形状句柄, SVG句柄. // // nLoopCount: 动画循环次数, 0: 无限循环. -func XAnima_Create(hObjectUI int, nLoopCount int) int { +func XAnima_Create(hObjectUI int, nLoopCount int32) int { r, _, _ := xAnima_Create.Call(uintptr(hObjectUI), uintptr(nLoopCount)) return int(r) } @@ -62,7 +61,7 @@ func XAnima_Create(hObjectUI int, nLoopCount int) int { // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func XAnima_Move(hSequence int, duration int, x float32, y float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func XAnima_Move(hSequence int, duration uint32, x float32, y float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { r, _, _ := xAnima_Move.Call(uintptr(hSequence), uintptr(duration), common.Float32Ptr(x), common.Float32Ptr(y), uintptr(nLoopCount), uintptr(ease_flag), common.BoolPtr(bGoBack)) return int(r) } @@ -86,7 +85,7 @@ func XAnima_Move(hSequence int, duration int, x float32, y float32, nLoopCount i // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func XAnima_MoveEx(hSequence int, duration int, from_x float32, from_y float32, to_x float32, to_y float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func XAnima_MoveEx(hSequence int, duration uint32, from_x float32, from_y float32, to_x float32, to_y float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { r, _, _ := xAnima_MoveEx.Call(uintptr(hSequence), uintptr(duration), common.Float32Ptr(from_x), common.Float32Ptr(from_y), common.Float32Ptr(to_x), common.Float32Ptr(to_y), uintptr(nLoopCount), uintptr(ease_flag), common.BoolPtr(bGoBack)) return int(r) } @@ -104,7 +103,7 @@ func XAnima_MoveEx(hSequence int, duration int, from_x float32, from_y float32, // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func XAnima_Rotate(hSequence int, duration int, angle float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func XAnima_Rotate(hSequence int, duration uint32, angle float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { r, _, _ := xAnima_Rotate.Call(uintptr(hSequence), uintptr(duration), common.Float32Ptr(angle), uintptr(nLoopCount), uintptr(ease_flag), common.BoolPtr(bGoBack)) return int(r) } @@ -124,7 +123,7 @@ func XAnima_Rotate(hSequence int, duration int, angle float32, nLoopCount int, e // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func XAnima_RotateEx(hSequence int, duration int, from float32, to float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func XAnima_RotateEx(hSequence int, duration uint32, from float32, to float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { r, _, _ := xAnima_RotateEx.Call(uintptr(hSequence), uintptr(duration), common.Float32Ptr(from), common.Float32Ptr(to), uintptr(nLoopCount), uintptr(ease_flag), common.BoolPtr(bGoBack)) return int(r) } @@ -144,7 +143,7 @@ func XAnima_RotateEx(hSequence int, duration int, from float32, to float32, nLoo // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func XAnima_Scale(hSequence int, duration int, scaleX float32, scaleY float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func XAnima_Scale(hSequence int, duration uint32, scaleX float32, scaleY float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { r, _, _ := xAnima_Scale.Call(uintptr(hSequence), uintptr(duration), common.Float32Ptr(scaleX), common.Float32Ptr(scaleY), uintptr(nLoopCount), uintptr(ease_flag), common.BoolPtr(bGoBack)) return int(r) } @@ -164,7 +163,7 @@ func XAnima_Scale(hSequence int, duration int, scaleX float32, scaleY float32, n // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func XAnima_ScaleSize(hSequence int, duration int, width float32, height float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func XAnima_ScaleSize(hSequence int, duration uint32, width float32, height float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { r, _, _ := xAnima_ScaleSize.Call(uintptr(hSequence), uintptr(duration), common.Float32Ptr(width), common.Float32Ptr(height), uintptr(nLoopCount), uintptr(ease_flag), common.BoolPtr(bGoBack)) return int(r) } @@ -182,7 +181,7 @@ func XAnima_ScaleSize(hSequence int, duration int, width float32, height float32 // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func XAnima_Alpha(hSequence int, duration int, alpha uint8, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func XAnima_Alpha(hSequence int, duration uint32, alpha uint8, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { r, _, _ := xAnima_Alpha.Call(uintptr(hSequence), uintptr(duration), uintptr(alpha), uintptr(nLoopCount), uintptr(ease_flag), common.BoolPtr(bGoBack)) return int(r) } @@ -202,7 +201,7 @@ func XAnima_Alpha(hSequence int, duration int, alpha uint8, nLoopCount int, ease // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func XAnima_AlphaEx(hSequence int, duration int, from_alpha uint8, to_alpha uint8, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func XAnima_AlphaEx(hSequence int, duration uint32, from_alpha byte, to_alpha byte, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { r, _, _ := xAnima_AlphaEx.Call(uintptr(hSequence), uintptr(duration), uintptr(from_alpha), uintptr(to_alpha), uintptr(nLoopCount), uintptr(ease_flag), common.BoolPtr(bGoBack)) return int(r) } @@ -213,14 +212,14 @@ func XAnima_AlphaEx(hSequence int, duration int, from_alpha uint8, to_alpha uint // // duration: 持续时间. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // nLoopCount: 动画循环次数, 0: 无限循环. // // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func XAnima_Color(hSequence int, duration int, color int, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func XAnima_Color(hSequence int, duration uint32, color int, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { r, _, _ := xAnima_Color.Call(uintptr(hSequence), uintptr(duration), uintptr(color), uintptr(nLoopCount), uintptr(ease_flag), common.BoolPtr(bGoBack)) return int(r) } @@ -231,16 +230,16 @@ func XAnima_Color(hSequence int, duration int, color int, nLoopCount int, ease_f // // duration: 持续时间. // -// from: 起点颜色, ABGR 颜色. +// from: 起点颜色, ARGB 颜色. // -// to: 终点颜色, ABGR 颜色. +// to: 终点颜色, ARGB 颜色. // // nLoopCount: 动画循环次数, 0: 无限循环. // // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func XAnima_ColorEx(hSequence int, duration int, from int, to int, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func XAnima_ColorEx(hSequence int, duration uint32, from int, to int, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { r, _, _ := xAnima_ColorEx.Call(uintptr(hSequence), uintptr(duration), uintptr(from), uintptr(to), uintptr(nLoopCount), uintptr(ease_flag), common.BoolPtr(bGoBack)) return int(r) } @@ -260,7 +259,7 @@ func XAnima_ColorEx(hSequence int, duration int, from int, to int, nLoopCount in // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func XAnima_LayoutWidth(hSequence int, duration int, nType xcc.Layout_Size_, width float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func XAnima_LayoutWidth(hSequence int, duration uint32, nType xcc.Layout_Size_, width float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { r, _, _ := xAnima_LayoutWidth.Call(uintptr(hSequence), uintptr(duration), uintptr(nType), common.Float32Ptr(width), uintptr(nLoopCount), uintptr(ease_flag), common.BoolPtr(bGoBack)) return int(r) } @@ -280,7 +279,7 @@ func XAnima_LayoutWidth(hSequence int, duration int, nType xcc.Layout_Size_, wid // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func XAnima_LayoutHeight(hSequence int, duration int, nType xcc.Layout_Size_, height float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func XAnima_LayoutHeight(hSequence int, duration uint32, nType xcc.Layout_Size_, height float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { r, _, _ := xAnima_LayoutHeight.Call(uintptr(hSequence), uintptr(duration), uintptr(nType), common.Float32Ptr(height), uintptr(nLoopCount), uintptr(ease_flag), common.BoolPtr(bGoBack)) return int(r) } @@ -304,7 +303,7 @@ func XAnima_LayoutHeight(hSequence int, duration int, nType xcc.Layout_Size_, he // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func XAnima_LayoutSize(hSequence int, duration int, nWidthType xcc.Layout_Size_, width float32, nHeightType xcc.Layout_Size_, height float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func XAnima_LayoutSize(hSequence int, duration uint32, nWidthType xcc.Layout_Size_, width float32, nHeightType xcc.Layout_Size_, height float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { r, _, _ := xAnima_LayoutSize.Call(uintptr(hSequence), uintptr(duration), uintptr(nWidthType), common.Float32Ptr(width), uintptr(nHeightType), common.Float32Ptr(height), uintptr(nLoopCount), uintptr(ease_flag), common.BoolPtr(bGoBack)) return int(r) } @@ -336,7 +335,7 @@ func XAnima_Show(hSequence int, duration float32, bShow bool) int { // 当遇到无限循环项时, 直至其他序列完成后终止循环, 避免出现无法到达终点, 无法返回头部进行同步, 返回动画组句柄. // // nLoopCount: 动画循环次数, 0: 无限循环. -func XAnimaGroup_Create(nLoopCount int) int { +func XAnimaGroup_Create(nLoopCount int32) int { r, _, _ := xAnimaGroup_Create.Call(uintptr(nLoopCount)) return int(r) } @@ -346,9 +345,8 @@ func XAnimaGroup_Create(nLoopCount int) int { // hGroup: 动画组句柄. // // hSequence: 动画序列句柄. -func XAnimaGroup_AddItem(hGroup int, hSequence int) int { - r, _, _ := xAnimaGroup_AddItem.Call(uintptr(hGroup), uintptr(hSequence)) - return int(r) +func XAnimaGroup_AddItem(hGroup int, hSequence int) { + xAnimaGroup_AddItem.Call(uintptr(hGroup), uintptr(hSequence)) } // 动画旋转_置中心, 设置旋转中心点坐标. @@ -360,9 +358,8 @@ func XAnimaGroup_AddItem(hGroup int, hSequence int) int { // y: 坐标Y. // // bOffset: TRUE: 相对于自身中心点偏移, FALSE: 绝对坐标. -func XAnimaRotate_SetCenter(hAnimationRotate int, x float32, y float32, bOffset bool) bool { - r, _, _ := xAnimaRotate_SetCenter.Call(uintptr(hAnimationRotate), common.Float32Ptr(x), common.Float32Ptr(y), common.BoolPtr(bOffset)) - return r != 0 +func XAnimaRotate_SetCenter(hAnimationRotate int, x, y float32, bOffset bool) { + xAnimaRotate_SetCenter.Call(uintptr(hAnimationRotate), common.Float32Ptr(x), common.Float32Ptr(y), common.BoolPtr(bOffset)) } // 动画缩放_置延伸位置, 设置缩放起点, 确定延伸方向. @@ -370,9 +367,8 @@ func XAnimaRotate_SetCenter(hAnimationRotate int, x float32, y float32, bOffset // hAnimationScale: 动画缩放项句柄. // // position: 位置, Position_Flag_. -func XAnimaScale_SetPosition(hAnimationScale int, position xcc.Position_Flag_) bool { - r, _, _ := xAnimaScale_SetPosition.Call(uintptr(hAnimationScale), uintptr(position)) - return r != 0 +func XAnimaScale_SetPosition(hAnimationScale int, position xcc.Position_Flag_) { + xAnimaScale_SetPosition.Call(uintptr(hAnimationScale), uintptr(position)) } // 动画_取UI对象, 获取动画关联的UI对象, 返回UI对象句柄. @@ -390,9 +386,8 @@ func XAnima_GetObjectUI(hAnimation int) int { // hAnimationItem: 动画项句柄. // // bEnable: 是否启用. -func XAnimaItem_EnableCompleteRelease(hAnimationItem int, bEnable bool) int { - r, _, _ := xAnimaItem_EnableCompleteRelease.Call(uintptr(hAnimationItem), common.BoolPtr(bEnable)) - return int(r) +func XAnimaItem_EnableCompleteRelease(hAnimationItem int, bEnable bool) { + xAnimaItem_EnableCompleteRelease.Call(uintptr(hAnimationItem), common.BoolPtr(bEnable)) } // 动画_启用自动销毁, TRUE: 当引用计数为0时自动销毁, FALSE: 手动销毁. @@ -400,9 +395,8 @@ func XAnimaItem_EnableCompleteRelease(hAnimationItem int, bEnable bool) int { // hAnimation: 动画项或动画序列或动画组句柄. // // bEnable: 是否启用. -func XAnima_EnableAutoDestroy(hAnimation int, bEnable bool) int { - r, _, _ := xAnima_EnableAutoDestroy.Call(uintptr(hAnimation), common.BoolPtr(bEnable)) - return int(r) +func XAnima_EnableAutoDestroy(hAnimation int, bEnable bool) { + xAnima_EnableAutoDestroy.Call(uintptr(hAnimation), common.BoolPtr(bEnable)) } // 动画_销毁UI对象, 返回动画项句柄. @@ -420,9 +414,8 @@ func XAnima_DestroyObjectUI(hSequence int, duration float32) int { // hAnimationEx: 动画序列或动画组句柄. // // callback: 回调函数. -func XAnima_SetCallBack(hAnimationEx int, callback interface{}) int { - r, _, _ := xAnima_SetCallBack.Call(uintptr(hAnimationEx), syscall.NewCallback(callback)) - return int(r) +func XAnima_SetCallBack(hAnimationEx int, callback FunAnimation) { + xAnima_SetCallBack.Call(uintptr(hAnimationEx), syscall.NewCallback(callback)) } // 动画_置用户数据. @@ -430,9 +423,8 @@ func XAnima_SetCallBack(hAnimationEx int, callback interface{}) int { // hAnimationEx: 动画序列或动画组句柄. // // nUserData: 用户数据. -func XAnima_SetUserData(hAnimationEx, nUserData int) int { - r, _, _ := xAnima_SetUserData.Call(uintptr(hAnimationEx), uintptr(nUserData)) - return int(r) +func XAnima_SetUserData(hAnimationEx, nUserData int) { + xAnima_SetUserData.Call(uintptr(hAnimationEx), uintptr(nUserData)) } // 动画_取用户数据, 返回用户数据. @@ -472,9 +464,8 @@ func XAnima_Pause(hAnimationEx int) bool { // hAnimationItem: 动画项句柄. // // callback: 回调函数. -func XAnimaItem_SetCallback(hAnimationItem int, callback interface{}) int { - r, _, _ := xAnimaItem_SetCallback.Call(uintptr(hAnimationItem), syscall.NewCallback(callback)) - return int(r) +func XAnimaItem_SetCallback(hAnimationItem int, callback FunAnimationItem) { + xAnimaItem_SetCallback.Call(uintptr(hAnimationItem), syscall.NewCallback(callback)) } // 动画项_置用户数据. @@ -482,9 +473,8 @@ func XAnimaItem_SetCallback(hAnimationItem int, callback interface{}) int { // hAnimationItem: 动画项句柄. // // nUserData: 用户数据. -func XAnimaItem_SetUserData(hAnimationItem, nUserData int) int { - r, _, _ := xAnimaItem_SetUserData.Call(uintptr(hAnimationItem), uintptr(nUserData)) - return int(r) +func XAnimaItem_SetUserData(hAnimationItem, nUserData int) { + xAnimaItem_SetUserData.Call(uintptr(hAnimationItem), uintptr(nUserData)) } // 动画项_取用户数据, 返回用户数据. @@ -500,9 +490,8 @@ func XAnimaItem_GetUserData(hAnimationItem int) int { // hAnimationItem: 动画项句柄. // // bEnable: 是否启用. -func XAnimaItem_EnableAutoDestroy(hAnimationItem int, bEnable bool) int { - r, _, _ := xAnimaItem_EnableAutoDestroy.Call(uintptr(hAnimationItem), common.BoolPtr(bEnable)) - return int(r) +func XAnimaItem_EnableAutoDestroy(hAnimationItem int, bEnable bool) { + xAnimaItem_EnableAutoDestroy.Call(uintptr(hAnimationItem), common.BoolPtr(bEnable)) } // 动画_延迟扩展, 可以作为一个空动画, 然后在回调里处理自己的算法, 返回动画项句柄. @@ -516,7 +505,7 @@ func XAnimaItem_EnableAutoDestroy(hAnimationItem int, bEnable bool) int { // ease_flag: 缓动标识, Ease_Flag_. // // bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点. -func XAnima_DelayEx(hSequence int, duration float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int { +func XAnima_DelayEx(hSequence int, duration float32, nLoopCount int32, ease_flag xcc.Ease_Flag_, bGoBack bool) int { r, _, _ := xAnima_DelayEx.Call(uintptr(hSequence), common.Float32Ptr(duration), uintptr(nLoopCount), uintptr(ease_flag), common.BoolPtr(bGoBack)) return int(r) } @@ -528,7 +517,20 @@ func XAnima_DelayEx(hSequence int, duration float32, nLoopCount int, ease_flag x // flags: 动画移动标识, 可组合使用, Animation_Move_. // // TODO: 此函数尚未封装到类中. -func XAnimaMove_SetFlag(hAnimationMove int, flags xcc.Animation_Move_) int { - r, _, _ := xAnimaMove_SetFlag.Call(uintptr(hAnimationMove), uintptr(flags)) - return int(r) +func XAnimaMove_SetFlag(hAnimationMove int, flags xcc.Animation_Move_) { + xAnimaMove_SetFlag.Call(uintptr(hAnimationMove), uintptr(flags)) } + +// FunAnimation 动画回调. +// +// hAnimation: 动画序列或动画组句柄. +// +// flag: 当前忽略. +type FunAnimation func(hAnimation int, flag int32) + +// FunAnimationItem 动画项回调. +// +// hAnimation: 动画项句柄. +// +// flag: 当前进度(0.0f-1.0f). +type FunAnimationItem func(hAnimation int, pos float32) diff --git a/xc/bkmanager.go b/xc/bkmanager.go index bed5086..93e8a69 100644 --- a/xc/bkmanager.go +++ b/xc/bkmanager.go @@ -16,21 +16,8 @@ func XBkM_Create() int { // 背景_销毁. // // hBkInfoM: 背景管理器句柄. -func XBkM_Destroy(hBkInfoM int) int { - r, _, _ := xBkM_Destroy.Call(uintptr(hBkInfoM)) - return int(r) -} - -// !废弃函数, 保留为了兼容旧版; 请使用 XBkM_SetInfo(). -// -// 背景_置内容, 设置背景内容, 返回设置的背景对象数量. -// -// hBkInfoM: 背景管理器句柄. -// -// pText: 背景内容字符串. -func XBkM_SetBkInfo(hBkInfoM int, pText string) int { - r, _, _ := xBkM_SetBkInfo.Call(uintptr(hBkInfoM), common.StrPtr(pText)) - return int(r) +func XBkM_Destroy(hBkInfoM int) { + xBkM_Destroy.Call(uintptr(hBkInfoM)) } // 背景_添加内容, 添加背景内容, 返回添加的背景对象数量. @@ -38,9 +25,9 @@ func XBkM_SetBkInfo(hBkInfoM int, pText string) int { // hBkInfoM: 背景管理器句柄. // // pText: 背景内容字符串. -func XBkM_AddInfo(hBkInfoM int, pText string) int { +func XBkM_AddInfo(hBkInfoM int, pText string) int32 { r, _, _ := xBkM_AddInfo.Call(uintptr(hBkInfoM), common.StrPtr(pText)) - return int(r) + return int32(r) } // 背景_添加边框, 添加背景内容边框. @@ -49,14 +36,13 @@ func XBkM_AddInfo(hBkInfoM int, pText string) int { // // nState: 组合状态. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // width: 线宽. // // id: 背景对象ID, 可忽略(填0). -func XBkM_AddBorder(hBkInfoM int, nState xcc.CombinedState, color, width, id int) int { - r, _, _ := xBkM_AddBorder.Call(uintptr(hBkInfoM), uintptr(nState), uintptr(color), uintptr(width), uintptr(id)) - return int(r) +func XBkM_AddBorder(hBkInfoM int, nState xcc.CombinedState, color int, width, id int32) { + xBkM_AddBorder.Call(uintptr(hBkInfoM), uintptr(nState), uintptr(color), uintptr(width), uintptr(id)) } // 背景_添加填充, 添加背景内容填充. @@ -65,12 +51,11 @@ func XBkM_AddBorder(hBkInfoM int, nState xcc.CombinedState, color, width, id int // // nState: 组合状态. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // id: 背景对象ID, 可忽略(填0). -func XBkM_AddFill(hBkInfoM int, nState xcc.CombinedState, color, id int) int { - r, _, _ := xBkM_AddFill.Call(uintptr(hBkInfoM), uintptr(nState), uintptr(color), uintptr(id)) - return int(r) +func XBkM_AddFill(hBkInfoM int, nState xcc.CombinedState, color int, id int32) { + xBkM_AddFill.Call(uintptr(hBkInfoM), uintptr(nState), uintptr(color), uintptr(id)) } // 背景_添加图片, 添加背景内容图片. @@ -82,25 +67,23 @@ func XBkM_AddFill(hBkInfoM int, nState xcc.CombinedState, color, id int) int { // hImage: 图片句柄. // // id: 背景对象ID, 可忽略(填0). -func XBkM_AddImage(hBkInfoM int, nState xcc.CombinedState, hImage, id int) int { - r, _, _ := xBkM_AddImage.Call(uintptr(hBkInfoM), uintptr(nState), uintptr(hImage), uintptr(id)) - return int(r) +func XBkM_AddImage(hBkInfoM int, nState xcc.CombinedState, hImage int, id int32) { + xBkM_AddImage.Call(uintptr(hBkInfoM), uintptr(nState), uintptr(hImage), uintptr(id)) } // 背景_取数量, 获取背景内容数量. // // hBkInfoM: 背景管理器句柄. -func XBkM_GetCount(hBkInfoM int) int { +func XBkM_GetCount(hBkInfoM int) int32 { r, _, _ := xBkM_GetCount.Call(uintptr(hBkInfoM)) - return int(r) + return int32(r) } // 背景_清空, 清空背景内容. // // hBkInfoM: 背景管理器句柄. -func XBkM_Clear(hBkInfoM int) int { - r, _, _ := xBkM_Clear.Call(uintptr(hBkInfoM)) - return int(r) +func XBkM_Clear(hBkInfoM int) { + xBkM_Clear.Call(uintptr(hBkInfoM)) } // 背景_绘制, 绘制背景内容. @@ -140,33 +123,30 @@ func XBkM_DrawEx(hBkInfoM int, nState xcc.CombinedState, hDraw int, pRect *RECT, // hBkInfoM: 背景管理器句柄. // // bEnable: 是否启用. -func XBkM_EnableAutoDestroy(hBkInfoM int, bEnable bool) int { - r, _, _ := xBkM_EnableAutoDestroy.Call(uintptr(hBkInfoM), common.BoolPtr(bEnable)) - return int(r) +func XBkM_EnableAutoDestroy(hBkInfoM int, bEnable bool) { + xBkM_EnableAutoDestroy.Call(uintptr(hBkInfoM), common.BoolPtr(bEnable)) } // 背景_增加引用计数. // // hBkInfoM: 背景管理器句柄. -func XBkM_AddRef(hBkInfoM int) int { - r, _, _ := xBkM_AddRef.Call(uintptr(hBkInfoM)) - return int(r) +func XBkM_AddRef(hBkInfoM int) { + xBkM_AddRef.Call(uintptr(hBkInfoM)) } // 背景_释放引用计数. // // hBkInfoM: 背景管理器句柄. -func XBkM_Release(hBkInfoM int) int { - r, _, _ := xBkM_Release.Call(uintptr(hBkInfoM)) - return int(r) +func XBkM_Release(hBkInfoM int) { + xBkM_Release.Call(uintptr(hBkInfoM)) } // 背景_取引用计数. // // hBkInfoM: 背景管理器句柄. -func XBkM_GetRefCount(hBkInfoM int) int { +func XBkM_GetRefCount(hBkInfoM int) int32 { r, _, _ := xBkM_GetRefCount.Call(uintptr(hBkInfoM)) - return int(r) + return int32(r) } // 背景_取引用计数, 设置背景内容, 返回设置的背景对象数量. @@ -174,9 +154,9 @@ func XBkM_GetRefCount(hBkInfoM int) int { // hBkInfoM: 背景管理器句柄. // // pText: 背景内容字符串. -func XBkM_SetInfo(hBkInfoM int, pText string) int { +func XBkM_SetInfo(hBkInfoM int, pText string) int32 { r, _, _ := xBkM_SetInfo.Call(uintptr(hBkInfoM), common.StrPtr(pText)) - return int(r) + return int32(r) } // 背景_取指定状态文本颜色. @@ -185,7 +165,7 @@ func XBkM_SetInfo(hBkInfoM int, pText string) int { // // nState: 组合状态. // -// color: 接收返回的ABGR 颜色. +// color: 接收返回的ARGB 颜色. func XBkM_GetStateTextColor(hBkInfoM int, nState xcc.CombinedState, color *int) bool { r, _, _ := xBkM_GetStateTextColor.Call(uintptr(hBkInfoM), uintptr(nState), uintptr(unsafe.Pointer(color))) return r != 0 @@ -196,7 +176,7 @@ func XBkM_GetStateTextColor(hBkInfoM int, nState xcc.CombinedState, color *int) // hBkInfoM: 背景管理器句柄. // // id: 背景对象ID. -func XBkM_GetObject(hBkInfoM int, id int) int { +func XBkM_GetObject(hBkInfoM int, id int32) int { r, _, _ := xBkM_GetObject.Call(uintptr(hBkInfoM), uintptr(id)) return int(r) } diff --git a/xc/bkobj.go b/xc/bkobj.go index 8d3c276..80afadc 100644 --- a/xc/bkobj.go +++ b/xc/bkobj.go @@ -18,9 +18,8 @@ import ( // right: 右边间距. // // bottom: 底部间距. -func XBkObj_SetMargin(hObj int, left int, top int, right int, bottom int) int { - r, _, _ := xBkObj_SetMargin.Call(uintptr(hObj), uintptr(left), uintptr(top), uintptr(right), uintptr(bottom)) - return int(r) +func XBkObj_SetMargin(hObj int, left, top, right, bottom int32) { + xBkObj_SetMargin.Call(uintptr(hObj), uintptr(left), uintptr(top), uintptr(right), uintptr(bottom)) } // 背景对象_置对齐. @@ -28,9 +27,8 @@ func XBkObj_SetMargin(hObj int, left int, top int, right int, bottom int) int { // hObj: 背景对象句柄. // // nFlags: 对齐方式: xcc.BkObject_Align_Flag_. -func XBkObj_SetAlign(hObj int, nFlags xcc.BkObject_Align_Flag_) int { - r, _, _ := xBkObj_SetAlign.Call(uintptr(hObj), uintptr(nFlags)) - return int(r) +func XBkObj_SetAlign(hObj int, nFlags xcc.BkObject_Align_Flag_) { + xBkObj_SetAlign.Call(uintptr(hObj), uintptr(nFlags)) } // 背景对象_置图片. @@ -38,9 +36,8 @@ func XBkObj_SetAlign(hObj int, nFlags xcc.BkObject_Align_Flag_) int { // hObj: 背景对象句柄. // // hImage: 图片句柄. -func XBkObj_SetImage(hObj int, hImage int) int { - r, _, _ := xBkObj_SetImage.Call(uintptr(hObj), uintptr(hImage)) - return int(r) +func XBkObj_SetImage(hObj int, hImage int) { + xBkObj_SetImage.Call(uintptr(hObj), uintptr(hImage)) } // 背景对象_置旋转. @@ -48,19 +45,17 @@ func XBkObj_SetImage(hObj int, hImage int) int { // hObj: 背景对象句柄. // // angle: 旋转角度. -func XBkObj_SetRotate(hObj int, angle float32) int { - r, _, _ := xBkObj_SetRotate.Call(uintptr(hObj), common.Float32Ptr(angle)) - return int(r) +func XBkObj_SetRotate(hObj int, angle float32) { + xBkObj_SetRotate.Call(uintptr(hObj), common.Float32Ptr(angle)) } // 背景对象_置填充颜色. // // hObj: 背景对象句柄. // -// color: ABGR 颜色值. -func XBkObj_SetFillColor(hObj int, color int) int { - r, _, _ := xBkObj_SetFillColor.Call(uintptr(hObj), uintptr(color)) - return int(r) +// color: ARGB 颜色值. +func XBkObj_SetFillColor(hObj int, color int) { + xBkObj_SetFillColor.Call(uintptr(hObj), uintptr(color)) } // 背景对象_置边框宽度. @@ -68,19 +63,17 @@ func XBkObj_SetFillColor(hObj int, color int) int { // hObj: 背景对象句柄. // // width: 宽度. -func XBkObj_SetBorderWidth(hObj int, width int) int { - r, _, _ := xBkObj_SetBorderWidth.Call(uintptr(hObj), uintptr(width)) - return int(r) +func XBkObj_SetBorderWidth(hObj int, width int32) { + xBkObj_SetBorderWidth.Call(uintptr(hObj), uintptr(width)) } // 背景对象_置边框颜色. // // hObj: 背景对象句柄. // -// color: ABGR 颜色值. -func XBkObj_SetBorderColor(hObj int, color int) int { - r, _, _ := xBkObj_SetBorderColor.Call(uintptr(hObj), uintptr(color)) - return int(r) +// color: ARGB 颜色值. +func XBkObj_SetBorderColor(hObj int, color int) { + xBkObj_SetBorderColor.Call(uintptr(hObj), uintptr(color)) } // 背景对象_置矩形圆角. @@ -94,9 +87,8 @@ func XBkObj_SetBorderColor(hObj int, color int) int { // rightTop: 右上角. // // rightBottom: 右下角. -func XBkObj_SetRectRoundAngle(hObj int, leftTop int, leftBottom int, rightTop int, rightBottom int) int { - r, _, _ := xBkObj_SetRectRoundAngle.Call(uintptr(hObj), uintptr(leftTop), uintptr(leftBottom), uintptr(rightTop), uintptr(rightBottom)) - return int(r) +func XBkObj_SetRectRoundAngle(hObj int, leftTop, leftBottom, rightTop, rightBottom int32) { + xBkObj_SetRectRoundAngle.Call(uintptr(hObj), uintptr(leftTop), uintptr(leftBottom), uintptr(rightTop), uintptr(rightBottom)) } // 背景对象_启用填充, 启用绘制填充. @@ -104,9 +96,8 @@ func XBkObj_SetRectRoundAngle(hObj int, leftTop int, leftBottom int, rightTop in // hObj: 背景对象句柄. // // bEnable: 是否启用. -func XBkObj_EnableFill(hObj int, bEnable bool) int { - r, _, _ := xBkObj_EnableFill.Call(uintptr(hObj), common.BoolPtr(bEnable)) - return int(r) +func XBkObj_EnableFill(hObj int, bEnable bool) { + xBkObj_EnableFill.Call(uintptr(hObj), common.BoolPtr(bEnable)) } // 背景对象_启用边框, 启用绘制边框. @@ -114,9 +105,8 @@ func XBkObj_EnableFill(hObj int, bEnable bool) int { // hObj: 背景对象句柄. // // bEnable: 是否启用. -func XBkObj_EnableBorder(hObj int, bEnable bool) int { - r, _, _ := xBkObj_EnableBorder.Call(uintptr(hObj), common.BoolPtr(bEnable)) - return int(r) +func XBkObj_EnableBorder(hObj int, bEnable bool) { + xBkObj_EnableBorder.Call(uintptr(hObj), common.BoolPtr(bEnable)) } // 背景对象_置文本. @@ -124,9 +114,8 @@ func XBkObj_EnableBorder(hObj int, bEnable bool) int { // hObj: 背景对象句柄. // // pText: 文本字符串. -func XBkObj_SetText(hObj int, pText string) int { - r, _, _ := xBkObj_SetText.Call(uintptr(hObj), common.StrPtr(pText)) - return int(r) +func XBkObj_SetText(hObj int, pText string) { + xBkObj_SetText.Call(uintptr(hObj), common.StrPtr(pText)) } // 背景对象_置字体. @@ -134,9 +123,8 @@ func XBkObj_SetText(hObj int, pText string) int { // hObj: 背景对象句柄. // // hFont: 字体句柄. -func XBkObj_SetFont(hObj int, hFont int) int { - r, _, _ := xBkObj_SetFont.Call(uintptr(hObj), uintptr(hFont)) - return int(r) +func XBkObj_SetFont(hObj int, hFont int) { + xBkObj_SetFont.Call(uintptr(hObj), uintptr(hFont)) } // 背景对象_置文本对齐. @@ -144,9 +132,8 @@ func XBkObj_SetFont(hObj int, hFont int) int { // hObj: 背景对象句柄. // // nAlign: 文本对齐方式: xcc.TextFormatFlag_, xcc.TextAlignFlag_, xcc.TextTrimming_. -func XBkObj_SetTextAlign(hObj int, nAlign xcc.TextFormatFlag_) int { - r, _, _ := xBkObj_SetTextAlign.Call(uintptr(hObj), uintptr(nAlign)) - return int(r) +func XBkObj_SetTextAlign(hObj int, nAlign xcc.TextFormatFlag_) { + xBkObj_SetTextAlign.Call(uintptr(hObj), uintptr(nAlign)) } // 背景对象_取外间距. @@ -154,9 +141,8 @@ func XBkObj_SetTextAlign(hObj int, nAlign xcc.TextFormatFlag_) int { // hObj: 背景对象句柄. // // pMargin: 接收返回外间距. -func XBkObj_GetMargin(hObj int, pMargin *RECT) int { - r, _, _ := xBkObj_GetMargin.Call(uintptr(hObj), uintptr(unsafe.Pointer(pMargin))) - return int(r) +func XBkObj_GetMargin(hObj int, pMargin *RECT) { + xBkObj_GetMargin.Call(uintptr(hObj), uintptr(unsafe.Pointer(pMargin))) } // 背景对象_取对齐, 返回对齐标识: xcc.BkObject_Align_Flag_. @@ -178,12 +164,12 @@ func XBkObj_GetImage(hObj int) int { // 背景对象_取旋转角度, 返回旋转角度. // // hObj: 背景对象句柄. -func XBkObj_GetRotate(hObj int) int { +func XBkObj_GetRotate(hObj int) int32 { r, _, _ := xBkObj_GetRotate.Call(uintptr(hObj)) - return int(r) + return int32(r) } -// 背景对象_取填充色, 返回ABGR填充色. +// 背景对象_取填充色, 返回ARGB填充色. // // hObj: 背景对象句柄. func XBkObj_GetFillColor(hObj int) int { @@ -191,7 +177,7 @@ func XBkObj_GetFillColor(hObj int) int { return int(r) } -// 背景对象_取边框色, 返回ABGR边框色. +// 背景对象_取边框色, 返回ARGB边框色. // // hObj: 背景对象句柄. func XBkObj_GetBorderColor(hObj int) int { @@ -202,9 +188,9 @@ func XBkObj_GetBorderColor(hObj int) int { // 背景对象_取边框宽度, 返回边框宽度. // // hObj: 背景对象句柄. -func XBkObj_GetBorderWidth(hObj int) int { +func XBkObj_GetBorderWidth(hObj int) int32 { r, _, _ := xBkObj_GetBorderWidth.Call(uintptr(hObj)) - return int(r) + return int32(r) } // 背景对象_取矩形圆角. @@ -212,9 +198,8 @@ func XBkObj_GetBorderWidth(hObj int) int { // hObj: 背景对象句柄. // // pRect: 接收返回圆角大小. -func XBkObj_GetRectRoundAngle(hObj int, pRect *RECT) int { - r, _, _ := xBkObj_GetRectRoundAngle.Call(uintptr(hObj), uintptr(unsafe.Pointer(pRect))) - return int(r) +func XBkObj_GetRectRoundAngle(hObj int, pRect *RECT) { + xBkObj_GetRectRoundAngle.Call(uintptr(hObj), uintptr(unsafe.Pointer(pRect))) } // 背景对象_是否填充. diff --git a/xc/button.go b/xc/button.go index 7e9f57c..32ce0c2 100644 --- a/xc/button.go +++ b/xc/button.go @@ -248,3 +248,12 @@ func XBtn_EnableAnimation(hEle int, bEnable bool, bLoopPlay bool) int { r, _, _ := xBtn_EnableAnimation.Call(uintptr(hEle), common.BoolPtr(bEnable), common.BoolPtr(bLoopPlay)) return int(r) } + +// 按钮_启用热键前缀. 对当前文本内容处理, 将&符号后面的一个字符加上下划线. +// +// hEle: 元素句柄. +// +// bEnable: 是否启用. +func XBtn_EnableHotkeyPrefix(hEle int, bEnable bool) { + xBtn_EnableHotkeyPrefix.Call(uintptr(hEle), common.BoolPtr(bEnable)) +} diff --git a/xc/combobox.go b/xc/combobox.go index 777fcba..403a4a3 100644 --- a/xc/combobox.go +++ b/xc/combobox.go @@ -552,9 +552,9 @@ func XComboBox_PopupDropList(hEle int) int { // hEle: 元素句柄. // // hTemp: 模板句柄. -func XComboBox_SetItemTemplate(hEle, hTemp int) int { +func XComboBox_SetItemTemplate(hEle, hTemp int) bool { r, _, _ := xComboBox_SetItemTemplate.Call(uintptr(hEle), uintptr(hTemp)) - return int(r) + return r != 0 } // 组合框_置项模板从内存. diff --git a/xc/common.go b/xc/common.go index 6f99241..4ae2cb5 100644 --- a/xc/common.go +++ b/xc/common.go @@ -3,8 +3,6 @@ package xc import ( "github.com/twgh/xcgui/xcc" "os" - "strconv" - "strings" "syscall" ) @@ -46,54 +44,44 @@ func PointInRect(pt POINT, rc RECT) bool { return pt.X <= rc.Right && pt.X >= rc.Left && pt.Y <= rc.Bottom && pt.Y >= rc.Top } -// ABGR 根据r, g, b, a组合成ABGR颜色. +// ARGB 根据r, g, b, a组合成ARGB颜色. // // @param r 红色分量. // @param g 绿色分量. // @param b 蓝色分量. // @param a 透明度. -// @return int ABGR颜色. -func ABGR(r, g, b, a byte) int { - return int(uint32(r) | uint32(g)<<8 | uint32(b)<<16 | uint32(a)<<24) +// @return int ARGB颜色. +func ARGB(r, g, b, a byte) int { + return int(uint32(a)<<24 | uint32(r) | uint32(g)<<8 | uint32(b)<<16) } -// ABGR2 根据bgr, a组合成ABGR颜色. +// ARGB2 根据rgb, a组合成十进制ARGB颜色. // -// @param bgr BGR颜色. +// @param rgb RGB颜色. // @param a 透明度. -// @return int ABGR颜色. -func ABGR2(bgr int, a byte) int { - return int((uint32(bgr) & 16777215) | (uint32(a)&255)<<24) +// @return int ARGB颜色. +func ARGB2(rgb int, a byte) int { + return int((uint32(rgb) & 16777215) | uint32(a)<<24) } -// RGBA 根据r, g, b, a组合成ABGR颜色. 和 ABGR 函数一模一样, 只是为了符合部分人使用习惯. +// RGBA 根据r, g, b, a组合成ARGB颜色. 和 ARGB 函数一模一样, 只是为了符合部分人使用习惯. // // @param r 红色分量. // @param g 绿色分量. // @param b 蓝色分量. // @param a 透明度. -// @return int ABGR颜色. +// @return int ARGB颜色. func RGBA(r, g, b, a byte) int { - return int(uint32(r) | uint32(g)<<8 | uint32(b)<<16 | uint32(a)<<24) + return int(uint32(a)<<24 | uint32(r) | uint32(g)<<8 | uint32(b)<<16) } -// RGBA2 根据bgr, a组合成十进制ABGR颜色. 和 ABGR2 函数一模一样, 只是为了符合部分人使用习惯. +// RGBA2 根据rgb, a组合成十进制ARGB颜色. 和 ARGB2 函数一模一样, 只是为了符合部分人使用习惯. // -// @param bgr BGR颜色. +// @param rgb RGB颜色. // @param a 透明度. -// @return int ABGR颜色. -func RGBA2(bgr int, a byte) int { - return int((uint32(bgr) & 16777215) | uint32(a)<<24) -} - -// BGR 根据r, g, b组合成BGR颜色. -// -// @param r 红色分量. -// @param g 绿色分量. -// @param b 蓝色分量. -// @return int BGR颜色. -func BGR(r, g, b byte) int { - return int(uint32(r) | uint32(g)<<8 | uint32(b)<<16) +// @return int ARGB颜色. +func RGBA2(rgb int, a byte) int { + return int((uint32(rgb) & 16777215) | uint32(a)<<24) } // RGB 根据r, g, b组合成RGB颜色. @@ -103,67 +91,66 @@ func BGR(r, g, b byte) int { // @param b 蓝色分量. // @return int RGB颜色. func RGB(r, g, b byte) int { - return int(uint32(b) | uint32(g)<<8 | uint32(r)<<16) + return int(uint32(r) | uint32(g)<<8 | uint32(b)<<16) } -// RGB2ABGR 将RGB颜色转换到ABGR颜色. +// RGB2ARGB 将RGB颜色转换到ARGB颜色. // // @param rgb RGB颜色. // @param a 透明度. -// @return int ABGR颜色. -func RGB2ABGR(rgb int, a byte) int { - r := rgb % 256 - g := (rgb / 256) % 256 - b := rgb / 65536 - return ABGR(byte(r), byte(g), byte(b), a) +// @return int ARGB颜色. +func RGB2ARGB(rgb int, a byte) int { + r := byte(rgb & 255) + g := byte((rgb >> 8) & 255) + b := byte((rgb >> 16) & 255) + return ARGB(r, g, b, a) } -// RGB2BGR 将RGB颜色转换到BGR颜色. -// -// @param rgb RGB颜色. -// @return int BGR颜色. -func RGB2BGR(rgb int) int { - r := byte(rgb % 256) - g := byte((rgb / 256) % 256) - b := byte(rgb / 65536) - return BGR(r, g, b) -} - -// HexRGB2BGR 将十六进制RGB颜色转换到十进制BGR颜色. +// HexRGB2RGB 将十六进制RGB颜色转换到十进制RGB颜色. // // @param str 十六进制RGB颜色, 开头有没有#都可以. -// @return int BGR颜色. -func HexRGB2BGR(str string) int { - s := strings.TrimLeft(str, "#") - r, _ := strconv.ParseInt(s[:2], 16, 10) - g, _ := strconv.ParseInt(s[2:4], 16, 18) - b, _ := strconv.ParseInt(s[4:], 16, 10) - return BGR(byte(r), byte(g), byte(b)) +// @return int RGB颜色. +func HexRGB2RGB(str string) int { + if len(str) > 0 && str[0] == '#' { + str = str[1:] + } + if len(str) != 6 { + return 0 // 返回一个默认值或错误 + } + r := hexToByte(str[0:2]) + g := hexToByte(str[2:4]) + b := hexToByte(str[4:6]) + return RGB(r, g, b) } -// HexRGB2ABGR 将十六进制RGB颜色转换到十进制ABGR颜色. +// HexRGB2ARGB 将十六进制RGB颜色转换到十进制ARGB颜色. // // @param str 十六进制RGB颜色, 开头有没有#都可以. // @param a 透明度. -// @return int ABGR颜色. -func HexRGB2ABGR(str string, a byte) int { - s := strings.TrimLeft(str, "#") - r, _ := strconv.ParseInt(s[:2], 16, 10) - g, _ := strconv.ParseInt(s[2:4], 16, 18) - b, _ := strconv.ParseInt(s[4:], 16, 10) - return ABGR(byte(r), byte(g), byte(b), a) +// @return int ARGB颜色. +func HexRGB2ARGB(str string, a byte) int { + return ARGB2(HexRGB2RGB(str), a) } -// HexRGB2RGB 将十六进制RGB颜色转换到十进制RGB颜色. -// -// @param str 十六进制RGB颜色, 开头有没有#都可以. -// @return int RGB颜色. -func HexRGB2RGB(str string) int { - s := strings.TrimLeft(str, "#") - r, _ := strconv.ParseInt(s[:2], 16, 10) - g, _ := strconv.ParseInt(s[2:4], 16, 18) - b, _ := strconv.ParseInt(s[4:], 16, 10) - return RGB(byte(r), byte(g), byte(b)) +func hexToByte(s string) byte { + if len(s) != 2 { + return 0 // 返回一个默认值或错误 + } + nib1 := hexToNibble(s[0]) + nib2 := hexToNibble(s[1]) + return (nib1 << 4) | nib2 +} + +func hexToNibble(c byte) byte { + if c >= '0' && c <= '9' { + return c - '0' + } else if c >= 'A' && c <= 'F' { + return c - 'A' + 10 + } else if c >= 'a' && c <= 'f' { + return c - 'a' + 10 + } else { + return 0 // 返回一个默认值或错误 + } } // SetBnClicks 给一个窗口或布局元素中所有的按钮注册按钮单击事件. @@ -195,10 +182,3 @@ func SetBnClicks(HXCGUI int, onBnClick func(hEle int, pbHandled *bool) int) { } } } - -// Deprecated -// -// !已废弃, 请使用 xc.XWnd_ClientToScreen 或 wapi.ClientToScreen -func ClientToScreen(hWindow int, pPoint *POINT) { - XWnd_ClientToScreen(hWindow, pPoint) -} diff --git a/xc/common_test.go b/xc/common_test.go index b402f69..11c99cb 100644 --- a/xc/common_test.go +++ b/xc/common_test.go @@ -27,3 +27,21 @@ func TestSetBnClicks(t *testing.T) { }) }) } + +func TestARGB(t *testing.T) { + fmt.Println(xc.ARGB(255, 201, 100, 255)) + fmt.Println(xc.ARGB2(xc.RGB(255, 201, 100), 255)) + fmt.Println(xc.RGB(255, 201, 100)) + fmt.Println(xc.HexRGB2RGB("ffc964")) + fmt.Println(xc.RGB2ARGB(xc.HexRGB2RGB("ffc964"), 255)) +} + +func TestHexRGB2RGB(t *testing.T) { + fmt.Println(xc.HexRGB2RGB("#ffc964")) + fmt.Println(xc.HexRGB2RGB("ffc964")) +} + +func TestHexRGB2ARGB(t *testing.T) { + fmt.Println(xc.HexRGB2ARGB("#ffc964", 255)) + fmt.Println(xc.HexRGB2ARGB("ffc964", 255)) +} diff --git a/xc/datetime.go b/xc/datetime.go index f77c11d..67d82a9 100644 --- a/xc/datetime.go +++ b/xc/datetime.go @@ -71,7 +71,7 @@ func XDateTime_GetSelBkColor(hEle int) int { // // hEle: 元素句柄. // -// crSelectBk: 文字被选中背景色, ABGR 颜色. +// crSelectBk: 文字被选中背景色, ARGB 颜色. func XDateTime_SetSelBkColor(hEle int, crSelectBk int) int { r, _, _ := xDateTime_SetSelBkColor.Call(uintptr(hEle), uintptr(crSelectBk)) return int(r) diff --git a/xc/deprecated.go b/xc/deprecated.go new file mode 100644 index 0000000..adf2774 --- /dev/null +++ b/xc/deprecated.go @@ -0,0 +1,317 @@ +package xc + +import ( + "github.com/twgh/xcgui/xcc" +) + +/* +// //////////////////////////////////// 旧版函数 ////////////////////////////////////// +*/ + +// Deprecated +// +// !这是旧版函数, 请使用 ARGB +func ABGR(r, g, b, a byte) int { + return ARGB(r, g, b, a) +} + +// Deprecated +// +// !这是旧版函数, 请使用 ARGB2 +func ABGR2(rgb int, a byte) int { + return ARGB2(rgb, a) +} + +// Deprecated +// +// !这是旧版函数, 请使用 RGB2ARGB +func RGB2ABGR(rgb int, a byte) int { + return RGB2ARGB(rgb, a) +} + +// Deprecated +// +// !这是旧版函数, 请使用 HexRGB2ARGB +func HexRGB2ABGR(str string, a byte) int { + return HexRGB2ARGB(str, a) +} + +// Deprecated +// +// !这是旧版函数, 请使用 xc.XWnd_ClientToScreen 或 wapi.ClientToScreen +func ClientToScreen(hWindow int, pPoint *POINT) { + XWnd_ClientToScreen(hWindow, pPoint) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_AddRowText +func XList_AddItemText(hEle int, pText string) int { + return XList_AddRowText(hEle, pText) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_AddRowTextEx +func XList_AddItemTextEx(hEle int, pName string, pText string) int { + return XList_AddRowTextEx(hEle, pName, pText) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_AddRowImage +func XList_AddItemImage(hEle int, hImage int) int { + return XList_AddRowImage(hEle, hImage) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_AddRowImageEx +func XList_AddItemImageEx(hEle int, pName string, hImage int) int { + return XList_AddRowImageEx(hEle, pName, hImage) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_InsertRowText +func XList_InsertItemText(hEle int, iItem int, pValue string) int { + return XList_InsertRowText(hEle, iItem, pValue) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_InsertRowTextEx +func XList_InsertItemTextEx(hEle int, iItem int, pName string, pValue string) int { + return XList_InsertRowTextEx(hEle, iItem, pName, pValue) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_InsertRowImage +func XList_InsertItemImage(hEle int, iItem int, hImage int) int { + return XList_InsertRowImage(hEle, iItem, hImage) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_InsertRowImageEx +func XList_InsertItemImageEx(hEle int, iItem int, pName string, hImage int) int { + return XList_InsertRowImageEx(hEle, iItem, pName, hImage) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_DeleteRow +func XList_DeleteItem(hEle int, iRow int) bool { + return XList_DeleteRow(hEle, iRow) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_DeleteRowEx +func XList_DeleteItemEx(hEle int, iRow int, nCount int) bool { + return XList_DeleteRowEx(hEle, iRow, nCount) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_DeleteRowAll +func XList_DeleteItemAll(hEle int) int { + return XList_DeleteRowAll(hEle) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_SetSelectRow +func XList_SetSelectItem(hEle int, iRow int) bool { + return XList_SetSelectRow(hEle, iRow) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_GetSelectRow +func XList_GetSelectItem(hEle int) int { + return XList_GetSelectRow(hEle) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_GetSelectRowCount +func XList_GetSelectItemCount(hEle int) int { + return XList_GetSelectRowCount(hEle) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_AddSelectRow +func XList_AddSelectItem(hEle int, iRow int) bool { + return XList_AddSelectRow(hEle, iRow) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_VisibleRow +func XList_VisibleItem(hEle int, iRow int) int { + return XList_VisibleRow(hEle, iRow) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_CancelSelectRow +func XList_CancelSelectItem(hEle int, iRow int) bool { + return XList_CancelSelectRow(hEle, iRow) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_GetHeaderColumnIndexFromHXCGUI +func XList_GetHeaderItemIndexFromHXCGUI(hEle int, hXCGUI int) int { + return XList_GetHeaderColumnIndexFromHXCGUI(hEle, hXCGUI) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_GetRowIndexFromHXCGUI +func XList_GetItemIndexFromHXCGUI(hEle int, hXCGUI int) int { + return XList_GetRowIndexFromHXCGUI(hEle, hXCGUI) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_SetRowHeightDefault +func XList_SetItemHeightDefault(hEle int, nHeight int32, nSelHeight int32) int { + return XList_SetRowHeightDefault(hEle, nHeight, nSelHeight) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_GetRowHeightDefault +func XList_GetItemHeightDefault(hEle int, pHeight *int32, pSelHeight *int32) int { + return XList_GetRowHeightDefault(hEle, pHeight, pSelHeight) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_SetRowHeight +func XList_SetItemHeight(hEle int, iRow int, nHeight, nSelHeight int32) int { + return XList_SetRowHeight(hEle, iRow, nHeight, nSelHeight) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_GetRowHeight +func XList_GetItemHeight(hEle int, iRow int, pHeight, pSelHeight *int32) int { + return XList_GetRowHeight(hEle, iRow, pHeight, pSelHeight) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_EnableRowBkFull +func XList_EnableItemBkFullRow(hEle int, bFull bool) { + XList_EnableRowBkFull(hEle, bFull) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_SetDrawRowBkFlags +func XList_SetDrawItemBkFlags(hEle int, nFlags xcc.List_DrawItemBk_Flag_) { + XList_SetDrawRowBkFlags(hEle, nFlags) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XList_RefreshRow +func XList_RefreshItem(hEle int, iRow int) { + XList_RefreshRow(hEle, iRow) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XAdTable_AddRowText +func XAdTable_AddItemText(hAdapter int, pValue string) int32 { + return XAdTable_AddRowText(hAdapter, pValue) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XAdTable_AddRowTextEx +func XAdTable_AddItemTextEx(hAdapter int, pName string, pValue string) int32 { + return XAdTable_AddRowTextEx(hAdapter, pName, pValue) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XAdTable_AddRowImage +func XAdTable_AddItemImage(hAdapter int, hImage int) int32 { + return XAdTable_AddRowImage(hAdapter, hImage) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XAdTable_AddRowImageEx +func XAdTable_AddItemImageEx(hAdapter int, pName string, hImage int) int32 { + return XAdTable_AddRowImageEx(hAdapter, pName, hImage) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XAdTable_InsertRowText +func XAdTable_InsertItemText(hAdapter int, iRow int32, pValue string) int32 { + return XAdTable_InsertRowText(hAdapter, iRow, pValue) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XAdTable_InsertRowTextEx +func XAdTable_InsertItemTextEx(hAdapter int, iRow int32, pName string, pValue string) int32 { + return XAdTable_InsertRowTextEx(hAdapter, iRow, pName, pValue) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XAdTable_InsertRowImage +func XAdTable_InsertItemImage(hAdapter int, iRow int32, hImage int) int32 { + return XAdTable_InsertRowImage(hAdapter, iRow, hImage) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XAdTable_InsertRowImageEx +func XAdTable_InsertItemImageEx(hAdapter int, iRow int32, pName string, hImage int) int32 { + return XAdTable_InsertRowImageEx(hAdapter, iRow, pName, hImage) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XAdTable_GetCountRow +func XAdTable_GetCount(hAdapter int) int32 { + return XAdTable_GetCountRow(hAdapter) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XAdTable_DeleteRow +func XAdTable_DeleteItem(hAdapter int, iRow int32) bool { + return XAdTable_DeleteRow(hAdapter, iRow) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XAdTable_DeleteRowEx +func XAdTable_DeleteItemEx(hAdapter int, iRow int32, nCount int32) bool { + return XAdTable_DeleteRowEx(hAdapter, iRow, nCount) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XAdTable_DeleteRowAll +func XAdTable_DeleteItemAll(hAdapter int) { + XAdTable_DeleteRowAll(hAdapter) +} + +// Deprecated +// +// !这是旧版函数, 请使用 XBkM_SetInfo +func XBkM_SetBkInfo(hBkInfoM int, pText string) int32 { + return XBkM_SetInfo(hBkInfoM, pText) +} diff --git a/xc/draw.go b/xc/draw.go index 94eb7bd..eb85a0e 100644 --- a/xc/draw.go +++ b/xc/draw.go @@ -29,9 +29,8 @@ func XDraw_CreateGDI(hWindow int, hdc uintptr) int { // 绘制_销毁, 销毁图形绘制模块实例句柄. // // hDraw: 图形绘制句柄. -func XDraw_Destroy(hDraw int) int { - r, _, _ := xDraw_Destroy.Call(uintptr(hDraw)) - return int(r) +func XDraw_Destroy(hDraw int) { + xDraw_Destroy.Call(uintptr(hDraw)) } // 绘制_虚线, 绘制水平或垂直虚线. @@ -45,9 +44,8 @@ func XDraw_Destroy(hDraw int) int { // x2: 结束点x坐标. // // y2: 结束点y坐标. -func XDraw_Dottedline(hDraw int, x1 int, y1 int, x2 int, y2 int) int { - r, _, _ := xDraw_Dottedline.Call(uintptr(hDraw), uintptr(x1), uintptr(y1), uintptr(x2), uintptr(y2)) - return int(r) +func XDraw_Dottedline(hDraw int, x1, y1, x2, y2 int32) { + xDraw_Dottedline.Call(uintptr(hDraw), uintptr(x1), uintptr(y1), uintptr(x2), uintptr(y2)) } // 绘制_虚线F, 绘制水平或垂直虚线. @@ -61,9 +59,8 @@ func XDraw_Dottedline(hDraw int, x1 int, y1 int, x2 int, y2 int) int { // x2: 结束点x坐标. // // y2: 结束点y坐标. -func XDraw_DottedlineF(hDraw int, x1, y1, x2, y2 float32) int { - r, _, _ := xDraw_DottedlineF.Call(uintptr(hDraw), common.Float32Ptr(x1), common.Float32Ptr(y1), common.Float32Ptr(x2), common.Float32Ptr(y2)) - return int(r) +func XDraw_DottedlineF(hDraw int, x1, y1, x2, y2 float32) { + xDraw_DottedlineF.Call(uintptr(hDraw), common.Float32Ptr(x1), common.Float32Ptr(y1), common.Float32Ptr(x2), common.Float32Ptr(y2)) } // 绘制_圆弧. @@ -81,9 +78,8 @@ func XDraw_DottedlineF(hDraw int, x1, y1, x2, y2 float32) int { // startAngle: 起始角度. // // sweepAngle: 绘制角度, 从起始角度开始计算. -func XDraw_DrawArc(hDraw int, x, y int, nWidth int, nHeight int, startAngle float32, sweepAngle float32) int { - r, _, _ := xDraw_DrawArc.Call(uintptr(hDraw), uintptr(x), uintptr(y), uintptr(nWidth), uintptr(nHeight), common.Float32Ptr(startAngle), common.Float32Ptr(sweepAngle)) - return int(r) +func XDraw_DrawArc(hDraw int, x, y, nWidth, nHeight int32, startAngle, sweepAngle float32) { + xDraw_DrawArc.Call(uintptr(hDraw), uintptr(x), uintptr(y), uintptr(nWidth), uintptr(nHeight), common.Float32Ptr(startAngle), common.Float32Ptr(sweepAngle)) } // 绘制_圆弧F. @@ -101,9 +97,8 @@ func XDraw_DrawArc(hDraw int, x, y int, nWidth int, nHeight int, startAngle floa // startAngle: 起始角度. // // sweepAngle: 绘制角度, 从起始角度开始计算. -func XDraw_DrawArcF(hDraw int, x, y, nWidth, nHeight, startAngle, sweepAngle float32) int { - r, _, _ := xDraw_DrawArcF.Call(uintptr(hDraw), common.Float32Ptr(x), common.Float32Ptr(y), common.Float32Ptr(nWidth), common.Float32Ptr(nHeight), common.Float32Ptr(startAngle), common.Float32Ptr(sweepAngle)) - return int(r) +func XDraw_DrawArcF(hDraw int, x, y, nWidth, nHeight, startAngle, sweepAngle float32) { + xDraw_DrawArcF.Call(uintptr(hDraw), common.Float32Ptr(x), common.Float32Ptr(y), common.Float32Ptr(nWidth), common.Float32Ptr(nHeight), common.Float32Ptr(startAngle), common.Float32Ptr(sweepAngle)) } // 绘制_曲线, D2D暂时留空. @@ -115,9 +110,8 @@ func XDraw_DrawArcF(hDraw int, x, y, nWidth, nHeight, startAngle, sweepAngle flo // count: 数组大小. // // tension: 大于或等于0.0F的值,指定曲线的张力, D2D 忽略此参数. -func XDraw_DrawCurve(hDraw int, points []POINT, count int, tension float32) int { - r, _, _ := xDraw_DrawCurve.Call(uintptr(hDraw), uintptr(unsafe.Pointer(&points[0])), uintptr(count), common.Float32Ptr(tension)) - return int(r) +func XDraw_DrawCurve(hDraw int, points []POINT, count int32, tension float32) { + xDraw_DrawCurve.Call(uintptr(hDraw), uintptr(unsafe.Pointer(&points[0])), uintptr(count), common.Float32Ptr(tension)) } // 绘制_曲线F, D2D暂时留空. @@ -129,9 +123,8 @@ func XDraw_DrawCurve(hDraw int, points []POINT, count int, tension float32) int // count: 数组大小. // // tension: 大于或等于0.0F的值,指定曲线的张力, D2D 忽略此参数. -func XDraw_DrawCurveF(hDraw int, points []POINTF, count int, tension float32) int { - r, _, _ := xDraw_DrawCurveF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(&points[0])), uintptr(count), common.Float32Ptr(tension)) - return int(r) +func XDraw_DrawCurveF(hDraw int, points []POINTF, count int32, tension float32) { + xDraw_DrawCurveF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(&points[0])), uintptr(count), common.Float32Ptr(tension)) } // 绘制_线条. @@ -145,9 +138,8 @@ func XDraw_DrawCurveF(hDraw int, points []POINTF, count int, tension float32) in // x2: 坐标. // // y2: 坐标. -func XDraw_DrawLine(hDraw int, x1 int, y1 int, x2 int, y2 int) int { - r, _, _ := xDraw_DrawLine.Call(uintptr(hDraw), uintptr(x1), uintptr(y1), uintptr(x2), uintptr(y2)) - return int(r) +func XDraw_DrawLine(hDraw int, x1, y1, x2, y2 int32) { + xDraw_DrawLine.Call(uintptr(hDraw), uintptr(x1), uintptr(y1), uintptr(x2), uintptr(y2)) } // 绘制_线条F. @@ -161,9 +153,8 @@ func XDraw_DrawLine(hDraw int, x1 int, y1 int, x2 int, y2 int) int { // x2: 坐标. // // y2: 坐标. -func XDraw_DrawLineF(hDraw int, x1, y1, x2, y2 float32) int { - r, _, _ := xDraw_DrawLineF.Call(uintptr(hDraw), common.Float32Ptr(x1), common.Float32Ptr(y1), common.Float32Ptr(x2), common.Float32Ptr(y2)) - return int(r) +func XDraw_DrawLineF(hDraw int, x1, y1, x2, y2 float32) { + xDraw_DrawLineF.Call(uintptr(hDraw), common.Float32Ptr(x1), common.Float32Ptr(y1), common.Float32Ptr(x2), common.Float32Ptr(y2)) } // 绘制_多边形, 绘制多边形. @@ -173,9 +164,8 @@ func XDraw_DrawLineF(hDraw int, x1, y1, x2, y2 float32) int { // points: 顶点坐标数组. // // nCount: 顶点数量. -func XDraw_DrawPolygon(hDraw int, points []POINT, nCount int) int { - r, _, _ := xDraw_DrawPolygon.Call(uintptr(hDraw), uintptr(unsafe.Pointer(&points[0])), uintptr(nCount)) - return int(r) +func XDraw_DrawPolygon(hDraw int, points []POINT, nCount int32) { + xDraw_DrawPolygon.Call(uintptr(hDraw), uintptr(unsafe.Pointer(&points[0])), uintptr(nCount)) } // 绘制_多边形F, 绘制多边形. @@ -185,9 +175,8 @@ func XDraw_DrawPolygon(hDraw int, points []POINT, nCount int) int { // points: 顶点坐标数组. // // nCount: 顶点数量. -func XDraw_DrawPolygonF(hDraw int, points []POINTF, nCount int) int { - r, _, _ := xDraw_DrawPolygonF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(&points[0])), uintptr(nCount)) - return int(r) +func XDraw_DrawPolygonF(hDraw int, points []POINTF, nCount int32) { + xDraw_DrawPolygonF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(&points[0])), uintptr(nCount)) } // 绘制_矩形, 绘制矩形边框. @@ -195,9 +184,8 @@ func XDraw_DrawPolygonF(hDraw int, points []POINTF, nCount int) int { // hDraw: 图形绘制句柄. // // pRect: 矩形坐标 . -func XDraw_DrawRect(hDraw int, pRect *RECT) int { - r, _, _ := xDraw_DrawRect.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) - return int(r) +func XDraw_DrawRect(hDraw int, pRect *RECT) { + xDraw_DrawRect.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) } // 绘制_矩形F, 绘制矩形边框. @@ -205,9 +193,8 @@ func XDraw_DrawRect(hDraw int, pRect *RECT) int { // hDraw: 图形绘制句柄. // // pRect: 矩形坐标 . -func XDraw_DrawRectF(hDraw int, pRect *RECTF) int { - r, _, _ := xDraw_DrawRectF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) - return int(r) +func XDraw_DrawRectF(hDraw int, pRect *RECTF) { + xDraw_DrawRectF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) } // 绘制_置偏移, 设置坐标偏移量, X向左偏移为负数, 向右偏移为正数. @@ -217,9 +204,8 @@ func XDraw_DrawRectF(hDraw int, pRect *RECTF) int { // x: X轴偏移量. // // y: Y轴偏移量. -func XDraw_SetOffset(hDraw int, x, y int32) int { - r, _, _ := xDraw_SetOffset.Call(uintptr(hDraw), uintptr(x), uintptr(y)) - return int(r) +func XDraw_SetOffset(hDraw int, x, y int32) { + xDraw_SetOffset.Call(uintptr(hDraw), uintptr(x), uintptr(y)) } // 绘制_取偏移, 获取坐标偏移量, X向左偏移为负数, 向右偏移为正数. @@ -229,17 +215,15 @@ func XDraw_SetOffset(hDraw int, x, y int32) int { // pX: 接收X轴偏移量. // // pY: 接收Y轴偏移量. -func XDraw_GetOffset(hDraw int, pX, pY *int32) int { - r, _, _ := xDraw_GetOffset.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pX)), uintptr(unsafe.Pointer(pY))) - return int(r) +func XDraw_GetOffset(hDraw int, pX, pY *int32) { + xDraw_GetOffset.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pX)), uintptr(unsafe.Pointer(pY))) } // 绘制_还原状态, 还原状态, 释放用户绑定的GDI对象, 例如画刷, 画笔. // // hDraw: 图形绘制句柄. -func XDraw_GDI_RestoreGDIOBJ(hDraw int) int { - r, _, _ := xDraw_GDI_RestoreGDIOBJ.Call(uintptr(hDraw)) - return int(r) +func XDraw_GDI_RestoreGDIOBJ(hDraw int) { + xDraw_GDI_RestoreGDIOBJ.Call(uintptr(hDraw)) } // 绘制_取HDC, 获取绑定的设备上下文HDC, 返回HDC句柄. @@ -254,10 +238,9 @@ func XDraw_GetHDC(hDraw int) uintptr { // // hDraw: 图形绘制句柄. // -// color: ABGR 颜色值. -func XDraw_SetBrushColor(hDraw int, color int) int { - r, _, _ := xDraw_SetBrushColor.Call(uintptr(hDraw), uintptr(color)) - return int(r) +// color: xc.ARGB 颜色值. +func XDraw_SetBrushColor(hDraw int, color int) { + xDraw_SetBrushColor.Call(uintptr(hDraw), uintptr(color)) } // 绘制_置文本垂直, 设置文本垂直显示. @@ -265,9 +248,8 @@ func XDraw_SetBrushColor(hDraw int, color int) int { // hDraw: 图形绘制句柄. // // bVertical: 是否垂直显示文本. -func XDraw_SetTextVertical(hDraw int, bVertical bool) int { - r, _, _ := xDraw_SetTextVertical.Call(uintptr(hDraw), common.BoolPtr(bVertical)) - return int(r) +func XDraw_SetTextVertical(hDraw int, bVertical bool) { + xDraw_SetTextVertical.Call(uintptr(hDraw), common.BoolPtr(bVertical)) } // 绘制_置文本对齐, 设置文本对齐. @@ -275,9 +257,8 @@ func XDraw_SetTextVertical(hDraw int, bVertical bool) int { // hDraw: 图形绘制句柄. // // nFlags: 对齐标识, TextFormatFlag_, TextAlignFlag_, TextTrimming_. -func XDraw_SetTextAlign(hDraw int, nFlags xcc.TextFormatFlag_) int { - r, _, _ := xDraw_SetTextAlign.Call(uintptr(hDraw), uintptr(nFlags)) - return int(r) +func XDraw_SetTextAlign(hDraw int, nFlags xcc.TextFormatFlag_) { + xDraw_SetTextAlign.Call(uintptr(hDraw), uintptr(nFlags)) } // 绘制_置字体. @@ -285,9 +266,8 @@ func XDraw_SetTextAlign(hDraw int, nFlags xcc.TextFormatFlag_) int { // hDraw: 图形绘制句柄. // // hFontx: 炫彩字体. -func XDraw_SetFont(hDraw int, hFontx int) int { - r, _, _ := xDraw_SetFont.Call(uintptr(hDraw), uintptr(hFontx)) - return int(r) +func XDraw_SetFont(hDraw int, hFontx int) { + xDraw_SetFont.Call(uintptr(hDraw), uintptr(hFontx)) } // 绘制_置线宽. @@ -295,9 +275,8 @@ func XDraw_SetFont(hDraw int, hFontx int) int { // hDraw: 图形绘制句柄. // // nWidth: 宽度. -func XDraw_SetLineWidth(hDraw int, nWidth int) int { - r, _, _ := xDraw_SetLineWidth.Call(uintptr(hDraw), uintptr(nWidth)) - return int(r) +func XDraw_SetLineWidth(hDraw int, nWidth int32) { + xDraw_SetLineWidth.Call(uintptr(hDraw), uintptr(nWidth)) } // 绘制_置线宽F. @@ -305,9 +284,8 @@ func XDraw_SetLineWidth(hDraw int, nWidth int) int { // hDraw: 图形绘制句柄. // // nWidth: 宽度. -func XDraw_SetLineWidthF(hDraw int, nWidth float32) int { - r, _, _ := xDraw_SetLineWidthF.Call(uintptr(hDraw), common.Float32Ptr(nWidth)) - return int(r) +func XDraw_SetLineWidthF(hDraw int, nWidth float32) { + xDraw_SetLineWidthF.Call(uintptr(hDraw), common.Float32Ptr(nWidth)) } // 绘制_置背景模式, SetBkMode() 参见MSDN. @@ -315,9 +293,9 @@ func XDraw_SetLineWidthF(hDraw int, nWidth float32) int { // hDraw: 图形绘制句柄. // // bTransparent: 参见MSDN. -func XDraw_GDI_SetBkMode(hDraw int, bTransparent bool) int { +func XDraw_GDI_SetBkMode(hDraw int, bTransparent bool) int32 { r, _, _ := xDraw_GDI_SetBkMode.Call(uintptr(hDraw), common.BoolPtr(bTransparent)) - return int(r) + return int32(r) } // 绘制_置裁剪区域, 设置裁剪区域. @@ -325,9 +303,8 @@ func XDraw_GDI_SetBkMode(hDraw int, bTransparent bool) int { // hDraw: 图形绘制句柄. // // pRect: 区域坐标. -func XDraw_SetClipRect(hDraw int, pRect *RECT) int { - r, _, _ := xDraw_SetClipRect.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) - return int(r) +func XDraw_SetClipRect(hDraw int, pRect *RECT) { + xDraw_SetClipRect.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) } // 绘制_置D2D文本渲染模式. @@ -335,17 +312,15 @@ func XDraw_SetClipRect(hDraw int, pRect *RECT) int { // hDraw: 图形绘制句柄. // // mode 渲染模式 XC_DWRITE_RENDERING_MODE_. -func XDraw_SetD2dTextRenderingMode(hDraw int, mode xcc.XC_DWRITE_RENDERING_MODE_) int { - r, _, _ := xDraw_SetD2dTextRenderingMode.Call(uintptr(hDraw), uintptr(mode)) - return int(r) +func XDraw_SetD2dTextRenderingMode(hDraw int, mode xcc.XC_DWRITE_RENDERING_MODE_) { + xDraw_SetD2dTextRenderingMode.Call(uintptr(hDraw), uintptr(mode)) } // 绘制_清除裁剪区域. // // hDraw: 图形绘制句柄. -func XDraw_ClearClip(hDraw int) int { - r, _, _ := xDraw_ClearClip.Call(uintptr(hDraw)) - return int(r) +func XDraw_ClearClip(hDraw int) { + xDraw_ClearClip.Call(uintptr(hDraw)) } // 绘制_启用平滑模式. @@ -353,9 +328,8 @@ func XDraw_ClearClip(hDraw int) int { // hDraw: 图形绘制句柄. // // bEnable: 是否启用. -func XDraw_EnableSmoothingMode(hDraw int, bEnable bool) int { - r, _, _ := xDraw_EnableSmoothingMode.Call(uintptr(hDraw), common.BoolPtr(bEnable)) - return int(r) +func XDraw_EnableSmoothingMode(hDraw int, bEnable bool) { + xDraw_EnableSmoothingMode.Call(uintptr(hDraw), common.BoolPtr(bEnable)) } // 绘制_启用窗口透明判断, 当启用之后, 调用GDI+函数时, 如果参数alpha=255, 将自动修改为254, 应对GDI+的bug, 否则透明通道异常. @@ -363,16 +337,15 @@ func XDraw_EnableSmoothingMode(hDraw int, bEnable bool) int { // hDraw: 图形绘制句柄. // // bTransparent: 是否启用. -func XDraw_EnableWndTransparent(hDraw int, bTransparent bool) int { - r, _, _ := xDraw_EnableWndTransparent.Call(uintptr(hDraw), common.BoolPtr(bTransparent)) - return int(r) +func XDraw_EnableWndTransparent(hDraw int, bTransparent bool) { + xDraw_EnableWndTransparent.Call(uintptr(hDraw), common.BoolPtr(bTransparent)) } // 绘制_创建实心画刷, GDI创建具有指定的纯色逻辑刷. // // hDraw: 图形绘制句柄. // -// crColor: 画刷颜色, RGB颜色. +// crColor: 画刷颜色, RGB 颜色. func XDraw_GDI_CreateSolidBrush(hDraw int, crColor int) int { r, _, _ := xDraw_GDI_CreateSolidBrush.Call(uintptr(hDraw), uintptr(crColor)) return int(r) @@ -386,8 +359,8 @@ func XDraw_GDI_CreateSolidBrush(hDraw int, crColor int) int { // // nWidth: 画笔宽度. // -// crColor: RGB颜色. -func XDraw_GDI_CreatePen(hDraw int, fnPenStyle int, nWidth int, crColor int) int { +// crColor: RGB 颜色. +func XDraw_GDI_CreatePen(hDraw int, fnPenStyle, nWidth int32, crColor int) int { r, _, _ := xDraw_GDI_CreatePen.Call(uintptr(hDraw), uintptr(fnPenStyle), uintptr(nWidth), uintptr(crColor)) return int(r) } @@ -403,7 +376,7 @@ func XDraw_GDI_CreatePen(hDraw int, fnPenStyle int, nWidth int, crColor int) int // nRightRect: 右下角X坐标. // // nBottomRect: 右下角Y坐标. -func XDraw_GDI_CreateRectRgn(hDraw int, nLeftRect int, nTopRect int, nRightRect int, nBottomRect int) int { +func XDraw_GDI_CreateRectRgn(hDraw int, nLeftRect, nTopRect, nRightRect, nBottomRect int32) int { r, _, _ := xDraw_GDI_CreateRectRgn.Call(uintptr(hDraw), uintptr(nLeftRect), uintptr(nTopRect), uintptr(nRightRect), uintptr(nBottomRect)) return int(r) } @@ -423,7 +396,7 @@ func XDraw_GDI_CreateRectRgn(hDraw int, nLeftRect int, nTopRect int, nRightRect // nWidthEllipse: 椭圆的宽度. // // nHeightEllipse: 椭圆的高度. -func XDraw_GDI_CreateRoundRectRgn(hDraw int, nLeftRect int, nTopRect int, nRightRect int, nBottomRect int, nWidthEllipse int, nHeightEllipse int) int { +func XDraw_GDI_CreateRoundRectRgn(hDraw int, nLeftRect, nTopRect, nRightRect, nBottomRect, nWidthEllipse, nHeightEllipse int32) int { r, _, _ := xDraw_GDI_CreateRoundRectRgn.Call(uintptr(hDraw), uintptr(nLeftRect), uintptr(nTopRect), uintptr(nRightRect), uintptr(nBottomRect), uintptr(nWidthEllipse), uintptr(nHeightEllipse)) return int(r) } @@ -441,7 +414,7 @@ func XDraw_GDI_CreateRoundRectRgn(hDraw int, nLeftRect int, nTopRect int, nRight // ALTERNATE Selects alternate mode (fills area between odd-numbered and even-numbered polygon sides on each scan line). // // WINDING Selects winding mode (fills any region with a nonzero winding value). -func XDraw_GDI_CreatePolygonRgn(hDraw int, pPt []POINT, cPoints int, fnPolyFillMode int) int { +func XDraw_GDI_CreatePolygonRgn(hDraw int, pPt []POINT, cPoints, fnPolyFillMode int32) int { r, _, _ := xDraw_GDI_CreatePolygonRgn.Call(uintptr(hDraw), uintptr(unsafe.Pointer(&pPt[0])), uintptr(cPoints), uintptr(fnPolyFillMode)) return int(r) } @@ -461,9 +434,9 @@ func XDraw_GDI_CreatePolygonRgn(hDraw int, pPt []POINT, cPoints int, fnPolyFillM // COMPLEXREGION Region is more than one rectangle. // // ERROR An error occurred. (The previous clipping region is unaffected). -func XDraw_GDI_SelectClipRgn(hDraw int, hRgn int) int { +func XDraw_GDI_SelectClipRgn(hDraw int, hRgn int) int32 { r, _, _ := xDraw_GDI_SelectClipRgn.Call(uintptr(hDraw), uintptr(hRgn)) - return int(r) + return int32(r) } // 绘制_填充矩形, 通过使用指定的刷子填充一个矩形, 此功能包括左侧和顶部的边界, 但不包括矩形的右边和底部边界. @@ -471,9 +444,8 @@ func XDraw_GDI_SelectClipRgn(hDraw int, hRgn int) int { // hDraw: 图形绘制句柄. // // pRect: 矩形区域. -func XDraw_FillRect(hDraw int, pRect *RECT) int { - r, _, _ := xDraw_FillRect.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) - return int(r) +func XDraw_FillRect(hDraw int, pRect *RECT) { + xDraw_FillRect.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) } // 绘制_填充矩形F, 通过使用指定的刷子填充一个矩形, 此功能包括左侧和顶部的边界, 但不包括矩形的右边和底部边界. @@ -481,9 +453,8 @@ func XDraw_FillRect(hDraw int, pRect *RECT) int { // hDraw: 图形绘制句柄. // // pRect: 矩形区域. -func XDraw_FillRectF(hDraw int, pRect *RECTF) int { - r, _, _ := xDraw_FillRectF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) - return int(r) +func XDraw_FillRectF(hDraw int, pRect *RECTF) { + xDraw_FillRectF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) } // 绘制_填充矩形指定颜色. @@ -492,10 +463,9 @@ func XDraw_FillRectF(hDraw int, pRect *RECTF) int { // // pRect: 矩形区域. // -// color: ABGR 颜色. -func XDraw_FillRectColor(hDraw int, pRect *RECT, color int) int { - r, _, _ := xDraw_FillRectColor.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(color)) - return int(r) +// color: ARGB 颜色. +func XDraw_FillRectColor(hDraw int, pRect *RECT, color int) { + xDraw_FillRectColor.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(color)) } // 绘制_填充矩形指定颜色F. @@ -504,10 +474,9 @@ func XDraw_FillRectColor(hDraw int, pRect *RECT, color int) int { // // pRect: 矩形区域. // -// color: ABGR 颜色. -func XDraw_FillRectColorF(hDraw int, pRect *RECTF, color int) int { - r, _, _ := xDraw_FillRectColorF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(color)) - return int(r) +// color: ARGB 颜色. +func XDraw_FillRectColorF(hDraw int, pRect *RECTF, color int) { + xDraw_FillRectColorF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(color)) } // 绘制_填充区域, 通过使用指定的画刷填充一个区域. @@ -527,9 +496,8 @@ func XDraw_GDI_FillRgn(hDraw int, hrgn int, hbr int) bool { // hDraw: 图形绘制句柄. // // pRect: 矩形区域. -func XDraw_FillEllipse(hDraw int, pRect *RECT) int { - r, _, _ := xDraw_FillEllipse.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) - return int(r) +func XDraw_FillEllipse(hDraw int, pRect *RECT) { + xDraw_FillEllipse.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) } // 绘制_填充圆形F. @@ -537,9 +505,8 @@ func XDraw_FillEllipse(hDraw int, pRect *RECT) int { // hDraw: 图形绘制句柄. // // pRect: 矩形区域. -func XDraw_FillEllipseF(hDraw int, pRect *RECTF) int { - r, _, _ := xDraw_FillEllipseF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) - return int(r) +func XDraw_FillEllipseF(hDraw int, pRect *RECTF) { + xDraw_FillEllipseF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) } // 绘制_圆形, 绘制圆边框. @@ -547,9 +514,8 @@ func XDraw_FillEllipseF(hDraw int, pRect *RECTF) int { // hDraw: 图形绘制句柄. // // pRect: 矩形区域. -func XDraw_DrawEllipse(hDraw int, pRect *RECT) int { - r, _, _ := xDraw_DrawEllipse.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) - return int(r) +func XDraw_DrawEllipse(hDraw int, pRect *RECT) { + xDraw_DrawEllipse.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) } // 绘制_填充圆角矩形. @@ -561,9 +527,8 @@ func XDraw_DrawEllipse(hDraw int, pRect *RECT) int { // nWidth: 圆角宽度. // // nHeight: 圆角高度. -func XDraw_FillRoundRect(hDraw int, pRect *RECT, nWidth, nHeight int) int { - r, _, _ := xDraw_FillRoundRect.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(nWidth), uintptr(nHeight)) - return int(r) +func XDraw_FillRoundRect(hDraw int, pRect *RECT, nWidth, nHeight int32) { + xDraw_FillRoundRect.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(nWidth), uintptr(nHeight)) } // 绘制_填充圆角矩形F. @@ -575,9 +540,8 @@ func XDraw_FillRoundRect(hDraw int, pRect *RECT, nWidth, nHeight int) int { // nWidth: 圆角宽度. // // nHeight: 圆角高度. -func XDraw_FillRoundRectF(hDraw int, pRect *RECTF, nWidth, nHeight float32) int { - r, _, _ := xDraw_FillRoundRectF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), common.Float32Ptr(nWidth), common.Float32Ptr(nHeight)) - return int(r) +func XDraw_FillRoundRectF(hDraw int, pRect *RECTF, nWidth, nHeight float32) { + xDraw_FillRoundRectF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), common.Float32Ptr(nWidth), common.Float32Ptr(nHeight)) } // 绘制_圆角矩形, 绘制圆角矩形边框. @@ -589,9 +553,8 @@ func XDraw_FillRoundRectF(hDraw int, pRect *RECTF, nWidth, nHeight float32) int // nWidth: 圆角宽度. // // nHeight: 圆角高度. -func XDraw_DrawRoundRect(hDraw int, pRect *RECT, nWidth int, nHeight int) int { - r, _, _ := xDraw_DrawRoundRect.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(nWidth), uintptr(nHeight)) - return int(r) +func XDraw_DrawRoundRect(hDraw int, pRect *RECT, nWidth, nHeight int32) { + xDraw_DrawRoundRect.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(nWidth), uintptr(nHeight)) } // 绘制_圆角矩形F, 绘制圆角矩形边框. @@ -603,9 +566,8 @@ func XDraw_DrawRoundRect(hDraw int, pRect *RECT, nWidth int, nHeight int) int { // nWidth: 圆角宽度. // // nHeight: 圆角高度. -func XDraw_DrawRoundRectF(hDraw int, pRect *RECT, nWidth, nHeight float32) int { - r, _, _ := xDraw_DrawRoundRectF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), common.Float32Ptr(nWidth), common.Float32Ptr(nHeight)) - return int(r) +func XDraw_DrawRoundRectF(hDraw int, pRect *RECT, nWidth, nHeight float32) { + xDraw_DrawRoundRectF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), common.Float32Ptr(nWidth), common.Float32Ptr(nHeight)) } // 绘制_填充圆角矩形扩展. @@ -621,9 +583,8 @@ func XDraw_DrawRoundRectF(hDraw int, pRect *RECT, nWidth, nHeight float32) int { // nRightBottom: 圆角大小. // // nLeftBottom: 圆角大小. -func XDraw_FillRoundRectEx(hDraw int, pRect *RECT, nLeftTop, nRightTop, nRightBottom, nLeftBottom int) int { - r, _, _ := xDraw_FillRoundRectEx.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(nLeftTop), uintptr(nRightTop), uintptr(nRightBottom), uintptr(nLeftBottom)) - return int(r) +func XDraw_FillRoundRectEx(hDraw int, pRect *RECT, nLeftTop, nRightTop, nRightBottom, nLeftBottom int32) { + xDraw_FillRoundRectEx.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(nLeftTop), uintptr(nRightTop), uintptr(nRightBottom), uintptr(nLeftBottom)) } // 绘制_填充圆角矩形扩展F. @@ -639,9 +600,8 @@ func XDraw_FillRoundRectEx(hDraw int, pRect *RECT, nLeftTop, nRightTop, nRightBo // nRightBottom: 圆角大小. // // nLeftBottom: 圆角大小. -func XDraw_FillRoundRectExF(hDraw int, pRect *RECTF, nLeftTop, nRightTop, nRightBottom, nLeftBottom float32) int { - r, _, _ := xDraw_FillRoundRectExF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), common.Float32Ptr(nLeftTop), common.Float32Ptr(nRightTop), common.Float32Ptr(nRightBottom), common.Float32Ptr(nLeftBottom)) - return int(r) +func XDraw_FillRoundRectExF(hDraw int, pRect *RECTF, nLeftTop, nRightTop, nRightBottom, nLeftBottom float32) { + xDraw_FillRoundRectExF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), common.Float32Ptr(nLeftTop), common.Float32Ptr(nRightTop), common.Float32Ptr(nRightBottom), common.Float32Ptr(nLeftBottom)) } // 绘制_圆角矩形扩展, 绘制圆角矩形边框. @@ -657,9 +617,8 @@ func XDraw_FillRoundRectExF(hDraw int, pRect *RECTF, nLeftTop, nRightTop, nRight // nRightBottom: 圆角大小. // // nLeftBottom: 圆角大小. -func XDraw_DrawRoundRectEx(hDraw int, pRect *RECT, nLeftTop int, nRightTop int, nRightBottom int, nLeftBottom int) int { - r, _, _ := xDraw_DrawRoundRectEx.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(nLeftTop), uintptr(nRightTop), uintptr(nRightBottom), uintptr(nLeftBottom)) - return int(r) +func XDraw_DrawRoundRectEx(hDraw int, pRect *RECT, nLeftTop, nRightTop, nRightBottom, nLeftBottom int32) { + xDraw_DrawRoundRectEx.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(nLeftTop), uintptr(nRightTop), uintptr(nRightBottom), uintptr(nLeftBottom)) } // 绘制_圆角矩形扩展F, 绘制圆角矩形边框. @@ -675,9 +634,8 @@ func XDraw_DrawRoundRectEx(hDraw int, pRect *RECT, nLeftTop int, nRightTop int, // nRightBottom: 圆角大小. // // nLeftBottom: 圆角大小. -func XDraw_DrawRoundRectExF(hDraw int, pRect *RECT, nLeftTop, nRightTop, nRightBottom, nLeftBottom float32) int { - r, _, _ := xDraw_DrawRoundRectExF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), common.Float32Ptr(nLeftTop), common.Float32Ptr(nRightTop), common.Float32Ptr(nRightBottom), common.Float32Ptr(nLeftBottom)) - return int(r) +func XDraw_DrawRoundRectExF(hDraw int, pRect *RECT, nLeftTop, nRightTop, nRightBottom, nLeftBottom float32) { + xDraw_DrawRoundRectExF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), common.Float32Ptr(nLeftTop), common.Float32Ptr(nRightTop), common.Float32Ptr(nRightBottom), common.Float32Ptr(nLeftBottom)) } // 绘制_矩形, 绘制矩形, 使用当前的画刷和画笔. 如果函数成功, 返回非零值, 如果函数失败, 返回值是零. @@ -691,7 +649,7 @@ func XDraw_DrawRoundRectExF(hDraw int, pRect *RECT, nLeftTop, nRightTop, nRightB // nRightRect: 右下角X坐标. // // nBottomRect: 右下角Y坐标. -func XDraw_GDI_Rectangle(hDraw int, nLeftRect int, nTopRect int, nRightRect int, nBottomRect int) bool { +func XDraw_GDI_Rectangle(hDraw int, nLeftRect, nTopRect, nRightRect, nBottomRect int32) bool { r, _, _ := xDraw_GDI_Rectangle.Call(uintptr(hDraw), uintptr(nLeftRect), uintptr(nTopRect), uintptr(nRightRect), uintptr(nBottomRect)) return r != 0 } @@ -702,14 +660,13 @@ func XDraw_GDI_Rectangle(hDraw int, nLeftRect int, nTopRect int, nRightRect int, // // pRect: 矩形坐标. // -// color1: 开始颜色, ABGR 颜色. +// color1: 开始颜色, ARGB 颜色. // -// color2: 结束颜色, ABGR 颜色. +// color2: 结束颜色, ARGB 颜色. // // mode: 模式, GRADIENT_FILL_. -func XDraw_GradientFill2(hDraw int, pRect *RECT, color1 int, color2 int, mode xcc.GRADIENT_FILL_) int { - r, _, _ := xDraw_GradientFill2.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(color1), uintptr(color2), uintptr(mode)) - return int(r) +func XDraw_GradientFill2(hDraw int, pRect *RECT, color1 int, color2 int, mode xcc.GRADIENT_FILL_) { + xDraw_GradientFill2.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(color1), uintptr(color2), uintptr(mode)) } // 绘制_渐变填充2F, 渐变填充, 从一种颜色过渡到另一种颜色. @@ -718,14 +675,13 @@ func XDraw_GradientFill2(hDraw int, pRect *RECT, color1 int, color2 int, mode xc // // pRect: 矩形坐标. // -// color1: 开始颜色, ABGR 颜色. +// color1: 开始颜色, ARGB 颜色. // -// color2: 结束颜色, ABGR 颜色. +// color2: 结束颜色, ARGB 颜色. // // mode: 模式, GRADIENT_FILL_. -func XDraw_GradientFill2F(hDraw int, pRect *RECTF, color1 int, color2 int, mode xcc.GRADIENT_FILL_) int { - r, _, _ := xDraw_GradientFill2F.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(color1), uintptr(color2), uintptr(mode)) - return int(r) +func XDraw_GradientFill2F(hDraw int, pRect *RECTF, color1 int, color2 int, mode xcc.GRADIENT_FILL_) { + xDraw_GradientFill2F.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(color1), uintptr(color2), uintptr(mode)) } // 绘制_渐变填充4, 渐变填充,从一种颜色过渡到另一种颜色. @@ -734,18 +690,17 @@ func XDraw_GradientFill2F(hDraw int, pRect *RECTF, color1 int, color2 int, mode // // pRect: 矩形坐标. // -// color1: 开始颜色, ABGR 颜色. +// color1: 开始颜色, ARGB 颜色. // -// color2: 结束颜色, ABGR 颜色. +// color2: 结束颜色, ARGB 颜色. // -// color3: 开始颜色, ABGR 颜色. +// color3: 开始颜色, ARGB 颜色. // -// color4: 结束颜色, ABGR 颜色. +// color4: 结束颜色, ARGB 颜色. // // mode: 模式, GRADIENT_FILL_. -func XDraw_GradientFill4(hDraw int, pRect *RECT, color1 int, color2 int, color3 int, color4 int, mode xcc.GRADIENT_FILL_) bool { - r, _, _ := xDraw_GradientFill4.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(color1), uintptr(color2), uintptr(color3), uintptr(color4), uintptr(mode)) - return r != 0 +func XDraw_GradientFill4(hDraw int, pRect *RECT, color1 int, color2 int, color3 int, color4 int, mode xcc.GRADIENT_FILL_) { + xDraw_GradientFill4.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(color1), uintptr(color2), uintptr(color3), uintptr(color4), uintptr(mode)) } // 绘制_渐变填充4F, 渐变填充,从一种颜色过渡到另一种颜色. @@ -754,18 +709,17 @@ func XDraw_GradientFill4(hDraw int, pRect *RECT, color1 int, color2 int, color3 // // pRect: 矩形坐标. // -// color1: 开始颜色, ABGR 颜色. +// color1: 开始颜色, ARGB 颜色. // -// color2: 结束颜色, ABGR 颜色. +// color2: 结束颜色, ARGB 颜色. // -// color3: 开始颜色, ABGR 颜色. +// color3: 开始颜色, ARGB 颜色. // -// color4: 结束颜色, ABGR 颜色. +// color4: 结束颜色, ARGB 颜色. // // mode: 模式, GRADIENT_FILL_. -func XDraw_GradientFill4F(hDraw int, pRect *RECTF, color1 int, color2 int, color3 int, color4 int, mode xcc.GRADIENT_FILL_) bool { - r, _, _ := xDraw_GradientFill4F.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(color1), uintptr(color2), uintptr(color3), uintptr(color4), uintptr(mode)) - return r != 0 +func XDraw_GradientFill4F(hDraw int, pRect *RECTF, color1 int, color2 int, color3 int, color4 int, mode xcc.GRADIENT_FILL_) { + xDraw_GradientFill4F.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect)), uintptr(color1), uintptr(color2), uintptr(color3), uintptr(color4), uintptr(mode)) } // 绘制_边框区域, 绘制边框, 使用指定的画刷绘制指定的区域的边框. 如果函数成功, 返回非零值, 如果函数失败, 返回值是零. @@ -779,7 +733,7 @@ func XDraw_GradientFill4F(hDraw int, pRect *RECTF, color1 int, color2 int, color // nWidth: 边框宽度, 垂直边. // // nHeight: 边框高度, 水平边. -func XDraw_GDI_FrameRgn(hDraw int, hrgn int, hbr int, nWidth int, nHeight int) bool { +func XDraw_GDI_FrameRgn(hDraw int, hrgn int, hbr int, nWidth, nHeight int32) bool { r, _, _ := xDraw_GDI_FrameRgn.Call(uintptr(hDraw), uintptr(hrgn), uintptr(hbr), uintptr(nWidth), uintptr(nHeight)) return r != 0 } @@ -789,9 +743,8 @@ func XDraw_GDI_FrameRgn(hDraw int, hrgn int, hbr int, nWidth int, nHeight int) b // hDraw: 图形绘制句柄. // // pRect: 矩形坐标. -func XDraw_FocusRect(hDraw int, pRect *RECT) int { - r, _, _ := xDraw_FocusRect.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) - return int(r) +func XDraw_FocusRect(hDraw int, pRect *RECT) { + xDraw_FocusRect.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) } // 绘制_焦点矩形F. @@ -799,9 +752,8 @@ func XDraw_FocusRect(hDraw int, pRect *RECT) int { // hDraw: 图形绘制句柄. // // pRect: 矩形坐标. -func XDraw_FocusRectF(hDraw int, pRect *RECTF) int { - r, _, _ := xDraw_FocusRectF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) - return int(r) +func XDraw_FocusRectF(hDraw int, pRect *RECTF) { + xDraw_FocusRectF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(pRect))) } // 绘制_移动到起点, 更新当前位置到指定点,并返回以前的位置. 如果函数成功, 返回非零值. @@ -813,7 +765,7 @@ func XDraw_FocusRectF(hDraw int, pRect *RECTF) int { // Y: 坐标. // // pPoint: 接收以前的当前位置到一个POINT结构的指针, 如果这个参数是NULL指针, 没有返回原来的位置. -func XDraw_GDI_MoveToEx(hDraw int, X int, Y int, pPoint *POINT) bool { +func XDraw_GDI_MoveToEx(hDraw int, X, Y int32, pPoint *POINT) bool { r, _, _ := xDraw_GDI_MoveToEx.Call(uintptr(hDraw), uintptr(X), uintptr(Y), uintptr(unsafe.Pointer(pPoint))) return r != 0 } @@ -825,7 +777,7 @@ func XDraw_GDI_MoveToEx(hDraw int, X int, Y int, pPoint *POINT) bool { // nXEnd: X坐标, 线结束点. // // nYEnd: Y坐标, 线结束点. -func XDraw_GDI_LineTo(hDraw int, nXEnd int, nYEnd int) bool { +func XDraw_GDI_LineTo(hDraw int, nXEnd, nYEnd int32) bool { r, _, _ := xDraw_GDI_LineTo.Call(uintptr(hDraw), uintptr(nXEnd), uintptr(nYEnd)) return r != 0 } @@ -837,7 +789,7 @@ func XDraw_GDI_LineTo(hDraw int, nXEnd int, nYEnd int) bool { // pArrayPt: 参见MSDN. // // arrayPtSize: 参见MSDN. -func XDraw_GDI_Polyline(hDraw int, pArrayPt []POINT, arrayPtSize int) bool { +func XDraw_GDI_Polyline(hDraw int, pArrayPt []POINT, arrayPtSize int32) bool { r, _, _ := xDraw_GDI_Polyline.Call(uintptr(hDraw), uintptr(unsafe.Pointer(&pArrayPt[0])), uintptr(arrayPtSize)) return r != 0 } @@ -851,7 +803,7 @@ func XDraw_GDI_Polyline(hDraw int, pArrayPt []POINT, arrayPtSize int) bool { // Y: 坐标. // // crColor: RGB颜色值. -func XDraw_GDI_SetPixel(hDraw int, X int, Y int, crColor int) int { +func XDraw_GDI_SetPixel(hDraw int, X, Y int32, crColor int) int { r, _, _ := xDraw_GDI_SetPixel.Call(uintptr(hDraw), uintptr(X), uintptr(Y), uintptr(crColor)) return int(r) } @@ -883,7 +835,7 @@ func XDraw_GetD2dRenderTarget(hDraw int) int { // hbrFlickerFreeDraw: . // // diFlags: . -func XDraw_GDI_DrawIconEx(hDraw int, xLeft int, yTop int, hIcon uintptr, cxWidth int, cyWidth int, istepIfAniCur int, hbrFlickerFreeDraw int, diFlags int) bool { +func XDraw_GDI_DrawIconEx(hDraw int, xLeft, yTop int32, hIcon uintptr, cxWidth, cyWidth int32, istepIfAniCur uint32, hbrFlickerFreeDraw int, diFlags uint32) bool { r, _, _ := xDraw_GDI_DrawIconEx.Call(uintptr(hDraw), uintptr(xLeft), uintptr(yTop), hIcon, uintptr(cxWidth), uintptr(cyWidth), uintptr(istepIfAniCur), uintptr(hbrFlickerFreeDraw), uintptr(diFlags)) return r != 0 } @@ -981,9 +933,8 @@ func XDraw_GDI_Ellipse(hDraw int, pRect *RECT) bool { // points: 顶点坐标数组. // // nCount: 顶点数量. -func XDraw_FillPolygon(hDraw int, points []POINT, nCount int) int { - r, _, _ := xDraw_FillPolygon.Call(uintptr(hDraw), uintptr(unsafe.Pointer(&points[0])), uintptr(nCount)) - return int(r) +func XDraw_FillPolygon(hDraw int, points []POINT, nCount int32) { + xDraw_FillPolygon.Call(uintptr(hDraw), uintptr(unsafe.Pointer(&points[0])), uintptr(nCount)) } // 绘制_填充多边形F, 填充多边形. @@ -993,9 +944,8 @@ func XDraw_FillPolygon(hDraw int, points []POINT, nCount int) int { // points: 顶点坐标数组. // // nCount: 顶点数量. -func XDraw_FillPolygonF(hDraw int, points []POINTF, nCount int) int { - r, _, _ := xDraw_FillPolygonF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(&points[0])), uintptr(nCount)) - return int(r) +func XDraw_FillPolygonF(hDraw int, points []POINTF, nCount int32) { + xDraw_FillPolygonF.Call(uintptr(hDraw), uintptr(unsafe.Pointer(&points[0])), uintptr(nCount)) } // 绘制_图片. @@ -1020,9 +970,8 @@ func XDraw_Image(hDraw int, hImageFrame int, x, y int32) { // x: x坐标. // // y: y坐标. -func XDraw_ImageF(hDraw int, hImageFrame int, x, y float32) int { - r, _, _ := xDraw_ImageF.Call(uintptr(hDraw), uintptr(hImageFrame), common.Float32Ptr(x), common.Float32Ptr(y)) - return int(r) +func XDraw_ImageF(hDraw int, hImageFrame int, x, y float32) { + xDraw_ImageF.Call(uintptr(hDraw), uintptr(hImageFrame), common.Float32Ptr(x), common.Float32Ptr(y)) } // 绘制_图片自适应. @@ -1034,9 +983,8 @@ func XDraw_ImageF(hDraw int, hImageFrame int, x, y float32) int { // pRect: 坐标. // // bOnlyBorder: 是否只绘制边缘区域. -func XDraw_ImageAdaptive(hDraw int, hImageFrame int, pRect *RECT, bOnlyBorder bool) int { - r, _, _ := xDraw_ImageAdaptive.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(pRect)), common.BoolPtr(bOnlyBorder)) - return int(r) +func XDraw_ImageAdaptive(hDraw int, hImageFrame int, pRect *RECT, bOnlyBorder bool) { + xDraw_ImageAdaptive.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(pRect)), common.BoolPtr(bOnlyBorder)) } // 绘制_图片自适应F. @@ -1048,9 +996,8 @@ func XDraw_ImageAdaptive(hDraw int, hImageFrame int, pRect *RECT, bOnlyBorder bo // pRect: 坐标. // // bOnlyBorder: 是否只绘制边缘区域. -func XDraw_ImageAdaptiveF(hDraw int, hImageFrame int, pRect *RECTF, bOnlyBorder bool) int { - r, _, _ := xDraw_ImageAdaptiveF.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(pRect)), common.BoolPtr(bOnlyBorder)) - return int(r) +func XDraw_ImageAdaptiveF(hDraw int, hImageFrame int, pRect *RECTF, bOnlyBorder bool) { + xDraw_ImageAdaptiveF.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(pRect)), common.BoolPtr(bOnlyBorder)) } // 绘制_图片扩展, 绘制图片. @@ -1066,9 +1013,8 @@ func XDraw_ImageAdaptiveF(hDraw int, hImageFrame int, pRect *RECTF, bOnlyBorder // width: 宽度. // // height: 高度. -func XDraw_ImageEx(hDraw int, hImageFrame int, x, y, width, height int) int { - r, _, _ := xDraw_ImageEx.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(x), uintptr(y), uintptr(width), uintptr(height)) - return int(r) +func XDraw_ImageEx(hDraw int, hImageFrame int, x, y, width, height int32) { + xDraw_ImageEx.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(x), uintptr(y), uintptr(width), uintptr(height)) } // 绘制_图片扩展F, 绘制图片. @@ -1084,9 +1030,8 @@ func XDraw_ImageEx(hDraw int, hImageFrame int, x, y, width, height int) int { // width: 宽度. // // height: 高度. -func XDraw_ImageExF(hDraw int, hImageFrame int, x, y, width, height float32) int { - r, _, _ := xDraw_ImageExF.Call(uintptr(hDraw), uintptr(hImageFrame), common.Float32Ptr(x), common.Float32Ptr(y), common.Float32Ptr(width), common.Float32Ptr(height)) - return int(r) +func XDraw_ImageExF(hDraw int, hImageFrame int, x, y, width, height float32) { + xDraw_ImageExF.Call(uintptr(hDraw), uintptr(hImageFrame), common.Float32Ptr(x), common.Float32Ptr(y), common.Float32Ptr(width), common.Float32Ptr(height)) } // 绘制_图片增强. @@ -1098,9 +1043,8 @@ func XDraw_ImageExF(hDraw int, hImageFrame int, x, y, width, height float32) int // pRect: 坐标. // // bClip: 是否裁剪区域. -func XDraw_ImageSuper(hDraw int, hImageFrame int, pRect *RECT, bClip bool) int { - r, _, _ := xDraw_ImageSuper.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(pRect)), common.BoolPtr(bClip)) - return int(r) +func XDraw_ImageSuper(hDraw int, hImageFrame int, pRect *RECT, bClip bool) { + xDraw_ImageSuper.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(pRect)), common.BoolPtr(bClip)) } // 绘制_图片增强F. @@ -1112,9 +1056,8 @@ func XDraw_ImageSuper(hDraw int, hImageFrame int, pRect *RECT, bClip bool) int { // pRect: 坐标. // // bClip: 是否裁剪区域. -func XDraw_ImageSuperF(hDraw int, hImageFrame int, pRect *RECTF, bClip bool) int { - r, _, _ := xDraw_ImageSuperF.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(pRect)), common.BoolPtr(bClip)) - return int(r) +func XDraw_ImageSuperF(hDraw int, hImageFrame int, pRect *RECTF, bClip bool) { + xDraw_ImageSuperF.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(pRect)), common.BoolPtr(bClip)) } // 绘制_图片增强扩展. @@ -1126,9 +1069,8 @@ func XDraw_ImageSuperF(hDraw int, hImageFrame int, pRect *RECTF, bClip bool) int // prcDest: 目标坐标. // // prcSrc: 源坐标. -func XDraw_ImageSuperEx(hDraw int, hImageFrame int, prcDest *RECT, prcSrc *RECT) int { - r, _, _ := xDraw_ImageSuperEx.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(prcDest)), uintptr(unsafe.Pointer(prcSrc))) - return int(r) +func XDraw_ImageSuperEx(hDraw int, hImageFrame int, prcDest *RECT, prcSrc *RECT) { + xDraw_ImageSuperEx.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(prcDest)), uintptr(unsafe.Pointer(prcSrc))) } // 绘制_图片增强扩展F. @@ -1140,9 +1082,8 @@ func XDraw_ImageSuperEx(hDraw int, hImageFrame int, prcDest *RECT, prcSrc *RECT) // prcDest: 目标坐标. // // prcSrc: 源坐标. -func XDraw_ImageSuperExF(hDraw int, hImageFrame int, prcDest *RECTF, prcSrc *RECT) int { - r, _, _ := xDraw_ImageSuperExF.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(prcDest)), uintptr(unsafe.Pointer(prcSrc))) - return int(r) +func XDraw_ImageSuperExF(hDraw int, hImageFrame int, prcDest *RECTF, prcSrc *RECT) { + xDraw_ImageSuperExF.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(prcDest)), uintptr(unsafe.Pointer(prcSrc))) } // 绘制_图片增强遮盖, 绘制带遮盖的图片. D2D留空. @@ -1158,9 +1099,8 @@ func XDraw_ImageSuperExF(hDraw int, hImageFrame int, prcDest *RECTF, prcSrc *REC // pRectMask: 坐标, 遮盖. // // bClip: 是否裁剪区域. -func XDraw_ImageSuperMask(hDraw int, hImageFrame int, hImageFrameMask int, pRect *RECT, pRectMask *RECT, bClip bool) int { - r, _, _ := xDraw_ImageSuperMask.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(hImageFrameMask), uintptr(unsafe.Pointer(pRect)), uintptr(unsafe.Pointer(pRectMask)), common.BoolPtr(bClip)) - return int(r) +func XDraw_ImageSuperMask(hDraw int, hImageFrame int, hImageFrameMask int, pRect *RECT, pRectMask *RECT, bClip bool) { + xDraw_ImageSuperMask.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(hImageFrameMask), uintptr(unsafe.Pointer(pRect)), uintptr(unsafe.Pointer(pRectMask)), common.BoolPtr(bClip)) } // 绘制_图片平铺, 绘制图片. @@ -1172,9 +1112,8 @@ func XDraw_ImageSuperMask(hDraw int, hImageFrame int, hImageFrameMask int, pRect // pRect: 坐标. // // flag: 标识, 0:从左上角开始平铺, 1:从左下角开始平铺. -func XDraw_ImageTile(hDraw int, hImageFrame int, hImageFrameMask int, pRect *RECT, flag int) int { - r, _, _ := xDraw_ImageTile.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(hImageFrameMask), uintptr(unsafe.Pointer(pRect)), uintptr(flag)) - return int(r) +func XDraw_ImageTile(hDraw int, hImageFrame int, hImageFrameMask int, pRect *RECT, flag int32) { + xDraw_ImageTile.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(hImageFrameMask), uintptr(unsafe.Pointer(pRect)), uintptr(flag)) } // 绘制_图片平铺F, 绘制图片. @@ -1186,9 +1125,8 @@ func XDraw_ImageTile(hDraw int, hImageFrame int, hImageFrameMask int, pRect *REC // pRect: 坐标. // // flag: 标识, 0:从左上角开始平铺, 1:从左下角开始平铺. -func XDraw_ImageTileF(hDraw int, hImageFrame int, hImageFrameMask int, pRect *RECTF, flag int) int { - r, _, _ := xDraw_ImageTileF.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(hImageFrameMask), uintptr(unsafe.Pointer(pRect)), uintptr(flag)) - return int(r) +func XDraw_ImageTileF(hDraw int, hImageFrame int, hImageFrameMask int, pRect *RECTF, flag int32) { + xDraw_ImageTileF.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(hImageFrameMask), uintptr(unsafe.Pointer(pRect)), uintptr(flag)) } // 绘制_图片遮盖, 绘制带遮盖的图片, D2D留空. @@ -1199,16 +1137,13 @@ func XDraw_ImageTileF(hDraw int, hImageFrame int, hImageFrameMask int, pRect *RE // // hImageFrameMask: 图片句柄, 遮盖. // -// x: hImageFrame X坐标. -// -// y: hImageFrame Y坐标. +// pRect: 坐标. // -// x2: hImageFrameMask X坐标. +// x: 目标X坐标. // -// y2: hImageFrameMask Y坐标. -func XDraw_ImageMask(hDraw int, hImageFrame int, hImageFrameMask int, x int, y int, x2 int, y2 int) int { - r, _, _ := xDraw_ImageMask.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(hImageFrameMask), uintptr(x), uintptr(y), uintptr(x2), uintptr(y2)) - return int(r) +// y: 目标Y坐标. +func XDraw_ImageMask(hDraw int, hImageFrame int, hImageFrameMask int, pRect *RECT, x, y int32) { + xDraw_ImageMask.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(hImageFrameMask), uintptr(unsafe.Pointer(pRect)), uintptr(x), uintptr(y)) } // 绘制_图片遮盖矩形, 使用矩形作为遮罩. @@ -1222,9 +1157,8 @@ func XDraw_ImageMask(hDraw int, hImageFrame int, hImageFrameMask int, x int, y i // pRcMask: 遮罩坐标. // // pRcRoundAngle: 遮罩圆角. -func XDraw_ImageMaskRect(hDraw int, hImageFrame int, pRect *RECT, pRcMask *RECT, pRcRoundAngle *RECT) int { - r, _, _ := xDraw_ImageMaskRect.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(pRect)), uintptr(unsafe.Pointer(pRcMask)), uintptr(unsafe.Pointer(pRcRoundAngle))) - return int(r) +func XDraw_ImageMaskRect(hDraw int, hImageFrame int, pRect *RECT, pRcMask *RECT, pRcRoundAngle *RECT) { + xDraw_ImageMaskRect.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(pRect)), uintptr(unsafe.Pointer(pRcMask)), uintptr(unsafe.Pointer(pRcRoundAngle))) } // 绘制_图片遮盖圆型, 使用圆形作为遮罩. @@ -1236,9 +1170,8 @@ func XDraw_ImageMaskRect(hDraw int, hImageFrame int, pRect *RECT, pRcMask *RECT, // pRect: 矩形坐标. // // pRcMask: 遮罩坐标. -func XDraw_ImageMaskEllipse(hDraw int, hImageFrame int, pRect *RECT, pRcMask *RECT) int { - r, _, _ := xDraw_ImageMaskEllipse.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(pRect)), uintptr(unsafe.Pointer(pRcMask))) - return int(r) +func XDraw_ImageMaskEllipse(hDraw int, hImageFrame int, pRect *RECT, pRcMask *RECT) { + xDraw_ImageMaskEllipse.Call(uintptr(hDraw), uintptr(hImageFrame), uintptr(unsafe.Pointer(pRect)), uintptr(unsafe.Pointer(pRcMask))) } // 绘制_文本指定矩形, DrawText() 参见MSDN. @@ -1248,9 +1181,8 @@ func XDraw_ImageMaskEllipse(hDraw int, hImageFrame int, pRect *RECT, pRcMask *RE // lpString: 字符串. // // lpRect: 坐标. -func XDraw_DrawText(hDraw int, lpString string, lpRect *RECT) int { - r, _, _ := xDraw_DrawText.Call(uintptr(hDraw), common.StrPtr(lpString), uintptr(len([]rune(lpString))), uintptr(unsafe.Pointer(lpRect))) - return int(r) +func XDraw_DrawText(hDraw int, lpString string, lpRect *RECT) { + xDraw_DrawText.Call(uintptr(hDraw), common.StrPtr(lpString), uintptr(int32(len([]rune(lpString)))), uintptr(unsafe.Pointer(lpRect))) } // 绘制_文本指定矩形F, DrawText() 参见MSDN. @@ -1260,9 +1192,8 @@ func XDraw_DrawText(hDraw int, lpString string, lpRect *RECT) int { // lpString: 字符串. // // lpRect: 坐标. -func XDraw_DrawTextF(hDraw int, lpString string, lpRect *RECTF) int { - r, _, _ := xDraw_DrawTextF.Call(uintptr(hDraw), common.StrPtr(lpString), uintptr(len([]rune(lpString))), uintptr(unsafe.Pointer(lpRect))) - return int(r) +func XDraw_DrawTextF(hDraw int, lpString string, lpRect *RECTF) { + xDraw_DrawTextF.Call(uintptr(hDraw), common.StrPtr(lpString), uintptr(int32(len([]rune(lpString)))), uintptr(unsafe.Pointer(lpRect))) } // 绘制_文本下划线. @@ -1273,10 +1204,9 @@ func XDraw_DrawTextF(hDraw int, lpString string, lpRect *RECTF) int { // // lpRect: 坐标. // -// colorLine: 下划线颜色, ABGR 颜色. -func XDraw_DrawTextUnderline(hDraw int, lpString string, lpRect *RECT, colorLine int) int { - r, _, _ := xDraw_DrawTextUnderline.Call(uintptr(hDraw), common.StrPtr(lpString), uintptr(len([]rune(lpString))), uintptr(unsafe.Pointer(lpRect)), uintptr(colorLine)) - return int(r) +// colorLine: 下划线颜色, ARGB 颜色. +func XDraw_DrawTextUnderline(hDraw int, lpString string, lpRect *RECT, colorLine int) { + xDraw_DrawTextUnderline.Call(uintptr(hDraw), common.StrPtr(lpString), uintptr(int32(len([]rune(lpString)))), uintptr(unsafe.Pointer(lpRect)), uintptr(colorLine)) } // 绘制_文本下划线F. @@ -1287,10 +1217,9 @@ func XDraw_DrawTextUnderline(hDraw int, lpString string, lpRect *RECT, colorLine // // lpRect: 坐标. // -// colorLine: 下划线颜色, ABGR 颜色. -func XDraw_DrawTextUnderlineF(hDraw int, lpString string, lpRect *RECTF, colorLine int) int { - r, _, _ := xDraw_DrawTextUnderlineF.Call(uintptr(hDraw), common.StrPtr(lpString), uintptr(len([]rune(lpString))), uintptr(unsafe.Pointer(lpRect)), uintptr(colorLine)) - return int(r) +// colorLine: 下划线颜色, ARGB 颜色. +func XDraw_DrawTextUnderlineF(hDraw int, lpString string, lpRect *RECTF, colorLine int) { + xDraw_DrawTextUnderlineF.Call(uintptr(hDraw), common.StrPtr(lpString), uintptr(int32(len([]rune(lpString)))), uintptr(unsafe.Pointer(lpRect)), uintptr(colorLine)) } // 绘制_文本, TextOut() 参见MSDN. @@ -1304,9 +1233,8 @@ func XDraw_DrawTextUnderlineF(hDraw int, lpString string, lpRect *RECTF, colorLi // lpString: XX. // // cbString: XX. -func XDraw_TextOut(hDraw int, nXStart int, nYStart int, lpString string, cbString string) int { - r, _, _ := xDraw_TextOut.Call(uintptr(hDraw), uintptr(nXStart), uintptr(nYStart), common.StrPtr(lpString), common.StrPtr(cbString)) - return int(r) +func XDraw_TextOut(hDraw int, nXStart, nYStart int32, lpString string, cbString string) { + xDraw_TextOut.Call(uintptr(hDraw), uintptr(nXStart), uintptr(nYStart), common.StrPtr(lpString), common.StrPtr(cbString)) } // 绘制_文本F, TextOut() 参见MSDN. @@ -1334,9 +1262,8 @@ func XDraw_TextOutF(hDraw int, nXStart, nYStart float32, lpString string, cbStri // nYStart: XX. // // lpString: XX. -func XDraw_TextOutEx(hDraw int, nXStart int, nYStart int, lpString string) int { - r, _, _ := xDraw_TextOutEx.Call(uintptr(hDraw), uintptr(nXStart), uintptr(nYStart), common.StrPtr(lpString)) - return int(r) +func XDraw_TextOutEx(hDraw int, nXStart, nYStart int32, lpString string) { + xDraw_TextOutEx.Call(uintptr(hDraw), uintptr(nXStart), uintptr(nYStart), common.StrPtr(lpString)) } // 绘制_文本扩展F, TextOut() 参见MSDN. @@ -1348,9 +1275,8 @@ func XDraw_TextOutEx(hDraw int, nXStart int, nYStart int, lpString string) int { // nYStart: XX. // // lpString: XX. -func XDraw_TextOutExF(hDraw int, nXStart, nYStart float32, lpString string) int { - r, _, _ := xDraw_TextOutExF.Call(uintptr(hDraw), common.Float32Ptr(nXStart), common.Float32Ptr(nYStart), common.StrPtr(lpString)) - return int(r) +func XDraw_TextOutExF(hDraw int, nXStart, nYStart float32, lpString string) { + xDraw_TextOutExF.Call(uintptr(hDraw), common.Float32Ptr(nXStart), common.Float32Ptr(nYStart), common.StrPtr(lpString)) } // 绘制_文本A, TextOut() 参见MSDN. @@ -1362,9 +1288,8 @@ func XDraw_TextOutExF(hDraw int, nXStart, nYStart float32, lpString string) int // nYStart: XX. // // lpString: XX. -func XDraw_TextOutA(hDraw int, nXStart int, nYStart int, lpString string) int { - r, _, _ := xDraw_TextOutA.Call(uintptr(hDraw), uintptr(nXStart), uintptr(nYStart), common.StrPtr(lpString)) - return int(r) +func XDraw_TextOutA(hDraw int, nXStart, nYStart int32, lpString string) { + xDraw_TextOutA.Call(uintptr(hDraw), uintptr(nXStart), uintptr(nYStart), common.StrPtr(lpString)) } // 绘制_文本AF, TextOut() 参见MSDN. @@ -1376,9 +1301,8 @@ func XDraw_TextOutA(hDraw int, nXStart int, nYStart int, lpString string) int { // nYStart: XX. // // lpString: XX. -func XDraw_TextOutAF(hDraw int, nXStart, nYStart float32, lpString string) int { - r, _, _ := xDraw_TextOutAF.Call(uintptr(hDraw), common.Float32Ptr(nXStart), common.Float32Ptr(nYStart), common.StrPtr(lpString)) - return int(r) +func XDraw_TextOutAF(hDraw int, nXStart, nYStart float32, lpString string) { + xDraw_TextOutAF.Call(uintptr(hDraw), common.Float32Ptr(nXStart), common.Float32Ptr(nYStart), common.StrPtr(lpString)) } // 绘制_设置文本渲染提示. @@ -1386,9 +1310,8 @@ func XDraw_TextOutAF(hDraw int, nXStart, nYStart float32, lpString string) int { // hDraw: 图形绘制句柄. // // nType: XX. -func XDraw_SetTextRenderingHint(hDraw int, nType int) int { - r, _, _ := xDraw_SetTextRenderingHint.Call(uintptr(hDraw), uintptr(nType)) - return int(r) +func XDraw_SetTextRenderingHint(hDraw int, nType int32) { + xDraw_SetTextRenderingHint.Call(uintptr(hDraw), uintptr(nType)) } // 绘制_SVG源. @@ -1396,9 +1319,8 @@ func XDraw_SetTextRenderingHint(hDraw int, nType int) int { // hDraw: 图形绘制句柄. // // hSvg: SVG句柄. -func XDraw_DrawSvgSrc(hDraw int, hSvg int) int { - r, _, _ := xDraw_DrawSvgSrc.Call(uintptr(hDraw), uintptr(hSvg)) - return int(r) +func XDraw_DrawSvgSrc(hDraw int, hSvg int) { + xDraw_DrawSvgSrc.Call(uintptr(hDraw), uintptr(hSvg)) } // 绘制_SVG. @@ -1410,9 +1332,8 @@ func XDraw_DrawSvgSrc(hDraw int, hSvg int) int { // x: x坐标. // // y: y坐标. -func XDraw_DrawSvg(hDraw int, hSvg int, x int, y int) int { - r, _, _ := xDraw_DrawSvg.Call(uintptr(hDraw), uintptr(hSvg), uintptr(x), uintptr(y)) - return int(r) +func XDraw_DrawSvg(hDraw int, hSvg int, x, y int32) { + xDraw_DrawSvg.Call(uintptr(hDraw), uintptr(hSvg), uintptr(x), uintptr(y)) } // 绘制_SVG扩展. @@ -1428,9 +1349,8 @@ func XDraw_DrawSvg(hDraw int, hSvg int, x int, y int) int { // nWidth: 宽度. // // nHeight: 高度. -func XDraw_DrawSvgEx(hDraw int, hSvg int, x int, y int, nWidth int, nHeight int) int { - r, _, _ := xDraw_DrawSvgEx.Call(uintptr(hDraw), uintptr(hSvg), uintptr(x), uintptr(y), uintptr(nWidth), uintptr(nHeight)) - return int(r) +func XDraw_DrawSvgEx(hDraw int, hSvg int, x, y, nWidth, nHeight int32) { + xDraw_DrawSvgEx.Call(uintptr(hDraw), uintptr(hSvg), uintptr(x), uintptr(y), uintptr(nWidth), uintptr(nHeight)) } // 绘制_SVG大小. @@ -1442,19 +1362,17 @@ func XDraw_DrawSvgEx(hDraw int, hSvg int, x int, y int, nWidth int, nHeight int) // nWidth: 宽度. // // nHeight: 高度. -func XDraw_DrawSvgSize(hDraw int, hSvg int, nWidth int, nHeight int) int { - r, _, _ := xDraw_DrawSvgSize.Call(uintptr(hDraw), uintptr(hSvg), uintptr(nWidth), uintptr(nHeight)) - return int(r) +func XDraw_DrawSvgSize(hDraw int, hSvg int, nWidth, nHeight int32) { + xDraw_DrawSvgSize.Call(uintptr(hDraw), uintptr(hSvg), uintptr(nWidth), uintptr(nHeight)) } // 绘制_D2D_清理, 使用指定颜色清理画布. // // hDraw: 图形绘制句柄. // -// color: ABGR 颜色值. -func XDraw_D2D_Clear(hDraw int, color int) int { - r, _, _ := xDraw_D2D_Clear.Call(uintptr(hDraw), uintptr(color)) - return int(r) +// color: ARGB 颜色值. +func XDraw_D2D_Clear(hDraw int, color int) { + xDraw_D2D_Clear.Call(uintptr(hDraw), uintptr(color)) } // 绘制_取字体, 返回字体句柄. diff --git a/xc/edit.go b/xc/edit.go index 9f88af2..c61ef61 100644 --- a/xc/edit.go +++ b/xc/edit.go @@ -207,7 +207,7 @@ func XEdit_SetDefaultText(hEle int, pString string) int { // // hEle: 元素句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XEdit_SetDefaultTextColor(hEle int, color int) int { r, _, _ := xEdit_SetDefaultTextColor.Call(uintptr(hEle), uintptr(color)) return int(r) @@ -270,11 +270,11 @@ func XEdit_SetTextInt(hEle int, nValue int) int { // pOut: 接收文本内存指针. // // nOutlen: 内存大小. 例: xc.XEdit_GetLength()+1 . -func XEdit_GetText(hEle int, pOut *string, nOutlen int) int { +func XEdit_GetText(hEle int, pOut *string, nOutlen int) int32 { buf := make([]uint16, nOutlen) r, _, _ := xEdit_GetText.Call(uintptr(hEle), common.Uint16SliceDataPtr(&buf), uintptr(nOutlen)) *pOut = syscall.UTF16ToString(buf[0:]) - return int(r) + return int32(r) } // 编辑框_取文本行. @@ -467,7 +467,7 @@ func XEdit_SetCaretWidth(hEle int, nWidth int) int { // // hEle: 元素句柄. // -// color: ABGR 颜色. +// color: ARGB 颜色. func XEdit_SetSelectBkColor(hEle int, color int) int { r, _, _ := xEdit_SetSelectBkColor.Call(uintptr(hEle), uintptr(color)) return int(r) @@ -500,9 +500,9 @@ func XEdit_SetRowHeightEx(hEle int, iRow int, nHeight int) int { // @param hEle: 元素句柄. // @param iRow: 行索引. // @return int -func XEdit_SetCurPos(hEle int, iRow int) int { +func XEdit_SetCurPos(hEle int, iRow int) bool { r, _, _ := xEdit_SetCurPos.Call(uintptr(hEle), uintptr(iRow)) - return int(r) + return r != 0 } // 编辑框_取当前位置点, 返回范围位置点. @@ -832,7 +832,7 @@ func XEdit_ReleaseStyle(hEle int, iStyle int) bool { // // hFont: 字体句柄. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // bColor: 是否使用颜色. func XEdit_ModifyStyle(hEle int, iStyle int, hFont int, color int, bColor bool) bool { @@ -968,3 +968,19 @@ func XEdit_InsertObject(hEle int, iRow int, iCol int, hObj int) int { func XEdit_SetChatMaxWidth(hEle int, nWidth int32) { xEdit_SetChatMaxWidth.Call(uintptr(hEle), uintptr(nWidth)) } + +// 编辑框_取总行数扩展. 包含自动换行数量, 返回总行数. +// +// hEle: 元素句柄. +func XEdit_GetRowCountEx(hEle int) int32 { + r, _, _ := xEdit_GetRowCountEx.Call(uintptr(hEle)) + return int32(r) +} + +// 编辑框_剪贴板复制. 复制全部内容. +// +// hEle: 元素句柄. +func XEdit_ClipboardCopyAll(hEle int) bool { + r, _, _ := xEdit_ClipboardCopyAll.Call(uintptr(hEle)) + return r != 0 +} diff --git a/xc/element.go b/xc/element.go index 22e6e70..6fba981 100644 --- a/xc/element.go +++ b/xc/element.go @@ -810,7 +810,7 @@ func XEle_SetLockScroll(hEle int, bHorizon bool, bVertical bool) int { // // hEle: 元素句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XEle_SetTextColor(hEle int, color int) int { r, _, _ := xEle_SetTextColor.Call(uintptr(hEle), uintptr(color)) return int(r) @@ -836,7 +836,7 @@ func XEle_GetTextColorEx(hEle int) int { // // hEle: 元素句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XEle_SetFocusBorderColor(hEle int, color int) int { r, _, _ := xEle_SetFocusBorderColor.Call(uintptr(hEle), uintptr(color)) return int(r) @@ -898,7 +898,7 @@ func XEle_Destroy(hEle int) int { // // nState: 组合状态. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // width: 线宽. func XEle_AddBkBorder(hEle int, nState xcc.CombinedState, color int, width int) int { @@ -912,7 +912,7 @@ func XEle_AddBkBorder(hEle int, nState xcc.CombinedState, color int, width int) // // nState: 组合状态. // -// color: ABGR 颜色. +// color: ARGB 颜色. func XEle_AddBkFill(hEle int, nState xcc.CombinedState, color int) int { r, _, _ := xEle_AddBkFill.Call(uintptr(hEle), uintptr(nState), uintptr(color)) return int(r) @@ -1231,3 +1231,12 @@ func XEle_RectClientToWndClientDPI(hEle int, pRect *RECT) int { r, _, _ := xEle_RectClientToWndClientDPI.Call(uintptr(hEle), uintptr(unsafe.Pointer(pRect))) return int(r) } + +// PGrid_启用仅扩展当前组. TODO: 这个api未封装到类, 官方文档里尚未说明具体是干什么的. +// +// hEle: 元素句柄. +// +// bEnabel: 是否启用. +func XPGrid_EnableExpandCurGroupOnly(hEle int, bEnabel bool) { + xPGrid_EnableExpandCurGroupOnly.Call(uintptr(hEle), common.BoolPtr(bEnabel)) +} diff --git a/xc/fontx.go b/xc/font.go similarity index 80% rename from xc/fontx.go rename to xc/font.go index 47be26b..de345ff 100644 --- a/xc/fontx.go +++ b/xc/font.go @@ -31,8 +31,8 @@ func XFont_CreateEx(pName string, size int32, style xcc.FontStyle_) int { // // @param pFontInfo 字体信息. // @return int 返回字体句柄. -func XFont_CreateLOGFONTW(pFontInfo *LOGFONTW) int { - r, _, _ := xFont_CreateLOGFONTW.Call(uintptr(unsafe.Pointer(pFontInfo))) +func XFont_CreateFromLOGFONTW(pFontInfo *LOGFONTW) int { + r, _, _ := xFont_CreateFromLOGFONTW.Call(uintptr(unsafe.Pointer(pFontInfo))) return int(r) } @@ -119,29 +119,25 @@ func XFont_CreateFromRes(id int32, pType string, fontSize int32, style xcc.FontS // // @param hFontX 字体句柄. // @param bEnable 是否启用. -// @return int -func XFont_EnableAutoDestroy(hFontX int, bEnable bool) int { - r, _, _ := xFont_EnableAutoDestroy.Call(uintptr(hFontX), common.BoolPtr(bEnable)) - return int(r) +func XFont_EnableAutoDestroy(hFontX int, bEnable bool) { + xFont_EnableAutoDestroy.Call(uintptr(hFontX), common.BoolPtr(bEnable)) } // XFont_GetFont 字体_取Font. 获取字体. // // @param hFontX 字体句柄. -// @return int 返回GDI+ Font指针. -func XFont_GetFont(hFontX int) int { +// @return GDI+ Font指针. +func XFont_GetFont(hFontX int) uintptr { r, _, _ := xFont_GetFont.Call(uintptr(hFontX)) - return int(r) + return r } // XFont_GetFontInfo 字体_取信息. 获取字体信息. // // @param hFontX 字体句柄. // @param pInfo 接收返回的字体信息. -// @return int -func XFont_GetFontInfo(hFontX int, pInfo *Font_Info_) int { - r, _, _ := xFont_GetFontInfo.Call(uintptr(hFontX), uintptr(unsafe.Pointer(pInfo))) - return int(r) +func XFont_GetFontInfo(hFontX int, pInfo *Font_Info_) { + xFont_GetFontInfo.Call(uintptr(hFontX), uintptr(unsafe.Pointer(pInfo))) } // XFont_GetLOGFONTW 字体_取LOGFONTW. 获取字体LOGFONTW. @@ -158,7 +154,6 @@ func XFont_GetLOGFONTW(hFontX int, hdc uintptr, pOut *LOGFONTW) bool { // XFont_Destroy 字体_销毁. 强制销毁炫彩字体, 谨慎使用, 建议使用 XFont_Release() 释放. // // @param hFontX 字体句柄. -// @return int func XFont_Destroy(hFontX int) { xFont_Destroy.Call(uintptr(hFontX)) } @@ -166,7 +161,6 @@ func XFont_Destroy(hFontX int) { // XFont_AddRef 字体_增加引用计数. // // @param hFontX 字体句柄. -// @return int func XFont_AddRef(hFontX int) { xFont_AddRef.Call(uintptr(hFontX)) } @@ -174,7 +168,6 @@ func XFont_AddRef(hFontX int) { // XFont_GetRefCount 字体_取引用计数. // // @param hFontX 字体句柄. -// @return int func XFont_GetRefCount(hFontX int) int32 { r, _, _ := xFont_GetRefCount.Call(uintptr(hFontX)) return int32(r) @@ -183,7 +176,25 @@ func XFont_GetRefCount(hFontX int) int32 { // XFont_Release 字体_释放引用计数. 释放引用计数, 当引用计数为0时自动销毁. // // @param hFontX 字体句柄. -// @return int func XFont_Release(hFontX int) { xFont_Release.Call(uintptr(hFontX)) } + +// XFont_SetUnderlineEdit 字体_置下划线. 仅供edit字体使用, 因为edit不支持下划线字体, 所以需要单独设置. +// +// @param hFontX 字体句柄. +// @param bUnderline 是否启用下划线. +// @param bStrikeout 是否启用删除线. +func XFont_SetUnderlineEdit(hFontX int, bUnderline, bStrikeout bool) { + xFont_SetUnderlineEdit.Call(uintptr(hFontX), common.BoolPtr(bUnderline), common.BoolPtr(bStrikeout)) +} + +// XFont_GetUnderlineEdit 字体_取下划线. 仅供edit字体使用, 因为edit不支持下划线字体, 所以需要单独设置. +// +// @param hFontX 字体句柄. +// @return bUnderline 是否启用下划线. +// @return bStrikeout 是否启用删除线. +func XFont_GetUnderlineEdit(hFontX int) (bUnderline, bStrikeout bool) { + xFont_GetUnderlineEdit.Call(uintptr(hFontX), uintptr(unsafe.Pointer(&bUnderline)), uintptr(unsafe.Pointer(&bStrikeout))) + return +} diff --git a/xc/framewindow.go b/xc/framewindow.go index 01e855d..e78d4b0 100644 --- a/xc/framewindow.go +++ b/xc/framewindow.go @@ -77,7 +77,7 @@ func XFrameWnd_SetView(hWindow int, hEle int) int { // // hWindow: 窗口句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XFrameWnd_SetPaneSplitBarColor(hWindow int, color int) int { r, _, _ := xFrameWnd_SetPaneSplitBarColor.Call(uintptr(hWindow), uintptr(color)) return int(r) @@ -186,3 +186,18 @@ func XFrameWnd_GetPaneSplitBarWidth(hWindow int) int32 { r, _, _ := xFrameWnd_GetPaneSplitBarWidth.Call(uintptr(hWindow)) return int32(r) } + +// 框架窗口_置布局外间距. 设置框架窗口, 窗格区域布局的外间距. +// +// hWindow: 窗口句柄. +// +// left: 左边间隔. +// +// top: 顶边间隔. +// +// right: 右边间隔. +// +// bottom: 底边间隔. +func XFrameWnd_SetLayoutMargin(hWindow int, left, top, right, bottom int32) { + xFrameWnd_SetLayoutMargin.Call(uintptr(hWindow), uintptr(left), uintptr(top), uintptr(right), uintptr(bottom)) +} diff --git a/xc/globalapi.go b/xc/globalapi.go index 493dd9f..e0d8b28 100644 --- a/xc/globalapi.go +++ b/xc/globalapi.go @@ -20,19 +20,13 @@ func XInitXCGUI(bD2D bool) bool { } // XRunXCGUI 炫彩_运行, 运行消息循环, 当炫彩窗口数量为0时退出. -// -// @return int -func XRunXCGUI() int { - r, _, _ := xRunXCGUI.Call() - return int(r) +func XRunXCGUI() { + xRunXCGUI.Call() } // XExitXCGUI 炫彩_退出, 退出界面库释放资源. -// -// @return int -func XExitXCGUI() int { - r, _, _ := xExitXCGUI.Call() - return int(r) +func XExitXCGUI() { + xExitXCGUI.Call() } // XC_DebugToFileInfo 炫彩_输出调试信息到文件, 打印调试信息到文件xcgui_debug.txt. @@ -337,26 +331,23 @@ func XC_EnableResMonitor(bEnable bool) { // 炫彩_置布局边界颜色. // -// color: ABGR 颜色值. -func XC_SetLayoutFrameColor(color int) int { - r, _, _ := xC_SetLayoutFrameColor.Call(uintptr(color)) - return int(r) +// color: ARGB 颜色值. +func XC_SetLayoutFrameColor(color int) { + xC_SetLayoutFrameColor.Call(uintptr(color)) } // 炫彩_启用错误弹窗, 启用错误弹出, 通过该接口可以设置遇到严重错误时不弹出消息提示框. // // bEnabel: 是否启用. -func XC_EnableErrorMessageBox(bEnabel bool) int { - r, _, _ := xC_EnableErrorMessageBox.Call(common.BoolPtr(bEnabel)) - return int(r) +func XC_EnableErrorMessageBox(bEnabel bool) { + xC_EnableErrorMessageBox.Call(common.BoolPtr(bEnabel)) } // 炫彩_启用自动退出程序, 启动或禁用自动退出程序, 当检测到所有用户创建的窗口都关闭时, 自动退出程序; 可调用 XC_PostQuitMessage() 手动退出程序. // // bEnabel: 是否启用. -func XC_EnableAutoExitApp(bEnabel bool) int { - r, _, _ := xC_EnableAutoExitApp.Call(common.BoolPtr(bEnabel)) - return int(r) +func XC_EnableAutoExitApp(bEnabel bool) { + xC_EnableAutoExitApp.Call(common.BoolPtr(bEnabel)) } // 炫彩_取文本绘制大小. @@ -368,9 +359,8 @@ func XC_EnableAutoExitApp(bEnabel bool) int { // hFontX: 字体. // // pOutSize: 接收返回大小. -func XC_GetTextSize(pString string, length int, hFontX int, pOutSize *SIZE) int { - r, _, _ := xC_GetTextSize.Call(common.StrPtr(pString), uintptr(length), uintptr(hFontX), uintptr(unsafe.Pointer(pOutSize))) - return int(r) +func XC_GetTextSize(pString string, length int, hFontX int, pOutSize *SIZE) { + xC_GetTextSize.Call(common.StrPtr(pString), uintptr(length), uintptr(hFontX), uintptr(unsafe.Pointer(pOutSize))) } // 炫彩_取文本显示大小. @@ -382,9 +372,8 @@ func XC_GetTextSize(pString string, length int, hFontX int, pOutSize *SIZE) int // hFontX: 字体. // // pOutSize: 接收返回大小. -func XC_GetTextShowSize(pString string, length int, hFontX int, pOutSize *SIZE) int { - r, _, _ := xC_GetTextShowSize.Call(common.StrPtr(pString), uintptr(length), uintptr(hFontX), uintptr(unsafe.Pointer(pOutSize))) - return int(r) +func XC_GetTextShowSize(pString string, length int, hFontX int, pOutSize *SIZE) { + xC_GetTextShowSize.Call(common.StrPtr(pString), uintptr(length), uintptr(hFontX), uintptr(unsafe.Pointer(pOutSize))) } // 炫彩_取文本显示大小扩展. @@ -398,9 +387,8 @@ func XC_GetTextShowSize(pString string, length int, hFontX int, pOutSize *SIZE) // nTextAlign: 文本对齐方式, TextFormatFlag_, TextAlignFlag_, TextTrimming_. // // pOutSize: 接收返回大小. -func XC_GetTextShowSizeEx(pString string, length int, hFontX int, nTextAlign xcc.TextFormatFlag_, pOutSize *SIZE) int { - r, _, _ := xC_GetTextShowSizeEx.Call(common.StrPtr(pString), uintptr(length), uintptr(hFontX), uintptr(nTextAlign), uintptr(unsafe.Pointer(pOutSize))) - return int(r) +func XC_GetTextShowSizeEx(pString string, length int, hFontX int, nTextAlign xcc.TextFormatFlag_, pOutSize *SIZE) { + xC_GetTextShowSizeEx.Call(common.StrPtr(pString), uintptr(length), uintptr(hFontX), uintptr(nTextAlign), uintptr(unsafe.Pointer(pOutSize))) } // XC_GetTextShowRect 炫彩_取文本显示矩形. @@ -411,26 +399,22 @@ func XC_GetTextShowSizeEx(pString string, length int, hFontX int, nTextAlign xcc // @param nTextAlign 文本对齐: xcc.TextFormatFlag_. // @param width 最大宽度. // @param pOutSize 接收返回大小. -// @return int -func XC_GetTextShowRect(pString string, length int, hFontX int, nTextAlign xcc.TextFormatFlag_, width int, pOutSize *SIZE) int { - r, _, _ := xC_GetTextShowRect.Call(common.StrPtr(pString), uintptr(length), uintptr(hFontX), uintptr(nTextAlign), uintptr(width), uintptr(unsafe.Pointer(pOutSize))) - return int(r) +func XC_GetTextShowRect(pString string, length int, hFontX int, nTextAlign xcc.TextFormatFlag_, width int, pOutSize *SIZE) { + xC_GetTextShowRect.Call(common.StrPtr(pString), uintptr(length), uintptr(hFontX), uintptr(nTextAlign), uintptr(width), uintptr(unsafe.Pointer(pOutSize))) } // 炫彩_置默认字体. // // hFontX: 炫彩字体句柄. -func XC_SetDefaultFont(hFontX int) int { - r, _, _ := xC_SetDefaultFont.Call(uintptr(hFontX)) - return int(r) +func XC_SetDefaultFont(hFontX int) { + xC_SetDefaultFont.Call(uintptr(hFontX)) } // 炫彩_添加搜索路径, 添加文件搜索路径, 默认路径为exe目录和程序当前运行目录. // // pPath: 文件夹. -func XC_AddFileSearchPath(pPath string) int { - r, _, _ := xC_AddFileSearchPath.Call(common.StrPtr(pPath)) - return int(r) +func XC_AddFileSearchPath(pPath string) { + xC_AddFileSearchPath.Call(common.StrPtr(pPath)) } // 炫彩_初始化字体, 初始化LOGFONTW结构体. @@ -448,25 +432,23 @@ func XC_AddFileSearchPath(pPath string) int { // bUnderline: 是否有下划线. // // bStrikeOut: 是否有删除线. -func XC_InitFont(pFont *LOGFONTW, pName string, size int, bBold bool, bItalic bool, bUnderline bool, bStrikeOut bool) int { - r, _, _ := xC_InitFont.Call(uintptr(unsafe.Pointer(pFont)), common.StrPtr(pName), uintptr(size), common.BoolPtr(bBold), common.BoolPtr(bItalic), common.BoolPtr(bUnderline), common.BoolPtr(bStrikeOut)) - return int(r) +func XC_InitFont(pFont *LOGFONTW, pName string, size int, bBold bool, bItalic bool, bUnderline bool, bStrikeOut bool) { + xC_InitFont.Call(uintptr(unsafe.Pointer(pFont)), common.StrPtr(pName), uintptr(size), common.BoolPtr(bBold), common.BoolPtr(bItalic), common.BoolPtr(bUnderline), common.BoolPtr(bStrikeOut)) } // 炫彩_分配内存, 在UI库中申请内存, 返回: 内存首地址. // // size: 大小, 字节为单位. -func XC_Malloc(size int) int { +func XC_Malloc(size int32) uintptr { r, _, _ := xC_Malloc.Call(uintptr(size)) - return int(r) + return r } // 炫彩_释放内存, 在UI库中释放内存. // // p: 内存首地址. -func XC_Free(p int) int { - r, _, _ := xC_Free.Call(uintptr(p)) - return int(r) +func XC_Free(p uintptr) { + xC_Free.Call(p) } // 炫彩_弹框, 弹出提示框. @@ -474,9 +456,8 @@ func XC_Free(p int) int { // pTitle: 提示框标题. // // pText: 提示内容. -func XC_Alert(pTitle, pText string) int { - r, _, _ := xC_Alert.Call(common.StrPtr(pTitle), common.StrPtr(pText)) - return int(r) +func XC_Alert(pTitle, pText string) { + xC_Alert.Call(common.StrPtr(pTitle), common.StrPtr(pText)) } // 对指定文件执行操作. 如果函数成功,则返回大于 32 的值。如果函数失败,则返回指示失败原因的错误值. @@ -534,17 +515,15 @@ func XC_LoadDll(pDllFileName string) uintptr { // 炫彩_PostQuitMessage, 发送WM_QUIT消息退出消息循环. // // nExitCode: 退出码. -func XC_PostQuitMessage(nExitCode int) int { - r, _, _ := xC_PostQuitMessage.Call(uintptr(nExitCode)) - return int(r) +func XC_PostQuitMessage(nExitCode int) { + xC_PostQuitMessage.Call(uintptr(nExitCode)) } // 炫彩_置D2D文本渲染模式. // // mode: 渲染模式, XC_DWRITE_RENDERING_MODE_ . -func XC_SetD2dTextRenderingMode(mode xcc.XC_DWRITE_RENDERING_MODE_) int { - r, _, _ := xC_SetD2dTextRenderingMode.Call(uintptr(mode)) - return int(r) +func XC_SetD2dTextRenderingMode(mode xcc.XC_DWRITE_RENDERING_MODE_) { + xC_SetD2dTextRenderingMode.Call(uintptr(mode)) } // 炫彩_是否启用了D2D. @@ -656,33 +635,30 @@ func XC_AnsiToUnicode(pIn uintptr, inLen int, pOut *string, outLen int) int { // level: 级别. // // pInfo: 信息. -func XDebug_Print(level int, pInfo string) int { - r, _, _ := xDebug_Print.Call(uintptr(level), XC_wtoa(pInfo)) - return int(r) +func XDebug_Print(level int, pInfo string) { + xDebug_Print.Call(uintptr(level), XC_wtoa(pInfo)) } // 炫彩_显示边界. // // bShow: 是否显示. -func XC_ShowSvgFrame(bShow bool) int { - r, _, _ := xC_ShowSvgFrame.Call(common.BoolPtr(bShow)) - return int(r) +func XC_ShowSvgFrame(bShow bool) { + xC_ShowSvgFrame.Call(common.BoolPtr(bShow)) } // 炫彩_启用自动DPI. 当启用后, 创建窗口时自动检测DPI调整UI缩放, 处理DPI改变消息; 禁用后,当DPI改变,需要手动设置窗口DPI. // // bEnabel: 是否启用. -func XC_EnableAutoDPI(bEnabel bool) int { - r, _, _ := xC_EnableAutoDPI.Call(common.BoolPtr(bEnabel)) - return int(r) +func XC_EnableAutoDPI(bEnabel bool) { + xC_EnableAutoDPI.Call(common.BoolPtr(bEnabel)) } // 炫彩_启用DPI. // // 为go程序启用DPI的几种方式: -// 1. 使用程序清单文件. -// 2. 调用此函数. -// 3. 自己调用DPI函数. +// 1. 调用此函数. +// 2. 使用程序清单文件. +// 3. 自行调用Windows DPI命令. // // 参考[MSDN](https://learn.microsoft.com/zh-cn/windows/win32/hidpi/setting-the-default-dpi-awareness-for-a-process) // @@ -695,9 +671,23 @@ func XC_EnableDPI(bEnabel bool) bool { // 炫彩_置窗口图标. 全局窗口图标, 所有未设置图标的窗口, 都将使用此默认图标. // // hImage: 图标句柄. -func XC_SetWindowIcon(hImage int) int { - r, _, _ := xC_SetWindowIcon.Call(uintptr(hImage)) - return int(r) +func XC_SetWindowIcon(hImage int) { + xC_SetWindowIcon.Call(uintptr(hImage)) +} + +// 炫彩_启用自动重绘UI. 当修改UI后将自动调用重绘函数更新UI. +// +// 例如改变了按钮标题后, 将自动调用 xc.XEle_Redraw 更新UI, 默认不启用, 手动和自动各有优势. +// +// bEnabel: 是否启用. +func XC_EnableAutoRedrawUI(bEnabel bool) { + xC_EnableAutoRedrawUI.Call(common.BoolPtr(bEnabel)) +} + +// 炫彩_取句柄总数. 获取当前所使用的句柄总数量, 返回当前所使用的句柄总数量. +func XC_GetHandleCount() int32 { + r, _, _ := xC_GetHandleCount.Call() + return int32(r) } /* // 炫彩_打印调试信息, 打印调试信息到文件xcgui_debug.txt.[无效] diff --git a/xc/image.go b/xc/image.go index f8c72e8..05b23aa 100644 --- a/xc/image.go +++ b/xc/image.go @@ -291,7 +291,7 @@ func XImage_SetDrawTypeAdaptive(hImage int, leftSize, topSize, rightSize, bottom // // hImage: 图片句柄. // -// color: ABGR 颜色. +// color: ARGB 颜色. func XImage_SetTranColor(hImage int, color int) { xImage_SetTranColor.Call(uintptr(hImage), uintptr(color)) } @@ -300,7 +300,7 @@ func XImage_SetTranColor(hImage int, color int) { // // hImage: 图片句柄. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // tranColor: 透明色的透明度. func XImage_SetTranColorEx(hImage int, color int, tranColor byte) { diff --git a/xc/list.go b/xc/list.go index 6d29fe1..56aa2fe 100644 --- a/xc/list.go +++ b/xc/list.go @@ -94,14 +94,13 @@ func XList_EnableVScrollBarTop(hEle int, bTop bool) int { return int(r) } -// 列表_启用项背景全行模式, 启用项背景全行填充模式. +// 列表_启用行背景铺满. // // hEle: 元素句柄. // // bFull: 是否启用. -func XList_EnableItemBkFullRow(hEle int, bFull bool) int { - r, _, _ := xList_EnableItemBkFullRow.Call(uintptr(hEle), common.BoolPtr(bFull)) - return int(r) +func XList_EnableRowBkFull(hEle int, bFull bool) { + xList_EnableRowBkFull.Call(uintptr(hEle), common.BoolPtr(bFull)) } // 列表_启用固定行高. @@ -158,14 +157,13 @@ func XList_SetSort(hEle int, iColumn int, iColumnAdapter int, bEnable bool) int return int(r) } -// 列表_置绘制项背景标志, 设置是否绘制指定状态下项的背景. +// 列表_置行背景绘制标志. 设置是否绘制指定状态下行的背景. // // hEle: 元素句柄. // -// nFlags: 标志位, List_DrawItemBk_Flag_. -func XList_SetDrawItemBkFlags(hEle int, nFlags xcc.List_DrawItemBk_Flag_) int { - r, _, _ := xList_SetDrawItemBkFlags.Call(uintptr(hEle), uintptr(nFlags)) - return int(r) +// nFlags: 标志位, xcc.List_DrawItemBk_Flag_. +func XList_SetDrawRowBkFlags(hEle int, nFlags xcc.List_DrawItemBk_Flag_) { + xList_SetDrawRowBkFlags.Call(uintptr(hEle), uintptr(nFlags)) } // 列表_置列宽. @@ -248,39 +246,39 @@ func XList_GetItemData(hEle int, iItem int, iSubItem int) int { return int(r) } -// 列表_置选择项. +// 列表_置选择行. // // hEle: 元素句柄. // -// iItem: 项索引. -func XList_SetSelectItem(hEle int, iItem int) bool { - r, _, _ := xList_SetSelectItem.Call(uintptr(hEle), uintptr(iItem)) +// iRow: 行索引. +func XList_SetSelectRow(hEle int, iRow int) bool { + r, _, _ := xList_SetSelectRow.Call(uintptr(hEle), uintptr(iRow)) return r != 0 } -// 列表_取选择项, 返回项索引. +// 列表_取选择行, 返回行索引. // // hEle: 元素句柄. -func XList_GetSelectItem(hEle int) int { - r, _, _ := xList_GetSelectItem.Call(uintptr(hEle)) +func XList_GetSelectRow(hEle int) int { + r, _, _ := xList_GetSelectRow.Call(uintptr(hEle)) return int(r) } -// 列表_取选择项数量, 获取选择项数量. +// 列表_取选择行数量, 获取选择行数量. // // hEle: 元素句柄. -func XList_GetSelectItemCount(hEle int) int { - r, _, _ := xList_GetSelectItemCount.Call(uintptr(hEle)) +func XList_GetSelectRowCount(hEle int) int { + r, _, _ := xList_GetSelectItemRow.Call(uintptr(hEle)) return int(r) } -// 列表_添加选择项. +// 列表_添加选择行. // // hEle: 元素句柄. // -// iItem: 项索引. -func XList_AddSelectItem(hEle int, iItem int) bool { - r, _, _ := xList_AddSelectItem.Call(uintptr(hEle), uintptr(iItem)) +// iRow: 行索引. +func XList_AddSelectRow(hEle int, iRow int) bool { + r, _, _ := xList_AddSelectRow.Call(uintptr(hEle), uintptr(iRow)) return r != 0 } @@ -308,23 +306,23 @@ func XList_GetSelectAll(hEle int, pArray *[]int32, nArraySize int) int { return int(r) } -// 列表_显示指定项, 滚动视图让指定项可见. +// 列表_显示指定行, 滚动视图让指定行可见. // // hEle: 元素句柄. // -// iItem: 项索引. -func XList_VisibleItem(hEle int, iItem int) int { - r, _, _ := xList_VisibleItem.Call(uintptr(hEle), uintptr(iItem)) +// iRow: 行索引. +func XList_VisibleRow(hEle int, iRow int) int { + r, _, _ := xList_VisibleRow.Call(uintptr(hEle), uintptr(iRow)) return int(r) } -// 列表_取消选择项, 取消选择指定项(这里的项可以理解为行). +// 列表_取消选择行, 取消选择指定行. // // hEle: 元素句柄. // -// iItem: 项索引. -func XList_CancelSelectItem(hEle int, iItem int) bool { - r, _, _ := xList_CancelSelectItem.Call(uintptr(hEle), uintptr(iItem)) +// iRow: 行索引. +func XList_CancelSelectRow(hEle int, iRow int) bool { + r, _, _ := xList_CancelSelectRow.Call(uintptr(hEle), uintptr(iRow)) return r != 0 } @@ -460,13 +458,13 @@ func XList_GetTemplateObject(hEle int, iItem int, iSubItem int, nTempItemID int) return int(r) } -// 列表_取对象所在行, 获取当前对象所在模板实例, 属于列表中哪一个项. 成功返回项索引, 否则返回XC_ID_ERROR. +// 列表_取对象所在行. 获取当前对象所在模板实例, 属于列表中哪一行. 成功返回行索引, 否则返回 xcc.XC_ID_ERROR. // // hEle: 元素句柄. // // hXCGUI: 对象句柄, UI元素句柄或形状对象句柄. -func XList_GetItemIndexFromHXCGUI(hEle int, hXCGUI int) int { - r, _, _ := xList_GetItemIndexFromHXCGUI.Call(uintptr(hEle), uintptr(hXCGUI)) +func XList_GetRowIndexFromHXCGUI(hEle int, hXCGUI int) int { + r, _, _ := xList_GetRowIndexFromHXCGUI.Call(uintptr(hEle), uintptr(hXCGUI)) return int(r) } @@ -482,13 +480,13 @@ func XList_GetHeaderTemplateObject(hEle int, iItem int, nTempItemID int) int { return int(r) } -// 列表_取列表头对象所在行, 列表头, 获取当前对象所在模板实例, 属于列表头中哪一个项. 成功返回项索引, 否则返回XC_ID_ERROR. +// 列表_取列表头对象所在列. 列表头, 获取当前对象所在模板实例, 属于列表头中哪一个列. 成功返回列索引, 否则返回 xcc.XC_ID_ERROR. // // hEle: 元素句柄. // // hXCGUI: 对象句柄. -func XList_GetHeaderItemIndexFromHXCGUI(hEle int, hXCGUI int) int { - r, _, _ := xList_GetHeaderItemIndexFromHXCGUI.Call(uintptr(hEle), uintptr(hXCGUI)) +func XList_GetHeaderColumnIndexFromHXCGUI(hEle int, hXCGUI int) int { + r, _, _ := xList_GetHeaderColumnIndexFromHXCGUI.Call(uintptr(hEle), uintptr(hXCGUI)) return int(r) } @@ -522,27 +520,27 @@ func XList_GetVisibleRowRange(hEle int, piStart *int32, piEnd *int32) int { return int(r) } -// 列表_置项默认高度. +// 列表_置行默认高度. // // hEle: 元素句柄. // // nHeight: 高度. // // nSelHeight: 选中时高度. -func XList_SetItemHeightDefault(hEle int, nHeight int32, nSelHeight int32) int { - r, _, _ := xList_SetItemHeightDefault.Call(uintptr(hEle), uintptr(nHeight), uintptr(nSelHeight)) +func XList_SetRowHeightDefault(hEle int, nHeight int32, nSelHeight int32) int { + r, _, _ := xList_SetRowHeightDefault.Call(uintptr(hEle), uintptr(nHeight), uintptr(nSelHeight)) return int(r) } -// 列表_取项默认高度. +// 列表_取行默认高度. // // hEle: 元素句柄. // // pHeight: 高度. // // pSelHeight: 选中时高度. -func XList_GetItemHeightDefault(hEle int, pHeight *int32, pSelHeight *int32) int { - r, _, _ := xList_GetItemHeightDefault.Call(uintptr(hEle), uintptr(unsafe.Pointer(pHeight)), uintptr(unsafe.Pointer(pSelHeight))) +func XList_GetRowHeightDefault(hEle int, pHeight *int32, pSelHeight *int32) int { + r, _, _ := xList_GetRowHeightDefault.Call(uintptr(hEle), uintptr(unsafe.Pointer(pHeight)), uintptr(unsafe.Pointer(pSelHeight))) return int(r) } @@ -640,14 +638,13 @@ func XList_RefreshData(hEle int) int { return int(r) } -// 列表_刷新指定项, 刷新指定项模板, 以便更新UI. +// 列表_刷新指定行. 修改数据后, 刷新指定行模板, 以便更新数据到模板(如果当前行可见). // // hEle: 元素句柄. // -// iItem: 项索引. -func XList_RefreshItem(hEle int, iItem int) int { - r, _, _ := xList_RefreshItem.Call(uintptr(hEle), uintptr(iItem)) - return int(r) +// iRow: 行索引. +func XList_RefreshRow(hEle int, iRow int) { + xList_RefreshRow.Call(uintptr(hEle), uintptr(iRow)) } // 列表_添加列文本. @@ -678,99 +675,99 @@ func XList_AddColumnImage(hEle int, nWidth int, pName string, hImage int) int { return int(r) } -// 列表_添加项文本. +// 列表_添加行文本. // // hEle:. // // pText:. -func XList_AddItemText(hEle int, pText string) int { - r, _, _ := xList_AddItemText.Call(uintptr(hEle), common.StrPtr(pText)) +func XList_AddRowText(hEle int, pText string) int { + r, _, _ := xList_AddRowText.Call(uintptr(hEle), common.StrPtr(pText)) return int(r) } -// 列表_添加项文本扩展. +// 列表_添加行文本扩展. // // hEle:. // // pName:. // // pText:. -func XList_AddItemTextEx(hEle int, pName string, pText string) int { - r, _, _ := xList_AddItemTextEx.Call(uintptr(hEle), common.StrPtr(pName), common.StrPtr(pText)) +func XList_AddRowTextEx(hEle int, pName string, pText string) int { + r, _, _ := xList_AddRowTextEx.Call(uintptr(hEle), common.StrPtr(pName), common.StrPtr(pText)) return int(r) } -// 列表_添加项图片. +// 列表_添加行图片. // // hEle:. // // hImage:. -func XList_AddItemImage(hEle int, hImage int) int { - r, _, _ := xList_AddItemImage.Call(uintptr(hEle), uintptr(hImage)) +func XList_AddRowImage(hEle int, hImage int) int { + r, _, _ := xList_AddRowImage.Call(uintptr(hEle), uintptr(hImage)) return int(r) } -// 列表_添加项图片扩展. +// 列表_添加行图片扩展. // // hEle:. // // pName:. // // hImage:. -func XList_AddItemImageEx(hEle int, pName string, hImage int) int { - r, _, _ := xList_AddItemImageEx.Call(uintptr(hEle), common.StrPtr(pName), uintptr(hImage)) +func XList_AddRowImageEx(hEle int, pName string, hImage int) int { + r, _, _ := xList_AddRowImageEx.Call(uintptr(hEle), common.StrPtr(pName), uintptr(hImage)) return int(r) } -// 列表_插入项文本. +// 列表_插入行文本. // // hEle:. // -// iItem:. +// iRow:. // // pValue:. -func XList_InsertItemText(hEle int, iItem int, pValue string) int { - r, _, _ := xList_InsertItemText.Call(uintptr(hEle), uintptr(iItem), common.StrPtr(pValue)) +func XList_InsertRowText(hEle int, iRow int, pValue string) int { + r, _, _ := xList_InsertRowText.Call(uintptr(hEle), uintptr(iRow), common.StrPtr(pValue)) return int(r) } -// 列表_插入项文本扩展. +// 列表_插入行文本扩展. // // hEle:. // -// iItem:. +// iRow:. // // pName:. // // pValue:. -func XList_InsertItemTextEx(hEle int, iItem int, pName string, pValue string) int { - r, _, _ := xList_InsertItemTextEx.Call(uintptr(hEle), uintptr(iItem), common.StrPtr(pName), common.StrPtr(pValue)) +func XList_InsertRowTextEx(hEle int, iRow int, pName string, pValue string) int { + r, _, _ := xList_InsertRowTextEx.Call(uintptr(hEle), uintptr(iRow), common.StrPtr(pName), common.StrPtr(pValue)) return int(r) } -// 列表_插入项图片. +// 列表_插入行图片. // // hEle:. // -// iItem:. +// iRow:. // // hImage:. -func XList_InsertItemImage(hEle int, iItem int, hImage int) int { - r, _, _ := xList_InsertItemImage.Call(uintptr(hEle), uintptr(iItem), uintptr(hImage)) +func XList_InsertRowImage(hEle int, iRow int, hImage int) int { + r, _, _ := xList_InsertRowImage.Call(uintptr(hEle), uintptr(iRow), uintptr(hImage)) return int(r) } -// 列表_插入项图片扩展. +// 列表_插入行图片扩展. // // hEle:. // -// iItem:. +// iRow:. // // pName:. // // hImage:. -func XList_InsertItemImageEx(hEle int, iItem int, pName string, hImage int) int { - r, _, _ := xList_InsertItemImageEx.Call(uintptr(hEle), uintptr(iItem), common.StrPtr(pName), uintptr(hImage)) +func XList_InsertRowImageEx(hEle int, iRow int, pName string, hImage int) int { + r, _, _ := xList_InsertRowImageEx.Call(uintptr(hEle), uintptr(iRow), common.StrPtr(pName), uintptr(hImage)) return int(r) } @@ -990,33 +987,33 @@ func XList_GetItemFloatEx(hEle int, iItem int, pName string, pOutValue *float32) return r != 0 } -// 列表_删除项. +// 列表_删除行. // // hEle:. // -// iItem:. -func XList_DeleteItem(hEle int, iItem int) bool { - r, _, _ := xList_DeleteItem.Call(uintptr(hEle), uintptr(iItem)) +// iRow:. +func XList_DeleteRow(hEle int, iRow int) bool { + r, _, _ := xList_DeleteRow.Call(uintptr(hEle), uintptr(iRow)) return r != 0 } -// 列表_删除项扩展. +// 列表_删除行扩展. // // hEle:. // -// iItem:. +// iRow:. // // nCount:. -func XList_DeleteItemEx(hEle int, iItem int, nCount int) bool { - r, _, _ := xList_DeleteItemEx.Call(uintptr(hEle), uintptr(iItem), uintptr(nCount)) +func XList_DeleteRowEx(hEle int, iRow int, nCount int) bool { + r, _, _ := xList_DeleteRowEx.Call(uintptr(hEle), uintptr(iRow), uintptr(nCount)) return r != 0 } -// 列表_删除项全部. +// 列表_删除行全部. // // hEle:. -func XList_DeleteItemAll(hEle int) int { - r, _, _ := xList_DeleteItemAll.Call(uintptr(hEle)) +func XList_DeleteRowAll(hEle int) int { + r, _, _ := xList_DeleteRowAll.Call(uintptr(hEle)) return int(r) } @@ -1048,13 +1045,13 @@ func XList_GetCountColumn_AD(hEle int) int { // // hEle: 元素句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XList_SetSplitLineColor(hEle int, color int) int { r, _, _ := xList_SetSplitLineColor.Call(uintptr(hEle), uintptr(color)) return int(r) } -// 列表_置项高度. +// 列表_置行高度. // // hEle: 元素句柄. // @@ -1063,12 +1060,12 @@ func XList_SetSplitLineColor(hEle int, color int) int { // nHeight: 高度. // // nSelHeight: 选中时高度. -func XList_SetItemHeight(hEle int, iRow int, nHeight, nSelHeight int32) int { - r, _, _ := xList_SetItemHeight.Call(uintptr(hEle), uintptr(iRow), uintptr(nHeight), uintptr(nSelHeight)) +func XList_SetRowHeight(hEle int, iRow int, nHeight, nSelHeight int32) int { + r, _, _ := xList_SetRowHeight.Call(uintptr(hEle), uintptr(iRow), uintptr(nHeight), uintptr(nSelHeight)) return int(r) } -// 列表_取项高度. +// 列表_取行高度. // // hEle: 元素句柄. // @@ -1077,8 +1074,8 @@ func XList_SetItemHeight(hEle int, iRow int, nHeight, nSelHeight int32) int { // pHeight: 高度. // // pSelHeight: 选中时高度. -func XList_GetItemHeight(hEle int, iRow int, pHeight, pSelHeight *int32) int { - r, _, _ := xList_GetItemHeight.Call(uintptr(hEle), uintptr(iRow), uintptr(unsafe.Pointer(pHeight)), uintptr(unsafe.Pointer(pSelHeight))) +func XList_GetRowHeight(hEle int, iRow int, pHeight, pSelHeight *int32) int { + r, _, _ := xList_GetRowHeight.Call(uintptr(hEle), uintptr(iRow), uintptr(unsafe.Pointer(pHeight)), uintptr(unsafe.Pointer(pSelHeight))) return int(r) } @@ -1086,7 +1083,7 @@ func XList_GetItemHeight(hEle int, iRow int, pHeight, pSelHeight *int32) int { // // hEle: 元素句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. // // width: 线宽度. func XList_SetDragRectColor(hEle int, color, width int) int { @@ -1143,3 +1140,37 @@ func XList_SetItemTemplateXMLFromZipRes(hEle int, id int32, pFileName string, pP r, _, _ := xList_SetItemTemplateXMLFromZipRes.Call(uintptr(hEle), uintptr(id), common.StrPtr(pFileName), common.StrPtr(pPassword), hModule) return r != 0 } + +// 列表_添加列文本2, 返回列索引. 简化版本. +// +// hEle: 元素句柄. +// +// nWidth: 列宽度. +// +// pText: 标题文本. +func XList_AddColumnText2(hEle int, nWidth int32, pText string) int32 { + r, _, _ := xList_AddColumnText2.Call(uintptr(hEle), uintptr(nWidth), common.StrPtr(pText)) + return int32(r) +} + +// 列表_添加列图片2, 返回列索引. 简化版本. +// +// hEle: 元素句柄. +// +// nWidth: 列宽度. +// +// hImage: 图片句柄. +func XList_AddColumnImage2(hEle int, nWidth int32, hImage int) int32 { + r, _, _ := xList_AddColumnImage2.Call(uintptr(hEle), uintptr(nWidth), uintptr(hImage)) + return int32(r) +} + +// 列表_创建数据适配器2. 创建数据适配器,根据绑定的项模板初始化数据适配器的列(字段名); 数据适配器存储数据, UI对象根据绑定的字段名显示数据适配器中对应的数据; 此接口是简化接口, 合并了 xc.XList_CreateAdapter() 和 xc.XList_CreateAdapterHeader() 接口; +// +// hEle: 元素句柄. +// +// col_extend_count: 列延伸-预计列表总列数, 默认值0; 限制最大延伸范围, 避免超出范围, 增加不必要的字段. 例如默认模板是1列, 但是数据有5列,那么列延伸填5. +func XList_CreateAdapters(hEle int, col_extend_count int32) bool { + r, _, _ := xList_CreateAdapters.Call(uintptr(hEle), uintptr(col_extend_count)) + return r != 0 +} diff --git a/xc/listbox.go b/xc/listbox.go index a251fe4..4c13207 100644 --- a/xc/listbox.go +++ b/xc/listbox.go @@ -47,9 +47,8 @@ func XListBox_CreateEx(x, y, cx, cy int32, hParent, col_extend_count int32) int // hEle: 元素句柄. // // bEnable: 是否启用. -func XListBox_EnableFixedRowHeight(hEle int, bEnable bool) int { - r, _, _ := xListBox_EnableFixedRowHeight.Call(uintptr(hEle), common.BoolPtr(bEnable)) - return int(r) +func XListBox_EnableFixedRowHeight(hEle int, bEnable bool) { + xListBox_EnableFixedRowHeight.Call(uintptr(hEle), common.BoolPtr(bEnable)) } // 列表框_启用模板复用. @@ -57,9 +56,8 @@ func XListBox_EnableFixedRowHeight(hEle int, bEnable bool) int { // hEle: 元素句柄. // // bEnable: 是否启用. -func XListBox_EnableTemplateReuse(hEle int, bEnable bool) int { - r, _, _ := xListBox_EnableTemplateReuse.Call(uintptr(hEle), common.BoolPtr(bEnable)) - return int(r) +func XListBox_EnableTemplateReuse(hEle int, bEnable bool) { + xListBox_EnableTemplateReuse.Call(uintptr(hEle), common.BoolPtr(bEnable)) } // 列表框_启用虚表. @@ -67,9 +65,8 @@ func XListBox_EnableTemplateReuse(hEle int, bEnable bool) int { // hEle: 元素句柄. // // bEnable: 是否启用. -func XListBox_EnableVirtualTable(hEle int, bEnable bool) int { - r, _, _ := xListBox_EnableVirtualTable.Call(uintptr(hEle), common.BoolPtr(bEnable)) - return int(r) +func XListBox_EnableVirtualTable(hEle int, bEnable bool) { + xListBox_EnableVirtualTable.Call(uintptr(hEle), common.BoolPtr(bEnable)) } // 列表框_置虚表行数. @@ -77,9 +74,8 @@ func XListBox_EnableVirtualTable(hEle int, bEnable bool) int { // hEle: 元素句柄. // // nRowCount: 行数. -func XListBox_SetVirtualRowCount(hEle int, nRowCount int) int { - r, _, _ := xListBox_SetVirtualRowCount.Call(uintptr(hEle), uintptr(nRowCount)) - return int(r) +func XListBox_SetVirtualRowCount(hEle int, nRowCount int32) { + xListBox_SetVirtualRowCount.Call(uintptr(hEle), uintptr(nRowCount)) } // 列表框_置绘制项背景标志, 设置是否绘制指定状态下项的背景. @@ -87,9 +83,8 @@ func XListBox_SetVirtualRowCount(hEle int, nRowCount int) int { // hEle: 元素句柄. // // nFlags: 标志位, List_DrawItemBk_Flag_. -func XListBox_SetDrawItemBkFlags(hEle int, nFlags xcc.List_DrawItemBk_Flag_) int { - r, _, _ := xListBox_SetDrawItemBkFlags.Call(uintptr(hEle), uintptr(nFlags)) - return int(r) +func XListBox_SetDrawItemBkFlags(hEle int, nFlags xcc.List_DrawItemBk_Flag_) { + xListBox_SetDrawItemBkFlags.Call(uintptr(hEle), uintptr(nFlags)) } // 列表框_置项数据, 设置项用户数据. @@ -99,7 +94,7 @@ func XListBox_SetDrawItemBkFlags(hEle int, nFlags xcc.List_DrawItemBk_Flag_) int // iItem: 想索引. // // nUserData: 用户数据. -func XListBox_SetItemData(hEle int, iItem int, nUserData int) bool { +func XListBox_SetItemData(hEle int, iItem int32, nUserData int) bool { r, _, _ := xListBox_SetItemData.Call(uintptr(hEle), uintptr(iItem), uintptr(nUserData)) return r != 0 } @@ -109,7 +104,7 @@ func XListBox_SetItemData(hEle int, iItem int, nUserData int) bool { // hEle: 元素句柄. // // iItem: 项索引. -func XListBox_GetItemData(hEle int, iItem int) int { +func XListBox_GetItemData(hEle int, iItem int32) int { r, _, _ := xListBox_GetItemData.Call(uintptr(hEle), uintptr(iItem)) return int(r) } @@ -121,7 +116,7 @@ func XListBox_GetItemData(hEle int, iItem int) int { // iItem: 项索引. // // pItem: 项信息. -func XListBox_SetItemInfo(hEle int, iItem int, pItem *ListBox_Item_Info_) bool { +func XListBox_SetItemInfo(hEle int, iItem int32, pItem *ListBox_Item_Info_) bool { r, _, _ := xListBox_SetItemInfo.Call(uintptr(hEle), uintptr(iItem), uintptr(unsafe.Pointer(pItem))) return r != 0 } @@ -133,7 +128,7 @@ func XListBox_SetItemInfo(hEle int, iItem int, pItem *ListBox_Item_Info_) bool { // iItem: 项索引. // // pItem: 项信息. -func XListBox_GetItemInfo(hEle int, iItem int, pItem *ListBox_Item_Info_) bool { +func XListBox_GetItemInfo(hEle int, iItem int32, pItem *ListBox_Item_Info_) bool { r, _, _ := xListBox_GetItemInfo.Call(uintptr(hEle), uintptr(iItem), uintptr(unsafe.Pointer(pItem))) return r != 0 } @@ -143,7 +138,7 @@ func XListBox_GetItemInfo(hEle int, iItem int, pItem *ListBox_Item_Info_) bool { // hEle: 元素句柄. // // iItem: 项索引. -func XListBox_SetSelectItem(hEle int, iItem int) bool { +func XListBox_SetSelectItem(hEle int, iItem int32) bool { r, _, _ := xListBox_SetSelectItem.Call(uintptr(hEle), uintptr(iItem)) return r != 0 } @@ -151,9 +146,9 @@ func XListBox_SetSelectItem(hEle int, iItem int) bool { // 列表框_取选择项, 返回项索引. // // hEle: 元素句柄. -func XListBox_GetSelectItem(hEle int) int { +func XListBox_GetSelectItem(hEle int) int32 { r, _, _ := xListBox_GetSelectItem.Call(uintptr(hEle)) - return int(r) + return int32(r) } // 列表框_添加选择项. @@ -161,7 +156,7 @@ func XListBox_GetSelectItem(hEle int) int { // hEle: 元素句柄. // // iItem: 项索引. -func XListBox_AddSelectItem(hEle int, iItem int) bool { +func XListBox_AddSelectItem(hEle int, iItem int32) bool { r, _, _ := xListBox_AddSelectItem.Call(uintptr(hEle), uintptr(iItem)) return r != 0 } @@ -171,7 +166,7 @@ func XListBox_AddSelectItem(hEle int, iItem int) bool { // hEle: 元素句柄. // // iItem: 项索引. -func XListBox_CancelSelectItem(hEle int, iItem int) bool { +func XListBox_CancelSelectItem(hEle int, iItem int32) bool { r, _, _ := xListBox_CancelSelectItem.Call(uintptr(hEle), uintptr(iItem)) return r != 0 } @@ -191,29 +186,29 @@ func XListBox_CancelSelectAll(hEle int) bool { // pArray: 数组缓冲区. // // nArraySize: 数组大小. -func XListBox_GetSelectAll(hEle int, pArray *[]int32, nArraySize int) int { +func XListBox_GetSelectAll(hEle int, pArray *[]int32, nArraySize int32) int32 { if nArraySize < 1 { return 0 } *pArray = make([]int32, nArraySize) r, _, _ := xListBox_GetSelectAll.Call(uintptr(hEle), uintptr(unsafe.Pointer(&(*pArray)[0])), uintptr(nArraySize)) - return int(r) + return int32(r) } // 列表框_取选择项数量, 获取选择项数量. // // hEle: 元素句柄. -func XListBox_GetSelectCount(hEle int) int { +func XListBox_GetSelectCount(hEle int) int32 { r, _, _ := xListBox_GetSelectCount.Call(uintptr(hEle)) - return int(r) + return int32(r) } // 列表框_取鼠标停留项, 返回鼠标所在项. // // hEle: 元素句柄. -func XListBox_GetItemMouseStay(hEle int) int { +func XListBox_GetItemMouseStay(hEle int) int32 { r, _, _ := xListBox_GetItemMouseStay.Call(uintptr(hEle)) - return int(r) + return int32(r) } // 列表框_选择全部项. @@ -229,9 +224,8 @@ func XListBox_SelectAll(hEle int) bool { // hEle: 元素句柄. // // iItem: 项索引. -func XListBox_VisibleItem(hEle int, iItem int) int { - r, _, _ := xListBox_VisibleItem.Call(uintptr(hEle), uintptr(iItem)) - return int(r) +func XListBox_VisibleItem(hEle int, iItem int32) { + xListBox_VisibleItem.Call(uintptr(hEle), uintptr(iItem)) } // 列表框_取可视行范围, 获取当前可见行范围. @@ -241,9 +235,8 @@ func XListBox_VisibleItem(hEle int, iItem int) int { // piStart: 开始行索引. // // piEnd: 结束行索引. -func XListBox_GetVisibleRowRange(hEle int, piStart *int32, piEnd *int32) int { - r, _, _ := xListBox_GetVisibleRowRange.Call(uintptr(hEle), uintptr(unsafe.Pointer(piStart)), uintptr(unsafe.Pointer(piEnd))) - return int(r) +func XListBox_GetVisibleRowRange(hEle int, piStart *int32, piEnd *int32) { + xListBox_GetVisibleRowRange.Call(uintptr(hEle), uintptr(unsafe.Pointer(piStart)), uintptr(unsafe.Pointer(piEnd))) } // 列表框_置项默认高度. @@ -253,9 +246,8 @@ func XListBox_GetVisibleRowRange(hEle int, piStart *int32, piEnd *int32) int { // nHeight: 项高度. // // nSelHeight: 选中项高度. -func XListBox_SetItemHeightDefault(hEle int, nHeight, nSelHeight int32) int { - r, _, _ := xListBox_SetItemHeightDefault.Call(uintptr(hEle), uintptr(nHeight), uintptr(nSelHeight)) - return int(r) +func XListBox_SetItemHeightDefault(hEle int, nHeight, nSelHeight int32) { + xListBox_SetItemHeightDefault.Call(uintptr(hEle), uintptr(nHeight), uintptr(nSelHeight)) } // 列表框_取项默认高度. @@ -265,9 +257,8 @@ func XListBox_SetItemHeightDefault(hEle int, nHeight, nSelHeight int32) int { // pHeight: 高度. // // pSelHeight: 选中时高度. -func XListBox_GetItemHeightDefault(hEle int, pHeight, pSelHeight *int32) int { - r, _, _ := xListBox_GetItemHeightDefault.Call(uintptr(hEle), uintptr(unsafe.Pointer(pHeight)), uintptr(unsafe.Pointer(pSelHeight))) - return int(r) +func XListBox_GetItemHeightDefault(hEle int, pHeight, pSelHeight *int32) { + xListBox_GetItemHeightDefault.Call(uintptr(hEle), uintptr(unsafe.Pointer(pHeight)), uintptr(unsafe.Pointer(pSelHeight))) } // 列表框_取所在行索引, 获取当前对象所在模板实例, 属于列表中哪一个项(行). 成功返回项索引, 否则返回XC_ID_ERROR. @@ -275,9 +266,9 @@ func XListBox_GetItemHeightDefault(hEle int, pHeight, pSelHeight *int32) int { // hEle: 元素句柄. // // hXCGUI: 对象句柄, UI元素句柄或形状对象句柄. -func XListBox_GetItemIndexFromHXCGUI(hEle int, hXCGUI int) int { +func XListBox_GetItemIndexFromHXCGUI(hEle int, hXCGUI int) int32 { r, _, _ := xListBox_GetItemIndexFromHXCGUI.Call(uintptr(hEle), uintptr(hXCGUI)) - return int(r) + return int32(r) } // 列表框_置行间距. @@ -285,17 +276,16 @@ func XListBox_GetItemIndexFromHXCGUI(hEle int, hXCGUI int) int { // hEle: 元素句柄. // // nSpace: 间距大小. -func XListBox_SetRowSpace(hEle int, nSpace int) int { - r, _, _ := xListBox_SetRowSpace.Call(uintptr(hEle), uintptr(nSpace)) - return int(r) +func XListBox_SetRowSpace(hEle int, nSpace int32) { + xListBox_SetRowSpace.Call(uintptr(hEle), uintptr(nSpace)) } // 列表框_取行间距. // // hEle: 元素句柄. -func XListBox_GetRowSpace(hEle int) int { +func XListBox_GetRowSpace(hEle int) int32 { r, _, _ := xListBox_GetRowSpace.Call(uintptr(hEle)) - return int(r) + return int32(r) } // 列表框_测试点击项, 检测坐标点所在项, 返回项索引. @@ -303,9 +293,9 @@ func XListBox_GetRowSpace(hEle int) int { // hEle: 元素句柄. // // pPt: 坐标点. -func XListBox_HitTest(hEle int, pPt *POINT) int { +func XListBox_HitTest(hEle int, pPt *POINT) int32 { r, _, _ := xListBox_HitTest.Call(uintptr(hEle), uintptr(unsafe.Pointer(pPt))) - return int(r) + return int32(r) } // 列表框_测试点击项扩展, 检测坐标点所在项, 自动添加滚动视图偏移量, 返回项索引. @@ -313,9 +303,9 @@ func XListBox_HitTest(hEle int, pPt *POINT) int { // hEle: 元素句柄. // // pPt: 坐标点. -func XListBox_HitTestOffset(hEle int, pPt *POINT) int { +func XListBox_HitTestOffset(hEle int, pPt *POINT) int32 { r, _, _ := xListBox_HitTestOffset.Call(uintptr(hEle), uintptr(unsafe.Pointer(pPt))) - return int(r) + return int32(r) } // 列表框_置项模板文件, 设置列表项模板文件. @@ -355,7 +345,7 @@ func XListBox_SetItemTemplateXMLFromString(hEle int, pStringXML string) bool { // iItem: 项索引. // // nTempItemID: 模板项ID. -func XListBox_GetTemplateObject(hEle int, iItem int, nTempItemID int) int { +func XListBox_GetTemplateObject(hEle int, iItem, nTempItemID int32) int { r, _, _ := xListBox_GetTemplateObject.Call(uintptr(hEle), uintptr(iItem), uintptr(nTempItemID)) return int(r) } @@ -365,9 +355,8 @@ func XListBox_GetTemplateObject(hEle int, iItem int, nTempItemID int) int { // hEle: 元素句柄. // // bEnable: 是否启用. -func XListBox_EnableMultiSel(hEle int, bEnable bool) int { - r, _, _ := xListBox_EnableMultiSel.Call(uintptr(hEle), common.BoolPtr(bEnable)) - return int(r) +func XListBox_EnableMultiSel(hEle int, bEnable bool) { + xListBox_EnableMultiSel.Call(uintptr(hEle), common.BoolPtr(bEnable)) } // 列表框_创建数据适配器, 创建数据适配器并绑定, 根据绑定的项模板初始化数据适配器的列, 返回适配器句柄. @@ -383,9 +372,8 @@ func XListBox_CreateAdapter(hEle int) int { // hEle: 元素句柄. // // hAdapter: 数据适配器句柄 XAdTable. -func XListBox_BindAdapter(hEle int, hAdapter int) int { - r, _, _ := xListBox_BindAdapter.Call(uintptr(hEle), uintptr(hAdapter)) - return int(r) +func XListBox_BindAdapter(hEle int, hAdapter int) { + xListBox_BindAdapter.Call(uintptr(hEle), uintptr(hAdapter)) } // 列表框_取数据适配器, 获取绑定的数据适配器, 返回数据适配器句柄. @@ -403,17 +391,15 @@ func XListBox_GetAdapter(hEle int) int { // iColumnAdapter: 需要排序的数据在数据适配器中所属列索引. // // bAscending: 升序(TRUE)或降序(FALSE). -func XListBox_Sort(hEle int, iColumnAdapter int, bAscending bool) int { - r, _, _ := xListBox_Sort.Call(uintptr(hEle), uintptr(iColumnAdapter), common.BoolPtr(bAscending)) - return int(r) +func XListBox_Sort(hEle int, iColumnAdapter int32, bAscending bool) { + xListBox_Sort.Call(uintptr(hEle), uintptr(iColumnAdapter), common.BoolPtr(bAscending)) } // 列表框_刷新数据. // // hEle: 元素句柄. -func XListBox_RefreshData(hEle int) int { - r, _, _ := xListBox_RefreshData.Call(uintptr(hEle)) - return int(r) +func XListBox_RefreshData(hEle int) { + xListBox_RefreshData.Call(uintptr(hEle)) } // 列表框_刷新指定项, 刷新指定项模板, 以便更新UI. @@ -421,53 +407,52 @@ func XListBox_RefreshData(hEle int) int { // hEle: 元素句柄. // // iItem: 项索引. -func XListBox_RefreshItem(hEle int, iItem int) int { - r, _, _ := xListBox_RefreshItem.Call(uintptr(hEle), uintptr(iItem)) - return int(r) +func XListBox_RefreshItem(hEle int, iItem int32) { + xListBox_RefreshItem.Call(uintptr(hEle), uintptr(iItem)) } -// 列表框_添加项文本, XAdTable_AddItemText, 返回项索引. +// 列表框_添加项文本, XAdTable_AddRowText, 返回项索引. // // hEle:. // // pText:. -func XListBox_AddItemText(hEle int, pText string) int { +func XListBox_AddItemText(hEle int, pText string) int32 { r, _, _ := xListBox_AddItemText.Call(uintptr(hEle), common.StrPtr(pText)) - return int(r) + return int32(r) } -// 列表框_添加项文本扩展, XAdTable_AddItemTextEx. +// 列表框_添加项文本扩展, XAdTable_AddRowTextEx. // // hEle:. // // pName:. // // pText:. -func XListBox_AddItemTextEx(hEle int, pName string, pText string) int { +func XListBox_AddItemTextEx(hEle int, pName string, pText string) int32 { r, _, _ := xListBox_AddItemTextEx.Call(uintptr(hEle), common.StrPtr(pName), common.StrPtr(pText)) - return int(r) + return int32(r) } -// 列表框_添加项图片, XAdTable_AddItemImage. +// 列表框_添加项图片, XAdTable_AddRowImage. // // hEle:. // // hImage:. -func XListBox_AddItemImage(hEle int, hImage int) int { +func XListBox_AddItemImage(hEle int, hImage int) int32 { r, _, _ := xListBox_AddItemImage.Call(uintptr(hEle), uintptr(hImage)) - return int(r) + return int32(r) } -// 列表框_添加项图片扩展, XAdTable_AddItemImageEx. +// 列表框_添加项图片扩展, XAdTable_AddRowImageEx. // // hEle:. // // pName:. // // hImage:. -func XListBox_AddItemImageEx(hEle int, pName string, hImage int) int { +func XListBox_AddItemImageEx(hEle int, pName string, hImage int) int32 { r, _, _ := xListBox_AddItemImageEx.Call(uintptr(hEle), common.StrPtr(pName), uintptr(hImage)) - return int(r) + return int32(r) } // 列表框_插入项文本. @@ -477,9 +462,9 @@ func XListBox_AddItemImageEx(hEle int, pName string, hImage int) int { // iItem:. // // pValue:. -func XListBox_InsertItemText(hEle int, iItem int, pValue string) int { +func XListBox_InsertItemText(hEle int, iItem int32, pValue string) int32 { r, _, _ := xListBox_InsertItemText.Call(uintptr(hEle), uintptr(iItem), common.StrPtr(pValue)) - return int(r) + return int32(r) } // 列表框_插入项文本扩展. @@ -491,9 +476,9 @@ func XListBox_InsertItemText(hEle int, iItem int, pValue string) int { // pName:. // // pValue:. -func XListBox_InsertItemTextEx(hEle int, iItem int, pName string, pValue string) int { +func XListBox_InsertItemTextEx(hEle int, iItem int32, pName string, pValue string) int32 { r, _, _ := xListBox_InsertItemTextEx.Call(uintptr(hEle), uintptr(iItem), common.StrPtr(pName), common.StrPtr(pValue)) - return int(r) + return int32(r) } // 列表框_插入项图片. @@ -503,9 +488,9 @@ func XListBox_InsertItemTextEx(hEle int, iItem int, pName string, pValue string) // iItem:. // // hImage:. -func XListBox_InsertItemImage(hEle int, iItem int, hImage int) int { +func XListBox_InsertItemImage(hEle int, iItem int32, hImage int) int32 { r, _, _ := xListBox_InsertItemImage.Call(uintptr(hEle), uintptr(iItem), uintptr(hImage)) - return int(r) + return int32(r) } // 列表框_插入项图片扩展. @@ -517,9 +502,9 @@ func XListBox_InsertItemImage(hEle int, iItem int, hImage int) int { // pName:. // // hImage:. -func XListBox_InsertItemImageEx(hEle int, iItem int, pName string, hImage int) int { +func XListBox_InsertItemImageEx(hEle int, iItem int32, pName string, hImage int) int32 { r, _, _ := xListBox_InsertItemImageEx.Call(uintptr(hEle), uintptr(iItem), common.StrPtr(pName), uintptr(hImage)) - return int(r) + return int32(r) } // 列表框_置项文本. @@ -531,7 +516,7 @@ func XListBox_InsertItemImageEx(hEle int, iItem int, pName string, hImage int) i // iColumn:. // // pText:. -func XListBox_SetItemText(hEle int, iItem int, iColumn int, pText string) bool { +func XListBox_SetItemText(hEle int, iItem, iColumn int32, pText string) bool { r, _, _ := xListBox_SetItemText.Call(uintptr(hEle), uintptr(iItem), uintptr(iColumn), common.StrPtr(pText)) return r != 0 } @@ -545,7 +530,7 @@ func XListBox_SetItemText(hEle int, iItem int, iColumn int, pText string) bool { // pName:. // // pText:. -func XListBox_SetItemTextEx(hEle int, iItem int, pName string, pText string) bool { +func XListBox_SetItemTextEx(hEle int, iItem int32, pName string, pText string) bool { r, _, _ := xListBox_SetItemTextEx.Call(uintptr(hEle), uintptr(iItem), common.StrPtr(pName), common.StrPtr(pText)) return r != 0 } @@ -559,7 +544,7 @@ func XListBox_SetItemTextEx(hEle int, iItem int, pName string, pText string) boo // iColumn:. // // hImage:. -func XListBox_SetItemImage(hEle int, iItem int, iColumn int, hImage int) bool { +func XListBox_SetItemImage(hEle int, iItem, iColumn int32, hImage int) bool { r, _, _ := xListBox_SetItemImage.Call(uintptr(hEle), uintptr(iItem), uintptr(iColumn), uintptr(hImage)) return r != 0 } @@ -573,7 +558,7 @@ func XListBox_SetItemImage(hEle int, iItem int, iColumn int, hImage int) bool { // pName:. // // hImage:. -func XListBox_SetItemImageEx(hEle int, iItem int, pName string, hImage int) bool { +func XListBox_SetItemImageEx(hEle int, iItem int32, pName string, hImage int) bool { r, _, _ := xListBox_SetItemImageEx.Call(uintptr(hEle), uintptr(iItem), common.StrPtr(pName), uintptr(hImage)) return r != 0 } @@ -587,7 +572,7 @@ func XListBox_SetItemImageEx(hEle int, iItem int, pName string, hImage int) bool // iColumn:. // // nValue:. -func XListBox_SetItemInt(hEle int, iItem int, iColumn int, nValue int) bool { +func XListBox_SetItemInt(hEle int, iItem, iColumn int32, nValue int32) bool { r, _, _ := xListBox_SetItemInt.Call(uintptr(hEle), uintptr(iItem), uintptr(iColumn), uintptr(nValue)) return r != 0 } @@ -601,7 +586,7 @@ func XListBox_SetItemInt(hEle int, iItem int, iColumn int, nValue int) bool { // pName:. // // nValue:. -func XListBox_SetItemIntEx(hEle int, iItem int, pName string, nValue int) bool { +func XListBox_SetItemIntEx(hEle int, iItem int32, pName string, nValue int32) bool { r, _, _ := xListBox_SetItemIntEx.Call(uintptr(hEle), uintptr(iItem), common.StrPtr(pName), uintptr(nValue)) return r != 0 } @@ -615,7 +600,7 @@ func XListBox_SetItemIntEx(hEle int, iItem int, pName string, nValue int) bool { // iColumn:. // // fFloat:. -func XListBox_SetItemFloat(hEle int, iItem int, iColumn int, fFloat float32) bool { +func XListBox_SetItemFloat(hEle int, iItem, iColumn int32, fFloat float32) bool { r, _, _ := xListBox_SetItemFloat.Call(uintptr(hEle), uintptr(iItem), uintptr(iColumn), common.Float32Ptr(fFloat)) return r != 0 } @@ -629,7 +614,7 @@ func XListBox_SetItemFloat(hEle int, iItem int, iColumn int, fFloat float32) boo // pName:. // // fFloat:. -func XListBox_SetItemFloatEx(hEle int, iItem int, pName string, fFloat float32) bool { +func XListBox_SetItemFloatEx(hEle int, iItem int32, pName string, fFloat float32) bool { r, _, _ := xListBox_SetItemFloatEx.Call(uintptr(hEle), uintptr(iItem), common.StrPtr(pName), common.Float32Ptr(fFloat)) return r != 0 } @@ -641,7 +626,7 @@ func XListBox_SetItemFloatEx(hEle int, iItem int, pName string, fFloat float32) // iItem:. // // iColumn:. -func XListBox_GetItemText(hEle int, iItem int, iColumn int) string { +func XListBox_GetItemText(hEle int, iItem, iColumn int32) string { r, _, _ := xListBox_GetItemText.Call(uintptr(hEle), uintptr(iItem), uintptr(iColumn)) return common.UintPtrToString(r) } @@ -653,7 +638,7 @@ func XListBox_GetItemText(hEle int, iItem int, iColumn int) string { // iItem:. // // pName:. -func XListBox_GetItemTextEx(hEle int, iItem int, pName string) string { +func XListBox_GetItemTextEx(hEle int, iItem int32, pName string) string { r, _, _ := xListBox_GetItemTextEx.Call(uintptr(hEle), uintptr(iItem), common.StrPtr(pName)) return common.UintPtrToString(r) } @@ -665,7 +650,7 @@ func XListBox_GetItemTextEx(hEle int, iItem int, pName string) string { // iItem:. // // iColumn:. -func XListBox_GetItemImage(hEle int, iItem int, iColumn int) int { +func XListBox_GetItemImage(hEle int, iItem, iColumn int32) int { r, _, _ := xListBox_GetItemImage.Call(uintptr(hEle), uintptr(iItem), uintptr(iColumn)) return int(r) } @@ -677,7 +662,7 @@ func XListBox_GetItemImage(hEle int, iItem int, iColumn int) int { // iItem:. // // pName:. -func XListBox_GetItemImageEx(hEle int, iItem int, pName string) int { +func XListBox_GetItemImageEx(hEle int, iItem int32, pName string) int { r, _, _ := xListBox_GetItemImageEx.Call(uintptr(hEle), uintptr(iItem), common.StrPtr(pName)) return int(r) } @@ -691,7 +676,7 @@ func XListBox_GetItemImageEx(hEle int, iItem int, pName string) int { // iColumn:. // // pOutValue:. -func XListBox_GetItemInt(hEle int, iItem int, iColumn int, pOutValue *int32) bool { +func XListBox_GetItemInt(hEle int, iItem, iColumn int32, pOutValue *int32) bool { r, _, _ := xListBox_GetItemInt.Call(uintptr(hEle), uintptr(iItem), uintptr(iColumn), uintptr(unsafe.Pointer(pOutValue))) return r != 0 } @@ -705,7 +690,7 @@ func XListBox_GetItemInt(hEle int, iItem int, iColumn int, pOutValue *int32) boo // pName:. // // pOutValue:. -func XListBox_GetItemIntEx(hEle int, iItem int, pName string, pOutValue *int32) bool { +func XListBox_GetItemIntEx(hEle int, iItem int32, pName string, pOutValue *int32) bool { r, _, _ := xListBox_GetItemIntEx.Call(uintptr(hEle), uintptr(iItem), common.StrPtr(pName), uintptr(unsafe.Pointer(pOutValue))) return r != 0 } @@ -719,7 +704,7 @@ func XListBox_GetItemIntEx(hEle int, iItem int, pName string, pOutValue *int32) // iColumn:. // // pOutValue:. -func XListBox_GetItemFloat(hEle int, iItem int, iColumn int, pOutValue *float32) bool { +func XListBox_GetItemFloat(hEle int, iItem, iColumn int32, pOutValue *float32) bool { r, _, _ := xListBox_GetItemFloat.Call(uintptr(hEle), uintptr(iItem), uintptr(iColumn), uintptr(unsafe.Pointer(pOutValue))) return r != 0 } @@ -733,7 +718,7 @@ func XListBox_GetItemFloat(hEle int, iItem int, iColumn int, pOutValue *float32) // pName:. // // pOutValue:. -func XListBox_GetItemFloatEx(hEle int, iItem int, pName string, pOutValue *float32) bool { +func XListBox_GetItemFloatEx(hEle int, iItem int32, pName string, pOutValue *float32) bool { r, _, _ := xListBox_GetItemFloatEx.Call(uintptr(hEle), uintptr(iItem), common.StrPtr(pName), uintptr(unsafe.Pointer(pOutValue))) return r != 0 } @@ -743,7 +728,7 @@ func XListBox_GetItemFloatEx(hEle int, iItem int, pName string, pOutValue *float // hEle:. // // iItem:. -func XListBox_DeleteItem(hEle int, iItem int) bool { +func XListBox_DeleteItem(hEle int, iItem int32) bool { r, _, _ := xListBox_DeleteItem.Call(uintptr(hEle), uintptr(iItem)) return r != 0 } @@ -755,7 +740,7 @@ func XListBox_DeleteItem(hEle int, iItem int) bool { // iItem:. // // nCount:. -func XListBox_DeleteItemEx(hEle int, iItem int, nCount int) bool { +func XListBox_DeleteItemEx(hEle int, iItem, nCount int32) bool { r, _, _ := xListBox_DeleteItemEx.Call(uintptr(hEle), uintptr(iItem), uintptr(nCount)) return r != 0 } @@ -763,55 +748,51 @@ func XListBox_DeleteItemEx(hEle int, iItem int, nCount int) bool { // 列表框_删除项全部. // // hEle:. -func XListBox_DeleteItemAll(hEle int) int { - r, _, _ := xListBox_DeleteItemAll.Call(uintptr(hEle)) - return int(r) +func XListBox_DeleteItemAll(hEle int) { + xListBox_DeleteItemAll.Call(uintptr(hEle)) } // 列表框_删除列全部. // // hEle:. -func XListBox_DeleteColumnAll(hEle int) int { - r, _, _ := xListBox_DeleteColumnAll.Call(uintptr(hEle)) - return int(r) +func XListBox_DeleteColumnAll(hEle int) { + xListBox_DeleteColumnAll.Call(uintptr(hEle)) } // 列表框_取项数量AD. // // hEle:. -func XListBox_GetCount_AD(hEle int) int { +func XListBox_GetCount_AD(hEle int) int32 { r, _, _ := xListBox_GetCount_AD.Call(uintptr(hEle)) - return int(r) + return int32(r) } // 列表框_取列数量AD. // // hEle:. -func XListBox_GetCountColumn_AD(hEle int) int { +func XListBox_GetCountColumn_AD(hEle int) int32 { r, _, _ := xListBox_GetCountColumn_AD.Call(uintptr(hEle)) - return int(r) + return int32(r) } // 列表框_置分割线颜色. // // hEle: 元素句柄. // -// color: ABGR 颜色值. -func XListBox_SetSplitLineColor(hEle int, color int) int { - r, _, _ := xListBox_SetSplitLineColor.Call(uintptr(hEle), uintptr(color)) - return int(r) +// color: ARGB 颜色值. +func XListBox_SetSplitLineColor(hEle int, color int) { + xListBox_SetSplitLineColor.Call(uintptr(hEle), uintptr(color)) } // 列表框_置拖动矩形颜色. // // hEle: 元素句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. // // width: 线宽度. -func XListBox_SetDragRectColor(hEle int, color, width int) int { - r, _, _ := xListBox_SetDragRectColor.Call(uintptr(hEle), uintptr(color), uintptr(width)) - return int(r) +func XListBox_SetDragRectColor(hEle int, color int, width int32) { + xListBox_SetDragRectColor.Call(uintptr(hEle), uintptr(color), uintptr(width)) } // 列表框_置项模板从内存. 设置项模板文件. @@ -820,7 +801,7 @@ func XListBox_SetDragRectColor(hEle int, color, width int) int { // // data: 模板数据. func XListBox_SetItemTemplateXMLFromMem(hEle int, data []byte) bool { - r, _, _ := xListBox_SetItemTemplateXMLFromMem.Call(uintptr(hEle), common.ByteSliceDataPtr(&data), uintptr(len(data))) + r, _, _ := xListBox_SetItemTemplateXMLFromMem.Call(uintptr(hEle), common.ByteSliceDataPtr(&data), uintptr(int32(len(data)))) return r != 0 } @@ -835,7 +816,7 @@ func XListBox_SetItemTemplateXMLFromMem(hEle int, data []byte) bool { // pPassword: zip密码. // // hModule: 模块句柄, 可填0. -func XListBox_SetItemTemplateXMLFromZipRes(hEle, id int, pFileName string, pPassword string, hModule uintptr) bool { +func XListBox_SetItemTemplateXMLFromZipRes(hEle int, id int32, pFileName string, pPassword string, hModule uintptr) bool { r, _, _ := xListBox_SetItemTemplateXMLFromZipRes.Call(uintptr(hEle), uintptr(id), common.StrPtr(pFileName), common.StrPtr(pPassword), hModule) return r != 0 } @@ -847,3 +828,29 @@ func XListBox_GetItemTemplate(hEle int) int { r, _, _ := xListBox_GetItemTemplate.Call(uintptr(hEle)) return int(r) } + +// 列表框_置项高度. 注意:为了提高性能, 默认使用列表框的全局项高度, 如果需要指定项单独高度, 需要关闭固定行高: xc.XListBox_EnableFixedRowHeight +// +// hEle: 元素句柄. +// +// iItem: 项索引. +// +// nHeight: 项高度. +// +// nSelHeight: 项选中时高度. +func XListBox_SetItemHeight(hEle int, iItem, nHeight, nSelHeight int32) { + xListBox_SetItemHeight.Call(uintptr(hEle), uintptr(iItem), uintptr(nHeight), uintptr(nSelHeight)) +} + +// 列表框_取项高度. +// +// hEle: 元素句柄. +// +// iItem: 项索引. +// +// pHeight: 高度. +// +// pSelHeight: 选中时高度. +func XListBox_GetItemHeight(hEle int, iItem int32, pHeight, pSelHeight *int32) { + xListBox_GetItemHeight.Call(uintptr(hEle), uintptr(iItem), uintptr(unsafe.Pointer(pHeight)), uintptr(unsafe.Pointer(pSelHeight))) +} diff --git a/xc/listview.go b/xc/listview.go index f04d564..5a4e74f 100644 --- a/xc/listview.go +++ b/xc/listview.go @@ -920,7 +920,7 @@ func XListView_Item_GetImage(hEle int, iGroup int, iItem int, iColumn int) int { // // hEle: 元素句柄. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // width: 线宽度. func XListView_SetDragRectColor(hEle int, color int, width int) int { diff --git a/xc/menu.go b/xc/menu.go index 0343411..e3bf9b1 100644 --- a/xc/menu.go +++ b/xc/menu.go @@ -270,7 +270,7 @@ func XMenu_GetItemHeight(hMenu int) int32 { // // hMenu: 菜单句柄. // -// crColor: ABGR 颜色. +// crColor: ARGB 颜色. func XMenu_SetBorderColor(hMenu int, crColor int) { xMenu_SetBorderColor.Call(uintptr(hMenu), uintptr(crColor)) } diff --git a/xc/monthcal.go b/xc/monthcal.go index 27a89af..04a72b8 100644 --- a/xc/monthcal.go +++ b/xc/monthcal.go @@ -46,11 +46,11 @@ func XMonthCal_SetToday(hEle int, nYear int32, nMonth int32, nDay int32) int { // // hEle: 元素句柄. // -// pnYear: 年.[INT. +// pnYear: 年. // -// pnMonth: 月.[INT. +// pnMonth: 月. // -// pnDay: 日.[INT. +// pnDay: 日. func XMonthCal_GetToday(hEle int, pnYear *int32, pnMonth *int32, pnDay *int32) int { r, _, _ := xMonthCal_GetToday.Call(uintptr(hEle), uintptr(unsafe.Pointer(pnYear)), uintptr(unsafe.Pointer(pnMonth)), uintptr(unsafe.Pointer(pnDay))) return int(r) @@ -60,11 +60,11 @@ func XMonthCal_GetToday(hEle int, pnYear *int32, pnMonth *int32, pnDay *int32) i // // hEle: 元素句柄. // -// pnYear: 年.[INT. +// pnYear: 年. // -// pnMonth: 月.[INT. +// pnMonth: 月. // -// pnDay: 日.[INT. +// pnDay: 日. func XMonthCal_GetSelDate(hEle int, pnYear *int32, pnMonth *int32, pnDay *int32) int { r, _, _ := xMonthCal_GetSelDate.Call(uintptr(hEle), uintptr(unsafe.Pointer(pnYear)), uintptr(unsafe.Pointer(pnMonth)), uintptr(unsafe.Pointer(pnDay))) return int(r) @@ -76,7 +76,7 @@ func XMonthCal_GetSelDate(hEle int, pnYear *int32, pnMonth *int32, pnDay *int32) // // nFlag: 1:周六, 周日文字颜色, 2:日期文字的颜色; 其它周文字颜色, 使用元素自身颜色. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XMonthCal_SetTextColor(hEle int, nFlag int32, color int) int { r, _, _ := xMonthCal_SetTextColor.Call(uintptr(hEle), uintptr(nFlag), uintptr(color)) return int(r) diff --git a/xc/objectbase.go b/xc/objectbase.go index 52b5111..c6cba90 100644 --- a/xc/objectbase.go +++ b/xc/objectbase.go @@ -13,9 +13,9 @@ func XObj_GetType(hXCGUI int) xcc.XC_OBJECT_TYPE { // XObj_GetTypeBase 炫彩对象_取基础类型, 获取对象的基础类型, 返回对象类型, 以下类型之一: XC_ERROR, XC_WINDOW, XC_ELE, XC_SHAPE, XC_ADAPTER. // // hXCGUI: 对象句柄. -func XObj_GetTypeBase(hXCGUI int) int { +func XObj_GetTypeBase(hXCGUI int) xcc.XC_OBJECT_TYPE { r, _, _ := xObj_GetTypeBase.Call(uintptr(hXCGUI)) - return int(r) + return xcc.XC_OBJECT_TYPE(r) } // XObj_GetTypeEx 炫彩对象_取类型扩展, 获取对象扩展类型, 返回对象扩展类型: button_type_ , element_type_ , xc_ex_error. diff --git a/xc/progressbar.go b/xc/progressbar.go index 51b7ef6..a09e693 100644 --- a/xc/progressbar.go +++ b/xc/progressbar.go @@ -98,7 +98,7 @@ func XProgBar_EnableShowText(hEle int, bShow bool) bool { // // hEle: 元素句柄. // -// color: ABGR 颜色. +// color: ARGB 颜色. func XProgBar_SetColorLoad(hEle int, color int) bool { r, _, _ := xProgBar_SetColorLoad.Call(uintptr(hEle), uintptr(color)) return r != 0 diff --git a/xc/resource.go b/xc/resource.go index 1f534fd..6a69589 100644 --- a/xc/resource.go +++ b/xc/resource.go @@ -8,25 +8,23 @@ import ( // 资源_启用延迟加载, 启用延迟加载; 图片文件, 列表项模板文件. // // bEnable: 是否启用. -func XRes_EnableDelayLoad(bEnable bool) int { - r, _, _ := xRes_EnableDelayLoad.Call(common.BoolPtr(bEnable)) - return int(r) +func XRes_EnableDelayLoad(bEnable bool) { + xRes_EnableDelayLoad.Call(common.BoolPtr(bEnable)) } // 资源_置文件加载回调, 设置文件加载回调函数. // // pFun: 回调函数. -func XRes_SetLoadFileCallback(pFun interface{}) int { - r, _, _ := xRes_SetLoadFileCallback.Call(syscall.NewCallback(pFun)) - return int(r) +func XRes_SetLoadFileCallback(pFun FunLoadFile) { + xRes_SetLoadFileCallback.Call(syscall.NewCallback(pFun)) } // 资源_取ID值, 获取资源ID整型值. // // pName: 资源ID名称. -func XRes_GetIDValue(pName string) int { +func XRes_GetIDValue(pName string) int32 { r, _, _ := xRes_GetIDValue.Call(common.StrPtr(pName)) - return int(r) + return int32(r) } // 资源_取图片, 查找资源图片. @@ -70,3 +68,6 @@ func XRes_GetBkM(pName string) int { r, _, _ := xRes_GetBkM.Call(common.StrPtr(pName)) return int(r) } + +// FunLoadFile 图片资源文件加载回调. +type FunLoadFile func(pFileName uintptr) bool diff --git a/xc/shapeellipse.go b/xc/shapeellipse.go index 9332596..01781e8 100644 --- a/xc/shapeellipse.go +++ b/xc/shapeellipse.go @@ -22,7 +22,7 @@ func XShapeEllipse_Create(x int, y int, cx int, cy int, hParent int) int { // // hShape: 形状对象句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XShapeEllipse_SetBorderColor(hShape int, color int) int { r, _, _ := xShapeEllipse_SetBorderColor.Call(uintptr(hShape), uintptr(color)) return int(r) @@ -32,7 +32,7 @@ func XShapeEllipse_SetBorderColor(hShape int, color int) int { // // hShape: 形状对象句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XShapeEllipse_SetFillColor(hShape int, color int) int { r, _, _ := xShapeEllipse_SetFillColor.Call(uintptr(hShape), uintptr(color)) return int(r) diff --git a/xc/shapegroupbox.go b/xc/shapegroupbox.go index d49faaf..96ddede 100644 --- a/xc/shapegroupbox.go +++ b/xc/shapegroupbox.go @@ -27,7 +27,7 @@ func XShapeGroupBox_Create(x int, y int, cx int, cy int, pName string, hParent i // // hShape: 形状对象句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XShapeGroupBox_SetBorderColor(hShape int, color int) int { r, _, _ := xShapeGroupBox_SetBorderColor.Call(uintptr(hShape), uintptr(color)) return int(r) @@ -37,7 +37,7 @@ func XShapeGroupBox_SetBorderColor(hShape int, color int) int { // // hShape: 形状对象句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XShapeGroupBox_SetTextColor(hShape int, color int) int { r, _, _ := xShapeGroupBox_SetTextColor.Call(uintptr(hShape), uintptr(color)) return int(r) diff --git a/xc/shapeline.go b/xc/shapeline.go index 97b6d94..d7be576 100644 --- a/xc/shapeline.go +++ b/xc/shapeline.go @@ -36,7 +36,7 @@ func XShapeLine_SetPosition(hShape int, x1 int, y1 int, x2 int, y2 int) int { // // hShape: 形状对象句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XShapeLine_SetColor(hShape int, color int) int { r, _, _ := xShapeLine_SetColor.Call(uintptr(hShape), uintptr(color)) return int(r) diff --git a/xc/shaperect.go b/xc/shaperect.go index 194f781..1e55e0b 100644 --- a/xc/shaperect.go +++ b/xc/shaperect.go @@ -25,7 +25,7 @@ func XShapeRect_Create(x int, y int, cx int, cy int, hParent int) int { // // hShape: 形状对象句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XShapeRect_SetBorderColor(hShape int, color int) int { r, _, _ := xShapeRect_SetBorderColor.Call(uintptr(hShape), uintptr(color)) return int(r) @@ -35,7 +35,7 @@ func XShapeRect_SetBorderColor(hShape int, color int) int { // // hShape: 形状对象句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XShapeRect_SetFillColor(hShape int, color int) int { r, _, _ := xShapeRect_SetFillColor.Call(uintptr(hShape), uintptr(color)) return int(r) diff --git a/xc/shapetext.go b/xc/shapetext.go index 01b32a0..e0361db 100644 --- a/xc/shapetext.go +++ b/xc/shapetext.go @@ -71,7 +71,7 @@ func XShapeText_GetFont(hTextBlock int) int { // // hTextBlock: 形状对象文本句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XShapeText_SetTextColor(hTextBlock int, color int) int { r, _, _ := xShapeText_SetTextColor.Call(uintptr(hTextBlock), uintptr(color)) return int(r) diff --git a/xc/textlink.go b/xc/textlink.go index 5843ae2..090cc11 100644 --- a/xc/textlink.go +++ b/xc/textlink.go @@ -44,7 +44,7 @@ func XTextLink_EnableUnderlineStay(hEle int, bEnable bool) int { // // hEle: 元素句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XTextLink_SetTextColorStay(hEle int, color int) int { r, _, _ := xTextLink_SetTextColorStay.Call(uintptr(hEle), uintptr(color)) return int(r) @@ -54,7 +54,7 @@ func XTextLink_SetTextColorStay(hEle int, color int) int { // // hEle: 元素句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XTextLink_SetUnderlineColorLeave(hEle int, color int) int { r, _, _ := xTextLink_SetUnderlineColorLeave.Call(uintptr(hEle), uintptr(color)) return int(r) @@ -64,7 +64,7 @@ func XTextLink_SetUnderlineColorLeave(hEle int, color int) int { // // hEle: 元素句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XTextLink_SetUnderlineColorStay(hEle int, color int) int { r, _, _ := xTextLink_SetUnderlineColorStay.Call(uintptr(hEle), uintptr(color)) return int(r) diff --git a/xc/toolbar.go b/xc/toolbar.go index 085b167..97dd320 100644 --- a/xc/toolbar.go +++ b/xc/toolbar.go @@ -36,7 +36,7 @@ func XToolBar_InsertEle(hEle int, hNewEle int, index int) int { // // index: 插入位置索引, (-1)插入末尾. // -// color: ABGR 颜色. +// color: ARGB 颜色. func XToolBar_InsertSeparator(hEle int, index int, color int) int { r, _, _ := xToolBar_InsertSeparator.Call(uintptr(hEle), uintptr(index), uintptr(color)) return int(r) diff --git a/xc/tree.go b/xc/tree.go index de4e312..f3ac994 100644 --- a/xc/tree.go +++ b/xc/tree.go @@ -84,7 +84,7 @@ func XTree_EnableTemplateReuse(hEle int, bEnable bool) { // // hEle: 元素句柄. // -// color: ABGR 颜色. +// color: ARGB 颜色. func XTree_SetConnectLineColor(hEle int, color int) { xTree_SetConnectLineColor.Call(uintptr(hEle), uintptr(color)) } @@ -113,7 +113,7 @@ func XTree_SetConnectLineLength(hEle int, nLength int32) { // // hEle: 元素句柄. // -// color: ABGR 颜色. +// color: ARGB 颜色. func XTree_SetDragInsertPositionColor(hEle int, color int) { xTree_SetDragInsertPositionColor.Call(uintptr(hEle), uintptr(color)) } @@ -707,7 +707,7 @@ func XTree_DeleteColumnAll(hEle int) { // // hEle: 元素句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XTree_SetSplitLineColor(hEle int, color int) { xTree_SetSplitLineColor.Call(uintptr(hEle), uintptr(color)) } diff --git a/xc/ui.go b/xc/ui.go index cfb703d..b70d9b6 100644 --- a/xc/ui.go +++ b/xc/ui.go @@ -24,14 +24,20 @@ func XUI_GetStyle(hXCGUI int) xcc.XC_OBJECT_STYLE { return xcc.XC_OBJECT_STYLE(r) } -// XUI_EnableCSS 可视对象_启用CSS, 启用或禁用样式. +// XUI_EnableCSS 可视对象_启用CSS. 启用或禁用样式, 并且覆盖内嵌子元素属性, 例如: 滚动视图上的滚动条, 滚动条上的按钮. // // @param hXCGUI 对象句柄. // @param bEnable 是否启用. -// @return int -func XUI_EnableCSS(hXCGUI int, bEnable bool) int { - r, _, _ := xUI_EnableCSS.Call(uintptr(hXCGUI), common.BoolPtr(bEnable)) - return int(r) +func XUI_EnableCSS(hXCGUI int, bEnable bool) { + xUI_EnableCSS.Call(uintptr(hXCGUI), common.BoolPtr(bEnable)) +} + +// XUI_EnableCssEx 可视对象_启用CSS, 启用或禁用样式, 仅设置自身属性, 不包含内嵌子元素属性, 例如:滚动视图上的滚动条, 滚动条上的按钮 +// +// @param hXCGUI 对象句柄. +// @param bEnable 是否启用. +func XUI_EnableCssEx(hXCGUI int, bEnable bool) { + xUI_EnableCssEx.Call(uintptr(hXCGUI), common.BoolPtr(bEnable)) } // XUI_SetCssName 可视对象_置CSS名称, 设置CSS[套用样式]名称. diff --git a/xc/window.go b/xc/window.go index 3df0273..58594b1 100644 --- a/xc/window.go +++ b/xc/window.go @@ -201,9 +201,8 @@ func XWnd_RedrawRect(hWindow int, pRect *RECT, bImmediate bool) int { // hWindow: 窗口句柄. // // pRect: 坐标. -func XWnd_SetRect(hWindow int, pRect *RECT) bool { - r, _, _ := xWnd_SetRect.Call(uintptr(hWindow), uintptr(unsafe.Pointer(pRect))) - return r != 0 +func XWnd_SetRect(hWindow int, pRect *RECT) { + xWnd_SetRect.Call(uintptr(hWindow), uintptr(unsafe.Pointer(pRect))) } // 窗口_置焦点. @@ -448,7 +447,7 @@ func XWnd_SetFont(hWindow, hFontx int) int { // // hWindow: 窗口句柄. // -// color: ABGR 颜色值. +// color: ARGB 颜色值. func XWnd_SetTextColor(hWindow, color int) int { r, _, _ := xWnd_SetTextColor.Call(uintptr(hWindow), uintptr(color)) return int(r) @@ -525,6 +524,8 @@ func XWnd_SetBorderSize(hWindow, left, top, right, bottom int) int { // 窗口_取边大小. // // hWindow: 窗口句柄. +// +// pBorder: 返回边大小. func XWnd_GetBorderSize(hWindow int, pBorder *RECT) int { r, _, _ := xWnd_GetBorderSize.Call(uintptr(hWindow), uintptr(unsafe.Pointer(pBorder))) return int(r) @@ -546,6 +547,15 @@ func XWnd_SetPadding(hWindow, left, top, right, bottom int) int { return int(r) } +// 窗口_取布局内填充大小. +// +// hWindow: 窗口句柄. +// +// pPadding: 返回布局内填充大小. +func XWnd_GetPadding(hWindow int, pPadding *RECT) { + xWnd_GetPadding.Call(uintptr(hWindow), uintptr(unsafe.Pointer(pPadding))) +} + // 窗口_置拖动边框大小. // // hWindow: 窗口句柄. @@ -584,7 +594,7 @@ func XWnd_SetMinimumSize(hWindow, width, height int) int { return int(r) } -// 窗口_测试点击子元素. +// 窗口_测试点击子元素. 成功则返回元素句柄. // // hWindow: 窗口句柄. // @@ -1005,7 +1015,7 @@ func XWnd_SetTitle(hWindow int, pTitle string) int { // // hWindow: 窗口句柄. // -// color: ABGR 颜色. +// color: ARGB 颜色. func XWnd_SetTitleColor(hWindow, color int) int { r, _, _ := xWnd_SetTitleColor.Call(uintptr(hWindow), uintptr(color)) return int(r) @@ -1037,7 +1047,7 @@ func XWnd_GetTitle(hWindow int) string { return common.UintPtrToString(r) } -// 窗口_取标题颜色, 返回ABGR 颜色. +// 窗口_取标题颜色, 返回ARGB 颜色. // // hWindow: 窗口句柄. func XWnd_GetTitleColor(hWindow int) int { @@ -1051,7 +1061,7 @@ func XWnd_GetTitleColor(hWindow int) int { // // nState: 组合状态. // -// color: ABGR 颜色. +// color: ARGB 颜色. // // width: 线宽. func XWnd_AddBkBorder(hWindow int, nState xcc.Window_State_Flag_, color int, width int) int { @@ -1065,7 +1075,7 @@ func XWnd_AddBkBorder(hWindow int, nState xcc.Window_State_Flag_, color int, wid // // nState: 组合状态. // -// color: ABGR 颜色. +// color: ARGB 颜色. func XWnd_AddBkFill(hWindow int, nState xcc.Window_State_Flag_, color int) int { r, _, _ := xWnd_AddBkFill.Call(uintptr(hWindow), uintptr(nState), uintptr(color)) return int(r) @@ -1232,7 +1242,6 @@ func XWnd_ScreenToClient(hWindow int, pPt *POINT) bool { // hWindow: 窗口句柄. // // nDPI: DPI值. -func XWnd_SetDPI(hWindow int, nDPI int) int { - r, _, _ := xWnd_SetDPI.Call(uintptr(hWindow), uintptr(nDPI)) - return int(r) +func XWnd_SetDPI(hWindow int, nDPI int) { + xWnd_SetDPI.Call(uintptr(hWindow), uintptr(nDPI)) } diff --git a/xc/xcgui.go b/xc/xcgui.go index a556823..9782eec 100644 --- a/xc/xcgui.go +++ b/xc/xcgui.go @@ -10,7 +10,7 @@ import ( // GetVer 获取当前库版本所需的 xcgui.dll 的版本号. func GetVer() string { - return "3.3.8.1" + return "3.3.9.0" } // xcguiPath 是xcgui.dll的完整路径(目录+文件名), 也可以是相对路径, 默认值为'xcgui.dll'. @@ -174,6 +174,8 @@ var ( xMsg_Create *syscall.LazyProc xMsg_CreateEx *syscall.LazyProc xC_ShowSvgFrame *syscall.LazyProc + xC_EnableAutoRedrawUI *syscall.LazyProc + xC_GetHandleCount *syscall.LazyProc // UI Designer. xC_LoadLayout *syscall.LazyProc @@ -251,6 +253,7 @@ var ( xWnd_SetBorderSize *syscall.LazyProc xWnd_GetBorderSize *syscall.LazyProc xWnd_SetPadding *syscall.LazyProc + xWnd_GetPadding *syscall.LazyProc xWnd_SetDragBorderSize *syscall.LazyProc xWnd_GetDragBorderSize *syscall.LazyProc xWnd_SetMinimumSize *syscall.LazyProc @@ -345,37 +348,41 @@ var ( xWidget_GetUID *syscall.LazyProc xWidget_SetName *syscall.LazyProc xWidget_GetName *syscall.LazyProc + // xUI. - xUI_SetStyle *syscall.LazyProc - xUI_GetStyle *syscall.LazyProc - xUI_EnableCSS *syscall.LazyProc - xUI_SetCssName *syscall.LazyProc - xUI_GetCssName *syscall.LazyProc + xUI_SetStyle *syscall.LazyProc + xUI_GetStyle *syscall.LazyProc + xUI_EnableCSS *syscall.LazyProc + xUI_EnableCssEx *syscall.LazyProc + xUI_SetCssName *syscall.LazyProc + xUI_GetCssName *syscall.LazyProc + // Button. - xBtn_Create *syscall.LazyProc - xBtn_IsCheck *syscall.LazyProc - xBtn_SetCheck *syscall.LazyProc - xBtn_SetState *syscall.LazyProc - xBtn_GetState *syscall.LazyProc - xBtn_GetStateEx *syscall.LazyProc - xBtn_SetTypeEx *syscall.LazyProc - xBtn_SetGroupID *syscall.LazyProc - xBtn_GetGroupID *syscall.LazyProc - xBtn_SetBindEle *syscall.LazyProc - xBtn_GetBindEle *syscall.LazyProc - xBtn_SetTextAlign *syscall.LazyProc - xBtn_GetTextAlign *syscall.LazyProc - xBtn_SetIconAlign *syscall.LazyProc - xBtn_SetOffset *syscall.LazyProc - xBtn_SetOffsetIcon *syscall.LazyProc - xBtn_SetIconSpace *syscall.LazyProc - xBtn_SetText *syscall.LazyProc - xBtn_GetText *syscall.LazyProc - xBtn_SetIcon *syscall.LazyProc - xBtn_SetIconDisable *syscall.LazyProc - xBtn_GetIcon *syscall.LazyProc - xBtn_AddAnimationFrame *syscall.LazyProc - xBtn_EnableAnimation *syscall.LazyProc + xBtn_Create *syscall.LazyProc + xBtn_IsCheck *syscall.LazyProc + xBtn_SetCheck *syscall.LazyProc + xBtn_SetState *syscall.LazyProc + xBtn_GetState *syscall.LazyProc + xBtn_GetStateEx *syscall.LazyProc + xBtn_SetTypeEx *syscall.LazyProc + xBtn_SetGroupID *syscall.LazyProc + xBtn_GetGroupID *syscall.LazyProc + xBtn_SetBindEle *syscall.LazyProc + xBtn_GetBindEle *syscall.LazyProc + xBtn_SetTextAlign *syscall.LazyProc + xBtn_GetTextAlign *syscall.LazyProc + xBtn_SetIconAlign *syscall.LazyProc + xBtn_SetOffset *syscall.LazyProc + xBtn_SetOffsetIcon *syscall.LazyProc + xBtn_SetIconSpace *syscall.LazyProc + xBtn_SetText *syscall.LazyProc + xBtn_GetText *syscall.LazyProc + xBtn_SetIcon *syscall.LazyProc + xBtn_SetIconDisable *syscall.LazyProc + xBtn_GetIcon *syscall.LazyProc + xBtn_AddAnimationFrame *syscall.LazyProc + xBtn_EnableAnimation *syscall.LazyProc + xBtn_EnableHotkeyPrefix *syscall.LazyProc // Element. xEle_Create *syscall.LazyProc @@ -508,6 +515,7 @@ var ( xFrameWnd_GetViewRect *syscall.LazyProc xFrameWnd_SetPaneSplitBarWidth *syscall.LazyProc xFrameWnd_GetPaneSplitBarWidth *syscall.LazyProc + xFrameWnd_SetLayoutMargin *syscall.LazyProc // Menu. xMenu_Create *syscall.LazyProc @@ -670,14 +678,14 @@ var ( xAdTable_GetItemDataTypeEx *syscall.LazyProc xAdTable_AddColumn *syscall.LazyProc xAdTable_SetColumn *syscall.LazyProc - xAdTable_AddItemText *syscall.LazyProc - xAdTable_AddItemTextEx *syscall.LazyProc - xAdTable_AddItemImage *syscall.LazyProc - xAdTable_AddItemImageEx *syscall.LazyProc - xAdTable_InsertItemText *syscall.LazyProc - xAdTable_InsertItemTextEx *syscall.LazyProc - xAdTable_InsertItemImage *syscall.LazyProc - xAdTable_InsertItemImageEx *syscall.LazyProc + xAdTable_AddRowText *syscall.LazyProc + xAdTable_AddRowTextEx *syscall.LazyProc + xAdTable_AddRowImage *syscall.LazyProc + xAdTable_AddRowImageEx *syscall.LazyProc + xAdTable_InsertRowText *syscall.LazyProc + xAdTable_InsertRowTextEx *syscall.LazyProc + xAdTable_InsertRowImage *syscall.LazyProc + xAdTable_InsertRowImageEx *syscall.LazyProc xAdTable_SetItemText *syscall.LazyProc xAdTable_SetItemTextEx *syscall.LazyProc xAdTable_SetItemInt *syscall.LazyProc @@ -686,11 +694,10 @@ var ( xAdTable_SetItemFloatEx *syscall.LazyProc xAdTable_SetItemImage *syscall.LazyProc xAdTable_SetItemImageEx *syscall.LazyProc - xAdTable_DeleteItem *syscall.LazyProc - xAdTable_DeleteItemEx *syscall.LazyProc - xAdTable_DeleteItemAll *syscall.LazyProc + xAdTable_DeleteRow *syscall.LazyProc + xAdTable_DeleteRowEx *syscall.LazyProc + xAdTable_DeleteRowAll *syscall.LazyProc xAdTable_DeleteColumnAll *syscall.LazyProc - xAdTable_GetCount *syscall.LazyProc xAdTable_GetCountColumn *syscall.LazyProc xAdTable_GetItemText *syscall.LazyProc xAdTable_GetItemTextEx *syscall.LazyProc @@ -700,6 +707,7 @@ var ( xAdTable_GetItemIntEx *syscall.LazyProc xAdTable_GetItemFloat *syscall.LazyProc xAdTable_GetItemFloatEx *syscall.LazyProc + xAdTable_GetCountRow *syscall.LazyProc // AdapterMap. xAdMap_Create *syscall.LazyProc @@ -862,6 +870,8 @@ var ( xEdit_InsertTextEx *syscall.LazyProc xEdit_InsertObject *syscall.LazyProc xEdit_SetChatMaxWidth *syscall.LazyProc + xEdit_GetRowCountEx *syscall.LazyProc + xEdit_ClipboardCopyAll *syscall.LazyProc // LayoutEle. xLayout_Create *syscall.LazyProc @@ -997,7 +1007,6 @@ var ( // BkManager. xBkM_Create *syscall.LazyProc xBkM_Destroy *syscall.LazyProc - xBkM_SetBkInfo *syscall.LazyProc xBkM_AddInfo *syscall.LazyProc xBkM_AddBorder *syscall.LazyProc xBkM_AddFill *syscall.LazyProc @@ -1137,24 +1146,26 @@ var ( xEase_Ex *syscall.LazyProc // FontX. - xFont_Create *syscall.LazyProc - xFont_CreateEx *syscall.LazyProc - xFont_CreateFromHFONT *syscall.LazyProc - xFont_CreateFromFont *syscall.LazyProc - xFont_CreateFromFile *syscall.LazyProc - xFont_CreateLOGFONTW *syscall.LazyProc - xFont_EnableAutoDestroy *syscall.LazyProc - xFont_GetFont *syscall.LazyProc - xFont_GetFontInfo *syscall.LazyProc - xFont_GetLOGFONTW *syscall.LazyProc - xFont_Destroy *syscall.LazyProc - xFont_AddRef *syscall.LazyProc - xFont_GetRefCount *syscall.LazyProc - xFont_Release *syscall.LazyProc - xFont_CreateFromMem *syscall.LazyProc - xFont_CreateFromRes *syscall.LazyProc - xFont_CreateFromZip *syscall.LazyProc - xFont_CreateFromZipMem *syscall.LazyProc + xFont_Create *syscall.LazyProc + xFont_CreateEx *syscall.LazyProc + xFont_CreateFromHFONT *syscall.LazyProc + xFont_CreateFromFont *syscall.LazyProc + xFont_CreateFromFile *syscall.LazyProc + xFont_CreateFromLOGFONTW *syscall.LazyProc + xFont_EnableAutoDestroy *syscall.LazyProc + xFont_GetFont *syscall.LazyProc + xFont_GetFontInfo *syscall.LazyProc + xFont_GetLOGFONTW *syscall.LazyProc + xFont_Destroy *syscall.LazyProc + xFont_AddRef *syscall.LazyProc + xFont_GetRefCount *syscall.LazyProc + xFont_Release *syscall.LazyProc + xFont_CreateFromMem *syscall.LazyProc + xFont_CreateFromRes *syscall.LazyProc + xFont_CreateFromZip *syscall.LazyProc + xFont_CreateFromZipMem *syscall.LazyProc + xFont_SetUnderlineEdit *syscall.LazyProc + xFont_GetUnderlineEdit *syscall.LazyProc // Image. xImage_LoadSrc *syscall.LazyProc @@ -1355,110 +1366,115 @@ var ( xListBox_SetItemTemplateXMLFromZipRes *syscall.LazyProc xListBox_GetItemTemplate *syscall.LazyProc xListBox_CreateEx *syscall.LazyProc + xListBox_SetItemHeight *syscall.LazyProc + xListBox_GetItemHeight *syscall.LazyProc // List. - xList_Create *syscall.LazyProc - xList_AddColumn *syscall.LazyProc - xList_InsertColumn *syscall.LazyProc - xList_EnableMultiSel *syscall.LazyProc - xList_EnableDragChangeColumnWidth *syscall.LazyProc - xList_EnableVScrollBarTop *syscall.LazyProc - xList_EnableItemBkFullRow *syscall.LazyProc - xList_EnableFixedRowHeight *syscall.LazyProc - xList_EnableTemplateReuse *syscall.LazyProc - xList_EnableVirtualTable *syscall.LazyProc - xList_SetVirtualRowCount *syscall.LazyProc - xList_SetSort *syscall.LazyProc - xList_SetDrawItemBkFlags *syscall.LazyProc - xList_SetColumnWidth *syscall.LazyProc - xList_SetColumnMinWidth *syscall.LazyProc - xList_SetColumnWidthFixed *syscall.LazyProc - xList_GetColumnWidth *syscall.LazyProc - xList_GetColumnCount *syscall.LazyProc - xList_SetItemData *syscall.LazyProc - xList_GetItemData *syscall.LazyProc - xList_SetSelectItem *syscall.LazyProc - xList_GetSelectItem *syscall.LazyProc - xList_GetSelectItemCount *syscall.LazyProc - xList_AddSelectItem *syscall.LazyProc - xList_SetSelectAll *syscall.LazyProc - xList_GetSelectAll *syscall.LazyProc - xList_VisibleItem *syscall.LazyProc - xList_CancelSelectItem *syscall.LazyProc - xList_CancelSelectAll *syscall.LazyProc - xList_GetHeaderHELE *syscall.LazyProc - xList_DeleteColumn *syscall.LazyProc - xList_DeleteColumnAll *syscall.LazyProc - xList_BindAdapter *syscall.LazyProc - xList_BindAdapterHeader *syscall.LazyProc - xList_CreateAdapter *syscall.LazyProc - xList_CreateAdapterHeader *syscall.LazyProc - xList_GetAdapter *syscall.LazyProc - xList_GetAdapterHeader *syscall.LazyProc - xList_SetItemTemplateXML *syscall.LazyProc - xList_SetItemTemplateXMLFromString *syscall.LazyProc - xList_SetItemTemplate *syscall.LazyProc - xList_GetTemplateObject *syscall.LazyProc - xList_GetItemIndexFromHXCGUI *syscall.LazyProc - xList_GetHeaderTemplateObject *syscall.LazyProc - xList_GetHeaderItemIndexFromHXCGUI *syscall.LazyProc - xList_SetHeaderHeight *syscall.LazyProc - xList_GetHeaderHeight *syscall.LazyProc - xList_GetVisibleRowRange *syscall.LazyProc - xList_SetItemHeightDefault *syscall.LazyProc - xList_GetItemHeightDefault *syscall.LazyProc - xList_SetRowSpace *syscall.LazyProc - xList_GetRowSpace *syscall.LazyProc - xList_SetLockColumnLeft *syscall.LazyProc - xList_SetLockColumnRight *syscall.LazyProc - xList_SetLockRowBottom *syscall.LazyProc - xList_SetLockRowBottomOverlap *syscall.LazyProc - xList_HitTest *syscall.LazyProc - xList_HitTestOffset *syscall.LazyProc - xList_RefreshData *syscall.LazyProc - xList_RefreshItem *syscall.LazyProc - xList_AddColumnText *syscall.LazyProc - xList_AddColumnImage *syscall.LazyProc - xList_AddItemText *syscall.LazyProc - xList_AddItemTextEx *syscall.LazyProc - xList_AddItemImage *syscall.LazyProc - xList_AddItemImageEx *syscall.LazyProc - xList_InsertItemText *syscall.LazyProc - xList_InsertItemTextEx *syscall.LazyProc - xList_InsertItemImage *syscall.LazyProc - xList_InsertItemImageEx *syscall.LazyProc - xList_SetItemText *syscall.LazyProc - xList_SetItemTextEx *syscall.LazyProc - xList_SetItemImage *syscall.LazyProc - xList_SetItemImageEx *syscall.LazyProc - xList_SetItemInt *syscall.LazyProc - xList_SetItemIntEx *syscall.LazyProc - xList_SetItemFloat *syscall.LazyProc - xList_SetItemFloatEx *syscall.LazyProc - xList_GetItemText *syscall.LazyProc - xList_GetItemTextEx *syscall.LazyProc - xList_GetItemImage *syscall.LazyProc - xList_GetItemImageEx *syscall.LazyProc - xList_GetItemInt *syscall.LazyProc - xList_GetItemIntEx *syscall.LazyProc - xList_GetItemFloat *syscall.LazyProc - xList_GetItemFloatEx *syscall.LazyProc - xList_DeleteItem *syscall.LazyProc - xList_DeleteItemEx *syscall.LazyProc - xList_DeleteItemAll *syscall.LazyProc - xList_DeleteColumnAll_AD *syscall.LazyProc - xList_GetCount_AD *syscall.LazyProc - xList_GetCountColumn_AD *syscall.LazyProc - xList_SetSplitLineColor *syscall.LazyProc - xList_SetItemHeight *syscall.LazyProc - xList_GetItemHeight *syscall.LazyProc - xList_SetDragRectColor *syscall.LazyProc - xList_GetItemTemplate *syscall.LazyProc - xList_GetItemTemplateHeader *syscall.LazyProc - xList_RefreshDataHeader *syscall.LazyProc - xList_SetItemTemplateXMLFromMem *syscall.LazyProc - xList_SetItemTemplateXMLFromZipRes *syscall.LazyProc - xList_CreateEx *syscall.LazyProc + xList_Create *syscall.LazyProc + xList_AddColumn *syscall.LazyProc + xList_InsertColumn *syscall.LazyProc + xList_EnableMultiSel *syscall.LazyProc + xList_EnableDragChangeColumnWidth *syscall.LazyProc + xList_EnableVScrollBarTop *syscall.LazyProc + xList_EnableRowBkFull *syscall.LazyProc + xList_EnableFixedRowHeight *syscall.LazyProc + xList_EnableTemplateReuse *syscall.LazyProc + xList_EnableVirtualTable *syscall.LazyProc + xList_SetVirtualRowCount *syscall.LazyProc + xList_SetSort *syscall.LazyProc + xList_SetDrawRowBkFlags *syscall.LazyProc + xList_SetColumnWidth *syscall.LazyProc + xList_SetColumnMinWidth *syscall.LazyProc + xList_SetColumnWidthFixed *syscall.LazyProc + xList_GetColumnWidth *syscall.LazyProc + xList_GetColumnCount *syscall.LazyProc + xList_SetItemData *syscall.LazyProc + xList_GetItemData *syscall.LazyProc + xList_SetSelectRow *syscall.LazyProc + xList_GetSelectRow *syscall.LazyProc + xList_GetSelectItemRow *syscall.LazyProc + xList_AddSelectRow *syscall.LazyProc + xList_SetSelectAll *syscall.LazyProc + xList_GetSelectAll *syscall.LazyProc + xList_VisibleRow *syscall.LazyProc + xList_CancelSelectRow *syscall.LazyProc + xList_CancelSelectAll *syscall.LazyProc + xList_GetHeaderHELE *syscall.LazyProc + xList_DeleteColumn *syscall.LazyProc + xList_DeleteColumnAll *syscall.LazyProc + xList_BindAdapter *syscall.LazyProc + xList_BindAdapterHeader *syscall.LazyProc + xList_CreateAdapter *syscall.LazyProc + xList_CreateAdapterHeader *syscall.LazyProc + xList_GetAdapter *syscall.LazyProc + xList_GetAdapterHeader *syscall.LazyProc + xList_SetItemTemplateXML *syscall.LazyProc + xList_SetItemTemplateXMLFromString *syscall.LazyProc + xList_SetItemTemplate *syscall.LazyProc + xList_GetTemplateObject *syscall.LazyProc + xList_GetRowIndexFromHXCGUI *syscall.LazyProc + xList_GetHeaderTemplateObject *syscall.LazyProc + xList_GetHeaderColumnIndexFromHXCGUI *syscall.LazyProc + xList_SetHeaderHeight *syscall.LazyProc + xList_GetHeaderHeight *syscall.LazyProc + xList_GetVisibleRowRange *syscall.LazyProc + xList_SetRowHeightDefault *syscall.LazyProc + xList_GetRowHeightDefault *syscall.LazyProc + xList_SetRowSpace *syscall.LazyProc + xList_GetRowSpace *syscall.LazyProc + xList_SetLockColumnLeft *syscall.LazyProc + xList_SetLockColumnRight *syscall.LazyProc + xList_SetLockRowBottom *syscall.LazyProc + xList_SetLockRowBottomOverlap *syscall.LazyProc + xList_HitTest *syscall.LazyProc + xList_HitTestOffset *syscall.LazyProc + xList_RefreshData *syscall.LazyProc + xList_RefreshRow *syscall.LazyProc + xList_AddColumnText *syscall.LazyProc + xList_AddColumnImage *syscall.LazyProc + xList_AddRowText *syscall.LazyProc + xList_AddRowTextEx *syscall.LazyProc + xList_AddRowImage *syscall.LazyProc + xList_AddRowImageEx *syscall.LazyProc + xList_InsertRowText *syscall.LazyProc + xList_InsertRowTextEx *syscall.LazyProc + xList_InsertRowImage *syscall.LazyProc + xList_InsertRowImageEx *syscall.LazyProc + xList_SetItemText *syscall.LazyProc + xList_SetItemTextEx *syscall.LazyProc + xList_SetItemImage *syscall.LazyProc + xList_SetItemImageEx *syscall.LazyProc + xList_SetItemInt *syscall.LazyProc + xList_SetItemIntEx *syscall.LazyProc + xList_SetItemFloat *syscall.LazyProc + xList_SetItemFloatEx *syscall.LazyProc + xList_GetItemText *syscall.LazyProc + xList_GetItemTextEx *syscall.LazyProc + xList_GetItemImage *syscall.LazyProc + xList_GetItemImageEx *syscall.LazyProc + xList_GetItemInt *syscall.LazyProc + xList_GetItemIntEx *syscall.LazyProc + xList_GetItemFloat *syscall.LazyProc + xList_GetItemFloatEx *syscall.LazyProc + xList_DeleteRow *syscall.LazyProc + xList_DeleteRowEx *syscall.LazyProc + xList_DeleteRowAll *syscall.LazyProc + xList_DeleteColumnAll_AD *syscall.LazyProc + xList_GetCount_AD *syscall.LazyProc + xList_GetCountColumn_AD *syscall.LazyProc + xList_SetSplitLineColor *syscall.LazyProc + xList_SetRowHeight *syscall.LazyProc + xList_GetRowHeight *syscall.LazyProc + xList_SetDragRectColor *syscall.LazyProc + xList_GetItemTemplate *syscall.LazyProc + xList_GetItemTemplateHeader *syscall.LazyProc + xList_RefreshDataHeader *syscall.LazyProc + xList_SetItemTemplateXMLFromMem *syscall.LazyProc + xList_SetItemTemplateXMLFromZipRes *syscall.LazyProc + xList_CreateEx *syscall.LazyProc + xList_AddColumnText2 *syscall.LazyProc + xList_AddColumnImage2 *syscall.LazyProc + xList_CreateAdapters *syscall.LazyProc // ListView. xListView_Create *syscall.LazyProc @@ -1866,6 +1882,8 @@ var ( xTrayIcon_SetTips *syscall.LazyProc xTrayIcon_SetPopupBalloon *syscall.LazyProc xTrayIcon_SetCallbackMessage *syscall.LazyProc + + xPGrid_EnableExpandCurGroupOnly *syscall.LazyProc ) // 保证 LoadXCGUI 只运行一次. @@ -1974,6 +1992,8 @@ func _loadXCGUI() { xC_EnableAutoDPI = xcgui.NewProc("XC_EnableAutoDPI") xC_SetWindowIcon = xcgui.NewProc("XC_SetWindowIcon") xC_EnableDPI = xcgui.NewProc("XC_EnableDPI") + xC_EnableAutoRedrawUI = xcgui.NewProc("XC_EnableAutoRedrawUI") + xC_GetHandleCount = xcgui.NewProc("XC_GetHandleCount") // UI Designer. xC_LoadLayout = xcgui.NewProc("XC_LoadLayout") @@ -2046,6 +2066,7 @@ func _loadXCGUI() { xWnd_SetBorderSize = xcgui.NewProc("XWnd_SetBorderSize") xWnd_GetBorderSize = xcgui.NewProc("XWnd_GetBorderSize") xWnd_SetPadding = xcgui.NewProc("XWnd_SetPadding") + xWnd_GetPadding = xcgui.NewProc("XWnd_GetPadding") xWnd_SetDragBorderSize = xcgui.NewProc("XWnd_SetDragBorderSize") xWnd_GetDragBorderSize = xcgui.NewProc("XWnd_GetDragBorderSize") xWnd_SetMinimumSize = xcgui.NewProc("XWnd_SetMinimumSize") @@ -2145,6 +2166,7 @@ func _loadXCGUI() { xUI_SetStyle = xcgui.NewProc("XUI_SetStyle") xUI_GetStyle = xcgui.NewProc("XUI_GetStyle") xUI_EnableCSS = xcgui.NewProc("XUI_EnableCSS") + xUI_EnableCssEx = xcgui.NewProc("XUI_EnableCssEx") xUI_SetCssName = xcgui.NewProc("XUI_SetCssName") xUI_GetCssName = xcgui.NewProc("XUI_GetCssName") @@ -2173,6 +2195,7 @@ func _loadXCGUI() { xBtn_GetIcon = xcgui.NewProc("XBtn_GetIcon") xBtn_AddAnimationFrame = xcgui.NewProc("XBtn_AddAnimationFrame") xBtn_EnableAnimation = xcgui.NewProc("XBtn_EnableAnimation") + xBtn_EnableHotkeyPrefix = xcgui.NewProc("XBtn_EnableHotkeyPrefix") // Element. xEle_Create = xcgui.NewProc("XEle_Create") @@ -2305,6 +2328,7 @@ func _loadXCGUI() { xFrameWnd_GetViewRect = xcgui.NewProc("XFrameWnd_GetViewRect") xFrameWnd_SetPaneSplitBarWidth = xcgui.NewProc("XFrameWnd_SetPaneSplitBarWidth") xFrameWnd_GetPaneSplitBarWidth = xcgui.NewProc("XFrameWnd_GetPaneSplitBarWidth") + xFrameWnd_SetLayoutMargin = xcgui.NewProc("XFrameWnd_SetLayoutMargin") // Menu. xMenu_Create = xcgui.NewProc("XMenu_Create") @@ -2467,14 +2491,14 @@ func _loadXCGUI() { xAdTable_GetItemDataTypeEx = xcgui.NewProc("XAdTable_GetItemDataTypeEx") xAdTable_AddColumn = xcgui.NewProc("XAdTable_AddColumn") xAdTable_SetColumn = xcgui.NewProc("XAdTable_SetColumn") - xAdTable_AddItemText = xcgui.NewProc("XAdTable_AddItemText") - xAdTable_AddItemTextEx = xcgui.NewProc("XAdTable_AddItemTextEx") - xAdTable_AddItemImage = xcgui.NewProc("XAdTable_AddItemImage") - xAdTable_AddItemImageEx = xcgui.NewProc("XAdTable_AddItemImageEx") - xAdTable_InsertItemText = xcgui.NewProc("XAdTable_InsertItemText") - xAdTable_InsertItemTextEx = xcgui.NewProc("XAdTable_InsertItemTextEx") - xAdTable_InsertItemImage = xcgui.NewProc("XAdTable_InsertItemImage") - xAdTable_InsertItemImageEx = xcgui.NewProc("XAdTable_InsertItemImageEx") + xAdTable_AddRowText = xcgui.NewProc("XAdTable_AddRowText") + xAdTable_AddRowTextEx = xcgui.NewProc("XAdTable_AddRowTextEx") + xAdTable_AddRowImage = xcgui.NewProc("XAdTable_AddRowImage") + xAdTable_AddRowImageEx = xcgui.NewProc("XAdTable_AddRowImageEx") + xAdTable_InsertRowText = xcgui.NewProc("XAdTable_InsertRowText") + xAdTable_InsertRowTextEx = xcgui.NewProc("XAdTable_InsertRowTextEx") + xAdTable_InsertRowImage = xcgui.NewProc("XAdTable_InsertRowImage") + xAdTable_InsertRowImageEx = xcgui.NewProc("XAdTable_InsertRowImageEx") xAdTable_SetItemText = xcgui.NewProc("XAdTable_SetItemText") xAdTable_SetItemTextEx = xcgui.NewProc("XAdTable_SetItemTextEx") xAdTable_SetItemInt = xcgui.NewProc("XAdTable_SetItemInt") @@ -2483,11 +2507,10 @@ func _loadXCGUI() { xAdTable_SetItemFloatEx = xcgui.NewProc("XAdTable_SetItemFloatEx") xAdTable_SetItemImage = xcgui.NewProc("XAdTable_SetItemImage") xAdTable_SetItemImageEx = xcgui.NewProc("XAdTable_SetItemImageEx") - xAdTable_DeleteItem = xcgui.NewProc("XAdTable_DeleteItem") - xAdTable_DeleteItemEx = xcgui.NewProc("XAdTable_DeleteItemEx") - xAdTable_DeleteItemAll = xcgui.NewProc("XAdTable_DeleteItemAll") + xAdTable_DeleteRow = xcgui.NewProc("XAdTable_DeleteRow") + xAdTable_DeleteRowEx = xcgui.NewProc("XAdTable_DeleteRowEx") + xAdTable_DeleteRowAll = xcgui.NewProc("XAdTable_DeleteRowAll") xAdTable_DeleteColumnAll = xcgui.NewProc("XAdTable_DeleteColumnAll") - xAdTable_GetCount = xcgui.NewProc("XAdTable_GetCount") xAdTable_GetCountColumn = xcgui.NewProc("XAdTable_GetCountColumn") xAdTable_GetItemText = xcgui.NewProc("XAdTable_GetItemText") xAdTable_GetItemTextEx = xcgui.NewProc("XAdTable_GetItemTextEx") @@ -2497,6 +2520,8 @@ func _loadXCGUI() { xAdTable_GetItemIntEx = xcgui.NewProc("XAdTable_GetItemIntEx") xAdTable_GetItemFloat = xcgui.NewProc("XAdTable_GetItemFloat") xAdTable_GetItemFloatEx = xcgui.NewProc("XAdTable_GetItemFloatEx") + xAdTable_GetCountRow = xcgui.NewProc("XAdTable_GetCountRow") + // AdapterMap. xAdMap_Create = xcgui.NewProc("XAdMap_Create") xAdMap_AddItemText = xcgui.NewProc("XAdMap_AddItemText") @@ -2657,6 +2682,8 @@ func _loadXCGUI() { xEdit_InsertTextEx = xcgui.NewProc("XEdit_InsertTextEx") xEdit_InsertObject = xcgui.NewProc("XEdit_InsertObject") xEdit_SetChatMaxWidth = xcgui.NewProc("XEdit_SetChatMaxWidth") + xEdit_GetRowCountEx = xcgui.NewProc("XEdit_GetRowCountEx") + xEdit_ClipboardCopyAll = xcgui.NewProc("XEdit_ClipboardCopyAll") // LayoutEle. xLayout_Create = xcgui.NewProc("XLayout_Create") @@ -2792,7 +2819,6 @@ func _loadXCGUI() { // BkManager. xBkM_Create = xcgui.NewProc("XBkM_Create") xBkM_Destroy = xcgui.NewProc("XBkM_Destroy") - xBkM_SetBkInfo = xcgui.NewProc("XBkM_SetBkInfo") xBkM_AddInfo = xcgui.NewProc("XBkM_AddInfo") xBkM_AddBorder = xcgui.NewProc("XBkM_AddBorder") xBkM_AddFill = xcgui.NewProc("XBkM_AddFill") @@ -2937,7 +2963,7 @@ func _loadXCGUI() { xFont_CreateFromHFONT = xcgui.NewProc("XFont_CreateFromHFONT") xFont_CreateFromFont = xcgui.NewProc("XFont_CreateFromFont") xFont_CreateFromFile = xcgui.NewProc("XFont_CreateFromFile") - xFont_CreateLOGFONTW = xcgui.NewProc("XFont_CreateLOGFONTW") + xFont_CreateFromLOGFONTW = xcgui.NewProc("XFont_CreateFromLOGFONTW") xFont_EnableAutoDestroy = xcgui.NewProc("XFont_EnableAutoDestroy") xFont_GetFont = xcgui.NewProc("XFont_GetFont") xFont_GetFontInfo = xcgui.NewProc("XFont_GetFontInfo") @@ -2950,6 +2976,8 @@ func _loadXCGUI() { xFont_CreateFromRes = xcgui.NewProc("XFont_CreateFromRes") xFont_CreateFromZip = xcgui.NewProc("XFont_CreateFromZip") xFont_CreateFromZipMem = xcgui.NewProc("XFont_CreateFromZipMem") + xFont_SetUnderlineEdit = xcgui.NewProc("XFont_SetUnderlineEdit") + xFont_GetUnderlineEdit = xcgui.NewProc("XFont_GetUnderlineEdit") // Image. xImage_LoadSrc = xcgui.NewProc("XImage_LoadSrc") @@ -3150,6 +3178,8 @@ func _loadXCGUI() { xListBox_SetItemTemplateXMLFromZipRes = xcgui.NewProc("XListBox_SetItemTemplateXMLFromZipRes") xListBox_GetItemTemplate = xcgui.NewProc("XListBox_GetItemTemplate") xListBox_CreateEx = xcgui.NewProc("XListBox_CreateEx") + xListBox_SetItemHeight = xcgui.NewProc("XListBox_SetItemHeight") + xListBox_GetItemHeight = xcgui.NewProc("XListBox_GetItemHeight") // List. xList_Create = xcgui.NewProc("XList_Create") @@ -3159,13 +3189,13 @@ func _loadXCGUI() { xList_EnableMultiSel = xcgui.NewProc("XList_EnableMultiSel") xList_EnableDragChangeColumnWidth = xcgui.NewProc("XList_EnableDragChangeColumnWidth") xList_EnableVScrollBarTop = xcgui.NewProc("XList_EnableVScrollBarTop") - xList_EnableItemBkFullRow = xcgui.NewProc("XList_EnableItemBkFullRow") + xList_EnableRowBkFull = xcgui.NewProc("XList_EnableRowBkFull") xList_EnableFixedRowHeight = xcgui.NewProc("XList_EnableFixedRowHeight") xList_EnableTemplateReuse = xcgui.NewProc("XList_EnableTemplateReuse") xList_EnableVirtualTable = xcgui.NewProc("XList_EnableVirtualTable") xList_SetVirtualRowCount = xcgui.NewProc("XList_SetVirtualRowCount") xList_SetSort = xcgui.NewProc("XList_SetSort") - xList_SetDrawItemBkFlags = xcgui.NewProc("XList_SetDrawItemBkFlags") + xList_SetDrawRowBkFlags = xcgui.NewProc("XList_SetDrawRowBkFlags") xList_SetColumnWidth = xcgui.NewProc("XList_SetColumnWidth") xList_SetColumnMinWidth = xcgui.NewProc("XList_SetColumnMinWidth") xList_SetColumnWidthFixed = xcgui.NewProc("XList_SetColumnWidthFixed") @@ -3173,14 +3203,14 @@ func _loadXCGUI() { xList_GetColumnCount = xcgui.NewProc("XList_GetColumnCount") xList_SetItemData = xcgui.NewProc("XList_SetItemData") xList_GetItemData = xcgui.NewProc("XList_GetItemData") - xList_SetSelectItem = xcgui.NewProc("XList_SetSelectItem") - xList_GetSelectItem = xcgui.NewProc("XList_GetSelectItem") - xList_GetSelectItemCount = xcgui.NewProc("XList_GetSelectItemCount") - xList_AddSelectItem = xcgui.NewProc("XList_AddSelectItem") + xList_SetSelectRow = xcgui.NewProc("XList_SetSelectRow") + xList_GetSelectRow = xcgui.NewProc("XList_GetSelectRow") + xList_GetSelectItemRow = xcgui.NewProc("XList_GetSelectRowCount") + xList_AddSelectRow = xcgui.NewProc("XList_AddSelectRow") xList_SetSelectAll = xcgui.NewProc("XList_SetSelectAll") xList_GetSelectAll = xcgui.NewProc("XList_GetSelectAll") - xList_VisibleItem = xcgui.NewProc("XList_VisibleItem") - xList_CancelSelectItem = xcgui.NewProc("XList_CancelSelectItem") + xList_VisibleRow = xcgui.NewProc("XList_VisibleRow") + xList_CancelSelectRow = xcgui.NewProc("XList_CancelSelectRow") xList_CancelSelectAll = xcgui.NewProc("XList_CancelSelectAll") xList_GetHeaderHELE = xcgui.NewProc("XList_GetHeaderHELE") xList_DeleteColumn = xcgui.NewProc("XList_DeleteColumn") @@ -3195,14 +3225,14 @@ func _loadXCGUI() { xList_SetItemTemplateXMLFromString = xcgui.NewProc("XList_SetItemTemplateXMLFromString") xList_SetItemTemplate = xcgui.NewProc("XList_SetItemTemplate") xList_GetTemplateObject = xcgui.NewProc("XList_GetTemplateObject") - xList_GetItemIndexFromHXCGUI = xcgui.NewProc("XList_GetItemIndexFromHXCGUI") + xList_GetRowIndexFromHXCGUI = xcgui.NewProc("XList_GetRowIndexFromHXCGUI") xList_GetHeaderTemplateObject = xcgui.NewProc("XList_GetHeaderTemplateObject") - xList_GetHeaderItemIndexFromHXCGUI = xcgui.NewProc("XList_GetHeaderItemIndexFromHXCGUI") + xList_GetHeaderColumnIndexFromHXCGUI = xcgui.NewProc("XList_GetHeaderColumnIndexFromHXCGUI") xList_SetHeaderHeight = xcgui.NewProc("XList_SetHeaderHeight") xList_GetHeaderHeight = xcgui.NewProc("XList_GetHeaderHeight") xList_GetVisibleRowRange = xcgui.NewProc("XList_GetVisibleRowRange") - xList_SetItemHeightDefault = xcgui.NewProc("XList_SetItemHeightDefault") - xList_GetItemHeightDefault = xcgui.NewProc("XList_GetItemHeightDefault") + xList_SetRowHeightDefault = xcgui.NewProc("XList_SetRowHeightDefault") + xList_GetRowHeightDefault = xcgui.NewProc("XList_GetRowHeightDefault") xList_SetRowSpace = xcgui.NewProc("XList_SetRowSpace") xList_GetRowSpace = xcgui.NewProc("XList_GetRowSpace") xList_SetLockColumnLeft = xcgui.NewProc("XList_SetLockColumnLeft") @@ -3212,17 +3242,17 @@ func _loadXCGUI() { xList_HitTest = xcgui.NewProc("XList_HitTest") xList_HitTestOffset = xcgui.NewProc("XList_HitTestOffset") xList_RefreshData = xcgui.NewProc("XList_RefreshData") - xList_RefreshItem = xcgui.NewProc("XList_RefreshItem") + xList_RefreshRow = xcgui.NewProc("XList_RefreshRow") xList_AddColumnText = xcgui.NewProc("XList_AddColumnText") xList_AddColumnImage = xcgui.NewProc("XList_AddColumnImage") - xList_AddItemText = xcgui.NewProc("XList_AddItemText") - xList_AddItemTextEx = xcgui.NewProc("XList_AddItemTextEx") - xList_AddItemImage = xcgui.NewProc("XList_AddItemImage") - xList_AddItemImageEx = xcgui.NewProc("XList_AddItemImageEx") - xList_InsertItemText = xcgui.NewProc("XList_InsertItemText") - xList_InsertItemTextEx = xcgui.NewProc("XList_InsertItemTextEx") - xList_InsertItemImage = xcgui.NewProc("XList_InsertItemImage") - xList_InsertItemImageEx = xcgui.NewProc("XList_InsertItemImageEx") + xList_AddRowText = xcgui.NewProc("XList_AddRowText") + xList_AddRowTextEx = xcgui.NewProc("XList_AddRowTextEx") + xList_AddRowImage = xcgui.NewProc("XList_AddRowImage") + xList_AddRowImageEx = xcgui.NewProc("XList_AddRowImageEx") + xList_InsertRowText = xcgui.NewProc("XList_InsertRowText") + xList_InsertRowTextEx = xcgui.NewProc("XList_InsertRowTextEx") + xList_InsertRowImage = xcgui.NewProc("XList_InsertRowImage") + xList_InsertRowImageEx = xcgui.NewProc("XList_InsertRowImageEx") xList_SetItemText = xcgui.NewProc("XList_SetItemText") xList_SetItemTextEx = xcgui.NewProc("XList_SetItemTextEx") xList_SetItemImage = xcgui.NewProc("XList_SetItemImage") @@ -3239,21 +3269,24 @@ func _loadXCGUI() { xList_GetItemIntEx = xcgui.NewProc("XList_GetItemIntEx") xList_GetItemFloat = xcgui.NewProc("XList_GetItemFloat") xList_GetItemFloatEx = xcgui.NewProc("XList_GetItemFloatEx") - xList_DeleteItem = xcgui.NewProc("XList_DeleteItem") - xList_DeleteItemEx = xcgui.NewProc("XList_DeleteItemEx") - xList_DeleteItemAll = xcgui.NewProc("XList_DeleteItemAll") + xList_DeleteRow = xcgui.NewProc("XList_DeleteRow") + xList_DeleteRowEx = xcgui.NewProc("XList_DeleteRowEx") + xList_DeleteRowAll = xcgui.NewProc("XList_DeleteRowAll") xList_DeleteColumnAll_AD = xcgui.NewProc("XList_DeleteColumnAll_AD") xList_GetCount_AD = xcgui.NewProc("XList_GetCount_AD") xList_GetCountColumn_AD = xcgui.NewProc("XList_GetCountColumn_AD") xList_SetSplitLineColor = xcgui.NewProc("XList_SetSplitLineColor") - xList_SetItemHeight = xcgui.NewProc("XList_SetItemHeight") - xList_GetItemHeight = xcgui.NewProc("XList_GetItemHeight") + xList_SetRowHeight = xcgui.NewProc("XList_SetRowHeight") + xList_GetRowHeight = xcgui.NewProc("XList_GetRowHeight") xList_SetDragRectColor = xcgui.NewProc("XList_SetDragRectColor") xList_GetItemTemplate = xcgui.NewProc("XList_GetItemTemplate") xList_GetItemTemplateHeader = xcgui.NewProc("XList_GetItemTemplateHeader") xList_RefreshDataHeader = xcgui.NewProc("XList_RefreshDataHeader") xList_SetItemTemplateXMLFromMem = xcgui.NewProc("XList_SetItemTemplateXMLFromMem") xList_SetItemTemplateXMLFromZipRes = xcgui.NewProc("XList_SetItemTemplateXMLFromZipRes") + xList_AddColumnText2 = xcgui.NewProc("XList_AddColumnText2") + xList_AddColumnImage2 = xcgui.NewProc("XList_AddColumnImage2") + xList_CreateAdapters = xcgui.NewProc("XList_CreateAdapters") // ListView. xListView_Create = xcgui.NewProc("XListView_Create") @@ -3661,4 +3694,7 @@ func _loadXCGUI() { xTrayIcon_SetTips = xcgui.NewProc("XTrayIcon_SetTips") xTrayIcon_SetPopupBalloon = xcgui.NewProc("XTrayIcon_SetPopupBalloon") xTrayIcon_SetCallbackMessage = xcgui.NewProc("XTrayIcon_SetCallbackMessage") + + // 其他. + xPGrid_EnableExpandCurGroupOnly = xcgui.NewProc("XPGrid_EnableExpandCurGroupOnly") } diff --git a/xc/xcgui_test.go b/xc/xcgui_test.go index 7464873..1ee3136 100644 --- a/xc/xcgui_test.go +++ b/xc/xcgui_test.go @@ -29,22 +29,6 @@ func TestWriteDll(t *testing.T) { t.Log(xc.GetXcguiPath()) } -func TestABGR(t *testing.T) { - t.Log(xc.ABGR(255, 201, 100, 255)) -} - -func TestRGBA(t *testing.T) { - t.Log(xc.RGBA(255, 201, 100, 255)) -} - -func TestABGR2(t *testing.T) { - t.Log(xc.ABGR2(xc.BGR(255, 201, 100), 255)) -} - -func TestRGB(t *testing.T) { - t.Log(xc.RGB(255, 201, 100)) -} - func TestGetXcgui(t *testing.T) { xc.LoadXCGUI() dll := xc.GetXcgui() @@ -63,30 +47,3 @@ func TestSetXcguiPath(t *testing.T) { } t.Log(xc.GetXcguiPath()) } - -func TestHexRGB2RGB(t *testing.T) { - t.Log(xc.HexRGB2RGB("#ffc964")) - t.Log(xc.HexRGB2RGB("ffc964")) -} - -func TestHexRGB2ABGR(t *testing.T) { - t.Log(xc.HexRGB2ABGR("#ffc964", 255)) - t.Log(xc.HexRGB2ABGR("ffc964", 255)) -} - -func TestHexRGB2BGR(t *testing.T) { - t.Log(xc.HexRGB2BGR("#ffc964")) - t.Log(xc.HexRGB2BGR("ffc964")) -} - -func TestRGB2ABGR(t *testing.T) { - t.Log(xc.RGB2ABGR(xc.HexRGB2RGB("ffc964"), 255)) -} - -func TestRGB2BGR(t *testing.T) { - t.Log(xc.RGB2BGR(xc.HexRGB2RGB("ffc964"))) -} - -func TestBGR(t *testing.T) { - t.Log(xc.BGR(255, 201, 100)) -} diff --git a/xc/xcstruct.go b/xc/xcstruct.go index 3058ab4..82807fc 100644 --- a/xc/xcstruct.go +++ b/xc/xcstruct.go @@ -144,14 +144,14 @@ type LOGFONTW struct { // Editor 颜色信息 type Editor_Color_ struct { - ClrMargin1 int32 // 背景色1, ABGR 颜色 - ClrMargin2 int32 // 背景色2, ABGR 颜色 - ClrMarginText int32 // 文本色, ABGR 颜色 - ClrBreakpoint int32 // 断点色, ABGR 颜色 - ClrBreakpointArrow int32 // 断点箭头色, ABGR 颜色 - ClrRun int32 // 当前执行位置指示色, ABGR 颜色 - ClrCurRow int32 // 突出显示当前行颜色, ABGR 颜色 - ClrMatch int32 // 设置匹配文本背景色, ABGR 颜色 + ClrMargin1 int32 // 背景色1, ARGB 颜色 + ClrMargin2 int32 // 背景色2, ARGB 颜色 + ClrMarginText int32 // 文本色, ARGB 颜色 + ClrBreakpoint int32 // 断点色, ARGB 颜色 + ClrBreakpointArrow int32 // 断点箭头色, ARGB 颜色 + ClrRun int32 // 当前执行位置指示色, ARGB 颜色 + ClrCurRow int32 // 突出显示当前行颜色, ARGB 颜色 + ClrMatch int32 // 设置匹配文本背景色, ARGB 颜色 } // Edit 数据复制 diff --git a/xcc/xcconst.go b/xcc/xcconst.go index 159f735..fac9b8e 100644 --- a/xcc/xcconst.go +++ b/xcc/xcconst.go @@ -175,7 +175,7 @@ const ( ) // TextFormatFlag_ 文本对齐. -type TextFormatFlag_ int +type TextFormatFlag_ int32 const ( TextAlignFlag_Left TextFormatFlag_ = 0 // 左对齐 @@ -496,7 +496,7 @@ const ( ) // GRADIENT_FILL_ 渐变填充模式. -type GRADIENT_FILL_ int +type GRADIENT_FILL_ int32 const ( GRADIENT_FILL_RECT_H GRADIENT_FILL_ = iota // 水平填充 @@ -514,7 +514,7 @@ const ( ) // Ease_Flag_ 缓动标识. -type Ease_Flag_ int +type Ease_Flag_ int32 const ( Ease_Flag_Linear Ease_Flag_ = iota // 线性, 直线 @@ -740,7 +740,7 @@ const ( ) // BkObject_Align_Flag_ 背景对象对齐方式. -type BkObject_Align_Flag_ int +type BkObject_Align_Flag_ int32 const ( BkObject_Align_Flag_Left BkObject_Align_Flag_ = 1 << iota // 左对齐, 当设置此标识时, 外间距(margin.left)代表左侧间距; 当right未设置时,那么外间距(margin.right)代表宽度; @@ -927,7 +927,7 @@ const ( TrayIcon_Flag_Nosound TrayIcon_Flag_ = 0x10 // 禁止播放气泡声音 NIIF_NOSOUND ) -// ABGR颜色 +// ARGB颜色 const ( COLOR_BLUE = 0xFFFF0000 // 蓝色