ui

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 10 Imported by: 1

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (

	// When parent is resized, nothing happens.
	LAY_NONE_NONE LAY = 0
	// When parent resizes:
	//	- horizontal: nothing happens;
	//	- vertical: control moves anchored at bottom.
	LAY_NONE_REPOS = _LAYV_REPOS
	// When parent resizes:
	//	- horizontal: nothing happens;
	//	- vertical: control is resized together.
	LAY_NONE_RESIZE = _LAYV_RESIZE
	// When parent resizes:
	//	- horizontal: control moves anchored at right;
	//	- vertical: nothing happens.
	LAY_REPOS_NONE = _LAYH_REPOS
	// When parent resizes:
	//	- horizontal: control moves anchored at right;
	//	- vertical: control moves anchored at bottom.
	LAY_REPOS_REPOS = _LAYH_REPOS | _LAYV_REPOS
	// When parent resizes:
	//	- horizontal: control moves anchored at right;
	//	- vertical: control is resized together.
	LAY_REPOS_RESIZE = _LAYH_REPOS | _LAYV_RESIZE
	// When parent resizes:
	//	- horizontal: control is resized together;
	//	- vertical: nothing happens.
	LAY_RESIZE_NONE = _LAYH_RESIZE
	// When parent resizes:
	//	- horizontal: control is resized together;
	//	- vertical: control moves anchored at bottom.
	LAY_RESIZE_REPOS = _LAYH_RESIZE | _LAYV_REPOS
	// When parent resizes:
	//	- horizontal: control is resized together;
	//	- vertical: control is resized together.
	LAY_RESIZE_RESIZE = _LAYH_RESIZE | _LAYV_RESIZE
)

Variables

This section is empty.

Functions

func Dpi added in v0.2.0

func Dpi(x, y int) (int, int)

Returns the value adjusted according to the current system DPI.

func DpiX added in v0.2.0

func DpiX(x int) int

Returns the value adjusted according to the current horizontal system DPI.

func DpiY added in v0.2.0

func DpiY(y int) int

Returns the value adjusted according to the current vertical system DPI.

func MsgError added in v0.2.0

func MsgError(wnd Parent, title, caption, body string)

Syntactic sugar to TaskDialogIndirect to display a message box indicating an error.

Panics on error.

Example

var wndOwner ui.Parent // initialized somewhere

ui.MsgError(
	wndOwner,
	"Title",
	"Big caption above text",
	"Here goes the text",
)

func MsgOk added in v0.2.0

func MsgOk(wnd Parent, title, caption, body string)

Syntactic sugar to TaskDialogIndirect to display a message box indicating a successful operation.

Panics on error.

Example

var wndOwner ui.Parent // initialized somewhere

ui.MsgOk(
	wndOwner,
	"Title",
	"Big caption above text",
	"Here goes the text",
)

func MsgOkCancel added in v0.2.0

func MsgOkCancel(wnd Parent, title, caption, body, okText string) co.ID

Syntactic sugar to TaskDialogIndirect to display a message box prompting the user to choose "Ok" or "Cancel". The "Ok" text can be customized.

Returns co.ID_OK or co.ID_CANCEL.

Panics on error.

Example

var wndOwner ui.Parent // initialized somewhere

ret := ui.MsgOkCancel(
	wndOwner,
	"Title",
	"Big caption above text",
	"Here goes the text",
	"&Confirm",
)
if ret == co.ID_OK {
	// ...
}

func MsgWarn added in v0.2.0

func MsgWarn(wnd Parent, title, caption, body string)

Syntactic sugar to TaskDialogIndirect to display a message box indicating a warning.

Panics on error.

Example

var wndOwner ui.Parent // initialized somewhere

ui.MsgWarn(
	wndOwner,
	"Title",
	"Big caption above text",
	"Here goes the text",
)

Types

type Button

type Button struct {
	// contains filtered or unexported fields
}

Native button control.

func NewButton

func NewButton(parent Parent, opts *VarOptsButton) *Button

Creates a new Button with win.CreateWindowEx.

Example

var wndOwner ui.Parent // initialized somewhere

btn := ui.NewButton(
	wndOwner,
	ui.OptsButton().
		Text("Click").
		Position(ui.Dpi(20, 10)),
)

func NewButtonDlg

func NewButtonDlg(parent Parent, ctrlId uint16, layout LAY) *Button

Instantiates a new Button to be loaded from a dialog resource with win.HWND.GetDlgItem.

Example

const ID_BTN uint16 = 0x100

var wndOwner ui.Parent // initialized somewhere

btn := ui.NewButtonDlg(
	wndOwner, ID_BTN, ui.LAY_NONE_NONE)

func (*Button) CtrlId added in v0.2.0

func (me *Button) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*Button) Focus added in v0.2.0

func (me *Button) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*Button) Hwnd added in v0.2.0

func (me *Button) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*Button) On

func (me *Button) On() *EventsButton

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*Button) OnSubclass added in v0.2.0

func (me *Button) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*Button) SetText added in v0.2.0

func (me *Button) SetText(text string) *Button

Calls win.HWND.SetWindowText.

Returns the same object, so further operations can be chained.

func (*Button) Text added in v0.2.0

func (me *Button) Text() string

Calls win.HWND.GetWindowText.

func (*Button) TriggerClick added in v0.2.0

func (me *Button) TriggerClick() *Button

Fires the click event by sending a BM_CLICK message.

Returns the same object, so further operations can be chained.

type CheckBox

type CheckBox struct {
	// contains filtered or unexported fields
}

Native check box control.

func NewCheckBox

func NewCheckBox(parent Parent, opts *VarOptsCheckBox) *CheckBox

Creates a new CheckBox with win.CreateWindowEx.

Example

var wndOwner ui.Parent // initialized somewhere

chk := ui.NewCheckBox(
	wndOwner,
	ui.OptsCheckBox().
		Text("&Click me").
		Position(ui.Dpi(128, 75)).
		State(co.BST_CHECKED),
)

func NewCheckBoxDlg

func NewCheckBoxDlg(parent Parent, ctrlId uint16, layout LAY) *CheckBox

Instantiates a new CheckBox to be loaded from a dialog resource with win.HWND.GetDlgItem.

Example

const ID_CHK uint16 = 0x100

var wndOwner ui.Parent // initialized somewhere

chk := ui.NewCheckBoxDlg(
	wndOwner, ID_CHK, ui.LAY_NONE_NONE)

func (*CheckBox) CtrlId added in v0.2.0

func (me *CheckBox) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*CheckBox) Focus added in v0.2.0

func (me *CheckBox) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*CheckBox) Hwnd added in v0.2.0

func (me *CheckBox) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*CheckBox) IsChecked

func (me *CheckBox) IsChecked() bool

Sends a BM_GETCHECK message and returns true if current check state is co.BST_CHECKED.

func (*CheckBox) On

func (me *CheckBox) On() *EventsButton

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*CheckBox) OnSubclass added in v0.2.0

func (me *CheckBox) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*CheckBox) SetCheck added in v0.2.0

func (me *CheckBox) SetCheck(checked bool) *CheckBox

Sets the current check state by sending a BM_SETCHECK message.

A true value will apply co.BST_CHECKED, otherwise co.BST_UNCHECKED.

Returns the same object, so further operations can be chained.

func (*CheckBox) SetCheckAndTrigger added in v0.2.0

func (me *CheckBox) SetCheckAndTrigger(checked bool) *CheckBox

Sets the current check state by sending a BM_SETCHECK message, then sends a BN_CLICKED notification.

A true value will apply co.BST_CHECKED, otherwise co.BST_UNCHECKED.

Returns the same object, so further operations can be chained.

func (*CheckBox) SetState added in v0.2.0

func (me *CheckBox) SetState(state co.BST) *CheckBox

Sets the current check state by sending a BM_SETCHECK message.

Returns the same object, so further operations can be chained.

func (*CheckBox) SetStateAndTrigger added in v0.2.0

func (me *CheckBox) SetStateAndTrigger(state co.BST) *CheckBox

Sets the current check state by sending a BM_SETCHECK message, then sends a BN_CLICKED notification.

Returns the same object, so further operations can be chained.

func (*CheckBox) SetTextAndResize

func (me *CheckBox) SetTextAndResize(text string) *CheckBox

Sets the current text and resizes the control to exactly fit it.

Returns the same object, so further operations can be chained.

func (*CheckBox) State added in v0.2.0

func (me *CheckBox) State() co.BST

Returns the current check state by sending a BM_GETCHECK message.

func (*CheckBox) Text added in v0.2.0

func (me *CheckBox) Text() string

Calls win.HWND.GetWindowText.

type ChildControl added in v0.2.0

type ChildControl interface {
	Window

	// Returns the control ID, unique within the same Parent.
	CtrlId() uint16

	// If parent is a dialog, sets the focus by sending [WM_NEXTDLGCTL]. This
	// draws the borders correctly in some undefined controls, like buttons.
	//
	// Otherwise, calls [SetFocus].
	//
	// [WM_NEXTDLGCTL]: https://learn.microsoft.com/en-us/windows/win32/dlgbox/wm-nextdlgctl
	// [SetFocus]: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setfocus
	Focus()
}

A child control window.

type CollectionComboBoxItems added in v0.2.0

type CollectionComboBoxItems struct {
	// contains filtered or unexported fields
}

The items collection.

You cannot create this object directly, it will be created automatically by the owning ComboBox.

func (*CollectionComboBoxItems) Add added in v0.2.0

func (me *CollectionComboBoxItems) Add(texts ...string)

Adds one or more items using CB_ADDSTRING.

func (*CollectionComboBoxItems) All added in v0.2.0

func (me *CollectionComboBoxItems) All() []string

Returns all items with CB_GETLBTEXT.

func (*CollectionComboBoxItems) Count added in v0.2.0

func (me *CollectionComboBoxItems) Count() uint

Retrieves the number of items with CB_GETCOUNT.

func (*CollectionComboBoxItems) DeleteAll added in v0.2.0

func (me *CollectionComboBoxItems) DeleteAll()

Deletes all items with CB_RESETCONTENT.

func (*CollectionComboBoxItems) Get added in v0.2.0

func (me *CollectionComboBoxItems) Get(index int) string

Returns the item at the given index with CB_GETLBTEXT.

Panics if the index is not valid.

func (*CollectionComboBoxItems) Last added in v0.2.0

func (me *CollectionComboBoxItems) Last() string

Returns the last item with CB_GETLBTEXT.

Panics if empty.

func (*CollectionComboBoxItems) Select added in v0.2.0

func (me *CollectionComboBoxItems) Select(index int)

Selects the given item with CB_SETCURSEL.

If index is -1, selection is cleared.

func (*CollectionComboBoxItems) Selected added in v0.2.0

func (me *CollectionComboBoxItems) Selected() int

Retrieves the selected index with CB_GETCURSEL.

If no item is selected, returns -1.

func (*CollectionComboBoxItems) Text added in v0.2.0

func (me *CollectionComboBoxItems) Text(index uint) string

Returns the string at the given position with CB_GETLBTEXT.

Panics on error.

type CollectionHeaderItems added in v0.2.0

type CollectionHeaderItems struct {
	// contains filtered or unexported fields
}

The items collection.

You cannot create this object directly, it will be created automatically by the owning Header.

func (*CollectionHeaderItems) Add added in v0.2.0

func (me *CollectionHeaderItems) Add(text string, width int) HeaderItem

Adds a new item with its width, using HDM_INSERTITEM, and returns the new item.

Panics on error.

func (*CollectionHeaderItems) All added in v0.2.0

func (me *CollectionHeaderItems) All() []HeaderItem

Returns all items.

func (*CollectionHeaderItems) AllOrdered added in v0.2.0

func (me *CollectionHeaderItems) AllOrdered() []HeaderItem

Sends HDM_GETORDERARRAY to retrieve the items in the current order.

func (*CollectionHeaderItems) Count added in v0.2.0

func (me *CollectionHeaderItems) Count() uint

Retrieves the number of items with HDM_GETITEMCOUNT.

Panics on error.

func (*CollectionHeaderItems) Get added in v0.2.0

func (me *CollectionHeaderItems) Get(index int) HeaderItem

Returns the item at the given index.

func (*CollectionHeaderItems) GetByOrder added in v0.2.0

func (me *CollectionHeaderItems) GetByOrder(order uint) HeaderItem

Sends HDM_ORDERTOINDEX to retrieve the item at the given order.

func (*CollectionHeaderItems) Last added in v0.2.0

func (me *CollectionHeaderItems) Last() HeaderItem

Returns the last item.

func (*CollectionHeaderItems) Reorder added in v0.2.0

func (me *CollectionHeaderItems) Reorder(indexes []int)

Sends a HDM_SETORDERARRAY to reorder the items with the given order.

type CollectionListViewCols added in v0.2.0

type CollectionListViewCols struct {
	// contains filtered or unexported fields
}

The columns collection.

You cannot create this object directly, it will be created automatically by the owning ListView.

func (*CollectionListViewCols) Add added in v0.2.0

func (me *CollectionListViewCols) Add(title string, width int) ListViewCol

Add a column with its width, using LVM_INSERTCOLUMN, and returns the new column.

Panics on error.

Example

var list ui.ListView // initialized somewhere

list.Cols.Add("Title", ui.DpiX(80))

func (*CollectionListViewCols) All added in v0.2.0

func (me *CollectionListViewCols) All() []ListViewCol

Returns all columns.

func (*CollectionListViewCols) Count added in v0.2.0

func (me *CollectionListViewCols) Count() uint

Retrieves the number of columns with HDM_GETITEMCOUNT.

Panics if the list view has no header.

func (*CollectionListViewCols) Get added in v0.2.0

func (me *CollectionListViewCols) Get(index int) ListViewCol

Returns the column at the given index.

func (*CollectionListViewCols) Last added in v0.2.0

Returns the last column.

type CollectionListViewItems added in v0.2.0

type CollectionListViewItems struct {
	// contains filtered or unexported fields
}

The items collection.

You cannot create this object directly, it will be created automatically by the owning ListView.

func (*CollectionListViewItems) Add added in v0.2.0

func (me *CollectionListViewItems) Add(texts ...string) ListViewItem

Adds one item with LVM_INSERTITEM, then sets the texts under each subsequent column, returning the new item.

Panics if no text is informed; panics on error.

func (*CollectionListViewItems) AddWithIcon added in v0.2.0

func (me *CollectionListViewItems) AddWithIcon(iconIndex int, texts ...string) ListViewItem

Adds one item with LVM_INSERTITEM, then sets the texts under each subsequent column, returning the new item.

The iconIndex is the zero-based index of the icon previously inserted into the control's image list, or -1 for no icon.

Panics if no text is informed; panics on error.

func (*CollectionListViewItems) All added in v0.2.0

Returns all items.

func (*CollectionListViewItems) Count added in v0.2.0

func (me *CollectionListViewItems) Count() uint

Retrieves the number of items with LVM_GETITEMCOUNT.

func (*CollectionListViewItems) DeleteAll added in v0.2.0

func (me *CollectionListViewItems) DeleteAll()

Deletes all items at once with LVM_DELETEALLITEMS.

func (*CollectionListViewItems) DeleteSelected added in v0.2.0

func (me *CollectionListViewItems) DeleteSelected()

Deletes all selected items at once by searching them with LVM_GETNEXTITEM, then calling LVM_DELETEITEM.

Panics on error.

func (*CollectionListViewItems) Find added in v0.2.0

func (me *CollectionListViewItems) Find(text string) (ListViewItem, bool)

Calls LVM_FINDITEM to search for the first item with the given exact text, case-insensitive.

func (*CollectionListViewItems) Focused added in v0.2.0

func (me *CollectionListViewItems) Focused() (ListViewItem, bool)

Retrieves the focused item with LVM_GETNEXTITEM, if any.

func (*CollectionListViewItems) Get added in v0.2.0

func (me *CollectionListViewItems) Get(index int) ListViewItem

Returns the item at the given index.

func (*CollectionListViewItems) GetByUid added in v0.2.0

func (me *CollectionListViewItems) GetByUid(uid int) ListViewItem

Calls LVM_MAPIDTOINDEX to return the item associated to the unique ID.

func (*CollectionListViewItems) HitTest added in v0.2.0

func (me *CollectionListViewItems) HitTest(pos win.POINT) (ListViewItem, bool)

Retrieves the item below the given coordinates with LVM_HITTEST, if any.

The coordinates must be relative to the ListView.

func (*CollectionListViewItems) Last added in v0.2.0

Returns the last item.

func (*CollectionListViewItems) SelectAll added in v0.2.0

func (me *CollectionListViewItems) SelectAll(doSelect bool)

Selects or deselects all items at once with LVM_SETITEMSTATE.

Panics on error.

func (*CollectionListViewItems) Selected added in v0.2.0

func (me *CollectionListViewItems) Selected() []ListViewItem

Returns the selected items with LVM_GETNEXTITEM.

func (*CollectionListViewItems) SelectedCount added in v0.2.0

func (me *CollectionListViewItems) SelectedCount() uint

Retrieves the number of selected items with LVM_GETSELECTEDCOUNT.

func (*CollectionListViewItems) Sort added in v0.2.0

func (me *CollectionListViewItems) Sort(fun func(a, b ListViewItem) int)

Sorts the items according to the callback with LVM_SORTITEMSEX.

Example

var lv ui.ListView // initialized somewhere

lv.Items.Sort(func(itemA, itemB ui.ListViewItem) int {
	return win.Str.Cmp(itemA.Text(0), itemB.Text(0))
})

func (*CollectionListViewItems) TopmostVisible added in v0.2.0

func (me *CollectionListViewItems) TopmostVisible() (ListViewItem, bool)

Retrieves the topmost visible item with LVM_GETTOPINDEX, if any.

type CollectionStatusBarParts added in v0.2.0

type CollectionStatusBarParts struct {
	// contains filtered or unexported fields
}

The parts collection.

You cannot create this object directly, it will be created automatically by the owning StatusBar.

func (*CollectionStatusBarParts) AddFixed added in v0.2.0

func (me *CollectionStatusBarParts) AddFixed(text string, width int)

Adds a fixed part.

Panics if width is zero.

Example

var sbar ui.StatusBar // initialized somewhere

sbar.Parts.AddFixed("Text", ui.DpiX(200))

func (*CollectionStatusBarParts) AddResizable added in v0.2.0

func (me *CollectionStatusBarParts) AddResizable(text string, resizeWeight uint)

Adds a resizable part.

How resizeWeight works:

  • Suppose you have 3 parts, respectively with weights of 1, 1 and 2.
  • If available client area is 400px, respective part widths will be 100, 100 and 200px.

Panics if resizeWeight is zero.

Example

var sbar ui.StatusBar // initialized somewhere

sbar.Parts.AddResizable("Text", 1)

func (*CollectionStatusBarParts) All added in v0.2.0

Returns all parts.

func (*CollectionStatusBarParts) Count added in v0.2.0

func (me *CollectionStatusBarParts) Count() uint

Returns the number of parts.

func (*CollectionStatusBarParts) Get added in v0.2.0

Returns the part at the given index.

func (*CollectionStatusBarParts) Last added in v0.2.0

Returns the last part.

type CollectionTabItems added in v0.2.0

type CollectionTabItems struct {
	// contains filtered or unexported fields
}

The items collection.

You cannot create this object directly, it will be created automatically by the owning Tab.

func (*CollectionTabItems) Count added in v0.2.0

func (me *CollectionTabItems) Count() uint

Retrieves the number of items with TCM_GETITEMCOUNT.

Panics on error.

func (*CollectionTabItems) Focused added in v0.2.0

func (me *CollectionTabItems) Focused() (TabItem, bool)

Retrieves the focused item with TCM_GETCURFOCUS, if any

func (*CollectionTabItems) Get added in v0.2.0

func (me *CollectionTabItems) Get(index int) TabItem

Returns the item at the given index.

func (*CollectionTabItems) Selected added in v0.2.0

func (me *CollectionTabItems) Selected() (TabItem, bool)

Retrieves the selected item with TCM_GETCURSEL, if any

type CollectionToolbarButtons added in v0.2.0

type CollectionToolbarButtons struct {
	// contains filtered or unexported fields
}

The buttons collection

You cannot create this object directly, it will be created automatically by the owning Toolbar.

func (*CollectionToolbarButtons) Add added in v0.2.0

func (me *CollectionToolbarButtons) Add(cmdId uint16, text string, iconIndex int)

Adds a new button with TB_ADDBUTTONS.

The iconIndex is the zero-based index of the icon previously inserted into the control's image list.

func (*CollectionToolbarButtons) Count added in v0.2.0

func (me *CollectionToolbarButtons) Count() uint

Retrieves the number of buttons with TB_BUTTONCOUNT.

type CollectionTreeViewItems added in v0.2.0

type CollectionTreeViewItems struct {
	// contains filtered or unexported fields
}

The items collection.

You cannot create this object directly, it will be created automatically by the owning TreeView.

func (*CollectionTreeViewItems) AddRoot added in v0.2.0

func (me *CollectionTreeViewItems) AddRoot(text string, iconIndex int) TreeViewItem

Adds a new root item with TVM_INSERTITEM, returning the new item.

The iconIndex is the zero-based index of the icon previously inserted into the control's image list, or -1 for no icon.

func (*CollectionTreeViewItems) Count added in v0.2.0

func (me *CollectionTreeViewItems) Count() int

Retrieves the total number of items in the control, with TVM_GETCOUNT.

func (*CollectionTreeViewItems) DeleteAll added in v0.2.0

func (me *CollectionTreeViewItems) DeleteAll()

Deletes all items at once with TVM_DELETEITEM.

Panics on error.

func (*CollectionTreeViewItems) FirstVisible added in v0.2.0

func (me *CollectionTreeViewItems) FirstVisible() (TreeViewItem, bool)

Retrieves the first visible item, if any, with TVM_GETNEXTITEM.

func (*CollectionTreeViewItems) Get added in v0.2.0

Returns the item with the given handle.

func (*CollectionTreeViewItems) Roots added in v0.2.0

func (me *CollectionTreeViewItems) Roots() []TreeViewItem

Returns the root items with TVM_GETNEXTITEM.

func (*CollectionTreeViewItems) Selected added in v0.2.0

func (me *CollectionTreeViewItems) Selected() (TreeViewItem, bool)

Retrieves the selected item, if any, with TVM_GETNEXTITEM.

type ComboBox

type ComboBox struct {
	Items CollectionComboBoxItems // Methods to interact with the items collection.
	// contains filtered or unexported fields
}

Native combo box control.

func NewComboBox

func NewComboBox(parent Parent, opts *VarOptsComboBox) *ComboBox

Creates a new ComboBox with win.CreateWindowEx.

Example

var wndOwner ui.Parent // initialized somewhere

cmb := ui.NewComboBox(
	wndOwner,
	ui.OptsComboBox().
		Position(ui.Dpi(20, 92)).
		Texts("Avocado", "Banana", "Pineapple").
		Selected(2),
)

func NewComboBoxDlg

func NewComboBoxDlg(parent Parent, ctrlId uint16, layout LAY) *ComboBox

Instantiates a new ComboBox to be loaded from a dialog resource with win.HWND.GetDlgItem.

Example

const ID_CMB uint16 = 0x100

var wndOwner ui.Parent // initialized somewhere

cmb := ui.NewComboBoxDlg(
	wndOwner, ID_CMB, ui.LAY_NONE_NONE)

func (*ComboBox) CtrlId added in v0.2.0

func (me *ComboBox) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*ComboBox) Focus added in v0.2.0

func (me *ComboBox) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*ComboBox) Hwnd added in v0.2.0

func (me *ComboBox) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*ComboBox) On

func (me *ComboBox) On() *EventsComboBox

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*ComboBox) OnSubclass added in v0.2.0

func (me *ComboBox) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*ComboBox) Text added in v0.2.0

func (me *ComboBox) Text() string

Returns the text currently on display.

type Control added in v0.2.0

type Control struct {
	// contains filtered or unexported fields
}

Custom control.

Implements:

func NewControl added in v0.2.0

func NewControl(parent Parent, opts *VarOptsControl) *Control

Creates a new custom control with CreateWindowEx.

func NewControlDlg added in v0.2.0

func NewControlDlg(parent Parent, opts *VarOptsControlDlg) *Control

Creates a new dialog-based custom control with CreateDialogParam.

func (*Control) CtrlId added in v0.2.0

func (me *Control) CtrlId() uint16

Returns the control ID, unique within the same Parent.

Implements ChildControl.

func (*Control) Focus added in v0.2.0

func (me *Control) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons. Otherwise, calls SetFocus.

Implements ChildControl.

func (*Control) Hwnd added in v0.2.0

func (me *Control) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Implements Window.

Note that this handle is initially zero, existing only after window creation.

func (*Control) On added in v0.2.0

func (me *Control) On() *EventsWindow

Exposes all the window notifications the can be handled.

Implements Parent.

Panics if called after the window has been created.

func (*Control) Parent added in v0.2.0

func (me *Control) Parent() Parent

Returns the parent container of this control.

func (*Control) UiThread added in v0.2.0

func (me *Control) UiThread(fun func())

This method is analog to SendMessage (synchronous), but intended to be called from another thread, so a callback function can, tunelled by WNDPROC, run in the original thread of the window, thus allowing GUI updates. With this, the user doesn't have to deal with a custom WM_ message.

Implements Parent.

Example

var wnd *ui.WindowModal // initialized somewhere

wnd.On().WmCreate(func(p WmCreate) int {
	go func() {
		// process to be done in a parallel goroutine...

		wnd.UiThread(func() {
			// update the UI in the original UI thread...
		})
	}()
	return 0
})

type DateTimePicker

type DateTimePicker struct {
	// contains filtered or unexported fields
}

Native date and time picker control.

func NewDateTimePicker

func NewDateTimePicker(parent Parent, opts *VarOptsDateTimePicker) *DateTimePicker

Creates a new DateTimePicker with win.CreateWindowEx.

Example

var wndOwner ui.Parent // initialized somewhere

dtp := ui.NewDateTimePicker(
	wndOwner,
	ui.OptsDateTimePicker().
		Position(ui.Dpi(210, 20)).
		Value(time.Date(1981, 4, 26, 5, 0, 0, 0, time.Local)),
)

func NewDateTimePickerDlg

func NewDateTimePickerDlg(parent Parent, ctrlId uint16, layout LAY) *DateTimePicker

Instantiates a new DateTimePicker to be loaded from a dialog resource with win.HWND.GetDlgItem.

Example

const ID_DTP uint16 = 0x100

var wndOwner ui.Parent // initialized somewhere

dtp := ui.NewDateTimePickerDlg(
	wndOwner, ID_DTP, ui.LAY_NONE_NONE)

func (*DateTimePicker) CtrlId added in v0.2.0

func (me *DateTimePicker) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*DateTimePicker) Focus added in v0.2.0

func (me *DateTimePicker) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*DateTimePicker) Hwnd added in v0.2.0

func (me *DateTimePicker) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*DateTimePicker) On

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*DateTimePicker) OnSubclass added in v0.2.0

func (me *DateTimePicker) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*DateTimePicker) SetTime

func (me *DateTimePicker) SetTime(newTime time.Time) *DateTimePicker

Calls DTM_SETSYSTEMTIME.

Returns the same object, so further operations can be chained.

func (*DateTimePicker) Time

func (me *DateTimePicker) Time() time.Time

Calls DTM_GETSYSTEMTIME.

Panics on error.

type Edit

type Edit struct {
	// contains filtered or unexported fields
}

Native edit (text box) control.

func NewEdit

func NewEdit(parent Parent, opts *VarOptsEdit) *Edit

Creates a new Edit with win.CreateWindowEx.

Example

var wndOwner ui.Parent // initialized somewhere

myEdit := ui.NewEdit(
	wndOwner,
	ui.OptsEdit().
		Position(ui.Dpi(20, 10)),
)

func NewEditDlg

func NewEditDlg(parent Parent, ctrlId uint16, layout LAY) *Edit

Instantiates a new Edit to be loaded from a dialog resource with win.HWND.GetDlgItem.

Example

const ID_TXT uint16 = 0x100

var wndOwner ui.Parent // initialized somewhere

txt := ui.NewEditDlg(
	wndOwner, ID_TXT, ui.LAY_NONE_NONE)

func (*Edit) CtrlId added in v0.2.0

func (me *Edit) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*Edit) Focus added in v0.2.0

func (me *Edit) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*Edit) HideBalloonTip

func (me *Edit) HideBalloonTip() *Edit

Calls EM_HIDEBALLOONTIP.

Returns the same object, so further operations can be chained.

func (*Edit) Hwnd added in v0.2.0

func (me *Edit) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*Edit) LimitText

func (me *Edit) LimitText(maxChars uint) *Edit

Calls EM_SETLIMITTEXT.

Returns the same object, so further operations can be chained.

func (*Edit) On

func (me *Edit) On() *EventsEdit

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*Edit) OnSubclass added in v0.2.0

func (me *Edit) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*Edit) SetSelection added in v0.2.0

func (me *Edit) SetSelection(startPos, endPos int) *Edit

Calls EM_SETSEL.

If the start is 0 and the end is -1, all the text in the edit control is selected. If the start is -1, any current selection is deselected.

Returns the same object, so further operations can be chained.

func (*Edit) SetText added in v0.2.0

func (me *Edit) SetText(text string) *Edit

Calls win.HWND.SetWindowText.

Returns the same object, so further operations can be chained.

func (*Edit) ShowBalloonTip

func (me *Edit) ShowBalloonTip(title, text string, icon co.TTI) *Edit

Calls EM_SHOWBALLOONTIP.

Returns the same object, so further operations can be chained.

func (*Edit) Text added in v0.2.0

func (me *Edit) Text() string

Calls win.HWND.GetWindowText.

type EventsButton added in v0.2.0

type EventsButton struct {
	// contains filtered or unexported fields
}

Native button control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsButton) BcnDropDown added in v0.2.0

func (me *EventsButton) BcnDropDown(fun func(p *win.NMBCDROPDOWN))

BCN_DROPDOWN message handler.

func (*EventsButton) BcnHotItemChange added in v0.2.0

func (me *EventsButton) BcnHotItemChange(fun func(p *win.NMBCHOTITEM))

BCN_HOTITEMCHANGE message handler.

func (*EventsButton) BnClicked added in v0.2.0

func (me *EventsButton) BnClicked(fun func())

BN_CLICKED message handler.

func (*EventsButton) BnDblClk added in v0.2.0

func (me *EventsButton) BnDblClk(fun func())

BN_DBLCLK message handler.

func (*EventsButton) BnKillFocus added in v0.2.0

func (me *EventsButton) BnKillFocus(fun func())

BN_KILLFOCUS message handler.

func (*EventsButton) BnSetFocus added in v0.2.0

func (me *EventsButton) BnSetFocus(fun func())

BN_SETFOCUS message handler.

func (*EventsButton) NmCustomDraw added in v0.2.0

func (me *EventsButton) NmCustomDraw(fun func(p *win.NMCUSTOMDRAW) co.CDRF)

NM_CUSTOMDRAW message handler.

type EventsComboBox added in v0.2.0

type EventsComboBox struct {
	// contains filtered or unexported fields
}

Native combo box control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsComboBox) CbnCloseUp added in v0.2.0

func (me *EventsComboBox) CbnCloseUp(fun func())

CBN_CLOSEUP message handler.

func (*EventsComboBox) CbnDblClk added in v0.2.0

func (me *EventsComboBox) CbnDblClk(fun func())

CBN_DBLCLK message handler.

func (*EventsComboBox) CbnDropDown added in v0.2.0

func (me *EventsComboBox) CbnDropDown(fun func())

CBN_DROPDOWN message handler.

func (*EventsComboBox) CbnEditChange added in v0.2.0

func (me *EventsComboBox) CbnEditChange(fun func())

CBN_EDITCHANGE message handler.

func (*EventsComboBox) CbnEditUpdate added in v0.2.0

func (me *EventsComboBox) CbnEditUpdate(fun func())

CBN_EDITUPDATE message handler.

func (*EventsComboBox) CbnErrSpace added in v0.2.0

func (me *EventsComboBox) CbnErrSpace(fun func())

CBN_ERRSPACE message handler.

func (*EventsComboBox) CbnKillFocus added in v0.2.0

func (me *EventsComboBox) CbnKillFocus(fun func())

CBN_KILLFOCUS message handler.

func (*EventsComboBox) CbnSelChange added in v0.2.0

func (me *EventsComboBox) CbnSelChange(fun func())

CBN_SELCHANGE message handler.

func (*EventsComboBox) CbnSelEndCancel added in v0.2.0

func (me *EventsComboBox) CbnSelEndCancel(fun func())

CBN_SELENDCANCEL message handler.

func (*EventsComboBox) CbnSelEndOk added in v0.2.0

func (me *EventsComboBox) CbnSelEndOk(fun func())

CBN_SELENDOK message handler.

func (*EventsComboBox) CbnSetFocus added in v0.2.0

func (me *EventsComboBox) CbnSetFocus(fun func())

CBN_SETFOCUS message handler.

type EventsDateTimePicker added in v0.2.0

type EventsDateTimePicker struct {
	// contains filtered or unexported fields
}

Native date and time picker control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsDateTimePicker) DtnCloseUp added in v0.2.0

func (me *EventsDateTimePicker) DtnCloseUp(fun func())

DTN_CLOSEUP message handler.

func (*EventsDateTimePicker) DtnDateTimeChange added in v0.2.0

func (me *EventsDateTimePicker) DtnDateTimeChange(fun func(p *win.NMDATETIMECHANGE))

DTN_DATETIMECHANGE message handler.

func (*EventsDateTimePicker) DtnDropDown added in v0.2.0

func (me *EventsDateTimePicker) DtnDropDown(fun func())

DTN_DROPDOWN message handler.

func (*EventsDateTimePicker) DtnFormat added in v0.2.0

func (me *EventsDateTimePicker) DtnFormat(fun func(p *win.NMDATETIMEFORMAT))

DTN_FORMAT message handler.

func (*EventsDateTimePicker) DtnFormatQuery added in v0.2.0

func (me *EventsDateTimePicker) DtnFormatQuery(fun func(p *win.NMDATETIMEFORMATQUERY))

DTN_FORMATQUERY message handler.

func (*EventsDateTimePicker) DtnUserString added in v0.2.0

func (me *EventsDateTimePicker) DtnUserString(fun func(p *win.NMDATETIMESTRING))

DTN_USERSTRING message handler.

func (*EventsDateTimePicker) DtnWmKeyDown added in v0.2.0

func (me *EventsDateTimePicker) DtnWmKeyDown(fun func(p *win.NMDATETIMEWMKEYDOWN))

DTN_WMKEYDOWN message handler.

func (*EventsDateTimePicker) NmKillFocus added in v0.2.0

func (me *EventsDateTimePicker) NmKillFocus(fun func())

NM_KILLFOCUS message handler.

func (*EventsDateTimePicker) NmSetFocus added in v0.2.0

func (me *EventsDateTimePicker) NmSetFocus(fun func())

NM_SETFOCUS message handler.

type EventsEdit added in v0.2.0

type EventsEdit struct {
	// contains filtered or unexported fields
}

Native edit (text box) control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsEdit) EnAlignLtrEc added in v0.2.0

func (me *EventsEdit) EnAlignLtrEc(fun func())

EN_ALIGN_LTR_EC message handler.

func (*EventsEdit) EnAlignRtlEc added in v0.2.0

func (me *EventsEdit) EnAlignRtlEc(fun func())

EN_ALIGN_RTL_EC message handler.

func (*EventsEdit) EnChange added in v0.2.0

func (me *EventsEdit) EnChange(fun func())

EN_CHANGE message handler.

func (*EventsEdit) EnErrSpace added in v0.2.0

func (me *EventsEdit) EnErrSpace(fun func())

EN_ERRSPACE message handler.

func (*EventsEdit) EnHScroll added in v0.2.0

func (me *EventsEdit) EnHScroll(fun func())

EN_HSCROLL message handler.

func (*EventsEdit) EnKillFocus added in v0.2.0

func (me *EventsEdit) EnKillFocus(fun func())

EN_KILLFOCUS message handler.

func (*EventsEdit) EnMaxText added in v0.2.0

func (me *EventsEdit) EnMaxText(fun func())

EN_MAXTEXT message handler.

func (*EventsEdit) EnSetFocus added in v0.2.0

func (me *EventsEdit) EnSetFocus(fun func())

EN_SETFOCUS message handler.

func (*EventsEdit) EnUpdate added in v0.2.0

func (me *EventsEdit) EnUpdate(fun func())

EN_UPDATE message handler.

func (*EventsEdit) EnVScroll added in v0.2.0

func (me *EventsEdit) EnVScroll(fun func())

EN_VSCROLL message handler.

type EventsHeader added in v0.2.0

type EventsHeader struct {
	// contains filtered or unexported fields
}

Native header control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsHeader) HdnBeginDrag added in v0.2.0

func (me *EventsHeader) HdnBeginDrag(fun func(p *win.NMHEADER) bool)

HDN_BEGINDRAG message handler.

func (*EventsHeader) HdnBeginFilterEdit added in v0.2.0

func (me *EventsHeader) HdnBeginFilterEdit(fun func(p *win.NMHEADER))

HDN_BEGINFILTEREDIT message handler.

func (*EventsHeader) HdnBeginTrack added in v0.2.0

func (me *EventsHeader) HdnBeginTrack(fun func(p *win.NMHEADER) bool)

HDN_BEGINTRACK message handler.

func (*EventsHeader) HdnDividerDblClick added in v0.2.0

func (me *EventsHeader) HdnDividerDblClick(fun func(p *win.NMHEADER))

HDN_DIVIDERDBLCLICK message handler.

func (*EventsHeader) HdnDropDown added in v0.2.0

func (me *EventsHeader) HdnDropDown(fun func(p *win.NMHEADER))

HDN_DROPDOWN message handler.

func (*EventsHeader) HdnEndDrag added in v0.2.0

func (me *EventsHeader) HdnEndDrag(fun func(p *win.NMHEADER) bool)

HDN_ENDDRAG message handler.

func (*EventsHeader) HdnEndFilterEdit added in v0.2.0

func (me *EventsHeader) HdnEndFilterEdit(fun func(p *win.NMHEADER))

HDN_ENDFILTEREDIT message handler.

func (*EventsHeader) HdnEndTrack added in v0.2.0

func (me *EventsHeader) HdnEndTrack(fun func(p *win.NMHEADER))

HDN_ENDTRACK message handler.

func (*EventsHeader) HdnFilterBtnClick added in v0.2.0

func (me *EventsHeader) HdnFilterBtnClick(fun func(p *win.NMHDFILTERBTNCLICK) bool)

HDN_FILTERBTNCLICK message handler.

func (*EventsHeader) HdnFilterChange added in v0.2.0

func (me *EventsHeader) HdnFilterChange(fun func(p *win.NMHEADER))

HDN_FILTERCHANGE message handler.

func (*EventsHeader) HdnGetDispInfo added in v0.2.0

func (me *EventsHeader) HdnGetDispInfo(fun func(p *win.NMHDDISPINFO) uintptr)

HDN_GETDISPINFO message handler.

func (*EventsHeader) HdnItemChanged added in v0.2.0

func (me *EventsHeader) HdnItemChanged(fun func(p *win.NMHEADER))

HDN_ITEMCHANGED message handler.

func (*EventsHeader) HdnItemChanging added in v0.2.0

func (me *EventsHeader) HdnItemChanging(fun func(p *win.NMHEADER) bool)

HDN_ITEMCHANGING message handler.

func (*EventsHeader) HdnItemClick added in v0.2.0

func (me *EventsHeader) HdnItemClick(fun func(p *win.NMHEADER))

HDN_ITEMCLICK message handler.

func (*EventsHeader) HdnItemDblClick added in v0.2.0

func (me *EventsHeader) HdnItemDblClick(fun func(p *win.NMHEADER))

HDN_ITEMDBLCLICK message handler.

func (*EventsHeader) HdnItemKeyDown added in v0.2.0

func (me *EventsHeader) HdnItemKeyDown(fun func(p *win.NMHEADER))

HDN_ITEMKEYDOWN message handler.

func (*EventsHeader) HdnItemStateIconClick added in v0.2.0

func (me *EventsHeader) HdnItemStateIconClick(fun func(p *win.NMHEADER))

HDN_ITEMSTATEICONCLICK message handler.

func (*EventsHeader) HdnOverflowClick added in v0.2.0

func (me *EventsHeader) HdnOverflowClick(fun func(p *win.NMHEADER))

HDN_OVERFLOWCLICK message handler.

func (*EventsHeader) HdnTrack added in v0.2.0

func (me *EventsHeader) HdnTrack(fun func(p *win.NMHEADER) bool)

HDN_TRACK message handler.

func (*EventsHeader) NmCustomDraw added in v0.2.0

func (me *EventsHeader) NmCustomDraw(fun func(p *win.NMCUSTOMDRAW) co.CDRF)

NM_CUSTOMDRAW message handler.

func (*EventsHeader) NmRClick added in v0.2.0

func (me *EventsHeader) NmRClick(fun func())

NM_RCLICK message handler.

func (*EventsHeader) NmReleasedCapture added in v0.2.0

func (me *EventsHeader) NmReleasedCapture(fun func())

NM_RELEASEDCAPTURE message handler.

type EventsListView added in v0.2.0

type EventsListView struct {
	// contains filtered or unexported fields
}

Native list view control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsListView) LvnBeginDrag added in v0.2.0

func (me *EventsListView) LvnBeginDrag(fun func(p *win.NMLISTVIEW))

LVN_BEGINDRAG message handler.

func (*EventsListView) LvnBeginLabelEdit added in v0.2.0

func (me *EventsListView) LvnBeginLabelEdit(fun func(p *win.NMLVDISPINFO) bool)

LVN_BEGINLABELEDIT message handler.

func (*EventsListView) LvnBeginRDrag added in v0.2.0

func (me *EventsListView) LvnBeginRDrag(fun func(p *win.NMLISTVIEW))

LVN_BEGINRDRAG message handler.

func (*EventsListView) LvnBeginScroll added in v0.2.0

func (me *EventsListView) LvnBeginScroll(fun func(p *win.NMLVSCROLL))

LVN_BEGINSCROLL message handler.

func (*EventsListView) LvnColumnClick added in v0.2.0

func (me *EventsListView) LvnColumnClick(fun func(p *win.NMLISTVIEW))

LVN_COLUMNCLICK message handler.

func (*EventsListView) LvnColumnDropDown added in v0.2.0

func (me *EventsListView) LvnColumnDropDown(fun func(p *win.NMLISTVIEW))

LVN_COLUMNDROPDOWN message handler.

func (*EventsListView) LvnColumnOverflowClick added in v0.2.0

func (me *EventsListView) LvnColumnOverflowClick(fun func(p *win.NMLISTVIEW))

LVN_COLUMNOVERFLOWCLICK message handler.

func (*EventsListView) LvnDeleteAllItems added in v0.2.0

func (me *EventsListView) LvnDeleteAllItems(fun func(p *win.NMLISTVIEW))

LVN_DELETEALLITEMS message handler.

func (*EventsListView) LvnDeleteItem added in v0.2.0

func (me *EventsListView) LvnDeleteItem(fun func(p *win.NMLISTVIEW))

LVN_DELETEITEM message handler.

func (*EventsListView) LvnEndLabelEdit added in v0.2.0

func (me *EventsListView) LvnEndLabelEdit(fun func(p *win.NMLVDISPINFO) bool)

LVN_ENDLABELEDIT message handler.

func (*EventsListView) LvnEndScroll added in v0.2.0

func (me *EventsListView) LvnEndScroll(fun func(p *win.NMLVSCROLL))

LVN_ENDSCROLL message handler.

func (*EventsListView) LvnGetDispInfo added in v0.2.0

func (me *EventsListView) LvnGetDispInfo(fun func(p *win.NMLVDISPINFO))

LVN_GETDISPINFO message handler.

func (*EventsListView) LvnGetEmptyMarkup added in v0.2.0

func (me *EventsListView) LvnGetEmptyMarkup(fun func(p *win.NMLVEMPTYMARKUP) bool)

LVN_GETEMPTYMARKUP message handler.

func (*EventsListView) LvnGetInfoTip added in v0.2.0

func (me *EventsListView) LvnGetInfoTip(fun func(p *win.NMLVGETINFOTIP))

LVN_GETINFOTIP message handler.

func (*EventsListView) LvnHotTrack added in v0.2.0

func (me *EventsListView) LvnHotTrack(fun func(p *win.NMLISTVIEW) int)

LVN_HOTTRACK message handler.

func (*EventsListView) LvnIncrementalSearch added in v0.2.0

func (me *EventsListView) LvnIncrementalSearch(fun func(p *win.NMLVFINDITEM) int)

LVN_INCREMENTALSEARCH message handler.

func (*EventsListView) LvnInsertItem added in v0.2.0

func (me *EventsListView) LvnInsertItem(fun func(p *win.NMLISTVIEW))

LVN_INSERTITEM message handler.

func (*EventsListView) LvnItemActivate added in v0.2.0

func (me *EventsListView) LvnItemActivate(fun func(p *win.NMITEMACTIVATE))

LVN_ITEMACTIVATE message handler.

func (*EventsListView) LvnItemChanged added in v0.2.0

func (me *EventsListView) LvnItemChanged(fun func(p *win.NMLISTVIEW))

LVN_ITEMCHANGED message handler.

func (*EventsListView) LvnItemChanging added in v0.2.0

func (me *EventsListView) LvnItemChanging(fun func(p *win.NMLISTVIEW) bool)

LVN_ITEMCHANGING message handler.

func (*EventsListView) LvnKeyDown added in v0.2.0

func (me *EventsListView) LvnKeyDown(fun func(p *win.NMLVKEYDOWN))

LVN_KEYDOWN message handler.

func (*EventsListView) LvnLinkClick added in v0.2.0

func (me *EventsListView) LvnLinkClick(fun func(p *win.NMLVLINK))

LVN_LINKCLICK message handler.

func (*EventsListView) LvnMarqueeBegin added in v0.2.0

func (me *EventsListView) LvnMarqueeBegin(fun func() uint)

LVN_MARQUEEBEGIN message handler.

func (*EventsListView) LvnODCacheHint added in v0.2.0

func (me *EventsListView) LvnODCacheHint(fun func(p *win.NMLVCACHEHINT))

LVN_ODCACHEHINT message handler.

func (*EventsListView) LvnODFindItem added in v0.2.0

func (me *EventsListView) LvnODFindItem(fun func(p *win.NMLVFINDITEM) int)

LVN_ODFINDITEM message handler.

func (*EventsListView) LvnODStateChanged added in v0.2.0

func (me *EventsListView) LvnODStateChanged(fun func(p *win.NMLVODSTATECHANGE))

LVN_ODSTATECHANGED message handler.

func (*EventsListView) LvnSetDispInfo added in v0.2.0

func (me *EventsListView) LvnSetDispInfo(fun func(p *win.NMLVDISPINFO))

LVN_SETDISPINFO message handler.

func (*EventsListView) NmClick added in v0.2.0

func (me *EventsListView) NmClick(fun func(p *win.NMITEMACTIVATE))

NM_CLICK message handler.

func (*EventsListView) NmCustomDraw added in v0.2.0

func (me *EventsListView) NmCustomDraw(fun func(p *win.NMLVCUSTOMDRAW) co.CDRF)

NM_CUSTOMDRAW message handler.

func (*EventsListView) NmDblClk added in v0.2.0

func (me *EventsListView) NmDblClk(fun func(p *win.NMITEMACTIVATE))

NM_DBLCLK message handler.

func (*EventsListView) NmHover added in v0.2.0

func (me *EventsListView) NmHover(fun func() uint)

NM_HOVER message handler.

func (*EventsListView) NmKillFocus added in v0.2.0

func (me *EventsListView) NmKillFocus(fun func())

NM_KILLFOCUS message handler.

func (*EventsListView) NmRClick added in v0.2.0

func (me *EventsListView) NmRClick(fun func(p *win.NMITEMACTIVATE))

NM_RCLICK message handler.

func (*EventsListView) NmRDblClk added in v0.2.0

func (me *EventsListView) NmRDblClk(fun func(p *win.NMITEMACTIVATE))

NM_RDBLCLK message handler.

func (*EventsListView) NmReleasedCapture added in v0.2.0

func (me *EventsListView) NmReleasedCapture(fun func())

NM_RELEASEDCAPTURE message handler.

func (*EventsListView) NmReturn added in v0.2.0

func (me *EventsListView) NmReturn(fun func())

NM_RETURN message handler.

func (*EventsListView) NmSetFocus added in v0.2.0

func (me *EventsListView) NmSetFocus(fun func())

NM_SETFOCUS message handler.

type EventsMonthCalendar added in v0.2.0

type EventsMonthCalendar struct {
	// contains filtered or unexported fields
}

Native month calendar control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsMonthCalendar) McnGetDayState added in v0.2.0

func (me *EventsMonthCalendar) McnGetDayState(fun func(p *win.NMDAYSTATE))

MCN_GETDAYSTATE message handler.

func (*EventsMonthCalendar) McnSelChange added in v0.2.0

func (me *EventsMonthCalendar) McnSelChange(fun func(p *win.NMSELCHANGE))

MCN_SELCHANGE message handler.

func (*EventsMonthCalendar) McnSelect added in v0.2.0

func (me *EventsMonthCalendar) McnSelect(fun func(p *win.NMSELCHANGE))

MCN_SELECT message handler.

func (*EventsMonthCalendar) McnViewChange added in v0.2.0

func (me *EventsMonthCalendar) McnViewChange(fun func(p *win.NMVIEWCHANGE))

MCN_VIEWCHANGE message handler.

func (*EventsMonthCalendar) NmReleasedCapture added in v0.2.0

func (me *EventsMonthCalendar) NmReleasedCapture(fun func())

NM_RELEASEDCAPTURE message handler.

type EventsRadioGroup added in v0.2.0

type EventsRadioGroup struct {
	// contains filtered or unexported fields
}

Native radio button group events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsRadioGroup) BnClicked added in v0.2.0

func (me *EventsRadioGroup) BnClicked(fun func(radio *RadioButton))

BN_CLICKED message handler.

func (*EventsRadioGroup) BnDblClk added in v0.2.0

func (me *EventsRadioGroup) BnDblClk(fun func(radio *RadioButton))

BN_DBLCLK message handler.

func (*EventsRadioGroup) BnKillFocus added in v0.2.0

func (me *EventsRadioGroup) BnKillFocus(fun func(radio *RadioButton))

BN_KILLFOCUS message handler.

func (*EventsRadioGroup) BnSetFocus added in v0.2.0

func (me *EventsRadioGroup) BnSetFocus(fun func(radio *RadioButton))

BN_SETFOCUS message handler.

type EventsStatic added in v0.2.0

type EventsStatic struct {
	// contains filtered or unexported fields
}

Native static (label) control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsStatic) StnClicked added in v0.2.0

func (me *EventsStatic) StnClicked(fun func())

STN_CLICKED message handler.

func (*EventsStatic) StnDblClk added in v0.2.0

func (me *EventsStatic) StnDblClk(fun func())

STN_DBLCLK message handler.

func (*EventsStatic) StnDisable added in v0.2.0

func (me *EventsStatic) StnDisable(fun func())

STN_DISABLE message handler.

func (*EventsStatic) StnEnable added in v0.2.0

func (me *EventsStatic) StnEnable(fun func())

STN_ENABLE message handler.

type EventsStatusBar added in v0.2.0

type EventsStatusBar struct {
	// contains filtered or unexported fields
}

Native status bar control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsStatusBar) NmClick added in v0.2.0

func (me *EventsStatusBar) NmClick(fun func(p *win.NMMOUSE) bool)

NM_CLICK message handler.

func (*EventsStatusBar) NmDblClk added in v0.2.0

func (me *EventsStatusBar) NmDblClk(fun func(p *win.NMMOUSE) bool)

NM_DBLCLK message handler.

func (*EventsStatusBar) NmRClick added in v0.2.0

func (me *EventsStatusBar) NmRClick(fun func(p *win.NMMOUSE) bool)

NM_RCLICK message handler.

func (*EventsStatusBar) NmRDblClk added in v0.2.0

func (me *EventsStatusBar) NmRDblClk(fun func(p *win.NMMOUSE) bool)

NM_RDBLCLK message handler.

func (*EventsStatusBar) SbnSimpleModeChange added in v0.2.0

func (me *EventsStatusBar) SbnSimpleModeChange(fun func(p *win.NMMOUSE))

SBN_SIMPLEMODECHANGE message handler.

type EventsSysLink struct {
	// contains filtered or unexported fields
}

Native syslink control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsSysLink) NmClick added in v0.2.0

func (me *EventsSysLink) NmClick(fun func(p *win.NMLINK))

NM_CLICK message handler.

type EventsTab added in v0.2.0

type EventsTab struct {
	// contains filtered or unexported fields
}

Native tab control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsTab) NmClick added in v0.2.0

func (me *EventsTab) NmClick(fun func())

NM_CLICK message handler.

func (*EventsTab) NmDblClk added in v0.2.0

func (me *EventsTab) NmDblClk(fun func())

NM_DBLCLK message handler.

func (*EventsTab) NmRClick added in v0.2.0

func (me *EventsTab) NmRClick(fun func())

NM_RCLICK message handler.

func (*EventsTab) NmRDblClk added in v0.2.0

func (me *EventsTab) NmRDblClk(fun func())

NM_RDBLCLK message handler.

func (*EventsTab) NmReleasedCapture added in v0.2.0

func (me *EventsTab) NmReleasedCapture(fun func())

NM_RELEASEDCAPTURE message handler.

func (*EventsTab) TcnFocusChange added in v0.2.0

func (me *EventsTab) TcnFocusChange(fun func())

TCN_FOCUSCHANGE message handler.

func (*EventsTab) TcnGetObject added in v0.2.0

func (me *EventsTab) TcnGetObject(fun func(p *win.NMOBJECTNOTIFY))

TCN_GETOBJECT message handler.

func (*EventsTab) TcnKeyDown added in v0.2.0

func (me *EventsTab) TcnKeyDown(fun func(p *win.NMTCKEYDOWN))

TCN_KEYDOWN message handler.

func (*EventsTab) TcnSelChange added in v0.2.0

func (me *EventsTab) TcnSelChange(fun func())

TCN_SELCHANGE message handler.

func (*EventsTab) TcnSelChanging added in v0.2.0

func (me *EventsTab) TcnSelChanging(fun func() bool)

TCN_SELCHANGING message handler.

type EventsToolbar added in v0.2.0

type EventsToolbar struct {
	// contains filtered or unexported fields
}

Native toolbar control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsToolbar) NmChar added in v0.2.0

func (me *EventsToolbar) NmChar(fun func(p *win.NMCHAR) bool)

NM_CHAR message handler.

func (*EventsToolbar) NmClick added in v0.2.0

func (me *EventsToolbar) NmClick(fun func(p *win.NMMOUSE) bool)

NM_CLICK message handler.

func (*EventsToolbar) NmCustomDraw added in v0.2.0

func (me *EventsToolbar) NmCustomDraw(fun func(p *win.NMTBCUSTOMDRAW) co.CDRF)

NM_CUSTOMDRAW message handler.

func (*EventsToolbar) NmDblClk added in v0.2.0

func (me *EventsToolbar) NmDblClk(fun func(p *win.NMMOUSE) bool)

NM_DBLCLK message handler.

func (*EventsToolbar) NmKeyDown added in v0.2.0

func (me *EventsToolbar) NmKeyDown(fun func(p *win.NMKEY) int)

NM_KEYDOWN message handler.

func (*EventsToolbar) NmLDown added in v0.2.0

func (me *EventsToolbar) NmLDown(fun func(p *win.NMMOUSE) bool)

NM_LDOWN message handler.

func (*EventsToolbar) NmRClick added in v0.2.0

func (me *EventsToolbar) NmRClick(fun func(p *win.NMMOUSE) bool)

NM_RCLICK message handler.

func (*EventsToolbar) NmRDblClk added in v0.2.0

func (me *EventsToolbar) NmRDblClk(fun func(p *win.NMMOUSE) bool)

NM_RDBLCLK message handler.

func (*EventsToolbar) NmReleasedCapture added in v0.2.0

func (me *EventsToolbar) NmReleasedCapture(fun func())

NM_RELEASEDCAPTURE message handler.

func (*EventsToolbar) NmTooltipsCreated added in v0.2.0

func (me *EventsToolbar) NmTooltipsCreated(fun func(p *win.NMTOOLTIPSCREATED))

NM_TOOLTIPSCREATED message handler.

func (*EventsToolbar) TbnBeginAdjust added in v0.2.0

func (me *EventsToolbar) TbnBeginAdjust(fun func())

TBN_BEGINADJUST message handler.

func (*EventsToolbar) TbnBeginDrag added in v0.2.0

func (me *EventsToolbar) TbnBeginDrag(fun func(p *win.NMTOOLBAR))

TBN_BEGINDRAG message handler.

func (*EventsToolbar) TbnCustHelp added in v0.2.0

func (me *EventsToolbar) TbnCustHelp(fun func())

TBN_CUSTHELP message handler.

func (*EventsToolbar) TbnDeletingButton added in v0.2.0

func (me *EventsToolbar) TbnDeletingButton(fun func(p *win.NMTOOLBAR))

TBN_DELETINGBUTTON message handler.

func (*EventsToolbar) TbnDragOut added in v0.2.0

func (me *EventsToolbar) TbnDragOut(fun func(p *win.NMTOOLBAR))

TBN_DRAGOUT message handler.

func (*EventsToolbar) TbnDragOver added in v0.2.0

func (me *EventsToolbar) TbnDragOver(fun func(p *win.NMTBHOTITEM) bool)

TBN_DRAGOVER message handler.

func (*EventsToolbar) TbnDropDown added in v0.2.0

func (me *EventsToolbar) TbnDropDown(fun func(p *win.NMTOOLBAR) co.TBDDRET)

TBN_DROPDOWN message handler.

func (*EventsToolbar) TbnDupAccelerator added in v0.2.0

func (me *EventsToolbar) TbnDupAccelerator(fun func(p *win.NMTBDUPACCELERATOR) bool)

TBN_DUPACCELERATOR message handler.

func (*EventsToolbar) TbnEndAdjust added in v0.2.0

func (me *EventsToolbar) TbnEndAdjust(fun func())

TBN_ENDADJUST message handler.

func (*EventsToolbar) TbnEndDrag added in v0.2.0

func (me *EventsToolbar) TbnEndDrag(fun func(p *win.NMTOOLBAR))

TBN_ENDDRAG message handler.

func (*EventsToolbar) TbnGetButtonInfo added in v0.2.0

func (me *EventsToolbar) TbnGetButtonInfo(fun func(p *win.NMTOOLBAR) bool)

TBN_GETBUTTONINFO message handler.

func (*EventsToolbar) TbnGetDispInfo added in v0.2.0

func (me *EventsToolbar) TbnGetDispInfo(fun func(p *win.NMTBDISPINFO))

TBN_GETDISPINFO message handler.

func (*EventsToolbar) TbnGetInfoTip added in v0.2.0

func (me *EventsToolbar) TbnGetInfoTip(fun func(p *win.NMTBGETINFOTIP))

TBN_GETINFOTIP message handler.

func (*EventsToolbar) TbnGetObject added in v0.2.0

func (me *EventsToolbar) TbnGetObject(fun func(p *win.NMOBJECTNOTIFY))

TBN_GETOBJECT message handler.

func (*EventsToolbar) TbnHotItemChange added in v0.2.0

func (me *EventsToolbar) TbnHotItemChange(fun func(*win.NMTBHOTITEM) int)

TBN_HOTITEMCHANGE message handler.

func (*EventsToolbar) TbnInitCustomize added in v0.2.0

func (me *EventsToolbar) TbnInitCustomize(fun func() co.TBNRF)

TBN_INITCUSTOMIZE message handler.

func (*EventsToolbar) TbnMapAccelerator added in v0.2.0

func (me *EventsToolbar) TbnMapAccelerator(fun func(p *win.NMCHAR) bool)

TBN_MAPACCELERATOR message handler.

func (*EventsToolbar) TbnQueryDelete added in v0.2.0

func (me *EventsToolbar) TbnQueryDelete(fun func(p *win.NMTOOLBAR) bool)

TBN_QUERYDELETE message handler.

func (*EventsToolbar) TbnQueryInsert added in v0.2.0

func (me *EventsToolbar) TbnQueryInsert(fun func(p *win.NMTOOLBAR) bool)

TBN_QUERYINSERT message handler.

func (*EventsToolbar) TbnReset added in v0.2.0

func (me *EventsToolbar) TbnReset(fun func() co.TBNRF)

TBN_RESET message handler.

func (*EventsToolbar) TbnRestore added in v0.2.0

func (me *EventsToolbar) TbnRestore(fun func(p *win.NMTBRESTORE) int)

TBN_RESTORE message handler.

func (*EventsToolbar) TbnSave added in v0.2.0

func (me *EventsToolbar) TbnSave(fun func(p *win.NMTBSAVE))

TBN_SAVE message handler.

func (*EventsToolbar) TbnToolbarChange added in v0.2.0

func (me *EventsToolbar) TbnToolbarChange(fun func())

TBN_TOOLBARCHANGE message handler.

func (*EventsToolbar) TbnWrapAccelerator added in v0.2.0

func (me *EventsToolbar) TbnWrapAccelerator(fun func(p *win.NMTBWRAPACCELERATOR) bool)

TBN_WRAPACCELERATOR message handler.

func (*EventsToolbar) TbnWrapHotItem added in v0.2.0

func (me *EventsToolbar) TbnWrapHotItem(fun func(p *win.NMTBWRAPHOTITEM) bool)

TBN_WRAPHOTITEM message handler.

type EventsTrackbar added in v0.2.0

type EventsTrackbar struct {
	// contains filtered or unexported fields
}

Native trackbar control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsTrackbar) NmCustomDraw added in v0.2.0

func (me *EventsTrackbar) NmCustomDraw(fun func(p *win.NMCUSTOMDRAW) co.CDRF)

NM_CUSTOMDRAW message handler.

func (*EventsTrackbar) NmReleasedCapture added in v0.2.0

func (me *EventsTrackbar) NmReleasedCapture(fun func())

NM_RELEASEDCAPTURE message handler.

func (*EventsTrackbar) ThumbPosChanging added in v0.2.0

func (me *EventsTrackbar) ThumbPosChanging(fun func(p *win.NMTRBTHUMBPOSCHANGING) bool)

TRBN_THUMBPOSCHANGING message handler.

func (*EventsTrackbar) WmHScroll added in v0.2.0

func (me *EventsTrackbar) WmHScroll(fun func(p WmScroll))

WM_HSCROLL message handler.

func (*EventsTrackbar) WmVScroll added in v0.2.0

func (me *EventsTrackbar) WmVScroll(fun func(p WmScroll))

WM_VSCROLL message handler.

type EventsTreeView added in v0.2.0

type EventsTreeView struct {
	// contains filtered or unexported fields
}

Native tree view control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsTreeView) NmClick added in v0.2.0

func (me *EventsTreeView) NmClick(fun func() int)

NM_CLICK message handler.

func (*EventsTreeView) NmCustomDraw added in v0.2.0

func (me *EventsTreeView) NmCustomDraw(fun func(p *win.NMTVCUSTOMDRAW) co.CDRF)

NM_CUSTOMDRAW message handler.

func (*EventsTreeView) NmDblClk added in v0.2.0

func (me *EventsTreeView) NmDblClk(fun func() int)

NM_DBLCLK message handler.

func (*EventsTreeView) NmKillFocus added in v0.2.0

func (me *EventsTreeView) NmKillFocus(fun func())

NM_KILLFOCUS message handler.

func (*EventsTreeView) NmRClick added in v0.2.0

func (me *EventsTreeView) NmRClick(fun func() int)

NM_RCLICK message handler.

func (*EventsTreeView) NmRDblClk added in v0.2.0

func (me *EventsTreeView) NmRDblClk(fun func() int)

NM_RDBLCLK message handler.

func (*EventsTreeView) NmReturn added in v0.2.0

func (me *EventsTreeView) NmReturn(fun func() int)

NM_RETURN message handler.

func (*EventsTreeView) NmSetCursor added in v0.2.0

func (me *EventsTreeView) NmSetCursor(fun func(p *win.NMMOUSE) int)

NM_SETCURSOR message handler.

func (*EventsTreeView) NmSetFocus added in v0.2.0

func (me *EventsTreeView) NmSetFocus(fun func())

NM_SETFOCUS message handler.

func (*EventsTreeView) TvnAsyncDraw added in v0.2.0

func (me *EventsTreeView) TvnAsyncDraw(fun func(p *win.NMTVASYNCDRAW))

TVN_ASYNCDRAW message handler.

func (*EventsTreeView) TvnBeginDrag added in v0.2.0

func (me *EventsTreeView) TvnBeginDrag(fun func(p *win.NMTREEVIEW))

TVN_BEGINDRAG message handler.

func (*EventsTreeView) TvnBeginLabelEdit added in v0.2.0

func (me *EventsTreeView) TvnBeginLabelEdit(fun func(p *win.NMTVDISPINFO) bool)

TVN_BEGINLABELEDIT message handler.

func (*EventsTreeView) TvnBeginRDrag added in v0.2.0

func (me *EventsTreeView) TvnBeginRDrag(fun func(p *win.NMTREEVIEW))

TVN_BEGINRDRAG message handler.

func (*EventsTreeView) TvnDeleteItem added in v0.2.0

func (me *EventsTreeView) TvnDeleteItem(fun func(p *win.NMTREEVIEW))

TVN_DELETEITEM message handler.

func (*EventsTreeView) TvnEndLabelEdit added in v0.2.0

func (me *EventsTreeView) TvnEndLabelEdit(fun func(p *win.NMTVDISPINFO) bool)

TVN_ENDLABELEDIT message handler.

func (*EventsTreeView) TvnGetDispInfo added in v0.2.0

func (me *EventsTreeView) TvnGetDispInfo(fun func(p *win.NMTVDISPINFO))

TVN_GETDISPINFO message handler.

func (*EventsTreeView) TvnGetInfoTip added in v0.2.0

func (me *EventsTreeView) TvnGetInfoTip(fun func(p *win.NMTVGETINFOTIP))

TVN_GETINFOTIP message handler.

func (*EventsTreeView) TvnItemChanged added in v0.2.0

func (me *EventsTreeView) TvnItemChanged(fun func(p *win.NMTVITEMCHANGE))

TVN_ITEMCHANGED message handler.

func (*EventsTreeView) TvnItemChanging added in v0.2.0

func (me *EventsTreeView) TvnItemChanging(fun func(p *win.NMTVITEMCHANGE) bool)

TVN_ITEMCHANGING message handler.

func (*EventsTreeView) TvnItemExpanded added in v0.2.0

func (me *EventsTreeView) TvnItemExpanded(fun func(p *win.NMTREEVIEW))

TVN_ITEMEXPANDED message handler.

func (*EventsTreeView) TvnItemExpanding added in v0.2.0

func (me *EventsTreeView) TvnItemExpanding(fun func(p *win.NMTREEVIEW) bool)

TVN_ITEMEXPANDING message handler.

func (*EventsTreeView) TvnKeyDown added in v0.2.0

func (me *EventsTreeView) TvnKeyDown(fun func(p *win.NMTVKEYDOWN) int)

TVN_KEYDOWN message handler.

func (*EventsTreeView) TvnSelChanged added in v0.2.0

func (me *EventsTreeView) TvnSelChanged(fun func(p *win.NMTREEVIEW))

TVN_SELCHANGED message handler.

func (*EventsTreeView) TvnSelChanging added in v0.2.0

func (me *EventsTreeView) TvnSelChanging(fun func(p *win.NMTREEVIEW) bool)

TVN_SELCHANGING message handler.

func (*EventsTreeView) TvnSetDispInfo added in v0.2.0

func (me *EventsTreeView) TvnSetDispInfo(fun func(p *win.NMTVDISPINFO))

TVN_SETDISPINFO message handler.

func (*EventsTreeView) TvnSingleExpand added in v0.2.0

func (me *EventsTreeView) TvnSingleExpand(fun func(p *win.NMTREEVIEW) co.TVNRET)

TVN_SINGLEEXPAND message handler.

type EventsUpDown added in v0.2.0

type EventsUpDown struct {
	// contains filtered or unexported fields
}

Native up-down control events.

You cannot create this object directly, it will be created automatically by the owning control.

func (*EventsUpDown) NmReleasedCapture added in v0.2.0

func (me *EventsUpDown) NmReleasedCapture(fun func())

NM_RELEASEDCAPTURE message handler.

func (*EventsUpDown) UdnDeltaPos added in v0.2.0

func (me *EventsUpDown) UdnDeltaPos(fun func(p *win.NMUPDOWN) int)

UDN_DELTAPOS message handler.

type EventsWindow added in v0.2.0

type EventsWindow struct {
	// contains filtered or unexported fields
}

Exposes events for window messages.

You cannot create this object directly, it will be created automatically by the owning window.

func (*EventsWindow) Wm added in v0.2.0

func (me *EventsWindow) Wm(id co.WM, fun func(p Wm) uintptr)

Generic message handler.

Avoid this method, prefer the specific message handlers.

func (*EventsWindow) WmActivate added in v0.2.0

func (me *EventsWindow) WmActivate(fun func(p WmActivate))

WM_ACTIVATE message handler.

func (*EventsWindow) WmActivateApp added in v0.2.0

func (me *EventsWindow) WmActivateApp(fun func(p WmActivateApp))

WM_ACTIVATEAPP message handler.

func (*EventsWindow) WmAppCommand added in v0.2.0

func (me *EventsWindow) WmAppCommand(fun func(p WmAppCommand))

WM_APPCOMMAND message handler.

func (*EventsWindow) WmAskCbFormatName added in v0.2.0

func (me *EventsWindow) WmAskCbFormatName(fun func(p WmAskCbFormatName))

WM_ASKCBFORMATNAME message handler.

func (*EventsWindow) WmCancelMode added in v0.2.0

func (me *EventsWindow) WmCancelMode(fun func())

WM_CANCELMODE message handler.

func (*EventsWindow) WmCaptureChanged added in v0.2.0

func (me *EventsWindow) WmCaptureChanged(fun func(p WmCaptureChanged))

WM_CAPTURECHANGED message handler.

func (*EventsWindow) WmChangeCbChain added in v0.2.0

func (me *EventsWindow) WmChangeCbChain(fun func(p WmChangeCbChain))

WM_CHANGECBCHAIN message handler.

func (*EventsWindow) WmChar added in v0.2.0

func (me *EventsWindow) WmChar(fun func(p WmChar))

WM_CHAR message handler.

func (*EventsWindow) WmCharToItem added in v0.2.0

func (me *EventsWindow) WmCharToItem(fun func(p WmCharToItem) int)

WM_CHARTOITEM message handler.

func (*EventsWindow) WmChildActivate added in v0.2.0

func (me *EventsWindow) WmChildActivate(fun func())

WM_CHILDACTIVATE message handler.

func (*EventsWindow) WmClipboardUpdate added in v0.2.0

func (me *EventsWindow) WmClipboardUpdate(fun func())

WM_CLIPBOARDUPDATE message handler.

func (*EventsWindow) WmClose added in v0.2.0

func (me *EventsWindow) WmClose(fun func())

WM_CLOSE message handler.

⚠️ By handling this message, you'll overwrite the default behavior in WindowMain and WindowModal:

func (*EventsWindow) WmCommand added in v0.2.0

func (me *EventsWindow) WmCommand(cmdId uint16, notifCode co.CMD, fun func())

Generic WM_COMMAND handler.

Avoid this method, prefer the specific command notification handlers.

func (*EventsWindow) WmCommandAccelMenu added in v0.2.0

func (me *EventsWindow) WmCommandAccelMenu(cmdId uint16, fun func())

WM_COMMAND handler for both accelerator and menu events. Ideal for IDs shared between accelerator keys and menu items.

func (*EventsWindow) WmCompareItem added in v0.2.0

func (me *EventsWindow) WmCompareItem(fun func(p WmCompareItem) int)

WM_COMPAREITEM message handler.

func (*EventsWindow) WmContextMenu added in v0.2.0

func (me *EventsWindow) WmContextMenu(fun func(p WmContextMenu))

WM_CONTEXTMENU message handler.

func (*EventsWindow) WmCopyData added in v0.2.0

func (me *EventsWindow) WmCopyData(fun func(p WmCopyData) bool)

WM_COPYDATA message handler.

func (*EventsWindow) WmCreate added in v0.2.0

func (me *EventsWindow) WmCreate(fun func(p WmCreate) int)

WM_CREATE message handler.

Return 0 to continue window creation, or -1 to abort it.

Sent only to windows created with CreateWindowEx; dialog windows will receive EventsWindow.WmInitDialog instead.

Example

var wnd ui.Parent // initialized somewhere

wnd.On().WmCreate(func(_ ui.WmCreate) bool {
	return 0
}

func (*EventsWindow) WmCtlColorBtn added in v0.2.0

func (me *EventsWindow) WmCtlColorBtn(fun func(p WmCtlColor) win.HBRUSH)

WM_CTLCOLORBTN message handler.

func (*EventsWindow) WmCtlColorDlg added in v0.2.0

func (me *EventsWindow) WmCtlColorDlg(fun func(p WmCtlColor) win.HBRUSH)

WM_CTLCOLORDLG message handler.

func (*EventsWindow) WmCtlColorEdit added in v0.2.0

func (me *EventsWindow) WmCtlColorEdit(fun func(p WmCtlColor) win.HBRUSH)

WM_CTLCOLOREDIT message handler.

func (*EventsWindow) WmCtlColorListBox added in v0.2.0

func (me *EventsWindow) WmCtlColorListBox(fun func(p WmCtlColor) win.HBRUSH)

WM_CTLCOLORLISTBOX message handler.

func (*EventsWindow) WmCtlColorScrollBar added in v0.2.0

func (me *EventsWindow) WmCtlColorScrollBar(fun func(p WmCtlColor) win.HBRUSH)

WM_CTLCOLORSCROLLBAR message handler.

func (*EventsWindow) WmCtlColorStatic added in v0.2.0

func (me *EventsWindow) WmCtlColorStatic(fun func(p WmCtlColor) win.HBRUSH)

WM_CTLCOLORSTATIC message handler.

func (*EventsWindow) WmDeadChar added in v0.2.0

func (me *EventsWindow) WmDeadChar(fun func(p WmChar))

WM_DEADCHAR message handler.

func (*EventsWindow) WmDeleteItem added in v0.2.0

func (me *EventsWindow) WmDeleteItem(fun func(p WmDeleteItem))

WM_DELETEITEM message handler.

func (*EventsWindow) WmDestroy added in v0.2.0

func (me *EventsWindow) WmDestroy(fun func())

WM_DESTROY message handler.

func (*EventsWindow) WmDestroyClipboard added in v0.2.0

func (me *EventsWindow) WmDestroyClipboard(fun func())

WM_DESTROYCLIPBOARD message handler.

func (*EventsWindow) WmDevModeChange added in v0.2.0

func (me *EventsWindow) WmDevModeChange(fun func(WmDevModeChange))

WM_DEVMODECHANGE message handler.

func (*EventsWindow) WmDeviceChange added in v0.2.0

func (me *EventsWindow) WmDeviceChange(fun func(WmDeviceChange) co.BROADCAST_QUERY)

WM_DEVICECHANGE message handler.

func (*EventsWindow) WmDisplayChange added in v0.2.0

func (me *EventsWindow) WmDisplayChange(fun func(p WmDisplayChange))

WM_DISPLAYCHANGE message handler.

func (*EventsWindow) WmDrawClipboard added in v0.2.0

func (me *EventsWindow) WmDrawClipboard(fun func())

WM_DRAWCLIPBOARD message handler.

func (*EventsWindow) WmDrawItem added in v0.2.0

func (me *EventsWindow) WmDrawItem(fun func(p WmDrawItem))

WM_DRAWITEM message handler.

func (*EventsWindow) WmDropFiles added in v0.2.0

func (me *EventsWindow) WmDropFiles(fun func(p WmDropFiles))

WM_DROPFILES message handler.

func (*EventsWindow) WmDwmColorizationColorChanged added in v0.2.0

func (me *EventsWindow) WmDwmColorizationColorChanged(fun func(p WmDwmColorizationColorChanged))

WM_DWMCOLORIZATIONCOLORCHANGED message handler.

func (*EventsWindow) WmDwmCompositionChanged added in v0.2.0

func (me *EventsWindow) WmDwmCompositionChanged(fun func())

WM_DWMCOMPOSITIONCHANGED message handler.

func (*EventsWindow) WmDwmNcRenderingChanged added in v0.2.0

func (me *EventsWindow) WmDwmNcRenderingChanged(fun func(p WmDwmNcRenderingChanged))

WM_DWMNCRENDERINGCHANGED message handler.

func (*EventsWindow) WmDwmSendIconicLivePreviewBitmap added in v0.2.0

func (me *EventsWindow) WmDwmSendIconicLivePreviewBitmap(fun func())

WM_DWMSENDICONICLIVEPREVIEWBITMAP message handler.

func (*EventsWindow) WmDwmSendIconicThumbnail added in v0.2.0

func (me *EventsWindow) WmDwmSendIconicThumbnail(fun func(p WmDwmSendIconicThumbnail))

WM_DWMSENDICONICTHUMBNAIL message handler.

func (*EventsWindow) WmDwmWindowMaximizedChange added in v0.2.0

func (me *EventsWindow) WmDwmWindowMaximizedChange(fun func(p WmDwmWindowMaximizedChange))

WM_DWMWINDOWMAXIMIZEDCHANGE message handler.

func (*EventsWindow) WmEnable added in v0.2.0

func (me *EventsWindow) WmEnable(fun func(p WmEnable))

WM_ENABLE message handler.

func (*EventsWindow) WmEndSession added in v0.2.0

func (me *EventsWindow) WmEndSession(fun func(p WmEndSession))

WM_ENDSESSION message handler.

func (*EventsWindow) WmEnterIdle added in v0.2.0

func (me *EventsWindow) WmEnterIdle(fun func(p WmEnterIdle))

WM_ENTERIDLE message handler.

func (*EventsWindow) WmEnterMenuLoop added in v0.2.0

func (me *EventsWindow) WmEnterMenuLoop(fun func(WmEnterMenuLoop))

WM_ENTERMENULOOP message handler.

func (*EventsWindow) WmEnterSizeMove added in v0.2.0

func (me *EventsWindow) WmEnterSizeMove(fun func())

WM_ENTERSIZEMOVE message handler.

func (*EventsWindow) WmEraseBkgnd added in v0.2.0

func (me *EventsWindow) WmEraseBkgnd(fun func(WmEraseBkgnd) int)

WM_ERASEBKGND message handler.

func (*EventsWindow) WmExitMenuLoop added in v0.2.0

func (me *EventsWindow) WmExitMenuLoop(fun func(WmExitMenuLoop))

WM_EXITMENULOOP message handler.

func (*EventsWindow) WmExitSizeMove added in v0.2.0

func (me *EventsWindow) WmExitSizeMove(fun func())

WM_EXITSIZEMOVE message handler.

func (*EventsWindow) WmFontChange added in v0.2.0

func (me *EventsWindow) WmFontChange(fun func())

WM_FONTCHANGE message handler.

func (*EventsWindow) WmGetDlgCode added in v0.2.0

func (me *EventsWindow) WmGetDlgCode(fun func(p WmGetDlgCode) co.DLGC)

WM_GETDLGCODE message handler.

func (*EventsWindow) WmGetFont added in v0.2.0

func (me *EventsWindow) WmGetFont(fun func() win.HFONT)

WM_GETFONT message handler.

func (*EventsWindow) WmGetHMenu added in v0.2.0

func (me *EventsWindow) WmGetHMenu(fun func() win.HMENU)

MN_GETHMENU message handler.

func (*EventsWindow) WmGetIcon added in v0.2.0

func (me *EventsWindow) WmGetIcon(fun func(p WmGetIcon) win.HICON)

WM_GETICON message handler.

func (*EventsWindow) WmGetMinMaxInfo added in v0.2.0

func (me *EventsWindow) WmGetMinMaxInfo(fun func(p WmGetMinMaxInfo))

WM_GETMINMAXINFO message handler.

func (*EventsWindow) WmGetText added in v0.2.0

func (me *EventsWindow) WmGetText(fun func(p WmGetText) uint)

WM_GETTEXT message handler.

func (*EventsWindow) WmGetTextLength added in v0.2.0

func (me *EventsWindow) WmGetTextLength(fun func() uint)

WM_GETTEXTLENGTH message handler.

func (*EventsWindow) WmGetTitleBarInfoEx added in v0.2.0

func (me *EventsWindow) WmGetTitleBarInfoEx(fun func(p WmGetTitleBarInfoEx))

WM_GETTITLEBARINFOEX message handler.

func (*EventsWindow) WmHScroll added in v0.2.0

func (me *EventsWindow) WmHScroll(fun func(p WmScroll))

WM_HSCROLL message handler.

func (*EventsWindow) WmHScrollClipboard added in v0.2.0

func (me *EventsWindow) WmHScrollClipboard(fun func(p WmScrollClipboard))

WM_HSCROLLCLIPBOARD message handler.

func (*EventsWindow) WmHelp added in v0.2.0

func (me *EventsWindow) WmHelp(fun func(p WmHelp))

WM_HELP message handler.

func (*EventsWindow) WmHotKey added in v0.2.0

func (me *EventsWindow) WmHotKey(fun func(p WmHotKey))

WM_HOTKEY message handler.

func (*EventsWindow) WmInitDialog added in v0.2.0

func (me *EventsWindow) WmInitDialog(fun func(p WmInitDialog) bool)

WM_INITDIALOG message handler.

Return true to direct the system to set the keyboard focus to the first control.

Sent only to dialog windows; those created with CreateWindowEx will receive EventsWindow.WmCreate instead.

Example

var wnd ui.Parent // initialized somewhere

wnd.On().WmInitDialog(func(_ ui.WmInitDialog) bool {
	return true
}

func (*EventsWindow) WmInitMenuPopup added in v0.2.0

func (me *EventsWindow) WmInitMenuPopup(fun func(p WmInitMenuPopup))

WM_INITMENUPOPUP message handler.

func (*EventsWindow) WmKeyDown added in v0.2.0

func (me *EventsWindow) WmKeyDown(fun func(p WmKey))

WM_KEYDOWN message handler.

func (*EventsWindow) WmKeyUp added in v0.2.0

func (me *EventsWindow) WmKeyUp(fun func(p WmKey))

WM_KEYUP message handler.

func (*EventsWindow) WmKillFocus added in v0.2.0

func (me *EventsWindow) WmKillFocus(fun func(p WmKillFocus))

WM_KILLFOCUS message handler.

func (*EventsWindow) WmLButtonDblClk added in v0.2.0

func (me *EventsWindow) WmLButtonDblClk(fun func(p WmMouse))

WM_LBUTTONDBLCLK message handler.

func (*EventsWindow) WmLButtonDown added in v0.2.0

func (me *EventsWindow) WmLButtonDown(fun func(p WmMouse))

WM_LBUTTONDOWN message handler.

func (*EventsWindow) WmLButtonUp added in v0.2.0

func (me *EventsWindow) WmLButtonUp(fun func(p WmMouse))

WM_LBUTTONUP message handler.

func (*EventsWindow) WmMButtonDblClk added in v0.2.0

func (me *EventsWindow) WmMButtonDblClk(fun func(p WmMouse))

WM_MBUTTONDBLCLK message handler.

func (*EventsWindow) WmMButtonDown added in v0.2.0

func (me *EventsWindow) WmMButtonDown(fun func(p WmMouse))

WM_MBUTTONDOWN message handler.

func (*EventsWindow) WmMButtonUp added in v0.2.0

func (me *EventsWindow) WmMButtonUp(fun func(p WmMouse))

WM_MBUTTONUP message handler.

func (*EventsWindow) WmMenuChar added in v0.2.0

func (me *EventsWindow) WmMenuChar(fun func(p WmMenuChar) co.MNC)

WM_MENUCHAR message handler.

func (*EventsWindow) WmMenuCommand added in v0.2.0

func (me *EventsWindow) WmMenuCommand(fun func(p WmMenu))

WM_MENUCOMMAND message handler.

func (*EventsWindow) WmMenuDrag added in v0.2.0

func (me *EventsWindow) WmMenuDrag(fun func(p WmMenu) co.MND)

WM_MENUDRAG message handler.

func (*EventsWindow) WmMenuGetObject added in v0.2.0

func (me *EventsWindow) WmMenuGetObject(fun func(p WmMenuGetObject) co.MNGO)

WM_MENUGETOBJECT message handler.

func (*EventsWindow) WmMenuRButtonUp added in v0.2.0

func (me *EventsWindow) WmMenuRButtonUp(fun func(p WmMenu))

WM_MENURBUTTONUP message handler.

func (*EventsWindow) WmMenuSelect added in v0.2.0

func (me *EventsWindow) WmMenuSelect(fun func(p WmMenuSelect))

WM_MENUSELECT message handler.

func (*EventsWindow) WmMouseHover added in v0.2.0

func (me *EventsWindow) WmMouseHover(fun func(p WmMouse))

WM_MOUSEHOVER message handler.

func (*EventsWindow) WmMouseLeave added in v0.2.0

func (me *EventsWindow) WmMouseLeave(fun func())

WM_MOUSELEAVE message handler.

func (*EventsWindow) WmMouseMove added in v0.2.0

func (me *EventsWindow) WmMouseMove(fun func(p WmMouse))

WM_MOUSEMOVE message handler.

func (*EventsWindow) WmMove added in v0.2.0

func (me *EventsWindow) WmMove(fun func(p WmMove))

WM_MOVE message handler.

func (*EventsWindow) WmMoving added in v0.2.0

func (me *EventsWindow) WmMoving(fun func(p WmMoving))

WM_MOVING message handler.

func (*EventsWindow) WmNcActivate added in v0.2.0

func (me *EventsWindow) WmNcActivate(fun func(p WmNcActivate) bool)

WM_NCACTIVATE message handler.

func (*EventsWindow) WmNcCalcSize added in v0.2.0

func (me *EventsWindow) WmNcCalcSize(fun func(p WmNcCalcSize) co.WVR)

WM_NCCALCSIZE message handler.

func (*EventsWindow) WmNcCreate added in v0.2.0

func (me *EventsWindow) WmNcCreate(fun func(p WmCreate) bool)

WM_NCCREATE message handler.

func (*EventsWindow) WmNcDestroy added in v0.2.0

func (me *EventsWindow) WmNcDestroy(fun func())

WM_NCDESTROY message handler.

⚠️ By handling this message, you'll overwrite the default behavior in raw and dialog WindowMain, in both cases calling PostQuitMessage.

func (*EventsWindow) WmNcHitTest added in v0.2.0

func (me *EventsWindow) WmNcHitTest(fun func(WmNcHitTest) co.HT)

WM_NCHITTEST message handler.

func (*EventsWindow) WmNcLButtonDblClk added in v0.2.0

func (me *EventsWindow) WmNcLButtonDblClk(fun func(p WmNcMouse))

WM_NCLBUTTONDBLCLK message handler.

func (*EventsWindow) WmNcLButtonDown added in v0.2.0

func (me *EventsWindow) WmNcLButtonDown(fun func(p WmNcMouse))

WM_NCLBUTTONDOWN message handler.

func (*EventsWindow) WmNcLButtonUp added in v0.2.0

func (me *EventsWindow) WmNcLButtonUp(fun func(p WmNcMouse))

WM_NCLBUTTONUP message handler.

func (*EventsWindow) WmNcMButtonDblClk added in v0.2.0

func (me *EventsWindow) WmNcMButtonDblClk(fun func(p WmNcMouse))

WM_NCMBUTTONDBLCLK message handler.

func (*EventsWindow) WmNcMButtonDown added in v0.2.0

func (me *EventsWindow) WmNcMButtonDown(fun func(p WmNcMouse))

WM_NCMBUTTONDOWN message handler.

func (*EventsWindow) WmNcMButtonUp added in v0.2.0

func (me *EventsWindow) WmNcMButtonUp(fun func(p WmNcMouse))

WM_NCMBUTTONUP message handler.

func (*EventsWindow) WmNcMouseHover added in v0.2.0

func (me *EventsWindow) WmNcMouseHover(fun func(p WmNcMouse))

WM_NCMOUSEHOVER message handler.

func (*EventsWindow) WmNcMouseLeave added in v0.2.0

func (me *EventsWindow) WmNcMouseLeave(fun func())

WM_NCMOUSELEAVE message handler.

func (*EventsWindow) WmNcMouseMove added in v0.2.0

func (me *EventsWindow) WmNcMouseMove(fun func(p WmNcMouse))

WM_NCMOUSEMOVE message handler.

func (*EventsWindow) WmNcPaint added in v0.2.0

func (me *EventsWindow) WmNcPaint(fun func(p WmNcPaint))

WM_NCPAINT message handler.

func (*EventsWindow) WmNcRButtonDblClk added in v0.2.0

func (me *EventsWindow) WmNcRButtonDblClk(fun func(p WmNcMouse))

WM_NCRBUTTONDBLCLK message handler.

func (*EventsWindow) WmNcRButtonDown added in v0.2.0

func (me *EventsWindow) WmNcRButtonDown(fun func(p WmNcMouse))

WM_NCRBUTTONDOWN message handler.

func (*EventsWindow) WmNcRButtonUp added in v0.2.0

func (me *EventsWindow) WmNcRButtonUp(fun func(p WmNcMouse))

WM_NCRBUTTONUP message handler.

func (*EventsWindow) WmNcXButtonDblClk added in v0.2.0

func (me *EventsWindow) WmNcXButtonDblClk(fun func(p WmNcMouseX))

WM_NCXBUTTONDBLCLK message handler.

func (*EventsWindow) WmNcXButtonDown added in v0.2.0

func (me *EventsWindow) WmNcXButtonDown(fun func(p WmNcMouseX))

WM_NCXBUTTONDOWN message handler.

func (*EventsWindow) WmNcXButtonUp added in v0.2.0

func (me *EventsWindow) WmNcXButtonUp(fun func(p WmNcMouseX))

WM_NCXBUTTONUP message handler.

func (*EventsWindow) WmNextDlgCtl added in v0.2.0

func (me *EventsWindow) WmNextDlgCtl(fun func(p WmNextDlgCtl))

WM_NEXTDLGCTL message handler.

func (*EventsWindow) WmNextMenu added in v0.2.0

func (me *EventsWindow) WmNextMenu(fun func(p WmNextMenu))

WM_NEXTMENU message handler.

func (*EventsWindow) WmNotify added in v0.2.0

func (me *EventsWindow) WmNotify(idFrom uint16, code co.NM, fun func(p unsafe.Pointer) uintptr)

Generic WM_NOTIFY handler.

Avoid this method, prefer the specific notification handlers.

func (*EventsWindow) WmNull added in v0.2.0

func (me *EventsWindow) WmNull(fun func())

WM_NULL message handler.

func (*EventsWindow) WmPaint added in v0.2.0

func (me *EventsWindow) WmPaint(fun func())

WM_PAINT message handler.

Note that, even if you don't actually paint anything, you still must call win.HWND.BeginPaint and win.HWND.EndPaint, otherwise the window may get stuck.

Example

var wnd ui.Parent // initialized somewhere

wnd.On().WmPaint(func() {
	var ps win.PAINTSTRUCT
	hdc, _ := wnd.Hwnd().BeginPaint(&ps)
	defer wnd.Hwnd().EndPaint(&ps)
}

func (*EventsWindow) WmPaintClipboard added in v0.2.0

func (me *EventsWindow) WmPaintClipboard(fun func(WmPaintClipboard))

WM_PAINTCLIPBOARD message handler.

func (*EventsWindow) WmParentNotify added in v0.2.0

func (me *EventsWindow) WmParentNotify(fun func(WmParentNotify))

WM_PARENTNOTIFY message handler.

func (*EventsWindow) WmPowerBroadcast added in v0.2.0

func (me *EventsWindow) WmPowerBroadcast(fun func(p WmPowerBroadcast))

WM_POWERBROADCAST message handler.

func (*EventsWindow) WmPrint added in v0.2.0

func (me *EventsWindow) WmPrint(fun func(p WmPrint))

WM_PRINT message handler.

func (*EventsWindow) WmQueryDragIcon added in v0.2.0

func (me *EventsWindow) WmQueryDragIcon(fun func() win.HICON)

WM_QUERYDRAGICON message handler.

func (*EventsWindow) WmQueryOpen added in v0.2.0

func (me *EventsWindow) WmQueryOpen(fun func() bool)

WM_QUERYOPEN message handler.

func (*EventsWindow) WmRButtonDblClk added in v0.2.0

func (me *EventsWindow) WmRButtonDblClk(fun func(p WmMouse))

WM_RBUTTONDBLCLK message handler.

func (*EventsWindow) WmRButtonDown added in v0.2.0

func (me *EventsWindow) WmRButtonDown(fun func(p WmMouse))

WM_RBUTTONDOWN message handler.

func (*EventsWindow) WmRButtonUp added in v0.2.0

func (me *EventsWindow) WmRButtonUp(fun func(p WmMouse))

WM_RBUTTONUP message handler.

func (*EventsWindow) WmRenderAllFormats added in v0.2.0

func (me *EventsWindow) WmRenderAllFormats(fun func())

WM_RENDERALLFORMATS message handler.

func (*EventsWindow) WmRenderFormat added in v0.2.0

func (me *EventsWindow) WmRenderFormat(fun func(p WmRenderFormat))

WM_RENDERFORMAT message handler.

func (*EventsWindow) WmSetFocus added in v0.2.0

func (me *EventsWindow) WmSetFocus(fun func(p WmSetFocus))

WM_SETFOCUS message handler.

func (*EventsWindow) WmSetFont added in v0.2.0

func (me *EventsWindow) WmSetFont(fun func(p WmSetFont))

WM_SETFONT message handler.

func (*EventsWindow) WmSetIcon added in v0.2.0

func (me *EventsWindow) WmSetIcon(fun func(p WmSetIcon) win.HICON)

WM_SETICON message handler.

func (*EventsWindow) WmSetRedraw added in v0.2.0

func (me *EventsWindow) WmSetRedraw(fun func(p WmSetRedraw))

WM_SETREDRAW message handler.

func (*EventsWindow) WmSetText added in v0.2.0

func (me *EventsWindow) WmSetText(fun func(p WmSetText) uintptr)

WM_SETTEXT message handler.

func (*EventsWindow) WmShowWindow added in v0.2.0

func (me *EventsWindow) WmShowWindow(fun func(p WmShowWindow))

WM_SHOWWINDOW message handler.

func (*EventsWindow) WmSize added in v0.2.0

func (me *EventsWindow) WmSize(fun func(p WmSize))

WM_SIZE message handler.

func (*EventsWindow) WmSizeClipboard added in v0.2.0

func (me *EventsWindow) WmSizeClipboard(fun func(p WmSizeClipboard))

WM_SIZECLIPBOARD message handler.

func (*EventsWindow) WmSizing added in v0.2.0

func (me *EventsWindow) WmSizing(fun func(p WmSizing))

WM_SIZING message handler.

func (*EventsWindow) WmStyleChanged added in v0.2.0

func (me *EventsWindow) WmStyleChanged(fun func(p WmStyles))

WM_STYLECHANGED message handler.

func (*EventsWindow) WmStyleChanging added in v0.2.0

func (me *EventsWindow) WmStyleChanging(fun func(p WmStyles))

WM_STYLECHANGING message handler.

func (*EventsWindow) WmSyncPaint added in v0.2.0

func (me *EventsWindow) WmSyncPaint(fun func())

WM_SYNCPAINT message handler.

func (*EventsWindow) WmSysChar added in v0.2.0

func (me *EventsWindow) WmSysChar(fun func(p WmChar))

WM_SYSCHAR message handler.

func (*EventsWindow) WmSysCommand added in v0.2.0

func (me *EventsWindow) WmSysCommand(fun func(p WmSysCommand))

WM_SYSCOMMAND message handler.

func (*EventsWindow) WmSysDeadChar added in v0.2.0

func (me *EventsWindow) WmSysDeadChar(fun func(p WmChar))

WM_SYSDEADCHAR message handler.

func (*EventsWindow) WmSysKeyDown added in v0.2.0

func (me *EventsWindow) WmSysKeyDown(fun func(p WmKey))

WM_SYSKEYDOWN message handler.

func (*EventsWindow) WmSysKeyUp added in v0.2.0

func (me *EventsWindow) WmSysKeyUp(fun func(p WmKey))

WM_SYSKEYUP message handler.

func (*EventsWindow) WmThemeChanged added in v0.2.0

func (me *EventsWindow) WmThemeChanged(fun func())

WM_THEMECHANGED message handler.

func (*EventsWindow) WmTimeChange added in v0.2.0

func (me *EventsWindow) WmTimeChange(fun func())

WM_TIMECHANGE message handler.

func (*EventsWindow) WmTimer added in v0.2.0

func (me *EventsWindow) WmTimer(timerId uintptr, fun func())

WM_TIMER message handler.

func (*EventsWindow) WmUnInitMenuPopup added in v0.2.0

func (me *EventsWindow) WmUnInitMenuPopup(fun func(p WmUnInitMenuPopup))

WM_UNINITMENUPOPUP message handler.

func (*EventsWindow) WmUndo added in v0.2.0

func (me *EventsWindow) WmUndo(fun func() bool)

WM_UNDO message handler.

func (*EventsWindow) WmVScroll added in v0.2.0

func (me *EventsWindow) WmVScroll(fun func(p WmScroll))

WM_VSCROLL message handler.

func (*EventsWindow) WmVScrollClipboard added in v0.2.0

func (me *EventsWindow) WmVScrollClipboard(fun func(p WmScrollClipboard))

WM_VSCROLLCLIPBOARD message handler.

func (*EventsWindow) WmWindowPosChanged added in v0.2.0

func (me *EventsWindow) WmWindowPosChanged(fun func(p WmWindowPos))

WM_WINDOWPOSCHANGED message handler.

func (*EventsWindow) WmWindowPosChanging added in v0.2.0

func (me *EventsWindow) WmWindowPosChanging(fun func(p WmWindowPos))

WM_WINDOWPOSCHANGING message handler.

func (*EventsWindow) WmWtsSessionChange added in v0.2.0

func (me *EventsWindow) WmWtsSessionChange(fun func(p WmWtsSessionChange))

WM_WTSSESSION_CHANGE message handler.

func (*EventsWindow) WmXButtonDblClk added in v0.2.0

func (me *EventsWindow) WmXButtonDblClk(fun func(p WmMouse))

WM_XBUTTONDBLCLK message handler.

func (*EventsWindow) WmXButtonDown added in v0.2.0

func (me *EventsWindow) WmXButtonDown(fun func(p WmMouse))

WM_XBUTTONDOWN message handler.

func (*EventsWindow) WmXButtonUp added in v0.2.0

func (me *EventsWindow) WmXButtonUp(fun func(p WmMouse))

WM_XBUTTONUP message handler.

type Header struct {
	Items CollectionHeaderItems // Methods to interact with the items collection.
	// contains filtered or unexported fields
}

Native header control.

func NewHeader added in v0.2.0

func NewHeader(parent Parent, opts *VarOptsHeader) *Header

Creates a new Header with win.CreateWindowEx.

Example

var wndOwner ui.Parent // initialized somewhere

header := ui.NewHeader(
	wndOwner,
	ui.OptsHeader().
		Position(ui.Dpi(260, 240)).
		Size(ui.Dpi(200, 23)),
)

func NewHeaderDlg added in v0.2.0

func NewHeaderDlg(parent Parent, ctrlId uint16, layout LAY) *Header

Instantiates a new Header to be loaded from a dialog resource with win.HWND.GetDlgItem.

Example

const ID_HEADER uint16 = 0x100

var wndOwner ui.Parent // initialized somewhere

header := ui.NewHeaderDlg(
	wndOwner, ID_HEADER, ui.LAY_NONE_NONE)

func (*Header) CtrlId added in v0.2.0

func (me *Header) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*Header) Focus added in v0.2.0

func (me *Header) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*Header) Hwnd added in v0.2.0

func (me *Header) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*Header) ImageList added in v0.2.0

func (me *Header) ImageList(which co.HDSIL) win.HIMAGELIST

Retrieves the given image list with HDM_GETIMAGELIST. The image lists are lazy-initialized: the first time you call this method for a given image list, it will be created and assigned with HDM_SETIMAGELIST.

The image lists will be automatically destroyed.

func (*Header) On added in v0.2.0

func (me *Header) On() *EventsHeader

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*Header) OnSubclass added in v0.2.0

func (me *Header) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

type HeaderItem added in v0.2.0

type HeaderItem struct {
	// contains filtered or unexported fields
}

An item from a header.

func (HeaderItem) Index added in v0.2.0

func (me HeaderItem) Index() int

Returns the zero-based index of the item.

func (HeaderItem) Justification added in v0.2.0

func (me HeaderItem) Justification() co.HDF

Retrieves the text justification with HDM_GETITEM.

Possible values:

func (HeaderItem) Order added in v0.2.0

func (me HeaderItem) Order() int

Retrieves the order of the item with HDM_GETITEM.

func (HeaderItem) SetJustification added in v0.2.0

func (me HeaderItem) SetJustification(hdf co.HDF) HeaderItem

Sets the text justification with HDM_SETITEM.

Possible values:

Returns the same item, so further operations can be chained.

func (HeaderItem) SetSortArrow added in v0.2.0

func (me HeaderItem) SetSortArrow(hdf co.HDF) HeaderItem

Sets the displayed sort arrow with HDM_SETITEM.

Possible values:

Returns the same item, so further operations can be chained.

Panics on error.

func (HeaderItem) SetText added in v0.2.0

func (me HeaderItem) SetText(text string) HeaderItem

Sets the text with HDM_SETITEM.

Returns the same item, so further operations can be chained.

Panics on error.

func (HeaderItem) SetWidth added in v0.2.0

func (me HeaderItem) SetWidth(width int) HeaderItem

Sets the width of the item with HDM_SETITEM.

Returns the same item, so further operations can be chained.

Panics on error.

func (HeaderItem) SortArrow added in v0.2.0

func (me HeaderItem) SortArrow() co.HDF

Retrieves the displayed sort arrow with HDM_GETITEM.

Possible values:

func (HeaderItem) Text added in v0.2.0

func (me HeaderItem) Text() string

Retrieves the text with HDM_GETITEM.

Panics on error.

func (HeaderItem) Width added in v0.2.0

func (me HeaderItem) Width() int

Retrieves the width of the item with HDM_GETITEM.

Panics on error.

type LAY added in v0.2.0

type LAY uint8

Horizontal and vertical behavior for the control layout, when the parent window is resized.

type ListView

type ListView struct {
	Cols  CollectionListViewCols  // Methods to interact with the columns collection.
	Items CollectionListViewItems // Methods to interact with the items collection.
	// contains filtered or unexported fields
}

Native list view control.

func NewListView

func NewListView(parent Parent, opts *VarOptsListView) *ListView

Creates a new ListView with win.CreateWindowEx.

func NewListViewDlg

func NewListViewDlg(parent Parent, ctrlId uint16, contextMenuId uint16, layout LAY) *ListView

Instantiates a new ListView to be loaded from a dialog resource with win.HWND.GetDlgItem.

func (*ListView) ContextMenu

func (me *ListView) ContextMenu() win.HMENU

Returns the context menu associated to this control, if any.

func (*ListView) CtrlId added in v0.2.0

func (me *ListView) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*ListView) Focus added in v0.2.0

func (me *ListView) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*ListView) Header added in v0.2.0

func (me *ListView) Header() *Header

Returns the embedded Header of the list view, or nil if none.

func (*ListView) Hwnd added in v0.2.0

func (me *ListView) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*ListView) ImageList

func (me *ListView) ImageList(which co.LVSIL) win.HIMAGELIST

Retrieves the given image list with LVM_GETIMAGELIST. The image lists are lazy-initialized: the first time you call this method for a given image list, it will be created and assigned with LVM_SETIMAGELIST.

Since LVS_SHAREIMAGELISTS style is not allowed, image lists will be automatically destroyed by the OS.

func (*ListView) On

func (me *ListView) On() *EventsListView

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*ListView) OnSubclass added in v0.2.0

func (me *ListView) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*ListView) Scroll

func (me *ListView) Scroll(horz, vert int) *ListView

Scrolls the control with LVM_SCROLL.

Returns the same object, so further operations can be chained.

Panics on error.

func (*ListView) SetExtendedStyle

func (me *ListView) SetExtendedStyle(doSet bool, style co.LVS_EX) *ListView

Adds or removes extended styles with LVM_SETEXTENDEDLISTVIEWSTYLE.

Returns the same object, so further operations can be chained.

func (*ListView) SetRedraw

func (me *ListView) SetRedraw(allowRedraw bool) *ListView

Enables or disables redrawing with WM_SETREDRAW.

Use this method to disable redrawing while you're updating multiple items at once.

Returns the same object, so further operations can be chained.

func (*ListView) SetView

func (me *ListView) SetView(view co.LV_VIEW) *ListView

Sets the current view with LVM_SETVIEW.

Returns the same object, so further operations can be chained.

Panics on error.

func (*ListView) View

func (me *ListView) View() co.LV_VIEW

Retrieves the current view with LVM_GETVIEW.

type ListViewCol added in v0.2.0

type ListViewCol struct {
	// contains filtered or unexported fields
}

An column from a list view.

func (ListViewCol) AllTexts added in v0.2.0

func (me ListViewCol) AllTexts() []string

Returns the text of each item under this column with LVM_GETITEMTEXT.

func (ListViewCol) Index added in v0.2.0

func (me ListViewCol) Index() int

Returns the zero-based index of the column.

func (ListViewCol) Justification added in v0.2.0

func (me ListViewCol) Justification() co.HDF

Retrieves the text justification with HDM_GETITEM.

Possible values:

Panics if the list view has no header.

func (ListViewCol) SelectedTexts added in v0.2.0

func (me ListViewCol) SelectedTexts() []string

Returns the text of each selected item under this column with LVM_GETNEXTITEM and LVM_GETITEMTEXT.

func (ListViewCol) SetJustification added in v0.2.0

func (me ListViewCol) SetJustification(hdf co.HDF) ListViewCol

Sets the text justification with LVM_GETHEADER and HDM_SETITEM.

Possible values:

Returns the same column, so further operations can be chained.

Panics if the list view has no header.

func (ListViewCol) SetSortArrow added in v0.2.0

func (me ListViewCol) SetSortArrow(hdf co.HDF) ListViewCol

Sets the displayed sort arrow with LVM_GETHEADER and HDM_SETITEM.

Possible values:

Returns the same column, so further operations can be chained.

Panics if the list view has no header.

func (ListViewCol) SetTitle added in v0.2.0

func (me ListViewCol) SetTitle(title string) ListViewCol

Sets the title with LVM_SETCOLUMN.

Returns the same column, so further operations can be chained.

Panics on error.

func (ListViewCol) SetWidth added in v0.2.0

func (me ListViewCol) SetWidth(width int) ListViewCol

Sets the width with LVM_SETCOLUMNWIDTH.

Returns the same column, so further operations can be chained.

Panics on error.

func (ListViewCol) SetWidthToFill added in v0.2.0

func (me ListViewCol) SetWidthToFill() ListViewCol

Resizes the column with LVM_SETCOLUMNWIDTH to fill the remaining space.

Returns the same column, so further operations can be chained.

Panics on error.

func (ListViewCol) SortArrow added in v0.2.0

func (me ListViewCol) SortArrow() co.HDF

Retrieves the displayed sort arrow with HDM_GETITEM.

Possible values:

Panics if the list view has no header.

func (ListViewCol) Title added in v0.2.0

func (me ListViewCol) Title() string

Retrieves the title of the column with LVM_GETCOLUMN.

Panics on error.

func (ListViewCol) Width added in v0.2.0

func (me ListViewCol) Width() int

Retrieves the width of the column with LVM_GETCOLUMNWIDTH.

Panics on error.

type ListViewItem

type ListViewItem struct {
	// contains filtered or unexported fields
}

An item from a list view.

func (ListViewItem) Data added in v0.2.0

func (me ListViewItem) Data() interface{}

Returns the user-custom data stored for this item, or nil if none.

Example

type Person struct {
	Name string
}

var item ui.ListViewItem // initialized somewhere

item.SetData(&Person{Name: "foo"})

if person := item.Data().(*Person); person != nil {
	println(person.Name)
}

func (ListViewItem) Delete

func (me ListViewItem) Delete()

Deletes the item with LVM_DELETEITEM.

Panics on error.

func (ListViewItem) EnsureVisible

func (me ListViewItem) EnsureVisible() ListViewItem

Makes sure the item is visible with LVM_ENSUREVISIBLE, scrolling the list view if needed.

Returns the same item, so further operations can be chained.

Panics on error.

func (ListViewItem) Focus

func (me ListViewItem) Focus() ListViewItem

Sets the item as the focused one with LVM_SETITEMSTATE.

Returns the same item, so further operations can be chained.

Panics on error.

func (ListViewItem) IconIndex added in v0.2.0

func (me ListViewItem) IconIndex() int

Retrieves the zero-based icon index with LVM_GETITEM.

Panics on error.

func (ListViewItem) Index

func (me ListViewItem) Index() int

Returns the zero-based index of the item.

func (ListViewItem) IsSelected

func (me ListViewItem) IsSelected() bool

Tells whether the item is currently selected with LVM_GETITEMSTATE.

func (ListViewItem) IsVisible

func (me ListViewItem) IsVisible() bool

Tells whether the item is currently visible with LVM_ISITEMVISIBLE.

func (ListViewItem) ItemRect added in v0.2.0

func (me ListViewItem) ItemRect(portion co.LVIR) win.RECT

Retrieves the coordinates of the rectangle surrounding the item with LVM_GETITEMRECT.

Panics on error.

func (ListViewItem) Next added in v0.2.0

func (me ListViewItem) Next() (ListViewItem, bool)

Returns the next item, if any.

func (ListViewItem) Prev added in v0.2.0

func (me ListViewItem) Prev() (ListViewItem, bool)

Returns the previous item, if any.

func (ListViewItem) Select

func (me ListViewItem) Select(isSelected bool) ListViewItem

Selects or deselects the item with LVM_SETITEMSTATE.

Returns the same item, so further operations can be chained.

Panics on error.

func (ListViewItem) SetData added in v0.2.0

func (me ListViewItem) SetData(data interface{})

Stores user-custom data for this item.

Example

type Person struct {
	Name string
}

var item ui.ListViewItem // initialized somewhere

item.SetData(&Person{Name: "foo"})

if person := item.Data().(*Person); person != nil {
	println(person.Name)
}

func (ListViewItem) SetIconIndex added in v0.2.0

func (me ListViewItem) SetIconIndex(iconIndex int) ListViewItem

Sets the zero-based icon index with LVM_SETITEM.

Returns the same item, so further operations can be chained.

Panics on error.

func (ListViewItem) SetText

func (me ListViewItem) SetText(columnIndex int, text string) ListViewItem

Sets the text of the item at the given column with LVM_SETITEMTEXT.

Returns the same item, so further operations can be chained.

Panics on error.

func (ListViewItem) Text

func (me ListViewItem) Text(columnIndex int) string

Retrieves the text of the item, with LVM_GETITEMTEXT.

func (ListViewItem) Uid added in v0.2.0

func (me ListViewItem) Uid() int

Returns the unique ID associated to the item with LVM_MAPINDEXTOID.

func (ListViewItem) Update

func (me ListViewItem) Update() ListViewItem

Redraws the item immediately with LVM_UPDATE.

Returns the same item, so further operations can be chained.

Panics on error.

type Main added in v0.2.0

type Main struct {
	// contains filtered or unexported fields
}

Main application window.

Implements:

func NewMain added in v0.2.0

func NewMain(opts *VarOptsMain) *Main

Creates a new main window with CreateWindowEx.

Example

runtime.LockOSThread()

wnd := ui.NewMain(
	ui.OptsMain().
		Title("Hello world").
		Size(ui.Dpi(500, 400)).
		Style(co.WS_CAPTION | co.WS_SYSMENU | co.WS_CLIPCHILDREN |
			co.WS_BORDER | co.WS_VISIBLE | co.WS_MINIMIZEBOX |
			co.WS_MAXIMIZEBOX | co.WS_SIZEBOX),
)
wnd.RunAsMain()

func NewMainDlg added in v0.2.0

func NewMainDlg(opts *VarOptsMainDlg) *Main

Creates a new dialog-based Main with CreateDialogParam.

Example

const (
	ID_MAIN_DLG    uint16 = 1000
	ID_MAIN_ICON   uint16 = 101
	ID_MAIN_ACCTBL uint16 = 102
)

runtime.LockOSThread()

wnd := ui.NewMainDlg(
	ui.OptsMainDlg().
		DlgId(ID_MAIN_DLG).
		IconId(ID_MAIN_ICON).
		AccelTableId(ID_MAIN_ACCTBL),
)
wnd.RunAsMain()

func (*Main) Hwnd added in v0.2.0

func (me *Main) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Implements Window.

Note that this handle is initially zero, existing only after window creation.

func (*Main) On added in v0.2.0

func (me *Main) On() *EventsWindow

Exposes all the window notifications the can be handled.

Implements Parent.

Panics if called after the window has been created.

func (*Main) RunAsMain added in v0.2.0

func (me *Main) RunAsMain() int

Physically creates the window, then runs the main application loop. This method will block until the window is closed.

Panics on error.

func (*Main) UiThread added in v0.2.0

func (me *Main) UiThread(fun func())

This method is analog to SendMessage (synchronous), but intended to be called from another thread, so a callback function can, tunelled by WNDPROC, run in the original thread of the window, thus allowing GUI updates. With this, the user doesn't have to deal with a custom WM_ message.

Implements Parent.

Example

var wnd *ui.WindowMain // initialized somewhere

wnd.On().WmCreate(func(p WmCreate) int {
	go func() {
		// process to be done in a parallel goroutine...

		wnd.UiThread(func() {
			// update the UI in the original UI thread...
		})
	}()
	return 0
})
type Modal struct {
	// contains filtered or unexported fields
}

Modal window.

Implements:

func NewModal added in v0.2.0

func NewModal(parent Parent, opts *VarOptsModal) *Modal

Creates a new modal window with CreateWindowEx.

Example

var wndParent ui.Parent // initialized somewhere

wndModal := ui.NewModal(
	wndParent,
	ui.OptsModal().
		Title("Hello modal"),
)
wndModal.ShowModal()

func NewModalDlg added in v0.2.0

func NewModalDlg(parent Parent, dlgId uint16) *Modal

Creates a new dialog-based Modal with DialogBoxParam.

Example

const ID_MODAL_DLG uint16 = 2000

var wndParent ui.Parent // initialized somewhere

wndModal := ui.NewModalDlg(wndParent, 2000)
wndModal.ShowModal()

func (*Modal) Hwnd added in v0.2.0

func (me *Modal) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Implements Window.

Note that this handle is initially zero, existing only after window creation.

func (*Modal) On added in v0.2.0

func (me *Modal) On() *EventsWindow

Exposes all the window notifications the can be handled.

Implements Parent.

Panics if called after the window has been created.

func (*Modal) ShowModal added in v0.2.0

func (me *Modal) ShowModal()

Physically creates the window, then runs the modal loop. This method will block until the window is closed.

func (*Modal) UiThread added in v0.2.0

func (me *Modal) UiThread(fun func())

This method is analog to SendMessage (synchronous), but intended to be called from another thread, so a callback function can, tunelled by WNDPROC, run in the original thread of the window, thus allowing GUI updates. With this, the user doesn't have to deal with a custom WM_ message.

Implements Parent.

Example

var wnd *ui.WindowModal // initialized somewhere

wnd.On().WmCreate(func(p WmCreate) int {
	go func() {
		// process to be done in a parallel goroutine...

		wnd.UiThread(func() {
			// update the UI in the original UI thread...
		})
	}()
	return 0
})

type MonthCalendar

type MonthCalendar struct {
	// contains filtered or unexported fields
}

Native month calendar control.

func NewMonthCalendar

func NewMonthCalendar(parent Parent, opts *VarOptsMonthCalendar) *MonthCalendar

Creates a new MonthCalendar with win.CreateWindowEx.

Example

var wndOwner ui.Parent // initialized somewhere

monthCal := ui.NewMonthCalendar(
	wndOwner,
	ui.OptsMonthCalendar().
		Position(ui.Dpi(20, 135)).
		Value(time.Date(1981, 4, 26, 5, 0, 0, 0, time.Local)),
)

func NewMonthCalendarDlg

func NewMonthCalendarDlg(parent Parent, ctrlId uint16, layout LAY) *MonthCalendar

Instantiates a new MonthCalendar to be loaded from a dialog resource with win.HWND.GetDlgItem.

Example

const ID_MCAL uint16 = 0x100

var wndOwner ui.Parent // initialized somewhere

monthCal := ui.NewMonthCalendarDlg(
	wndOwner, ID_MCAL, ui.LAY_NONE_NONE)

func (*MonthCalendar) CtrlId added in v0.2.0

func (me *MonthCalendar) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*MonthCalendar) Date added in v0.2.0

func (me *MonthCalendar) Date() time.Time

Returns the current date with MCM_GETCURSEL.

func (*MonthCalendar) Focus added in v0.2.0

func (me *MonthCalendar) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*MonthCalendar) Hwnd added in v0.2.0

func (me *MonthCalendar) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*MonthCalendar) On

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*MonthCalendar) OnSubclass added in v0.2.0

func (me *MonthCalendar) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*MonthCalendar) SetDate added in v0.2.0

func (me *MonthCalendar) SetDate(date time.Time) *MonthCalendar

Sets the current date with MCM_SETCURSEL.

Returns the same object, so further operations can be chained.

type Parent added in v0.2.0

type Parent interface {
	Window

	// Exposes all the window notifications the can be handled.
	//
	// Cannot be called after the window was created.
	On() *EventsWindow

	// This method is analog to [SendMessage] (synchronous), but intended to be
	// called from another thread, so a callback function can, tunelled by
	// [WNDPROC], run in the original thread of the window, thus allowing GUI
	// updates. With this, the user doesn't have to deal with a custom WM_
	// message.
	//
	// # Example
	//
	//	var wnd ui.Parent // initialized somewhere
	//
	//	wnd.On().WmCreate(func(_ WmCreate) int {
	//		go func() {
	//			// process to be done in a parallel goroutine...
	//
	//			wnd.UiThread(func() {
	//				// update the UI in the original UI thread...
	//			})
	//		}()
	//		return 0
	//	})
	//
	// [SendMessage]: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessagew
	// [WNDPROC]: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nc-winuser-wndproc
	UiThread(fun func())
	// contains filtered or unexported methods
}

A parent window.

type ProgressBar

type ProgressBar struct {
	// contains filtered or unexported fields
}

Native progress bar control.

func NewProgressBar

func NewProgressBar(parent Parent, opts *VarOptsProgressBar) *ProgressBar

Creates a new ProgressBar with win.CreateWindowEx.

func NewProgressBarDlg

func NewProgressBarDlg(parent Parent, ctrlId uint16, layout LAY) *ProgressBar

Instantiates a new ProgressBar to be loaded from a dialog resource with win.HWND.GetDlgItem.

func (*ProgressBar) CtrlId added in v0.2.0

func (me *ProgressBar) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*ProgressBar) Focus added in v0.2.0

func (me *ProgressBar) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*ProgressBar) Hwnd added in v0.2.0

func (me *ProgressBar) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*ProgressBar) OnSubclass added in v0.2.0

func (me *ProgressBar) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*ProgressBar) Pos

func (me *ProgressBar) Pos() int

Retrieves the current position with PBM_GETPOS.

func (*ProgressBar) Range added in v0.2.0

func (me *ProgressBar) Range() (int, int)

Retrieves the range with PBM_GETRANGE.

func (*ProgressBar) SetMarquee

func (me *ProgressBar) SetMarquee(isMarquee bool) *ProgressBar

Sets indeterminate state, a graphic animation going back and forth, by toggling the PBS_MARQUEE style.

Returns the same object, so further operations can be chained.

func (*ProgressBar) SetPos

func (me *ProgressBar) SetPos(pos int) *ProgressBar

Sets the current position with PBM_SETPOS.

Returns the same object, so further operations can be chained.

func (*ProgressBar) SetRange

func (me *ProgressBar) SetRange(min, max int) *ProgressBar

Sets the range with PBM_SETRANGE32.

Returns the same object, so further operations can be chained.

func (*ProgressBar) SetState

func (me *ProgressBar) SetState(state co.PBST) *ProgressBar

Sets the state with PBM_SETSTATE.

Returns the same object, so further operations can be chained.

type RadioButton

type RadioButton struct {
	// contains filtered or unexported fields
}

Native radio button control.

You cannot create this control directly, it must be created through a RadioGroup.

func (*RadioButton) CtrlId added in v0.2.0

func (me *RadioButton) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*RadioButton) Focus added in v0.2.0

func (me *RadioButton) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*RadioButton) Hwnd added in v0.2.0

func (me *RadioButton) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*RadioButton) Index added in v0.2.0

func (me *RadioButton) Index() uint

Zero-based index of this radio button within its RadioGroup.

func (*RadioButton) IsSelected

func (me *RadioButton) IsSelected() bool

Returns true if the radio button is currently selected, with BM_GETSTATE.

func (*RadioButton) On

func (me *RadioButton) On() *EventsButton

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

Prefer using the RadioGroup notifications, which can handle all radio buttons in the group at once.

func (*RadioButton) OnSubclass added in v0.2.0

func (me *RadioButton) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*RadioButton) Select

func (me *RadioButton) Select() *RadioButton

Selects this radio button with BM_SETCHECK.

Returns the same object, so further operations can be chained.

func (*RadioButton) SelectAndTrigger

func (me *RadioButton) SelectAndTrigger() *RadioButton

Selects this radio button with BM_SETCHECK, then sends a BN_CLICKED notification.

Returns the same object, so further operations can be chained.

func (*RadioButton) SetTextAndResize

func (me *RadioButton) SetTextAndResize(text string) *RadioButton

Sets the current text and resizes the control to exactly fit it.

Returns the same object, so further operations can be chained.

type RadioGroup

type RadioGroup struct {
	// contains filtered or unexported fields
}

Manages a group of native RadioButton controls.

func NewRadioGroup

func NewRadioGroup(parent Parent, allOpts ...*VarOptsRadioButton) *RadioGroup

Creates the RadioButton controls with win.CreateWindowEx.

Panics if the number of radio buttons is zero.

Example

var wndOwner ui.Parent // initialized somewhere

radios := ui.NewRadioGroup(
	wndOwner,
	ui.OptsRadioButton().
		Text("&First").
		Position(260, 125),
	ui.OptsRadioButton().
		Text("&Second").
		Position(260, 145).
		Selected(true),
)

func NewRadioGroupDlg

func NewRadioGroupDlg(parent Parent, layout LAY, ctrlIds ...uint16) *RadioGroup

Instantiates the RadioButton controls to be loaded from a dialog resource with win.HWND.GetDlgItem.

Panics if the number of radio buttons is zero.

func (*RadioGroup) Count added in v0.2.0

func (me *RadioGroup) Count() uint

Returns the number of RadioButton controls.

func (*RadioGroup) Enable added in v0.2.0

func (me *RadioGroup) Enable(enable bool) *RadioGroup

Enables or disables all RadioButton controls at once with win.HWND.EnableWindow.

Returns the same object, so further operations can be chained.

func (*RadioGroup) Get added in v0.2.0

func (me *RadioGroup) Get(index uint) *RadioButton

Returns the RadioButton at the given index.

func (*RadioGroup) GetById added in v0.2.0

func (me *RadioGroup) GetById(ctrlId uint16) *RadioButton

Returns the RadioButton with the given control ID, or nil if none.

func (*RadioGroup) On

func (me *RadioGroup) On() *EventsRadioGroup

Exposes all the control notifications the can be handled for all RadioButton controls at once.

Panics if called after the controls have been created.

func (*RadioGroup) Selected

func (me *RadioGroup) Selected() *RadioButton

Returns the selected RadioButton, or nil if none.

type Static

type Static struct {
	// contains filtered or unexported fields
}

Native static (label) control.

func NewStatic

func NewStatic(parent Parent, opts *VarOptsStatic) *Static

Creates a new Static with win.CreateWindowEx.

func NewStaticDlg

func NewStaticDlg(parent Parent, ctrlId uint16, layout LAY) *Static

Instantiates a new Static to be loaded from a dialog resource with win.HWND.GetDlgItem.

func (*Static) CtrlId added in v0.2.0

func (me *Static) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*Static) Focus added in v0.2.0

func (me *Static) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*Static) Hwnd added in v0.2.0

func (me *Static) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*Static) On

func (me *Static) On() *EventsStatic

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*Static) OnSubclass added in v0.2.0

func (me *Static) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*Static) SetTextAndResize

func (me *Static) SetTextAndResize(text string) *Static

Calls win.HWND.SetWindowText and resizes the control to exactly fit it.

func (*Static) Text added in v0.2.0

func (me *Static) Text() string

Calls win.HWND.GetWindowText.

type StatusBar

type StatusBar struct {
	Parts CollectionStatusBarParts // Methods to interact with the parts collection.
	// contains filtered or unexported fields
}

Native status bar control.

func NewStatusBar

func NewStatusBar(parent Parent) *StatusBar

Creates a new StatusBar with win.CreateWindowEx.

func (*StatusBar) CtrlId added in v0.2.0

func (me *StatusBar) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*StatusBar) Focus added in v0.2.0

func (me *StatusBar) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*StatusBar) Hwnd added in v0.2.0

func (me *StatusBar) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*StatusBar) On

func (me *StatusBar) On() *EventsStatusBar

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*StatusBar) OnSubclass added in v0.2.0

func (me *StatusBar) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

type StatusBarPart

type StatusBarPart struct {
	// contains filtered or unexported fields
}

A part from a status bar.

func (StatusBarPart) Icon

func (me StatusBarPart) Icon() win.HICON

Retrieves the icon with SB_GETICON.

The icon is shared, the StatusBar doesn't own it.

func (StatusBarPart) Index

func (me StatusBarPart) Index() int

Returns the zero-based index of the column.

func (StatusBarPart) SetIcon

func (me StatusBarPart) SetIcon(hIcon win.HICON) StatusBarPart

Sets the icon with SB_SETICON.

The icon is shared, the StatusBar doesn't own it.

Returns the same part, so further operations can be chained.

func (StatusBarPart) SetText

func (me StatusBarPart) SetText(text string) StatusBarPart

Sets the text with SB_SETTEXT.

Returns the same part, so further operations can be chained.

Panics on error.

func (StatusBarPart) Text

func (me StatusBarPart) Text() string

Retrieves the text with SB_GETTEXT.

type SysLink struct {
	// contains filtered or unexported fields
}

Native syslink control.

func NewSysLink(parent Parent, opts *VarOptsSysLink) *SysLink

Creates a new SysLink with win.CreateWindowEx.

func NewSysLinkDlg

func NewSysLinkDlg(parent Parent, ctrlId uint16, layout LAY) *SysLink

Instantiates a new SysLink to be loaded from a dialog resource with win.HWND.GetDlgItem.

func (*SysLink) CtrlId added in v0.2.0

func (me *SysLink) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*SysLink) Focus added in v0.2.0

func (me *SysLink) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*SysLink) Hwnd added in v0.2.0

func (me *SysLink) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*SysLink) On

func (me *SysLink) On() *EventsSysLink

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*SysLink) OnSubclass added in v0.2.0

func (me *SysLink) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*SysLink) SetTextAndResize

func (me *SysLink) SetTextAndResize(text string) *SysLink

Calls win.HWND.SetWindowText and resizes the control to exactly fit it.

var link ui.SysLink // initialized somewhere

link.SetTextAndResize(
	"Link <a href=\"https://google.com\">here</a>")

func (*SysLink) Text added in v0.2.0

func (me *SysLink) Text() string

Calls win.HWND.GetWindowText.

type Tab added in v0.2.0

type Tab struct {
	Items CollectionTabItems // Methods to interact with the items collection.
	// contains filtered or unexported fields
}

Native tab control.

func NewTab added in v0.2.0

func NewTab(parent Parent, opts *VarOptsTab) *Tab

Creates a new Tab with win.CreateWindowEx.

Example

var (
	wndOwner ui.Parent // initialized somewhere
	child1   *ui.Control
	child2   *ui.Control
)

tab := ui.NewTab(
	wndOwner,
	ui.OptsTab().
		Position(ui.Dpi(510, 20)).
		Size(ui.Dpi(170, 180)).
		Items(
			ui.TabIns{Title: "First", Content: child1},
			ui.TabIns{Title: "Second", Content: child2},
		),
)

func NewTabDlg added in v0.2.0

func NewTabDlg(parent Parent, ctrlId uint16, layout LAY, items ...TabIns) *Tab

Instantiates a new Tab to be loaded from a dialog resource with win.HWND.GetDlgItem.

func (*Tab) CtrlId added in v0.2.0

func (me *Tab) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*Tab) Focus added in v0.2.0

func (me *Tab) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*Tab) Hwnd added in v0.2.0

func (me *Tab) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*Tab) On added in v0.2.0

func (me *Tab) On() *EventsTab

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*Tab) OnSubclass added in v0.2.0

func (me *Tab) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*Tab) SetExtendedStyle added in v0.2.0

func (me *Tab) SetExtendedStyle(doSet bool, style co.TCS_EX) *Tab

Adds or removes extended styles with TCM_SETEXTENDEDSTYLE.

Returns the same object, so further operations can be chained.

type TabIns added in v0.2.0

type TabIns struct {
	Title   string   // Title of the tab.
	Content *Control // Custom control to be rendered inside the tab.
}

Title and content of a tab to be added to a Tab control in NewTab.

type TabItem added in v0.2.0

type TabItem struct {
	// contains filtered or unexported fields
}

An item from a tab.

func (TabItem) Index added in v0.2.0

func (me TabItem) Index() int

Returns the zero-based index of the item.

func (TabItem) Select added in v0.2.0

func (me TabItem) Select() TabItem

Selects this tab with TCM_SETCURSEL.

Returns the same item, so further operations can be chained.

func (TabItem) SetText added in v0.2.0

func (me TabItem) SetText(text string) TabItem

Sets the text with TCM_SETITEM.

Returns the same item, so further operations can be chained.

Panics on error.

func (TabItem) Text added in v0.2.0

func (me TabItem) Text() string

Retrieves the text with TCM_GETITEM.

Panics on error.

type Toolbar

type Toolbar struct {
	Buttons CollectionToolbarButtons // Methods to interact with the buttons collection.
	// contains filtered or unexported fields
}

Native toolbar control.

func NewToolbar

func NewToolbar(parent Parent, opts *VarOptsToolbar) *Toolbar

Creates a new Toolbar with win.CreateWindowEx.

func (*Toolbar) CtrlId added in v0.2.0

func (me *Toolbar) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*Toolbar) ExtendedStyle

func (me *Toolbar) ExtendedStyle() co.TBSTYLE_EX

Retrieves the extended style with TB_GETEXTENDEDSTYLE.

func (*Toolbar) Focus added in v0.2.0

func (me *Toolbar) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*Toolbar) Hwnd added in v0.2.0

func (me *Toolbar) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*Toolbar) ImageList added in v0.2.0

func (me *Toolbar) ImageList(cx, cy int) win.HIMAGELIST

Retrieves the image list with TB_GETIMAGELIST. The image list is lazy-initialized: the first time you call this method, it will be created and assigned with TB_SETIMAGELIST.

The icon size is used to create the image list on the first call. Subsequent calls will ignore cx and cy parameters.

The image list will be automatically destroyed.

func (*Toolbar) On

func (me *Toolbar) On() *EventsToolbar

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*Toolbar) OnSubclass added in v0.2.0

func (me *Toolbar) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*Toolbar) SetExtendedStyle

func (me *Toolbar) SetExtendedStyle(doSet bool, style co.TBSTYLE_EX) *Toolbar

Adds or removes extended styles with [TB_SETEXTENDEDSTYLE].

Returns the same object, so further operations can be chained.

type Trackbar

type Trackbar struct {
	// contains filtered or unexported fields
}

Native trackbar control.

func NewTrackbar

func NewTrackbar(parent Parent, opts *VarOptsTrackbar) *Trackbar

Creates a new Trackbar with win.CreateWindowEx.

Example

var wndOwner ui.Parent // initialized somewhere

trackbar := ui.NewTrackbar(
	wndOwner,
	ui.OptsTrackbar().
		Position(ui.Dpi(100, 100)).
		Range(0, 10),
)

trackbar.On().WmHScroll(func(_ WmScroll) {
	println("Pos", trackbar.Pos())
})

func NewTrackbarDlg

func NewTrackbarDlg(parent Parent, ctrlId uint16, layout LAY) *Trackbar

Instantiates a new Trackbar to be loaded from a dialog resource with win.HWND.GetDlgItem.

func (*Trackbar) CtrlId added in v0.2.0

func (me *Trackbar) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*Trackbar) Focus added in v0.2.0

func (me *Trackbar) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*Trackbar) Hwnd added in v0.2.0

func (me *Trackbar) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*Trackbar) On

func (me *Trackbar) On() *EventsTrackbar

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*Trackbar) OnSubclass added in v0.2.0

func (me *Trackbar) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*Trackbar) PageSize

func (me *Trackbar) PageSize() int

Retrieves the page with with TBM_GETPAGESIZE.

func (*Trackbar) Pos

func (me *Trackbar) Pos() int

Retrieves the current position with TBM_GETPOS.

func (*Trackbar) Range added in v0.2.0

func (me *Trackbar) Range() (int, int)

Retrieves the minimum and maximum position values with TBM_GETRANGEMIN, TBM_GETRANGEMAX.

func (*Trackbar) SetPageSize

func (me *Trackbar) SetPageSize(pageSize int) *Trackbar

Sets the page size with TBM_SETPAGESIZE.

func (*Trackbar) SetPos

func (me *Trackbar) SetPos(pos int) *Trackbar

Sets the current position witn TBM_SETPOS.

func (*Trackbar) SetRange added in v0.2.0

func (me *Trackbar) SetRange(min, max int) *Trackbar

Sets the minimum and maximum position values with TBM_SETRANGEMIN and TBM_SETRANGEMAX.

type TreeView

type TreeView struct {
	Items CollectionTreeViewItems // Methods to interact with the items collection.
	// contains filtered or unexported fields
}

Native tree view control.

func NewTreeView

func NewTreeView(parent Parent, opts *VarOptsTreeView) *TreeView

Creates a new TreeView with win.CreateWindowEx.

func NewTreeViewDlg

func NewTreeViewDlg(parent Parent, ctrlId uint16, layout LAY) *TreeView

Instantiates a new TreeView to be loaded from a dialog resource with win.HWND.GetDlgItem.

func (*TreeView) CtrlId added in v0.2.0

func (me *TreeView) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*TreeView) Focus added in v0.2.0

func (me *TreeView) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*TreeView) Hwnd added in v0.2.0

func (me *TreeView) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*TreeView) ImageList added in v0.2.0

func (me *TreeView) ImageList(which co.TVSIL) win.HIMAGELIST

Retrieves the given image list with TVM_GETIMAGELIST. The image lists are lazy-initialized: the first time you call this method for a given image list, it will be created and assigned with TVM_SETIMAGELIST.

The image lists will be automatically destroyed.

func (*TreeView) On

func (me *TreeView) On() *EventsTreeView

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*TreeView) OnSubclass added in v0.2.0

func (me *TreeView) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*TreeView) SetExtendedStyle added in v0.2.0

func (me *TreeView) SetExtendedStyle(doSet bool, style co.TVS_EX) *TreeView

Adds or removes extended styles with TVM_SETEXTENDEDSTYLE.

Returns the same object, so further operations can be chained.

type TreeViewItem

type TreeViewItem struct {
	// contains filtered or unexported fields
}

An item from a tree view.

func (TreeViewItem) AddChild

func (me TreeViewItem) AddChild(text string, iconIndex int) TreeViewItem

Adds a child to this item with TVM_INSERTITEM, returning the new item.

The iconIndex is the zero-based index of the icon previously inserted into the control's image list, or -1 for no icon.

Panics on error.

func (TreeViewItem) Children

func (me TreeViewItem) Children() []TreeViewItem

Returns the child items with TVM_GETNEXTITEM.

func (TreeViewItem) Data added in v0.2.0

func (me TreeViewItem) Data() interface{}

Returns the user-custom data stored for this item, or nil if none.

Example

type Person struct {
	Name string
}

var item ui.TreeViewItem // initialized somewhere

item.SetData(&Person{Name: "foo"})

if person := item.Data().(*Person); person != nil {
	println(person.Name)
}

func (TreeViewItem) Delete

func (me TreeViewItem) Delete()

Deletes the item and all its children with TVM_DELETEITEM.

Panics on error.

func (TreeViewItem) EnsureVisible

func (me TreeViewItem) EnsureVisible() TreeViewItem

Makes sure the item is visible with TVM_ENSUREVISIBLE, scrolling the control if needed.

Returns the same item, so further operations can be chained.

func (TreeViewItem) Expand

func (me TreeViewItem) Expand(doExpand bool) TreeViewItem

Expands the item with TVM_EXPAND.

Returns the same item, so further operations can be chained.

func (TreeViewItem) Htreeitem

func (me TreeViewItem) Htreeitem() win.HTREEITEM

Returns the unique handle that identifies item.

func (TreeViewItem) IconIndex added in v0.2.0

func (me TreeViewItem) IconIndex() int

Retrieves the zero-based icon index with TVM_GETITEM.

Panics on error.

func (TreeViewItem) IsExpanded

func (me TreeViewItem) IsExpanded() bool

Returns true if the item is currently expanded, with TVM_GETITEMSTATE.

func (TreeViewItem) IsRoot

func (me TreeViewItem) IsRoot() bool

Returns true if the item has no parent.

func (TreeViewItem) NextSibling

func (me TreeViewItem) NextSibling() (TreeViewItem, bool)

Retrieves the next sibling item, if any, with TVM_GETNEXTITEM.

func (TreeViewItem) Parent

func (me TreeViewItem) Parent() (TreeViewItem, bool)

Retrieves the parent item, if any, with TVM_GETNEXTITEM.

func (TreeViewItem) PrevSibling

func (me TreeViewItem) PrevSibling() (TreeViewItem, bool)

Retrieves the previous item, if any, with TVM_GETNEXTITEM.

func (TreeViewItem) SetData added in v0.2.0

func (me TreeViewItem) SetData(data interface{})

Stores user-custom data for this item.

Example

type Person struct {
	Name string
}

var item ui.TreeViewItem // initialized somewhere

item.SetData(&Person{Name: "foo"})

if person := item.Data().(*Person); person != nil {
	println(person.Name)
}

func (TreeViewItem) SetIconIndex added in v0.2.0

func (me TreeViewItem) SetIconIndex(iconIndex int) TreeViewItem

Sets the zero-based icon index with TVM_SETITEM.

Returns the same item, so further operations can be chained.

Panics on error.

func (TreeViewItem) SetText

func (me TreeViewItem) SetText(text string) TreeViewItem

Sets the text of the item with TVM_SETITEM.

Returns the same item, so further operations can be chained.

Panics on error.

func (TreeViewItem) Text

func (me TreeViewItem) Text() string

Retrieves the text of the item with TVM_GETITEM.

Panics on error.

type UpDown added in v0.2.0

type UpDown struct {
	// contains filtered or unexported fields
}

Native up-down control.

func NewUpDown added in v0.2.0

func NewUpDown(parent Parent, opts *VarOptsUpDown) *UpDown

Creates a new UpDown with win.CreateWindowEx.

If co.UDS_AUTOBUDDY control style is set, the UpDown will use the immediately previous control – usually an Edit – as its buddy, attaching itself to it.

Example

var wndOwner ui.Parent // initialized somewhere

txt := ui.NewEdit( // will be taken as the buddy control
	wndOwner,
	ui.OptsEdit().
		Position(ui.Dpi(10, 10)).
		Width(ui.DpiY(50)),
)

upDn := ui.NewUpDown(
	wndOwner,
	ui.OptsUpDown().
		Range(0, 10),
)

func NewUpDownDlg added in v0.2.0

func NewUpDownDlg(parent Parent, ctrlId uint16, layout LAY) *UpDown

Instantiates a new UpDown to be loaded from a dialog resource with win.HWND.GetDlgItem.

If co.UDS_AUTOBUDDY control style is set, the UpDown will use the immediately previous control – usually an Edit – as its buddy, attaching itself to it.

func (*UpDown) CtrlId added in v0.2.0

func (me *UpDown) CtrlId() uint16

Returns the control ID, unique within the same Parent.

func (*UpDown) Focus added in v0.2.0

func (me *UpDown) Focus()

If parent is a dialog, sets the focus by sending WM_NEXTDLGCTL. This draws the borders correctly in some undefined controls, like buttons.

Otherwise, calls win.HWND.SetFocus.

func (*UpDown) Hwnd added in v0.2.0

func (me *UpDown) Hwnd() win.HWND

Returns the underlying HWND handle of this window.

Note that this handle is initially zero, existing only after window creation.

func (*UpDown) On added in v0.2.0

func (me *UpDown) On() *EventsUpDown

Exposes all the control notifications the can be handled.

Panics if called after the control has been created.

func (*UpDown) OnSubclass added in v0.2.0

func (me *UpDown) OnSubclass() *EventsWindow

Exposes all the subclass events the can be handled.

Panics if called after the control was created.

Note that subclassing is a potentially slow technique, prefer using ordinary events.

func (*UpDown) Radix added in v0.2.0

func (me *UpDown) Radix() uint

Retrieves the radix with UDM_GETBASE. Can be 10 (decimal) or 16 (hexadecimal).

func (*UpDown) Range added in v0.2.0

func (me *UpDown) Range() (int, int)

Retrieves the range with UDM_GETRANGE32.

func (*UpDown) SetRadix added in v0.2.0

func (me *UpDown) SetRadix(radix uint) *UpDown

Sets the radix with UDM_SETBASE. Must be 10 (decimal) or 16 (hexadecimal).

Returns the same object, so further operations can be chained.

func (*UpDown) SetRange added in v0.2.0

func (me *UpDown) SetRange(min, max int) *UpDown

Sets the range with UDM_SETRANGE32.

Returns the same object, so further operations can be chained.

func (*UpDown) SetValue added in v0.2.0

func (me *UpDown) SetValue(val int) *UpDown

Sets the value with UDM_SETPOS32.

Returns the same object, so further operations can be chained.

func (*UpDown) Value added in v0.2.0

func (me *UpDown) Value() (int, bool)

Retrieves the value with UDM_GETPOS32, which may be invalid.

type VarOptsButton added in v0.2.0

type VarOptsButton struct {
	// contains filtered or unexported fields
}

Options for NewButton; returned by OptsButton.

func OptsButton added in v0.2.0

func OptsButton() *VarOptsButton

Options for NewButton.

func (*VarOptsButton) CtrlId added in v0.2.0

func (o *VarOptsButton) CtrlId(id uint16) *VarOptsButton

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsButton) CtrlStyle added in v0.2.0

func (o *VarOptsButton) CtrlStyle(s co.BS) *VarOptsButton

Button control style, passed to win.CreateWindowEx.

Defaults to co.BS_PUSHBUTTON.

func (*VarOptsButton) Height added in v0.2.0

func (o *VarOptsButton) Height(h int) *VarOptsButton

Control width in pixels, passed to win.CreateWindowEx.

Defaults to ui.DpiY(26).

func (*VarOptsButton) Layout added in v0.2.0

func (o *VarOptsButton) Layout(l LAY) *VarOptsButton

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsButton) Position added in v0.2.0

func (o *VarOptsButton) Position(x, y int) *VarOptsButton

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsButton) Text added in v0.2.0

func (o *VarOptsButton) Text(t string) *VarOptsButton

Text to be displayed, passed to win.CreateWindowEx.

Defaults to empty string.

func (*VarOptsButton) Width added in v0.2.0

func (o *VarOptsButton) Width(w int) *VarOptsButton

Control height in pixels, passed to win.CreateWindowEx.

Defaults to ui.DpiX(88).

func (*VarOptsButton) WndExStyle added in v0.2.0

func (o *VarOptsButton) WndExStyle(s co.WS_EX) *VarOptsButton

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT.

func (*VarOptsButton) WndStyle added in v0.2.0

func (o *VarOptsButton) WndStyle(s co.WS) *VarOptsButton

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_VISIBLE | co.WS_TABSTOP | co.WS_GROUP.

type VarOptsCheckBox added in v0.2.0

type VarOptsCheckBox struct {
	// contains filtered or unexported fields
}

Options for NewCheckBox; returned by OptsCheckBox.

func OptsCheckBox added in v0.2.0

func OptsCheckBox() *VarOptsCheckBox

Options for NewCheckBox].

func (*VarOptsCheckBox) CtrlId added in v0.2.0

func (o *VarOptsCheckBox) CtrlId(id uint16) *VarOptsCheckBox

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsCheckBox) CtrlStyle added in v0.2.0

func (o *VarOptsCheckBox) CtrlStyle(s co.BS) *VarOptsCheckBox

Check box control style, passed to win.CreateWindowEx.

Defaults to co.BS_AUTOCHECKBOX.

func (*VarOptsCheckBox) Layout added in v0.2.0

func (o *VarOptsCheckBox) Layout(l LAY) *VarOptsCheckBox

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsCheckBox) Position added in v0.2.0

func (o *VarOptsCheckBox) Position(x, y int) *VarOptsCheckBox

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsCheckBox) Size added in v0.2.0

func (o *VarOptsCheckBox) Size(cx int, cy int) *VarOptsCheckBox

Control size in pixels, passed to win.CreateWindowEx.

Defaults to fit current text.

func (*VarOptsCheckBox) State added in v0.2.0

func (o *VarOptsCheckBox) State(s co.BST) *VarOptsCheckBox

Sets the initial state of the check box.

Defaults to co.BST_UNCHECKED.

func (*VarOptsCheckBox) Text added in v0.2.0

Text to be displayed, passed to win.CreateWindowEx.

Defaults to empty string.

func (*VarOptsCheckBox) WndExStyle added in v0.2.0

func (o *VarOptsCheckBox) WndExStyle(s co.WS_EX) *VarOptsCheckBox

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT.

func (*VarOptsCheckBox) WndStyle added in v0.2.0

func (o *VarOptsCheckBox) WndStyle(s co.WS) *VarOptsCheckBox

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_VISIBLE | co.WS_TABSTOP | co.WS_GROUP.

type VarOptsComboBox added in v0.2.0

type VarOptsComboBox struct {
	// contains filtered or unexported fields
}

Options for NewComboBox; returned by OptsComboBox.

func OptsComboBox added in v0.2.0

func OptsComboBox() *VarOptsComboBox

Options for NewComboBox.

func (*VarOptsComboBox) CtrlId added in v0.2.0

func (o *VarOptsComboBox) CtrlId(id uint16) *VarOptsComboBox

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsComboBox) CtrlStyle added in v0.2.0

func (o *VarOptsComboBox) CtrlStyle(s co.CBS) *VarOptsComboBox

Combo box control style, passed to win.CreateWindowEx.

Defaults to co.CBS_DROPDOWNLIST.

func (*VarOptsComboBox) Layout added in v0.2.0

func (o *VarOptsComboBox) Layout(l LAY) *VarOptsComboBox

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsComboBox) Position added in v0.2.0

func (o *VarOptsComboBox) Position(x, y int) *VarOptsComboBox

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsComboBox) Selected added in v0.2.0

func (o *VarOptsComboBox) Selected(i int) *VarOptsComboBox

Zero-based index of the item initially selected.

Defaults to -1 (none).

func (*VarOptsComboBox) Texts added in v0.2.0

func (o *VarOptsComboBox) Texts(t ...string) *VarOptsComboBox

Texts to be added to the ComboBox.

Defaults to none.

func (*VarOptsComboBox) Width added in v0.2.0

func (o *VarOptsComboBox) Width(w int) *VarOptsComboBox

Control width in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(100).

func (*VarOptsComboBox) WndExStyle added in v0.2.0

func (o *VarOptsComboBox) WndExStyle(s co.WS_EX) *VarOptsComboBox

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT.

func (*VarOptsComboBox) WndStyle added in v0.2.0

func (o *VarOptsComboBox) WndStyle(s co.WS) *VarOptsComboBox

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_VISIBLE | co.WS_TABSTOP | co.WS_GROUP.

type VarOptsControl added in v0.2.0

type VarOptsControl struct {
	// contains filtered or unexported fields
}

Options for NewControl; returned by OptsControl.

func OptsControl added in v0.2.0

func OptsControl() *VarOptsControl

Options for NewControl.

func (*VarOptsControl) ClassBrush added in v0.2.0

func (o *VarOptsControl) ClassBrush(h win.HBRUSH) *VarOptsControl

Window background brush, passed to RegisterClassEx.

Defaults to co.COLOR_WINDOW color.

Example

ui.OptsControl().
	ClassBrush(win.HBRUSH(co.COLOR_WINDOW + 1))

func (*VarOptsControl) ClassCursor added in v0.2.0

func (o *VarOptsControl) ClassCursor(h win.HCURSOR) *VarOptsControl

Window cursor, passed to RegisterClassEx.

Defaults to stock co.IDC_ARROW.

Example

hCursor, _ := win.HINSTANCE(0).
	LoadCursor(win.CursorResIdc(co.IDC_ARROW))

ui.OptsControl().
	ClassCursor(hCursor)

func (*VarOptsControl) ClassName added in v0.2.0

func (o *VarOptsControl) ClassName(s string) *VarOptsControl

Class name registered with RegisterClassEx.

Defaults to a computed hash.

func (*VarOptsControl) ClassStyle added in v0.2.0

func (o *VarOptsControl) ClassStyle(s co.CS) *VarOptsControl

Window class style, passed to RegisterClassEx.

Defaults to co.CS_DBLCLKS.

func (*VarOptsControl) CtrlId added in v0.2.0

func (o *VarOptsControl) CtrlId(id uint16) *VarOptsControl

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsControl) ExStyle added in v0.2.0

func (o *VarOptsControl) ExStyle(s co.WS_EX) *VarOptsControl

Extended window style, passed to CreateWindowEx.

Defaults to co.WS_EX_LEFT | co.WS_EX_CLIENTEDGE.

func (*VarOptsControl) Layout added in v0.2.0

func (o *VarOptsControl) Layout(l LAY) *VarOptsControl

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsControl) Position added in v0.2.0

func (o *VarOptsControl) Position(x, y int) *VarOptsControl

Position coordinates within parent window client area, passed to CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsControl) Size added in v0.2.0

func (o *VarOptsControl) Size(cx int, cy int) *VarOptsControl

Control size in pixels, passed to CreateWindowEx.

Defaults to ui.Dpi(300, 200).

func (*VarOptsControl) Style added in v0.2.0

func (o *VarOptsControl) Style(s co.WS) *VarOptsControl

Window style, passed to CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_TABSTOP | co.WS_GROUP | co.WS_VISIBLE | co.WS_CLIPCHILDREN | co.WS_CLIPSIBLINGS.

type VarOptsControlDlg added in v0.2.0

type VarOptsControlDlg struct {
	// contains filtered or unexported fields
}

Options for NewControlDlg; returned by OptsControlDlg.

func OptsControlDlg added in v0.2.0

func OptsControlDlg() *VarOptsControlDlg

Options for NewControlDlg.

func (*VarOptsControlDlg) CtrlId added in v0.2.0

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsControlDlg) DlgId added in v0.2.0

Dialog resource ID passed to CreateDialogParam.

Panics if not informed.

func (*VarOptsControlDlg) Layout added in v0.2.0

func (o *VarOptsControlDlg) Layout(l LAY) *VarOptsControlDlg

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsControlDlg) Position added in v0.2.0

func (o *VarOptsControlDlg) Position(x, y int) *VarOptsControlDlg

Position coordinates within parent window client area.

Defaults to ui.Dpi(0, 0).

type VarOptsDateTimePicker added in v0.2.0

type VarOptsDateTimePicker struct {
	// contains filtered or unexported fields
}

Options for NewDateTimePicker; returned by OptsDateTimePicker.

func OptsDateTimePicker added in v0.2.0

func OptsDateTimePicker() *VarOptsDateTimePicker

Options for NewDateTimePicker.

func (*VarOptsDateTimePicker) CtrlId added in v0.2.0

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsDateTimePicker) CtrlStyle added in v0.2.0

Date and time picker control style, passed to win.CreateWindowEx.

Defaults to co.DTS_LONGDATEFORMAT.

func (*VarOptsDateTimePicker) Layout added in v0.2.0

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsDateTimePicker) Position added in v0.2.0

func (o *VarOptsDateTimePicker) Position(x, y int) *VarOptsDateTimePicker

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsDateTimePicker) Size added in v0.2.0

Control size in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(230, 23).

func (*VarOptsDateTimePicker) Value added in v0.2.0

Initial value.

Defaults to time.Now.

func (*VarOptsDateTimePicker) WndExStyle added in v0.2.0

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT | co.WS_EX_CLIENTEDGE.

func (*VarOptsDateTimePicker) WndStyle added in v0.2.0

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_GROUP | co.WS_TABSTOP | co.WS_VISIBLE.

type VarOptsEdit added in v0.2.0

type VarOptsEdit struct {
	// contains filtered or unexported fields
}

Options for NewEdit; returned by OptsEdit.

func OptsEdit added in v0.2.0

func OptsEdit() *VarOptsEdit

Options for NewEdit.

func (*VarOptsEdit) CtrlId added in v0.2.0

func (o *VarOptsEdit) CtrlId(id uint16) *VarOptsEdit

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsEdit) CtrlStyle added in v0.2.0

func (o *VarOptsEdit) CtrlStyle(s co.ES) *VarOptsEdit

Edit control style, passed to win.CreateWindowEx.

Defaults to co.ES_AUTOHSCROLL | co.ES_NOHIDESEL.

func (*VarOptsEdit) Height added in v0.2.0

func (o *VarOptsEdit) Height(h int) *VarOptsEdit

Control height in pixels, passed to win.CreateWindowEx.

Defaults to ui.DpiY(23).

func (*VarOptsEdit) Layout added in v0.2.0

func (o *VarOptsEdit) Layout(l LAY) *VarOptsEdit

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsEdit) Position added in v0.2.0

func (o *VarOptsEdit) Position(x, y int) *VarOptsEdit

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsEdit) Text added in v0.2.0

func (o *VarOptsEdit) Text(t string) *VarOptsEdit

Text to be displayed, passed to win.CreateWindowEx.

Defaults to empty string.

func (*VarOptsEdit) Width added in v0.2.0

func (o *VarOptsEdit) Width(w int) *VarOptsEdit

Control width in pixels, passed to win.CreateWindowEx.

Defaults to ui.DpiX(100).

func (*VarOptsEdit) WndExStyle added in v0.2.0

func (o *VarOptsEdit) WndExStyle(s co.WS_EX) *VarOptsEdit

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT | co.WS_EX_CLIENTEDGE.

func (*VarOptsEdit) WndStyle added in v0.2.0

func (o *VarOptsEdit) WndStyle(s co.WS) *VarOptsEdit

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_VISIBLE | co.WS_TABSTOP | co.WS_GROUP.

type VarOptsHeader added in v0.2.0

type VarOptsHeader struct {
	// contains filtered or unexported fields
}

Options for NewHeader; returned by OptsHeader.

func OptsHeader added in v0.2.0

func OptsHeader() *VarOptsHeader

Options for NewHeader.

func (*VarOptsHeader) CtrlId added in v0.2.0

func (o *VarOptsHeader) CtrlId(id uint16) *VarOptsHeader

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsHeader) CtrlStyle added in v0.2.0

func (o *VarOptsHeader) CtrlStyle(s co.HDS) *VarOptsHeader

Header control style, passed to win.CreateWindowEx.

Defaults to co.HDS_BUTTONS | co.HDS_HORZ.

func (*VarOptsHeader) Layout added in v0.2.0

func (o *VarOptsHeader) Layout(l LAY) *VarOptsHeader

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsHeader) Position added in v0.2.0

func (o *VarOptsHeader) Position(x, y int) *VarOptsHeader

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsHeader) Size added in v0.2.0

func (o *VarOptsHeader) Size(cx int, cy int) *VarOptsHeader

Control size in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(100, 23).

func (*VarOptsHeader) WndExStyle added in v0.2.0

func (o *VarOptsHeader) WndExStyle(s co.WS_EX) *VarOptsHeader

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT.

func (*VarOptsHeader) WndStyle added in v0.2.0

func (o *VarOptsHeader) WndStyle(s co.WS) *VarOptsHeader

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_GROUP | co.WS_VISIBLE | co.WS_BORDER.

type VarOptsListView added in v0.2.0

type VarOptsListView struct {
	// contains filtered or unexported fields
}

Options for NewListView; returned by OptsListView.

func OptsListView added in v0.2.0

func OptsListView() *VarOptsListView

Options for NewListView.

func (*VarOptsListView) ContextMenu added in v0.2.0

func (o *VarOptsListView) ContextMenu(h win.HMENU) *VarOptsListView

Context menu popup.

This menu is owned by the list view. It will be automatically destroyed.

Defaults to none.

Example

hInst, _ := win.GetModuleHandle("")
hMenu, _ := hInst.LoadMenu(win.ResIdInt(0x101))

ui.ListViewOpts().
	ContextMenu(hMenu)

func (*VarOptsListView) CtrlExStyle added in v0.2.0

func (o *VarOptsListView) CtrlExStyle(s co.LVS_EX) *VarOptsListView

List view control extended style.

Defaults to co.LVS_EX_NONE.

func (*VarOptsListView) CtrlId added in v0.2.0

func (o *VarOptsListView) CtrlId(id uint16) *VarOptsListView

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsListView) CtrlStyle added in v0.2.0

func (o *VarOptsListView) CtrlStyle(s co.LVS) *VarOptsListView

List view control style, passed to win.CreateWindowEx.

Since the image lists are managed by the control, co.LVS_SHAREIMAGELISTS won't be allowed.

Defaults to co.LVS_REPORT | co.LVS_NOSORTHEADER | co.LVS_SHOWSELALWAYS.

func (*VarOptsListView) Layout added in v0.2.0

func (o *VarOptsListView) Layout(l LAY) *VarOptsListView

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsListView) Position added in v0.2.0

func (o *VarOptsListView) Position(x, y int) *VarOptsListView

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsListView) Size added in v0.2.0

func (o *VarOptsListView) Size(cx int, cy int) *VarOptsListView

Control size in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(120, 120).

func (*VarOptsListView) WndExStyle added in v0.2.0

func (o *VarOptsListView) WndExStyle(s co.WS_EX) *VarOptsListView

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT | co.WS_EX_CLIENTEDGE.

func (*VarOptsListView) WndStyle added in v0.2.0

func (o *VarOptsListView) WndStyle(s co.WS) *VarOptsListView

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_GROUP | co.WS_TABSTOP | co.WS_VISIBLE.

type VarOptsMain added in v0.2.0

type VarOptsMain struct {
	// contains filtered or unexported fields
}

Options for NewMain; returned by OptsMain.

func OptsMain added in v0.2.0

func OptsMain() *VarOptsMain

Options for NewMain.

func (*VarOptsMain) AccelTable added in v0.2.0

func (o *VarOptsMain) AccelTable(a win.HACCEL) *VarOptsMain

Main accelerator table to the window, passed to CreateWindowEx. Defaults to none.

func (*VarOptsMain) ClassBrush added in v0.2.0

func (o *VarOptsMain) ClassBrush(h win.HBRUSH) *VarOptsMain

Window background brush, passed to RegisterClassEx.

Defaults to co.COLOR_BTNFACE color.

Example

ui.OptsControl().
	ClassBrush(win.HBRUSH(co.COLOR_BTNFACE + 1))

func (*VarOptsMain) ClassCursor added in v0.2.0

func (o *VarOptsMain) ClassCursor(h win.HCURSOR) *VarOptsMain

Window cursor, passed to RegisterClassEx.

Defaults to stock co.IDC_ARROW.

Example

hCursor, _ := win.HINSTANCE(0).
	LoadCursor(win.CursorResIdc(co.IDC_ARROW))

ui.OptsMain().
	ClassCursor(hCursor)

func (*VarOptsMain) ClassIconId added in v0.2.0

func (o *VarOptsMain) ClassIconId(i uint16) *VarOptsMain

Icon associated to the window, passed to RegisterClassEx. This icon is loaded from the resources with LoadIcon, using the given resource ID.

Defaults to none.

func (*VarOptsMain) ClassName added in v0.2.0

func (o *VarOptsMain) ClassName(s string) *VarOptsMain

Class name registered with RegisterClassEx.

Defaults to a computed hash.

func (*VarOptsMain) ClassStyle added in v0.2.0

func (o *VarOptsMain) ClassStyle(s co.CS) *VarOptsMain

Window class style, passed to RegisterClassEx.

Defaults to co.CS_DBLCLKS.

func (*VarOptsMain) CmdShow added in v0.2.0

func (o *VarOptsMain) CmdShow(c co.SW) *VarOptsMain

Initial window exhibition state, passed to ShowWindow.

Defaults to co.SW_SHOW.

func (*VarOptsMain) ExStyle added in v0.2.0

func (o *VarOptsMain) ExStyle(s co.WS_EX) *VarOptsMain

Extended window style, passed to CreateWindowEx.

Defaults to co.WS_EX_LEFT.

func (*VarOptsMain) Menu added in v0.2.0

func (o *VarOptsMain) Menu(m win.HMENU) *VarOptsMain

Main window menu, passed to CreateWindowEx.

Defaults to none.

func (*VarOptsMain) ProcessDlgMsgs added in v0.2.0

func (o *VarOptsMain) ProcessDlgMsgs(p bool) *VarOptsMain

In most applications, the window loop calls IsDialogMessage so child control messages will properly work. However, this has the side effect of inhibiting WM_CHAR messages from being sent to the window procedure. So, applications which do not have child controls and deal directly with character processing – like text editors – will never be able to receive WM_CHAR.

This flag, when true, will enable the normal IsDialogMessage call in the window loop. When false, the call will be suppressed.

Defaults to true.

func (*VarOptsMain) Size added in v0.2.0

func (o *VarOptsMain) Size(cx int, cy int) *VarOptsMain

Size of client area in pixels, passed to CreateWindowEx.

Defaults to ui.Dpi(500, 400).

func (*VarOptsMain) Style added in v0.2.0

func (o *VarOptsMain) Style(s co.WS) *VarOptsMain

Window style, passed to CreateWindowEx.

Defaults to co.WS_CAPTION | co.WS_SYSMENU | co.WS_CLIPCHILDREN | co.WS_BORDER | co.WS_VISIBLE | co.WS_MINIMIZEBOX.

func (*VarOptsMain) Title added in v0.2.0

func (o *VarOptsMain) Title(t string) *VarOptsMain

Title of the window, passed to CreateWindowEx.

Defaults to empty string.

type VarOptsMainDlg added in v0.2.0

type VarOptsMainDlg struct {
	// contains filtered or unexported fields
}

Options for NewMainDlg; returned by OptsMainDlg.

func OptsMainDlg added in v0.2.0

func OptsMainDlg() *VarOptsMainDlg

Options for NewMainDlg.

func (*VarOptsMainDlg) AccelTableId added in v0.2.0

func (o *VarOptsMainDlg) AccelTableId(id uint16) *VarOptsMainDlg

Accelerator table ID passed to LoadAccelerators.

Defaults to none.

func (*VarOptsMainDlg) DlgId added in v0.2.0

func (o *VarOptsMainDlg) DlgId(id uint16) *VarOptsMainDlg

Dialog resource ID passed to CreateDialogParam.

Panics if not informed.

func (*VarOptsMainDlg) IconId added in v0.2.0

func (o *VarOptsMainDlg) IconId(id uint16) *VarOptsMainDlg

Dialog icon ID passed to WM_SETICON.

Defaults to none.

type VarOptsModal added in v0.2.0

type VarOptsModal struct {
	// contains filtered or unexported fields
}

Options for NewModal; returned by OptsModal.

func OptsModal added in v0.2.0

func OptsModal() *VarOptsModal

Options for NewModal.

func (*VarOptsModal) ClassBrush added in v0.2.0

func (o *VarOptsModal) ClassBrush(h win.HBRUSH) *VarOptsModal

Window background brush, passed to RegisterClassEx.

Defaults to co.COLOR_BTNFACE color.

Example

classBrush: win.HBRUSH(co.COLOR_BTNFACE + 1),

func (*VarOptsModal) ClassCursor added in v0.2.0

func (o *VarOptsModal) ClassCursor(h win.HCURSOR) *VarOptsModal

Window cursor, passed to RegisterClassEx.

Defaults to stock co.IDC_ARROW.

Example

hCursor, _ := win.HINSTANCE(0).
	LoadCursor(win.CursorResIdc(co.IDC_ARROW))

ui.OptsModal().
	ClassCursor(hCursor)

func (*VarOptsModal) ClassIconId added in v0.2.0

func (o *VarOptsModal) ClassIconId(i uint16) *VarOptsModal

Icon associated to the window, passed to RegisterClassEx. This icon is loaded from the resources with LoadIcon, using the given resource ID.

Defaults to none.

func (*VarOptsModal) ClassName added in v0.2.0

func (o *VarOptsModal) ClassName(s string) *VarOptsModal

Class name registered with RegisterClassEx.

Defaults to a computed hash.

func (*VarOptsModal) ClassStyle added in v0.2.0

func (o *VarOptsModal) ClassStyle(s co.CS) *VarOptsModal

Window class style, passed to RegisterClassEx.

Defaults to co.CS_DBLCLKS.

func (*VarOptsModal) ExStyle added in v0.2.0

func (o *VarOptsModal) ExStyle(s co.WS_EX) *VarOptsModal

Extended window style, passed to CreateWindowEx.

Defaults to co.WS_EX_LEFT | co.WS_EX_DLGMODALFRAME.

func (*VarOptsModal) ProcessDlgMsgs added in v0.2.0

func (o *VarOptsModal) ProcessDlgMsgs(p bool) *VarOptsModal

In most applications, the window loop calls IsDialogMessage so child control messages will properly work. However, this has the side effect of inhibiting WM_CHAR messages from being sent to the window procedure. So, applications which do not have child controls and deal directly with character processing – like text editors – will never be able to receive WM_CHAR.

This flag, when true, will enable the normal IsDialogMessage call in the window loop. When false, the call will be suppressed.

Defaults to true.

func (*VarOptsModal) Size added in v0.2.0

func (o *VarOptsModal) Size(cx int, cy int) *VarOptsModal

Size of client area in pixels, passed to CreateWindowEx.

Defaults to ui.Dpi(400, 200).

func (*VarOptsModal) Style added in v0.2.0

func (o *VarOptsModal) Style(s co.WS) *VarOptsModal

Window style, passed to CreateWindowEx.

Defaults to co.WS_CAPTION | co.WS_SYSMENU | co.WS_CLIPCHILDREN | co.WS_BORDER | co.WS_VISIBLE.

func (*VarOptsModal) Title added in v0.2.0

func (o *VarOptsModal) Title(t string) *VarOptsModal

Title of the window, passed to CreateWindowEx.

Defaults to empty string.

type VarOptsMonthCalendar added in v0.2.0

type VarOptsMonthCalendar struct {
	// contains filtered or unexported fields
}

Options for NewMonthCalendar; returned by OptsMonthCalendar.

func OptsMonthCalendar added in v0.2.0

func OptsMonthCalendar() *VarOptsMonthCalendar

Options for NewMonthCalendar.

func (*VarOptsMonthCalendar) CtrlId added in v0.2.0

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsMonthCalendar) CtrlStyle added in v0.2.0

Month calendar control style, passed to win.CreateWindowEx.

Defaults to co.MCS_NONE.

func (*VarOptsMonthCalendar) Layout added in v0.2.0

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsMonthCalendar) Position added in v0.2.0

func (o *VarOptsMonthCalendar) Position(x, y int) *VarOptsMonthCalendar

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsMonthCalendar) Value added in v0.2.0

Initial value.

Defaults to time.Now.

func (*VarOptsMonthCalendar) WndExStyle added in v0.2.0

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT.

func (*VarOptsMonthCalendar) WndStyle added in v0.2.0

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_VISIBLE | co.WS_TABSTOP | co.WS_GROUP.

type VarOptsProgressBar added in v0.2.0

type VarOptsProgressBar struct {
	// contains filtered or unexported fields
}

Options for NewProgressBar; returned by OptsProgressBar.

func OptsProgressBar added in v0.2.0

func OptsProgressBar() *VarOptsProgressBar

Options for NewProgressBar.

func (*VarOptsProgressBar) CtrlId added in v0.2.0

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsProgressBar) CtrlStyle added in v0.2.0

func (o *VarOptsProgressBar) CtrlStyle(s co.PBS) *VarOptsProgressBar

Progress bar control style, passed to win.CreateWindowEx.

Defaults to co.PBS_SMOOTH.

func (*VarOptsProgressBar) Layout added in v0.2.0

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsProgressBar) Position added in v0.2.0

func (o *VarOptsProgressBar) Position(x, y int) *VarOptsProgressBar

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsProgressBar) Range added in v0.2.0

func (o *VarOptsProgressBar) Range(min, max int) *VarOptsProgressBar

Minimum and maximum range.

Defaults to 0, 100.

func (*VarOptsProgressBar) Size added in v0.2.0

func (o *VarOptsProgressBar) Size(cx int, cy int) *VarOptsProgressBar

Control size in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(140, 26).

func (*VarOptsProgressBar) State added in v0.2.0

State (normal, error or paused).

Defaults to normal.

func (*VarOptsProgressBar) Value added in v0.2.0

Current progress position.

Defaults to 0.

func (*VarOptsProgressBar) WndExStyle added in v0.2.0

func (o *VarOptsProgressBar) WndExStyle(s co.WS_EX) *VarOptsProgressBar

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT.

func (*VarOptsProgressBar) WndStyle added in v0.2.0

func (o *VarOptsProgressBar) WndStyle(s co.WS) *VarOptsProgressBar

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_VISIBLE.

type VarOptsRadioButton added in v0.2.0

type VarOptsRadioButton struct {
	// contains filtered or unexported fields
}

Options for NewRadioGroup; returned by OptsRadioButton.

func OptsRadioButton added in v0.2.0

func OptsRadioButton() *VarOptsRadioButton

Options for NewRadioGroup.

func (*VarOptsRadioButton) CtrlId added in v0.2.0

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsRadioButton) CtrlStyle added in v0.2.0

func (o *VarOptsRadioButton) CtrlStyle(s co.BS) *VarOptsRadioButton

Radio button control style, passed to win.CreateWindowEx.

Defaults to co.BS_AUTORADIOBUTTON.

func (*VarOptsRadioButton) Layout added in v0.2.0

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsRadioButton) Position added in v0.2.0

func (o *VarOptsRadioButton) Position(x, y int) *VarOptsRadioButton

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsRadioButton) Selected added in v0.2.0

func (o *VarOptsRadioButton) Selected(c bool) *VarOptsRadioButton

Defines this radio button as initially selected.

Defaults to false.

func (*VarOptsRadioButton) Size added in v0.2.0

func (o *VarOptsRadioButton) Size(cx int, cy int) *VarOptsRadioButton

Control size in pixels, passed to win.CreateWindowEx.

Defaults to fit current text.

func (*VarOptsRadioButton) Text added in v0.2.0

Text to be displayed, passed to win.CreateWindowEx.

Defaults to empty string.

func (*VarOptsRadioButton) WndExStyle added in v0.2.0

func (o *VarOptsRadioButton) WndExStyle(s co.WS_EX) *VarOptsRadioButton

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT.

func (*VarOptsRadioButton) WndStyle added in v0.2.0

func (o *VarOptsRadioButton) WndStyle(s co.WS) *VarOptsRadioButton

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_VISIBLE.

type VarOptsStatic added in v0.2.0

type VarOptsStatic struct {
	// contains filtered or unexported fields
}

Options for NewStatic; returned by OptsStatic.

func OptsStatic added in v0.2.0

func OptsStatic() *VarOptsStatic

Options for NewStatic.

func (*VarOptsStatic) CtrlId added in v0.2.0

func (o *VarOptsStatic) CtrlId(id uint16) *VarOptsStatic

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsStatic) CtrlStyle added in v0.2.0

func (o *VarOptsStatic) CtrlStyle(s co.SS) *VarOptsStatic

Static control style, passed to win.CreateWindowEx.

Defaults to co.SS_LEFT | co.SS_NOTIFY.

func (*VarOptsStatic) Layout added in v0.2.0

func (o *VarOptsStatic) Layout(l LAY) *VarOptsStatic

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsStatic) Position added in v0.2.0

func (o *VarOptsStatic) Position(x, y int) *VarOptsStatic

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsStatic) Size added in v0.2.0

func (o *VarOptsStatic) Size(cx int, cy int) *VarOptsStatic

Control size in pixels, passed to win.CreateWindowEx.

Defaults to fit current text.

func (*VarOptsStatic) Text added in v0.2.0

func (o *VarOptsStatic) Text(t string) *VarOptsStatic

Text to be displayed, passed to win.CreateWindowEx.

Defaults to empty string.

func (*VarOptsStatic) WndExStyle added in v0.2.0

func (o *VarOptsStatic) WndExStyle(s co.WS_EX) *VarOptsStatic

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT.

func (*VarOptsStatic) WndStyle added in v0.2.0

func (o *VarOptsStatic) WndStyle(s co.WS) *VarOptsStatic

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_VISIBLE.

type VarOptsSysLink struct {
	// contains filtered or unexported fields
}

Options for NewSysLink; returned by OptsSysLink.

func OptsSysLink() *VarOptsSysLink

Options for NewSysLink

func (*VarOptsSysLink) CtrlId added in v0.2.0

func (o *VarOptsSysLink) CtrlId(id uint16) *VarOptsSysLink

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsSysLink) CtrlStyle added in v0.2.0

func (o *VarOptsSysLink) CtrlStyle(s co.LWS) *VarOptsSysLink

SysLink control style, passed to win.CreateWindowEx.

Defaults to co.LWS_TRANSPARENT.

func (*VarOptsSysLink) Layout added in v0.2.0

func (o *VarOptsSysLink) Layout(l LAY) *VarOptsSysLink

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsSysLink) Position added in v0.2.0

func (o *VarOptsSysLink) Position(x, y int) *VarOptsSysLink

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsSysLink) Size added in v0.2.0

func (o *VarOptsSysLink) Size(cx int, cy int) *VarOptsSysLink

Control size in pixels, passed to win.CreateWindowEx.

Defaults to fit current text.

func (*VarOptsSysLink) Text added in v0.2.0

func (o *VarOptsSysLink) Text(t string) *VarOptsSysLink

Text to be displayed, passed to win.CreateWindowEx. URLs are embedded using HTML anchor syntax.

Defaults to empty string.

ui.OptsSysLink().
	Text("Link <a href=\"https://google.com\">here</a>")

func (*VarOptsSysLink) WndExStyle added in v0.2.0

func (o *VarOptsSysLink) WndExStyle(s co.WS_EX) *VarOptsSysLink

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT.

func (*VarOptsSysLink) WndStyle added in v0.2.0

func (o *VarOptsSysLink) WndStyle(s co.WS) *VarOptsSysLink

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_VISIBLE | co.WS_TABSTOP | co.WS_GROUP.

type VarOptsTab added in v0.2.0

type VarOptsTab struct {
	// contains filtered or unexported fields
}

Options for NewTab; returned by OptsTab.

func OptsTab added in v0.2.0

func OptsTab() *VarOptsTab

Options for NewTab.

func (*VarOptsTab) CtrlExStyle added in v0.2.0

func (o *VarOptsTab) CtrlExStyle(s co.TCS_EX) *VarOptsTab

Tab control extended style.

Defaults to co.TCS_EX_NONE.

func (*VarOptsTab) CtrlId added in v0.2.0

func (o *VarOptsTab) CtrlId(id uint16) *VarOptsTab

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsTab) CtrlStyle added in v0.2.0

func (o *VarOptsTab) CtrlStyle(s co.TCS) *VarOptsTab

Tab control style, passed to win.CreateWindowEx.

Defaults to co.TCS_NONE.

func (*VarOptsTab) Items added in v0.2.0

func (o *VarOptsTab) Items(t ...TabIns) *VarOptsTab

Items to be added as soon as the control is created.

Defaults to none.

func (*VarOptsTab) Layout added in v0.2.0

func (o *VarOptsTab) Layout(l LAY) *VarOptsTab

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsTab) Position added in v0.2.0

func (o *VarOptsTab) Position(x, y int) *VarOptsTab

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsTab) Selected added in v0.2.0

func (o *VarOptsTab) Selected(i int) *VarOptsTab

Zero-based index of the item initially selected.

Defaults to 0 (first tab).

func (*VarOptsTab) Size added in v0.2.0

func (o *VarOptsTab) Size(cx int, cy int) *VarOptsTab

Control size in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(80, 50).

func (*VarOptsTab) WndExStyle added in v0.2.0

func (o *VarOptsTab) WndExStyle(s co.WS_EX) *VarOptsTab

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT.

func (*VarOptsTab) WndStyle added in v0.2.0

func (o *VarOptsTab) WndStyle(s co.WS) *VarOptsTab

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_GROUP | co.WS_TABSTOP | co.WS_VISIBLE.

type VarOptsToolbar added in v0.2.0

type VarOptsToolbar struct {
	// contains filtered or unexported fields
}

Options for NewToolbar; returned by OptsToolbar.

func OptsToolbar added in v0.2.0

func OptsToolbar() *VarOptsToolbar

Options for NewToolbar.

func (*VarOptsToolbar) CtrlExStyle added in v0.2.0

func (o *VarOptsToolbar) CtrlExStyle(s co.TBSTYLE_EX) *VarOptsToolbar

Toolbar control extended style.

Defaults to co.TBSTYLE_EX_NONE.

func (*VarOptsToolbar) CtrlId added in v0.2.0

func (o *VarOptsToolbar) CtrlId(id uint16) *VarOptsToolbar

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsToolbar) CtrlStyle added in v0.2.0

func (o *VarOptsToolbar) CtrlStyle(s co.TBSTYLE) *VarOptsToolbar

Toolbar control style, passed to win.CreateWindowEx.

Defaults to co.TBSTYLE_BUTTON | co.TBSTYLE_FLAT | co.TBSTYLE_LIST.

func (*VarOptsToolbar) WndExStyle added in v0.2.0

func (o *VarOptsToolbar) WndExStyle(s co.WS_EX) *VarOptsToolbar

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT.

func (*VarOptsToolbar) WndStyle added in v0.2.0

func (o *VarOptsToolbar) WndStyle(s co.WS) *VarOptsToolbar

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_VISIBLE.

type VarOptsTrackbar added in v0.2.0

type VarOptsTrackbar struct {
	// contains filtered or unexported fields
}

Options for NewTrackbar; returned by OptsTrackbar.

func OptsTrackbar added in v0.2.0

func OptsTrackbar() *VarOptsTrackbar

Options for NewTrackbar.

func (*VarOptsTrackbar) CtrlId added in v0.2.0

func (o *VarOptsTrackbar) CtrlId(id uint16) *VarOptsTrackbar

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsTrackbar) CtrlStyle added in v0.2.0

func (o *VarOptsTrackbar) CtrlStyle(s co.TBS) *VarOptsTrackbar

Trackbar control style, passed to win.CreateWindowEx.

Defaults to co.TBS_AUTOTICKS | co.TBS_HORZ.

func (*VarOptsTrackbar) Layout added in v0.2.0

func (o *VarOptsTrackbar) Layout(l LAY) *VarOptsTrackbar

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsTrackbar) PageSize added in v0.2.0

func (o *VarOptsTrackbar) PageSize(p int) *VarOptsTrackbar

Number of positions of page up/down.

Defaults to rangeMax / 5.

func (*VarOptsTrackbar) Position added in v0.2.0

func (o *VarOptsTrackbar) Position(x, y int) *VarOptsTrackbar

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsTrackbar) Range added in v0.2.0

func (o *VarOptsTrackbar) Range(min, max int) *VarOptsTrackbar

Minimum and maximum position value.

Defaults to 0, 100.

func (*VarOptsTrackbar) Size added in v0.2.0

func (o *VarOptsTrackbar) Size(cx int, cy int) *VarOptsTrackbar

Control size in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(175, 28).

func (*VarOptsTrackbar) Value added in v0.2.0

func (o *VarOptsTrackbar) Value(v int) *VarOptsTrackbar

Current trackbar position.

Defaults to 0.

func (*VarOptsTrackbar) WndExStyle added in v0.2.0

func (o *VarOptsTrackbar) WndExStyle(s co.WS_EX) *VarOptsTrackbar

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT.

func (*VarOptsTrackbar) WndStyle added in v0.2.0

func (o *VarOptsTrackbar) WndStyle(s co.WS) *VarOptsTrackbar

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_VISIBLE | co.WS_TABSTOP | co.WS_GROUP.

type VarOptsTreeView added in v0.2.0

type VarOptsTreeView struct {
	// contains filtered or unexported fields
}

Options for NewTreeView; returned by OptsTreeView.

func OptsTreeView added in v0.2.0

func OptsTreeView() *VarOptsTreeView

Options for NewTreeView.

func (*VarOptsTreeView) CtrlExStyle added in v0.2.0

func (o *VarOptsTreeView) CtrlExStyle(s co.TVS_EX) *VarOptsTreeView

Tree view control extended style.

Defaults to co.TVS_EX_NONE.

func (*VarOptsTreeView) CtrlId added in v0.2.0

func (o *VarOptsTreeView) CtrlId(id uint16) *VarOptsTreeView

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsTreeView) CtrlStyle added in v0.2.0

func (o *VarOptsTreeView) CtrlStyle(s co.TVS) *VarOptsTreeView

Tree view control style, passed to win.CreateWindowEx.

Defaults to co.TVS_HASLINES | co.TVS_LINESATROOT | co.TVS_SHOWSELALWAYS | co.TVS_HASBUTTONS.

func (*VarOptsTreeView) Layout added in v0.2.0

func (o *VarOptsTreeView) Layout(l LAY) *VarOptsTreeView

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsTreeView) Position added in v0.2.0

func (o *VarOptsTreeView) Position(x, y int) *VarOptsTreeView

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsTreeView) Size added in v0.2.0

func (o *VarOptsTreeView) Size(cx int, cy int) *VarOptsTreeView

Control size in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(120, 120).

func (*VarOptsTreeView) WndExStyle added in v0.2.0

func (o *VarOptsTreeView) WndExStyle(s co.WS_EX) *VarOptsTreeView

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT | co.WS_EX_CLIENTEDGE.

func (*VarOptsTreeView) WndStyle added in v0.2.0

func (o *VarOptsTreeView) WndStyle(s co.WS) *VarOptsTreeView

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_GROUP | co.WS_TABSTOP | co.WS_VISIBLE.

type VarOptsUpDown added in v0.2.0

type VarOptsUpDown struct {
	// contains filtered or unexported fields
}

Options for NewUpDown; returned by OptsUpDown.

func OptsUpDown added in v0.2.0

func OptsUpDown() *VarOptsUpDown

Options for NewUpDown.

func (*VarOptsUpDown) CtrlId added in v0.2.0

func (o *VarOptsUpDown) CtrlId(id uint16) *VarOptsUpDown

Control ID. Must be unique within a same parent window.

Defaults to an auto-generated ID.

func (*VarOptsUpDown) CtrlStyle added in v0.2.0

func (o *VarOptsUpDown) CtrlStyle(s co.UDS) *VarOptsUpDown

Up-down control style, passed to win.CreateWindowEx.

If co.UDS_AUTOBUDDY is set, the UpDown will use the immediately previous control – usually an Edit – as its buddy, attaching itself to it.

Defaults to co.UDS_AUTOBUDDY | co.UDS_SETBUDDYINT | co.UDS_ALIGNRIGHT | co.UDS_ARROWKEYS | co.UDS_HOTTRACK.

func (*VarOptsUpDown) Height added in v0.2.0

func (o *VarOptsUpDown) Height(h int) *VarOptsUpDown

Control height in pixels, passed to win.CreateWindowEx.

Defaults to ui.DpiY(50).

func (*VarOptsUpDown) Layout added in v0.2.0

func (o *VarOptsUpDown) Layout(l LAY) *VarOptsUpDown

Horizontal and vertical behavior for the control layout, when the parent window is resized.

Defaults to ui.LAY_NONE_NONE.

func (*VarOptsUpDown) Position added in v0.2.0

func (o *VarOptsUpDown) Position(x, y int) *VarOptsUpDown

Position coordinates within parent window client area, in pixels, passed to win.CreateWindowEx.

Defaults to ui.Dpi(0, 0).

func (*VarOptsUpDown) Radix added in v0.2.0

func (o *VarOptsUpDown) Radix(r uint) *VarOptsUpDown

Value radix. Must be 10 (decimal) or 16 (hexadecimal).

Defaults to 10.

func (*VarOptsUpDown) Range added in v0.2.0

func (o *VarOptsUpDown) Range(min, max int) *VarOptsUpDown

Minimum and maximum range.

Defaults to 0, 100.

func (*VarOptsUpDown) Value added in v0.2.0

func (o *VarOptsUpDown) Value(v int) *VarOptsUpDown

Current value.

Defaults to 0.

func (*VarOptsUpDown) WndExStyle added in v0.2.0

func (o *VarOptsUpDown) WndExStyle(s co.WS_EX) *VarOptsUpDown

Window extended style, passed to win.CreateWindowEx.

Defaults to co.WS_EX_LEFT.

func (*VarOptsUpDown) WndStyle added in v0.2.0

func (o *VarOptsUpDown) WndStyle(s co.WS) *VarOptsUpDown

Window style, passed to win.CreateWindowEx.

Defaults to co.WS_CHILD | co.WS_VISIBLE.

type Window added in v0.2.0

type Window interface {
	// Returns the underlying HWND handle of this window.
	//
	// Note that this handle is initially zero, existing only after window creation.
	Hwnd() win.HWND
}

Any window.

type Wm added in v0.2.0

type Wm struct {
	Msg    co.WM      // Window message ID.
	WParam win.WPARAM // First parameter.
	LParam win.LPARAM // Second parameter.
}

Raw message parameters to any message: WPARAM and LPARAM.

type WmActivate added in v0.2.0

type WmActivate struct{ Raw Wm }

WM_ACTIVATE parameters.

func (WmActivate) Event added in v0.2.0

func (p WmActivate) Event() co.WA

func (WmActivate) HwndActivatedOrDeactivated added in v0.2.0

func (p WmActivate) HwndActivatedOrDeactivated() win.HWND

func (WmActivate) IsMinimized added in v0.2.0

func (p WmActivate) IsMinimized() bool

type WmActivateApp added in v0.2.0

type WmActivateApp struct{ Raw Wm }

WM_ACTIVATEAPP parameters.

func (WmActivateApp) IsBeingActivated added in v0.2.0

func (p WmActivateApp) IsBeingActivated() bool

func (WmActivateApp) ThreadId added in v0.2.0

func (p WmActivateApp) ThreadId() uint32

type WmAppCommand added in v0.2.0

type WmAppCommand struct{ Raw Wm }

WM_APPCOMMAND parameters.

func (WmAppCommand) AppCommand added in v0.2.0

func (p WmAppCommand) AppCommand() co.APPCOMMAND

func (WmAppCommand) Keys added in v0.2.0

func (p WmAppCommand) Keys() co.MK

func (WmAppCommand) OwnerWindow added in v0.2.0

func (p WmAppCommand) OwnerWindow() win.HWND

func (WmAppCommand) UDevice added in v0.2.0

func (p WmAppCommand) UDevice() co.FAPPCOMMAND

type WmAskCbFormatName added in v0.2.0

type WmAskCbFormatName struct{ Raw Wm }

WM_ASKCBFORMATNAME parameters.

func (WmAskCbFormatName) Buffer added in v0.2.0

func (p WmAskCbFormatName) Buffer() []uint16

type WmCaptureChanged added in v0.2.0

type WmCaptureChanged struct{ Raw Wm }

WM_CAPTURECHANGED parameters.

func (WmCaptureChanged) HwndGainingMouse added in v0.2.0

func (p WmCaptureChanged) HwndGainingMouse() win.HWND

type WmChangeCbChain added in v0.2.0

type WmChangeCbChain struct{ Raw Wm }

WM_CHANGECBCHAIN parameters.

func (WmChangeCbChain) IsLastWindow added in v0.2.0

func (p WmChangeCbChain) IsLastWindow() bool

func (WmChangeCbChain) NextWindow added in v0.2.0

func (p WmChangeCbChain) NextWindow() win.HWND

func (WmChangeCbChain) WindowBeingRemoved added in v0.2.0

func (p WmChangeCbChain) WindowBeingRemoved() win.HWND

type WmChar added in v0.2.0

type WmChar struct{ Raw Wm }

Parameters for:

func (WmChar) CharCode added in v0.2.0

func (p WmChar) CharCode() rune

func (WmChar) HasAltKey added in v0.2.0

func (p WmChar) HasAltKey() bool

func (WmChar) IsExtendedKey added in v0.2.0

func (p WmChar) IsExtendedKey() bool

func (WmChar) IsKeyBeingReleased added in v0.2.0

func (p WmChar) IsKeyBeingReleased() bool

func (WmChar) IsKeyDownBeforeSend added in v0.2.0

func (p WmChar) IsKeyDownBeforeSend() bool

func (WmChar) RepeatCount added in v0.2.0

func (p WmChar) RepeatCount() uint

func (WmChar) ScanCode added in v0.2.0

func (p WmChar) ScanCode() uint8

type WmCharToItem added in v0.2.0

type WmCharToItem struct{ Raw Wm }

WM_CHARTOITEM parameters.

func (WmCharToItem) CharCode added in v0.2.0

func (p WmCharToItem) CharCode() rune

func (WmCharToItem) CurrentCaretPos added in v0.2.0

func (p WmCharToItem) CurrentCaretPos() int

func (WmCharToItem) HwndListBox added in v0.2.0

func (p WmCharToItem) HwndListBox() win.HWND

type WmCommand added in v0.2.0

type WmCommand struct{ Raw Wm }

WM_COMMAND parameters.

func (WmCommand) AcceleratorId added in v0.2.0

func (p WmCommand) AcceleratorId() int

func (WmCommand) ControlHwnd added in v0.2.0

func (p WmCommand) ControlHwnd() win.HWND

func (WmCommand) ControlId added in v0.2.0

func (p WmCommand) ControlId() int

func (WmCommand) ControlNotifCode added in v0.2.0

func (p WmCommand) ControlNotifCode() int

func (WmCommand) IsFromAccelerator added in v0.2.0

func (p WmCommand) IsFromAccelerator() bool

func (WmCommand) IsFromControl added in v0.2.0

func (p WmCommand) IsFromControl() bool

func (WmCommand) IsFromMenu added in v0.2.0

func (p WmCommand) IsFromMenu() bool

func (WmCommand) MenuId added in v0.2.0

func (p WmCommand) MenuId() int

type WmCompareItem added in v0.2.0

type WmCompareItem struct{ Raw Wm }

WM_COMPAREITEM parameters.

func (WmCompareItem) CompareItemStruct added in v0.2.0

func (p WmCompareItem) CompareItemStruct() *win.COMPAREITEMSTRUCT

func (WmCompareItem) ControlId added in v0.2.0

func (p WmCompareItem) ControlId() int

type WmContextMenu added in v0.2.0

type WmContextMenu struct{ Raw Wm }

WM_CONTEXTMENU parameters.

func (WmContextMenu) CursorPos added in v0.2.0

func (p WmContextMenu) CursorPos() win.POINT

func (WmContextMenu) RightClickedWindow added in v0.2.0

func (p WmContextMenu) RightClickedWindow() win.HWND

type WmCopyData added in v0.2.0

type WmCopyData struct{ Raw Wm }

WM_COPYDATA parameters.

func (WmCopyData) CopyDataStruct added in v0.2.0

func (p WmCopyData) CopyDataStruct() *win.COPYDATASTRUCT

func (WmCopyData) HwndPassingData added in v0.2.0

func (p WmCopyData) HwndPassingData() win.HWND

type WmCreate added in v0.2.0

type WmCreate struct{ Raw Wm }

Parameters for:

Sent only to windows created with CreateWindowEx; dialog windows will receive WM_INITDIALOG instead.

func (WmCreate) CreateStruct added in v0.2.0

func (p WmCreate) CreateStruct() *win.CREATESTRUCT

type WmCtlColor added in v0.2.0

type WmCtlColor struct{ Raw Wm }

Parameters for:

func (WmCtlColor) Hdc added in v0.2.0

func (p WmCtlColor) Hdc() win.HDC

func (WmCtlColor) HwndControl added in v0.2.0

func (p WmCtlColor) HwndControl() win.HWND

type WmDeleteItem added in v0.2.0

type WmDeleteItem struct{ Raw Wm }

WM_DELETEITEM parameters.

func (WmDeleteItem) ControlId added in v0.2.0

func (p WmDeleteItem) ControlId() int

func (WmDeleteItem) DeleteItemStruct added in v0.2.0

func (p WmDeleteItem) DeleteItemStruct() *win.DELETEITEMSTRUCT

type WmDevModeChange added in v0.2.0

type WmDevModeChange struct{ Raw Wm }

WM_DEVMODECHANGE parameters.

func (WmDevModeChange) DeviceName added in v0.2.0

func (p WmDevModeChange) DeviceName() string

type WmDeviceChange added in v0.2.0

type WmDeviceChange struct{ Raw Wm }

WM_DEVICECHANGE parameters.

func (WmDeviceChange) Event added in v0.2.0

func (p WmDeviceChange) Event() co.DBT

func (WmDeviceChange) EventData added in v0.2.0

func (p WmDeviceChange) EventData() unsafe.Pointer

type WmDisplayChange added in v0.2.0

type WmDisplayChange struct{ Raw Wm }

WM_DISPLAYCHANGE parameters.

func (WmDisplayChange) BitsPerPixel added in v0.2.0

func (p WmDisplayChange) BitsPerPixel() int

func (WmDisplayChange) Size added in v0.2.0

func (p WmDisplayChange) Size() win.SIZE

type WmDrawItem added in v0.2.0

type WmDrawItem struct{ Raw Wm }

WM_DRAWITEM parameters.

func (WmDrawItem) ControlId added in v0.2.0

func (p WmDrawItem) ControlId() int

func (WmDrawItem) DrawItemStruct added in v0.2.0

func (p WmDrawItem) DrawItemStruct() *win.DRAWITEMSTRUCT

func (WmDrawItem) IsFromMenu added in v0.2.0

func (p WmDrawItem) IsFromMenu() bool

type WmDropFiles added in v0.2.0

type WmDropFiles struct{ Raw Wm }

WM_DROPFILES parameters.

func (WmDropFiles) HDrop added in v0.2.0

func (p WmDropFiles) HDrop() win.HDROP

type WmDwmColorizationColorChanged added in v0.2.0

type WmDwmColorizationColorChanged struct{ Raw Wm }

WM_DWMCOLORIZATIONCOLORCHANGED parameters.

func (WmDwmColorizationColorChanged) BlendedWithOpacity added in v0.2.0

func (p WmDwmColorizationColorChanged) BlendedWithOpacity() bool

func (WmDwmColorizationColorChanged) Color added in v0.2.0

type WmDwmNcRenderingChanged added in v0.2.0

type WmDwmNcRenderingChanged struct{ Raw Wm }

WM_DWMNCRENDERINGCHANGED parameters.

func (WmDwmNcRenderingChanged) IsEnabled added in v0.2.0

func (p WmDwmNcRenderingChanged) IsEnabled() bool

type WmDwmSendIconicThumbnail added in v0.2.0

type WmDwmSendIconicThumbnail struct{ Raw Wm }

WM_DWMSENDICONICTHUMBNAIL parameters.

func (WmDwmSendIconicThumbnail) MaxCoords added in v0.2.0

func (p WmDwmSendIconicThumbnail) MaxCoords() win.POINT

type WmDwmWindowMaximizedChange added in v0.2.0

type WmDwmWindowMaximizedChange struct{ Raw Wm }

WM_DWMWINDOWMAXIMIZEDCHANGE parameters.

func (WmDwmWindowMaximizedChange) IsMaximized added in v0.2.0

func (p WmDwmWindowMaximizedChange) IsMaximized() bool

type WmEnable added in v0.2.0

type WmEnable struct{ Raw Wm }

WM_ENABLE parameters.

func (WmEnable) HasBeenEnabled added in v0.2.0

func (p WmEnable) HasBeenEnabled() bool

type WmEndSession added in v0.2.0

type WmEndSession struct{ Raw Wm }

WM_ENDSESSION parameters.

func (WmEndSession) Event added in v0.2.0

func (p WmEndSession) Event() co.ENDSESSION

func (WmEndSession) IsSessionBeingEnded added in v0.2.0

func (p WmEndSession) IsSessionBeingEnded() bool

type WmEnterIdle added in v0.2.0

type WmEnterIdle struct{ Raw Wm }

WM_ENTERIDLE parameters.

func (WmEnterIdle) DialogOrWindow added in v0.2.0

func (p WmEnterIdle) DialogOrWindow() win.HWND

func (WmEnterIdle) Displayed added in v0.2.0

func (p WmEnterIdle) Displayed() co.MSGF

type WmEnterMenuLoop added in v0.2.0

type WmEnterMenuLoop struct{ Raw Wm }

WM_ENTERMENULOOP parameters.

func (WmEnterMenuLoop) IsTrackPopupMenu added in v0.2.0

func (p WmEnterMenuLoop) IsTrackPopupMenu() bool

type WmEraseBkgnd added in v0.2.0

type WmEraseBkgnd struct{ Raw Wm }

WM_ERASEBKGND parameters.

func (WmEraseBkgnd) Hdc added in v0.2.0

func (p WmEraseBkgnd) Hdc() win.HDC

type WmExitMenuLoop added in v0.2.0

type WmExitMenuLoop struct{ Raw Wm }

WM_EXITMENULOOP parameters.

func (WmExitMenuLoop) IsShortcutMenu added in v0.2.0

func (p WmExitMenuLoop) IsShortcutMenu() bool

type WmGetDlgCode added in v0.2.0

type WmGetDlgCode struct{ Raw Wm }

WM_GETDLGCODE parameters.

func (WmGetDlgCode) HasAlt added in v0.2.0

func (p WmGetDlgCode) HasAlt() bool

func (WmGetDlgCode) HasCtrl added in v0.2.0

func (p WmGetDlgCode) HasCtrl() bool

func (WmGetDlgCode) HasShift added in v0.2.0

func (p WmGetDlgCode) HasShift() bool

func (WmGetDlgCode) IsQuery added in v0.2.0

func (p WmGetDlgCode) IsQuery() bool

func (WmGetDlgCode) Message added in v0.2.0

func (p WmGetDlgCode) Message() *win.MSG

func (WmGetDlgCode) VirtualKeyCode added in v0.2.0

func (p WmGetDlgCode) VirtualKeyCode() co.VK

type WmGetIcon added in v0.2.0

type WmGetIcon struct{ Raw Wm }

WM_GETICON parameters.

func (WmGetIcon) Dpi added in v0.2.0

func (p WmGetIcon) Dpi() uint32

func (WmGetIcon) Type added in v0.2.0

func (p WmGetIcon) Type() co.ICON_SZ

type WmGetMinMaxInfo added in v0.2.0

type WmGetMinMaxInfo struct{ Raw Wm }

WM_GETMINMAXINFO parameters.

func (WmGetMinMaxInfo) Info added in v0.2.0

func (p WmGetMinMaxInfo) Info() *win.MINMAXINFO

type WmGetText added in v0.2.0

type WmGetText struct{ Raw Wm }

WM_GETTEXT parameters.

func (WmGetText) Buffer added in v0.2.0

func (p WmGetText) Buffer() *uint16

func (WmGetText) MaxChars added in v0.2.0

func (p WmGetText) MaxChars() uint

type WmGetTitleBarInfoEx added in v0.2.0

type WmGetTitleBarInfoEx struct{ Raw Wm }

WM_GETTITLEBARINFOEX parameters.

func (WmGetTitleBarInfoEx) Info added in v0.2.0

type WmHelp added in v0.2.0

type WmHelp struct{ Raw Wm }

WM_HELP parameters.

func (WmHelp) Info added in v0.2.0

func (p WmHelp) Info() *win.HELPINFO

type WmHotKey added in v0.2.0

type WmHotKey struct{ Raw Wm }

WM_HOTKEY parameters.

func (WmHotKey) HotKey added in v0.2.0

func (p WmHotKey) HotKey() co.IDHOT

func (WmHotKey) OtherKeys added in v0.2.0

func (p WmHotKey) OtherKeys() co.MOD

func (WmHotKey) VirtualKeyCode added in v0.2.0

func (p WmHotKey) VirtualKeyCode() co.VK

type WmInitDialog added in v0.2.0

type WmInitDialog struct{ Raw Wm }

WM_INITDIALOG parameters.

Sent only to dialog windows; those created with CreateWindowEx will receive WM_CREATE instead.

func (WmInitDialog) HwndFocused added in v0.2.0

func (p WmInitDialog) HwndFocused() win.HWND

type WmInitMenuPopup added in v0.2.0

type WmInitMenuPopup struct{ Raw Wm }

WM_INITMENUPOPUP parameters.

func (WmInitMenuPopup) HMenu added in v0.2.0

func (p WmInitMenuPopup) HMenu() win.HMENU

func (WmInitMenuPopup) IsWindowMenu added in v0.2.0

func (p WmInitMenuPopup) IsWindowMenu() bool

func (WmInitMenuPopup) Pos added in v0.2.0

func (p WmInitMenuPopup) Pos() int

type WmKey added in v0.2.0

type WmKey struct{ Raw Wm }

Parameters for:

func (WmKey) HasAltKey added in v0.2.0

func (p WmKey) HasAltKey() bool

func (WmKey) IsExtendedKey added in v0.2.0

func (p WmKey) IsExtendedKey() bool

func (WmKey) IsKeyDownBeforeSend added in v0.2.0

func (p WmKey) IsKeyDownBeforeSend() bool

func (WmKey) IsReleasingKey added in v0.2.0

func (p WmKey) IsReleasingKey() bool

func (WmKey) RepeatCount added in v0.2.0

func (p WmKey) RepeatCount() uint

func (WmKey) ScanCode added in v0.2.0

func (p WmKey) ScanCode() uint8

func (WmKey) VirtualKeyCode added in v0.2.0

func (p WmKey) VirtualKeyCode() co.VK

type WmKillFocus added in v0.2.0

type WmKillFocus struct{ Raw Wm }

WM_KILLFOCUS parameters.

func (WmKillFocus) HwndReceivingFocus added in v0.2.0

func (p WmKillFocus) HwndReceivingFocus() win.HWND

type WmMenu added in v0.2.0

type WmMenu struct{ Raw Wm }

Parameters for:

func (WmMenu) Hmenu added in v0.2.0

func (p WmMenu) Hmenu() win.HMENU

func (WmMenu) ItemIndex added in v0.2.0

func (p WmMenu) ItemIndex() uint

type WmMenuChar added in v0.2.0

type WmMenuChar struct{ Raw Wm }

WM_MENUCHAR parameters.

func (WmMenuChar) ActiveMenu added in v0.2.0

func (p WmMenuChar) ActiveMenu() win.HMENU

func (WmMenuChar) ActiveMenuType added in v0.2.0

func (p WmMenuChar) ActiveMenuType() co.MFMC

func (WmMenuChar) CharCode added in v0.2.0

func (p WmMenuChar) CharCode() rune

type WmMenuGetObject added in v0.2.0

type WmMenuGetObject struct{ Raw Wm }

WM_MENUGETOBJECT parameters.

func (WmMenuGetObject) Info added in v0.2.0

type WmMenuSelect added in v0.2.0

type WmMenuSelect struct{ Raw Wm }

WM_MENUSELECT parameters.

func (WmMenuSelect) Flags added in v0.2.0

func (p WmMenuSelect) Flags() co.MF

func (WmMenuSelect) Hmenu added in v0.2.0

func (p WmMenuSelect) Hmenu() win.HMENU

func (WmMenuSelect) Item added in v0.2.0

func (p WmMenuSelect) Item() int

type WmMouse added in v0.2.0

type WmMouse struct{ Raw Wm }

Parameters for:

func (WmMouse) HasCtrl added in v0.2.0

func (p WmMouse) HasCtrl() bool

func (WmMouse) HasShift added in v0.2.0

func (p WmMouse) HasShift() bool

func (WmMouse) IsLeftBtn added in v0.2.0

func (p WmMouse) IsLeftBtn() bool

func (WmMouse) IsMiddleBtn added in v0.2.0

func (p WmMouse) IsMiddleBtn() bool

func (WmMouse) IsRightBtn added in v0.2.0

func (p WmMouse) IsRightBtn() bool

func (WmMouse) IsXBtn1 added in v0.2.0

func (p WmMouse) IsXBtn1() bool

func (WmMouse) IsXBtn2 added in v0.2.0

func (p WmMouse) IsXBtn2() bool

func (WmMouse) Pos added in v0.2.0

func (p WmMouse) Pos() win.POINT

func (WmMouse) VirtualKeys added in v0.2.0

func (p WmMouse) VirtualKeys() co.MK

type WmMove added in v0.2.0

type WmMove struct{ Raw Wm }

WM_MOVE parameters.

func (WmMove) ClientAreaPos added in v0.2.0

func (p WmMove) ClientAreaPos() win.POINT

type WmMoving added in v0.2.0

type WmMoving struct{ Raw Wm }

WM_MOVING parameters.

func (WmMoving) WindowPos added in v0.2.0

func (p WmMoving) WindowPos() *win.RECT

type WmNcActivate added in v0.2.0

type WmNcActivate struct{ Raw Wm }

WM_NCACTIVATE parameters.

func (WmNcActivate) IsActive added in v0.2.0

func (p WmNcActivate) IsActive() bool

func (WmNcActivate) IsVisualStyleActive added in v0.2.0

func (p WmNcActivate) IsVisualStyleActive() bool

func (WmNcActivate) UpdatedRegion added in v0.2.0

func (p WmNcActivate) UpdatedRegion() win.HRGN

type WmNcCalcSize added in v0.2.0

type WmNcCalcSize struct{ Raw Wm }

WM_NCCALCSIZE parameters.

func (WmNcCalcSize) NcCalcSizeParams added in v0.2.0

func (p WmNcCalcSize) NcCalcSizeParams() *win.NCCALCSIZE_PARAMS

func (WmNcCalcSize) Rect added in v0.2.0

func (p WmNcCalcSize) Rect() *win.RECT

func (WmNcCalcSize) ShouldIndicateValidPart added in v0.2.0

func (p WmNcCalcSize) ShouldIndicateValidPart() bool

type WmNcHitTest added in v0.2.0

type WmNcHitTest struct{ Raw Wm }

WM_NCHITTEST parameters.

func (WmNcHitTest) CursorPos added in v0.2.0

func (p WmNcHitTest) CursorPos() win.POINT

type WmNcMouse added in v0.2.0

type WmNcMouse struct{ Raw Wm }

Parameters for:

func (WmNcMouse) HitTest added in v0.2.0

func (p WmNcMouse) HitTest() co.HT

func (WmNcMouse) Pos added in v0.2.0

func (p WmNcMouse) Pos() win.POINT

type WmNcMouseX added in v0.2.0

type WmNcMouseX struct{ Raw Wm }

Parameters for:

func (WmNcMouseX) HitTest added in v0.2.0

func (p WmNcMouseX) HitTest() co.HT

func (WmNcMouseX) IsXBtn1 added in v0.2.0

func (p WmNcMouseX) IsXBtn1() bool

func (WmNcMouseX) IsXBtn2 added in v0.2.0

func (p WmNcMouseX) IsXBtn2() bool

func (WmNcMouseX) Pos added in v0.2.0

func (p WmNcMouseX) Pos() win.POINT

type WmNcPaint added in v0.2.0

type WmNcPaint struct{ Raw Wm }

WM_NCPAINT parameters.

func (WmNcPaint) UpdatedHrgn added in v0.2.0

func (p WmNcPaint) UpdatedHrgn() win.HRGN

type WmNextDlgCtl added in v0.2.0

type WmNextDlgCtl struct{ Raw Wm }

WM_NEXTDLGCTL parameters.

func (WmNextDlgCtl) HwndFocus added in v0.2.0

func (p WmNextDlgCtl) HwndFocus() win.HWND

func (WmNextDlgCtl) IsHwnd added in v0.2.0

func (p WmNextDlgCtl) IsHwnd() bool

type WmNextMenu added in v0.2.0

type WmNextMenu struct{ Raw Wm }

WM_NEXTMENU parameters.

func (WmNextMenu) MdiNextMenu added in v0.2.0

func (p WmNextMenu) MdiNextMenu() *win.MDINEXTMENU

func (WmNextMenu) VirtualKeyCode added in v0.2.0

func (p WmNextMenu) VirtualKeyCode() co.VK

type WmPaintClipboard added in v0.2.0

type WmPaintClipboard struct{ Raw Wm }

WM_PAINTCLIPBOARD parameters.

func (WmPaintClipboard) CbViewerWindow added in v0.2.0

func (p WmPaintClipboard) CbViewerWindow() win.HWND

func (WmPaintClipboard) PaintStruct added in v0.2.0

func (p WmPaintClipboard) PaintStruct() *win.PAINTSTRUCT

type WmParentNotify added in v0.2.0

type WmParentNotify struct{ Raw Wm }

WM_PARENTNOTIFY parameters.

func (WmParentNotify) ChildId added in v0.2.0

func (p WmParentNotify) ChildId() uint16

func (WmParentNotify) Coords added in v0.2.0

func (p WmParentNotify) Coords() win.POINT

func (WmParentNotify) Event added in v0.2.0

func (p WmParentNotify) Event() co.WMPN

type WmPowerBroadcast added in v0.2.0

type WmPowerBroadcast struct{ Raw Wm }

WM_POWERBROADCAST parameters.

func (WmPowerBroadcast) Event added in v0.2.0

func (p WmPowerBroadcast) Event() co.PBT

func (WmPowerBroadcast) PowerBroadcastSetting added in v0.2.0

func (p WmPowerBroadcast) PowerBroadcastSetting() *win.POWERBROADCAST_SETTING

type WmPrint added in v0.2.0

type WmPrint struct{ Raw Wm }

WM_PRINT parameters.

func (WmPrint) DrawingOptions added in v0.2.0

func (p WmPrint) DrawingOptions() co.PRF

func (WmPrint) Hdc added in v0.2.0

func (p WmPrint) Hdc() win.HDC

type WmRenderFormat added in v0.2.0

type WmRenderFormat struct{ Raw Wm }

WM_RENDERFORMAT parameters.

func (WmRenderFormat) ClipboardFormat added in v0.2.0

func (p WmRenderFormat) ClipboardFormat() co.CF

type WmScroll added in v0.2.0

type WmScroll struct{ Raw Wm }

Parameters for:

func (WmScroll) HwndScrollbar added in v0.2.0

func (p WmScroll) HwndScrollbar() win.HWND

func (WmScroll) Request added in v0.2.0

func (p WmScroll) Request() co.SB_REQ

func (WmScroll) ScrollBoxPos added in v0.2.0

func (p WmScroll) ScrollBoxPos() int

type WmScrollClipboard added in v0.2.0

type WmScrollClipboard struct{ Raw Wm }

Parameters for:

func (WmScrollClipboard) HwndClipboard added in v0.2.0

func (p WmScrollClipboard) HwndClipboard() win.HWND

func (WmScrollClipboard) Request added in v0.2.0

func (p WmScrollClipboard) Request() co.SB_REQ

func (WmScrollClipboard) ScrollBoxPos added in v0.2.0

func (p WmScrollClipboard) ScrollBoxPos() int

type WmSetFocus added in v0.2.0

type WmSetFocus struct{ Raw Wm }

WM_SETFOCUS parameters.

func (WmSetFocus) HwndLosingFocus added in v0.2.0

func (p WmSetFocus) HwndLosingFocus() win.HWND

type WmSetFont added in v0.2.0

type WmSetFont struct{ Raw Wm }

WM_SETFONT parameters.

func (WmSetFont) Hfont added in v0.2.0

func (p WmSetFont) Hfont() win.HFONT

func (WmSetFont) ShouldRedraw added in v0.2.0

func (p WmSetFont) ShouldRedraw() bool

type WmSetIcon added in v0.2.0

type WmSetIcon struct{ Raw Wm }

WM_SETICON parameters.

func (WmSetIcon) Hicon added in v0.2.0

func (p WmSetIcon) Hicon() win.HICON

func (WmSetIcon) Size added in v0.2.0

func (p WmSetIcon) Size() co.ICON_SZ

type WmSetRedraw added in v0.2.0

type WmSetRedraw struct{ Raw Wm }

WM_SETREDRAW parameters.

func (WmSetRedraw) CanRedraw added in v0.2.0

func (p WmSetRedraw) CanRedraw() bool

type WmSetText added in v0.2.0

type WmSetText struct{ Raw Wm }

WM_SETTEXT parameters.

func (WmSetText) Text added in v0.2.0

func (p WmSetText) Text() *uint16

type WmShowWindow added in v0.2.0

type WmShowWindow struct{ Raw Wm }

WM_SHOWWINDOW parameters.

func (WmShowWindow) IsBeingShown added in v0.2.0

func (p WmShowWindow) IsBeingShown() bool

func (WmShowWindow) Status added in v0.2.0

func (p WmShowWindow) Status() co.SWS

type WmSize added in v0.2.0

type WmSize struct{ Raw Wm }

WM_SIZE parameters.

func (WmSize) ClientAreaSize added in v0.2.0

func (p WmSize) ClientAreaSize() win.SIZE

func (WmSize) Request added in v0.2.0

func (p WmSize) Request() co.SIZE_REQ

type WmSizeClipboard added in v0.2.0

type WmSizeClipboard struct{ Raw Wm }

WM_SIZECLIPBOARD parameters.

func (WmSizeClipboard) CbViewerWindow added in v0.2.0

func (p WmSizeClipboard) CbViewerWindow() win.HWND

func (WmSizeClipboard) NewDimensions added in v0.2.0

func (p WmSizeClipboard) NewDimensions() *win.RECT

type WmSizing added in v0.2.0

type WmSizing struct{ Raw Wm }

WM_SIZING parameters.

func (WmSizing) DragRect added in v0.2.0

func (p WmSizing) DragRect() *win.RECT

func (WmSizing) WindowEdge added in v0.2.0

func (p WmSizing) WindowEdge() co.WMSZ

type WmStyles added in v0.2.0

type WmStyles struct{ Raw Wm }

Parameters for:

func (WmStyles) StylesWs added in v0.2.0

func (p WmStyles) StylesWs() *win.STYLESTRUCT_WS

func (WmStyles) StylesWsEx added in v0.2.0

func (p WmStyles) StylesWsEx() *win.STYLESTRUCT_WSEX

type WmSysCommand added in v0.2.0

type WmSysCommand struct{ Raw Wm }

WM_SYSCOMMAND parameters.

func (WmSysCommand) CursorPos added in v0.2.0

func (p WmSysCommand) CursorPos() win.POINT

func (WmSysCommand) RequestCommand added in v0.2.0

func (p WmSysCommand) RequestCommand() co.SC

type WmUnInitMenuPopup added in v0.2.0

type WmUnInitMenuPopup struct{ Raw Wm }

WM_UNINITMENUPOPUP parameters.

func (WmUnInitMenuPopup) Hmenu added in v0.2.0

func (p WmUnInitMenuPopup) Hmenu() win.HMENU

type WmWindowPos added in v0.2.0

type WmWindowPos struct{ Raw Wm }

Parameters for:

func (WmWindowPos) WindowPos added in v0.2.0

func (p WmWindowPos) WindowPos() *win.WINDOWPOS

type WmWtsSessionChange added in v0.2.0

type WmWtsSessionChange struct{ Raw Wm }

WM_WTSSESSION_CHANGE parameters.

func (WmWtsSessionChange) SessionId added in v0.2.0

func (p WmWtsSessionChange) SessionId() uint32

func (WmWtsSessionChange) State added in v0.2.0

func (p WmWtsSessionChange) State() co.WTS

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL