Documentation ¶
Index ¶
- Constants
- Variables
- func AddFont(p string) error
- func Init() error
- func RGBA_F_To_UINT(r, g, b, a float32) (uint8, uint8, uint8, uint8)
- func RemoveFont(p string) error
- func RunLoop(win Frame)
- type Canvas
- func (c *Canvas) Arc(p *Point, radius int, start, end float64)
- func (c *Canvas) BeginPath(p *Point)
- func (c *Canvas) Beizer2(sp, cp, ep *Point)
- func (c *Canvas) Beizer3(sp, cp1, cp2, ep *Point)
- func (c *Canvas) DrawImage(img *Image, pt *Point)
- func (c *Canvas) DrawText(str string, pt *Point, size int)
- func (c *Canvas) EndPath()
- func (c *Canvas) Fill()
- func (c *Canvas) FillRect(r *Rectangle)
- func (c *Canvas) LineMoveTo(p *Point)
- func (c *Canvas) LineTo(p *Point)
- func (c *Canvas) Pix(p *Point) *RGB
- func (c *Canvas) Rect(r *Rectangle)
- func (c *Canvas) RoundRect(r *Rectangle, radius int)
- func (c *Canvas) SetPix(p *Point, rgb *RGB)
- func (c *Canvas) Stroke()
- type Char
- type DC
- type FillStyle
- type FillStyleType
- type Font
- type Frame
- type Handle
- type Image
- type Key
- type Module
- func (m *Module) AddModule(f Frame)
- func (m *Module) Destory()
- func (m *Module) FindModule(h Handle) Frame
- func (m *Module) GetMessage() bool
- func (m *Module) Handle() Handle
- func (m *Module) Location() *Point
- func (m *Module) Modules() map[Handle]Frame
- func (m *Module) MoveBottom()
- func (m *Module) MoveTop()
- func (m *Module) OnClose() bool
- func (m *Module) OnCreated()
- func (m *Module) OnDestory()
- func (m *Module) OnFocus()
- func (m *Module) OnFocusOut()
- func (m *Module) OnKeyDown(k Key)
- func (m *Module) OnKeyUp(k Key)
- func (m *Module) OnMouseDouble(p *Point, btn MouseKey)
- func (m *Module) OnMouseDown(p *Point, btn MouseKey)
- func (m *Module) OnMouseHover()
- func (m *Module) OnMouseLeave()
- func (m *Module) OnMouseMove(p *Point)
- func (m *Module) OnMouseUp(p *Point, btn MouseKey)
- func (m *Module) OnMouseWheel(p *Point, wheel int)
- func (m *Module) OnMove(p *Point)
- func (m *Module) OnPaint(c *Canvas)
- func (m *Module) OnShow()
- func (m *Module) OnSize(size *Size)
- func (m *Module) Opacity() uint8
- func (m *Module) Rect() *Rectangle
- func (m *Module) ReomoveModule(f Frame)
- func (m *Module) Repaint()
- func (m *Module) SetIcon(img *Image)
- func (m *Module) SetLocation(p *Point)
- func (m *Module) SetModules(ms map[Handle]Frame)
- func (m *Module) SetOpacity(a uint8)
- func (m *Module) SetRect(r *Rectangle)
- func (m *Module) SetSize(p *Size)
- func (m *Module) SetText(t string)
- func (m *Module) Show()
- func (m *Module) Size() *Size
- func (m *Module) Text() string
- type MouseKey
- type Point
- type RGB
- type Rectangle
- type Size
Constants ¶
View Source
const ( MOUSE_LEFT = MouseKey(0) MOUSE_RIGHT = MouseKey(1) MOUSE_MIDDLE = MouseKey(2) )
View Source
const ( FILL_SOLID = FillStyleType(0) FILL_LINEAR = FillStyleType(1) )
View Source
const ( KEY_BACK = Key(C.gKEY_BACK) KEY_TAB = Key(C.gKEY_TAB) KEY_ENTER = Key(C.gKEY_ENTER) KEY_SHIFT = Key(C.gKEY_SHIFT) KEY_CTRL = Key(C.gKEY_CTRL) KEY_ALT = Key(C.gKEY_ALT) KEY_PAUSE = Key(C.gKEY_PAUSE) KEY_CAPS = Key(C.gKEY_CAPS) KEY_ESC = Key(C.gKEY_ESC) KEY_SPACE = Key(C.gKEY_SPACE) KEY_PAGEUP = Key(C.gKEY_PAGEUP) KEY_PAGEDOWN = Key(C.gKEY_PAGEDOWN) KEY_END = Key(C.gKEY_END) KEY_HOME = Key(C.gKEY_HOME) KEY_LEFT = Key(C.gKEY_LEFT) KEY_UP = Key(C.gKEY_UP) KEY_RIGHT = Key(C.gKEY_RIGHT) KEY_DOWN = Key(C.gKEY_DOWN) KEY_PRINT = Key(C.gKEY_PRINT) KEY_INSERT = Key(C.gKEY_INSERT) KEY_DELETE = Key(C.gKEY_DELETE) KEY_HELP = Key(C.gKEY_HELP) KEY_NUM0 = Key(C.gKEY_NUM0) KEY_NUM1 = Key(C.gKEY_NUM1) KEY_NUM2 = Key(C.gKEY_NUM2) KEY_NUM3 = Key(C.gKEY_NUM3) KEY_NUM4 = Key(C.gKEY_NUM4) KEY_NUM5 = Key(C.gKEY_NUM5) KEY_NUM6 = Key(C.gKEY_NUM6) KEY_NUM7 = Key(C.gKEY_NUM7) KEY_NUM8 = Key(C.gKEY_NUM8) KEY_NUM9 = Key(C.gKEY_NUM9) KEY_F1 = Key(C.gKEY_F1) KEY_F2 = Key(C.gKEY_F2) KEY_F3 = Key(C.gKEY_F3) KEY_F4 = Key(C.gKEY_F4) KEY_F5 = Key(C.gKEY_F5) KEY_F6 = Key(C.gKEY_F6) KEY_F7 = Key(C.gKEY_F7) KEY_F8 = Key(C.gKEY_F8) KEY_F9 = Key(C.gKEY_F9) KEY_F10 = Key(C.gKEY_F10) KEY_F11 = Key(C.gKEY_F11) KEY_F12 = Key(C.gKEY_F12) KEY_NUMLOCK = Key(C.gKEY_NUMLOCK) KEY_LSHIFT = Key(C.gKEY_LSHIFT) KEY_RSHIFT = Key(C.gKEY_RSHIFT) KEY_LCTRL = Key(C.gKEY_LCTRL) KEY_RCTRL = Key(C.gKEY_RCTRL) KEY_LALT = Key(C.gKEY_LALT) KEY_RALT = Key(C.gKEY_RALT) KEY_A = Key(C.gKEY_A) KEY_B = Key(C.gKEY_B) KEY_C = Key(C.gKEY_C) KEY_D = Key(C.gKEY_D) KEY_E = Key(C.gKEY_E) KEY_F = Key(C.gKEY_F) KEY_G = Key(C.gKEY_G) KEY_H = Key(C.gKEY_H) KEY_I = Key(C.gKEY_I) KEY_J = Key(C.gKEY_J) KEY_K = Key(C.gKEY_K) KEY_L = Key(C.gKEY_L) KEY_M = Key(C.gKEY_M) KEY_N = Key(C.gKEY_N) KEY_O = Key(C.gKEY_O) KEY_P = Key(C.gKEY_P) KEY_Q = Key(C.gKEY_Q) KEY_R = Key(C.gKEY_R) KEY_S = Key(C.gKEY_S) KEY_T = Key(C.gKEY_T) KEY_U = Key(C.gKEY_U) KEY_V = Key(C.gKEY_V) KEY_W = Key(C.gKEY_W) KEY_X = Key(C.gKEY_X) KEY_Y = Key(C.gKEY_Y) KEY_Z = Key(C.gKEY_Z) KEY_1 = Key(C.gKEY_1) KEY_2 = Key(C.gKEY_2) KEY_3 = Key(C.gKEY_3) KEY_4 = Key(C.gKEY_4) KEY_5 = Key(C.gKEY_5) KEY_6 = Key(C.gKEY_6) KEY_7 = Key(C.gKEY_7) KEY_8 = Key(C.gKEY_8) KEY_9 = Key(C.gKEY_9) KEY_0 = Key(C.gKEY_0) KEY_MINUS_UNDERLINE = Key(C.gKEY_MINUS_UNDERLINE) // -_ KEY_ADDA_ND = Key(C.gKEY_ADDA_ND) // += KEY_BACKLASH = Key(C.gKEY_BACKLASH) // |\ KEY_TILDE = Key(C.gKEY_TILDE) // `~ KEY_SEMICONLON = Key(C.gKEY_SEMICONLON) // :; KEY_QUOTES = Key(C.gKEY_QUOTES) // '" KEY_COMMA = Key(C.gKEY_COMMA) // <, KEY_PERIOD = Key(C.gKEY_PERIOD) // .> KEY_FORWARDSLASH = Key(C.gKEY_FORWARDSLASH) // /? KEY_BRACKETLEFT = Key(C.gKEY_BRACKETLEFT) // [{ KEY_BRACKETRIGHT = Key(C.gKEY_BRACKETRIGHT) // ]} KEY_NUM_FORWARDSLASH = Key(C.gKEY_NUM_FORWARDSLASH) KEY_NUM_ASTERISK = Key(C.gKEY_NUM_ASTERISK) KEY_NUM_MINUS = Key(C.gKEY_NUM_MINUS) KEY_NUM_ADD = Key(C.gKEY_NUM_ADD) KEY_NUM_DOT = Key(C.gKEY_NUM_DOT) )
========= key const ======
View Source
const ( STYLE_DEFAULT = C.gWS_DEFAULT STYLE_CHILD = C.gWS_CHILD STYLE_TOOL = C.gWS_TOOL FONT_BOLD = int(C.gFONT_BOLD) FONT_ITALIC = int(C.gFONT_ITALIC) FONT_UNDERLINE = int(C.gFONT_UNDERLINE) FONT_STRIKEOUT = int(C.gFONT_STRIKEOUT) )
Variables ¶
View Source
var ( DefaultBackground = NewRGB(23, 24, 20) DefaultFrontground = NewRGB(39, 40, 34) DefaultLineColor = NewRGB(60, 61, 56) DefaultFontColor = NewRGB(255, 255, 255) )
View Source
var DefaultFont = NewFont("宋体", 0, 12)
set canvas font new canvas use this font
Functions ¶
func RemoveFont ¶
Types ¶
type Canvas ¶
type Canvas struct { Font *Font Line struct { Width int Color *RGB } FillStyle FillStyle // contains filtered or unexported fields }
======= canvas =========
func (*Canvas) LineMoveTo ¶
type FillStyle ¶
type FillStyle interface { Type() FillStyleType // contains filtered or unexported methods }
type FillStyleType ¶
type FillStyleType int
type Frame ¶
type Frame interface { Handle() Handle Destory() GetMessage() bool Show() // show and updata window Size() *Size SetSize(s *Size) Opacity() uint8 SetOpacity(a uint8) MoveBottom() // move win to layer bottom MoveTop() // move win to layer up Location() *Point SetLocation(p *Point) // modules Modules() map[Handle]Frame AddModule(m Frame) ReomoveModule(m Frame) SetModules(ms map[Handle]Frame) FindModule(h Handle) Frame Rect() *Rectangle SetRect(r *Rectangle) SetIcon(ico *Image) Repaint() // ---- event ---- OnClose() bool // return true send close to window OnPaint(c *Canvas) // begin paint event OnSize(s *Size) OnDestory() OnMove(p *Point) OnFocus() OnFocusOut() OnKeyDown(k Key) OnKeyUp(k Key) OnMouseDown(p *Point, btn MouseKey) OnMouseUp(p *Point, btn MouseKey) OnMouseDouble(p *Point, btn MouseKey) OnMouseWheel(p *Point, wheel int) OnCreated() OnShow() OnMouseMove(p *Point) OnMouseLeave() OnMouseHover() // contains filtered or unexported methods }
all control interface
var MainFrame Frame
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
========== Module ==========
func (*Module) FindModule ¶
func (*Module) GetMessage ¶
func (*Module) MoveBottom ¶
func (m *Module) MoveBottom()
func (*Module) OnFocusOut ¶
func (m *Module) OnFocusOut()
func (*Module) OnMouseDouble ¶
func (*Module) OnMouseDown ¶
func (*Module) OnMouseHover ¶
func (m *Module) OnMouseHover()
func (*Module) OnMouseLeave ¶
func (m *Module) OnMouseLeave()
func (*Module) OnMouseMove ¶
func (*Module) OnMouseWheel ¶
func (*Module) ReomoveModule ¶
func (*Module) SetLocation ¶
func (*Module) SetModules ¶
func (*Module) SetOpacity ¶
Click to show internal directories.
Click to hide internal directories.