Renamed sysData.editable to sysData.alternate in preparation for ListBox.
This commit is contained in:
parent
9070eae214
commit
61d7f285ac
|
@ -22,7 +22,7 @@ func NewCombobox(editable bool, items ...string) (c *Combobox) {
|
||||||
sysData: mksysdata(c_combobox),
|
sysData: mksysdata(c_combobox),
|
||||||
initItems: items,
|
initItems: items,
|
||||||
}
|
}
|
||||||
c.sysData.editable = editable
|
c.sysData.alternate = editable
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ type cSysData struct {
|
||||||
ctype int
|
ctype int
|
||||||
event chan struct{}
|
event chan struct{}
|
||||||
resize func(x int, y int, width int, height int) error
|
resize func(x int, y int, width int, height int) error
|
||||||
editable bool // for Combobox
|
alternate bool // editable for Combobox, multi-select for listbox
|
||||||
}
|
}
|
||||||
func (c *cSysData) make(initText string, initWidth int, initHeight int, window *sysData) error {
|
func (c *cSysData) make(initText string, initWidth int, initHeight int, window *sysData) error {
|
||||||
panic(runtime.GOOS + " sysData does not define make()")
|
panic(runtime.GOOS + " sysData does not define make()")
|
||||||
|
|
|
@ -23,7 +23,7 @@ type classData struct {
|
||||||
style uint32
|
style uint32
|
||||||
xstyle uint32
|
xstyle uint32
|
||||||
mkid bool
|
mkid bool
|
||||||
editStyle uint32
|
altStyle uint32
|
||||||
appendMsg uintptr
|
appendMsg uintptr
|
||||||
insertAfterMsg uintptr
|
insertAfterMsg uintptr
|
||||||
deleteMsg uintptr
|
deleteMsg uintptr
|
||||||
|
@ -51,7 +51,7 @@ var classTypes = [nctypes]*classData{
|
||||||
name: "COMBOBOX",
|
name: "COMBOBOX",
|
||||||
style: _CBS_DROPDOWNLIST | controlstyle,
|
style: _CBS_DROPDOWNLIST | controlstyle,
|
||||||
xstyle: 0 | controlxstyle,
|
xstyle: 0 | controlxstyle,
|
||||||
editStyle: _CBS_DROPDOWN | _CBS_AUTOHSCROLL | controlstyle,
|
altStyle: _CBS_DROPDOWN | _CBS_AUTOHSCROLL | controlstyle,
|
||||||
appendMsg: _CB_ADDSTRING,
|
appendMsg: _CB_ADDSTRING,
|
||||||
insertAfterMsg: _CB_INSERTSTRING,
|
insertAfterMsg: _CB_INSERTSTRING,
|
||||||
deleteMsg: _CB_DELETESTRING,
|
deleteMsg: _CB_DELETESTRING,
|
||||||
|
@ -104,8 +104,8 @@ func (s *sysData) make(initText string, initWidth int, initHeight int, window *s
|
||||||
classname = n
|
classname = n
|
||||||
}
|
}
|
||||||
style := uintptr(ct.style)
|
style := uintptr(ct.style)
|
||||||
if s.editable {
|
if s.alternate {
|
||||||
style = uintptr(ct.editStyle)
|
style = uintptr(ct.altStyle)
|
||||||
}
|
}
|
||||||
uitask <- &uimsg{
|
uitask <- &uimsg{
|
||||||
call: _createWindowEx,
|
call: _createWindowEx,
|
||||||
|
|
Loading…
Reference in New Issue