Documentation ¶
Index ¶
- Variables
- func ButtonOpts() *_ButtonO
- func CheckBoxOpts() *_CheckBoxO
- func ComboBoxOpts() *_ComboBoxO
- func DateTimePickerOpts() *_DateTimePickerO
- func EditOpts() *_EditO
- func ListViewOpts() *_ListViewO
- func MonthCalendarOpts() *_MonthCalendarO
- func ProgressBarOpts() *_ProgressBarO
- func RadioButtonOpts() *_RadioButtonO
- func StaticOpts() *_StaticO
- func SysLinkOpts() *_SysLinkO
- func ToolbarOpts() *_ToolbarO
- func TrackbarOpts() *_TrackbarO
- func TreeViewOpts() *_TreeViewO
- func WindowControlOpts() *_WindowControlO
- func WindowMainOpts() *_WindowMainO
- func WindowModalOpts() *_WindowModalO
- type AcceleratorTable
- type AnyControl
- type AnyFocusControl
- type AnyNativeControl
- type AnyParent
- type AnyTextControl
- type AnyWindow
- type Button
- type CheckBox
- type ComboBox
- type ComboBoxItem
- type DateTimePicker
- type Edit
- type HORZ
- type ListView
- type ListViewColumn
- func (me ListViewColumn) Index() int
- func (me ListViewColumn) SelectedTexts() []string
- func (me ListViewColumn) SetTitle(text string)
- func (me ListViewColumn) SetWidth(width int)
- func (me ListViewColumn) SetWidthToFill()
- func (me ListViewColumn) Texts() []string
- func (me ListViewColumn) Title() string
- func (me ListViewColumn) Width() int
- type ListViewItem
- func (me ListViewItem) Delete()
- func (me ListViewItem) EnsureVisible()
- func (me ListViewItem) Focus()
- func (me ListViewItem) Index() int
- func (me ListViewItem) IsSelected() bool
- func (me ListViewItem) IsVisible() bool
- func (me ListViewItem) LParam() win.LPARAM
- func (me ListViewItem) MapIndexToId() int
- func (me ListViewItem) Rect(portion co.LVIR) win.RECT
- func (me ListViewItem) Select(isSelected bool)
- func (me ListViewItem) SetHot() (previous ListViewItem, hasPrevious bool)
- func (me ListViewItem) SetLParam(lp win.LPARAM)
- func (me ListViewItem) SetText(columnIndex int, text string)
- func (me ListViewItem) Text(columnIndex int) string
- func (me ListViewItem) Update()
- type MonthCalendar
- type ProgressBar
- type RadioButton
- type RadioGroup
- type Static
- type StatusBar
- type StatusBarPart
- type SysLink
- type Toolbar
- type Trackbar
- type TreeView
- type TreeViewItem
- func (me TreeViewItem) AddChild(text string) TreeViewItem
- func (me TreeViewItem) Children() []TreeViewItem
- func (me TreeViewItem) Delete()
- func (me TreeViewItem) EnsureVisible()
- func (me TreeViewItem) Expand(doExpand bool)
- func (me TreeViewItem) Htreeitem() win.HTREEITEM
- func (me TreeViewItem) IsExpanded() bool
- func (me TreeViewItem) IsRoot() bool
- func (me TreeViewItem) LParam() win.LPARAM
- func (me TreeViewItem) NextSibling() (TreeViewItem, bool)
- func (me TreeViewItem) Parent() (TreeViewItem, bool)
- func (me TreeViewItem) PrevSibling() (TreeViewItem, bool)
- func (me TreeViewItem) SetLParam(lp win.LPARAM)
- func (me TreeViewItem) SetText(text string)
- func (me TreeViewItem) Text() string
- type VERT
- type WindowControl
- func NewWindowControl(parent AnyParent, opts *_WindowControlO) WindowControl
- func NewWindowControlDlg(parent AnyParent, dialogId int, position win.POINT, horz HORZ, vert VERT) WindowControl
- func NewWindowControlDlgWithId(parent AnyParent, dialogId int, position win.POINT, ctrlId int, horz HORZ, ...) WindowControl
- type WindowMain
- type WindowModal
Constants ¶
This section is empty.
Variables ¶
var TaskDlg _TaskDlgT
Displays various modal prompts which the user must interact to.
The methods are high-level wrappers to TaskDialogIndirect, which is a modern replacement to the old MessageBox method.
Functions ¶
func DateTimePickerOpts ¶
func DateTimePickerOpts() *_DateTimePickerO
Options for NewDateTimePicker().
Types ¶
type AcceleratorTable ¶
type AcceleratorTable interface { // Adds a new character accelerator, with a specific command ID. AddChar(character rune, modifiers co.ACCELF, cmdId int) AcceleratorTable // Adds a new virtual key accelerator, with a specific command ID. AddKey(vKey co.VK, modifiers co.ACCELF, cmdId int) AcceleratorTable // Free the resources. Destroy() // Builds the accelerator table once, and returns the HACCEL handle. // // Further accelerator additions will panic after this call. Haccel() win.HACCEL // contains filtered or unexported methods }
Native accelerator table resource.
func NewAcceleratorTable ¶
func NewAcceleratorTable() AcceleratorTable
Creates a new AcceleratorTable.
⚠️ You must defer AcceleratorTable.Destroy().
type AnyControl ¶
type AnyControl interface { AnyWindow // Returns the ID of this control. CtrlId() int // Returns the parent of this control. Parent() AnyParent }
Any child window control.
type AnyFocusControl ¶
type AnyFocusControl interface { AnyControl // Puts the focus on the control by sending a WM_NEXTDLGCTL message. This // ensures that the borders will be correctly drawn. Focus() }
Any child window wich can receive the focus.
type AnyNativeControl ¶
type AnyNativeControl interface { AnyControl // Exposes all the window messages that can be handled with subclassing. // // Warning: Subclassing is a potentially slow technique, try to use the // regular events first. // // Cannot be called after the control was created. OnSubclass() *_EventsWm }
Any native child window control.
type AnyParent ¶
type AnyParent interface { AnyWindow // Exposes all the window notifications the can be handled. // // Cannot be called after the window was created. On() *_EventsWmNfy // Runs a closure synchronously in the window original UI thread. // // When in a goroutine, you *MUST* use this method to update the UI, // otherwise your application may deadlock. RunUiThread(userFunc func()) // contains filtered or unexported methods }
Any window that can have child controls.
type AnyTextControl ¶
type AnyTextControl interface { AnyControl // Sets the text of the control. SetText(text string) // Retrieves the text of the control. Text() string }
Any child window control which can get/set text.
type AnyWindow ¶
type AnyWindow 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 Button ¶
type Button interface { AnyNativeControl AnyFocusControl AnyTextControl // Exposes all the [Button notifications] the can be handled. // // Panics if called after the control was created. // // [Button notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-button-control-reference-notifications On() *_ButtonEvents EmulateClick() // Emulates an user click. // contains filtered or unexported methods }
Native button control.
type CheckBox ¶
type CheckBox interface { AnyNativeControl AnyFocusControl AnyTextControl // Exposes all the [Button notifications] the can be handled. // // Panics if called after the control was created. // // [Button notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-button-control-reference-notifications On() *_ButtonEvents CheckState() co.BST // Retrieves the current check state. EmulateClick() // Emulates an user click. IsChecked() bool // Tells whether the check box state is checked. SetCheckState(state co.BST) // Sets the current check state. SetCheckStateAndTrigger(state co.BST) // Sets the current check state and triggers the click event. SetTextAndResize(text string) // Sets the text and resizes the control to fit it exactly. // contains filtered or unexported methods }
Native check box control.
func NewCheckBox ¶
Creates a new CheckBox. Call ui.CheckBoxOpts() to define the options to be passed to the underlying CreateWindowEx().
Example ¶
var owner ui.AnyParent // initialized somewhere myCheck := ui.NewCheckBox( owner, ui.CheckBoxOpts(). Text("Some option"). Position(win.POINT{X: 20, Y: 10}). State(co.BST_CHECKED), ), )
type ComboBox ¶
type ComboBox interface { AnyNativeControl AnyFocusControl AnyTextControl // Exposes all the [ComboBox notifications] the can be handled. // // Panics if called after the control was created. // // [ComboBox notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-combobox-control-reference-notifications On() *_ComboBoxEvents Items() *_ComboBoxItems // Item methods. // contains filtered or unexported methods }
Native combo box control.
func NewComboBox ¶
Creates a new ComboBox. Call ui.ComboBoxOpts() to define the options to be passed to the underlying CreateWindowEx().
Example ¶
var owner ui.AnyParent // initialized somewhere myCombo := ui.NewComboBox( owner, ui.ComboBoxOpts(). Text("Some option"). Position(win.POINT{X: 20, Y: 10}). State(co.BST_CHECKED), ), )
type ComboBoxItem ¶
type ComboBoxItem struct {
// contains filtered or unexported fields
}
A single item of a ComboBox.
func (ComboBoxItem) Index ¶
func (me ComboBoxItem) Index() int
Returns the zero-based index of the item.
type DateTimePicker ¶
type DateTimePicker interface { AnyNativeControl AnyFocusControl // Exposes all the [DateTimePicker notifications] the can be handled. // // Panics if called after the control was created. // // [DateTimePicker notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-date-and-time-picker-control-reference-notifications On() *_DateTimePickerEvents SetTime(newTime time.Time) // Sets the current time. Time() time.Time // Retrieves current time. // contains filtered or unexported methods }
Native date and time picker control.
func NewDateTimePicker ¶
func NewDateTimePicker(parent AnyParent, opts *_DateTimePickerO) DateTimePicker
Creates a new DateTimePicker. Call ui.DateTimePickerOpts() to define the options to be passed to the underlying CreateWindowEx().
Example ¶
var owner ui.AnyParent // initialized somewhere myDtp := ui.NewDateTimePicker( owner, ui.DateTimePickerOpts(). Position(win.POINT{X: 10, Y: 210}), ), )
func NewDateTimePickerDlg ¶
func NewDateTimePickerDlg( parent AnyParent, ctrlId int, horz HORZ, vert VERT) DateTimePicker
Creates a new DateTimePicker from a dialog resource.
type Edit ¶
type Edit interface { AnyNativeControl AnyFocusControl AnyTextControl // Exposes all the [Edit notifications] the can be handled. // // Panics if called after the control was created. // // [Edit notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-edit-control-reference-notifications On() *_EditEvents HideBalloonTip() // Hides a balloon tip, if any. LimitText(maxChars int) // Limits the length of the text. ReplaceSelection(text string) // Replaces the current text selection with the given text. SelectedRange() (int, int) // Retrieves the index of first and last selected chars. SelectRange(idxFirst, idxLast int) // Sets the currently selected chars. ShowBalloonTip(title, text string, icon co.TTI) // Displays a balloon tip. // contains filtered or unexported methods }
Native edit control.
type ListView ¶
type ListView interface { AnyNativeControl AnyFocusControl // Exposes all the [ListView notifications] the can be handled. // // Panics if called after the control was created. // // [ListView notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-list-view-control-reference-notifications On() *_ListViewEvents ContextMenu() win.HMENU // Returns the associated context menu, if any. Columns() *_ListViewColumns // Column methods. EditControl() win.HWND // Retrieves a handle to the edit control being used. ExtendedStyle() co.LVS_EX // Retrieves the extended style flags. ImageList(which co.LVSIL) win.HIMAGELIST // Retrieves one of the current image lists. If the list has LVS_SHAREIMAGELISTS, it's shared, otherwise it will be automatically destroyed. Items() *_ListViewItems // Item methods. Scroll(horz, vert int) // Scrolls the list view horizontally and vertically, in pixels, from its current position. SetExtendedStyle(doSet bool, styles co.LVS_EX) // Sets or unsets extended style flags. SetImageList(which co.LVSIL, himgl win.HIMAGELIST) win.HIMAGELIST // Sets one of the current image lists. If the list has LVS_SHAREIMAGELISTS, it's shared, otherwise it will be automatically destroyed. SetRedraw(allowRedraw bool) // Sends WM_SETREDRAW to enable or disable UI updates. SetView(view co.LV_VIEW) // Sets current view. View() co.LV_VIEW // Retrieves current view. // contains filtered or unexported methods }
Native list view control.
func NewListView ¶
Creates a new ListView. Call ui.ListViewOpts() to define the options to be passed to the underlying CreateWindowEx().
Example ¶
var owner ui.AnyParent // initialized somewhere myList := ui.NewListView( owner, ui.ListViewOpts(). Position(win.POINT{X: 10, Y: 20}). Size(win.SIZE{Cx: 120}). CtrlExStyles(co.LVS_EX_FULLROWSELECT), ), )
type ListViewColumn ¶
type ListViewColumn struct {
// contains filtered or unexported fields
}
A single column of a ListView.
func (ListViewColumn) Index ¶
func (me ListViewColumn) Index() int
Returns the zero-based index of the column.
func (ListViewColumn) SelectedTexts ¶
func (me ListViewColumn) SelectedTexts() []string
Retrieves all selected item texts under this column.
func (ListViewColumn) SetWidth ¶
func (me ListViewColumn) SetWidth(width int)
Sets the width. Will be adjusted to the current system DPI.
func (ListViewColumn) SetWidthToFill ¶
func (me ListViewColumn) SetWidthToFill()
Resizes the column to fill the remaining space.
func (ListViewColumn) Texts ¶
func (me ListViewColumn) Texts() []string
Retrieves all item texts under this column.
func (ListViewColumn) Title ¶
func (me ListViewColumn) Title() string
Retrieves the title of the column.
func (ListViewColumn) Width ¶
func (me ListViewColumn) Width() int
Retrieves the width of the column.
type ListViewItem ¶
type ListViewItem struct {
// contains filtered or unexported fields
}
A single item of a ListView.
func (ListViewItem) EnsureVisible ¶
func (me ListViewItem) EnsureVisible()
Makes sure the item is visible, scrolling the ListView if needed.
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.
func (ListViewItem) IsVisible ¶
func (me ListViewItem) IsVisible() bool
Tells whether the item is currently visible.
func (ListViewItem) LParam ¶
func (me ListViewItem) LParam() win.LPARAM
Retrieves the custom data associated with the item.
func (ListViewItem) MapIndexToId ¶
func (me ListViewItem) MapIndexToId() int
Returns a ID which uniquely identifies the item.
func (ListViewItem) Rect ¶
func (me ListViewItem) Rect(portion co.LVIR) win.RECT
Retrieves the coordinates of the rectangle surrounding the item.
func (ListViewItem) SetHot ¶
func (me ListViewItem) SetHot() (previous ListViewItem, hasPrevious bool)
Sets the item as hot, returning the previous one, if any.
func (ListViewItem) SetLParam ¶
func (me ListViewItem) SetLParam(lp win.LPARAM)
Sets the custom data associated with the item.
func (ListViewItem) SetText ¶
func (me ListViewItem) SetText(columnIndex int, text string)
Sets the text of the item.
func (ListViewItem) Text ¶
func (me ListViewItem) Text(columnIndex int) string
Retrieves the text of the item.
func (ListViewItem) Update ¶
func (me ListViewItem) Update()
Sends an LVM_UPDATE message to the item.
type MonthCalendar ¶
type MonthCalendar interface { AnyNativeControl AnyFocusControl // Exposes all the [MonthCalendar notifications] the can be handled. // // Panics if called after the control was created. // // [MonthCalendar notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-month-calendar-control-reference-notifications On() *_MonthCalendarEvents SelectDate(date time.Time) // Sets the selected date. SelectedDate() time.Time // Retrieves the selected date. // contains filtered or unexported methods }
Native month calendar control.
func NewMonthCalendar ¶
func NewMonthCalendar(parent AnyParent, opts *_MonthCalendarO) MonthCalendar
Creates a new MonthCalendar. Call ui.MonthCalendarOpts() to define the options to be passed to the underlying CreateWindowEx().
Example ¶
var owner ui.AnyParent // initialized somewhere myCal := ui.NewMonthCalendar( owner, ui.MonthCalendarOpts(). Position(win.POINT{X: 50, Y: 50}), ), )
func NewMonthCalendarDlg ¶
func NewMonthCalendarDlg( parent AnyParent, ctrlId int, horz HORZ, vert VERT) MonthCalendar
Creates a new MonthCalendar from a dialog resource.
type ProgressBar ¶
type ProgressBar interface { AnyNativeControl Pos() int // Retrieves the current position. SetMarquee(isMarquee bool) // Sets indeterminate state, a graphic animation going back and forth. SetPos(pos int) // Sets the current position. SetRange(min, max int) // Sets the new range. Default is 0-100. SetState(state co.PBST) // Sets the current state (green, yellow, red). // contains filtered or unexported methods }
Native progress bar control.
func NewProgressBar ¶
func NewProgressBar(parent AnyParent, opts *_ProgressBarO) ProgressBar
Creates a new ProgressBar. Call ui.ProgressBarOpts() to define the options to be passed to the underlying CreateWindowEx().
Example ¶
var owner ui.AnyParent // initialized somewhere myProg := ui.NewProgressBar( owner, ui.ProgressBarOpts(). Position(win.POINT{X: 350, Y: 80}), ), )
func NewProgressBarDlg ¶
func NewProgressBarDlg( parent AnyParent, ctrlId int, horz HORZ, vert VERT) ProgressBar
Creates a new ProgressBar from a dialog resource.
type RadioButton ¶
type RadioButton interface { AnyNativeControl AnyFocusControl AnyTextControl // Exposes all the [Button notifications] the can be handled. // // Panics if called after the control was created. // // [Button notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-button-control-reference-notifications On() *_ButtonEvents EmulateClick() // Emulates an user click. IsSelected() bool // Tells whether this radio button is the selected one in its group. Select() // Selects the radio button. SelectAndTrigger() // Selects the radio button and triggers the click event. SetTextAndResize(text string) // Sets the text and resizes the control to fit it exactly. // contains filtered or unexported methods }
Native radio button control.
Prefer using a RadioGroup instead.
func NewRadioButton ¶
func NewRadioButton(parent AnyParent, opts *_RadioButtonO) RadioButton
Creates a new RadioButton. Call ui.RadioButtonOpts() to define the options to be passed to the underlying CreateWindowEx().
Prefer using the RadioGroup, which manages multiple radio buttons at once.
Example ¶
var owner ui.AnyParent // initialized somewhere myRadio := ui.NewRadioButton( owner, ui.RadioButtonOpts(). Text("Some option"). Position(win.POINT{X: 10, Y: 40}). WndStyles(co.WS_VISIBLE|co.WS_CHILD|co.WS_TABSTOP|co.WS_GROUP), ), )
func NewRadioButtonDlg ¶
func NewRadioButtonDlg( parent AnyParent, ctrlId int, horz HORZ, vert VERT) RadioButton
Creates a new RadioButton from a dialog resource.
type RadioGroup ¶
type RadioGroup interface { // Exposes all the [Button notifications] the can be handled by all radios // in the group. // // Panics if called after the control was created. // // [Button notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-button-control-reference-notifications On() *_RadioButtonEvents AsCtrls() []AnyControl // Returns all radios buttons as AnyControl. EnableAll(enable bool) // Calls EnableWindow on all radio buttons. FocusSelected() // Puts the focus on the currently selected radio button, if any. Item(index int) RadioButton // Returns the RadioButton at the given index. Parent() AnyParent // Returns the parent of the radio buttons. Selected() (RadioButton, bool) // Returns the currently selected RadioButton, if any. // contains filtered or unexported methods }
Manages a group of native radio button controls.
func NewRadioGroup ¶
func NewRadioGroup(parent AnyParent, opts ...*_RadioButtonO) RadioGroup
Creates a new RadioGroup, with one or more RadioButton controls. Call ui.RadioButtonOpts() to define the options of each RadioButton to be passed to the underlying CreateWindowEx().
Example ¶
var owner ui.AnyParent // initialized somewhere myRadios := ui.NewRadioGroup( owner, ui.RadioButtonOpts(). Text("First option"). Position(win.POINT{X: 10, Y: 40}). WndStyles(co.WS_VISIBLE|co.WS_CHILD|co.WS_TABSTOP|co.WS_GROUP), ), ui.RadioButtonOpts(). Text("Second option"). Position(win.POINT{X: 10, Y: 80}). Select(true), ), ui.RadioButtonOpts(). Text("Third option"). Position(win.POINT{X: 10, Y: 120}), ), )
func NewRadioGroupDlg ¶
func NewRadioGroupDlg( parent AnyParent, horz HORZ, vert VERT, ctrlIds ...int) RadioGroup
Creates a new RadioGroup, where each RadioButton is from a dialog resource.
type Static ¶
type Static interface { AnyNativeControl AnyTextControl // Exposes all the [Static notifications] the can be handled. // // Panics if called after the control was created. // // [Static notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-static-control-reference-notifications On() *_StaticEvents SetTextAndResize(text string) // Sets the text and resizes the control to fit it exactly. // contains filtered or unexported methods }
Native static control.
type StatusBar ¶
type StatusBar interface { AnyNativeControl // Exposes all the [StatusBar notifications] the can be handled. // // Panics if called after the control was created. // // [StatusBar notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-status-bars-reference-notifications On() *_StatusBarEvents // Parts methods. Parts() *_StatusBarParts // contains filtered or unexported methods }
Native status bar control.
type StatusBarPart ¶
type StatusBarPart struct {
// contains filtered or unexported fields
}
A single part of a StatusBar.
func (StatusBarPart) Icon ¶
func (me StatusBarPart) Icon() win.HICON
Retrieves the HICON.
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 part.
func (StatusBarPart) SetIcon ¶
func (me StatusBarPart) SetIcon(hIcon win.HICON)
Puts the HICON.
The icon is shared, the StatusBar doesn't own it.
type SysLink ¶
type SysLink interface { AnyNativeControl AnyFocusControl AnyTextControl // Exposes all the [SysLink notifications] the can be handled. // // Panics if called after the control was created. // // [SysLink notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-syslink-control-reference-notifications On() *_SysLinkEvents SetTextAndResize(text string) // Sets the text and resizes the control to fit it exactly. // contains filtered or unexported methods }
Native SysLink control.
func NewSysLink ¶
Creates a new SysLink. Call ui.SysLinkOpts() to define the options to be passed to the underlying CreateWindowEx().
Example ¶
var owner ui.AnyParent // initialized somewhere myLink := ui.NewSysLink( owner, ui.SysLinkOpts(). Text("Click <a href=\"123\">here</a>."). Position(win.POINT{X: 20, Y: 10}), ), )
type Toolbar ¶
type Toolbar interface { AnyNativeControl // Exposes all the [Toolbar notifications] the can be handled. // // Panics if called after the control was created. // // [Toolbar notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-toolbar-control-reference-notifications On() *_ToolbarEvents AutoSize() // Sends a TB_AUTOSIZE message to resize the toolbar. ExtendedStyle() co.TBSTYLE_EX // Retrieves the extended style flags. Buttons() *_ToolbarButtons // Button methods. SetExtendedStyle(doSet bool, styles co.TBSTYLE_EX) // Sets or unsets extended style flags. SetImageList(index int, himgl win.HIMAGELIST) win.HIMAGELIST // Sets the nth image list for the control. SetParent(hNewParent win.HWND) win.HWND // Sets the window to which the toolbar control sends notification messages. // contains filtered or unexported methods }
Native toolbar control.
func NewToolbar ¶
Creates a new Toolbar. Call ui.ToolbarOpts() to define the options to be passed to the underlying CreateWindowEx().
Example ¶
var owner ui.AnyParent // initialized somewhere myBar := ui.NewToolbar( owner, ui.ToolbarOpts(). CtrlStyles(co.TBSTYLE_BUTTON|co.TBSTYLE_LIST|co.TBSTYLE_FLAT), ), )
type Trackbar ¶
type Trackbar interface { AnyNativeControl AnyFocusControl // Exposes all the [Trackbar notifications] the can be handled. // // Panics if called after the control was created. // // [Trackbar notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-trackbar-control-reference-notifications On() *_TrackbarEvents PageSize() int // Retrieves the number of positions of page up/down. Pos() int // Retrieves the current position. RangeMax() int // Retrieves the maximum position. RangeMin() int // Retrieves the mininum position. SetPageSize(pageSize int) int // Sets the number of positions of page up/down. SetPos(pos int) // Sets the current position. SetRangeMax(max int) // Sets the maximum position. SetRangeMin(min int) // Sets the minimum position. // contains filtered or unexported methods }
Native trackbar control.
func NewTrackbar ¶
Creates a new Trackbar. Call ui.TrackbarOpts() to define the options to be passed to the underlying CreateWindowEx().
Example ¶
var owner ui.AnyParent // initialized somewhere mySlider := ui.NewTrackbar( owner, ui.TrackbarOpts(). Position(win.POINT{X: 10, Y: 250}). RangeMax(4), ), )
type TreeView ¶
type TreeView interface { AnyNativeControl AnyFocusControl // Exposes all the [TreeView notifications] the can be handled. // // Panics if called after the control was created. // // [TreeView notifications]: https://learn.microsoft.com/en-us/windows/win32/controls/bumper-tree-view-control-reference-notifications On() *_TreeViewEvents Items() *_TreeViewItems // Item methods. // contains filtered or unexported methods }
Native tree view control.
func NewTreeView ¶
Creates a new TreView. Call ui.TreeViewOpts() to define the options to be passed to the underlying CreateWindowEx().
Example ¶
var owner AnyParent // initialized somewhere myTree := ui.NewTreeView( owner, ui.TreeViewOpts(). Position(win.POINT{X: 10, Y: 240}). Size(win.SIZE{Cx: 150, Cy: 100}), ), )
type TreeViewItem ¶
type TreeViewItem struct {
// contains filtered or unexported fields
}
A single item of a TreeView.
func (TreeViewItem) AddChild ¶
func (me TreeViewItem) AddChild(text string) TreeViewItem
Adds a child to this item.
func (TreeViewItem) Children ¶
func (me TreeViewItem) Children() []TreeViewItem
Retrieves all the children of this item.
func (TreeViewItem) EnsureVisible ¶
func (me TreeViewItem) EnsureVisible()
Makes sure the item is visible, scrolling the TreeView if needed.
func (TreeViewItem) Htreeitem ¶
func (me TreeViewItem) Htreeitem() win.HTREEITEM
Returns the unique handle of the item.
func (TreeViewItem) IsExpanded ¶
func (me TreeViewItem) IsExpanded() bool
Tells whether the item is currently expanded.
func (TreeViewItem) IsRoot ¶
func (me TreeViewItem) IsRoot() bool
Tells whether the item is a root item (has no parent).
func (TreeViewItem) LParam ¶
func (me TreeViewItem) LParam() win.LPARAM
Retrieves the custom data associated with the item.
func (TreeViewItem) NextSibling ¶
func (me TreeViewItem) NextSibling() (TreeViewItem, bool)
Retrieves the next item, if any.
func (TreeViewItem) Parent ¶
func (me TreeViewItem) Parent() (TreeViewItem, bool)
Retrieves the parent item, if any.
func (TreeViewItem) PrevSibling ¶
func (me TreeViewItem) PrevSibling() (TreeViewItem, bool)
Retrieves the previous item, if any.
func (TreeViewItem) SetLParam ¶
func (me TreeViewItem) SetLParam(lp win.LPARAM)
Sets the custom data associated with the item.
func (TreeViewItem) SetText ¶
func (me TreeViewItem) SetText(text string)
Sets the text of the item.
type WindowControl ¶
type WindowControl interface { AnyParent AnyControl }
User-custom child control.
func NewWindowControl ¶
func NewWindowControl(parent AnyParent, opts *_WindowControlO) WindowControl
Creates a new WindowControl. Call WindowControlOpts() to define the options to be passed to the underlying CreateWindowEx().
Example ¶
var owner AnyParent // initialized somewhere myControl := ui.NewWindowControl( owner, ui.WindowControlOpts(). Position(win.POINT{X: 100, Y: 100}). Size(win.SIZE{Cx: 300, Cy: 200}). RangeMax(4), ), )
func NewWindowControlDlg ¶
func NewWindowControlDlg( parent AnyParent, dialogId int, position win.POINT, horz HORZ, vert VERT) WindowControl
Creates a new WindowControl by loading a dialog resource, with an auto-generated control ID.
If parent is a dialog box, position coordinates are in Dialog Template Units; otherwise, they are in pixels and they will be adjusted to the current system DPI.
func NewWindowControlDlgWithId ¶
func NewWindowControlDlgWithId( parent AnyParent, dialogId int, position win.POINT, ctrlId int, horz HORZ, vert VERT) WindowControl
Creates a new WindowControl by loading a dialog resource, specifying a control ID.
If parent is a dialog box, position coordinates are in Dialog Template Units; otherwise, they are in pixels and they will be adjusted to the current system DPI.
type WindowMain ¶
type WindowMain interface { AnyParent // Creates the main window and runs the main application loop. // // Will block until the window is closed. RunAsMain() int }
User-custom main application window.
func NewWindowMain ¶
func NewWindowMain(opts *_WindowMainO) WindowMain
Creates a new WindowMain. Call WindowMainOpts() to define the options to be passed to the underlying CreateWindowEx().
Example ¶
myWindow := ui.NewWindowMain( ui.WindowMainOpts(). Title("Hello world"). ClientArea(win.SIZE{Cx: 500, Cy: 400}). WndStyles(co.WS_CAPTION | co.WS_SYSMENU | co.WS_CLIPCHILDREN | co.WS_BORDER | co.WS_VISIBLE | co.WS_MINIMIZEBOX | co.WS_MAXIMIZEBOX | co.WS_SIZEBOX), ), )
func NewWindowMainDlg ¶
func NewWindowMainDlg(dialogId, iconId, accelTableId int) WindowMain
Creates a new WindowMain by loading a dialog resource.
Parameters iconId and accelTableId are optional.
type WindowModal ¶
type WindowModal interface { AnyParent // Creates and shows the modal window. // // Will block until the window is closed. ShowModal(parent AnyParent) }
User-custom modal window.
func NewWindowModal ¶
func NewWindowModal(opts *_WindowModalO) WindowModal
Creates a new WindowModal. Call WindowModalOpts() to define the options to be passed to the underlying CreateWindowEx().
Example ¶
myModal := ui.NewWindowModal( ui.WindowModalOpts(). Title("My modal window"), ), )
func NewWindowModalDlg ¶
func NewWindowModalDlg(dialogId int) WindowModal
Creates a new WindowModal by loading a dialog resource.
Source Files ¶
- AcceleratorTable.go
- CButton.go
- CCheckBox.go
- CComboBox.go
- CComboBoxItem.go
- CComboBoxItems.go
- CDateTimePicker.go
- CEdit.go
- CListView.go
- CListViewColumn.go
- CListViewColumns.go
- CListViewItem.go
- CListViewItems.go
- CMonthCalendar.go
- CProgressBar.go
- CRadioButton.go
- CRadioGroup.go
- CStatic.go
- CStatusBar.go
- CStatusBarPart.go
- CStatusBarParts.go
- CSysLink.go
- CToolbar.go
- CToolbarButtons.go
- CTrackbar.go
- CTreeView.go
- CTreeViewItem.go
- CTreeViewItems.go
- EventsInternal.go
- EventsWm.go
- EventsWmNfy.go
- NativeControlBase.go
- ResizerChildren.go
- TaskDlg.go
- WindowBase.go
- WindowDlg.go
- WindowDlgControl.go
- WindowDlgMain.go
- WindowDlgModal.go
- WindowRaw.go
- WindowRawControl.go
- WindowRawMain.go
- WindowRawModal.go
- any_globals.go
- any_interfaces.go