forms

package
v0.0.0-...-ef40660 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Data_ContextMenu = "__ContextMenu"
	Data_Font        = "__Font"
	Data_FontHandle  = "__FontHandle"
	Data_Disposables = "__Disposables"
	Data_ModalResult = "__ModalResult"

	Data_BackColor      = "__BackColor"
	Data_BackColorBrush = "__BackColorBrush"

	Data_Collapsed = "__Collapsed"
)
View Source
const (
	MenuGenIdStart    = -10000
	AccelGenIdStart   = -20000
	ToolbarGenIdStart = -30000
)
View Source
const CONTROL_TIMER_TRACK_LEAVE = 101
View Source
const DefaultSplitterWidth = 4
View Source
const ID_SEPARATOR = 65534
View Source
const LazyNodeId int = math.MinInt32 + 'L' + 'A' + 'Z' + 'Y'
View Source
const NegativeOne = consts.NegativeOne
View Source
const NegativeOne32 = consts.NegativeOne32
View Source
const NullColor win32.COLORREF = math.MaxUint32 - 2
View Source
const TransparentColor win32.COLORREF = math.MaxUint32 - 1
View Source
const WM_APP_DISPATCH = win32.WM_APP + 88
View Source
const WM_CHILD_KILLFOCUS = win32.WM_APP + 101
View Source
const WM_CHILD_SETFOCUS = win32.WM_APP + 100
View Source
const WM_REFLECT_COMMAND = win32.WM_APP + 64
View Source
const WM_REFLECT_DRAWITEM = win32.WM_APP + 67
View Source
const WM_REFLECT_MEASUREITEM = win32.WM_APP + 66
View Source
const WM_REFLECT_NOTIFY = win32.WM_APP + 65

Variables

View Source
var CancelError error = errors.New("Canceled")
View Source
var Dispatcher = newDispatcherImpl()

Dispatcher is used to dispatch actions to be executed on the UI thread

View Source
var Dpi int32 = 96
View Source
var DpiAware bool
View Source
var HInstance win32.HINSTANCE

HInstance is the handle to the current instance of the application.

View Source
var ImagesFilter = FileTypeFilter{
	Name:    "Image files(*.gif;*.jpg;*.jpeg;*.bmp;*.png)",
	Pattern: "*.gif;*.jpg;*.jpeg;*.bmp;*.png"}
View Source
var ImagesFilters = []FileTypeFilter{ImagesFilter}
View Source
var LazyIdTextNode = IdTextNode{Id: LazyNodeId}
View Source
var LazyIdTextNodes = []IdTextNode{LazyIdTextNode}
View Source
var MsgPreprocessors msgPreprocessorsImpl

MsgPreprocessors is a global registry to add or remove MsgPreprocessor implementations

Functions

func Alert

func Alert(text string)

func Confirm

func Confirm(text string) bool

func ConfirmYesNoCancel

func ConfirmYesNoCancel(text string) win32.MESSAGEBOX_RESULT

func ContainsWindow

func ContainsWindow(hWndAncestor win32.HWND, hWndTest win32.HWND) bool

func DeflateRect

func DeflateRect(rect *win32.RECT, x int32, y int32)

func DoEvents

func DoEvents()

DoEvents processes all Windows messages currently in the message queue.

func DpiScale

func DpiScale(value int) int

func DpiUnscale

func DpiUnscale(value int) int

func FillSolidRect

func FillSolidRect(hdc win32.HDC, lpRect *win32.RECT, clr win32.COLORREF)

func GetComboBoxMetrics

func GetComboBoxMetrics(hWndParent HWND) *comboBoxMetrics

func GetDefaultFont

func GetDefaultFont() win32.HFONT

func GetMessageClientPos

func GetMessageClientPos(hWnd win32.HWND) win32.POINT

func GetMessagePos

func GetMessagePos() win32.POINT

func GetWindowText

func GetWindowText(hwnd HWND) (string, win32.WIN32_ERROR)

func HandleTabFocus

func HandleTabFocus(hWnd HWND)

func INDEXTOSTATEIMAGEMASK

func INDEXTOSTATEIMAGEMASK(index int) win32.TREE_VIEW_ITEM_STATE_FLAGS

func Info

func Info(text string)

func IsChildWindow

func IsChildWindow(hWnd win32.HWND) bool

func IsFocusable

func IsFocusable(hWnd HWND) bool

func IsRectEmpty

func IsRectEmpty(rect *win32.RECT) bool

func LoadIcon

func LoadIcon(filePath string, big bool) win32.HICON

??

func LoadIconFromImageData

func LoadIconFromImageData(data []byte) win32.HICON

func MeasureDcText

func MeasureDcText(hdc win32.HDC, text string) (int, int)

func MeasureDcText2

func MeasureDcText2(hdc win32.HDC, text string, text2 string) (int, int)

func MeasureText

func MeasureText(hWnd HWND, text string) (int, int)

func MeasureText2

func MeasureText2(hWnd HWND, text string, text2 string) (int, int)

func MessageBox

func MessageBox(text string, title string)

func MessageBoxEx

func MessageBoxEx(hWnd HWND, text, caption string,
	uType win32.MESSAGEBOX_STYLE) (win32.MESSAGEBOX_RESULT, win32.WIN32_ERROR)

func MessageLoop

func MessageLoop()

MessageLoop is the function that's typically called at the end of the main function to pump windows messages to their desired target and bring the UI to life.

func MustRegisterClass

func MustRegisterClass(className string, wndProc WndProcFunc, options ClassOptions)

func NewScope

func NewScope() *scope.Scope

func ParseMouseMsgParams

func ParseMouseMsgParams(wParam WPARAM, lParam LPARAM) (int32, int32, byte)

func PtInRect

func PtInRect(rect *win32.RECT, pt win32.POINT) bool

func RegisterClass

func RegisterClass(className string, wndProc WndProcFunc, options ClassOptions) (win32.ATOM, error)

func RequestGC

func RequestGC()

func STATEIMAGEMASKTOINDEX

func STATEIMAGEMASKTOINDEX(state uint32) int

func SetDpiAware

func SetDpiAware()

func SetWindowText

func SetWindowText(hWnd HWND, text string) (bool, win32.WIN32_ERROR)

func StrToWsz

func StrToWsz(str string) []uint16

func ToSysColorBrush

func ToSysColorBrush(color byte) win32.HBRUSH

func Warn

func Warn(text string)

func WithScope

func WithScope(scopedFunc scope.ScopedFunc)

func WndProc

func WndProc(hWnd HWND, uMsg uint32,
	wParam WPARAM, lParam LPARAM) win32.LRESULT

WndProc is the default window procedure function in GoForms

Types

type Accelerator

type Accelerator struct {
	CmdId uint16

	Ctrl  bool
	Alt   bool
	Shift bool
	Key   byte

	Command *Command
	Action  Action
}

type AcceleratorTable

type AcceleratorTable struct {
	Handle win32.HACCEL
	Items  []*Accelerator

	OnHandleChange SimpleEvent
	// contains filtered or unexported fields
}

func NewAcceleratorTable

func NewAcceleratorTable() *AcceleratorTable

func (*AcceleratorTable) AddItemsFromCommand

func (this *AcceleratorTable) AddItemsFromCommand(commands []*Command)

func (*AcceleratorTable) AddTabPageKeys

func (this *AcceleratorTable) AddTabPageKeys(tabCtrl TabControl)

func (*AcceleratorTable) ClearItems

func (this *AcceleratorTable) ClearItems()

func (*AcceleratorTable) Create

func (this *AcceleratorTable) Create() error

func (*AcceleratorTable) Dispose

func (this *AcceleratorTable) Dispose()

func (*AcceleratorTable) FindByCommand

func (this *AcceleratorTable) FindByCommand(command *Command) *Accelerator

func (*AcceleratorTable) FindById

func (this *AcceleratorTable) FindById(id uint16) *Accelerator

func (*AcceleratorTable) ReCreate

func (this *AcceleratorTable) ReCreate() error

type Action

type Action func()

func ChainActions

func ChainActions(actions ...Action) Action

type ActionAware

type ActionAware interface {
	SetAction(action Action)
	GetAction() Action
}

type ActionAwareSupport

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

func (*ActionAwareSupport) GetAction

func (this *ActionAwareSupport) GetAction() Action

func (*ActionAwareSupport) SetAction

func (this *ActionAwareSupport) SetAction(action Action)

type BackColorAware

type BackColorAware interface {
	SetBackColor(color drawing.Color)
	GetBackColor() drawing.Color
}

type BoundsAware

type BoundsAware = types.BoundsAware

type Button

type Button interface {
	Control // the parent interface

	ActionAware    // action aware
	CommandAware   // command aware
	TextAware      // text aware
	ForeColorAware // forecolor aware

	SetDefault()              //sets the button as the default button
	SetIcon(icon win32.HICON) // sets the icon for the button
	Click()                   // simulates a button click

	ButtonObj() *ButtonObject // returns the underlying ButtonObject
}

Button is an interface that represents a button control. It extends the Control interfaces.

type ButtonInterface

type ButtonInterface interface {
	Button
	ButtonSpi
}

ButtonInterface is a composition of Button and ButtonSpi

type ButtonObject

type ButtonObject struct {

	// ControlObject is the parent struct.
	ControlObject

	// ActionAwareSupport is the ActionAware implementation
	ActionAwareSupport

	// ForeColorAwareSupport is the ForeColorAware implementation
	ForeColorAwareSupport
	// contains filtered or unexported fields
}

ButtonObject implements the ButtonInterface It extends ControlObject.

func NewButtonObject

func NewButtonObject() *ButtonObject

NewButtonObject creates a new ButtonObject.

func (*ButtonObject) ButtonObj

func (this *ButtonObject) ButtonObj() *ButtonObject

ButtonObj implements Button.ButtonObj

func (*ButtonObject) Click

func (this *ButtonObject) Click()

Click implements Button.Click

func (*ButtonObject) GetCommand

func (this *ButtonObject) GetCommand() *Command

GetCommand implements Button.GetCommand

func (*ButtonObject) GetPreferredSize

func (this *ButtonObject) GetPreferredSize(int, int) (cx, cy int)

GetPreferredSize implements Window.GetPreferredSize

func (*ButtonObject) GetText

func (this *ButtonObject) GetText() string

GetText implements Button.GetText

func (*ButtonObject) GetWindowClass

func (this *ButtonObject) GetWindowClass() string

GetWindowClass implements WindowSpi.GetWindowClass

func (*ButtonObject) Init

func (this *ButtonObject) Init()

Init implements Window.Init

func (*ButtonObject) OnClick

func (this *ButtonObject) OnClick()

OnClick implements ButtonSpi.OnClick

func (*ButtonObject) OnReflectCommand

func (this *ButtonObject) OnReflectCommand(msg *CommandMessage)

OnReflectCommand implements WindowSpi.OnReflectCommand

func (*ButtonObject) OnReflectMessage

func (this *ButtonObject) OnReflectMessage(msg *Message)

OnReflectMessage implements WindowSpi.OnReflectMessage

func (*ButtonObject) OnReflectNotify

func (this *ButtonObject) OnReflectNotify(info *NotifyMessage)

OnReflectNotify implements WindowSpi.OnReflectNotify

func (*ButtonObject) SetCommand

func (this *ButtonObject) SetCommand(command *Command)

SetCommand implements Button.SetCommand

func (*ButtonObject) SetDefault

func (this *ButtonObject) SetDefault()

SetDefault implements Button.SetDefault

func (*ButtonObject) SetIcon

func (this *ButtonObject) SetIcon(icon win32.HICON)

SetIcon implements Button.SetIcon

func (*ButtonObject) SetText

func (this *ButtonObject) SetText(text string)

SetText implements Button.SetText

type ButtonSpi

type ButtonSpi interface {
	ControlSpi
	OnClick() // todo:
}

ButtonSpi is an interface that provides additional methods specific to implementing a ButtonS.

type CharMessage

type CharMessage Message

func (*CharMessage) GetChar

func (this *CharMessage) GetChar() int

type CheckBox

type CheckBox interface {
	Control
	Input
	TextAware

	GetChecked() bool
	SetChecked(checked bool)

	CheckBoxObj() *CheckBoxObject
}

type CheckBoxInterface

type CheckBoxInterface interface {
	CheckBox
	CheckBoxSpi
}

type CheckBoxObject

type CheckBoxObject struct {
	ControlObject

	ForeColorAwareSupport
	AutoCheck bool

	OnValueChange SimpleEvent
	// contains filtered or unexported fields
}

func NewCheckBoxObject

func NewCheckBoxObject() *CheckBoxObject

func (*CheckBoxObject) CheckBoxObj

func (this *CheckBoxObject) CheckBoxObj() *CheckBoxObject

func (*CheckBoxObject) GetChecked

func (this *CheckBoxObject) GetChecked() bool

func (*CheckBoxObject) GetControlSpecStyle

func (this *CheckBoxObject) GetControlSpecStyle() (include WINDOW_STYLE, exclude WINDOW_STYLE)

func (*CheckBoxObject) GetOnValueChange

func (this *CheckBoxObject) GetOnValueChange() *SimpleEvent

func (*CheckBoxObject) GetPreferredSize

func (this *CheckBoxObject) GetPreferredSize(int, int) (cx, cy int)

func (*CheckBoxObject) GetText

func (this *CheckBoxObject) GetText() string

func (*CheckBoxObject) GetValue

func (this *CheckBoxObject) GetValue() any

func (*CheckBoxObject) GetWindowClass

func (this *CheckBoxObject) GetWindowClass() string

func (*CheckBoxObject) Init

func (this *CheckBoxObject) Init()

func (*CheckBoxObject) OnReflectCommand

func (this *CheckBoxObject) OnReflectCommand(msg *CommandMessage)

func (*CheckBoxObject) SetChecked

func (this *CheckBoxObject) SetChecked(checked bool)

func (*CheckBoxObject) SetText

func (this *CheckBoxObject) SetText(text string)

func (*CheckBoxObject) SetValue

func (this *CheckBoxObject) SetValue(value any)

type CheckBoxSpi

type CheckBoxSpi interface {
	ControlSpi
}

type ClassOptions

type ClassOptions struct {
	Style           win32.WNDCLASS_STYLES
	BackgroundBrush win32.HBRUSH
	CursorResId     int
}

type ColorDialog

type ColorDialog struct {
	CustomColors [16]win32.COLORREF
	ResultColor  win32.COLORREF
}

func NewColorDialog

func NewColorDialog() *ColorDialog

func (*ColorDialog) Show

func (this *ColorDialog) Show(hWndOwner win32.HWND) bool

type ComboBox

type ComboBox interface {
	Control
	Input

	TextAware

	ClearItems()

	AddItem(item types.ValueText)
	AddItems(items []types.ValueText)

	AddStringItem(item string)
	AddStringItems(items []string)

	GetItemCount() int
	GetItem(index int) *types.ValueText

	GetSelectedItem() *types.ValueText

	GetSelectedIndex() int
	SetSelectedIndex(index int)

	ComboBoxObj() *ComboBoxObject
}

type ComboBoxInterface

type ComboBoxInterface interface {
	ComboBox
	ComboBoxSpi
}

type ComboBoxObject

type ComboBoxObject struct {
	ControlObject

	ForeColorAwareSupport

	Editable bool
	Height   int

	OnValueChange SimpleEvent
	// contains filtered or unexported fields
}

func NewComboBoxObject

func NewComboBoxObject() *ComboBoxObject

func (*ComboBoxObject) AddItem

func (this *ComboBoxObject) AddItem(item types.ValueText)

func (*ComboBoxObject) AddItems

func (this *ComboBoxObject) AddItems(items []types.ValueText)

func (*ComboBoxObject) AddStringItem

func (this *ComboBoxObject) AddStringItem(item string)

func (*ComboBoxObject) AddStringItems

func (this *ComboBoxObject) AddStringItems(items []string)

func (*ComboBoxObject) ClearItems

func (this *ComboBoxObject) ClearItems()

func (*ComboBoxObject) ComboBoxObj

func (this *ComboBoxObject) ComboBoxObj() *ComboBoxObject

func (*ComboBoxObject) GetControlSpecStyle

func (this *ComboBoxObject) GetControlSpecStyle() (WINDOW_STYLE, WINDOW_STYLE)

func (*ComboBoxObject) GetItem

func (this *ComboBoxObject) GetItem(index int) *types.ValueText

func (*ComboBoxObject) GetItemCount

func (this *ComboBoxObject) GetItemCount() int

func (*ComboBoxObject) GetOnValueChange

func (this *ComboBoxObject) GetOnValueChange() *SimpleEvent

func (*ComboBoxObject) GetPreferredSize

func (this *ComboBoxObject) GetPreferredSize(int, int) (int, int)

func (*ComboBoxObject) GetSelectedIndex

func (this *ComboBoxObject) GetSelectedIndex() int

func (*ComboBoxObject) GetSelectedItem

func (this *ComboBoxObject) GetSelectedItem() *types.ValueText

func (*ComboBoxObject) GetText

func (this *ComboBoxObject) GetText() string

func (*ComboBoxObject) GetValue

func (this *ComboBoxObject) GetValue() any

func (*ComboBoxObject) GetWindowClass

func (this *ComboBoxObject) GetWindowClass() string

func (*ComboBoxObject) OnReflectCommand

func (this *ComboBoxObject) OnReflectCommand(msg *CommandMessage)

func (*ComboBoxObject) SetPlaceholder

func (this *ComboBoxObject) SetPlaceholder(placeholder string)

func (*ComboBoxObject) SetSelectedIndex

func (this *ComboBoxObject) SetSelectedIndex(index int)

func (*ComboBoxObject) SetText

func (this *ComboBoxObject) SetText(text string)

func (*ComboBoxObject) SetValue

func (this *ComboBoxObject) SetValue(value any)

type ComboBoxSpi

type ComboBoxSpi interface {
	ControlSpi
}

type Command

type Command struct {
	Id       int
	Name     string
	Text     string //u
	Image    int    //u //default 0 means null. use zero to specify 0.
	Tooltip  string
	Desc     string
	Action   Action
	Category string

	Disabled   bool
	RadioGroup string
	Checked    bool //u

	ShortcutKeys []KeyStroke

	OnChange  SimpleEvent
	OnExecute SimpleEvent
}

func NewCommand

func NewCommand(text string, action Action) *Command

func (*Command) GetNoPrefixText

func (this *Command) GetNoPrefixText() string

func (*Command) NotifyChange

func (this *Command) NotifyChange()

func (*Command) NotifyExecute

func (this *Command) NotifyExecute()

func (*Command) SetState

func (this *Command) SetState(disabled bool, checked bool)

type CommandAware

type CommandAware interface {
	SetCommand(command *Command)
	GetCommand() *Command
}

type CommandManager

type CommandManager struct {
	Items []*Command
	// contains filtered or unexported fields
}

func NewCommandManager

func NewCommandManager() *CommandManager

func (*CommandManager) AddItems

func (this *CommandManager) AddItems(items []*Command)

func (*CommandManager) Init

func (this *CommandManager) Init()

func (*CommandManager) Item

func (this *CommandManager) Item(id int) *Command

func (*CommandManager) SetShortcuts

func (this *CommandManager) SetShortcuts(shortcuts map[int][]KeyStroke)

type CommandMessage

type CommandMessage Message

func (*CommandMessage) FromAccelerator

func (this *CommandMessage) FromAccelerator() bool

func (*CommandMessage) FromMenu

func (this *CommandMessage) FromMenu() bool

func (*CommandMessage) GetCmdId

func (this *CommandMessage) GetCmdId() uint16

func (*CommandMessage) GetHwndCtrl

func (this *CommandMessage) GetHwndCtrl() HWND

func (*CommandMessage) GetNotifyCode

func (this *CommandMessage) GetNotifyCode() uint16

type Container

type Container interface {
	CustomWindow // the parent interface

	// Add adds one or more controls to the container.
	Add(control ...Control)

	// Remove removes the specified control from the container.
	Remove(ctrl Control)

	// SetLayout sets the layout for the container.
	SetLayout(layout Layout)

	// GetLayout returns the current layout of the container.
	GetLayout() Layout

	// UpdateLayout updates the layout of the container.
	UpdateLayout()

	// GetChildWindows returns direct child windows.
	GetChildWindows() []Window

	// GetDescendantWindows returns all descendant windows.
	GetDescendantWindows() []Window

	// GetChildControls returns  the child controls of the container.
	GetChildControls() []Control

	// GetControlByName returns the control with the specified name.
	GetControlByName(name string) Control

	// GetControlById returns the control with the specified ID.
	GetControlById(id int) Control

	// GetRootContainer returns the root container of the hierarchy.
	GetRootContainer() Container

	// UseDialogFont sets the container to use the dialog font.
	UseDialogFont()
}

Container is an interface that represents a container window, which can hold other controls and manage their layout.

todo: scrollable?

var ContextContainer Container

ContextContainer is the default parent window for newly created controls if no explicit parent is specified.

type ContainerControl

type ContainerControl interface {
	Container
	Control
}

type ContainerControlObject

type ContainerControlObject struct {
	ContainerObject

	NameAwareSupport
}

func (*ContainerControlObject) CreateIn

func (this *ContainerControlObject) CreateIn(
	parent Window, extraOpts ...*WindowOptions) Control

func (*ContainerControlObject) GetContainer

func (this *ContainerControlObject) GetContainer() Container

func (*ContainerControlObject) GetControlId

func (this *ContainerControlObject) GetControlId() uint16

func (*ContainerControlObject) GetControlSpecStyle

func (this *ContainerControlObject) GetControlSpecStyle() (include, exclude WINDOW_STYLE)

func (*ContainerControlObject) GetDefaultExStyle

func (this *ContainerControlObject) GetDefaultExStyle() WINDOW_EX_STYLE

func (*ContainerControlObject) GetDefaultStyle

func (this *ContainerControlObject) GetDefaultStyle() WINDOW_STYLE

type ContainerInterface

type ContainerInterface interface {
	Container
	ContainerSpi
}

ContainerInterface is a composition of ContainerWindow and ContainerSpi

type ContainerObject

type ContainerObject struct {

	// CustomWindowObject is the parent struct.
	CustomWindowObject

	Layout Layout // The layout of the container.
	// contains filtered or unexported fields
}

ContainerObject implements the ContainerInterface It extends CustomWindowObject.

func (*ContainerObject) Add

func (this *ContainerObject) Add(controls ...Control)

Add implements Control.Add.

func (*ContainerObject) Dispose

func (this *ContainerObject) Dispose()

Dispose implements Window.Dispose.

func (*ContainerObject) EnsureClassRegistered

func (this *ContainerObject) EnsureClassRegistered()

EnsureClassRegistered implements WindowSpi.EnsureClassRegistered.

func (*ContainerObject) EnsureCustomWndProc

func (this *ContainerObject) EnsureCustomWndProc()

EnsureCustomWndProc implements WindowSpi.EnsureCustomWndProc.

func (*ContainerObject) GetChildControls

func (this *ContainerObject) GetChildControls() []Control

GetChildControls implements Container.GetChildControls

func (*ContainerObject) GetChildWindows

func (this *ContainerObject) GetChildWindows() []Window

GetChildWindows implements Container.GetChildWindows.

func (*ContainerObject) GetControlById

func (this *ContainerObject) GetControlById(id int) Control

GetControlById implements Container.GetControlById.

func (*ContainerObject) GetControlByName

func (this *ContainerObject) GetControlByName(name string) Control

GetControlByName implements Container.GetControlByName.

func (*ContainerObject) GetDescendantWindows

func (this *ContainerObject) GetDescendantWindows() []Window

GetDescendantWindows implements Container.GetDescendantWindows.

func (*ContainerObject) GetLayout

func (this *ContainerObject) GetLayout() Layout

GetLayout implements Container.GetLayout.

func (*ContainerObject) GetRootContainer

func (this *ContainerObject) GetRootContainer() Container

GetRootContainer implements Container.GetRootContainer.

func (*ContainerObject) GetWindowClass

func (this *ContainerObject) GetWindowClass() string

GetWindowClass implements WindowSpi.GetWindowClass.

func (*ContainerObject) Init

func (this *ContainerObject) Init()

Init implements Window.Init

func (*ContainerObject) OnCtlColorStatic

func (this *ContainerObject) OnCtlColorStatic(msg *Message)

OnCtlColorStatic implements CustomWindowSpi.OnCtlColorStatic.

func (*ContainerObject) PreCreate

func (this *ContainerObject) PreCreate(opts *WindowOptions)

PreCreate implements WindowSpi.PreCreate.

func (*ContainerObject) PreDispose

func (this *ContainerObject) PreDispose()

PreDispose implements WindowSpi.PreDispose.

func (*ContainerObject) Remove

func (this *ContainerObject) Remove(ctrl Control)

Remove implements Control.Remove.

func (*ContainerObject) SetBounds

func (this *ContainerObject) SetBounds(left, top, width, height int)

SetBounds implements Window.SetBounds.

func (*ContainerObject) SetLayout

func (this *ContainerObject) SetLayout(layout Layout)

SetLayout implements Container.SetLayout.

func (*ContainerObject) UpdateLayout

func (this *ContainerObject) UpdateLayout()

UpdateLayout implements Container.UpdateLayout.

func (*ContainerObject) UseDialogFont

func (this *ContainerObject) UseDialogFont()

UseDialogFont implements Container.UseDialogFont.

type ContainerSpi

type ContainerSpi interface {
	CustomWindowSpi
}

ContainerSpi is an interface that provides additional methods specific to implementing a Container.

type ContextContainerRestorer

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

ContextContainerRestorer is the holder of the original ContextContainer

func SetContextContainer

func SetContextContainer(container Container) ContextContainerRestorer

SetContextContainer sets the specified container as current ContextContainer and returns ContextContainerRestorer that can be used to Restore the old one.

func (ContextContainerRestorer) Restore

func (me ContextContainerRestorer) Restore()

Restore sets ContextContainer to the saved original one.

type ContextMenuAware

type ContextMenuAware interface {
	SetContextMenu(menu *PopupMenu)
	GetContextMenu() *PopupMenu
}

type ContextMenuMessage

type ContextMenuMessage Message

func (*ContextMenuMessage) GetClickedHwnd

func (this *ContextMenuMessage) GetClickedHwnd() HWND

func (*ContextMenuMessage) GetScreenPos

func (this *ContextMenuMessage) GetScreenPos() (int, int)

type Control

type Control interface {
	Window    //Control is a Window
	NameAware //Control is name aware

	// GetContainer returns the parent container of the control.
	GetContainer() Container

	// GetRootContainer returns the root container of the control.
	GetRootContainer() Container

	// CreateIn creates the control within a parent window.
	CreateIn(parent Window, extraOpts ...*WindowOptions) Control

	// GetControlSpecStyle returns the specific window styles for the control.
	GetControlSpecStyle() (include, exclude WINDOW_STYLE)

	// GetControlId returns the Win32 control identifier.
	GetControlId() uint16
}

Control is an interface that represents a graphical control window. It extends the Window and NameAware interfaces.

type ControlInterface

type ControlInterface interface {
	Control
	ControlSpi
}

ControlInterface is a composition of Control and ControlSpi

type ControlObject

type ControlObject struct {

	// WindowObject is the parent struct.
	WindowObject

	// NameAwareSupport is a NameAware implementation
	NameAwareSupport
	// contains filtered or unexported fields
}

ControlObject implements the ControlInterface It extends WindowObject.

func (*ControlObject) Create

func (this *ControlObject) Create(options WindowOptions) error

Create implements Window.Create.

func (*ControlObject) CreateIn

func (this *ControlObject) CreateIn(parent Window, extraOpts ...*WindowOptions) Control

CreateIn implements Control.CreateIn.

func (*ControlObject) GetContainer

func (this *ControlObject) GetContainer() Container

GetContainer implements Control.GetContainer.

func (*ControlObject) GetControlId

func (this *ControlObject) GetControlId() uint16

GetControlId implements Control.GetControlId.

func (*ControlObject) GetControlSpecStyle

func (this *ControlObject) GetControlSpecStyle() (include, exclude WINDOW_STYLE)

GetControlSpecStyle implements Control.GetControlSpecStyle.

func (*ControlObject) GetDefaultStyle

func (this *ControlObject) GetDefaultStyle() WINDOW_STYLE

GetDefaultStyle implements WindowSpi.GetDefaultStyle.

func (*ControlObject) GetRootContainer

func (this *ControlObject) GetRootContainer() Container

GetRootContainer implements Control.GetRootContainer.

func (*ControlObject) Init

func (this *ControlObject) Init()

Init implements Window.Init.

func (*ControlObject) PostCreate

func (this *ControlObject) PostCreate(opts *WindowOptions)

PostCreate implements WindowSpi.PostCreate.

func (*ControlObject) PreDispose

func (this *ControlObject) PreDispose()

PreDispose implements Window.PreDispose.

type ControlSpi

type ControlSpi interface {
	WindowSpi
}

ControlSpi is an interface that provides additional methods specific to implementing a Control.

type Cursor

type Cursor struct {
	Handle win32.HCURSOR
	// contains filtered or unexported fields
}

func NewCursorFromData

func NewCursorFromData(data []byte) (*Cursor, error)

func (*Cursor) Dispose

func (this *Cursor) Dispose()

type CustomControl

type CustomControl interface {
	Control
}

type CustomControlObject

type CustomControlObject struct {
	CustomWindowObject

	NameAwareSupport
	// contains filtered or unexported fields
}

func (*CustomControlObject) Create

func (this *CustomControlObject) Create(options WindowOptions) error

func (*CustomControlObject) CreateIn

func (this *CustomControlObject) CreateIn(parent Window, extraOpts ...*WindowOptions) Control

func (*CustomControlObject) EnsureClassRegistered

func (this *CustomControlObject) EnsureClassRegistered()

func (*CustomControlObject) EnsureCustomWndProc

func (this *CustomControlObject) EnsureCustomWndProc()

func (*CustomControlObject) GetBackgroundColor

func (this *CustomControlObject) GetBackgroundColor() win32.COLORREF

func (*CustomControlObject) GetContainer

func (this *CustomControlObject) GetContainer() Container

func (*CustomControlObject) GetControlId

func (this *CustomControlObject) GetControlId() uint16

func (*CustomControlObject) GetControlSpecStyle

func (this *CustomControlObject) GetControlSpecStyle() (include, exclude WINDOW_STYLE)

func (*CustomControlObject) GetDefaultStyle

func (this *CustomControlObject) GetDefaultStyle() WINDOW_STYLE

func (*CustomControlObject) GetRootContainer

func (this *CustomControlObject) GetRootContainer() Container

dup..

func (*CustomControlObject) GetWindowClass

func (this *CustomControlObject) GetWindowClass() string

func (*CustomControlObject) Init

func (this *CustomControlObject) Init()

func (*CustomControlObject) SetDluBounds

func (this *CustomControlObject) SetDluBounds(left, top, width, height int)

func (*CustomControlObject) WinProc

func (this *CustomControlObject) WinProc(win *WindowObject, m *Message) error

type CustomControlSpi

type CustomControlSpi interface {
}

type CustomWindow

type CustomWindow interface {
	Window // the parent interface

	IsMouseHovering() bool // checks if the mouse is inside the window's boundary
}

CustomWindow is an interface for custom windows. Custom windows are user defined, not system provided windows.

type CustomWindowInterface

type CustomWindowInterface interface {
	CustomWindow
	CustomWindowSpi
}

CustomWindowInterface is a composition of CustomWindow and CustomWindowSpi

type CustomWindowObject

type CustomWindowObject struct {

	// WindowObject is the parent struct.
	WindowObject
	// contains filtered or unexported fields
}

CustomWindowObject implements the CustomWindowInterface It extends WindowObject.

func (*CustomWindowObject) EnsureCustomWndProc

func (this *CustomWindowObject) EnsureCustomWndProc()

EnsureCustomWndProc implements WindowSpi.EnsureCustomWndProc

func (*CustomWindowObject) Init

func (this *CustomWindowObject) Init()

Init implements Window.Init

func (*CustomWindowObject) IsMouseHovering

func (this *CustomWindowObject) IsMouseHovering() bool

IsMouseHovering implements CustomWindow.IsMouseHovering

func (*CustomWindowObject) OnBubbleMessage

func (this *CustomWindowObject) OnBubbleMessage(msg *Message)

OnBubbleMessage implements CustomWindowSpi.OnBubbleMessage

func (*CustomWindowObject) OnCommand

func (this *CustomWindowObject) OnCommand(info *CommandMessage)

OnCommand implements CustomWindowSpi.OnCommand

func (*CustomWindowObject) OnContextMenu

func (this *CustomWindowObject) OnContextMenu(sourceWin Window, pt Point) bool

OnContextMenu implements CustomWindowSpi.OnContextMenu

func (*CustomWindowObject) OnCtlColorStatic

func (this *CustomWindowObject) OnCtlColorStatic(msg *Message)

OnCtlColorStatic implements CustomWindowSpi.OnCtlColorStatic

func (*CustomWindowObject) OnDestroy

func (this *CustomWindowObject) OnDestroy()

OnDestroy implements CustomWindowSpi.OnDestroy

func (*CustomWindowObject) OnEraseBkgnd

func (this *CustomWindowObject) OnEraseBkgnd(hdc win32.HDC) bool

OnEraseBkgnd implements CustomWindowSpi.OnEraseBkgnd

func (*CustomWindowObject) OnKeyDown

func (this *CustomWindowObject) OnKeyDown(args KeyEventArgs)

OnKeyDown implements CustomWindowSpi.OnKeyDown

func (*CustomWindowObject) OnKeyUp

func (this *CustomWindowObject) OnKeyUp(args KeyEventArgs)

OnKeyUp implements CustomWindowSpi.OnKeyUp

func (*CustomWindowObject) OnKillFocus

func (this *CustomWindowObject) OnKillFocus()

OnKillFocus implements CustomWindowSpi.OnKillFocus

func (*CustomWindowObject) OnMouseDown

func (this *CustomWindowObject) OnMouseDown(x int32, y int32, button byte)

OnMouseDown implements CustomWindowSpi.OnMouseDown

func (*CustomWindowObject) OnMouseEnter

func (this *CustomWindowObject) OnMouseEnter()

OnMouseEnter implements CustomWindowSpi.OnMouseEnter

func (*CustomWindowObject) OnMouseLeave

func (this *CustomWindowObject) OnMouseLeave()

OnMouseLeave implements CustomWindowSpi.OnMouseLeave

func (*CustomWindowObject) OnMouseMove

func (this *CustomWindowObject) OnMouseMove(x int32, y int32, button byte)

OnMouseMove implements CustomWindowSpi.OnMouseMove

func (*CustomWindowObject) OnMouseUp

func (this *CustomWindowObject) OnMouseUp(x int32, y int32, button byte)

OnMouseUp implements CustomWindowSpi.OnMouseUp

func (*CustomWindowObject) OnNotify

func (this *CustomWindowObject) OnNotify(msg *NotifyMessage)

OnNotify implements CustomWindowSpi.OnNotify

func (*CustomWindowObject) OnPaint

func (this *CustomWindowObject) OnPaint(hdc win32.HDC, clipRect *win32.RECT)

OnPaint implements CustomWindowSpi.OnPaint

func (*CustomWindowObject) OnSetFocus

func (this *CustomWindowObject) OnSetFocus()

OnSetFocus implements CustomWindowSpi.OnSetFocus

func (*CustomWindowObject) WinProc

func (this *CustomWindowObject) WinProc(winObj *WindowObject, m *Message) error

WinProc implements CustomWindowSpi.WinProc

type CustomWindowSpi

type CustomWindowSpi interface {
	WindowSpi       // the parent interface
	WinProcProvider // provides a custom WinProc

	OnCommand(msg *CommandMessage)                 // processes WM_COMMAND
	OnNotify(msg *NotifyMessage)                   // processes WM_NOTIFY
	OnContextMenu(sourceWin Window, pt Point) bool // processes WM_CONTEXT_MENU
	OnEraseBkgnd(hdc win32.HDC) bool               // processes WM_ERASEBKGND
	OnCtlColorStatic(msg *Message)                 // processes WM_CTLCOLORSTATIC
	OnDestroy()                                    // on WM_DESTROY

	OnSetFocus()  // on WM_SETFOCUS
	OnKillFocus() // on WM_KILLFOCUS

	OnMouseDown(x int32, y int32, button byte) // on WM_LBUTTONDOWN/WM_RBUTTONDOWN
	OnMouseUp(x int32, y int32, button byte)   // on WM_LBUTTONUP/WM_RBUTTONUP
	OnMouseMove(x int32, y int32, button byte) // on WM_MOUSEMOVE

	OnMouseEnter() // called when the mouse enters the window's boundary
	OnMouseLeave() // called when the mouse leaves the window's boundary

	OnKeyDown(args KeyEventArgs) // on WM_KEYDOWN
	OnKeyUp(args KeyEventArgs)   // on WM_KEYUP

	OnPaint(hdc win32.HDC, clipRect *win32.RECT) // on WM_PAINT

	// OnBubbleMessage processes reflection messages bubbled up from a child container.
	OnBubbleMessage(msg *Message)
}

CustomWindowSpi is an interface that provides additional methods specific to implementing a CustomWindow.

type DateTimePicker

type DateTimePicker interface {
	Control
	Input
}

type DateTimePickerObject

type DateTimePickerObject struct {
	ControlObject

	Nullable  bool
	Format    string
	TimeOnly  bool
	UseUpDown bool
	// contains filtered or unexported fields
}

func NewDateTimePickerObject

func NewDateTimePickerObject() *DateTimePickerObject

func (*DateTimePickerObject) Create

func (this *DateTimePickerObject) Create(options WindowOptions) error

func (*DateTimePickerObject) GetControlSpecStyle

func (this *DateTimePickerObject) GetControlSpecStyle() (WINDOW_STYLE, WINDOW_STYLE)

func (*DateTimePickerObject) GetOnValueChange

func (this *DateTimePickerObject) GetOnValueChange() *SimpleEvent

func (*DateTimePickerObject) GetPreferredSize

func (this *DateTimePickerObject) GetPreferredSize(cxMax int, cyMax int) (int, int)

func (*DateTimePickerObject) GetValue

func (this *DateTimePickerObject) GetValue() any

func (*DateTimePickerObject) GetWindowClass

func (this *DateTimePickerObject) GetWindowClass() string

func (*DateTimePickerObject) Init

func (this *DateTimePickerObject) Init()

func (*DateTimePickerObject) OnReflectNotify

func (this *DateTimePickerObject) OnReflectNotify(msg *NotifyMessage)

func (*DateTimePickerObject) SetValue

func (this *DateTimePickerObject) SetValue(value any)

type Dialog

type Dialog interface {
	Container
}

type DialogObject

type DialogObject struct {
	ContainerObject
}

func NewDialogObject

func NewDialogObject() *DialogObject

func (*DialogObject) Show

func (this *DialogObject) Show()

func (*DialogObject) ShowModal

func (this *DialogObject) ShowModal()

type Disposable

type Disposable = types.Disposable

type DpiPosAware

type DpiPosAware interface {
	SetDpiPos(x, y int)
	GetDpiPos() (x, y int)
}

type DpiSizeAware

type DpiSizeAware interface {
	SetDpiSize(cx, cy int)
	GetDpiSize() (cx, cy int)
}

type Edit

type Edit interface {
	Control
	Input
	TextAware

	SetPlaceholder(placeholder string)
	GetPlaceholder() string
	SetReadonly(readonly bool)
	SelectAll()
	SelectEnd()

	IsEmpty() bool

	EditObj() *EditObject
}

type EditInterface

type EditInterface interface {
	Edit
	EditSpi
}

type EditObject

type EditObject struct {
	ControlObject

	ForeColorAwareSupport
	OnValueChange SimpleEvent
	// contains filtered or unexported fields
}

func NewEditObject

func NewEditObject() *EditObject

func (*EditObject) Dispose

func (this *EditObject) Dispose()

func (*EditObject) EditObj

func (this *EditObject) EditObj() *EditObject

func (*EditObject) GetDefaultExStyle

func (this *EditObject) GetDefaultExStyle() WINDOW_EX_STYLE

func (*EditObject) GetOnValueChange

func (this *EditObject) GetOnValueChange() *SimpleEvent

func (*EditObject) GetPlaceholder

func (this *EditObject) GetPlaceholder() string

func (*EditObject) GetPreferredSize

func (this *EditObject) GetPreferredSize(int, int) (int, int)

func (*EditObject) GetText

func (this *EditObject) GetText() string

func (*EditObject) GetTextByteLength

func (this *EditObject) GetTextByteLength() int

func (*EditObject) GetTextLength

func (this *EditObject) GetTextLength() int

func (*EditObject) GetValue

func (this *EditObject) GetValue() any

func (*EditObject) GetWindowClass

func (this *EditObject) GetWindowClass() string

func (*EditObject) Init

func (this *EditObject) Init()

func (*EditObject) IsEmpty

func (this *EditObject) IsEmpty() bool

func (*EditObject) OnReflectCommand

func (this *EditObject) OnReflectCommand(info *CommandMessage)

func (*EditObject) OnReflectMessage

func (this *EditObject) OnReflectMessage(msg *Message)

func (*EditObject) SelectAll

func (this *EditObject) SelectAll()

func (*EditObject) SelectEnd

func (this *EditObject) SelectEnd()

func (*EditObject) SetPlaceholder

func (this *EditObject) SetPlaceholder(placeholder string)

func (*EditObject) SetReadonly

func (this *EditObject) SetReadonly(readonly bool)

func (*EditObject) SetText

func (this *EditObject) SetText(text string)

func (*EditObject) SetValue

func (this *EditObject) SetValue(value any)

type EditSpi

type EditSpi interface {
	ControlSpi
}

type EnabledAware

type EnabledAware interface {
	SetEnabled(enabled bool)
	GetEnabled() bool
}

type Event

type Event[T events.EventInfo] struct {
	events.Event[T]
}

type ExtraEvent

type ExtraEvent = events.ExtraEvent

type ExtraEventInfo

type ExtraEventInfo = events.ExtraEventInfo

type FileDialog

type FileDialog struct {
	Title              string
	Filters            []FileTypeFilter
	DefaultFilterIndex int //0 based
	DefaultFileName    string
	InitialDir         string
	ResultFileName     string
	// contains filtered or unexported fields
}

type FileTypeFilter

type FileTypeFilter struct {
	Name    string
	Pattern string
}

type FocusAware

type FocusAware interface {
	Focus()
	HasFocus() bool
}

type FontAware

type FontAware interface {
	SetFont(font *gdi.Font)
	GetFont() *gdi.Font
}

type ForeColorAware

type ForeColorAware interface {
	SetForeColor(color drawing.Color)
	GetForeColor() drawing.Color
}

type ForeColorAwareSupport

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

func (*ForeColorAwareSupport) GetForeColor

func (this *ForeColorAwareSupport) GetForeColor() drawing.Color

func (*ForeColorAwareSupport) SetForeColor

func (this *ForeColorAwareSupport) SetForeColor(color drawing.Color)

type Form

type Form interface {
	TopWindow // the parent interface

	AsFormObject() *FormObject // returns the underlying FormObject
}

Form is an interface that represents a form window, which are designed specifically for creating application windows.

type FormInterface

type FormInterface interface {
	Form
	FormSpi
}

FormInterface is a composition of Form and FormSpi

type FormObject

type FormObject struct {

	// TopWindowObject is the parent struct.
	TopWindowObject
	// contains filtered or unexported fields
}

FormObject implements the FormInterface It extends TopWindowObject.

func NewFormObject

func NewFormObject() *FormObject

func (*FormObject) AsFormObject

func (this *FormObject) AsFormObject() *FormObject

func (*FormObject) EnsureClassRegistered

func (this *FormObject) EnsureClassRegistered()

func (*FormObject) GetDefaultExStyle

func (this *FormObject) GetDefaultExStyle() WINDOW_EX_STYLE

func (*FormObject) GetDefaultStyle

func (this *FormObject) GetDefaultStyle() WINDOW_STYLE

func (*FormObject) GetWindowClass

func (this *FormObject) GetWindowClass() string

func (*FormObject) Init

func (this *FormObject) Init()

func (*FormObject) OnEraseBkgnd

func (this *FormObject) OnEraseBkgnd(hdc win32.HDC) bool

func (*FormObject) OnHandleCreated

func (this *FormObject) OnHandleCreated()

func (*FormObject) PreCreate

func (this *FormObject) PreCreate(opts *WindowOptions)

type FormSpi

type FormSpi interface {
	TopWindowSpi
}

FormSpi is an interface that provides additional methods specific to implementing a Form.

type GetToolTipTextFunc

type GetToolTipTextFunc func() string

func (GetToolTipTextFunc) GetTooltipText

func (me GetToolTipTextFunc) GetTooltipText() string

type GroupBox

type GroupBox interface {
	Control

	TextAware

	GroupBoxObj() *GroupBoxObject
}

type GroupBoxInterface

type GroupBoxInterface interface {
	GroupBox
	GroupBoxSpi
}

type GroupBoxObject

type GroupBoxObject struct {
	ControlObject

	Caption string

	Layout Layout
	// contains filtered or unexported fields
}

func NewGroupBoxObject

func NewGroupBoxObject() *GroupBoxObject

func (*GroupBoxObject) Create

func (this *GroupBoxObject) Create(options WindowOptions) error

func (*GroupBoxObject) GetPreferredSize

func (this *GroupBoxObject) GetPreferredSize(maxWidth int, maxHeight int) (cx, cy int)

func (*GroupBoxObject) GetText

func (this *GroupBoxObject) GetText() string

func (*GroupBoxObject) GetWindowClass

func (this *GroupBoxObject) GetWindowClass() string

func (*GroupBoxObject) GroupBoxObj

func (this *GroupBoxObject) GroupBoxObj() *GroupBoxObject

func (*GroupBoxObject) Init

func (this *GroupBoxObject) Init()

func (*GroupBoxObject) OnReflectMessage

func (this *GroupBoxObject) OnReflectMessage(msg *Message)

func (*GroupBoxObject) PreCreate

func (this *GroupBoxObject) PreCreate(opts *WindowOptions)

func (*GroupBoxObject) SetBounds

func (this *GroupBoxObject) SetBounds(left, top, width, height int)

func (*GroupBoxObject) SetText

func (this *GroupBoxObject) SetText(text string)

type GroupBoxSpi

type GroupBoxSpi interface {
	ControlSpi
}

type HWND

type HWND = win32.HWND
var HWndActive HWND

HWndActive is the handle of the last activated window

func CreateWindow

func CreateWindow(className string,
	options WindowOptions, lpParam unsafe.Pointer) (HWND, error)

func FindFirstFocusable

func FindFirstFocusable(hWndContainer HWND) HWND

func GetChildHandles

func GetChildHandles(hWndParent HWND) []HWND

func GetDescendantHandles

func GetDescendantHandles(hWndRoot HWND) []HWND

type HeaderControl

type HeaderControl interface {
	Control
}

type HeaderControlObject

type HeaderControlObject struct {
	ControlObject
	// contains filtered or unexported fields
}

func NewHeaderControlObject

func NewHeaderControlObject() *HeaderControlObject

func (*HeaderControlObject) AddItem

func (this *HeaderControlObject) AddItem(text string, width int)

func (*HeaderControlObject) AddItemAligned

func (this *HeaderControlObject) AddItemAligned(text string, width int, align int)

func (*HeaderControlObject) GetControlSpecStyle

func (this *HeaderControlObject) GetControlSpecStyle() (include, exclude WINDOW_STYLE)

func (*HeaderControlObject) GetItemCount

func (this *HeaderControlObject) GetItemCount() int

func (*HeaderControlObject) GetItemText

func (this *HeaderControlObject) GetItemText(index int) string

func (*HeaderControlObject) GetItemWidth

func (this *HeaderControlObject) GetItemWidth(index int) int

func (*HeaderControlObject) GetPreferredSize

func (this *HeaderControlObject) GetPreferredSize(cxMax int, cyMax int) (int, int)

func (*HeaderControlObject) GetWindowClass

func (this *HeaderControlObject) GetWindowClass() string

func (*HeaderControlObject) Init

func (this *HeaderControlObject) Init()

func (*HeaderControlObject) SetItemWidth

func (this *HeaderControlObject) SetItemWidth(index int, width int)

type IdTextNode

type IdTextNode struct {
	Id       int
	Text     string
	Children []IdTextNode
}

type ImageBox

type ImageBox interface {
	Control
	SetBitmap(hBitmap win32.HBITMAP)
	GetBitmap() win32.HBITMAP

	SetIcon(hIcon win32.HICON)
	GetIcon() win32.HICON

	ImageBoxObj() *ImageBoxObject
}

type ImageBoxInterface

type ImageBoxInterface interface {
	ImageBox
	ImageBoxSpi
}

type ImageBoxObject

type ImageBoxObject struct {
	ControlObject
	// contains filtered or unexported fields
}

func NewImageBoxObject

func NewImageBoxObject() *ImageBoxObject

func (*ImageBoxObject) GetBitmap

func (this *ImageBoxObject) GetBitmap() win32.HBITMAP

func (*ImageBoxObject) GetControlSpecStyle

func (this *ImageBoxObject) GetControlSpecStyle() (WINDOW_STYLE, WINDOW_STYLE)

func (*ImageBoxObject) GetIcon

func (this *ImageBoxObject) GetIcon() win32.HICON

func (*ImageBoxObject) GetPreferredSize

func (this *ImageBoxObject) GetPreferredSize(int, int) (cx, cy int)

func (*ImageBoxObject) GetText

func (this *ImageBoxObject) GetText() string

func (*ImageBoxObject) GetWindowClass

func (this *ImageBoxObject) GetWindowClass() string

func (*ImageBoxObject) ImageBoxObj

func (this *ImageBoxObject) ImageBoxObj() *ImageBoxObject

func (*ImageBoxObject) Init

func (this *ImageBoxObject) Init()

func (*ImageBoxObject) OnHandleCreated

func (this *ImageBoxObject) OnHandleCreated()

func (*ImageBoxObject) OnReflectMessage

func (this *ImageBoxObject) OnReflectMessage(msg *Message)

func (*ImageBoxObject) PreCreate

func (this *ImageBoxObject) PreCreate(opts *WindowOptions)

func (*ImageBoxObject) SetBitmap

func (this *ImageBoxObject) SetBitmap(hBitmap win32.HBITMAP)

func (*ImageBoxObject) SetIcon

func (this *ImageBoxObject) SetIcon(hIcon win32.HICON)

func (*ImageBoxObject) UpdateImage

func (this *ImageBoxObject) UpdateImage()

type ImageBoxSpi

type ImageBoxSpi interface {
	ControlSpi
}

type ImageList

type ImageList struct {
	Cx     int
	Cy     int
	Bpp    byte
	Masked bool
	// contains filtered or unexported fields
}

func CreateImageListFromIcons

func CreateImageListFromIcons(size int, hIcons ...win32.HICON) (*ImageList, error)

func CreateImageListFromImage

func CreateImageListFromImage(imageData []byte) (*ImageList, error)

func GetSysImageList

func GetSysImageList(small bool) *ImageList

func NewImageList

func NewImageList(size int, create bool) *ImageList

func NewImageListEx

func NewImageListEx(size int, bpp int, masked bool) *ImageList

func NewImageListFromHandle

func NewImageListFromHandle(hIml win32.HIMAGELIST, owned bool) *ImageList

func (*ImageList) Add

func (this *ImageList) Add(hBitmap win32.HBITMAP) (int, error)

func (*ImageList) AddIcon

func (this *ImageList) AddIcon(hIcon win32.HICON) (int, error)

func (*ImageList) AddImageData

func (this *ImageList) AddImageData(imageData []byte) (int, error)

func (*ImageList) AddImageDatas

func (this *ImageList) AddImageDatas(imageData ...[]byte) (int, error)

func (*ImageList) AddImageFile

func (this *ImageList) AddImageFile(filePath string) (int, error)

func (*ImageList) CopyUnowned

func (this *ImageList) CopyUnowned() *ImageList

func (*ImageList) Create

func (this *ImageList) Create() error

func (*ImageList) Detach

func (this *ImageList) Detach() win32.HIMAGELIST

func (*ImageList) Dispose

func (this *ImageList) Dispose()

func (*ImageList) Draw

func (this *ImageList) Draw(index int, hdc win32.HDC, x int32, y int32)

func (*ImageList) GetCount

func (this *ImageList) GetCount() int

func (*ImageList) GetHBitmap

func (this *ImageList) GetHBitmap(index int) win32.HBITMAP

func (*ImageList) GetHIcon

func (this *ImageList) GetHIcon(index int) win32.HICON

func (*ImageList) GetHandle

func (this *ImageList) GetHandle() win32.HIMAGELIST

func (*ImageList) Init

func (this *ImageList) Init()

func (*ImageList) Resize

func (this *ImageList) Resize(cx int) *ImageList

type Input

type Input interface {
	GetValue() any
	SetValue(any)
	Focus()
	GetOnValueChange() *SimpleEvent //todo:clearify only fire on user action?
}

type KeyEventArgs

type KeyEventArgs struct {
	Key   win32.VIRTUAL_KEY
	Ctrl  bool
	Alt   bool
	Shift bool
}

func NewKeyEventArgs

func NewKeyEventArgs(wParam WPARAM, lParam LPARAM) KeyEventArgs

type KeyMessage

type KeyMessage Message

func (*KeyMessage) GetKey

func (this *KeyMessage) GetKey() int

type KeyStroke

type KeyStroke struct {
	Ctrl  bool
	Alt   bool
	Shift bool
	Key   byte
}

func (KeyStroke) IsExtended

func (me KeyStroke) IsExtended() bool

func (KeyStroke) String

func (me KeyStroke) String() string

type LPARAM

type LPARAM = win32.LPARAM

type Label

type Label interface {
	Control
	TextAware
	BackColorAware
	LabelObject() *LabelObject
}

type LabelInterface

type LabelInterface interface {
	Label
	LabelSpi
}

type LabelObject

type LabelObject struct {
	ControlObject

	ForeColorAwareSupport
	// contains filtered or unexported fields
}

func NewLabelObject

func NewLabelObject() *LabelObject

func (*LabelObject) GetPreferredSize

func (this *LabelObject) GetPreferredSize(int, int) (cx, cy int)

func (*LabelObject) GetText

func (this *LabelObject) GetText() string

func (*LabelObject) GetWindowClass

func (this *LabelObject) GetWindowClass() string

func (*LabelObject) LabelObject

func (this *LabelObject) LabelObject() *LabelObject

func (*LabelObject) OnReflectMessage

func (this *LabelObject) OnReflectMessage(msg *Message)

func (*LabelObject) SetText

func (this *LabelObject) SetText(text string)

type LabelSpi

type LabelSpi interface {
	ControlSpi
}

type Layout

type Layout = layouts.Layout

type LayoutContainer

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

LayoutContainer is an layouts.Container implementation.

func (LayoutContainer) GetClientSize

func (me LayoutContainer) GetClientSize() (cx, cy int)

GetClientSize implements layouts.Container.GetClientSize.

func (LayoutContainer) GetControlByName

func (me LayoutContainer) GetControlByName(name string) layouts.Control

GetControlByName implements layouts.Container.GetControlByName.

func (LayoutContainer) GetControls

func (me LayoutContainer) GetControls() []layouts.Control

GetControls implements layouts.Container.GetControls.

type LinkLabel

type LinkLabel interface {
	Control
	TextAware

	GetOnClick() *Event[*LinkLabelOnClickInfo]
}

type LinkLabelObject

type LinkLabelObject struct {
	ControlObject

	OnClick Event[*LinkLabelOnClickInfo]
	Action  Action
	// contains filtered or unexported fields
}

func NewLinkLabelObject

func NewLinkLabelObject() *LinkLabelObject

func (*LinkLabelObject) GetControlSpecStyle

func (this *LinkLabelObject) GetControlSpecStyle() (WINDOW_STYLE, WINDOW_STYLE)

func (*LinkLabelObject) GetOnClick

func (this *LinkLabelObject) GetOnClick() *Event[*LinkLabelOnClickInfo]

func (*LinkLabelObject) GetPreferredSize

func (this *LinkLabelObject) GetPreferredSize(cxMax int, cyMax int) (int, int)

func (*LinkLabelObject) GetText

func (this *LinkLabelObject) GetText() string

func (*LinkLabelObject) GetWindowClass

func (this *LinkLabelObject) GetWindowClass() string

func (*LinkLabelObject) Init

func (this *LinkLabelObject) Init()

func (*LinkLabelObject) OnReflectNotify

func (this *LinkLabelObject) OnReflectNotify(msg *NotifyMessage)

func (*LinkLabelObject) SetText

func (this *LinkLabelObject) SetText(text string)

type LinkLabelOnClickInfo

type LinkLabelOnClickInfo struct {
	SimpleEventInfo
	Index int
	Id    string
	Url   string
}

type ListBox

type ListBox interface {
	Control
	Input

	ClearItems()

	AddItem(item types.ValueText)
	AddItems(items []types.ValueText)

	AddStringItem(item string)
	AddStringItems(items []string)

	GetItemCount() int
	GetItem(index int) *types.ValueText

	GetSelectedItem() *types.ValueText

	GetSelectedIndex() int
	SetSelectedIndex(index int)

	GetText() string
	DeleteItem(index int)

	IndexFromPoint(x, y int) int

	ListBoxObj() *ListBoxObject
}

type ListBoxObject

type ListBoxObject struct {
	ControlObject

	IntegralHeight bool
	ForeColorAwareSupport

	OnValueChange SimpleEvent
	// contains filtered or unexported fields
}

func NewListBoxObject

func NewListBoxObject() *ListBoxObject

func (*ListBoxObject) AddItem

func (this *ListBoxObject) AddItem(item types.ValueText)

func (*ListBoxObject) AddItems

func (this *ListBoxObject) AddItems(items []types.ValueText)

func (*ListBoxObject) AddStringItem

func (this *ListBoxObject) AddStringItem(item string)

func (*ListBoxObject) AddStringItems

func (this *ListBoxObject) AddStringItems(items []string)

func (*ListBoxObject) ClearItems

func (this *ListBoxObject) ClearItems()

func (*ListBoxObject) DeleteItem

func (this *ListBoxObject) DeleteItem(index int)

func (*ListBoxObject) GetControlSpecStyle

func (this *ListBoxObject) GetControlSpecStyle() (WINDOW_STYLE, WINDOW_STYLE)

func (*ListBoxObject) GetDefaultExStyle

func (this *ListBoxObject) GetDefaultExStyle() WINDOW_EX_STYLE

func (*ListBoxObject) GetItem

func (this *ListBoxObject) GetItem(index int) *types.ValueText

func (*ListBoxObject) GetItemCount

func (this *ListBoxObject) GetItemCount() int

func (*ListBoxObject) GetItemText

func (this *ListBoxObject) GetItemText(index int) string

func (*ListBoxObject) GetOnValueChange

func (this *ListBoxObject) GetOnValueChange() *SimpleEvent

func (*ListBoxObject) GetPreferredSize

func (this *ListBoxObject) GetPreferredSize(int, int) (int, int)

func (*ListBoxObject) GetSelectedIndex

func (this *ListBoxObject) GetSelectedIndex() int

func (*ListBoxObject) GetSelectedItem

func (this *ListBoxObject) GetSelectedItem() *types.ValueText

func (*ListBoxObject) GetText

func (this *ListBoxObject) GetText() string

func (*ListBoxObject) GetValue

func (this *ListBoxObject) GetValue() any

func (*ListBoxObject) GetWindowClass

func (this *ListBoxObject) GetWindowClass() string

func (*ListBoxObject) IndexFromPoint

func (this *ListBoxObject) IndexFromPoint(x, y int) int

func (*ListBoxObject) ListBoxObj

func (this *ListBoxObject) ListBoxObj() *ListBoxObject

func (*ListBoxObject) OnReflectCommand

func (this *ListBoxObject) OnReflectCommand(msg *CommandMessage)

func (*ListBoxObject) SelectByText

func (this *ListBoxObject) SelectByText(text string) bool

func (*ListBoxObject) SetSelectedIndex

func (this *ListBoxObject) SetSelectedIndex(index int)

func (*ListBoxObject) SetValue

func (this *ListBoxObject) SetValue(value any)

type ListRowInfo

type ListRowInfo struct {
	Id         int
	Image      int
	Data       any
	CellValues []any
}

type ListView

type ListView interface {
	Control

	GetRowCount() int
	ListViewObj() *ListViewObject
}

type ListViewColumn

type ListViewColumn struct {
	Title string
	Align int //textalign..

	Width      int
	MinWidth   int
	FixedWidth bool

	Sortable        bool
	DefaultSortDesc bool
	SortCompareFunc func(row1Id int, row2Id int) int

	Formatter types.Formatter
}

type ListViewItemEventInfo

type ListViewItemEventInfo struct {
	SimpleEventInfo
	Index int
}

type ListViewObject

type ListViewObject struct {
	ControlObject

	SingleRowSelect bool
	SortCompareFunc func(row1Id int, row2Id, colIndex int) int

	OnSelectionChange Event[*ListViewItemEventInfo]
	OnItemDblClick    Event[*ListViewItemEventInfo]

	Columns []*ListViewColumn
	// contains filtered or unexported fields
}

func NewListViewObject

func NewListViewObject() *ListViewObject

func (*ListViewObject) AddColumn

func (this *ListViewObject) AddColumn(column ListViewColumn)

func (*ListViewObject) AddRow

func (this *ListViewObject) AddRow(info *ListRowInfo) (int, int)

return index,rowid

func (*ListViewObject) AddRowInfos

func (this *ListViewObject) AddRowInfos(rows []*ListRowInfo)

rename?

func (*ListViewObject) AddRows

func (this *ListViewObject) AddRows(rows [][]any, rowAsData bool)

func (*ListViewObject) AddRowsWithData

func (this *ListViewObject) AddRowsWithData(dataRows [][]any)

func (*ListViewObject) AddRowsWithId

func (this *ListViewObject) AddRowsWithId(rows [][]any, rowAsData bool)

func (*ListViewObject) AddRowsWithIdAndData

func (this *ListViewObject) AddRowsWithIdAndData(dataRows [][]any)

func (*ListViewObject) AddRowsWithInfo

func (this *ListViewObject) AddRowsWithInfo(dataRows [][]any)

?

func (*ListViewObject) ClearColumns

func (this *ListViewObject) ClearColumns()

func (*ListViewObject) ClearRows

func (this *ListViewObject) ClearRows()

func (*ListViewObject) Create

func (this *ListViewObject) Create(options WindowOptions) error

func (*ListViewObject) DeleteColumn

func (this *ListViewObject) DeleteColumn(index int)

func (*ListViewObject) DeleteRow

func (this *ListViewObject) DeleteRow(index int)

func (*ListViewObject) Dispose

func (this *ListViewObject) Dispose()

func (*ListViewObject) GetColumnCount

func (this *ListViewObject) GetColumnCount() int

func (*ListViewObject) GetControlSpecStyle

func (this *ListViewObject) GetControlSpecStyle() (WINDOW_STYLE, WINDOW_STYLE)

func (*ListViewObject) GetRowCount

func (this *ListViewObject) GetRowCount() int

func (*ListViewObject) GetRowData

func (this *ListViewObject) GetRowData(id int) any

func (*ListViewObject) GetSelectedData

func (this *ListViewObject) GetSelectedData() any

func (*ListViewObject) GetSelectedId

func (this *ListViewObject) GetSelectedId() int

func (*ListViewObject) GetSelectedIndex

func (this *ListViewObject) GetSelectedIndex() int

func (*ListViewObject) GetSelectedIndexes

func (this *ListViewObject) GetSelectedIndexes() []int

func (*ListViewObject) GetWindowClass

func (this *ListViewObject) GetWindowClass() string

func (*ListViewObject) IndexToId

func (this *ListViewObject) IndexToId(index int) int

func (*ListViewObject) Init

func (this *ListViewObject) Init()

func (*ListViewObject) ListViewObj

func (this *ListViewObject) ListViewObj() *ListViewObject

func (*ListViewObject) OnReflectNotify

func (this *ListViewObject) OnReflectNotify(msg *NotifyMessage)

func (*ListViewObject) SetColumns

func (this *ListViewObject) SetColumns(columns []ListViewColumn)

func (*ListViewObject) SetImageList

func (this *ListViewObject) SetImageList(iml *ImageList)

func (*ListViewObject) SetRowData

func (this *ListViewObject) SetRowData(id int, data any)

func (*ListViewObject) SetSelectedIndex

func (this *ListViewObject) SetSelectedIndex(index int)
type Menu struct {
	Handle     win32.HMENU
	OnSelected func(item *MenuItem)

	ImageList *ImageList
	OwnerDraw bool
	// contains filtered or unexported fields
}

func GetMenuObject

func GetMenuObject(hMenu win32.HMENU) *Menu
func (this *Menu) AddItem(item MenuItem)
func (this *Menu) AddItems(items []MenuItem)
func (this *Menu) AddSeparator()
func (this *Menu) Dispose()
func (this *Menu) GetItem(id uint16) *MenuItem
func (this *Menu) GetItemCount() int
func (this *Menu) GetSubMenuItem(hSubMenu win32.HMENU) *MenuItem
func (this *Menu) Init()
func (this *Menu) SetItemText(id int, text string)
type MenuBar struct {
	Menu
	// contains filtered or unexported fields
}

action not working?

func NewMenuBar

func NewMenuBar(create bool) *MenuBar
func (this *MenuBar) BindTo(topWin TopWindow)
func (this *MenuBar) CheckItem(id uint16, checked bool)
func (this *MenuBar) CheckItemByName(name string, checked bool)
func (this *MenuBar) Create()
func (this *MenuBar) GetItemByName(name string) *MenuItem
type MenuHelpUI interface {
	EnterMenuHelp()
	ShowMenuHelp(text string)
	ExitMenuHelp()
}
type MenuItem struct {
	Id       uint16
	Name     string
	Text     string
	Desc     string //description
	Image    int    //default 0 means null. use zero to specify 0.
	Radio    bool
	Disabled bool
	Checked  bool
	Action   Action
	SubItems []*MenuItem

	Command *Command
	// contains filtered or unexported fields
}

type Message

type Message struct {
	HWnd    HWND
	UMsg    uint32
	WParam  WPARAM
	LParam  LPARAM
	Handled bool
	Result  win32.LRESULT
}

func NewMessageFromMSG

func NewMessageFromMSG(msg *win32.MSG) *Message

func (*Message) GetHandled

func (this *Message) GetHandled() bool

func (*Message) GetResult

func (this *Message) GetResult() uintptr

func (*Message) GetSender

func (this *Message) GetSender() any

func (*Message) SetHandled

func (this *Message) SetHandled(handle bool)

func (*Message) SetHandledWithResult

func (this *Message) SetHandledWithResult(result uintptr) error

func (*Message) SetResult

func (this *Message) SetResult(result uintptr)

func (*Message) SetSender

func (this *Message) SetSender(sender any)

type MessageProcessFunc

type MessageProcessFunc func(message *Message)

type MessageProcessFuncHolder

type MessageProcessFuncHolder struct {
	MessageProcessFunc
}

func (*MessageProcessFuncHolder) ProcessMessage

func (this *MessageProcessFuncHolder) ProcessMessage(message *Message)

type MessageProcessor

type MessageProcessor interface {
	ProcessMessage(message *Message)
}

--

func MessageProcessorByFunc

func MessageProcessorByFunc(processFunc MessageProcessFunc) MessageProcessor

type MessageProcessors

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

func (*MessageProcessors) Add

func (this *MessageProcessors) Add(processor MessageProcessor)

func (*MessageProcessors) ProcessMsg

func (this *MessageProcessors) ProcessMsg(message *Message) bool

func (*MessageProcessors) Remove

func (this *MessageProcessors) Remove(processor MessageProcessor)

type MsgEvent

type MsgEvent = Event[*Message]

type MsgEventListener

type MsgEventListener func(ei *Message)

?type EventListener = events.EventListener[*Message]

type MsgEventSource

type MsgEventSource interface {
	GetEvent(uMsg uint32) *MsgEvent
	TryGetEvent(uMsg uint32) (*MsgEvent, bool)
}

type MsgPreprocessor

type MsgPreprocessor interface {
	// PreprocessMsg is called to preprocess win32 messages in the message loop
	PreprocessMsg(msg *win32.MSG) bool
}

MsgPreprocessor is an interface that wraps the PreprocessMsg method.

type NameAware

type NameAware = types.NameAware
type TextAwareSupport struct {
	text string
}
func (this *TextAwareSupport) SetText(text string) {
	this.text = text
}
func (this *TextAwareSupport) GetText() string {
	return this.text
}

type NameAwareSupport

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

func (*NameAwareSupport) GetName

func (this *NameAwareSupport) GetName() string

func (*NameAwareSupport) SetName

func (this *NameAwareSupport) SetName(name string)

type NewButton

type NewButton struct {
	Parent   Container   // Parent container
	Id       uint16      // Control identifier
	Name     string      // Control Name
	Text     string      // Text for the button
	Icon     win32.HICON // Icon of the button
	Pos      Point       // Control position
	Size     Size        // Control Size
	Disabled bool        // Whether the button is disabled
	Action   Action      // Action to execute on click
}

NewButton is a struct representing the configuration for creating a new button

func (NewButton) Create

func (me NewButton) Create(extraOpts ...*WindowOptions) Button

Create creates a new button with the specified configuration

type NewCheckBox

type NewCheckBox struct {
	Parent   Container
	Name     string
	Text     string
	Pos      Point
	Size     Size
	Checked  bool
	Disabled bool
}

func (NewCheckBox) Create

func (me NewCheckBox) Create(extraOpts ...*WindowOptions) CheckBox

type NewComboBox

type NewComboBox struct {
	Parent   Container
	Name     string
	Text     string
	Pos      Point
	Size     Size
	Disabled bool
	Editable bool //?
	Items    []string
}

func (NewComboBox) Create

func (me NewComboBox) Create(extraOpts ...*WindowOptions) ComboBox

type NewEdit

type NewEdit struct {
	Parent   Container
	Name     string
	Text     string
	Pos      Point
	Size     Size
	OnChange SimpleEventListener
}

func (NewEdit) Create

func (me NewEdit) Create(extraOpts ...*WindowOptions) Edit

type NewForm

type NewForm struct {
	Title      string
	Pos        Point
	Size       Size
	ClientSize Size
	BackColor  drawing.Color

	Icon    win32.HICON
	IconBig win32.HICON

	NoResize      bool
	NoMinimizeBox bool
	NoMaximizeBox bool
	NoIcon        bool
	HelpButton    bool

	Owner    TopWindow
	Center   WindowCenter
	State    WindowState
	TopMost  bool
	SizeGrip bool
}

func (NewForm) Create

func (me NewForm) Create(extraOpts ...*WindowOptions) Form

type NewGroupBox

type NewGroupBox struct {
	Parent Container
	Name   string
	Text   string
	Pos    Point
	Size   Size
}

func (NewGroupBox) Create

func (me NewGroupBox) Create(extraOpts ...*WindowOptions) GroupBox

type NewImageBox

type NewImageBox struct {
	Parent Container
	Name   string
	Pos    Point
	Size   Size
	Icon   win32.HICON
	Bitmap win32.HBITMAP
}

func (NewImageBox) Create

func (me NewImageBox) Create(extraOpts ...*WindowOptions) ImageBox

type NewLabel

type NewLabel struct {
	Parent Container
	Name   string
	Text   string
	Pos    Point
	Size   Size
}

func (NewLabel) Create

func (me NewLabel) Create(extraOpts ...*WindowOptions) Label

type NewLinkLabel

type NewLinkLabel struct {
	Parent Container
	Name   string
	Text   string
	Pos    Point
	Size   Size
	Action Action
}

func (NewLinkLabel) Create

func (me NewLinkLabel) Create(extraOpts ...*WindowOptions) LinkLabel

type NewListBox

type NewListBox struct {
	Parent         Container
	Name           string
	Pos            Point
	Size           Size
	IntegralHeight bool
	Items          []types.ValueText
	StringItems    []string
}

func (NewListBox) Create

func (me NewListBox) Create(extraOpts ...*WindowOptions) ListBox

type NewListView

type NewListView struct {
	Parent  Container
	Name    string
	Pos     Point
	Size    Size
	Columns []*ListViewColumn
	Rows    []*ListRowInfo
}

func (NewListView) Create

func (me NewListView) Create(extraOpts ...*WindowOptions) ListView

type NewNumberEdit

type NewNumberEdit struct {
	Parent Container
	Name   string
	Pos    Point
	Size   Size
	Min    int
	Max    int
	Value  int
}

func (NewNumberEdit) Create

func (me NewNumberEdit) Create(extraOpts ...*WindowOptions) NumberEdit

type NewPanel

type NewPanel struct {
	Parent   Container
	Name     string
	Pos      Point
	Size     Size
	WindowBg bool
	Border   bool
}

func (NewPanel) Create

func (me NewPanel) Create(extraOpts ...*WindowOptions) Panel

type NewProgressBar

type NewProgressBar struct {
	Parent Container
	Name   string
	Pos    Point
	Size   Size
	Min    int
	Max    int
	Value  int
}

func (NewProgressBar) Create

func (me NewProgressBar) Create(extraOpts ...*WindowOptions) ProgressBar

type NewRadioButton

type NewRadioButton struct {
	Parent     Container
	Name       string
	Text       string
	Pos        Point
	Size       Size
	Checked    bool
	Disabled   bool
	BeginGroup bool
}

func (NewRadioButton) Create

func (me NewRadioButton) Create(extraOpts ...*WindowOptions) RadioButton

type NewSlider

type NewSlider struct {
	Parent   Container
	Name     string
	Pos      Point
	Size     Size
	Vertical bool
}

func (NewSlider) Create

func (me NewSlider) Create(extraOpts ...*WindowOptions) Slider

type NewSplitter

type NewSplitter struct {
	Parent Container
	Name   string
	Pos    Point
	Size   Size
	Width  int
}

func (NewSplitter) Create

func (me NewSplitter) Create(extraOpts ...*WindowOptions) Splitter

type NewStatusBar

type NewStatusBar struct {
	Parent Container
	Name   string
	Simple bool
	Parts  []*StatusPart
}

func (NewStatusBar) Create

func (me NewStatusBar) Create(extraOpts ...*WindowOptions) StatusBar

type NewTabControl

type NewTabControl struct {
	Parent   Container
	Name     string
	Pos      Point
	Size     Size
	TabItems []TabItem
}

func (NewTabControl) Create

func (me NewTabControl) Create(extraOpts ...*WindowOptions) TabControl

type NewTabSheet

type NewTabSheet struct {
	Parent Container
	Name   string
	Title  string
}

func (NewTabSheet) Create

func (me NewTabSheet) Create(extraOpts ...*WindowOptions) TabSheet

type NewTextArea

type NewTextArea struct {
	Parent Container
	Name   string
	Text   string
	Pos    Point
	Size   Size
}

func (NewTextArea) Create

func (me NewTextArea) Create(extraOpts ...*WindowOptions) TextArea

type NewToolBar

type NewToolBar struct {
	Parent     Container
	Name       string
	LabelStyle TbLabelStyle
}

func (NewToolBar) Create

func (me NewToolBar) Create(extraOpts ...*WindowOptions) ToolBar

type NewTreeView

type NewTreeView struct {
	Parent Container
	Name   string
	Pos    Point
	Size   Size

	Checkable     bool
	NoLines       bool
	NoLinesAtRoot bool
	NoButtons     bool

	ImageList *ImageList
	Items     []TreeItem
	Nodes     []TreeNode
}

func (NewTreeView) Create

func (me NewTreeView) Create(extraOpts ...*WindowOptions) TreeView

type NotifyMessage

type NotifyMessage struct {
	*Message
}

func (*NotifyMessage) GetNMHDR

func (this *NotifyMessage) GetNMHDR() *win32.NMHDR

type NumberEdit

type NumberEdit interface {
	Edit
}

type NumberEditObject

type NumberEditObject struct {
	EditObject

	//
	Min int
	Max int
	// contains filtered or unexported fields
}

func NewNumberEditObject

func NewNumberEditObject() *NumberEditObject

func (*NumberEditObject) Create

func (this *NumberEditObject) Create(options WindowOptions) error

func (*NumberEditObject) GetValue

func (this *NumberEditObject) GetValue() any

func (*NumberEditObject) GetWindowClass

func (this *NumberEditObject) GetWindowClass() string

func (*NumberEditObject) Init

func (this *NumberEditObject) Init()

func (*NumberEditObject) SetBounds

func (this *NumberEditObject) SetBounds(left, top, width, height int)

func (*NumberEditObject) SetValue

func (this *NumberEditObject) SetValue(value any)

type OpenFileDialog

type OpenFileDialog struct {
	FileDialog
	FileMustExists bool
}

func NewOpenFileDialog

func NewOpenFileDialog() *OpenFileDialog

func (*OpenFileDialog) Show

func (this *OpenFileDialog) Show(hWndOwner win32.HWND) bool

type Panel

type Panel interface {
	ContainerControl

	PanelObj() *PanelObject
}

type PanelInterface

type PanelInterface interface {
	Panel
	PanelSpi
}

type PanelObject

type PanelObject struct {
	ContainerControlObject

	WindowBg bool
	Border   bool
	// contains filtered or unexported fields
}

func NewPanelObject

func NewPanelObject() *PanelObject

func (*PanelObject) EnsureClassRegistered

func (this *PanelObject) EnsureClassRegistered()

func (*PanelObject) GetDefaultStyle

func (this *PanelObject) GetDefaultStyle() WINDOW_STYLE

func (*PanelObject) GetWindowClass

func (this *PanelObject) GetWindowClass() string

func (*PanelObject) Init

func (this *PanelObject) Init()

func (*PanelObject) OnCtlColorStatic

func (this *PanelObject) OnCtlColorStatic(msg *Message)

func (*PanelObject) PanelObj

func (this *PanelObject) PanelObj() *PanelObject

func (*PanelObject) WinProc

func (this *PanelObject) WinProc(winObj *WindowObject, m *Message) error

type PanelSpi

type PanelSpi interface {
	ControlSpi
}

type Point

type Point = types.Point

func DpiPoint

func DpiPoint(x, y int) Point

func PointFromDWORD

func PointFromDWORD(dw win32.DWORD) Point

func Pt

func Pt(x, y int) Point

type PopupMenu

type PopupMenu struct {
	Menu
}

func NewPopupMenu

func NewPopupMenu() *PopupMenu

func (*PopupMenu) Create

func (this *PopupMenu) Create()

func (*PopupMenu) Show

func (this *PopupMenu) Show(x, y int, hWndOwner HWND) (uint16, string)

type PosAware

type PosAware interface {
	SetPos(x, y int)
	GetPos() (x, y int)
}

type ProgressBar

type ProgressBar interface {
	Control

	ProgressBarObj() *ProgressBarObject
}

type ProgressBarObject

type ProgressBarObject struct {
	ControlObject
	// contains filtered or unexported fields
}

func NewProgressBarObject

func NewProgressBarObject() *ProgressBarObject

func (*ProgressBarObject) Create

func (this *ProgressBarObject) Create(options WindowOptions) error

func (*ProgressBarObject) GetPreferredSize

func (this *ProgressBarObject) GetPreferredSize(cxMax int, cyMax int) (int, int)

func (*ProgressBarObject) GetWindowClass

func (this *ProgressBarObject) GetWindowClass() string

func (*ProgressBarObject) Init

func (this *ProgressBarObject) Init()

func (*ProgressBarObject) ProgressBarObj

func (this *ProgressBarObject) ProgressBarObj() *ProgressBarObject

func (*ProgressBarObject) SetMax

func (this *ProgressBarObject) SetMax(max int)

func (*ProgressBarObject) SetMin

func (this *ProgressBarObject) SetMin(min int)

func (*ProgressBarObject) SetPos_

func (this *ProgressBarObject) SetPos_(pos int)

func (*ProgressBarObject) SetProgress

func (this *ProgressBarObject) SetProgress(progress int)

func (*ProgressBarObject) SetRange

func (this *ProgressBarObject) SetRange(min, max int)

func (*ProgressBarObject) ShowMarquee

func (this *ProgressBarObject) ShowMarquee(marquee bool)

type RadioButton

type RadioButton interface {
	Control
	TextAware

	GetChecked() bool
	SetChecked(checked bool)

	GetOnClick() *SimpleEvent

	RadioButtonObj() *RadioButtonObject
}

type RadioButtonInterface

type RadioButtonInterface interface {
	RadioButton
	RadioButtonSpi
}

type RadioButtonObject

type RadioButtonObject struct {
	ControlObject

	ForeColorAwareSupport
	AutoCheck  bool
	BeginGroup bool

	OnValueChange SimpleEvent
	OnClick       SimpleEvent
}

func NewRadioButtonObject

func NewRadioButtonObject() *RadioButtonObject

func (*RadioButtonObject) GetChecked

func (this *RadioButtonObject) GetChecked() bool

func (*RadioButtonObject) GetControlSpecStyle

func (this *RadioButtonObject) GetControlSpecStyle() (include, exclude WINDOW_STYLE)

func (*RadioButtonObject) GetOnClick

func (this *RadioButtonObject) GetOnClick() *SimpleEvent

func (*RadioButtonObject) GetOnValueChangeEvent

func (this *RadioButtonObject) GetOnValueChangeEvent() *SimpleEvent

func (*RadioButtonObject) GetPreferredSize

func (this *RadioButtonObject) GetPreferredSize(int, int) (cx, cy int)

func (*RadioButtonObject) GetText

func (this *RadioButtonObject) GetText() string

func (*RadioButtonObject) GetValue

func (this *RadioButtonObject) GetValue() any

func (*RadioButtonObject) GetWindowClass

func (this *RadioButtonObject) GetWindowClass() string

func (*RadioButtonObject) OnReflectCommand

func (this *RadioButtonObject) OnReflectCommand(msg *CommandMessage)

func (*RadioButtonObject) RadioButtonObj

func (this *RadioButtonObject) RadioButtonObj() *RadioButtonObject

func (*RadioButtonObject) SetChecked

func (this *RadioButtonObject) SetChecked(checked bool)

func (*RadioButtonObject) SetText

func (this *RadioButtonObject) SetText(text string)

func (*RadioButtonObject) SetValue

func (this *RadioButtonObject) SetValue(value any)

type RadioButtonSpi

type RadioButtonSpi interface {
	ControlSpi
}

type ReadOnlyAware

type ReadOnlyAware interface {
	SetReadOnly(readOnly bool)
	GetReadOnly() bool
}

type Rect

type Rect = types.Rect

func RectFromRECT

func RectFromRECT(rc win32.RECT) Rect

func RectWithSize

func RectWithSize(left int, top int, width int, height int) Rect

type SaveFileDialog

type SaveFileDialog struct {
	FileDialog
}

func NewSaveFileDialog

func NewSaveFileDialog() *SaveFileDialog

func (*SaveFileDialog) Show

func (this *SaveFileDialog) Show() bool

type SimpleEvent

type SimpleEvent = events.SimpleEvent

type SimpleEventInfo

type SimpleEventInfo = events.SimpleEventInfo

type SimpleEventListener

type SimpleEventListener = events.SimpleEventListener

type SimpleWindowObject

type SimpleWindowObject struct {
	WindowObject
	// contains filtered or unexported fields
}

func (*SimpleWindowObject) EnsureClassRegistered

func (this *SimpleWindowObject) EnsureClassRegistered()

func (*SimpleWindowObject) EnsureCustomWndProc

func (this *SimpleWindowObject) EnsureCustomWndProc()

func (*SimpleWindowObject) GetWindowClass

func (this *SimpleWindowObject) GetWindowClass() string

type Size

type Size = types.Size

func DpiSize

func DpiSize(width, height int) Size

func Sz

func Sz(cx, cy int) Size

type SizeAware

type SizeAware interface {
	SetSize(cx, cy int)
	GetSize() (cx, cy int)
}

type Slider

type Slider interface {
	Control

	SetRange(min int, max int)
	GetRange() (min int, max int)

	SetValue(value int)
	GetValue() int
}

type SliderObject

type SliderObject struct {
	ControlObject

	Vertical bool
	// contains filtered or unexported fields
}

func NewSliderObject

func NewSliderObject() *SliderObject

func (*SliderObject) GetControlSpecStyle

func (this *SliderObject) GetControlSpecStyle() (include, exclude WINDOW_STYLE)

func (*SliderObject) GetPreferredSize

func (this *SliderObject) GetPreferredSize(cxMax int, cyMax int) (int, int)

func (*SliderObject) GetRange

func (this *SliderObject) GetRange() (int, int)

func (*SliderObject) GetValue

func (this *SliderObject) GetValue() int

func (*SliderObject) GetWindowClass

func (this *SliderObject) GetWindowClass() string

func (*SliderObject) Init

func (this *SliderObject) Init()

func (*SliderObject) OnHandleCreated

func (this *SliderObject) OnHandleCreated()

func (*SliderObject) SetRange

func (this *SliderObject) SetRange(min int, max int)

func (*SliderObject) SetValue

func (this *SliderObject) SetValue(value int)

type Splitter

type Splitter interface {
	Control
}

type SplitterObject

type SplitterObject struct {
	ControlObject

	Width int
	// contains filtered or unexported fields
}

func NewSplitterObject

func NewSplitterObject() *SplitterObject

func (*SplitterObject) Create

func (this *SplitterObject) Create(options WindowOptions) error

func (*SplitterObject) EnsureClassRegistered

func (this *SplitterObject) EnsureClassRegistered()

func (*SplitterObject) GetPreferredSize

func (this *SplitterObject) GetPreferredSize(maxWidth int, maxHeight int) (int, int)

func (*SplitterObject) GetWindowClass

func (this *SplitterObject) GetWindowClass() string

func (*SplitterObject) Init

func (this *SplitterObject) Init()

type StatusBar

type StatusBar interface {
	Control
	IsSimpleMode() bool
	SetSimpleMode(simple bool)
	SetParts(parts []StatusPart)

	SetSimpleText(text string)
	GetSimpleText() string

	SetPartText(index int, text string)
	GetPartText(index int) string

	SetText(text string)
	GetText() string
}

type StatusBarInterface

type StatusBarInterface interface {
	StatusBar
	StatusBarSpi
}

type StatusBarMenuHelpUI

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

func NewStatusBarMenuHelpUI

func NewStatusBarMenuHelpUI(statusBar StatusBar, simpleMode bool) *StatusBarMenuHelpUI

func (*StatusBarMenuHelpUI) EnterMenuHelp

func (this *StatusBarMenuHelpUI) EnterMenuHelp()

func (*StatusBarMenuHelpUI) ExitMenuHelp

func (this *StatusBarMenuHelpUI) ExitMenuHelp()

func (*StatusBarMenuHelpUI) ShowMenuHelp

func (this *StatusBarMenuHelpUI) ShowMenuHelp(text string)

type StatusBarObject

type StatusBarObject struct {
	ControlObject
	// contains filtered or unexported fields
}

func NewStatusBarObject

func NewStatusBarObject() *StatusBarObject

func (*StatusBarObject) Create

func (this *StatusBarObject) Create(options WindowOptions) error

func (*StatusBarObject) GetPartText

func (this *StatusBarObject) GetPartText(index int) string

func (*StatusBarObject) GetPreferredSize

func (this *StatusBarObject) GetPreferredSize(cxMax int, cyMax int) (int, int)

func (*StatusBarObject) GetSimpleText

func (this *StatusBarObject) GetSimpleText() string

func (*StatusBarObject) GetText

func (this *StatusBarObject) GetText() string

func (*StatusBarObject) GetWindowClass

func (this *StatusBarObject) GetWindowClass() string

func (*StatusBarObject) Init

func (this *StatusBarObject) Init()

func (*StatusBarObject) IsSimpleMode

func (this *StatusBarObject) IsSimpleMode() bool

func (*StatusBarObject) OnParentResized

func (this *StatusBarObject) OnParentResized()

func (*StatusBarObject) SetPartText

func (this *StatusBarObject) SetPartText(index int, text string)

func (*StatusBarObject) SetParts

func (this *StatusBarObject) SetParts(parts []StatusPart)

func (*StatusBarObject) SetSimpleMode

func (this *StatusBarObject) SetSimpleMode(simple bool)

func (*StatusBarObject) SetSimpleText

func (this *StatusBarObject) SetSimpleText(text string)

func (*StatusBarObject) SetText

func (this *StatusBarObject) SetText(text string)

type StatusBarSpi

type StatusBarSpi interface {
	ControlSpi
}

type StatusPart

type StatusPart struct {
	Width    int
	MinWidth int
	MaxWidth int
	Weight   float32
	Text     string
}

type TabControl

type TabControl interface {
	Control

	SetItems(items []TabItem)
	SetSelectedIndex(index int)
	GetSelectedIndex() int

	SelectFirst()
	SelectPrev()
	SelectNext()
	SelectLast()

	TabControlObj() *TabControlObject
}

type TabControlObject

type TabControlObject struct {
	ControlObject
	// contains filtered or unexported fields
}

func NewTabControlObject

func NewTabControlObject() *TabControlObject

func (*TabControlObject) GetPreferredSize

func (this *TabControlObject) GetPreferredSize(maxWidth int, maxHeight int) (int, int)

func (*TabControlObject) GetSelectedIndex

func (this *TabControlObject) GetSelectedIndex() int

func (*TabControlObject) GetWindowClass

func (this *TabControlObject) GetWindowClass() string

func (*TabControlObject) Init

func (this *TabControlObject) Init()

func (*TabControlObject) MeasureControlRect

func (this *TabControlObject) MeasureControlRect(sheetRect Rect) Rect

func (*TabControlObject) MeasureSheetRect

func (this *TabControlObject) MeasureSheetRect(controlRect Rect) Rect

func (*TabControlObject) OnReflectNotify

func (this *TabControlObject) OnReflectNotify(msg *NotifyMessage)

func (*TabControlObject) SelectFirst

func (this *TabControlObject) SelectFirst()

func (*TabControlObject) SelectLast

func (this *TabControlObject) SelectLast()

func (*TabControlObject) SelectNext

func (this *TabControlObject) SelectNext()

func (*TabControlObject) SelectPrev

func (this *TabControlObject) SelectPrev()

func (*TabControlObject) SetBounds

func (this *TabControlObject) SetBounds(left, top, width, height int)

func (*TabControlObject) SetItems

func (this *TabControlObject) SetItems(items []TabItem)

func (*TabControlObject) SetSelectedIndex

func (this *TabControlObject) SetSelectedIndex(index int)

func (*TabControlObject) TabControlObj

func (this *TabControlObject) TabControlObj() *TabControlObject

type TabItem

type TabItem struct {
	Title string
	Sheet Control
}

type TabSheet

type TabSheet interface {
	ContainerControl
	//TextAware
	TitleAware
}

type TabSheetInterface

type TabSheetInterface interface {
	TabSheet
	TabSheetSpi
}

type TabSheetObject

type TabSheetObject struct {
	ContainerControlObject
	// contains filtered or unexported fields
}

func NewTabSheetObject

func NewTabSheetObject() *TabSheetObject

func (*TabSheetObject) CreateHandle

func (this *TabSheetObject) CreateHandle(
	className string, options WindowOptions) (HWND, error)

func (*TabSheetObject) GetControlSpecStyle

func (this *TabSheetObject) GetControlSpecStyle() (include, exclude WINDOW_STYLE)

func (*TabSheetObject) GetTitle

func (this *TabSheetObject) GetTitle() string

func (*TabSheetObject) SetTitle

func (this *TabSheetObject) SetTitle(title string)

type TabSheetSpi

type TabSheetSpi interface {
	ControlSpi
}

type TbLabelStyle

type TbLabelStyle byte
const (
	TbLabelDefault   TbLabelStyle = 0 //default below
	TbLabelBelow     TbLabelStyle = 1
	TbLabelOnRight   TbLabelStyle = 2
	TbLabelInvisible TbLabelStyle = 3
)

type TextArea

type TextArea interface {
	Edit

	TextAreaObj() *TextAreaObject
}

type TextAreaObject

type TextAreaObject struct {
	EditObject

	NoAutoWrap          bool //horz scrollbar?
	AlwaysShowScrollBar bool
	ForeColorAwareSupport
	// contains filtered or unexported fields
}

func NewTextAreaObject

func NewTextAreaObject() *TextAreaObject

func (*TextAreaObject) Create

func (this *TextAreaObject) Create(options WindowOptions) error

func (*TextAreaObject) Dispose

func (this *TextAreaObject) Dispose()

func (*TextAreaObject) GetControlSpecStyle

func (this *TextAreaObject) GetControlSpecStyle() (include, exclude WINDOW_STYLE)

func (*TextAreaObject) GetPreferredSize

func (this *TextAreaObject) GetPreferredSize(maxCx int, maxCy int) (int, int)

func (*TextAreaObject) GetWindowClass

func (this *TextAreaObject) GetWindowClass() string

func (*TextAreaObject) Init

func (this *TextAreaObject) Init()

func (*TextAreaObject) OnReflectCommand

func (this *TextAreaObject) OnReflectCommand(msg *CommandMessage)

func (*TextAreaObject) SetBounds

func (this *TextAreaObject) SetBounds(left, top, width, height int)

func (*TextAreaObject) TextAreaObj

func (this *TextAreaObject) TextAreaObj() *TextAreaObject

type TextAware

type TextAware interface {
	SetText(text string)
	GetText() string
}

--

type TextNode

type TextNode struct {
	Text     string
	Children []TextNode
}

type Timer

type Timer struct {
	IntervalMillis int
	OnTick         SimpleEvent
	// contains filtered or unexported fields
}

func CreateTimer

func CreateTimer(intervalMillis int, onTick events.SimpleEventListener) *Timer

func NewTimer

func NewTimer() *Timer

func (*Timer) Dispose

func (this *Timer) Dispose()

func (*Timer) Start

func (this *Timer) Start()

type TitleAware

type TitleAware interface {
	GetTitle() string
	SetTitle(title string)
}

type ToolBar

type ToolBar interface {
	Control

	SetImageList(imageList *ImageList, imageListLarge *ImageList)
	SetLarge(large bool)
	IsLarge() bool

	AddItems(items []*ToolBarItem)
	BuildOverflowMenu() *PopupMenu

	GetItems() []*ToolBarItem
	GetItemIds() []int
	SetItemIds(ids []int)
	SetDefaultItemIds(ids []int)
	LoadSystemImages(idbId uint32) int

	EnableItem(id int, enabled bool)
}

type ToolBarInterface

type ToolBarInterface interface {
	ToolBar
	ToolBarSpi
}

type ToolBarItem

type ToolBarItem struct {
	Id            uint16
	Name          string
	Text          string
	Image         int
	Tooltip       string
	NoTextOnRight bool
	Action        Action
	Menu          *PopupMenu

	Disabled bool
	Command  *Command
}

type ToolBarObject

type ToolBarObject struct {
	ControlObject

	Flat          bool
	ButtonSize    Size
	LabelStyle    TbLabelStyle
	OnContextMenu SimpleEvent
	OnDblClick    SimpleEvent
	AllItems      []*ToolBarItem
	// contains filtered or unexported fields
}

func NewToolBarObject

func NewToolBarObject() *ToolBarObject

func (*ToolBarObject) AddItems

func (this *ToolBarObject) AddItems(items []*ToolBarItem)

func (*ToolBarObject) BuildOverflowMenu

func (this *ToolBarObject) BuildOverflowMenu() *PopupMenu

func (*ToolBarObject) Clear

func (this *ToolBarObject) Clear()

func (*ToolBarObject) Create

func (this *ToolBarObject) Create(options WindowOptions) error

func (*ToolBarObject) Customize

func (this *ToolBarObject) Customize()

func (*ToolBarObject) Dispose

func (this *ToolBarObject) Dispose()

func (*ToolBarObject) EnableItem

func (this *ToolBarObject) EnableItem(id int, enabled bool)

func (*ToolBarObject) GetControlSpecStyle

func (this *ToolBarObject) GetControlSpecStyle() (WINDOW_STYLE, WINDOW_STYLE)

func (*ToolBarObject) GetItemIds

func (this *ToolBarObject) GetItemIds() []int

func (*ToolBarObject) GetItems

func (this *ToolBarObject) GetItems() []*ToolBarItem

func (*ToolBarObject) GetPreferredSize

func (this *ToolBarObject) GetPreferredSize(cxMax int, cyMax int) (int, int)

func (*ToolBarObject) GetWindowClass

func (this *ToolBarObject) GetWindowClass() string

func (*ToolBarObject) Init

func (this *ToolBarObject) Init()

func (*ToolBarObject) IsLarge

func (this *ToolBarObject) IsLarge() bool

func (*ToolBarObject) LoadImages

func (this *ToolBarObject) LoadImages(typeId uint32) int

func (*ToolBarObject) LoadSystemImages

func (this *ToolBarObject) LoadSystemImages(idbId uint32) int

func (*ToolBarObject) OnParentResized

func (this *ToolBarObject) OnParentResized()

func (*ToolBarObject) OnReflectCommand

func (this *ToolBarObject) OnReflectCommand(msg *CommandMessage)

func (*ToolBarObject) OnReflectNotify

func (this *ToolBarObject) OnReflectNotify(msg *NotifyMessage)

func (*ToolBarObject) PreProcessMsg

func (this *ToolBarObject) PreProcessMsg(msg *win32.MSG) bool

func (*ToolBarObject) SetBitmapSize

func (this *ToolBarObject) SetBitmapSize(cx, cy int)

func (*ToolBarObject) SetButtonSize

func (this *ToolBarObject) SetButtonSize(cx, cy int)

func (*ToolBarObject) SetButtonWidth

func (this *ToolBarObject) SetButtonWidth(minWdith, maxWidth int)

func (*ToolBarObject) SetDefaultItemIds

func (this *ToolBarObject) SetDefaultItemIds(ids []int)

func (*ToolBarObject) SetImageList

func (this *ToolBarObject) SetImageList(imageList *ImageList, imageListLarge *ImageList)

func (*ToolBarObject) SetItemIds

func (this *ToolBarObject) SetItemIds(ids []int)

func (*ToolBarObject) SetItems

func (this *ToolBarObject) SetItems(items []*ToolBarItem)

func (*ToolBarObject) SetLabelStyle

func (this *ToolBarObject) SetLabelStyle(labelStyle TbLabelStyle)

func (*ToolBarObject) SetLarge

func (this *ToolBarObject) SetLarge(large bool)

func (*ToolBarObject) SetPadding

func (this *ToolBarObject) SetPadding(cx, cy int)

func (*ToolBarObject) UpdateCommandItems

func (this *ToolBarObject) UpdateCommandItems()

type ToolBarSpi

type ToolBarSpi interface {
	ControlSpi
}

type Tooltip

type Tooltip interface {
	Window

	AddTool(control Control, textProvider TooltipTextProvider)
}

type TooltipObject

type TooltipObject struct {
	WindowObject
	// contains filtered or unexported fields
}

func NewTooltipObject

func NewTooltipObject() *TooltipObject

func (*TooltipObject) AddTool

func (this *TooltipObject) AddTool(control Control, textProvider TooltipTextProvider)

func (*TooltipObject) CreateIn

func (this *TooltipObject) CreateIn(parent Window, extraOpts ...*WindowOptions)

func (*TooltipObject) Dispose

func (this *TooltipObject) Dispose()

func (*TooltipObject) GetDefaultStyle

func (this *TooltipObject) GetDefaultStyle() WINDOW_STYLE

func (*TooltipObject) GetWindowClass

func (this *TooltipObject) GetWindowClass() string

func (*TooltipObject) Hide

func (this *TooltipObject) Hide()

func (*TooltipObject) Init

func (this *TooltipObject) Init()

func (*TooltipObject) OnReflectNotify

func (this *TooltipObject) OnReflectNotify(msg *NotifyMessage)

func (*TooltipObject) SetText

func (this *TooltipObject) SetText(text string)

func (*TooltipObject) Show

func (this *TooltipObject) Show()

func (*TooltipObject) ShowAt

func (this *TooltipObject) ShowAt(x, y int)

func (*TooltipObject) ShowInplace

func (this *TooltipObject) ShowInplace(x int, y int)

type TooltipTextProvider

type TooltipTextProvider interface {
	GetTooltipText() string
}

type TopWindow

type TopWindow interface {
	Container  // the parent interface
	NameAware  // name aware
	TitleAware // title aware

	Close() // closes the window

	CenterOnScreen()          // centers the window on the screen
	CenterToWindow(hWnd HWND) // centers the window relative to the specified window

	SetClientSize(width, height int)    // sets the client area size
	SetDluClientSize(width, height int) // sets the client area size using Dialog Units.

	ShowModal()                // shows the top window as a modal dialog
	SetModalResult(result int) // sets the modal result
	GetModalResult() int       // returns the modal result

	GetAccelHandle() win32.HACCEL // returns the handle to the accelerator table

	SetMenuBar(menuBar *MenuBar)         // sets the menu bar
	SetMenuHelpUI(menuHelpUI MenuHelpUI) // sets the menu help UI

	SetAccelerators(accelTable *AcceleratorTable) // sets the accelerator table

	AsTopWindowObject() *TopWindowObject // returns the underlying TopWindowObject
	// contains filtered or unexported methods
}

TopWindow is an interface that represents a top level window, which can hold other controls and manage their layout.

type TopWindowInterface

type TopWindowInterface interface {
	TopWindow
	TopWindowSpi
}

TopWindowInterface is a composition of TopWindow and TopWindowSpi

type TopWindowObject

type TopWindowObject struct {

	// ContainerObject is the parent struct.
	ContainerObject

	// NameAwareSupport is the NameAware implementation
	NameAwareSupport
	// contains filtered or unexported fields
}

TopWindowObject implements the TopWindowInterface It extends ContainerObject.

func (*TopWindowObject) AsTopWindowObject

func (this *TopWindowObject) AsTopWindowObject() *TopWindowObject

func (*TopWindowObject) CenterOnScreen

func (this *TopWindowObject) CenterOnScreen()

func (*TopWindowObject) CenterToWindow

func (this *TopWindowObject) CenterToWindow(hWnd HWND)

func (*TopWindowObject) Close

func (this *TopWindowObject) Close()

func (*TopWindowObject) Create

func (this *TopWindowObject) Create(options WindowOptions) error

func (*TopWindowObject) Dispose

func (this *TopWindowObject) Dispose()

func (*TopWindowObject) EnsureClassRegistered

func (this *TopWindowObject) EnsureClassRegistered()

func (*TopWindowObject) GetAccelHandle

func (this *TopWindowObject) GetAccelHandle() win32.HACCEL

func (*TopWindowObject) GetContainer

func (this *TopWindowObject) GetContainer() Container

func (*TopWindowObject) GetModalResult

func (this *TopWindowObject) GetModalResult() int

func (*TopWindowObject) GetRootContainer

func (this *TopWindowObject) GetRootContainer() Container

func (*TopWindowObject) GetTitle

func (this *TopWindowObject) GetTitle() string

func (*TopWindowObject) GetWindowClass

func (this *TopWindowObject) GetWindowClass() string

func (*TopWindowObject) Init

func (this *TopWindowObject) Init()

func (*TopWindowObject) IsChild

func (this *TopWindowObject) IsChild() bool

func (*TopWindowObject) OnCommand

func (this *TopWindowObject) OnCommand(msg *CommandMessage)

func (*TopWindowObject) OnMenuCommand

func (this *TopWindowObject) OnMenuCommand(wParam WPARAM, lParam LPARAM)

func (*TopWindowObject) OnSize

func (this *TopWindowObject) OnSize(width, height int)

func (*TopWindowObject) PostCreate

func (this *TopWindowObject) PostCreate(opts *WindowOptions)

func (*TopWindowObject) PostShow

func (this *TopWindowObject) PostShow()

func (*TopWindowObject) PreCreate

func (this *TopWindowObject) PreCreate(opts *WindowOptions)

func (*TopWindowObject) SetAccelerators

func (this *TopWindowObject) SetAccelerators(accelTable *AcceleratorTable)

func (*TopWindowObject) SetClientSize

func (this *TopWindowObject) SetClientSize(width, height int)

func (*TopWindowObject) SetDluClientSize

func (this *TopWindowObject) SetDluClientSize(width, height int)

func (*TopWindowObject) SetMenuBar

func (this *TopWindowObject) SetMenuBar(menuBar *MenuBar)

func (*TopWindowObject) SetMenuHelpUI

func (this *TopWindowObject) SetMenuHelpUI(menuHelpUI MenuHelpUI)

func (*TopWindowObject) SetModalResult

func (this *TopWindowObject) SetModalResult(result int)

func (*TopWindowObject) SetTitle

func (this *TopWindowObject) SetTitle(title string)

func (*TopWindowObject) ShowModal

func (this *TopWindowObject) ShowModal()

func (*TopWindowObject) WinProc

func (this *TopWindowObject) WinProc(winObj *WindowObject, m *Message) error

type TopWindowSpi

type TopWindowSpi interface {
	WindowSpi
	OnMenuCommand(wParam WPARAM, lParam LPARAM)
}

TopWindowSpi is an interface that provides additional methods specific to implementing a TopWindow.

type TrayIcon

type TrayIcon struct {
	Icon        win32.HICON
	Tooltip     string
	ContextMenu *PopupMenu
	// contains filtered or unexported fields
}

func NewTrayIcon

func NewTrayIcon(icon win32.HICON, tooltip string) *TrayIcon

func (*TrayIcon) Create

func (this *TrayIcon) Create(visible bool)

func (*TrayIcon) Hide

func (this *TrayIcon) Hide()

func (*TrayIcon) Remove

func (this *TrayIcon) Remove()

func (*TrayIcon) Show

func (this *TrayIcon) Show()

type TreeItem

type TreeItem struct {
	Id            int
	ParentId      int
	Image         int
	SelectedImage int
	Text          string
	HasChild      bool
	Expanded      bool
}

type TreeNode

type TreeNode struct {
	Id            int
	Text          string
	Image         int
	SelectedImage int
	Children      []TreeNode
	Expanded      bool
}

type TreeView

type TreeView interface {
	Control

	UseDefaultNodeImages()
	AddIdTextNodes(nodes []IdTextNode)
	GetNoScrollSize() (int, int)

	GetSelectedItem() win32.HTREEITEM
	GetSelectedId() int
	GetSelectedText() string
	SetSelectedId(id int)
	GetItemIdAtCursor() int

	IsLeaf(hItem win32.HTREEITEM) bool

	GetOnNodeDblClick() *SimpleEvent
	GetOnSelectionChange() *ExtraEvent

	ExpandAll()
	TreeViewObj() *TreeViewObject

	AddNode(node TreeNode) int
	AddNodes(nodes ...TreeNode) []int
	AddChildNode(parentId int, node TreeNode) int

	AddItem(item TreeItem) int
	AddItems(items []TreeItem)
	ClearItems()
}

type TreeViewObject

type TreeViewObject struct {
	ControlObject

	Checkable                bool
	DefaultNodeImage         int
	DefaultNodeSelectedImage int

	NoLines       bool
	NoLinesAtRoot bool
	NoButtons     bool

	LazyChildrenLoadCallback func(parentId int) []TreeItem

	OnNodeDblClick    SimpleEvent
	OnRightClick      SimpleEvent
	OnSelectionChange ExtraEvent

	//LoadingLazyChildren bool
	LazyExpandingItems map[win32.HTREEITEM]bool
	// contains filtered or unexported fields
}

func NewTreeViewObject

func NewTreeViewObject() *TreeViewObject

func (*TreeViewObject) AddChildIdTextNode

func (this *TreeViewObject) AddChildIdTextNode(parentId int, node IdTextNode)

func (*TreeViewObject) AddChildNode

func (this *TreeViewObject) AddChildNode(parentId int, node TreeNode) int

func (*TreeViewObject) AddChildTextNode

func (this *TreeViewObject) AddChildTextNode(parentId int, node TextNode)

func (*TreeViewObject) AddIdTextNode

func (this *TreeViewObject) AddIdTextNode(node IdTextNode)

func (*TreeViewObject) AddIdTextNodes

func (this *TreeViewObject) AddIdTextNodes(nodes []IdTextNode)

func (*TreeViewObject) AddItem

func (this *TreeViewObject) AddItem(item TreeItem) int

return id

func (*TreeViewObject) AddItems

func (this *TreeViewObject) AddItems(items []TreeItem)

func (*TreeViewObject) AddNode

func (this *TreeViewObject) AddNode(node TreeNode) int

func (*TreeViewObject) AddNodes

func (this *TreeViewObject) AddNodes(nodes ...TreeNode) []int

func (*TreeViewObject) AddTextNode

func (this *TreeViewObject) AddTextNode(node TextNode)

func (*TreeViewObject) AddTextNodes

func (this *TreeViewObject) AddTextNodes(nodes []TextNode)

func (*TreeViewObject) ClearItems

func (this *TreeViewObject) ClearItems()

func (*TreeViewObject) Create

func (this *TreeViewObject) Create(options WindowOptions) error

func (*TreeViewObject) Dispose

func (this *TreeViewObject) Dispose()

func (*TreeViewObject) ExpandAll

func (this *TreeViewObject) ExpandAll()

func (*TreeViewObject) ExpandItem

func (this *TreeViewObject) ExpandItem(hItem win32.HTREEITEM)

func (*TreeViewObject) GenId

func (this *TreeViewObject) GenId() int

func (*TreeViewObject) GetChildItems

func (this *TreeViewObject) GetChildItems(
	hParentItem win32.HTREEITEM) []win32.HTREEITEM

func (*TreeViewObject) GetControlSpecStyle

func (this *TreeViewObject) GetControlSpecStyle() (WINDOW_STYLE, WINDOW_STYLE)

func (*TreeViewObject) GetDefaultExStyle

func (this *TreeViewObject) GetDefaultExStyle() WINDOW_EX_STYLE

func (*TreeViewObject) GetItem

func (this *TreeViewObject) GetItem(id int) win32.HTREEITEM

func (*TreeViewObject) GetItemCheckState

func (this *TreeViewObject) GetItemCheckState(hItem win32.HTREEITEM) int

func (*TreeViewObject) GetItemId

func (this *TreeViewObject) GetItemId(hItem win32.HTREEITEM) int

func (*TreeViewObject) GetItemIdAtCursor

func (this *TreeViewObject) GetItemIdAtCursor() int

func (*TreeViewObject) GetItemText

func (this *TreeViewObject) GetItemText(hItem win32.HTREEITEM) string

func (*TreeViewObject) GetItemsCheckState

func (this *TreeViewObject) GetItemsCheckState(hItems []win32.HTREEITEM) int

func (*TreeViewObject) GetNextItem

func (this *TreeViewObject) GetNextItem(hItem win32.HTREEITEM) win32.HTREEITEM

func (*TreeViewObject) GetNoScrollSize

func (this *TreeViewObject) GetNoScrollSize() (int, int)

func (*TreeViewObject) GetOnNodeDblClick

func (this *TreeViewObject) GetOnNodeDblClick() *SimpleEvent

func (*TreeViewObject) GetOnSelectionChange

func (this *TreeViewObject) GetOnSelectionChange() *ExtraEvent

func (*TreeViewObject) GetParentId

func (this *TreeViewObject) GetParentId(id int) int

func (*TreeViewObject) GetParentItem

func (this *TreeViewObject) GetParentItem(id int) win32.HTREEITEM

?

func (*TreeViewObject) GetPathIds

func (this *TreeViewObject) GetPathIds(id int) []int

func (*TreeViewObject) GetPrevItem

func (this *TreeViewObject) GetPrevItem(hItem win32.HTREEITEM) win32.HTREEITEM

func (*TreeViewObject) GetSelectedId

func (this *TreeViewObject) GetSelectedId() int

func (*TreeViewObject) GetSelectedItem

func (this *TreeViewObject) GetSelectedItem() win32.HTREEITEM

func (*TreeViewObject) GetSelectedText

func (this *TreeViewObject) GetSelectedText() string

func (*TreeViewObject) GetText

func (this *TreeViewObject) GetText(id int) string

func (*TreeViewObject) GetWindowClass

func (this *TreeViewObject) GetWindowClass() string

func (*TreeViewObject) Init

func (this *TreeViewObject) Init()

func (*TreeViewObject) IsLeaf

func (this *TreeViewObject) IsLeaf(hItem win32.HTREEITEM) bool

func (*TreeViewObject) IsParent

func (this *TreeViewObject) IsParent(id int) bool

func (*TreeViewObject) LoadLazyChildItems

func (this *TreeViewObject) LoadLazyChildItems(parentId int) []TreeItem

func (*TreeViewObject) OnReflectNotify

func (this *TreeViewObject) OnReflectNotify(msg *NotifyMessage)

func (*TreeViewObject) SetImageList

func (this *TreeViewObject) SetImageList(iml *ImageList)

func (*TreeViewObject) SetItemCheckState

func (this *TreeViewObject) SetItemCheckState(hItem win32.HTREEITEM, state int)

func (*TreeViewObject) SetItemNoChildren

func (this *TreeViewObject) SetItemNoChildren(hItem win32.HTREEITEM)

func (*TreeViewObject) SetSelectedId

func (this *TreeViewObject) SetSelectedId(id int)

func (*TreeViewObject) SetSelectedItem

func (this *TreeViewObject) SetSelectedItem(hItem win32.HTREEITEM)

func (*TreeViewObject) TreeViewObj

func (this *TreeViewObject) TreeViewObj() *TreeViewObject

func (*TreeViewObject) UseDefaultNodeImages

func (this *TreeViewObject) UseDefaultNodeImages()

type TreeViewSpi

type TreeViewSpi interface {
	ControlSpi

	LoadLazyChildItems(parentId int) []TreeItem
}

type UidGen

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

func NewUidGen

func NewUidGen(initId int, step int) *UidGen

func (*UidGen) Gen

func (this *UidGen) Gen() int

func (*UidGen) IsGenerated

func (this *UidGen) IsGenerated(id int) bool

func (*UidGen) Recycle

func (this *UidGen) Recycle(uid int)

func (*UidGen) Reset

func (this *UidGen) Reset()

type VisibleAware

type VisibleAware interface {
	SetVisible(visible bool)
	GetVisible() bool
}

type WIN32_ERROR

type WIN32_ERROR = win32.WIN32_ERROR

func SendMessage

func SendMessage[T_WPARAM, T_LPARAM types.PtrCompatible](
	hWnd HWND, Msg uint32, wParam T_WPARAM, lParam T_LPARAM) (uintptr, WIN32_ERROR)

type WINDOW_EX_STYLE

type WINDOW_EX_STYLE = win32.WINDOW_EX_STYLE

type WINDOW_STYLE

type WINDOW_STYLE = win32.WINDOW_STYLE
var DefaultControlStyle WINDOW_STYLE = win32.WS_CHILD | win32.WS_VISIBLE | win32.WS_TABSTOP

DefaultControlStyle is the default window style for controls.

type WPARAM

type WPARAM = win32.WPARAM

type WaitCursor

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

func NewWaitCursor

func NewWaitCursor() WaitCursor

func (WaitCursor) Restore

func (me WaitCursor) Restore()

func (WaitCursor) Update

func (me WaitCursor) Update()

type WinProcFunc

type WinProcFunc func(win *WindowObject, msg *Message) error

type WinProcProvider

type WinProcProvider interface {
	// WinProc processes messages targeting the window object
	WinProc(win *WindowObject, m *Message) error
}

WinProcProvider wraps the WinProc method

type Window

type Window interface {
	virtual.Virtual
	types.LifecycleAware
	types.DataAware
	EnabledAware
	VisibleAware
	FocusAware
	FontAware
	BackColorAware
	ContextMenuAware
	BoundsAware
	PosAware
	SizeAware
	MsgEventSource

	// GetHandle returns the win32 handle of the window.
	GetHandle() HWND

	// Show displays the window.
	Show()

	// Hide hides the window.
	Hide()

	// IsVisible checks whether the window is visible
	IsVisible() bool

	// Invalidate adds all the window's client area to the update region
	Invalidate()

	// Update causes an immediate redraw on the update region
	Update()

	// GetPreferredSize returns the preferred size of the window
	// given the maximum width and height.
	GetPreferredSize(maxWidth int, maxHeight int) (int, int)

	// AutoSize adjusts the size of the window to fit its contents,
	// using the maximum size provided if available.
	AutoSize(maxSize ...Size)

	// GetClientSize returns the width and height of the client area of the window.
	GetClientSize() (cx, cy int)

	// GetDpiClientSize returns the width and height of
	// the client area of the window, adjusted for DPI scaling.
	GetDpiClientSize() (cx, cy int)

	// SetDluBounds sets the size and position of the control using dialog units.
	SetDluBounds(left, top, width, height int)

	// GetParentHandle returns the handle of the parent window.
	GetParentHandle() HWND

	// Contains checks if the hWnd is the handle of a window contained in this window.
	// The contained window is either a direct child or a deeper descendant window.
	Contains(hWnd win32.HWND) bool

	// GetParent returns the parent window of this window.
	GetParent() Window

	// GetRootWindow returns the root window that contains the current window.
	GetRootWindow() Window

	// GetStyle returns the window style.
	GetStyle() WINDOW_STYLE

	// GetExStyle returns the extended window style.
	GetExStyle() WINDOW_EX_STYLE

	// ModifyStyle modifies the window style using the provided style flags.
	// A style with value 0 is equivalent to the current style.
	ModifyStyle(style, styleInclude, styleExclude win32.WINDOW_STYLE)

	// IsChild returns true if the window is a child window.
	IsChild() bool

	// Create creates the window with the specified options.
	Create(options WindowOptions) error

	// GetOnCreate returns the event that is triggered when the window is created.
	GetOnCreate() *SimpleEvent

	// Refresh redraws the window.
	Refresh()

	// AddDisposeAction adds an action to be executed when the window is disposed.
	AddDisposeAction(action Action)

	// AsWindowObject returns the underlying WindowObject.
	AsWindowObject() *WindowObject

	// AddMessageProcessor adds a message processor to handle incoming messages.
	AddMessageProcessor(processor MessageProcessor)

	// RemoveMessageProcessor removes a message processor.
	RemoveMessageProcessor(processor MessageProcessor)
}

Window is an interface that represents a graphical window, it exposes the common functionalities for Win32 windows.

func GetActiveWin

func GetActiveWin() Window

func GetTopWindows

func GetTopWindows() []Window

type WindowCenter

type WindowCenter int
const (
	CenterNone   WindowCenter = 0
	CenterScreen WindowCenter = 1
	CenterParent WindowCenter = 2
)

type WindowFlag

type WindowFlag uint32
const (
	FlagPreDisposed WindowFlag = 0x02 // PreDispose has been called
	FlagDisposed    WindowFlag = 0x04 // Dispose has been called
	FlagCollapsed   WindowFlag = 0x08 // collapsed in layout
	FlagDesignMode  WindowFlag = 0x10 // in design mode
)

Window flags

type WindowInterface

type WindowInterface interface {
	Window
	WindowSpi
}

WindowInterface is the interface that combines Window and WindowSpi

func GetWindow

func GetWindow(hWnd HWND) WindowInterface

type WindowObject

type WindowObject struct {

	// VirtualObject is the parent struct.
	virtual.VirtualObject[WindowInterface]

	// Handle is the underlying win32 window handle.
	Handle HWND

	// OnCreateEvent is fired after win32 window handle is created.
	OnCreateEvent SimpleEvent

	// WinProcFunc optionally specifies a function that
	// provide a custom WinProc implementation.
	WinProcFunc WinProcFunc
	// contains filtered or unexported fields
}

WindowObject implements the WindowInterface. It extends VirtualObject.

func NewWindowObject

func NewWindowObject() *WindowObject

NewWindowObject creates a new WindowObject.

func (*WindowObject) AddDisposeAction

func (this *WindowObject) AddDisposeAction(action Action)

AddDisposeAction implements Window.AddDisposeAction

func (*WindowObject) AddMessageProcessor

func (this *WindowObject) AddMessageProcessor(processor MessageProcessor)

AddMessageProcessor implements Window.AddMessageProcessor

func (*WindowObject) AsWindowObject

func (this *WindowObject) AsWindowObject() *WindowObject

WindowObject implements Window.WindowObject

func (*WindowObject) Attach

func (this *WindowObject) Attach(hWnd HWND) error

Attach attaches this WindowObject to an existing window handle

func (*WindowObject) AutoSize

func (this *WindowObject) AutoSize(optMaxSize ...Size)

AutoSize implements Window.AutoSize

func (*WindowObject) CallDefaultWndProc

func (this *WindowObject) CallDefaultWndProc(msg *Message) error

CallDefaultWndProc implements WindowSpi.CallDefaultWndProc

func (*WindowObject) CallOriWndProc

func (this *WindowObject) CallOriWndProc(msg *Message) error

CallOriWndProc calls the original or default window procedure

func (*WindowObject) Contains

func (this *WindowObject) Contains(hWnd win32.HWND) bool

Contains implements Window.Contains

func (*WindowObject) ContainsFocus

func (this *WindowObject) ContainsFocus() bool

ContainsFocus checks whether this window has focus or contains the focused window handle

func (*WindowObject) Create

func (this *WindowObject) Create(options WindowOptions) error

Create implements Window.Create

func (*WindowObject) CreateHandle

func (this *WindowObject) CreateHandle(
	className string, options WindowOptions) (HWND, error)

CreateHandle implements WindowSpi.CreateHandle

func (*WindowObject) Destroy

func (this *WindowObject) Destroy()

Destroy destroys the Win32 window and disposes this WindowObject

func (*WindowObject) Detach

func (this *WindowObject) Detach() error

Detach detaches this WindowObject from its window handle

func (*WindowObject) Dispose

func (this *WindowObject) Dispose()

Dispose implements Window.Dispose

func (*WindowObject) DluToPx

func (this *WindowObject) DluToPx(x, y int) (int, int)

DluToPx converts x, y in dialog units to pixel values

func (*WindowObject) EnsureClassRegistered

func (this *WindowObject) EnsureClassRegistered()

EnsureClassRegistered implements WindowSpi.EnsureClassRegistered

func (*WindowObject) EnsureCustomWndProc

func (this *WindowObject) EnsureCustomWndProc()

EnsureCustomWndProc implements WindowSpi.EnsureCustomWndProc

func (*WindowObject) FireMsgEvent

func (this *WindowObject) FireMsgEvent(msg *Message) bool

FireMsgEvent fires the event for the specified window message and returns whether it's been handled

func (*WindowObject) Focus

func (this *WindowObject) Focus()

Focus implements Window.FocusFocus

func (*WindowObject) GetBackColor

func (this *WindowObject) GetBackColor() drawing.Color

GetBackColor implements Window.GetBackColor

func (*WindowObject) GetBounds

func (this *WindowObject) GetBounds() Rect

GetBounds implements Window.GetBounds

func (*WindowObject) GetClientSize

func (this *WindowObject) GetClientSize() (cx, cy int)

GetClientSize implements Window.GetClientSize

func (*WindowObject) GetClientSize32

func (this *WindowObject) GetClientSize32() (cx, cy int32)

func (*WindowObject) GetContextMenu

func (this *WindowObject) GetContextMenu() *PopupMenu

GetContextMenu implements Window.GetContextMenu

func (*WindowObject) GetData

func (this *WindowObject) GetData(key string) any

GetData implements Window.GetData

func (*WindowObject) GetDefaultExStyle

func (this *WindowObject) GetDefaultExStyle() WINDOW_EX_STYLE

GetDefaultExStyle implements WindowSpi.GetDefaultExStyle

func (*WindowObject) GetDefaultStyle

func (this *WindowObject) GetDefaultStyle() WINDOW_STYLE

GetDefaultStyle implements WindowSpi.GetDefaultStyle

func (*WindowObject) GetDpiClientSize

func (this *WindowObject) GetDpiClientSize() (cx, cy int)

GetDpiClientSize implements Window.GetDpiClientSize

func (*WindowObject) GetDpiPos

func (this *WindowObject) GetDpiPos() (x, y int)

GetDpiPos implements Window.GetDpiPos

func (*WindowObject) GetDpiSize

func (this *WindowObject) GetDpiSize() (cx, cy int)

GetDpiSize implements Window.GetDpiSize

func (*WindowObject) GetEnabled

func (this *WindowObject) GetEnabled() bool

GetEnabled implements Window.GetEnabled

func (*WindowObject) GetEvent

func (this *WindowObject) GetEvent(uMsg uint32) *MsgEvent

GetEvent implements Window.GetEvent

func (*WindowObject) GetExStyle

func (this *WindowObject) GetExStyle() WINDOW_EX_STYLE

GetExStyle implements Window.GetExStyle

func (*WindowObject) GetFont

func (this *WindowObject) GetFont() *gdi.Font

GetFont implements Window.GetFont

func (*WindowObject) GetHandle

func (this *WindowObject) GetHandle() HWND

GetHandle implements Window.GetHandle

func (*WindowObject) GetOnCreate

func (this *WindowObject) GetOnCreate() *SimpleEvent

GetOnCreate implements Window.GetOnCreate

func (*WindowObject) GetParent

func (this *WindowObject) GetParent() Window

GetParent implements Window.GetParent

func (*WindowObject) GetParentHandle

func (this *WindowObject) GetParentHandle() HWND

GetParentHandle implements Window.GetParentHandle

func (*WindowObject) GetPos

func (this *WindowObject) GetPos() (x, y int)

GetPos implements Window.GetPos

func (*WindowObject) GetPreferredSize

func (this *WindowObject) GetPreferredSize(cxMax int, cyMax int) (int, int)

GetPreferredSize implements Window.GetPreferredSize

func (*WindowObject) GetRootHandle

func (this *WindowObject) GetRootHandle() HWND

GetRootHandle returns the handle of the root ancestor windows of this window

func (*WindowObject) GetRootWindow

func (this *WindowObject) GetRootWindow() Window

GetRootWindow implements Window.GetRootWindow

func (*WindowObject) GetSize

func (this *WindowObject) GetSize() (cx, cy int)

GetSize implements Window.GetSize

func (*WindowObject) GetStyle

func (this *WindowObject) GetStyle() WINDOW_STYLE

GetStyle implements Window.GetStyle

func (*WindowObject) GetVisible

func (this *WindowObject) GetVisible() bool

GetVisible implements Window.GetVisible

func (*WindowObject) GetWindowClass

func (this *WindowObject) GetWindowClass() string

GetWindowClass implements WindowSpi.GetWindowClass

func (*WindowObject) HasFlag

func (this *WindowObject) HasFlag(flag WindowFlag) bool

HasFlag checks if the window has the specified flag

func (*WindowObject) HasFocus

func (this *WindowObject) HasFocus() bool

HasFocus implements Window.HasFocus

func (*WindowObject) Hide

func (this *WindowObject) Hide()

Hide implements Window.Hide

func (*WindowObject) Init

func (this *WindowObject) Init()

Init implements Window.Init

func (*WindowObject) Invalidate

func (this *WindowObject) Invalidate()

Invalidate implements Window.Invalidate

func (*WindowObject) IsChild

func (this *WindowObject) IsChild() bool

IsChild implements Window.IsChild

func (*WindowObject) IsVisible

func (this *WindowObject) IsVisible() bool

IsVisible implements Window.IsVisible

func (*WindowObject) ModifyStyle

func (this *WindowObject) ModifyStyle(style, styleInclude, styleExclude win32.WINDOW_STYLE)

ModifyStyle implements Window.ModifyStyle

func (*WindowObject) OnHandleCreated

func (this *WindowObject) OnHandleCreated()

OnHandleCreated implements WindowSpi.OnHandleCreated

func (*WindowObject) OnParentResized

func (this *WindowObject) OnParentResized()

OnParentResized implements WindowSpi.OnParentResized

func (*WindowObject) OnReflectCommand

func (this *WindowObject) OnReflectCommand(info *CommandMessage)

OnReflectCommand implements WindowSpi.OnReflectCommand

func (*WindowObject) OnReflectMessage

func (this *WindowObject) OnReflectMessage(msg *Message)

OnReflectMessage implements WindowSpi.OnReflectMessage

func (*WindowObject) OnReflectNotify

func (this *WindowObject) OnReflectNotify(info *NotifyMessage)

OnReflectNotify implements WindowSpi.OnReflectNotify

func (*WindowObject) OnSize

func (this *WindowObject) OnSize(width, height int)

OnSize implements WindowSpi.OnSize

func (*WindowObject) PostCreate

func (this *WindowObject) PostCreate(opts *WindowOptions)

PostCreate implements WindowSpi.PostCreate

func (*WindowObject) PostShow

func (this *WindowObject) PostShow()

PostShow implements WindowSpi.PostShow

func (*WindowObject) PreCreate

func (this *WindowObject) PreCreate(opts *WindowOptions)

PreCreate implements WindowSpi.PreCreate

func (*WindowObject) PreDispose

func (this *WindowObject) PreDispose()

PreDispose implements WindowSpi.PreDispose

func (*WindowObject) PreProcessMsg

func (this *WindowObject) PreProcessMsg(msg *win32.MSG) bool

PreProcessMsg implements WindowSpi.PreProcessMsg

func (*WindowObject) PreShow

func (this *WindowObject) PreShow()

PreShow implements WindowSpi.PreShow

func (*WindowObject) PxToDlu

func (this *WindowObject) PxToDlu(x, y int) (int, int)

PxToDlu converts x, y in pixels to dialog units

func (*WindowObject) Refresh

func (this *WindowObject) Refresh()

Refresh implements Window.Refresh

func (*WindowObject) RemoveMessageProcessor

func (this *WindowObject) RemoveMessageProcessor(processor MessageProcessor)

RemoveMessageProcessor implements Window.RemoveMessageProcessor

func (*WindowObject) SetBackColor

func (this *WindowObject) SetBackColor(color drawing.Color)

SetBackColor implements Window.SetBackColor

func (*WindowObject) SetBounds

func (this *WindowObject) SetBounds(left, top, width, height int)

SetBounds implements Window.SetBounds

func (*WindowObject) SetContextMenu

func (this *WindowObject) SetContextMenu(menu *PopupMenu)

SetContextMenu implements Window.SetContextMenu

func (*WindowObject) SetData

func (this *WindowObject) SetData(key string, value any)

SetData implements Window.SetData

func (*WindowObject) SetDluBounds

func (this *WindowObject) SetDluBounds(left, top, width, height int)

SetDluBounds implements Window.SetDluBounds.

func (*WindowObject) SetDpiPos

func (this *WindowObject) SetDpiPos(x int, y int)

SetDpiPos implements Window.SetDpiPos

func (*WindowObject) SetDpiSize

func (this *WindowObject) SetDpiSize(cx int, cy int)

SetDpiSize implements Window.SetDpiSize

func (*WindowObject) SetEnabled

func (this *WindowObject) SetEnabled(enabled bool)

SetEnabled implements Window.SetEnabled

func (*WindowObject) SetFlag

func (this *WindowObject) SetFlag(flag WindowFlag, set bool)

SetFlag sets or unsets the specified WindowFlag of the window.

func (*WindowObject) SetFont

func (this *WindowObject) SetFont(font *gdi.Font)

SetFont implements Window.SetFont

func (*WindowObject) SetPos

func (this *WindowObject) SetPos(x int, y int)

SetPos implements Window.SetPos

func (*WindowObject) SetSize

func (this *WindowObject) SetSize(cx int, cy int)

SetSize implements Window.SetSize

func (*WindowObject) SetVisible

func (this *WindowObject) SetVisible(visible bool)

SetVisible implements Window.SetVisible

func (*WindowObject) Show

func (this *WindowObject) Show()

Show implements Window.Show

func (*WindowObject) TryGetEvent

func (this *WindowObject) TryGetEvent(uMsg uint32) (*MsgEvent, bool)

TryGetEvent implements Window.TryGetEvent

func (*WindowObject) Update

func (this *WindowObject) Update()

Update implements Window.Update

type WindowOptions

type WindowOptions struct {
	//WinProcFunc WndProcFunc
	ClassName      string
	WindowName     string
	ParentHandle   HWND
	HMENU          win32.HMENU
	Style          WINDOW_STYLE
	StyleInclude   WINDOW_STYLE
	StyleExclude   WINDOW_STYLE
	ExStyle        WINDOW_EX_STYLE
	ExStyleExclude WINDOW_EX_STYLE
	ExStyleInclude WINDOW_EX_STYLE
	Width          int
	Height         int
	Left           int
	Top            int
	ControlId      uint16
}

type WindowSpi

type WindowSpi interface {

	// GetWindowClass returns the class name of the window.
	GetWindowClass() string

	// GetDefaultStyle returns the default window style.
	GetDefaultStyle() WINDOW_STYLE

	// GetDefaultExStyle returns the default extended window style.
	GetDefaultExStyle() WINDOW_EX_STYLE

	// EnsureClassRegistered ensures that the window class is registered.
	EnsureClassRegistered()

	// EnsureCustomWndProc ensures that the custom window procedure is set up.
	EnsureCustomWndProc()

	// OnHandleCreated is called when the window handle is created.
	OnHandleCreated()

	// CreateHandle creates a win32 window with the specified class name and options.
	CreateHandle(className string, options WindowOptions) (HWND, error)

	// OnReflectMessage processes notification messages of this window
	// that are sent to its parent window,
	OnReflectMessage(msg *Message)

	// OnReflectCommand processes the WM_COMMAND reflection message.
	OnReflectCommand(msg *CommandMessage)

	// OnReflectNotify processes the WM_NOTIFY reflection message.
	OnReflectNotify(msg *NotifyMessage)

	// PreCreate is called before the win32 window is created.
	PreCreate(opts *WindowOptions)

	// PreDispose is called before the win32 window is destroyed.
	PreDispose()

	// PostCreate is called after the win32 window is created.
	PostCreate(opts *WindowOptions)

	// PreShow is called before showing the window.
	PreShow() //?first

	// PostShow is called after the window is shown.
	PostShow()

	// OnSize is called after calling SetSize or SetBounds
	OnSize(width, height int)

	// PreProcessMsg is called before processing a window message.
	// Return true to mark the message as handled.
	PreProcessMsg(msg *win32.MSG) bool

	// CallDefaultWndProc calls the default window procedure for processing a message.
	CallDefaultWndProc(msg *Message) error
}

WindowSpi is an interface that provides additional methods specific to implementing a window.

type WindowState

type WindowState int
const (
	StateNormal    WindowState = 0
	StateMaximized WindowState = 1
	StateMinimized WindowState = 2
)

type WndProcFunc

type WndProcFunc func(hWnd HWND, uMsg uint32, wParam WPARAM, lParam LPARAM) win32.LRESULT

WndProcFunc is the type of Win32 window procedure function

Directories

Path Synopsis
x

Jump to

Keyboard shortcuts

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