forked from ying32/govcl
/
taskdialog.go
414 lines (340 loc) · 10.4 KB
/
taskdialog.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
//----------------------------------------
// The code is automatically generated by the GenlibLcl tool.
// Copyright © ying32. All Rights Reserved.
//
// Licensed under Apache License 2.0
//
//----------------------------------------
package vcl
import (
. "github.com/ying32/govcl/vcl/api"
. "github.com/ying32/govcl/vcl/types"
"unsafe"
)
type TTaskDialog struct {
IComponent
instance uintptr
// 特殊情况下使用,主要应对Go的GC问题,与LCL没有太多关系。
ptr unsafe.Pointer
}
// 创建一个新的对象。
//
// Create a new object.
func NewTaskDialog(owner IComponent) *TTaskDialog {
t := new(TTaskDialog)
t.instance = TaskDialog_Create(CheckPtr(owner))
t.ptr = unsafe.Pointer(t.instance)
return t
}
// 动态转换一个已存在的对象实例。
//
// Dynamically convert an existing object instance.
func AsTaskDialog(obj interface{}) *TTaskDialog {
instance, ptr := getInstance(obj)
if instance == 0 { return nil }
return &TTaskDialog{instance: instance, ptr: ptr}
}
// -------------------------- Deprecated begin --------------------------
// 新建一个对象来自已经存在的对象实例指针。
//
// Create a new object from an existing object instance pointer.
// Deprecated: use AsTaskDialog.
func TaskDialogFromInst(inst uintptr) *TTaskDialog {
return AsTaskDialog(inst)
}
// 新建一个对象来自已经存在的对象实例。
//
// Create a new object from an existing object instance.
// Deprecated: use AsTaskDialog.
func TaskDialogFromObj(obj IObject) *TTaskDialog {
return AsTaskDialog(obj)
}
// 新建一个对象来自不安全的地址。注意:使用此函数可能造成一些不明情况,慎用。
//
// Create a new object from an unsecured address. Note: Using this function may cause some unclear situations and be used with caution..
// Deprecated: use AsTaskDialog.
func TaskDialogFromUnsafePointer(ptr unsafe.Pointer) *TTaskDialog {
return AsTaskDialog(ptr)
}
// -------------------------- Deprecated end --------------------------
// 释放对象。
//
// Free object.
func (t *TTaskDialog) Free() {
if t.instance != 0 {
TaskDialog_Free(t.instance)
t.instance, t.ptr = 0, nullptr
}
}
// 返回对象实例指针。
//
// Return object instance pointer.
func (t *TTaskDialog) Instance() uintptr {
return t.instance
}
// 获取一个不安全的地址。
//
// Get an unsafe address.
func (t *TTaskDialog) UnsafeAddr() unsafe.Pointer {
return t.ptr
}
// 检测地址是否为空。
//
// Check if the address is empty.
func (t *TTaskDialog) IsValid() bool {
return t.instance != 0
}
// 检测当前对象是否继承自目标对象。
//
// Checks whether the current object is inherited from the target object.
func (t *TTaskDialog) Is() TIs {
return TIs(t.instance)
}
// 动态转换当前对象为目标对象。
//
// Dynamically convert the current object to the target object.
//func (t *TTaskDialog) As() TAs {
// return TAs(t.instance)
//}
// 获取类信息指针。
//
// Get class information pointer.
func TTaskDialogClass() TClass {
return TaskDialog_StaticClassType()
}
// 执行。
func (t *TTaskDialog) Execute() bool {
return TaskDialog_Execute(t.instance)
}
// 查找指定名称的组件。
//
// Find the component with the specified name.
func (t *TTaskDialog) FindComponent(AName string) *TComponent {
return AsComponent(TaskDialog_FindComponent(t.instance, AName))
}
// 获取类名路径。
//
// Get the class name path.
func (t *TTaskDialog) GetNamePath() string {
return TaskDialog_GetNamePath(t.instance)
}
// 是否有父容器。
//
// Is there a parent container.
func (t *TTaskDialog) HasParent() bool {
return TaskDialog_HasParent(t.instance)
}
// 复制一个对象,如果对象实现了此方法的话。
//
// Copy an object, if the object implements this method.
func (t *TTaskDialog) Assign(Source IObject) {
TaskDialog_Assign(t.instance, CheckPtr(Source))
}
// 获取类的类型信息。
//
// Get class type information.
func (t *TTaskDialog) ClassType() TClass {
return TaskDialog_ClassType(t.instance)
}
// 获取当前对象类名称。
//
// Get the current object class name.
func (t *TTaskDialog) ClassName() string {
return TaskDialog_ClassName(t.instance)
}
// 获取当前对象实例大小。
//
// Get the current object instance size.
func (t *TTaskDialog) InstanceSize() int32 {
return TaskDialog_InstanceSize(t.instance)
}
// 判断当前类是否继承自指定类。
//
// Determine whether the current class inherits from the specified class.
func (t *TTaskDialog) InheritsFrom(AClass TClass) bool {
return TaskDialog_InheritsFrom(t.instance, AClass)
}
// 与一个对象进行比较。
//
// Compare with an object.
func (t *TTaskDialog) Equals(Obj IObject) bool {
return TaskDialog_Equals(t.instance, CheckPtr(Obj))
}
// 获取类的哈希值。
//
// Get the hash value of the class.
func (t *TTaskDialog) GetHashCode() int32 {
return TaskDialog_GetHashCode(t.instance)
}
// 文本类信息。
//
// Text information.
func (t *TTaskDialog) ToString() string {
return TaskDialog_ToString(t.instance)
}
func (t *TTaskDialog) Buttons() *TTaskDialogButtons {
return AsTaskDialogButtons(TaskDialog_GetButtons(t.instance))
}
func (t *TTaskDialog) SetButtons(value *TTaskDialogButtons) {
TaskDialog_SetButtons(t.instance, CheckPtr(value))
}
// 获取控件标题。
//
// Get the control title.
func (t *TTaskDialog) Caption() string {
return TaskDialog_GetCaption(t.instance)
}
// 设置控件标题。
//
// Set the control title.
func (t *TTaskDialog) SetCaption(value string) {
TaskDialog_SetCaption(t.instance, value)
}
func (t *TTaskDialog) CommonButtons() TTaskDialogCommonButtons {
return TaskDialog_GetCommonButtons(t.instance)
}
func (t *TTaskDialog) SetCommonButtons(value TTaskDialogCommonButtons) {
TaskDialog_SetCommonButtons(t.instance, value)
}
func (t *TTaskDialog) DefaultButton() TTaskDialogCommonButton {
return TaskDialog_GetDefaultButton(t.instance)
}
func (t *TTaskDialog) SetDefaultButton(value TTaskDialogCommonButton) {
TaskDialog_SetDefaultButton(t.instance, value)
}
func (t *TTaskDialog) ExpandButtonCaption() string {
return TaskDialog_GetExpandButtonCaption(t.instance)
}
func (t *TTaskDialog) SetExpandButtonCaption(value string) {
TaskDialog_SetExpandButtonCaption(t.instance, value)
}
func (t *TTaskDialog) ExpandedText() string {
return TaskDialog_GetExpandedText(t.instance)
}
func (t *TTaskDialog) SetExpandedText(value string) {
TaskDialog_SetExpandedText(t.instance, value)
}
func (t *TTaskDialog) Flags() TTaskDialogFlags {
return TaskDialog_GetFlags(t.instance)
}
func (t *TTaskDialog) SetFlags(value TTaskDialogFlags) {
TaskDialog_SetFlags(t.instance, value)
}
func (t *TTaskDialog) FooterIcon() TTaskDialogIcon {
return TaskDialog_GetFooterIcon(t.instance)
}
func (t *TTaskDialog) SetFooterIcon(value TTaskDialogIcon) {
TaskDialog_SetFooterIcon(t.instance, value)
}
func (t *TTaskDialog) FooterText() string {
return TaskDialog_GetFooterText(t.instance)
}
func (t *TTaskDialog) SetFooterText(value string) {
TaskDialog_SetFooterText(t.instance, value)
}
func (t *TTaskDialog) MainIcon() TTaskDialogIcon {
return TaskDialog_GetMainIcon(t.instance)
}
func (t *TTaskDialog) SetMainIcon(value TTaskDialogIcon) {
TaskDialog_SetMainIcon(t.instance, value)
}
func (t *TTaskDialog) RadioButtons() *TTaskDialogButtons {
return AsTaskDialogButtons(TaskDialog_GetRadioButtons(t.instance))
}
func (t *TTaskDialog) SetRadioButtons(value *TTaskDialogButtons) {
TaskDialog_SetRadioButtons(t.instance, CheckPtr(value))
}
// 获取文本。
func (t *TTaskDialog) Text() string {
return TaskDialog_GetText(t.instance)
}
// 设置文本。
func (t *TTaskDialog) SetText(value string) {
TaskDialog_SetText(t.instance, value)
}
func (t *TTaskDialog) Title() string {
return TaskDialog_GetTitle(t.instance)
}
func (t *TTaskDialog) SetTitle(value string) {
TaskDialog_SetTitle(t.instance, value)
}
func (t *TTaskDialog) VerificationText() string {
return TaskDialog_GetVerificationText(t.instance)
}
func (t *TTaskDialog) SetVerificationText(value string) {
TaskDialog_SetVerificationText(t.instance, value)
}
func (t *TTaskDialog) SetOnButtonClicked(fn TTaskDlgClickEvent) {
TaskDialog_SetOnButtonClicked(t.instance, fn)
}
func (t *TTaskDialog) Button() *TTaskDialogButtonItem {
return AsTaskDialogButtonItem(TaskDialog_GetButton(t.instance))
}
func (t *TTaskDialog) SetButton(value *TTaskDialogButtonItem) {
TaskDialog_SetButton(t.instance, CheckPtr(value))
}
// 获取模态对话框显示结果。
func (t *TTaskDialog) ModalResult() TModalResult {
return TaskDialog_GetModalResult(t.instance)
}
// 设置模态对话框显示结果。
func (t *TTaskDialog) SetModalResult(value TModalResult) {
TaskDialog_SetModalResult(t.instance, value)
}
func (t *TTaskDialog) RadioButton() *TTaskDialogRadioButtonItem {
return AsTaskDialogRadioButtonItem(TaskDialog_GetRadioButton(t.instance))
}
// 获取组件总数。
//
// Get the total number of components.
func (t *TTaskDialog) ComponentCount() int32 {
return TaskDialog_GetComponentCount(t.instance)
}
// 获取组件索引。
//
// Get component index.
func (t *TTaskDialog) ComponentIndex() int32 {
return TaskDialog_GetComponentIndex(t.instance)
}
// 设置组件索引。
//
// Set component index.
func (t *TTaskDialog) SetComponentIndex(value int32) {
TaskDialog_SetComponentIndex(t.instance, value)
}
// 获取组件所有者。
//
// Get component owner.
func (t *TTaskDialog) Owner() *TComponent {
return AsComponent(TaskDialog_GetOwner(t.instance))
}
// 获取组件名称。
//
// Get the component name.
func (t *TTaskDialog) Name() string {
return TaskDialog_GetName(t.instance)
}
// 设置组件名称。
//
// Set the component name.
func (t *TTaskDialog) SetName(value string) {
TaskDialog_SetName(t.instance, value)
}
// 获取对象标记。
//
// Get the control tag.
func (t *TTaskDialog) Tag() int {
return TaskDialog_GetTag(t.instance)
}
// 设置对象标记。
//
// Set the control tag.
func (t *TTaskDialog) SetTag(value int) {
TaskDialog_SetTag(t.instance, value)
}
// 获取指定索引组件。
//
// Get the specified index component.
func (t *TTaskDialog) Components(AIndex int32) *TComponent {
return AsComponent(TaskDialog_GetComponents(t.instance, AIndex))
}