Esempio n. 1
0
func (w *Window) NewListBox() *ListBox {
	lb := new(ListBox)
	lb.id = getNewControlId()
	lb.handle = w32.CreateWindowEx(
		/* exStyle */ w32.WS_EX_CLIENTEDGE,
		/* className */ listBoxClassName,
		/* windowName */ nil,
		/* style */ w32.WS_CHILD|w32.WS_VISIBLE|w32.WS_VSCROLL|w32.LBS_NOTIFY,
		/* x */ w32.CW_USEDEFAULT,
		/* y */ w32.CW_USEDEFAULT,
		/* width */ w32.CW_USEDEFAULT,
		/* height */ w32.CW_USEDEFAULT,
		/* parent */ w.handle,
		/* menu */ w32.HMENU(lb.id),
		/* instance */ appHandle,
		/* param */ nil,
	)
	controls = append(controls, lb)
	lb.Parent = w
	lb.setFont(defaultFont)
	return lb
}
Esempio n. 2
0
func (w *Window) NewButton() *Button {
	b := new(Button)
	b.id = getNewControlId()
	b.handle = w32.CreateWindowEx(
		/* exStyle */ 0,
		/* className */ buttonClassName,
		/* windowName */ nil,
		/* style */ w32.WS_CHILD|w32.WS_VISIBLE|w32.BS_PUSHBUTTON,
		/* x */ w32.CW_USEDEFAULT,
		/* y */ w32.CW_USEDEFAULT,
		/* width */ w32.CW_USEDEFAULT,
		/* height */ w32.CW_USEDEFAULT,
		/* parent */ w.handle,
		/* menu */ w32.HMENU(b.id),
		/* instance */ appHandle,
		/* param */ nil,
	)
	controls = append(controls, b)
	b.Parent = w
	b.setFont(defaultFont)
	return b
}
Esempio n. 3
0
func (w *Window) NewTextEdit() *TextEdit {
	te := new(TextEdit)
	te.id = getNewControlId()
	te.handle = w32.CreateWindowEx(
		/* exStyle */ w32.WS_EX_CLIENTEDGE,
		/* className */ textEditClassName,
		/* windowName */ nil,
		/* style */ w32.WS_CHILD|w32.WS_VISIBLE|w32.ES_AUTOHSCROLL,
		/* x */ w32.CW_USEDEFAULT,
		/* y */ w32.CW_USEDEFAULT,
		/* width */ w32.CW_USEDEFAULT,
		/* height */ w32.CW_USEDEFAULT,
		/* parent */ w.handle,
		/* menu */ w32.HMENU(te.id),
		/* instance */ appHandle,
		/* param */ nil,
	)
	controls = append(controls, te)
	te.Parent = w
	te.setFont(defaultFont)
	return te
}
Esempio n. 4
0
func (w *Window) NewLabel() *Label {
	l := new(Label)
	l.id = getNewControlId()
	l.handle = w32.CreateWindowEx(
		/* exStyle */ 0,
		/* className */ labelClassName,
		/* windowName */ nil,
		/* style */ w32.WS_CHILD|w32.WS_VISIBLE,
		/* x */ w32.CW_USEDEFAULT,
		/* y */ w32.CW_USEDEFAULT,
		/* width */ w32.CW_USEDEFAULT,
		/* height */ w32.CW_USEDEFAULT,
		/* parent */ w.handle,
		/* menu */ w32.HMENU(l.id),
		/* instance */ appHandle,
		/* param */ nil,
	)
	controls = append(controls, l)
	l.Parent = w
	l.setFont(defaultFont)
	return l
}