Documentation
¶
Index ¶
- Constants
- func CreateWindow(className string, parent Controller, exStyle, style uint) w32.HWND
- func Exit()
- func GetAppInstance() w32.HINSTANCE
- func Init()
- func MsgBox(parent Controller, title, caption string, flags uint) int
- func PreTranslateMessage(msg *w32.MSG) bool
- func RegClassOnlyOnce(className string)
- func RegMsgHandler(controller Controller)
- func RegisterClass(className string, wndproc uintptr)
- func RunMainLoop() int
- func ShowBrowseFolderDlg(parent Controller, title string) (folder string, accepted bool)
- func ShowOpenFileDlg(parent Controller, title, filter string, filterIndex uint, initialDir string) (filePath string, accepted bool)
- func ShowSaveFileDlg(parent Controller, title, filter string, filterIndex uint, initialDir string) (filePath string, accepted bool)
- func ToggleExStyle(hwnd w32.HWND, b bool, style int)
- func ToggleStyle(hwnd w32.HWND, b bool, style int)
- func UnRegMsgHandler(hwnd w32.HWND)
- type Bitmap
- type Brush
- type Button
- type Canvas
- func (this *Canvas) Dispose()
- func (this *Canvas) DrawBitmap(bmp *Bitmap, x, y int)
- func (this *Canvas) DrawIcon(ico *Icon, x, y int) bool
- func (this *Canvas) DrawRect(rect *Rect, pen *Pen, brush *Brush)
- func (this *Canvas) DrawStretchedBitmap(bmp *Bitmap, rect *Rect)
- func (this *Canvas) DrawText(text string, rect *Rect, format uint, font *Font, textColor Color)
- func (this *Canvas) FillRect(rect *Rect, brush *Brush)
- type CheckBox
- type Color
- type ControlBase
- func (this *ControlBase) Bind(msg uint, handler EventHandler)
- func (this *ControlBase) BindedHandler(msg uint) (EventHandler, bool)
- func (this *ControlBase) Bounds() *Rect
- func (this *ControlBase) Caption() string
- func (this *ControlBase) ClientRect() *Rect
- func (this *ControlBase) Close()
- func (this *ControlBase) EnableDragAcceptFiles(b bool)
- func (this *ControlBase) Enabled() bool
- func (this *ControlBase) Focus()
- func (this *ControlBase) Font() *Font
- func (this *ControlBase) Handle() w32.HWND
- func (this *ControlBase) Height() int
- func (this *ControlBase) Hide()
- func (this *ControlBase) Invalidate(erase bool)
- func (this *ControlBase) InvokeRequired() bool
- func (this *ControlBase) OnClose() *EventManager
- func (this *ControlBase) OnCreate() *EventManager
- func (this *ControlBase) OnDropFiles() *EventManager
- func (this *ControlBase) OnKeyUp() *EventManager
- func (this *ControlBase) OnKillFocus() *EventManager
- func (this *ControlBase) OnLBDown() *EventManager
- func (this *ControlBase) OnLBUp() *EventManager
- func (this *ControlBase) OnMBDown() *EventManager
- func (this *ControlBase) OnMBUp() *EventManager
- func (this *ControlBase) OnMouseHover() *EventManager
- func (this *ControlBase) OnMouseLeave() *EventManager
- func (this *ControlBase) OnPaint() *EventManager
- func (this *ControlBase) OnRBDown() *EventManager
- func (this *ControlBase) OnRBUp() *EventManager
- func (this *ControlBase) OnSetFocus() *EventManager
- func (this *ControlBase) OnSize() *EventManager
- func (this *ControlBase) Parent() Controller
- func (this *ControlBase) Pos() (x, y int)
- func (this *ControlBase) PreTranslateMessage(msg *w32.MSG) bool
- func (this *ControlBase) SetCaption(caption string)
- func (this *ControlBase) SetEnabled(b bool)
- func (this *ControlBase) SetFont(font *Font)
- func (this *ControlBase) SetPos(x, y int)
- func (this *ControlBase) SetSize(width, height int)
- func (this *ControlBase) Show()
- func (this *ControlBase) Size() (width, height int)
- func (this *ControlBase) Visible() bool
- func (this *ControlBase) Width() int
- type Controller
- type CustomControl
- type Dialog
- func (this *Dialog) Close(result int)
- func (this *Dialog) OnCancel() *EventManager
- func (this *Dialog) OnLoad() *EventManager
- func (this *Dialog) OnOK() *EventManager
- func (this *Dialog) PreTranslateMessage(msg *w32.MSG) bool
- func (this *Dialog) Show()
- func (this *Dialog) ShowModal() int
- func (this *Dialog) ShowModalWithData(data interface{}) (result int)
- func (this *Dialog) ShowWithData(data interface{})
- func (this *Dialog) WndProc(msg uint, wparam, lparam uintptr) uintptr
- type DropFilesEventData
- type Edit
- type EventArg
- type EventHandler
- type EventManager
- type Font
- type Form
- func (this *Form) Center()
- func (this *Form) EnableDragMove(b bool)
- func (this *Form) EnableMaxButton(b bool)
- func (this *Form) EnableMinButton(b bool)
- func (this *Form) EnableSizable(b bool)
- func (this *Form) EnableTopMost(b bool)
- func (this *Form) SetIcon(iconType int, icon *Icon)
- func (this *Form) WndProc(msg uint, wparam, lparam uintptr) uintptr
- type GroupBox
- type Icon
- type ImageList
- func (this *ImageList) AddIcon(icon *Icon) int
- func (this *ImageList) Destroy() bool
- func (this *ImageList) Handle() w32.HIMAGELIST
- func (this *ImageList) ImageCount() int
- func (this *ImageList) Remove(i int) bool
- func (this *ImageList) RemoveAll() bool
- func (this *ImageList) SetImageCount(uNewCount uint) bool
- type KeyUpEventData
- type LVDBLClickEventData
- type LVEndLabelEditEventData
- type Label
- type ListView
- func (this *ListView) AddItem(text ...string)
- func (this *ListView) DeleteAllItems() bool
- func (this *ListView) EnableDoubleBuffer(enable bool)
- func (this *ListView) EnableEditLabels(enable bool)
- func (this *ListView) EnableFullRowSelect(enable bool)
- func (this *ListView) EnableHotTrack(enable bool)
- func (this *ListView) EnableSingleSelect(enable bool)
- func (this *ListView) EnableSortAscending(enable bool)
- func (this *ListView) EnableSortHeader(enable bool)
- func (this *ListView) ImageList(imageListType int) *ImageList
- func (this *ListView) InsertColumn(caption string, width int, iCol int)
- func (this *ListView) InsertLvColumn(lvColumn *w32.LVCOLUMN, iCol int)
- func (this *ListView) InsertLvItem(lvItem *w32.LVITEM)
- func (this *ListView) Item(item *w32.LVITEM) bool
- func (this *ListView) ItemAtIndex(i int) *w32.LVITEM
- func (this *ListView) ItemCount() int
- func (this *ListView) OnClick() *EventManager
- func (this *ListView) OnDBLClick() *EventManager
- func (this *ListView) OnEndLabelEdit() *EventManager
- func (this *ListView) SelectedCount() uint
- func (this *ListView) SelectedItems(mask uint) []*w32.LVITEM
- func (this *ListView) SetImageList(imageList *ImageList, imageListType int) *ImageList
- func (this *ListView) SetItemCount(count int) bool
- func (this *ListView) SetLvItem(lvItem *w32.LVITEM)
- func (this *ListView) SetSelectedItem(i int)
- func (this *ListView) WndProc(msg uint, wparam, lparam uintptr) uintptr
- type MouseEventData
- type PaintEventData
- type Pen
- type ProgressBar
- type PushButton
- type RadioButton
- type RawMsg
- type Rect
- func (this *Rect) Data() (left, top, right, bottom int32)
- func (this *Rect) GetW32Rect() *w32.RECT
- func (this *Rect) Inflate(x, y int)
- func (this *Rect) Intersect(src *Rect)
- func (this *Rect) IsEmpty() bool
- func (this *Rect) IsEqual(rect *Rect) bool
- func (this *Rect) IsPointIn(x, y int) bool
- func (this *Rect) Offset(x, y int)
- func (this *Rect) Set(left, top, right, bottom int)
- func (this *Rect) Substract(src *Rect)
- func (this *Rect) Union(src *Rect)
- type SizeEventData
- type ToolTip
- type W32Control
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 GetAppInstance ¶
func PreTranslateMessage ¶
func RegClassOnlyOnce ¶
func RegClassOnlyOnce(className string)
func RegMsgHandler ¶
func RegMsgHandler(controller Controller)
func RegisterClass ¶
func RunMainLoop ¶
func RunMainLoop() int
func ShowBrowseFolderDlg ¶
func ShowBrowseFolderDlg(parent Controller, title string) (folder string, accepted bool)
func ShowOpenFileDlg ¶
func ShowSaveFileDlg ¶
func UnRegMsgHandler ¶
Types ¶
type Bitmap ¶
type Bitmap struct {
// contains filtered or unexported fields
}
func NewBitmapFromResource ¶
func (*Bitmap) GetHBITMAP ¶
type Brush ¶
type Brush struct {
// contains filtered or unexported fields
}
func NewNullBrush ¶
func NewNullBrush() *Brush
func NewSolidColorBrush ¶
func (*Brush) GetLOGBRUSH ¶
type Canvas ¶
type Canvas struct {
// contains filtered or unexported fields
}
func NewCanvasFromHDC ¶
func NewCanvasFromHwnd ¶
func (*Canvas) DrawBitmap ¶
func (*Canvas) DrawStretchedBitmap ¶
type CheckBox ¶
type CheckBox struct {
Button
}
func AttachCheckBox ¶
func AttachCheckBox(parent Controller, id int) *CheckBox
func NewCheckBox ¶
func NewCheckBox(parent Controller) *CheckBox
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) 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)
type Dialog ¶
type Dialog struct { Form Data interface{} // contains filtered or unexported fields }
func NewDialogFromResId ¶
func NewDialogFromResId(parent Controller, resId uint) *Dialog
func (*Dialog) OnCancel ¶
func (this *Dialog) OnCancel() *EventManager
func (*Dialog) OnOK ¶
func (this *Dialog) OnOK() *EventManager
func (*Dialog) ShowModalWithData ¶
func (*Dialog) ShowWithData ¶
func (this *Dialog) ShowWithData(data interface{})
type DropFilesEventData ¶
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
type EventArg ¶
type EventArg struct {
// contains filtered or unexported fields
}
func NewEventArg ¶
func NewEventArg(sender Controller, data interface{}) *EventArg
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.
type Form ¶
type Form struct { ControlBase // contains filtered or unexported fields }
func NewForm ¶
func NewForm(parent Controller) *Form
func (*Form) EnableDragMove ¶
func (*Form) EnableMaxButton ¶
func (*Form) EnableMinButton ¶
func (*Form) EnableSizable ¶
func (*Form) EnableTopMost ¶
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 NewIconFromFile ¶
func NewIconFromResource ¶
type ImageList ¶
type ImageList struct {
// contains filtered or unexported fields
}
func (*ImageList) Handle ¶
func (this *ImageList) Handle() w32.HIMAGELIST
func (*ImageList) ImageCount ¶
func (*ImageList) SetImageCount ¶
type KeyUpEventData ¶
type KeyUpEventData struct {
VKey, Code int
}
type LVDBLClickEventData ¶
type LVDBLClickEventData struct {
NmItem *w32.NMITEMACTIVATE
}
type LVEndLabelEditEventData ¶
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) DeleteAllItems ¶
func (*ListView) EnableDoubleBuffer ¶
func (*ListView) EnableEditLabels ¶
func (*ListView) EnableFullRowSelect ¶
func (*ListView) EnableHotTrack ¶
func (*ListView) EnableSingleSelect ¶
func (*ListView) EnableSortAscending ¶
func (*ListView) EnableSortHeader ¶
func (*ListView) InsertColumn ¶
func (*ListView) InsertLvColumn ¶
func (*ListView) InsertLvItem ¶
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 (*ListView) SelectedItems ¶
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 (*ListView) SetItemCount ¶
func (*ListView) SetSelectedItem ¶
Set i to -1 to select all items.
type MouseEventData ¶
type PaintEventData ¶
type PaintEventData struct {
Canvas *Canvas
}
type Pen ¶
type Pen struct {
// contains filtered or unexported fields
}
func NewNullPen ¶
func NewNullPen() *Pen
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
type RadioButton ¶
type RadioButton struct {
Button
}
func AttachRadioButton ¶
func AttachRadioButton(parent Controller, id int) *RadioButton
func NewRadioButton ¶
func NewRadioButton(parent Controller) *RadioButton
type Rect ¶
type Rect struct {
// contains filtered or unexported fields
}
func NewEmptyRect ¶
func NewEmptyRect() *Rect
func (*Rect) GetW32Rect ¶
type SizeEventData ¶
type ToolTip ¶
type ToolTip struct {
W32Control
}
func NewToolTip ¶
func NewToolTip(parent Controller) *ToolTip
type W32Control ¶
type W32Control struct { ControlBase // contains filtered or unexported fields }
Source Files
¶
- app.go
- bitmap.go
- brush.go
- buttons.go
- canvas.go
- color.go
- commondlgs.go
- controlbase.go
- controller.go
- customcontrol.go
- dialog.go
- edit.go
- eventarg.go
- eventdata.go
- eventmanager.go
- font.go
- form.go
- globalvars.go
- icon.go
- imagelist.go
- init.go
- listview.go
- msghandlerregistry.go
- pen.go
- progressbar.go
- rect.go
- statics.go
- tooltip.go
- utils.go
- w32control.go
- wndproc.go
Click to show internal directories.
Click to hide internal directories.