summaryrefslogtreecommitdiff
path: root/sysdata_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'sysdata_windows.go')
-rw-r--r--sysdata_windows.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/sysdata_windows.go b/sysdata_windows.go
index f311187..7c904ae 100644
--- a/sysdata_windows.go
+++ b/sysdata_windows.go
@@ -24,6 +24,7 @@ type classData struct {
xstyle uint32
mkid bool
altStyle uint32
+ font *_HANDLE
appendMsg uintptr
insertBeforeMsg uintptr
deleteMsg uintptr
@@ -44,17 +45,20 @@ var classTypes = [nctypes]*classData{
name: "BUTTON",
style: _BS_PUSHBUTTON | controlstyle,
xstyle: 0 | controlxstyle,
+ font: &controlFont,
},
c_checkbox: &classData{
name: "BUTTON",
style: _BS_AUTOCHECKBOX | controlstyle,
xstyle: 0 | controlxstyle,
+ font: &controlFont,
},
c_combobox: &classData{
name: "COMBOBOX",
style: _CBS_DROPDOWNLIST | _WS_VSCROLL | controlstyle,
xstyle: 0 | controlxstyle,
altStyle: _CBS_DROPDOWN | _CBS_AUTOHSCROLL | _WS_VSCROLL | controlstyle,
+ font: &controlFont,
appendMsg: _CB_ADDSTRING,
insertBeforeMsg: _CB_INSERTSTRING,
deleteMsg: _CB_DELETESTRING,
@@ -66,11 +70,13 @@ var classTypes = [nctypes]*classData{
name: "EDIT",
style: _ES_AUTOHSCROLL | _WS_BORDER | controlstyle,
xstyle: 0 | controlxstyle,
+ font: &controlFont,
},
c_label: &classData{
name: "STATIC",
style: _SS_NOPREFIX | controlstyle,
xstyle: 0 | controlxstyle,
+ font: &controlFont,
},
c_listbox: &classData{
name: "LISTBOX",
@@ -78,6 +84,7 @@ var classTypes = [nctypes]*classData{
style: _WS_VSCROLL | controlstyle,
xstyle: 0 | controlxstyle,
altStyle: _LBS_EXTENDEDSEL | _WS_VSCROLL | controlstyle,
+ font: &controlFont,
appendMsg: _LB_ADDSTRING,
insertBeforeMsg: _LB_INSERTSTRING,
deleteMsg: _LB_DELETESTRING,
@@ -151,6 +158,19 @@ func (s *sysData) make(initText string, window *sysData) (err error) {
return fmt.Errorf("error actually creating window/control: %v", r.err)
}
s.hwnd = _HWND(r.ret)
+ if ct.font != nil {
+ uitask <- &uimsg{
+ call: _sendMessage,
+ p: []uintptr{
+ uintptr(s.hwnd),
+ uintptr(_WM_SETFONT),
+ uintptr(_WPARAM(*ct.font)),
+ uintptr(_LPARAM(_TRUE)),
+ },
+ ret: ret,
+ }
+ <-ret
+ }
return nil
}