forked from ying32/govcl
/
Form1Impl.go
63 lines (46 loc) · 1.41 KB
/
Form1Impl.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
package main
import (
"fmt"
"github.com/ying32/govcl/vcl/win"
"github.com/ying32/govcl/vcl/types/keys"
"github.com/ying32/govcl/vcl"
"github.com/ying32/govcl/vcl/types"
)
//::private::
type TForm1Fields struct {
}
func (f *TForm1) OnFormCreate(sender vcl.IObject) {
win.OutputDebugString(Form1.Caption(), f.PixelsPerInch())
}
func (f *TForm1) OnFormDestroy(sender vcl.IObject) {
win.OutputDebugString("----------------------OnFormDestroy")
}
func (f *TForm1) memoOnKeyup(sender vcl.IObject, key *types.Char, shift types.TShiftState) {
if shift.In(types.SsCtrl) && *key == /*keys.VkA*/ keys.VkB {
vcl.AsMemo(sender).SelectAll()
}
}
func (f *TForm1) OnActExitExecute(vcl.IObject) {
}
func (f *TForm1) OnButton2Click(vcl.IObject) {
win.OutputDebugString("currentid-1: ", win.GetCurrentThreadId())
go func() {
win.OutputDebugString("OnButton2Click, currentid-2", win.GetCurrentThreadId())
vcl.ThreadSync(func() {
win.OutputDebugString("ThreadSync OnButton2Click-3", win.GetCurrentThreadId())
vcl.ShowMessage("测试")
})
}()
}
func (f *TForm1) OnActFileNewExecute(vcl.IObject) {
vcl.ShowMessage("ActFileNew Execute.")
}
func (f *TForm1) OnFormCloseQuery(sender vcl.IObject, canClose *bool) {
fmt.Println("关闭。")
}
func (f *TForm1) OnCheckBox1Click(sender vcl.IObject) {
f.Button1.SetEnabled(f.CheckBox1.Checked())
}
func (f *TForm1) OnButton1Click(sender vcl.IObject) {
vcl.ShowMessage("Hello!")
}