-
Notifications
You must be signed in to change notification settings - Fork 46
/
windowbase.go
1806 lines (1562 loc) · 55.3 KB
/
windowbase.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package window
import (
"github.com/twgh/xcgui/objectbase"
"github.com/twgh/xcgui/wapi/wnd"
"github.com/twgh/xcgui/xc"
"github.com/twgh/xcgui/xcc"
)
// windowBase 窗口基类.
type windowBase struct {
objectbase.UI
}
// MessageBox 炫彩_消息框.
//
// @param pTitle 标题.
// @param pText 内容文本.
// @param nFlags 标识: xcc.MessageBox_Flag_.
// @param XCStyle xcc.Window_Style_.
// @return xcc.MessageBox_Flag_. 返回: xcc.MessageBox_Flag_Ok: 点击确定按钮退出. xcc.MessageBox_Flag_Cancel: 点击取消按钮退出. xcc.MessageBox_Flag_Other: 其他方式退出.
func (w *windowBase) MessageBox(pTitle, pText string, nFlags xcc.MessageBox_Flag_, XCStyle xcc.Window_Style_) xcc.MessageBox_Flag_ {
return xc.XC_MessageBox(pTitle, pText, nFlags, w.GetHWND(), XCStyle)
}
// Msg_Create 消息框_创建, 然后请调用 DoModal() 方法显示模态窗口.
//
// @param pTitle 标题.
// @param pText 内容文本.
// @param nFlags 标识: xcc.MessageBox_Flag_.
// @param XCStyle xcc.Window_Style_.
// @return *ModalWindow 模态窗口对象.
func (w *windowBase) Msg_Create(pTitle, pText string, nFlags xcc.MessageBox_Flag_, XCStyle xcc.Window_Style_) *ModalWindow {
p := &ModalWindow{}
p.SetHandle(xc.XMsg_Create(pTitle, pText, nFlags, w.GetHWND(), XCStyle))
return p
}
// Msg_CreateEx 消息框_创建扩展, 然后请调用 DoModal() 方法显示模态窗口.
//
// @param dwExStyle 窗口扩展样式.
// @param dwStyle 窗口样式.
// @param lpClassName 窗口类名.
// @param pTitle 标题.
// @param pText 内容文本.
// @param nFlags 标识: xcc.MessageBox_Flag_.
// @param XCStyle xcc.Window_Style_.
// @return *ModalWindow 模态窗口对象.
func (w *windowBase) Msg_CreateEx(dwExStyle, dwStyle int, lpClassName, pTitle, pText string, nFlags xcc.MessageBox_Flag_, XCStyle xcc.Window_Style_) *ModalWindow {
p := &ModalWindow{}
p.SetHandle(xc.XMsg_CreateEx(dwExStyle, dwStyle, lpClassName, pTitle, pText, nFlags, w.GetHWND(), XCStyle))
return p
}
// 炫彩_发送窗口消息.
//
// msg:.
//
// wParam:.
//
// lParam:.
func (w *windowBase) SendMessage(msg uint32, wParam, lParam uint) uint {
return xc.XC_SendMessage(w.Handle, msg, wParam, lParam)
}
// 炫彩_投递窗口消息.
//
// msg:.
//
// wParam:.
//
// lParam:.
func (w *windowBase) PostMessage(msg uint32, wParam int32, lParam int32) bool {
return xc.XC_PostMessage(w.Handle, msg, wParam, lParam)
}
// 炫彩_判断窗口, 判断是否为窗口句柄.
func (w *windowBase) IsHWINDOW() bool {
return xc.XC_IsHWINDOW(w.Handle)
}
// 炫彩_取对象从ID, 通过ID获取对象句柄, 不包括窗口对象.
//
// nID: ID值.
func (w *windowBase) GetObjectByID(nID int) int {
return xc.XC_GetObjectByID(w.Handle, nID)
}
// 炫彩_取对象从ID名称, 通过ID名称获取对象句柄.
//
// pName: ID名称.
func (w *windowBase) GetObjectByIDName(pName string) int {
return xc.XC_GetObjectByIDName(w.Handle, pName)
}
// 窗口_显示.
//
// nCmdShow: 显示方式: xcc.SW_.
func (w *windowBase) ShowWindow(nCmdShow xcc.SW_) int {
return xc.XWnd_ShowWindow(w.Handle, nCmdShow)
}
// 窗口_置顶.
func (w *windowBase) SetTop() *windowBase {
xc.XWnd_SetTop(w.Handle)
return w
}
// 窗口_注册事件C.
//
// nEvent: 事件类型: xcc.WM_, xcc.XWM_.
//
// pFun: 事件函数.
func (w *windowBase) RegEventC(nEvent xcc.WM_, pFun interface{}) bool {
return xc.XWnd_RegEventC(w.Handle, nEvent, pFun)
}
// 窗口_注册事件C1.
//
// nEvent: 事件类型: xcc.WM_, xcc.XWM_.
//
// pFun: 事件函数.
func (w *windowBase) RegEventC1(nEvent xcc.WM_, pFun interface{}) bool {
return xc.XWnd_RegEventC1(w.Handle, nEvent, pFun)
}
// 窗口_移除事件C.
//
// nEvent: 事件类型: xcc.WM_, xcc.XWM_.
//
// pFun: 事件函数.
func (w *windowBase) RemoveEventC(nEvent xcc.WM_, pFun interface{}) bool {
return xc.XWnd_RemoveEventC(w.Handle, nEvent, pFun)
}
// 窗口_移除事件CEx, 和非Ex版相比只是最后一个参数不同.
//
// nEvent: 事件类型: xcc.WM_, xcc.XWM_.
//
// pFun: 事件函数指针, 使用 syscall.NewCallback() 生成..
func (w *windowBase) RemoveEventCEx(nEvent xcc.WM_, pFun uintptr) bool {
return xc.XWnd_RemoveEventCEx(w.Handle, nEvent, pFun)
}
// 窗口_添加子对象.
//
// hChild: 要添加的对象句柄.
func (w *windowBase) AddChild(hChild int) bool {
return xc.XWnd_AddChild(w.Handle, hChild)
}
// 窗口_插入子对象.
//
// hChild: 要插入的对象句柄.
//
// index: 插入位置索引.
func (w *windowBase) InsertChild(hChild int, index int) bool {
return xc.XWnd_InsertChild(w.Handle, hChild, index)
}
// 窗口_取HWND.
func (w *windowBase) GetHWND() uintptr {
return xc.XWnd_GetHWND(w.Handle)
}
// 窗口_重绘.
//
// bImmediate: 是否立即重绘, 默认为否.
func (w *windowBase) Redraw(bImmediate bool) *windowBase {
xc.XWnd_Redraw(w.Handle, bImmediate)
return w
}
// 窗口_重绘指定区域.
//
// pRect: 需要重绘的区域坐标.
//
// bImmediate: TRUE立即重绘, FALSE放入消息队列延迟重绘.
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) *windowBase {
xc.XWnd_SetRect(w.Handle, pRect)
return w
}
// 窗口_置焦点.
//
// hFocusEle: 将获得焦点的元素.
func (w *windowBase) SetFocusEle(hFocusEle int) *windowBase {
xc.XWnd_SetFocusEle(w.Handle, hFocusEle)
return w
}
// 窗口_取焦点.
func (w *windowBase) GetFocusEle() int {
return xc.XWnd_GetFocusEle(w.Handle)
}
// 窗口_取鼠标停留元素.
func (w *windowBase) GetStayEle() int {
return xc.XWnd_GetStayEle(w.Handle)
}
// 窗口_绘制, 在自绘事件函数中,用户手动调用绘制窗口, 以便控制绘制顺序.
//
// hDraw: 图形绘制句柄.
func (w *windowBase) DrawWindow(hDraw int) *windowBase {
xc.XWnd_DrawWindow(w.Handle, hDraw)
return w
}
// 窗口_居中.
func (w *windowBase) Center() *windowBase {
xc.XWnd_Center(w.Handle)
return w
}
// 窗口_居中扩展.
//
// 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) *windowBase {
xc.XWnd_SetCursor(w.Handle, hCursor)
return w
}
// 窗口_取光标.
func (w *windowBase) GetCursor() int {
return xc.XWnd_GetCursor(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) *windowBase {
xc.XWnd_EnableDragWindow(w.Handle, bEnable)
return w
}
// 窗口_启用拖动标题栏.
//
// bEnable: 是否启用.
func (w *windowBase) EnableDragCaption(bEnable bool) *windowBase {
xc.XWnd_EnableDragCaption(w.Handle, bEnable)
return w
}
// 窗口_启用绘制背景.
//
// bEnable: 是否启用.
func (w *windowBase) EnableDrawBk(bEnable bool) *windowBase {
xc.XWnd_EnableDrawBk(w.Handle, bEnable)
return w
}
// 窗口_启用自动焦点.
//
// bEnable: 是否启用.
func (w *windowBase) EnableAutoFocus(bEnable bool) *windowBase {
xc.XWnd_EnableAutoFocus(w.Handle, bEnable)
return w
}
// 窗口_启用允许最大化.
//
// bEnable: 是否启用.
func (w *windowBase) EnableMaxWindow(bEnable bool) *windowBase {
xc.XWnd_EnableMaxWindow(w.Handle, bEnable)
return w
}
// 窗口_启用限制窗口大小.
//
// bEnable: 是否启用.
func (w *windowBase) EnableLimitWindowSize(bEnable bool) *windowBase {
xc.XWnd_EnableLimitWindowSize(w.Handle, bEnable)
return w
}
// 窗口_启用布局.
//
// bEnable: 是否启用.
func (w *windowBase) EnableLayout(bEnable bool) *windowBase {
xc.XWnd_EnableLayout(w.Handle, bEnable)
return w
}
// 窗口_启用布局覆盖边框.
//
// bEnable: 是否启用.
func (w *windowBase) EnableLayoutOverlayBorder(bEnable bool) *windowBase {
xc.XWnd_EnableLayoutOverlayBorder(w.Handle, bEnable)
return w
}
// 窗口_显示布局边界.
//
// bEnable: 是否启用.
func (w *windowBase) ShowLayoutFrame(bEnable bool) *windowBase {
xc.XWnd_ShowLayoutFrame(w.Handle, bEnable)
return w
}
// 窗口_判断启用布局.
func (w *windowBase) IsEnableLayout() bool {
return xc.XWnd_IsEnableLayout(w.Handle)
}
// 窗口_是否最大化.
func (w *windowBase) IsMaxWindow() bool {
return xc.XWnd_IsMaxWindow(w.Handle)
}
// 窗口_置鼠标捕获元素.
//
// hEle: 元素句柄.
func (w *windowBase) SetCaptureEle(hEle int) *windowBase {
xc.XWnd_SetCaptureEle(w.Handle, hEle)
return w
}
// 窗口_取鼠标捕获元素.
func (w *windowBase) GetCaptureEle() int {
return xc.XWnd_GetCaptureEle(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
}
// 窗口_置系统光标.
//
// hCursor: 光标句柄.
func (w *windowBase) SetCursorSys(hCursor int) int {
return xc.XWnd_SetCursorSys(w.Handle, hCursor)
}
// 窗口_置字体.
//
// hFontx: 炫彩字体句柄.
func (w *windowBase) SetFont(hFontx int) *windowBase {
xc.XWnd_SetFont(w.Handle, hFontx)
return w
}
// 窗口_置文本颜色.
//
// color: ARGB 颜色值.
func (w *windowBase) SetTextColor(color int) *windowBase {
xc.XWnd_SetTextColor(w.Handle, color)
return w
}
// 窗口_取文本颜色, 返回ARGB 颜色.
func (w *windowBase) GetTextColor() int {
return xc.XWnd_GetTextColor(w.Handle)
}
// 窗口_取文本颜色扩展, 返回ARGB 颜色.
func (w *windowBase) GetTextColorEx() int {
return xc.XWnd_GetTextColorEx(w.Handle)
}
// 窗口_置ID.
//
// nID: ID值.
func (w *windowBase) SetID(nID int) *windowBase {
xc.XWnd_SetID(w.Handle, nID)
return w
}
// 窗口_取ID.
func (w *windowBase) GetID() int {
return xc.XWnd_GetID(w.Handle)
}
// 窗口_置名称.
//
// pName: name值, 字符串.
func (w *windowBase) SetName(pName string) *windowBase {
xc.XWnd_SetName(w.Handle, pName)
return w
}
// 窗口_取名称.
func (w *windowBase) GetName() string {
return xc.XWnd_GetName(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
}
// 窗口_取边大小.
//
// 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
}
// 窗口_置布局内填充大小.
//
// 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
}
// 窗口_置拖动边框大小.
//
// 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) *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
}
// 窗口_置最小大小.
//
// 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 {
return xc.XWnd_HitChildEle(w.Handle, pPt)
}
// 窗口_取子对象数量.
func (w *windowBase) GetChildCount() int {
return xc.XWnd_GetChildCount(w.Handle)
}
// 窗口_取子对象从索引.
//
// index: 元素索引.
func (w *windowBase) GetChildByIndex(index int) int {
return xc.XWnd_GetChildByIndex(w.Handle, index)
}
// 窗口_取子对象从ID.
//
// nID: 元素ID, ID必须大于0.
func (w *windowBase) GetChildByID(nID int) int {
return xc.XWnd_GetChildByID(w.Handle, nID)
}
// 窗口_取子对象.
//
// nID: 对象ID,ID必须大于0.
func (w *windowBase) GetChild(nID int) int {
return xc.XWnd_GetChild(w.Handle, nID)
}
// 窗口_关闭.
func (w *windowBase) CloseWindow() *windowBase {
xc.XWnd_CloseWindow(w.Handle)
return w
}
// 窗口_调整布局.
func (w *windowBase) AdjustLayout() *windowBase {
xc.XWnd_AdjustLayout(w.Handle)
return w
}
// 窗口_调整布局扩展.
//
// nFlags: 调整布局标识位: xcc.AdjustLayout_.
func (w *windowBase) AdjustLayoutEx(nFlags xcc.AdjustLayout_) *windowBase {
xc.XWnd_AdjustLayoutEx(w.Handle, nFlags)
return w
}
// 窗口_创建插入符.
//
// hEle: 元素句柄.
//
// x: x坐标.
//
// y: 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
}
// 窗口_置插入符位置, 设置插入符位置.
//
// x: x坐标.
//
// y: y坐标.
//
// width: 宽度.
//
// height: 高度.
//
// bUpdate: 是否立即更新UI.
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: 颜色值, ARGB 颜色.
func (w *windowBase) SetCaretColor(color int) *windowBase {
xc.XWnd_SetCaretColor(w.Handle, color)
return w
}
// 窗口_显示插入符.
//
// bShow: 是否显示.
func (w *windowBase) ShowCaret(bShow bool) *windowBase {
xc.XWnd_ShowCaret(w.Handle, bShow)
return w
}
// 窗口_销毁插入符.
func (w *windowBase) DestroyCaret() *windowBase {
xc.XWnd_DestroyCaret(w.Handle)
return w
}
// 窗口_取插入符元素.
func (w *windowBase) GetCaretHELE() int {
return xc.XWnd_GetCaretHELE(w.Handle)
}
// 窗口_取客户区坐标.
//
// pRect: 坐标.
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) *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) *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
}
// 窗口_移动窗口.
//
// x: X坐标.
//
// y: Y坐标.
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) *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) *windowBase {
xc.XWnd_MaxWindow(w.Handle, bMaximize)
return w
}
// 窗口_置定时器.
//
// nIDEvent: 定时器ID.
//
// uElapse: 间隔值, 单位毫秒.
func (w *windowBase) SetTimer(nIDEvent, uElapse int) int {
return xc.XWnd_SetTimer(w.Handle, nIDEvent, uElapse)
}
// 窗口_关闭定时器.
//
// nIDEvent: 定时器ID.
func (w *windowBase) KillTimer(nIDEvent int) int {
return xc.XWnd_KillTimer(w.Handle, nIDEvent)
}
// 窗口_置炫彩定时器.
//
// nIDEvent: 定时器ID.
//
// uElapse: 间隔值, 单位毫秒.
func (w *windowBase) SetXCTimer(nIDEvent, uElapse int) int {
return xc.XWnd_SetXCTimer(w.Handle, nIDEvent, uElapse)
}
// 窗口_关闭炫彩定时器.
//
// nIDEvent: 定时器ID.
func (w *windowBase) KillXCTimer(nIDEvent int) int {
return xc.XWnd_KillXCTimer(w.Handle, nIDEvent)
}
// 窗口_取背景管理器.
func (w *windowBase) GetBkManager() int {
return xc.XWnd_GetBkManager(w.Handle)
}
// 窗口_取背景管理器扩展.
func (w *windowBase) GetBkManagerEx() int {
return xc.XWnd_GetBkManagerEx(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_) *windowBase {
xc.XWnd_SetTransparentType(w.Handle, nType)
return w
}
// 窗口_置透明度.
//
// alpha: 窗口透明度, 范围0-255之间, 0透明, 255不透明.
func (w *windowBase) SetTransparentAlpha(alpha byte) *windowBase {
xc.XWnd_SetTransparentAlpha(w.Handle, alpha)
return w
}
// 窗口_置透明色.
//
// color: 窗口透明色, ARGB 颜色.
func (w *windowBase) SetTransparentColor(color int) *windowBase {
xc.XWnd_SetTransparentColor(w.Handle, color)
return w
}
// 窗口_置阴影信息.
//
// nSize: 阴影大小.
//
// nDepth: 阴影深度, 0-255.
//
// nAngeleSize: 圆角阴影内收大小.
//
// bRightAngle: 是否强制直角.
//
// 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
}
// 窗口_取阴影信息.
//
// pnSize: 阴影大小.
//
// pnDepth: 阴影深度.
//
// pnAngeleSize: 圆角阴影内收大小 .
//
// pbRightAngle: 是否强制直角.
//
// 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_.
func (w *windowBase) GetTransparentType() xcc.Window_Transparent_ {
return xc.XWnd_GetTransparentType(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) *windowBase {
xc.XWnd_Show(w.Handle, bShow)
return w
}
// 窗口_取插入符信息, 获取插入符信息, 返回: 插入符元素句柄.
//
// hWindow: 窗口句柄.
//
// pX: 接收返回x坐标.
//
// pY: 接收返回y坐标.
//
// pWidth: 接收返回宽度.
//
// pHeight: 接收返回高度.
func (w *windowBase) GetCaretInfo(pX, pY, pWidth, pHeight *int32) int {
return xc.XWnd_GetCaretInfo(w.Handle, pX, pY, pWidth, pHeight)
}
// 窗口_置图标.
//
// hImage: 图标句柄.
func (w *windowBase) SetIcon(hImage int) *windowBase {
xc.XWnd_SetIcon(w.Handle, hImage)
return w
}
// 窗口_置标题.
//
// pTitle: 标题文本.
func (w *windowBase) SetTitle(pTitle string) *windowBase {
xc.XWnd_SetTitle(w.Handle, pTitle)
return w
}
// 窗口_置标题颜色.
//
// color: ARGB 颜色.
func (w *windowBase) SetTitleColor(color int) *windowBase {
xc.XWnd_SetTitleColor(w.Handle, color)
return w
}
// 窗口_取控制按钮, 返回按钮句柄.
//
// nFlag: xcc.Window_Style_ . 可用值: xcc.Window_Style_Btn_Min , xcc.Window_Style_Btn_Max , xcc.Window_Style_Btn_Close .
func (w *windowBase) GetButton(nFlag xcc.Window_Style_) int {
return xc.XWnd_GetButton(w.Handle, nFlag)
}
// 窗口_取图标, 返回图标句柄.
func (w *windowBase) GetIcon() int {
return xc.XWnd_GetIcon(w.Handle)
}
// 窗口_取标题, 返回标题文本.
func (w *windowBase) GetTitle() string {
return xc.XWnd_GetTitle(w.Handle)
}
// 窗口_取标题颜色, 返回ARGB 颜色.
func (w *windowBase) GetTitleColor() int {
return xc.XWnd_GetTitleColor(w.Handle)
}
// 窗口_添加背景边框.
//
// nState: 组合状态.
//
// color: ARGB 颜色.
//
// 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: ARGB 颜色.
func (w *windowBase) AddBkFill(nState xcc.Window_State_Flag_, color int) *windowBase {
xc.XWnd_AddBkFill(w.Handle, nState, color)
return w
}
// 窗口_添加背景图片.
//
// nState: 组合状态.
//
// hImage: 图片句柄.
func (w *windowBase) AddBkImage(nState xcc.Window_State_Flag_, hImage int) *windowBase {
xc.XWnd_AddBkImage(w.Handle, nState, hImage)
return w
}
// 窗口_取背景对象数量.
func (w *windowBase) GetBkInfoCount() int {
return xc.XWnd_GetBkInfoCount(w.Handle)
}
// 窗口_清空背景对象.
func (w *windowBase) ClearBkInfo() *windowBase {
xc.XWnd_ClearBkInfo(w.Handle)
return w
}
// 通知消息_窗口中弹出, 使用基础元素作为面板, 弹出一个通知消息, 返回元素句柄, 通过此句柄可对其操作.
//
// position: 位置, Position_Flag_.
//
// pTitle: 标题.
//
// pText: 内容.
//
// hIcon: 图标.
//
// skin: 外观类型, NotifyMsg_Skin_.
func (w *windowBase) NotifyMsg_WindowPopup(position xcc.Position_Flag_, pTitle, pText string, hIcon int, skin xcc.NotifyMsg_Skin_) int {
return xc.XNotifyMsg_WindowPopup(w.Handle, position, pTitle, pText, hIcon, skin)
}
// 通知消息_窗口中弹出扩展, 使用基础元素作为面板, 弹出一个通知消息, 返回元素句柄, 通过此句柄可对其操作.
//
// position: 位置, Position_Flag_.
//
// pTitle: 标题.
//
// pText: 内容.
//
// hIcon: 图标.
//
// skin: 外观类型, NotifyMsg_Skin_.
//
// bBtnClose: 是否启用关闭按钮.
//
// bAutoClose: 是否自动关闭.
//
// nWidth: 自定义宽度, -1(使用默认值).
//
// nHeight: 自定义高度, -1(使用默认值).
func (w *windowBase) NotifyMsg_WindowPopupEx(position xcc.Position_Flag_, pTitle, pText string, hIcon int, skin xcc.NotifyMsg_Skin_, bBtnClose, bAutoClose bool, nWidth, nHeight int) int {
return xc.XNotifyMsg_WindowPopupEx(w.Handle, position, pTitle, pText, hIcon, skin, bBtnClose, bAutoClose, nWidth, nHeight)
}
// 通知消息_置持续时间.
//
// duration: 持续时间.
func (w *windowBase) NotifyMsg_SetDuration(duration int) int {
return xc.XNotifyMsg_SetDuration(w.Handle, duration)
}
// 通知消息_置父边距 设置通知消息与父对象的四边间隔.
//
// left: 左侧间隔, 未实现, 预留功能.
//
// top: 顶部间隔.
//
// right: 右侧间隔.
//
// bottom: 底部间隔, 未实现, 预留功能.
func (w *windowBase) NotifyMsg_SetParentMargin(left, top, right, bottom int) int {
return xc.XNotifyMsg_SetParentMargin(w.Handle, left, top, right, bottom)
}
// 通知消息_置标题高度.
//