gform

package module
v0.0.0-...-6bb9f0d Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2013 License: BSD-3-Clause Imports: 5 Imported by: 53

README

gform is an easy to use Windows GUI toolkit for Go

It provides two approaches to create UI.

1. Pure code.

gform.Init()

mainWindow := gform.NewForm(nil)
mainWindow.SetPos(300, 100)
mainWindow.SetSize(500, 300)
mainWindow.SetCaption("Controls Demo")

btn := gform.NewPushButton(mainWindow)
btn.SetPos(10, 10)
btn.OnLBUp().Bind(btn_onclick)

mainWindow.Show()

gform.RunMainLoop()

2. Create dialog in resource file and attach to it.

gform.Init()

dialog := gform.NewDialogFromResId(nil, 101) //101 is the resource Id.
dialog.Center()
dialog.Show()

edt = gform.AttachEdit(dialog, 1000)
edt.SetCaption("Hello")

btn := gform.AttachPushButton(dialog, 2)
btn.OnLBDown().Attach(onclick)

gform.RunMainLoop()

Event handling

gform provides two approaches to handle event. For most commonly used events, convenient event handler is introduced. To handle windows message directly, "Bind" mechanism is introduce.

1. Convenient event handler.

These kind of event handler follows the same naming convention, "OnSomething".

btn.OnLBUp().Bind(btn_onclick) //LB means Left Button.
btn.OnMBUp //MB means middle button
btn.OnKillFocus
btn.OnDropFiles
...

If you bind two methods for one event, the first bind will be overwritten by later bind. E.g.

btn.OnLBUp().Bind(btn_onclick1)
btn.OnLBUp().Bind(btn_onclick2)

Only "btn_onclick2" will be triggered.

You can also bind "nil" to a event handler, that simply means nothing will be triggered.

2. Raw windows message handler.

It's a common case that we need to handler various windows messages in GUI, and to wrap them all is basically "mission impossible" (and I don't think a GUI framework should do that frankly), so gform leaves the freedom to user. The "Bind" method could bind an event handler directly to a raw windows message. E.g.

btn.Bind(w32.WM_CLIPBOARDUPDATE, btn_onClipboardUpdate)

func btn_onClipboardUpdate(arg *EventArg) {
    sender := arg.Sender()
    if data, ok := arg.Data().(*gform.RawMsg); ok {
        println(data.Hwnd, data.Msg, data.WParam, data.LParam)
    }
}

The event handler uses the same method signature "func(arg *EventArg)", but a new struct named "RawMsg" will be filled to the "data" field of EventArg.

type RawMsg struct {
    Hwnd           w32.HWND
    Msg            uint
    WParam, LParam uintptr
} 

The same with convenient event handler, if you bind two methods for one event, the first bind will be overwritten by later bind. And bind "nil" to a message is allowed.

Setup

  1. Make sure you have a working Go installation and build environment, see more for details from below page. http://golang.org/doc/install

  2. go get github.com/AllenDang/gform

  3. go install github.com/AllenDang/gform

Have fun now!

Recommand Tools

  1. ResEdit - very good tool to edit resource file, strongly recommand! http://www.resedit.net/

  2. windres - tools to compile *.rc file to *.o which makes it is possible to embed resource file into *.exe.

Contribute

Contributions in form of design, code, documentation, bug reporting or other ways you see fit are very welcome.

Thank You!

Documentation

Index

Constants

View Source
const (
	FontBold      byte = 0x01
	FontItalic    byte = 0x02
	FontUnderline byte = 0x04
	FontStrikeOut byte = 0x08
)

Variables

This section is empty.

Functions

func CreateWindow

func CreateWindow(className string, parent Controller, exStyle, style uint) w32.HWND

func Exit

func Exit()

func GetAppInstance

func GetAppInstance() w32.HINSTANCE

func Init

func Init()

func MsgBox

func MsgBox(parent Controller, title, caption string, flags uint) int

func PreTranslateMessage

func PreTranslateMessage(msg *w32.MSG) bool

func RegClassOnlyOnce

func RegClassOnlyOnce(className string)

func RegMsgHandler

func RegMsgHandler(controller Controller)

func RegisterClass

func RegisterClass(className string, wndproc uintptr)

func RunMainLoop

func RunMainLoop() int

func ShowBrowseFolderDlg

func ShowBrowseFolderDlg(parent Controller, title string) (folder string, accepted bool)

func ShowOpenFileDlg

func ShowOpenFileDlg(parent Controller, title, filter string, filterIndex uint, initialDir string) (filePath string, accepted bool)

func ShowSaveFileDlg

func ShowSaveFileDlg(parent Controller, title, filter string, filterIndex uint, initialDir string) (filePath string, accepted bool)

func ToggleExStyle

func ToggleExStyle(hwnd w32.HWND, b bool, style int)

func ToggleStyle

func ToggleStyle(hwnd w32.HWND, b bool, style int)

func UnRegMsgHandler

func UnRegMsgHandler(hwnd w32.HWND)

Types

type Bitmap

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

func NewBitmapFromFile

func NewBitmapFromFile(filepath string, background Color) (*Bitmap, error)

func NewBitmapFromResource

func NewBitmapFromResource(instance w32.HINSTANCE, resName *uint16, resType *uint16, background Color) (*Bitmap, error)

func (*Bitmap) Dispose

func (this *Bitmap) Dispose()

func (*Bitmap) GetHBITMAP

func (this *Bitmap) GetHBITMAP() w32.HBITMAP

func (*Bitmap) Height

func (this *Bitmap) Height() int

func (*Bitmap) Size

func (this *Bitmap) Size() (int, int)

func (*Bitmap) Width

func (this *Bitmap) Width() int

type Brush

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

func NewNullBrush

func NewNullBrush() *Brush

func NewSolidColorBrush

func NewSolidColorBrush(color Color) *Brush

func (*Brush) Dispose

func (this *Brush) Dispose()

func (*Brush) GetHBRUSH

func (this *Brush) GetHBRUSH() w32.HBRUSH

func (*Brush) GetLOGBRUSH

func (this *Brush) GetLOGBRUSH() *w32.LOGBRUSH

type Button

type Button struct {
	W32Control
}

func (*Button) Checked

func (this *Button) Checked() bool

func (*Button) SetChecked

func (this *Button) SetChecked(checked bool)

type Canvas

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

func NewCanvasFromHDC

func NewCanvasFromHDC(hdc w32.HDC) *Canvas

func NewCanvasFromHwnd

func NewCanvasFromHwnd(hwnd w32.HWND) *Canvas

func (*Canvas) Dispose

func (this *Canvas) Dispose()

func (*Canvas) DrawBitmap

func (this *Canvas) DrawBitmap(bmp *Bitmap, x, y int)

func (*Canvas) DrawIcon

func (this *Canvas) DrawIcon(ico *Icon, x, y int) bool

func (*Canvas) DrawRect

func (this *Canvas) DrawRect(rect *Rect, pen *Pen, brush *Brush)

func (*Canvas) DrawStretchedBitmap

func (this *Canvas) DrawStretchedBitmap(bmp *Bitmap, rect *Rect)

func (*Canvas) DrawText

func (this *Canvas) DrawText(text string, rect *Rect, format uint, font *Font, textColor Color)

Refer win32 DrawText document for uFormat.

func (*Canvas) FillRect

func (this *Canvas) FillRect(rect *Rect, brush *Brush)

type CheckBox

type CheckBox struct {
	Button
}

func AttachCheckBox

func AttachCheckBox(parent Controller, id int) *CheckBox

func NewCheckBox

func NewCheckBox(parent Controller) *CheckBox

type Color

type Color uint32

func RGB

func RGB(r, g, b byte) Color

func (Color) B

func (c Color) B() byte

func (Color) G

func (c Color) G() byte

func (Color) R

func (c Color) R() byte

type ControlBase

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

func (*ControlBase) Bind

func (this *ControlBase) Bind(msg uint, handler EventHandler)

func (*ControlBase) BindedHandler

func (this *ControlBase) BindedHandler(msg uint) (EventHandler, bool)

Get binded handlers for specifed message.

func (*ControlBase) Bounds

func (this *ControlBase) Bounds() *Rect

func (*ControlBase) Caption

func (this *ControlBase) Caption() string

func (*ControlBase) ClientRect

func (this *ControlBase) ClientRect() *Rect

func (*ControlBase) Close

func (this *ControlBase) Close()

func (*ControlBase) EnableDragAcceptFiles

func (this *ControlBase) EnableDragAcceptFiles(b bool)

func (*ControlBase) Enabled

func (this *ControlBase) Enabled() bool

func (*ControlBase) Focus

func (this *ControlBase) Focus()

func (*ControlBase) Font

func (this *ControlBase) Font() *Font

func (*ControlBase) Handle

func (this *ControlBase) Handle() w32.HWND

func (*ControlBase) Height

func (this *ControlBase) Height() int

func (*ControlBase) Hide

func (this *ControlBase) Hide()

func (*ControlBase) Invalidate

func (this *ControlBase) Invalidate(erase bool)

func (*ControlBase) InvokeRequired

func (this *ControlBase) InvokeRequired() bool

func (*ControlBase) OnClose

func (this *ControlBase) OnClose() *EventManager

func (*ControlBase) OnCreate

func (this *ControlBase) OnCreate() *EventManager

Events

func (*ControlBase) OnDropFiles

func (this *ControlBase) OnDropFiles() *EventManager

func (*ControlBase) OnKeyUp

func (this *ControlBase) OnKeyUp() *EventManager

func (*ControlBase) OnKillFocus

func (this *ControlBase) OnKillFocus() *EventManager

func (*ControlBase) OnLBDown

func (this *ControlBase) OnLBDown() *EventManager

func (*ControlBase) OnLBUp

func (this *ControlBase) OnLBUp() *EventManager

func (*ControlBase) OnMBDown

func (this *ControlBase) OnMBDown() *EventManager

func (*ControlBase) OnMBUp

func (this *ControlBase) OnMBUp() *EventManager

func (*ControlBase) OnMouseHover

func (this *ControlBase) OnMouseHover() *EventManager

func (*ControlBase) OnMouseLeave

func (this *ControlBase) OnMouseLeave() *EventManager

func (*ControlBase) OnPaint

func (this *ControlBase) OnPaint() *EventManager

func (*ControlBase) OnRBDown

func (this *ControlBase) OnRBDown() *EventManager

func (*ControlBase) OnRBUp

func (this *ControlBase) OnRBUp() *EventManager

func (*ControlBase) OnSetFocus

func (this *ControlBase) OnSetFocus() *EventManager

func (*ControlBase) OnSize

func (this *ControlBase) OnSize() *EventManager

func (*ControlBase) Parent

func (this *ControlBase) Parent() Controller

func (*ControlBase) Pos

func (this *ControlBase) Pos() (x, y int)

func (*ControlBase) PreTranslateMessage

func (this *ControlBase) PreTranslateMessage(msg *w32.MSG) bool

func (*ControlBase) SetCaption

func (this *ControlBase) SetCaption(caption string)

func (*ControlBase) SetEnabled

func (this *ControlBase) SetEnabled(b bool)

func (*ControlBase) SetFont

func (this *ControlBase) SetFont(font *Font)

func (*ControlBase) SetPos

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

func (*ControlBase) SetSize

func (this *ControlBase) SetSize(width, height int)

func (*ControlBase) Show

func (this *ControlBase) Show()

func (*ControlBase) Size

func (this *ControlBase) Size() (width, height int)

func (*ControlBase) Visible

func (this *ControlBase) Visible() bool

func (*ControlBase) Width

func (this *ControlBase) Width() int

type Controller

type Controller interface {
	Caption() string
	Enabled() bool
	Focus()
	Handle() w32.HWND
	Invalidate(erase bool)
	Parent() Controller
	Pos() (x, y int)
	Size() (w, h int)
	Height() int
	Width() int
	Visible() bool
	Bounds() *Rect
	ClientRect() *Rect
	SetCaption(s string)
	SetEnabled(b bool)
	SetPos(x, y int)
	SetSize(w, h int)
	EnableDragAcceptFiles(b bool)
	Show()
	Hide()
	Font() *Font
	SetFont(font *Font)
	InvokeRequired() bool
	PreTranslateMessage(msg *w32.MSG) bool
	WndProc(msg uint, wparam, lparam uintptr) uintptr

	//Bind w32 message to handler function
	Bind(msg uint, handler EventHandler)
	BindedHandler(msg uint) (EventHandler, bool)

	//General events
	OnCreate() *EventManager
	OnClose() *EventManager

	// Focus events
	OnKillFocus() *EventManager
	OnSetFocus() *EventManager

	//Drag and drop events
	OnDropFiles() *EventManager

	//Mouse events
	OnLBDown() *EventManager
	OnLBUp() *EventManager
	OnMBDown() *EventManager
	OnMBUp() *EventManager
	OnRBDown() *EventManager
	OnRBUp() *EventManager

	OnMouseHover() *EventManager
	OnMouseLeave() *EventManager

	//Keyboard events
	OnKeyUp() *EventManager

	//Paint events
	OnPaint() *EventManager
	OnSize() *EventManager
}

func GetMsgHandler

func GetMsgHandler(hwnd w32.HWND) Controller

type CustomControl

type CustomControl struct {
	W32Control

	ClassName      string
	ExStyle, Style uint
}

func (*CustomControl) Init

func (this *CustomControl) Init(parent Controller)

func (*CustomControl) WndProc

func (this *CustomControl) WndProc(msg uint32, wparam, lparam uintptr) uintptr

type Dialog

type Dialog struct {
	Form

	Data interface{}
	// contains filtered or unexported fields
}

func NewDialogFromResId

func NewDialogFromResId(parent Controller, resId uint) *Dialog

func (*Dialog) Close

func (this *Dialog) Close(result int)

func (*Dialog) OnCancel

func (this *Dialog) OnCancel() *EventManager

func (*Dialog) OnLoad

func (this *Dialog) OnLoad() *EventManager

Events

func (*Dialog) OnOK

func (this *Dialog) OnOK() *EventManager

func (*Dialog) PreTranslateMessage

func (this *Dialog) PreTranslateMessage(msg *w32.MSG) bool

func (*Dialog) Show

func (this *Dialog) Show()

Public methods

func (*Dialog) ShowModal

func (this *Dialog) ShowModal() int

func (*Dialog) ShowModalWithData

func (this *Dialog) ShowModalWithData(data interface{}) (result int)

func (*Dialog) ShowWithData

func (this *Dialog) ShowWithData(data interface{})

func (*Dialog) WndProc

func (this *Dialog) WndProc(msg uint, wparam, lparam uintptr) uintptr

type DropFilesEventData

type DropFilesEventData struct {
	X, Y  int
	Files []string
}

type Edit

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

func AttachEdit

func AttachEdit(parent Controller, id int) *Edit

func NewEdit

func NewEdit(parent Controller) *Edit

func (*Edit) AddLine

func (this *Edit) AddLine(text string)

func (*Edit) OnChange

func (this *Edit) OnChange() *EventManager

Events

func (*Edit) SetReadOnly

func (this *Edit) SetReadOnly(isReadOnly bool)

Public methods

func (*Edit) WndProc

func (this *Edit) WndProc(msg uint, wparam, lparam uintptr) uintptr

type EventArg

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

func NewEventArg

func NewEventArg(sender Controller, data interface{}) *EventArg

func (*EventArg) Data

func (this *EventArg) Data() interface{}

func (*EventArg) Sender

func (this *EventArg) Sender() Controller

type EventHandler

type EventHandler func(arg *EventArg)

type EventManager

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

func (*EventManager) Bind

func (this *EventManager) Bind(handler EventHandler)

func (*EventManager) Fire

func (this *EventManager) Fire(arg *EventArg)

type Font

type Font struct {
	// contains filtered or unexported fields
}
var (
	GeneralWndprocCallBack = syscall.NewCallback(generalWndProc)
	DefaultFont            *Font
)

Public global variables.

func NewFont

func NewFont(family string, pointSize int, style byte) *Font

func (*Font) Bold

func (this *Font) Bold() bool

func (*Font) Dispose

func (this *Font) Dispose()

func (*Font) Family

func (this *Font) Family() string

func (*Font) GetHFONT

func (this *Font) GetHFONT() w32.HFONT

func (*Font) Italic

func (this *Font) Italic() bool

func (*Font) StrikeOut

func (this *Font) StrikeOut() bool

func (*Font) Style

func (this *Font) Style() byte

func (*Font) Underline

func (this *Font) Underline() bool

type Form

type Form struct {
	ControlBase
	// contains filtered or unexported fields
}

func NewForm

func NewForm(parent Controller) *Form

func (*Form) Center

func (this *Form) Center()

Public methods

func (*Form) EnableDragMove

func (this *Form) EnableDragMove(b bool)

func (*Form) EnableMaxButton

func (this *Form) EnableMaxButton(b bool)

func (*Form) EnableMinButton

func (this *Form) EnableMinButton(b bool)

func (*Form) EnableSizable

func (this *Form) EnableSizable(b bool)

func (*Form) EnableTopMost

func (this *Form) EnableTopMost(b bool)

func (*Form) SetIcon

func (this *Form) SetIcon(iconType int, icon *Icon)

IconType: 1 - ICON_BIG; 0 - ICON_SMALL

func (*Form) WndProc

func (this *Form) WndProc(msg uint, wparam, lparam uintptr) uintptr

type GroupBox

type GroupBox struct {
	Button
}

func AttachGroupBox

func AttachGroupBox(parent Controller, id int) *GroupBox

func NewGroupBox

func NewGroupBox(parent Controller) *GroupBox

type Icon

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

func ExtractIcon

func ExtractIcon(fileName string, index int) (*Icon, error)

func NewIconFromFile

func NewIconFromFile(path string) (*Icon, error)

func NewIconFromResource

func NewIconFromResource(instance w32.HINSTANCE, resId uint16) (*Icon, error)

func (*Icon) Destroy

func (this *Icon) Destroy() bool

func (*Icon) Handle

func (this *Icon) Handle() w32.HICON

type ImageList

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

func NewImageList

func NewImageList(cx, cy int, flags uint, cInitial, cGrow int) *ImageList

func (*ImageList) AddIcon

func (this *ImageList) AddIcon(icon *Icon) int

func (*ImageList) Destroy

func (this *ImageList) Destroy() bool

func (*ImageList) Handle

func (this *ImageList) Handle() w32.HIMAGELIST

func (*ImageList) ImageCount

func (this *ImageList) ImageCount() int

func (*ImageList) Remove

func (this *ImageList) Remove(i int) bool

func (*ImageList) RemoveAll

func (this *ImageList) RemoveAll() bool

func (*ImageList) SetImageCount

func (this *ImageList) SetImageCount(uNewCount uint) bool

type KeyUpEventData

type KeyUpEventData struct {
	VKey, Code int
}

type LVDBLClickEventData

type LVDBLClickEventData struct {
	NmItem *w32.NMITEMACTIVATE
}

type LVEndLabelEditEventData

type LVEndLabelEditEventData struct {
	Item *w32.LVITEM
}

type Label

type Label struct {
	W32Control
}

func AttachLabel

func AttachLabel(parent Controller, id int) *Label

func NewLabel

func NewLabel(parent Controller) *Label

type ListView

type ListView struct {
	W32Control
	// contains filtered or unexported fields
}

func AttachListView

func AttachListView(parent Controller, id int) *ListView

func NewListView

func NewListView(parent Controller) *ListView

func (*ListView) AddItem

func (this *ListView) AddItem(text ...string)

func (*ListView) DeleteAllItems

func (this *ListView) DeleteAllItems() bool

func (*ListView) EnableDoubleBuffer

func (this *ListView) EnableDoubleBuffer(enable bool)

func (*ListView) EnableEditLabels

func (this *ListView) EnableEditLabels(enable bool)

func (*ListView) EnableFullRowSelect

func (this *ListView) EnableFullRowSelect(enable bool)

func (*ListView) EnableHotTrack

func (this *ListView) EnableHotTrack(enable bool)

func (*ListView) EnableSingleSelect

func (this *ListView) EnableSingleSelect(enable bool)

func (*ListView) EnableSortAscending

func (this *ListView) EnableSortAscending(enable bool)

func (*ListView) EnableSortHeader

func (this *ListView) EnableSortHeader(enable bool)

func (*ListView) ImageList

func (this *ListView) ImageList(imageListType int) *ImageList

func (*ListView) InsertColumn

func (this *ListView) InsertColumn(caption string, width int, iCol int)

func (*ListView) InsertLvColumn

func (this *ListView) InsertLvColumn(lvColumn *w32.LVCOLUMN, iCol int)

func (*ListView) InsertLvItem

func (this *ListView) InsertLvItem(lvItem *w32.LVITEM)

func (*ListView) Item

func (this *ListView) Item(item *w32.LVITEM) bool

func (*ListView) ItemAtIndex

func (this *ListView) ItemAtIndex(i int) *w32.LVITEM

func (*ListView) ItemCount

func (this *ListView) ItemCount() int

func (*ListView) OnClick

func (this *ListView) OnClick() *EventManager

func (*ListView) OnDBLClick

func (this *ListView) OnDBLClick() *EventManager

func (*ListView) OnEndLabelEdit

func (this *ListView) OnEndLabelEdit() *EventManager

Event publishers

func (*ListView) SelectedCount

func (this *ListView) SelectedCount() uint

func (*ListView) SelectedItems

func (this *ListView) SelectedItems(mask uint) []*w32.LVITEM

mask is used to set the LVITEM.Mask for ListView.GetItem which indicates which attributes you'd like to receive of LVITEM.

func (*ListView) SetImageList

func (this *ListView) SetImageList(imageList *ImageList, imageListType int) *ImageList

func (*ListView) SetItemCount

func (this *ListView) SetItemCount(count int) bool

func (*ListView) SetLvItem

func (this *ListView) SetLvItem(lvItem *w32.LVITEM)

func (*ListView) SetSelectedItem

func (this *ListView) SetSelectedItem(i int)

Set i to -1 to select all items.

func (*ListView) WndProc

func (this *ListView) WndProc(msg uint, wparam, lparam uintptr) uintptr

Message processer

type MouseEventData

type MouseEventData struct {
	X, Y   int
	Button int
	Wheel  int
}

type PaintEventData

type PaintEventData struct {
	Canvas *Canvas
}

type Pen

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

func NewNullPen

func NewNullPen() *Pen

func NewPen

func NewPen(style uint, width uint, brush *Brush) *Pen

func (*Pen) Brush

func (this *Pen) Brush() *Brush

func (*Pen) Dispose

func (this *Pen) Dispose()

func (*Pen) GetHPEN

func (this *Pen) GetHPEN() w32.HPEN

func (*Pen) Style

func (this *Pen) Style() uint

type ProgressBar

type ProgressBar struct {
	W32Control
}

func NewProgressBar

func NewProgressBar(parent Controller) *ProgressBar

func (*ProgressBar) Range

func (this *ProgressBar) Range() (min, max uint)

func (*ProgressBar) SetRange

func (this *ProgressBar) SetRange(min, max uint)

func (*ProgressBar) SetValue

func (this *ProgressBar) SetValue(v uint)

func (*ProgressBar) Value

func (this *ProgressBar) Value() uint

type PushButton

type PushButton struct {
	Button
}

func AttachPushButton

func AttachPushButton(parent Controller, id int) *PushButton

func NewPushButton

func NewPushButton(parent Controller) *PushButton

func (*PushButton) WndProc

func (this *PushButton) WndProc(msg uint, wparam, lparam uintptr) uintptr

type RadioButton

type RadioButton struct {
	Button
}

func AttachRadioButton

func AttachRadioButton(parent Controller, id int) *RadioButton

func NewRadioButton

func NewRadioButton(parent Controller) *RadioButton

type RawMsg

type RawMsg struct {
	Hwnd           w32.HWND
	Msg            uint
	WParam, LParam uintptr
}

type Rect

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

func NewEmptyRect

func NewEmptyRect() *Rect

func NewRect

func NewRect(left, top, right, bottom int) *Rect

func ScreenToClientRect

func ScreenToClientRect(hwnd w32.HWND, rect *w32.RECT) *Rect

func (*Rect) Data

func (this *Rect) Data() (left, top, right, bottom int32)

func (*Rect) GetW32Rect

func (this *Rect) GetW32Rect() *w32.RECT

func (*Rect) Inflate

func (this *Rect) Inflate(x, y int)

func (*Rect) Intersect

func (this *Rect) Intersect(src *Rect)

func (*Rect) IsEmpty

func (this *Rect) IsEmpty() bool

func (*Rect) IsEqual

func (this *Rect) IsEqual(rect *Rect) bool

func (*Rect) IsPointIn

func (this *Rect) IsPointIn(x, y int) bool

func (*Rect) Offset

func (this *Rect) Offset(x, y int)

func (*Rect) Set

func (this *Rect) Set(left, top, right, bottom int)

func (*Rect) Substract

func (this *Rect) Substract(src *Rect)

func (*Rect) Union

func (this *Rect) Union(src *Rect)

type SizeEventData

type SizeEventData struct {
	Type uint
	X, Y int
}

type ToolTip

type ToolTip struct {
	W32Control
}

func NewToolTip

func NewToolTip(parent Controller) *ToolTip

func (*ToolTip) AddTool

func (this *ToolTip) AddTool(tool Controller, tip string) bool

type W32Control

type W32Control struct {
	ControlBase
	// contains filtered or unexported fields
}

func (*W32Control) WndProc

func (this *W32Control) WndProc(msg uint, wparam, lparam uintptr) uintptr

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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