-
Notifications
You must be signed in to change notification settings - Fork 28
/
types_labelbutton_component.go
130 lines (113 loc) · 3.79 KB
/
types_labelbutton_component.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
//----------------------------------------
//
// Copyright © yanghy. All Rights Reserved.
//
// Licensed under Apache License Version 2.0, January 2004
//
// https//www.apache.org/licenses/LICENSE-2.0
//
//----------------------------------------
package cef
import (
"github.com/energye/energy/v2/cef/internal/def"
"github.com/energye/energy/v2/common/imports"
"github.com/energye/energy/v2/consts"
"github.com/energye/energy/v2/types"
"github.com/energye/golcl/lcl"
"github.com/energye/golcl/lcl/api"
"unsafe"
)
// LabelButtonComponentRef -> TCEFLabelButtonComponent
var LabelButtonComponentRef labelButtonComponent
type labelButtonComponent uintptr
func (m *labelButtonComponent) New(AOwner lcl.IComponent) *TCEFLabelButtonComponent {
var result uintptr
imports.Proc(def.LabelButtonComponent_Create).Call(AOwner.Instance(), uintptr(unsafe.Pointer(&result)))
if result != 0 {
return &TCEFLabelButtonComponent{&TCEFButtonComponent{&TCEFViewComponent{instance: getInstance(result)}}}
}
return nil
}
func (m *TCEFLabelButtonComponent) CreateLabelButton(text string) {
if !m.IsValid() {
return
}
imports.Proc(def.LabelButtonComponent_CreateLabelButton).Call(m.Instance(), api.PascalStr(text))
}
func (m *TCEFLabelButtonComponent) SetTextColor(forState consts.TCefButtonState, color types.TCefColor) {
if !m.IsValid() {
return
}
imports.Proc(def.LabelButtonComponent_SetTextColor).Call(m.Instance(), uintptr(forState), uintptr(color))
}
func (m *TCEFLabelButtonComponent) SetEnabledTextColors(color types.TCefColor) {
if !m.IsValid() {
return
}
imports.Proc(def.LabelButtonComponent_SetEnabledTextColors).Call(m.Instance(), uintptr(color))
}
func (m *TCEFLabelButtonComponent) SetFontList(fontList string) {
if !m.IsValid() {
return
}
imports.Proc(def.LabelButtonComponent_SetFontList).Call(m.Instance(), api.PascalStr(fontList))
}
func (m *TCEFLabelButtonComponent) SetHorizontalAlignment(alignment consts.TCefHorizontalAlignment) {
if !m.IsValid() {
return
}
imports.Proc(def.LabelButtonComponent_SetHorizontalAlignment).Call(m.Instance(), uintptr(alignment))
}
func (m *TCEFLabelButtonComponent) SetMinimumSize(size *TCefSize) {
if !m.IsValid() {
return
}
imports.Proc(def.LabelButtonComponent_SetMinimumSize).Call(m.Instance(), uintptr(unsafe.Pointer(size)))
}
func (m *TCEFLabelButtonComponent) SetMaximumSize(size *TCefSize) {
if !m.IsValid() {
return
}
imports.Proc(def.LabelButtonComponent_SetMaximumSize).Call(m.Instance(), uintptr(unsafe.Pointer(size)))
}
func (m *TCEFLabelButtonComponent) GetText() string {
if !m.IsValid() {
return ""
}
r1, _, _ := imports.Proc(def.LabelButtonComponent_GetText).Call(m.Instance())
return api.GoStr(r1)
}
func (m *TCEFLabelButtonComponent) SetText(text string) {
if !m.IsValid() {
return
}
imports.Proc(def.LabelButtonComponent_SetText).Call(m.Instance(), api.PascalStr(text))
}
func (m *TCEFLabelButtonComponent) GetImage(buttonState consts.TCefButtonState) *ICefImage {
if !m.IsValid() {
return nil
}
var result uintptr
imports.Proc(def.LabelButtonComponent_GetImage).Call(m.Instance(), uintptr(buttonState), uintptr(unsafe.Pointer(&result)))
if result != 0 {
return &ICefImage{instance: getInstance(result)}
}
return nil
}
func (m *TCEFLabelButtonComponent) SetImage(buttonState consts.TCefButtonState, image *ICefImage) {
if !m.IsValid() || !image.IsValid() {
return
}
imports.Proc(def.LabelButtonComponent_SetImage).Call(m.Instance(), uintptr(buttonState), image.Instance())
}
func (m *TCEFLabelButtonComponent) AsMenuButton() *ICefMenuButton {
if !m.IsValid() {
return nil
}
var result uintptr
imports.Proc(def.LabelButtonComponent_AsMenuButton).Call(m.Instance(), uintptr(unsafe.Pointer(&result)))
if result != 0 {
return &ICefMenuButton{&ICefLabelButton{&ICefButton{&ICefView{instance: getInstance(result)}}}}
}
return nil
}