/
finddialog.go
311 lines (256 loc) · 8.46 KB
/
finddialog.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
//----------------------------------------
// 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 TFindDialog struct {
IComponent
instance uintptr
// 特殊情况下使用,主要应对Go的GC问题,与LCL没有太多关系。
ptr unsafe.Pointer
}
// CN: 创建一个新的对象。
// EN: Create a new object.
func NewFindDialog(owner IComponent) *TFindDialog {
f := new(TFindDialog)
f.instance = FindDialog_Create(CheckPtr(owner))
f.ptr = unsafe.Pointer(f.instance)
// 不敢启用,因为不知道会发生什么...
// runtime.SetFinalizer(f, (*TFindDialog).Free)
return f
}
// CN: 动态转换一个已存在的对象实例。或者使用Obj.As().<目标对象>。
// EN: Dynamically convert an existing object instance. Or use Obj.As().<Target object>.
func AsFindDialog(obj interface{}) *TFindDialog {
instance, ptr := getInstance(obj)
if instance == 0 { return nil }
return &TFindDialog{instance: instance, ptr: ptr}
}
// -------------------------- Deprecated begin --------------------------
// CN: 新建一个对象来自已经存在的对象实例指针。
// EN: Create a new object from an existing object instance pointer.
// Deprecated: use AsFindDialog.
func FindDialogFromInst(inst uintptr) *TFindDialog {
return AsFindDialog(inst)
}
// CN: 新建一个对象来自已经存在的对象实例。
// EN: Create a new object from an existing object instance.
// Deprecated: use AsFindDialog.
func FindDialogFromObj(obj IObject) *TFindDialog {
return AsFindDialog(obj)
}
// CN: 新建一个对象来自不安全的地址。注意:使用此函数可能造成一些不明情况,慎用。
// EN: Create a new object from an unsecured address. Note: Using this function may cause some unclear situations and be used with caution..
// Deprecated: use AsFindDialog.
func FindDialogFromUnsafePointer(ptr unsafe.Pointer) *TFindDialog {
return AsFindDialog(ptr)
}
// -------------------------- Deprecated end --------------------------
// CN: 释放对象。
// EN: Free object.
func (f *TFindDialog) Free() {
if f.instance != 0 {
FindDialog_Free(f.instance)
f.instance, f.ptr = 0, nullptr
}
}
// CN: 返回对象实例指针。
// EN: Return object instance pointer.
func (f *TFindDialog) Instance() uintptr {
return f.instance
}
// CN: 获取一个不安全的地址。
// EN: Get an unsafe address.
func (f *TFindDialog) UnsafeAddr() unsafe.Pointer {
return f.ptr
}
// CN: 检测地址是否为空。
// EN: Check if the address is empty.
func (f *TFindDialog) IsValid() bool {
return f.instance != 0
}
// CN: 检测当前对象是否继承自目标对象。
// EN: Checks whether the current object is inherited from the target object.
func (f *TFindDialog) Is() TIs {
return TIs(f.instance)
}
// CN: 动态转换当前对象为目标对象。
// EN: Dynamically convert the current object to the target object.
//func (f *TFindDialog) As() TAs {
// return TAs(f.instance)
//}
// CN: 获取类信息指针。
// EN: Get class information pointer.
func TFindDialogClass() TClass {
return FindDialog_StaticClassType()
}
func (f *TFindDialog) CloseDialog() {
FindDialog_CloseDialog(f.instance)
}
// CN: 执行。
// EN: .
func (f *TFindDialog) Execute() bool {
return FindDialog_Execute(f.instance)
}
// CN: 查找指定名称的组件。
// EN: Find the component with the specified name.
func (f *TFindDialog) FindComponent(AName string) *TComponent {
return AsComponent(FindDialog_FindComponent(f.instance, AName))
}
// CN: 获取类名路径。
// EN: Get the class name path.
func (f *TFindDialog) GetNamePath() string {
return FindDialog_GetNamePath(f.instance)
}
// CN: 是否有父容器。
// EN: Is there a parent container.
func (f *TFindDialog) HasParent() bool {
return FindDialog_HasParent(f.instance)
}
// CN: 复制一个对象,如果对象实现了此方法的话。
// EN: Copy an object, if the object implements this method.
func (f *TFindDialog) Assign(Source IObject) {
FindDialog_Assign(f.instance, CheckPtr(Source))
}
// CN: 获取类的类型信息。
// EN: Get class type information.
func (f *TFindDialog) ClassType() TClass {
return FindDialog_ClassType(f.instance)
}
// CN: 获取当前对象类名称。
// EN: Get the current object class name.
func (f *TFindDialog) ClassName() string {
return FindDialog_ClassName(f.instance)
}
// CN: 获取当前对象实例大小。
// EN: Get the current object instance size.
func (f *TFindDialog) InstanceSize() int32 {
return FindDialog_InstanceSize(f.instance)
}
// CN: 判断当前类是否继承自指定类。
// EN: Determine whether the current class inherits from the specified class.
func (f *TFindDialog) InheritsFrom(AClass TClass) bool {
return FindDialog_InheritsFrom(f.instance, AClass)
}
// CN: 与一个对象进行比较。
// EN: Compare with an object.
func (f *TFindDialog) Equals(Obj IObject) bool {
return FindDialog_Equals(f.instance, CheckPtr(Obj))
}
// CN: 获取类的哈希值。
// EN: Get the hash value of the class.
func (f *TFindDialog) GetHashCode() int32 {
return FindDialog_GetHashCode(f.instance)
}
// CN: 文本类信息。
// EN: Text information.
func (f *TFindDialog) ToString() string {
return FindDialog_ToString(f.instance)
}
// CN: 获取左边位置。
// EN: Get Left position.
func (f *TFindDialog) Left() int32 {
return FindDialog_GetLeft(f.instance)
}
// CN: 设置左边位置。
// EN: Set Left position.
func (f *TFindDialog) SetLeft(value int32) {
FindDialog_SetLeft(f.instance, value)
}
func (f *TFindDialog) Position() TPoint {
return FindDialog_GetPosition(f.instance)
}
func (f *TFindDialog) SetPosition(value TPoint) {
FindDialog_SetPosition(f.instance, value)
}
// CN: 获取顶边位置。
// EN: Get Top position.
func (f *TFindDialog) Top() int32 {
return FindDialog_GetTop(f.instance)
}
// CN: 设置顶边位置。
// EN: Set Top position.
func (f *TFindDialog) SetTop(value int32) {
FindDialog_SetTop(f.instance, value)
}
func (f *TFindDialog) FindText() string {
return FindDialog_GetFindText(f.instance)
}
func (f *TFindDialog) SetFindText(value string) {
FindDialog_SetFindText(f.instance, value)
}
func (f *TFindDialog) Options() TFindOptions {
return FindDialog_GetOptions(f.instance)
}
func (f *TFindDialog) SetOptions(value TFindOptions) {
FindDialog_SetOptions(f.instance, value)
}
func (f *TFindDialog) SetOnFind(fn TNotifyEvent) {
FindDialog_SetOnFind(f.instance, fn)
}
// CN: 获取控件句柄。
// EN: Get Control handle.
func (f *TFindDialog) Handle() HWND {
return FindDialog_GetHandle(f.instance)
}
func (f *TFindDialog) SetOnClose(fn TNotifyEvent) {
FindDialog_SetOnClose(f.instance, fn)
}
// CN: 设置显示事件。
// EN: .
func (f *TFindDialog) SetOnShow(fn TNotifyEvent) {
FindDialog_SetOnShow(f.instance, fn)
}
// CN: 获取组件总数。
// EN: Get the total number of components.
func (f *TFindDialog) ComponentCount() int32 {
return FindDialog_GetComponentCount(f.instance)
}
// CN: 获取组件索引。
// EN: Get component index.
func (f *TFindDialog) ComponentIndex() int32 {
return FindDialog_GetComponentIndex(f.instance)
}
// CN: 设置组件索引。
// EN: Set component index.
func (f *TFindDialog) SetComponentIndex(value int32) {
FindDialog_SetComponentIndex(f.instance, value)
}
// CN: 获取组件所有者。
// EN: Get component owner.
func (f *TFindDialog) Owner() *TComponent {
return AsComponent(FindDialog_GetOwner(f.instance))
}
// CN: 获取组件名称。
// EN: Get the component name.
func (f *TFindDialog) Name() string {
return FindDialog_GetName(f.instance)
}
// CN: 设置组件名称。
// EN: Set the component name.
func (f *TFindDialog) SetName(value string) {
FindDialog_SetName(f.instance, value)
}
// CN: 获取对象标记。
// EN: Get the control tag.
func (f *TFindDialog) Tag() int {
return FindDialog_GetTag(f.instance)
}
// CN: 设置对象标记。
// EN: Set the control tag.
func (f *TFindDialog) SetTag(value int) {
FindDialog_SetTag(f.instance, value)
}
// CN: 获取指定索引组件。
// EN: Get the specified index component.
func (f *TFindDialog) Components(AIndex int32) *TComponent {
return AsComponent(FindDialog_GetComponents(f.instance, AIndex))
}