gwin

package
v0.0.0-...-cc4dccb Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package gwin windows ui lib 这是演示本地窗口和bone如何结合 并不是生产环境下的UI库 建议自己开发可以使用的UI库

Index

Constants

This section is empty.

Variables

View Source
var ChildWindowComponent = bone.Component{
	Template: `
	<Canvas when:Created = "WhenViewCreated" when:Attached="WhenViewAttached" when:Deattached = "WhenViewDeattached">
	</Canvas>
	`,
	DataContext: reflect.TypeOf((*ChildWindow)(nil)),
}

ChildWindowComponent native child window 组件描述

View Source
var MainWindowComponent = bone.Component{
	Template: `
	<Canvas bind:Widget="Widget" when:Created = "WhenViewCreated" when:Attached="WhenViewAttached" when:Deattached = "WhenViewDeattached">
	</Canvas>
	`,
	DataContext: reflect.TypeOf((*MainWindow)(nil)),
}

MainWindowComponent Native MainWindow 组件描述

View Source
var StaticTextComponent = bone.Component{
	Template: `
	<Canvas when:Attached="WhenViewAttached" when:Deattached = "WhenViewDeattached">
	</Canvas>
	`,
	DataContext: reflect.TypeOf((*StaticText)(nil)),
}

StaticTextComponent native child window 组件描述

Functions

func ImportChildWindow

func ImportChildWindow() error

ImportChildWindow 导入子窗口标签

func ImportMainWindow

func ImportMainWindow() error

ImportMainWindow 导入主窗口标签

func ImportStaticText

func ImportStaticText() error

ImportStaticText 导入StaticText标签

func MustRegisterWindowClass

func MustRegisterWindowClass(className string)

func MustRegisterWindowClassWithStyle

func MustRegisterWindowClassWithStyle(className string, style uint32)

func MustRegisterWindowClassWithWndProcPtr

func MustRegisterWindowClassWithWndProcPtr(className string, wndProcPtr uintptr)

func MustRegisterWindowClassWithWndProcPtrAndStyle

func MustRegisterWindowClassWithWndProcPtrAndStyle(className string, wndProcPtr uintptr, style uint32)

Types

type ChildWindow

type ChildWindow struct {

	//依赖属性
	Bounds  bone.DepProperty //win.RECT
	Visible bone.DepProperty // bool
	//事件
	OnDestroy func(sender interface{})
	// contains filtered or unexported fields
}

ChildWindow native 窗口

func (*ChildWindow) Constructor

func (cw *ChildWindow) Constructor(logger bone.BLogger)

Constructor 构造函数

func (*ChildWindow) WhenViewAttached

func (cw *ChildWindow) WhenViewAttached(sender *bone.View, parent, child interface{})

WhenViewAttached 标签被添加到树上

func (*ChildWindow) WhenViewCreated

func (cw *ChildWindow) WhenViewCreated(sender *bone.View)

WhenViewCreated 内置标签view创建通知

func (*ChildWindow) WhenViewDeattached

func (cw *ChildWindow) WhenViewDeattached(sender *bone.View, parent, child interface{})

WhenViewDeattached 标签从树上摘除

type MainWindow

type MainWindow struct {

	//依赖属性 因为要通过反射来绑定 必须首字母大写
	//Widget也许不需要是依赖属性 因为大写导出了 可能会被其他标签绑定
	//要么使用canvas直接设置值 要么后期对DepProperty增加私有权限控制
	Widget bone.DepProperty //*bone.Widget

	Bounds  bone.DepProperty //win.RECT
	Visible bone.DepProperty // bool
	//事件
	OnDestroy func(sender interface{})
	// contains filtered or unexported fields
}

MainWindow native 窗口

func (*MainWindow) Constructor

func (mw *MainWindow) Constructor(logger bone.BLogger)

Constructor 构造函数 顶级窗口可以直接创建

func (*MainWindow) WhenViewAttached

func (mw *MainWindow) WhenViewAttached(sender *bone.View, parent, child interface{})

WhenViewAttached 标签被添加到树上

func (*MainWindow) WhenViewCreated

func (mw *MainWindow) WhenViewCreated(sender *bone.View)

WhenViewCreated 内置标签view创建通知

func (*MainWindow) WhenViewDeattached

func (mw *MainWindow) WhenViewDeattached(sender *bone.View, parent, child interface{})

WhenViewDeattached 标签从树上摘除

type MessageLoop

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

MessageLoop 消息循环 目前不能兼容模态对话框

func NewMessageLoop

func NewMessageLoop() *MessageLoop

NewMessageLoop 返回消息循环

func (*MessageLoop) Append

func (ml *MessageLoop) Append(idle func()) *MessageLoop

Append 添加一个空闲例程

func (*MessageLoop) Close

func (ml *MessageLoop) Close()

func (*MessageLoop) EnterModal

func (ml *MessageLoop) EnterModal() *MessageLoop

EnterModal 显示native dialog前 调用EnterModal() EnterModal->MessageBox->MessageBox->LeaveModal

func (*MessageLoop) LeaveModal

func (ml *MessageLoop) LeaveModal() *MessageLoop

LeaveModal 关闭native dialog后 调用

func (*MessageLoop) Quit

func (ml *MessageLoop) Quit(code int) *MessageLoop

Quit 退出当前消息循环 必须LeaveModal后才能调用

func (*MessageLoop) Run

func (ml *MessageLoop) Run() int

Run 消息主循环

type StaticText

type StaticText struct {

	//依赖属性
	Widget  bone.DepProperty
	Bounds  bone.DepProperty //win.RECT
	Visible bone.DepProperty // bool
	Text    bone.DepProperty //string
	// contains filtered or unexported fields
}

StaticText 静态文本

func (*StaticText) Constructor

func (st *StaticText) Constructor(logger bone.BLogger)

func (*StaticText) WhenViewAttached

func (st *StaticText) WhenViewAttached(sender *bone.View, parent, child interface{})

WhenViewAttached 标签被添加到树上

func (*StaticText) WhenViewDeattached

func (st *StaticText) WhenViewDeattached(sender *bone.View, parent, child interface{})

WhenViewDeattached 标签从树上摘除

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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