Documentation
¶
Index ¶
- type Control
- type Controls
- type Form
- type FormActiveProc
- type FormParam
- type FormStateProc
- type MsgBox
- type Provider
- type Window
- type WindowCreateProc
- type WindowDestroyProc
- type WindowFocusProc
- type WindowImeStartCompositionProc
- type WindowKeyDownProc
- type WindowKeyPressProc
- type WindowKeyUpProc
- type WindowLostFocusProc
- type WindowMouseClickProc
- type WindowMouseDownProc
- type WindowMouseMoveProc
- type WindowMouseUpProc
- type WindowMouseWheelProc
- type WindowMoveProc
- type WindowPaintProc
- type WindowResizeProc
- type WindowSetCursorProc
- type WindowShowProc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controls ¶
type Controls interface {
Control
AddControl(control Control)
RemoveControl(control Control)
GetChilds() []Control
}
Controls 容器控件接口,可以添加和移除子控件
type Form ¶
type Form interface {
Controls
Close()
ShowDialog()
SetTitle(title string)
SetBorderStyle(style fm.FormBorder)
ShowToMax()
ShowToMin()
/*
允许在无边框模式下调整窗体大小
*/
NoneBorderResize()
Active()
SetMaximizeBox(isShow bool)
SetMinimizeBox(isShow bool)
SetIcon(iconFile string)
SetIconData(iconData []byte)
SetTopMost(isTop bool)
SetOnState(proc FormStateProc) FormStateProc
SetOnActive(proc FormActiveProc) FormActiveProc
}
Form 窗体接口
type Provider ¶
type Provider interface {
RunMain(form Form)
Exit(code int)
SetIcon(file string)
SetIconData(iconData []byte)
SetMinSize(width, height int) // ✅ 设置最小尺寸
GetScreen() f.Screen
ModifierKeys() map[f.Keys]bool
MouseIsDown() map[f.MouseButtons]bool
MouseLocation() f.Point
AppDir() string
NewForm(param FormParam) Form
NewControl() Control
NewMsgBox() MsgBox
}
Provider 平台提供者接口,提供跨平台的窗体和控制功能
type Window ¶
type Window interface {
GetHandle() uintptr
SetOnCreate(proc WindowCreateProc) WindowCreateProc
SetOnDestroy(proc WindowDestroyProc) WindowDestroyProc
SetOnResize(proc WindowResizeProc) WindowResizeProc
SetOnMove(proc WindowMoveProc) WindowMoveProc
SetOnMouseMove(proc WindowMouseMoveProc) WindowMouseMoveProc
SetOnMouseDown(proc WindowMouseDownProc) WindowMouseDownProc
SetOnMouseUp(proc WindowMouseUpProc) WindowMouseUpProc
SetOnMouseWheel(proc WindowMouseWheelProc) WindowMouseWheelProc
SetOnMouseClick(proc WindowMouseClickProc) WindowMouseClickProc
SetOnPaint(proc WindowPaintProc) WindowPaintProc
SetOnKeyDown(proc WindowKeyDownProc) WindowKeyDownProc
SetOnKeyUp(proc WindowKeyUpProc) WindowKeyUpProc
SetOnKeyPress(proc WindowKeyPressProc) WindowKeyPressProc
SetOnCursor(proc WindowSetCursorProc) WindowSetCursorProc
SetOnImeStartComposition(proc WindowImeStartCompositionProc) WindowImeStartCompositionProc
SetOnFocus(proc WindowFocusProc) WindowFocusProc
SetOnLostFocus(proc WindowLostFocusProc) WindowLostFocusProc
SetOnShow(proc WindowShowProc) WindowShowProc
GetProvider() Provider
Invoke(fn func())
InvokeEx(fn func(state interface{}), state interface{})
SetSize(w int, h int)
SetLocation(x int, y int)
GetBound() fm.Bound
Show()
Hide()
SetBgColor(color int32)
CreateGraphics() fm.Graphics
SetCursor(cursor fm.CursorType)
GetCursor() fm.CursorType
GetParent() Control
GetOwner() Form
ToClientPoint(p fm.Point) fm.Point
IsEnable() bool
Enable(b bool)
}
Window 窗口接口,提供窗口的基本操作和事件处理
type WindowImeStartCompositionProc ¶
type WindowImeStartCompositionProc func() bool
WindowImeStartCompositionProc 输入法开始组合回调函数类型
type WindowKeyPressProc ¶
type WindowKeyPressProc func(e *fm.KeyPressEvArgs)
WindowKeyPressProc 按键按下回调函数类型
type WindowMouseClickProc ¶
type WindowMouseClickProc func(e *fm.MouseEvArgs)
WindowMouseClickProc 鼠标点击回调函数类型
type WindowMouseDownProc ¶
type WindowMouseDownProc func(e *fm.MouseEvArgs)
WindowMouseDownProc 鼠标按下回调函数类型
type WindowMouseMoveProc ¶
type WindowMouseMoveProc func(e *fm.MouseEvArgs)
WindowMouseMoveProc 鼠标移动回调函数类型
type WindowMouseUpProc ¶
type WindowMouseUpProc func(e *fm.MouseEvArgs)
WindowMouseUpProc 鼠标释放回调函数类型
type WindowMouseWheelProc ¶
type WindowMouseWheelProc func(e *fm.MouseEvArgs)
WindowMouseWheelProc 鼠标滚轮回调函数类型
Click to show internal directories.
Click to hide internal directories.