wingui

package module
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: May 9, 2025 License: MIT Imports: 9 Imported by: 0

README

Windows GUI Library - wingui

GitHub Go Report Card GoDoc GitHub All Releases

Actions Status

Golang GUI library for windows, UI created by ResEdit or Visual Studio Resource Editor

Lightweight, high performance and small executable file size Windows GUI library.

UI Design tool

ResEdit

Visual Studio Resource Editor

Other dialog box editor

Requires

GCC (Optionally, windres.exe can be used to generate a syso file from res or rc.)

MinGW http://www.mingw.org

or

TDM-GCC http://tdm-gcc.tdragon.net/

windres.exe

This tool in TDM-GCC-64/bin/windres.exe,don't know where in MinGW.

You can also use rc.exe and link.exe to generate syso file.

Usage

Simple usage:

example for https://github.com/whtiehack/wingui/tree/master/examples/simple

Generate x.syso file from rc or res file use windres.exe tool.

generate syso file:

windres -i emptyProject/Debug/resource.res -O coff -o vsui.syso

or

windres -i ui/ui.rc -O coff -o ui.syso

main.go

package main

import "github.com/whtiehack/wingui"

func main() {
	dlg, _ := wingui.NewDialog(101, 0, nil)
	dlg.SetIcon(105)
	btnok, _ := wingui.BindNewButton(1002, dlg)
	btncancel, _ := wingui.BindNewButton(1003, dlg)
	btnok.OnClicked = func() {
		dlg.Close()
	}
	btncancel.OnClicked = btnok.OnClicked
	dlg.Show()
	// This invoke is optional.
	wingui.SetCurrentDialog(dlg.Handle())
	wingui.MessageLoop()
}


run: go run .

Don't use go run main.go, because golang can't load x.syso files.

More examples

Examples

see https://github.com/whtiehack/wingui/tree/master/examples

Welcome PRs.

References

https://github.com/lxn/walk

https://github.com/sumorf/gowi

https://docs.microsoft.com/zh-cn/windows/win32/

https://docs.microsoft.com/zh-cn/windows/win32/uxguide/controls

https://docs.microsoft.com/zh-cn/windows/win32/controls/window-controls

Screenshot

ResEdit

resedit

wowjump ResEdit Download

Visual Studio Resource Editor

vsreseditor

Effect

resedit

wowjump

File size

size

TODOs

click to show
  • Edit

  • Static Text

  • Image

  • ComboBoxx

  • ListBox


Button
  • PushButton
  • CheckBox
  • Radio Button

  • Slider Control

  • Progress Bar

  • Tab Control

  • ListView Control

  • Spin Control

  • Rich Edit

  • DateTimePicker

  • Month Calendar

  • TreeView Control

  • Hot Key

  • Accelerator

  • Menu

Recommend

If you need to do complex GUI programs, you can use govcl or walk.

Documentation

Overview

Package wingui https://docs.microsoft.com/zh-cn/windows/win32/controls/progress-bar-control#using-progress-bars

* wingui Golang GUI library

Usage

### Simple usage:

Generate x.syso file from rc or res file use `windres.exe` tool.

genereate syso:

`windres -i emptyProject/Debug/resource.res -O coff -o vsui.syso`

or

`windres -i ui/ui.rc -O coff -o ui.syso`

main.go ```go package main

import "github.com/whtiehack/wingui"

func main() {
	dlg, _ := wingui.NewDialog(101, 0, nil)
	dlg.SetIcon(105)
	btnok, _ := wingui.BindNewButton(1002, dlg)
	btncancel, _ := wingui.BindNewButton(1003, dlg)
	btnok.OnClicked = func() {
		dlg.Close()
	}
	btncancel.OnClicked = btnok.OnClicked
	dlg.Show()
	// This invoke is optional.
	wingui.SetCurrentDialog(dlg.Handle())
	wingui.MessageLoop()
}

```

run: `go run .`

Don't use `go run main.go`, because golang can't load x.syso files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitHInstance

func InitHInstance(lpModuleName string)

InitHInstance init hInstance,used by Dialog APIs.

func MessageLoop

func MessageLoop()

MessageLoop start windows message loop.

func NewModalDialog

func NewModalDialog(idd uintptr, parent win.HWND, dialogConfig *DialogConfig, cb ModalDialogCallBack) int

NewModalDialog create a new modal Dialog.

func RGB

func RGB(r, g, b uintptr) win.COLORREF

func SetCurrentDialog

func SetCurrentDialog(h win.HWND)

SetCurrentDialog make sure Message Loop could process dialog msg correct,such as Tabstop msg. This is a optional method.

Types

type Bitmap

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

Bitmap struct

func NewBitmapFromFile

func NewBitmapFromFile(filePath string) (*Bitmap, error)

NewBitmapFromFile create a new Bitmap from file. Could use jpg file :)

func NewBitmapFromResource

func NewBitmapFromResource(name string) (bm *Bitmap, err error)

NewBitmapFromResource create a new Bitmap from resource.

func NewBitmapFromResourceId

func NewBitmapFromResourceId(idd uintptr) (bm *Bitmap, err error)

NewBitmapFromResourceId create a new Bitmap from resource ID.

func NewBitmapFromWindow

func NewBitmapFromWindow(hwnd win.HWND) (*Bitmap, error)

func (*Bitmap) Dispose

func (b *Bitmap) Dispose()

Dispose release resource.

func (*Bitmap) HBitmap

func (b *Bitmap) HBitmap() win.HBITMAP

HBitmap get handle HBITMAP

func (*Bitmap) Size

func (bmp *Bitmap) Size() Size

Size get bitmap size

type Button

type Button struct {
	WindowBase
	OnClicked       func()
	OnDoubleClicked func()
}

Button a widget for Dialog. base of all button type.

func BindNewButton

func BindNewButton(idd uintptr, dlg *Dialog) (*Button, error)

BindNewButton create a new Button and bind to target dlg.

func BindNewButtons

func BindNewButtons(idds []uintptr, dlg *Dialog) ([]*Button, error)

func NewButton

func NewButton(idd uintptr) *Button

NewButton create a new Button,need bind to Dialog before use.

func (*Button) Click

func (b *Button) Click()

Click simulates the user clicking a button. This message causes the button to receive the WM_LBUTTONDOWN and WM_LBUTTONUP messages, and the button's parent window to receive a BN_CLICKED notification code.

func (*Button) GetCheck

func (b *Button) GetCheck() int

GetCheck gets the check state of a radio button or check box.

checked return 1, unchecked return 0

if Button has BS_3STATE or BS_AUTO3STATE style, may be return 2

BST_CHECKED 1

BST_INDETERMINATE 2

BST_UNCHECKED 0

func (*Button) GetImage

func (b *Button) GetImage(t int) uintptr

GetImage retrieves a handle to the image (icon or bitmap) associated with the button. t is the type of image to associate with the button. This parameter can be one of the following values: - IMAGE_BITMAP - IMAGE_ICON

The return value is a handle to the image, if any; otherwise, it is NULL.

func (*Button) GetNote

func (b *Button) GetNote() (str string)

GetNote gets the text of the note associated with a command link button. CommandLink button

func (*Button) GetState

func (b *Button) GetState() int

GetState retrieves the state of a button or check box.

The return value specifies the current state of the button. It is a combination of the following values.

Return code and description:

BST_CHECKED The button is checked.

BST_DROPDOWNPUSHED Windows Vista. The button is in the drop-down state. Applies only if the button has the TBSTYLE_DROPDOWN style.

BST_FOCUS The button has the keyboard focus.

BST_HOT The button is hot; that is, the mouse is hovering over it.

BST_INDETERMINATE The state of the button is indeterminate. Applies only if the button has the BS_3STATE or BS_AUTO3STATE style.

BST_PUSHED The button is being shown in the pushed state.

BST_UNCHECKED No special state. Equivalent to zero.

func (*Button) SetCheck

func (b *Button) SetCheck(state int)

SetCheck Sets the check state of a radio button or check box, state is the check state. This parameter can be one of the following values.

Value Meaning: BST_CHECKED 1 Sets the button state to checked.

BST_INDETERMINATE 2 Sets the button state to grayed, indicating an indeterminate state. Use this value only if the button has the BS_3STATE or BS_AUTO3STATE style.

BST_UNCHECKED 0 Sets the button state to cleared.

func (*Button) SetDontClick

func (b *Button) SetDontClick(state bool)

SetDontClick sets a flag on a radio button that controls the generation of BN_CLICKED messages when the button receives focus. notice: WINVER >= 0x0600

func (*Button) SetDropDownState

func (b *Button) SetDropDownState(state bool)

SetDropDownState sets the drop down state for a button with style TBSTYLE_DROPDOWN. state is a BOOL that is TRUE for state of BST_DROPDOWNPUSHED, or FALSE otherwise.

func (*Button) SetImage

func (b *Button) SetImage(t int, handle uintptr) uintptr

SetImage associates a new image (icon or bitmap) with the button. t is the type of image to associate with the button. This parameter can be one of the following values: - IMAGE_BITMAP - IMAGE_ICON

handle is a handle (HICON or HBITMAP) to the image to associate with the button.

The return value is a handle to the image previously associated with the button, if any; otherwise, it is NULL.

func (*Button) SetNote

func (b *Button) SetNote(note string)

SetNote sets the text of the note associated with a command link button.

func (*Button) SetShield

func (b *Button) SetShield(state bool)

SetShield sets the elevation required state for a specified button or command link to display an elevated icon. state is a BOOL that is TRUE to draw an elevated icon, or FALSE otherwise.

func (*Button) SetState

func (b *Button) SetState(highlight bool)
SetState sets the highlight state of a button.
The highlight state indicates whether the button is highlighted as if the user had pushed it.

Highlighting affects only the appearance of a button.
It has no effect on the check state of a radio button or check box.

A button is automatically highlighted when the user positions the cursor over it and presses and holds the left mouse button. The highlighting is removed when the user releases the mouse button.

func (*Button) SetStyle

func (b *Button) SetStyle(style int, redrawn bool)

SetStyle sets the style of a button. The button style can be a combination of button styles. For a table of button styles,

Constant Description:

BS_3STATE Creates a button that is the same as a check box, except that the box can be grayed as well as checked or cleared. Use the grayed state to show that the state of the check box is not determined.

BS_AUTO3STATE Creates a button that is the same as a three-state check box, except that the box changes its state when the user selects it. The state cycles through checked, indeterminate, and cleared.

BS_AUTOCHECKBOX Creates a button that is the same as a check box, except that the check state automatically toggles between checked and cleared each time the user selects the check box.

BS_AUTORADIOBUTTON Creates a button that is the same as a radio button, except that when the user selects it, the system automatically sets the button's check state to checked and automatically sets the check state for all other buttons in the same group to cleared.

BS_BITMAP Specifies that the button displays a bitmap. See the Remarks section for its interaction with BS_ICON.

BS_BOTTOM Places text at the bottom of the button rectangle.

BS_CENTER Centers text horizontally in the button rectangle.

BS_CHECKBOX Creates a small, empty check box with text. By default, the text is displayed to the right of the check box. To display the text to the left of the check box, combine this flag with the BS_LEFTTEXT style (or with the equivalent BS_RIGHTBUTTON style).

BS_COMMANDLINK Creates a command link button that behaves like a BS_PUSHBUTTON style button, but the command link button has a green arrow on the left pointing to the button text. A caption for the button text can be set by sending the BCM_SETNOTE message to the button.

BS_DEFCOMMANDLINK Creates a command link button that behaves like a BS_PUSHBUTTON style button. If the button is in a dialog box, the user can select the command link button by pressing the ENTER key, even when the command link button does not have the input focus. This style is useful for enabling the user to quickly select the most likely (default) option.

BS_DEFPUSHBUTTON Creates a push button that behaves like a BS_PUSHBUTTON style button, but has a distinct appearance. If the button is in a dialog box, the user can select the button by pressing the ENTER key, even when the button does not have the input focus. This style is useful for enabling the user to quickly select the most likely (default) option.

BS_DEFSPLITBUTTON Creates a split button that behaves like a BS_PUSHBUTTON style button, but also has a distinctive appearance. If the split button is in a dialog box, the user can select the split button by pressing the ENTER key, even when the split button does not have the input focus. This style is useful for enabling the user to quickly select the most likely (default) option.

BS_GROUPBOX Creates a rectangle in which other controls can be grouped. Any text associated with this style is displayed in the rectangle's upper left corner.

BS_ICON Specifies that the button displays an icon. See the Remarks section for its interaction with BS_BITMAP.

BS_FLAT Specifies that the button is two-dimensional; it does not use the default shading to create a 3-D image.

BS_LEFT Left-justifies the text in the button rectangle. However, if the button is a check box or radio button that does not have the BS_RIGHTBUTTON style, the text is left justified on the right side of the check box or radio button.

BS_LEFTTEXT Places text on the left side of the radio button or check box when combined with a radio button or check box style. Same as the BS_RIGHTBUTTON style.

BS_MULTILINE Wraps the button text to multiple lines if the text string is too long to fit on a single line in the button rectangle.

BS_NOTIFY Enables a button to send BN_KILLFOCUS and BN_SETFOCUS notification codes to its parent window.

Note that buttons send the BN_CLICKED notification code regardless of whether it has this style. To get BN_DBLCLK notification codes, the button must have the BS_RADIOBUTTON or BS_OWNERDRAW style.

BS_OWNERDRAW Creates an owner-drawn button. The owner window receives a WM_DRAWITEM message when a visual aspect of the button has changed. Do not combine the BS_OWNERDRAW style with any other button styles.

BS_PUSHBUTTON Creates a push button that posts a WM_COMMAND message to the owner window when the user selects the button.

BS_PUSHLIKE Makes a button (such as a check box, three-state check box, or radio button) look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked.

BS_RADIOBUTTON Creates a small circle with text. By default, the text is displayed to the right of the circle. To display the text to the left of the circle, combine this flag with the BS_LEFTTEXT style (or with the equivalent BS_RIGHTBUTTON style). Use radio buttons for groups of related, but mutually exclusive choices.

BS_RIGHT Right-justifies text in the button rectangle. However, if the button is a check box or radio button that does not have the BS_RIGHTBUTTON style, the text is right justified on the right side of the check box or radio button.

BS_RIGHTBUTTON Positions a radio button's circle or a check box's square on the right side of the button rectangle. Same as the BS_LEFTTEXT style.

BS_SPLITBUTTON Creates a split button. A split button has a drop down arrow.

BS_TEXT Specifies that the button displays text.

BS_TOP Places text at the top of the button rectangle.

BS_TYPEMASK Do not use this style. A composite style bit that results from using the OR operator on BS_* style bits. It can be used to mask out valid BS_* bits from a given bitmask. Note that this is out of date and does not correctly include all valid styles. Thus, you should not use this style.

BS_USERBUTTON Obsolete, but provided for compatibility with 16-bit versions of Windows. Applications should use BS_OWNERDRAW instead.

BS_VCENTER Places text in the middle (vertically) of the button rectangle.

https://docs.microsoft.com/zh-cn/windows/win32/controls/button-styles

func (*Button) WndProc

func (b *Button) WndProc(msg uint32, wParam, lParam uintptr) uintptr

WndProc Button window WndProc.

type ComboBox

type ComboBox struct {
	WindowBase
	// OnSelChange
	OnSelChange func()
}

ComboBox a ComboBox widget for Dialog.

func BindNewComboBox

func BindNewComboBox(idd uintptr, dlg *Dialog) (*ComboBox, error)

BindNewComboBox create a new ComboBox and bind to target dlg.

func NewComboBox

func NewComboBox(idd uintptr) *ComboBox

NewComboBox create a new ComboBox,need bind to Dialog before use.

func (*ComboBox) AddString

func (cb *ComboBox) AddString(str string) (idx int, err error)

AddString adds a string to the list box of a combo box. If the combo box does not have the CBS_SORT style, the string is added to the end of the list. Otherwise, the string is inserted into the list, and the list is sorted. The return value idx is the zero-based index to the string in the list box of the combo box.

func (*ComboBox) DeleteString

func (cb *ComboBox) DeleteString(idx int) (leftCount int, err error)

DeleteString deletes a string in the list box of a combo box. The return value leftCount is a count of the strings remaining in the list

func (*ComboBox) GetCount

func (cb *ComboBox) GetCount() int

GetCount get items count of combobox.

func (*ComboBox) GetCurSel

func (cb *ComboBox) GetCurSel() int

GetCurSel get currentIndex.

func (*ComboBox) GetItemData

func (cb *ComboBox) GetItemData(index int) (data uintptr, err error)

GetItemData sends a CB_GETITEMDATA message to a combo box to retrieve the application-supplied value associated with the specified item in the combo box.

func (*ComboBox) GetLbText

func (cb *ComboBox) GetLbText(idx int) (str string)

GetLbText get text of item.

func (*ComboBox) InsertString

func (cb *ComboBox) InsertString(idx int, str string) (err error)

InsertString Inserts a string or item data into the list of a combo box. Unlike the CB_ADDSTRING message, the CB_INSERTSTRING message does not cause a list with the CBS_SORT style to be sorted.

func (*ComboBox) ResetContent

func (cb *ComboBox) ResetContent() int

ResetContent removes all items from the list box and edit control of a combo box.

func (*ComboBox) SelectString

func (cb *ComboBox) SelectString(str string, startIdx int) int

SelectString Searches the list of a combo box for an item that begins with the characters in a specified string. If a matching item is found, it is selected and copied to the edit control. If has error or not find,return -1

func (*ComboBox) SetCurSel

func (cb *ComboBox) SetCurSel(value int) error

SetCurSel set current index

func (*ComboBox) SetItemData

func (cb *ComboBox) SetItemData(index int, data uintptr) error

SetItemData sends a CB_SETITEMDATA message to set the value associated with the specified item in a combo box.

func (*ComboBox) WndProc

func (cb *ComboBox) WndProc(msg uint32, wParam, lParam uintptr) uintptr

WndProc ComboBox window WndProc.

type Dialog

type Dialog struct {
	WindowBase

	// if return true,will eat message.
	OnClose   func() bool
	OnDestroy func()
	// contains filtered or unexported fields
}

Dialog is main windows struct.

func NewDialog

func NewDialog(idd uintptr, parent win.HWND, dialogConfig *DialogConfig) (dlg *Dialog, err error)

NewDialog create a new Dialog.

func (*Dialog) BindWidgets

func (dlg *Dialog) BindWidgets(widgets ...Widget) error

BindWidgets bind dialog items.

func (*Dialog) GetWidget added in v0.0.6

func (dlg *Dialog) GetWidget(idd uintptr) Widget

func (*Dialog) SetIcon

func (dlg *Dialog) SetIcon(id uintptr)

SetIcon set Window Icon.

type DialogConfig

type DialogConfig struct {
	Style uint32
	//Widgets will be bind when dialog init.
	Widgets []Widget
}

DialogConfig TODO.

type Edit

type Edit struct {
	WindowBase
	OnChanged func()
}

Edit a widget for Dialog.

func BindNewEdit

func BindNewEdit(idd uintptr, dlg *Dialog) (*Edit, error)

BindNewEdit create a new Edit and bind to dlg.

func NewEdit

func NewEdit(idd uintptr) *Edit

NewEdit create a new Edit ,need bind to Dialog before use.

func (*Edit) AppendText

func (e *Edit) AppendText(value string)

AppendText append text to Edit

func (*Edit) ReplaceSelectedText

func (e *Edit) ReplaceSelectedText(text string, canUndo bool)

ReplaceSelectedText replace Text.

func (*Edit) SetTextSelection

func (e *Edit) SetTextSelection(start, end int)

SetTextSelection set Edit selection

func (*Edit) TextLength

func (e *Edit) TextLength() int

TextLength get Edit text length.

func (*Edit) TextSelection

func (e *Edit) TextSelection() (start, end int)

TextSelection get Edit selection.

func (*Edit) WndProc

func (e *Edit) WndProc(msg uint32, wParam, lParam uintptr) uintptr

WndProc Edit Window WndProc.

type Image

type Image struct {
	WindowBase
	// OnClicked must set appearance Notify to true before use.
	OnClicked func()
}

Image a static image widget for Dialog.

func BindNewImage

func BindNewImage(idd uintptr, dlg *Dialog) (*Image, error)

BindNewStatic create a new Image and bind to target dlg.

func NewImage

func NewImage(idd uintptr) *Image

NewImage create a new Image,need bind to Dialog before use.

func (*Image) LoadBitmap

func (b *Image) LoadBitmap(bitmap win.HBITMAP) uintptr

LoadBitmap show Bitmap on window. Don't forget to set the type to Bitmap

func (*Image) WndProc

func (b *Image) WndProc(msg uint32, wParam, lParam uintptr) uintptr

WndProc Image window WndProc.

type ListBox

type ListBox struct {
	WindowBase
	// TOxDO: notify method
	OnDoubleClick func()
	OnSelChange   func()
}

ListBox a ListBox widget for Dialog.

func BindNewListBox

func BindNewListBox(idd uintptr, dlg *Dialog) (*ListBox, error)

BindNewListBox create a new ListBox and bind to target dlg.

func NewListBox

func NewListBox(idd uintptr) *ListBox

NewListBox create a new ListBox,need bind to Dialog before use.

func (*ListBox) AddString

func (lb *ListBox) AddString(str string) (idx int, err error)

AddString Adds a string to a list box. If the list box does not have the LBS_SORT style, the string is added to the end of the list. Otherwise, the string is inserted into the list and the list is sorted.

func (*ListBox) DeleteString

func (lb *ListBox) DeleteString(idx int) (leftCount int, err error)

DeleteString deletes a string in a list box. The return value leftCount is a count of the strings remaining in the list

func (*ListBox) GetCount

func (lb *ListBox) GetCount() int

GetCount gets the number of items in a list box.

func (*ListBox) GetCurSel

func (lb *ListBox) GetCurSel() int

GetCurSel gets the index of the currently selected item, if any, in a single-selection list box.

If there is no selection, the return value is -1.

func (*ListBox) GetItemData

func (lb *ListBox) GetItemData(index int) (data uintptr, err error)

GetItemData gets the application-defined value associated with the specified list box item.

func (*ListBox) GetSel

func (lb *ListBox) GetSel(idx int) bool

GetSel gets the selection state of an item. If selected , return true;otherwise return false

func (*ListBox) GetSelectedIndexes

func (lb *ListBox) GetSelectedIndexes() []int

GetSelectedIndexes gets the current selected items index. The return value is the array of index selected. If the list box is a single-selection list box, the return value is nil.

func (*ListBox) GetText

func (lb *ListBox) GetText(idx int) (str string)

GetText gets a string from a list box.

func (*ListBox) InsertString

func (lb *ListBox) InsertString(idx int, str string) (err error)

InsertString inserts a string or item data into a list box. Unlike the LB_ADDSTRING message, the LB_INSERTSTRING message does not cause a list with the LBS_SORT style to be sorted.

func (*ListBox) ResetContent

func (lb *ListBox) ResetContent() int

ResetContent removes all items from a list box.

func (*ListBox) SelectString

func (lb *ListBox) SelectString(str string, startIdx int) int

SelectString searches a list box for an item that begins with the characters in a specified string. If a matching item is found, the item is selected.

func (*ListBox) SetCurSel

func (lb *ListBox) SetCurSel(idx int) error

SetCurSel selects a string and scrolls it into view, if necessary. When the new string is selected, the list box removes the highlight from the previously selected string. Use this message only with single-selection list boxes. You cannot use it to set or remove a selection in a multiple-selection list box.

func (*ListBox) SetItemData

func (lb *ListBox) SetItemData(index int, data uintptr) error

SetItemData sets a value associated with the specified item in a list box.

func (*ListBox) SetSel

func (lb *ListBox) SetSel(idx int, sel bool) error

SetSel selects an item in a multiple-selection list box and, if necessary, scrolls the item into view. Use this message only with multiple-selection list boxes.

If idx parameter is -1, the selection is added to or removed from all items,
depending on the value of wParam, and no scrolling occurs.

func (*ListBox) WndProc

func (lb *ListBox) WndProc(msg uint32, wParam, lParam uintptr) uintptr

WndProc ListBox window WndProc.

type ModalDialogCallBack

type ModalDialogCallBack func(dlg *Dialog)

ModalDialogCallBack is modal dialog callback

type ProgressBar

type ProgressBar struct {
	WindowBase
}

ProgressBar a widget for Dialog. Progress Bar

func BindNewProgressBar

func BindNewProgressBar(idd uintptr, dlg *Dialog) (*ProgressBar, error)

BindNewProgressBar create a new ProgressBar and bind to target dlg.

func NewProgressBar

func NewProgressBar(idd uintptr) *ProgressBar

NewProgressBar create a new ProgressBar,need bind to Dialog before use.

func (*ProgressBar) DeltaPos

func (pb *ProgressBar) DeltaPos(delta int) int

DeltaPos Advances the current position of a progress bar by a specified increment and redraws the bar to reflect the new position.

Returns the previous position.

If the increment results in a value outside the range of the control, the position is set to the nearest boundary.

The behavior of this message is undefined if it is sent to a control that has the PBS_MARQUEE style.

func (*ProgressBar) GetBarColor

func (pb *ProgressBar) GetBarColor() int

GetBarColor Gets the color of the progress bar.

Returns the color of the progress bar.

This is the color set by the PBM_SETBARCOLOR message. The default value is CLR_DEFAULT, which is defined in commctrl.h.

This function only affects the classic mode, not any visual style.

func (*ProgressBar) GetBkColor added in v0.0.4

func (pb *ProgressBar) GetBkColor() int

GetBkColor Gets the background color of the progress bar.

Returns the background color of the progress bar.

This is the color set by the PBM_SETBKCOLOR message. The default value is CLR_DEFAULT, which is defined in commctrl.h.

This function only affects the classic mode, not any visual style.

func (*ProgressBar) GetPos added in v0.0.4

func (pb *ProgressBar) GetPos() int

GetPos Retrieves the current position of the progress bar.

Returns a UINT value that represents the current position of the progress bar.

func (*ProgressBar) GetRange added in v0.0.4

func (pb *ProgressBar) GetRange() (low int, high int)

GetRange Retrieves information about the current high and low limits of a given progress bar control.

func (*ProgressBar) GetState added in v0.0.4

func (pb *ProgressBar) GetState() int

GetState Gets the state of the progress bar.

Returns the current state of the progress bar. One of the following values.

Return code	Description
PBST_NORMAL
In progress.

PBST_ERROR
Error.

PBST_PAUSED
Paused.

func (*ProgressBar) GetStep added in v0.0.4

func (pb *ProgressBar) GetStep() int

GetStep Retrieves the step increment from a progress bar. The step increment is the amount by which the progress bar increases its current position whenever it receives a PBM_STEPIT message. By default, the step increment is set to 10.

Returns the current step increment.

func (*ProgressBar) SetBarColor added in v0.0.4

func (pb *ProgressBar) SetBarColor(color int) int

SetBarColor Sets the color of the progress indicator bar in the progress bar control.

The COLORREF value that specifies the new progress indicator bar color. Specifying the CLR_DEFAULT value causes the progress bar to use its default progress indicator bar color.

Returns the previous progress indicator bar color, or CLR_DEFAULT if the progress indicator bar color is the default color.

func (*ProgressBar) SetBkColor added in v0.0.4

func (pb *ProgressBar) SetBkColor(color int) int

SetBkColor Sets the background color in the progress bar.

COLORREF value that specifies the new background color. Specify the CLR_DEFAULT value to cause the progress bar to use its default background color.

Returns the previous background color, or CLR_DEFAULT if the background color is the default color.

Remarks
When visual styles are enabled, this message has no effect.

func (*ProgressBar) SetMarquee added in v0.0.4

func (pb *ProgressBar) SetMarquee(enable bool, time int)

SetMarquee Sets the progress bar to marquee mode. This causes the progress bar to move like a marquee.

enable,indicates whether to turn the marquee mode on or off.

Time, in milliseconds, between marquee animation updates. If this parameter is zero, the marquee animation is updated every 30 milliseconds.

Remarks
Use this message when you do not know the amount of progress toward completion
but wish to indicate that progress is being made.

Send the PBM_SETMARQUEE message to start or stop the animation.

func (*ProgressBar) SetPit added in v0.0.4

func (pb *ProgressBar) SetPit() int

SetPit Advances the current position for a progress bar by the step increment and redraws the bar to reflect the new position. An application sets the step increment by sending the PBM_SETSTEP message.

Returns the previous position.

When the position exceeds the maximum range value, this message resets the current position so that the progress indicator starts over again from the beginning.

func (*ProgressBar) SetPos added in v0.0.4

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

SetPos Sets the current position for a progress bar and redraws the bar to reflect the new position.

pos:Signed integer that becomes the new position.

Returns the previous position.

Remarks
If pos is outside the range of the control, the position is set to the closest boundary.

Do not send this message to a control that has the PBS_MARQUEE style.

func (*ProgressBar) SetRange added in v0.0.4

func (pb *ProgressBar) SetRange(low, high int) int

SetRange Sets the minimum and maximum values for a progress bar and redraws the bar to reflect the new range.

The low specifies the minimum range value, and the high specifies the maximum range value. The minimum range value must not be negative. By default, the minimum value is zero. The maximum range value must be greater than the minimum range value. By default, the maximum range value is 100.

Returns the previous range values if successful, or zero otherwise.
The LOWORD specifies the previous minimum value, and the HIWORD specifies the previous maximum value.

Remarks
If you do not set the range values, the system sets the minimum value to 0 and the maximum value to 100.
Because this message expresses the range as a 16-bit unsigned integer, it can extend from 0 to 65,535.
The minimum value in the range can be from 0 to 65,535. Likewise, the maximum value can be from 0 to 65,535.

To set a larger range, call PBM_SETRANGE32.

func (*ProgressBar) SetRange32 added in v0.0.4

func (pb *ProgressBar) SetRange32(low, high int) int

SetRange32 Sets the minimum and maximum values for a progress bar to 32-bit values, and redraws the bar to reflect the new range.

func (*ProgressBar) SetState added in v0.0.4

func (pb *ProgressBar) SetState(state int) int

SetState Sets the state of the progress bar.

State of the progress bar that is being set. One of the following values.

Value	Meaning
PBST_NORMAL
In progress.

PBST_ERROR
Error.

PBST_PAUSED
Paused.

Returns the previous state.

func (*ProgressBar) SetStep added in v0.0.4

func (pb *ProgressBar) SetStep(step int) int

SetStep Specifies the step increment for a progress bar. The step increment is the amount by which the progress bar increases its current position whenever it receives a PBM_STEPIT message. By default, the step increment is set to 10.

step: New step increment.

Returns the previous step increment.

type Rectangle

type Rectangle struct {
	X, Y, Width, Height int
}

Rectangle is a Rect struct

type Size

type Size struct {
	Width, Height int
}

type Static

type Static struct {
	WindowBase
	// Color must set before Dialog init,Widget should bind use DialogConfig.
	Color win.COLORREF
	//BkMode must set same as Color
	BkMode int32

	// OnClicked must set appearance Notify to true before use.
	OnClicked func()
}

Static a static label widget for Dialog.

func BindNewStatic

func BindNewStatic(idd uintptr, dlg *Dialog) (*Static, error)

BindNewStatic create a new Static and bind to target dlg.

func NewStatic

func NewStatic(idd uintptr) *Static

NewStatic create a new Static,need bind to Dialog before use.

func (*Static) WndProc

func (b *Static) WndProc(msg uint32, wParam, lParam uintptr) uintptr

WndProc Static window WndProc.

type TabControl added in v0.0.4

type TabControl struct {
	WindowBase
	// contains filtered or unexported fields
}

TabControl a widget for Dialog. Tab Control

func BindTabControl added in v0.0.4

func BindTabControl(idd uintptr, dlg *Dialog) (*TabControl, error)

BindTabControl create a new TabControl and bind to target dlg.

func NewTabControl added in v0.0.4

func NewTabControl(idd uintptr) *TabControl

NewTabControl create a new TabControl, need bind to Dialog before use.

func (*TabControl) InsertItemText added in v0.0.6

func (tc *TabControl) InsertItemText(text string, dlg *Dialog)

TODO: direct newdialog InsertItemText insert tab with text

func (*TabControl) WndProc added in v0.0.6

func (tc *TabControl) WndProc(msg uint32, wParam, lParam uintptr) uintptr

WndProc TabControl window WndProc.

type TrackBar

type TrackBar struct {
	WindowBase
}

TrackBar a widget for Dialog. TrackBar

func BindNewTrackBar

func BindNewTrackBar(idd uintptr, dlg *Dialog) (*TrackBar, error)

BindNewTrackBar create a new TrackBar and bind to target dlg.

func NewTrackBar

func NewTrackBar(idd uintptr) *TrackBar

NewTrackBar create a new TrackBar,need bind to Dialog before use.

func (*TrackBar) ClearSel

func (tb *TrackBar) ClearSel(redraw bool)

ClearSel clears the current selection range in a trackbar. redraw if this parameter is TRUE, the trackbar is redrawn after the selection is cleared.

func (*TrackBar) ClearTics

func (tb *TrackBar) ClearTics(redraw bool)

ClearTics removes the current tick marks from a trackbar. This message does not remove the first and last tick marks, which are created automatically by the trackbar. redraw if this parameter is TRUE, the trackbar is redrawn after the selection is cleared.

func (*TrackBar) GetBuddy

func (tb *TrackBar) GetBuddy(isLeftOrTop bool) win.HWND

GetBuddy retrieves the handle to a trackbar control buddy window at a given location. The specified location is relative to the control's orientation (horizontal or vertical). isLeftOrTop indicating which buddy window handle will be retrieved, by relative location. This value can be one of the following: - TRUE - Retrieves the handle to the buddy to the left of the trackbar. If the trackbar control uses the TBS_VERT style, the message will retrieve the buddy above the trackbar. - FALSE - Retrieves the handle to the buddy to the right of the trackbar. If the trackbar control uses the TBS_VERT style, the message will retrieve the buddy below the trackbar.

func (*TrackBar) GetChannelRect

func (tb *TrackBar) GetChannelRect() win.RECT

Retrieves the size and position of the bounding rectangle for a trackbar's channel. (The channel is the area over which the slider moves. It contains the highlight when a range is selected.) Return value is a RECT structure. This structure with the channel's bounding rectangle, in client coordinates of the trackbar's window.

func (*TrackBar) GetLineSize

func (tb *TrackBar) GetLineSize() int

GetLineSize retrieves the number of logical positions the trackbar's slider moves in response to keyboard input from the arrow keys, such as the or keys. The logical positions are the integer increments in the trackbar's range of minimum to maximum slider positions. Returns a 32-bit value that specifies the line size for the trackbar. The default setting for the line size is 1. The trackbar also sends a WM_HSCROLL or WM_VSCROLL message with the TB_LINEUP and TB_LINEDOWN notification codes to its parent window when the user presses the arrow keys.

func (*TrackBar) GetNumTics

func (tb *TrackBar) GetNumTics() int

GetNumTics retrieves the number of tick marks in a trackbar. If no tick flag is set, it returns 2 for the beginning and ending ticks. If TBS_NOTICKS is set, it returns zero. Otherwise, it takes the difference between the range minimum and maximum, divides by the tick frequency, and adds 2.

The TBM_GETNUMTICS message counts all of the tick marks, including the first and last tick marks created by the trackbar.

func (*TrackBar) GetPageSize

func (tb *TrackBar) GetPageSize() int

GetPageSize retrieves the number of logical positions the trackbar's slider moves in response to keyboard input, such as the or keys, or mouse input, such as clicks in the trackbar's channel. The logical positions are the integer increments in the trackbar's range of minimum to maximum slider positions.

Returns a 32-bit value that specifies the page size for the trackbar. Remarks: The trackbar also sends a WM_HSCROLL or WM_VSCROLL message with the TB_PAGEUP and TB_PAGEDOWN notification codes to its parent window when it receives keyboard or mouse input that scrolls the page.

func (*TrackBar) GetPos

func (tb *TrackBar) GetPos() int

GetPos retrieves the current logical position of the slider in a trackbar. The logical positions are the integer values in the trackbar's range of minimum to maximum slider positions. Returns a 32-bit value that specifies the current logical position of the trackbar's slider.

func (*TrackBar) GetRangeMax

func (tb *TrackBar) GetRangeMax() int

GetRangeMax retrieves the maximum position for the slider in a trackbar. Returns a 32-bit value that specifies the maximum position in the trackbar's range of minimum to maximum slider positions.

func (*TrackBar) GetRangeMin

func (tb *TrackBar) GetRangeMin() int

GetRangeMin retrieves the minimum position for the slider in a trackbar. Returns a 32-bit value that specifies the minimum position in the trackbar's range of minimum to maximum slider positions

func (*TrackBar) GetSelEnd

func (tb *TrackBar) GetSelEnd() int

GetSelEnd retrieves the ending position of the current selection range in a trackbar. Returns a 32-bit value that specifies the ending position of the current selection range. A trackbar can have a selection range only if you specified the TBS_ENABLESELRANGE style when you created it.

func (*TrackBar) GetSelStart

func (tb *TrackBar) GetSelStart() int

GetSelStart retrieves the starting position of the current selection range in a trackbar. Returns a 32-bit value that specifies the starting position of the current selection range. A trackbar can have a selection range only if you specified the TBS_ENABLESELRANGE style when you created it.

func (*TrackBar) GetThumbLength

func (tb *TrackBar) GetThumbLength() int

GetThumbLength retrieves the length of the slider in a trackbar. Returns the length, in pixels, of the slider.

func (*TrackBar) GetThumbRect

func (tb *TrackBar) GetThumbRect() win.RECT

GetThumbRect retrieves the size and position of the bounding rectangle for the slider in a trackbar.

func (*TrackBar) GetTic

func (tb *TrackBar) GetTic(idx int) int

GetTic retrieves the logical position of a tick mark in a trackbar. The logical position can be any of the integer values in the trackbar's range of minimum to maximum slider positions. idx is a zero-based index identifying a tick mark. Valid indexes are in the range from zero to two less than the tick count returned by the TBM_GETNUMTICS message. Returns the logical position of the specified tick mark, or -1 if wParam does not specify a valid index.

func (*TrackBar) GetTicPos

func (tb *TrackBar) GetTicPos(idx int) int
	GetTicPos retrieves the current physical position of a tick mark in a trackbar.
	idx is a zero-based index identifying a tick mark. The positions of the first and last tick marks are not
	directly available via this message.

	Returns the distance, in client coordinates, from the left or top of the trackbar's client area to
	the specified tick mark. The return value is the x-coordinate of the tick mark for a horizontal trackbar or
	the y-coordinate for a vertical trackbar. If wParam is not a valid index, the return value is -1.

	Remarks
	Because the first and last tick marks are not available through this message, valid indexes are offset from
	their tick position on the trackbar. If the difference between TBM_GETRANGEMIN and TBM_GETRANGEMAX is less than two,
	then there is no valid index and this message will fail.

	The following illustrates the relation between the ticks on a trackbar, the ticks available through this message,
	and their zero-based indexes.

	0 1 2 3 4 5 6 7 8 9    // Tick positions seen on the trackbar.
   1 2 3 4 5 6 7 8      // Tick positions whose position can be identified.
   0 1 2 3 4 5 6 7      // Index numbers for the identifiable positions.

func (*TrackBar) GetTooltips

func (tb *TrackBar) GetTooltips() win.HWND

GetTooltips retrieves the handle to the tooltip control assigned to the trackbar, if any. Returns the handle to the tooltip control assigned to the trackbar, or NULL if tooltips are not in use. If the trackbar control does not use the TBS_TOOLTIPS style, the return value is NULL.

func (*TrackBar) SetBuddy

func (tb *TrackBar) SetBuddy(isLeftOrTop bool, hWnd win.HWND) win.HWND

SetBuddy assigns a window as the buddy window for a trackbar control. Trackbar buddy windows are automatically displayed in a location relative to the control's orientation (horizontal or vertical). isLeftOrTop indicating which buddy window handle will be retrieved, by relative location. This value can be one of the following: - TRUE - Retrieves the handle to the buddy to the left of the trackbar. If the trackbar control uses the TBS_VERT style, the message will retrieve the buddy above the trackbar. - FALSE - Retrieves the handle to the buddy to the right of the trackbar. If the trackbar control uses the TBS_VERT style, the message will retrieve the buddy below the trackbar.

hWnd is a Handle to the window that will be set as the trackbar control's buddy. Returns the handle to the window that was previously assigned to the control at that location.

func (*TrackBar) SetLineSize

func (tb *TrackBar) SetLineSize(size int) int

SetLineSize sets the number of logical positions the trackbar's slider moves in response to keyboard input from the arrow keys, such as the or keys. The logical positions are the integer increments in the trackbar's range of minimum to maximum slider positions. size is new line size. Returns a 32-bit value that specifies the previous line size.

Remarks The default setting for the line size is 1.

The trackbar also sends a WM_HSCROLL or WM_VSCROLL message with the TB_LINEUP and TB_LINEDOWN notification codes to its parent window when the user presses the arrow keys.

func (*TrackBar) SetPageSize

func (tb *TrackBar) SetPageSize(newSize int) int

SetPageSize sets the number of logical positions the trackbar's slider moves in response to keyboard input, such as the or keys, or mouse input, such as clicks in the trackbar's channel. The logical positions are the integer increments in the trackbar's range of minimum to maximum slider positions. Returns a 32-bit value that specifies the previous page size.

Remarks The trackbar also sends a WM_HSCROLL or WM_VSCROLL message with the TB_PAGEUP and TB_PAGEDOWN notification codes to its parent window when it receives keyboard or mouse input that scrolls the page.

func (*TrackBar) SetPos

func (tb *TrackBar) SetPos(redraw bool, newPos int)

SetPos sets the current logical position of the slider in a trackbar.

newPose is new logical position of the slider. Valid logical positions are the integer values in the trackbar's range of minimum to maximum slider positions. If this value is outside the control's maximum and minimum range, the position is set to the maximum or minimum value.

func (*TrackBar) SetPosNotify

func (tb *TrackBar) SetPosNotify(newPos int)

SetPosNotify sets the current logical position of the slider in a trackbar. newPost New logical position of the slider. Valid logical positions are the integer values in the trackbar's range of minimum to maximum slider positions. If this value is outside the control's maximum and minimum range, the position is set to the maximum or minimum value.

Remarks Calling TBM_SETPOSNOTIFY will set the trackbar slider location like TBM_SETPOS would, but it will also cause the trackbar to notify its parent of a move via a WM_HSCROLL or WM_VSCROLL message.

func (*TrackBar) SetRange

func (tb *TrackBar) SetRange(redraw bool, min, max uint16)

SetRange sets the range of minimum and maximum logical positions for the slider in a trackbar.

Remarks If the current slider position is outside the new range, the TBM_SETRANGE message sets the slider position to the new maximum or minimum value.

Because this message takes two 16-bit unsigned integer values, the maximum range that this message can specify is from 0 to 65,535. To specify larger range values, use the TBM_SETRANGEMIN and TBM_SETRANGEMAX messages.

func (*TrackBar) SetRangeMax

func (tb *TrackBar) SetRangeMax(redraw bool, max int)

SetRangeMax Sets the maximum logical position for the slider in a trackbar. max Maximum position for the slider.

Remarks If the current slider position is greater than the new maximum, the TBM_SETRANGEMAX message sets the slider position to the new maximum value.

func (*TrackBar) SetRangeMin

func (tb *TrackBar) SetRangeMin(redraw bool, min int)

SetRangeMin Sets the minimum logical position for the slider in a trackbar. min Minimum position for the slider.

Remarks If the current slider position is less than the new minimum, the TBM_SETRANGEMIN message sets the slider position to the new minimum value.

func (*TrackBar) SetSel

func (tb *TrackBar) SetSel(redraw bool, start, end uint16)

SetSel Sets the starting and ending positions for the available selection range in a trackbar.

func (*TrackBar) SetSelEnd

func (tb *TrackBar) SetSelEnd(redraw bool, end int)

SetSelEnd Sets the ending logical position of the current selection range in a trackbar. This message is ignored if the trackbar does not have the TBS_ENABLESELRANGE style. end Ending logical position of the selection range.

func (*TrackBar) SetSelStart

func (tb *TrackBar) SetSelStart(redraw bool, start int)

SetSelStart Sets the starting logical position of the current selection range in a trackbar. This message is ignored if the trackbar does not have the TBS_ENABLESELRANGE style. start Starting position of the selection range.

func (*TrackBar) SetThumbLength

func (tb *TrackBar) SetThumbLength(length int)

SetThumbLength sets the length of the slider in a trackbar. This message is ignored if the trackbar does not have the TBS_FIXEDLENGTH style.\ length, in pixels, of the slider.

func (*TrackBar) SetTic

func (tb *TrackBar) SetTic(position int) bool

SetTic sets a tick mark in a trackbar at the specified logical position. position is position of the tick mark. This parameter can be any of the integer values in the trackbar's range of minimum to maximum slider positions. Returns TRUE if the tick mark is set, or FALSE otherwise.

func (*TrackBar) SetTicFreq

func (tb *TrackBar) SetTicFreq(frequency int)

SetTicFreq Sets the interval frequency for tick marks in a trackbar. For example, if the frequency is set to two, a tick mark is displayed for every other increment in the trackbar's range. The default setting for the frequency is one; that is, every increment in the range is associated with a tick mark. frequency is frequency of the tick marks. Remarks The trackbar must have the TBS_AUTOTICKS style to use this message.

func (*TrackBar) SetTipSide

func (tb *TrackBar) SetTipSide(flag int) int

SetTipSide positions a tooltip control used by a trackbar control. Trackbar controls that use the TBS_TOOLTIPS style display tooltips. flag representing the location at which to display the tooltip control. This value can be one of the following: TBTS_TOP The tooltip control will be positioned above the trackbar. This flag is for use with horizontal trackbars. TBTS_LEFT The tooltip control will be positioned to the left of the trackbar. This flag is for use with vertical trackbars. TBTS_BOTTOM The tooltip control will be positioned below the trackbar. This flag is for use with horizontal trackbars. TBTS_RIGHT The tooltip control will be positioned to the right of the trackbar. This flag is for use with vertical trackbars.

Returns a value that represents the tooltip control's previous location. The return value equals one of the possible values for flag.

func (*TrackBar) SetTooltips

func (tb *TrackBar) SetTooltips(hWnd win.HWND)

SetTooltips assigns a tooltip control to a trackbar control. hWnd is a handle to an existing tooltip control. Remarks When a trackbar control is created with the TBS_TOOLTIPS style, it creates a default tooltip control that appears next to the slider, displaying the slider's current position.

func (*TrackBar) SetUnicodeFormat

func (tb *TrackBar) SetUnicodeFormat(unicode int) int
SetUnicodeFormat sets the Unicode character format flag for the control.
This message allows you to change the character set used by the control
at run time rather than having to re-create the control.

unicode Determines the character set that is used by the control. If this value is nonzero, the control will use Unicode characters. If this value is zero, the control will use ANSI characters. Return value Returns the previous Unicode format flag for the control.

func (*TrackBar) WndProc

func (tb *TrackBar) WndProc(msg uint32, wParam, lParam uintptr) uintptr

WndProc TrackBar window WndProc.

type Widget

type Widget interface {
	WndProc(msg uint32, wParam, lParam uintptr) uintptr
	AsWindowBase() *WindowBase
}

Widget inspect dialog item.

type WindowBase

type WindowBase struct {

	// Subclassing indicate that this window need Subclass,
	// make sure set this flag before bind to Dialog.
	Subclassing bool
	// contains filtered or unexported fields
}

WindowBase is an interface that provides operations common to all windows. if need subclass window ,must set Subclassing to true. hwnd,if custom window could set by Init. idd Reource Id. if custom window could set zero by Init

func (*WindowBase) AsWindowBase

func (w *WindowBase) AsWindowBase() *WindowBase

AsWindowBase return a *WindowBase.

func (*WindowBase) BoundsPixels

func (w *WindowBase) BoundsPixels() Rectangle

BoundsPixels returns the outer bounding box Rectangle of the *WindowBase, including decorations. The coordinates are relative to the screen.

func (*WindowBase) Close

func (w *WindowBase) Close()

Close close window.

func (*WindowBase) GetWindowRect

func (w *WindowBase) GetWindowRect() win.RECT

GetWindowRect get window rect

func (*WindowBase) GetWindowText

func (w *WindowBase) GetWindowText() string

GetWindowText get text.

func (*WindowBase) Handle

func (w *WindowBase) Handle() win.HWND

Handle get hwnd.

func (*WindowBase) Hide

func (w *WindowBase) Hide()

Hide set window hide.

func (*WindowBase) Init

func (w *WindowBase) Init(hwnd win.HWND, idd uintptr)

Init could init new WindowBase by youself .

func (*WindowBase) IsEnabled

func (w *WindowBase) IsEnabled() bool

IsEnabled check windows is enabled.

func (*WindowBase) IsVisible

func (w *WindowBase) IsVisible() bool

IsVisible check window is visible.

func (*WindowBase) SendMessage

func (w *WindowBase) SendMessage(msg uint32, wParam, lParam uintptr) uintptr

SendMessage sends a message to the window and returns the result.

func (*WindowBase) SetBounds

func (w *WindowBase) SetBounds(value Rectangle)

SetBounds set window rect.

func (*WindowBase) SetDisabled

func (w *WindowBase) SetDisabled(disable bool)

SetDisabled reverse of SetEnabled

func (*WindowBase) SetEnabled

func (w *WindowBase) SetEnabled(b bool)

SetEnabled set window enable status.

func (*WindowBase) SetFocus

func (w *WindowBase) SetFocus()

SetFocus set focus.

func (*WindowBase) SetIcon

func (w *WindowBase) SetIcon(iconType int, icon uintptr, loadIcon bool)

SetIcon set window icon. IconType: 1 - ICON_BIG; 0 - ICON_SMALL Icon: Resource Id or Icon Handle LoadIcon: If Icon is ResourceId then invoke LoadIcon

func (*WindowBase) SetText

func (w *WindowBase) SetText(str string)

SetText alias to SetWindowText

func (*WindowBase) SetVisible

func (w *WindowBase) SetVisible(value bool)

SetVisible set window visible status.

func (*WindowBase) SetWindowText

func (w *WindowBase) SetWindowText(title string)

SetWindowText set text

func (*WindowBase) Show

func (w *WindowBase) Show()

Show set window show.

func (*WindowBase) ShowFullScreen

func (w *WindowBase) ShowFullScreen()

ShowFullScreen ShowFullScreen

func (*WindowBase) ShowMaximized

func (w *WindowBase) ShowMaximized()

ShowMaximized show maximized btn.

func (*WindowBase) ShowMinimized

func (w *WindowBase) ShowMinimized()

ShowMinimized show minimized btn.

func (*WindowBase) ShowNormal

func (w *WindowBase) ShowNormal()

ShowNormal ShowNormal

func (*WindowBase) Text

func (w *WindowBase) Text() string

Text alias to GetWindowText

func (*WindowBase) WndProc

func (w *WindowBase) WndProc(msg uint32, wParam, lParam uintptr) uintptr

WndProc process window message.

Directories

Path Synopsis
examples
tools
genids
Parse resource.h define ids to Golang const
Parse resource.h define ids to Golang const

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL