4 Star 22 Fork 9

aochulai / GoMiniblink

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Control.go 944 Bytes
一键复制 编辑 原始数据 按行查看 历史
aochulai 提交于 2020-12-19 14:21 . 控件和窗体加上默认大小
package controls
import (
fm "gitee.com/aochulai/GoMiniblink/forms"
br "gitee.com/aochulai/GoMiniblink/forms/bridge"
)
type Control struct {
BaseUI
impl br.Control
anchor fm.AnchorStyle
}
func (_this *Control) Init() *Control {
_this.impl = App.NewControl()
_this.BaseUI.Init(_this, _this.impl)
_this.anchor = fm.AnchorStyle_Left | fm.AnchorStyle_Top
_this.SetSize(200, 200)
return _this
}
func (_this *Control) GetAnchor() fm.AnchorStyle {
return _this.anchor
}
func (_this *Control) SetAnchor(style fm.AnchorStyle) {
_this.anchor = style
if _this.parent != nil {
if ct, ok := _this.parent.(Container); ok {
bn := ct.GetBound()
ct.SetSize(bn.Width, bn.Height-1)
ct.SetSize(bn.Width, bn.Height)
}
}
}
func (_this *Control) toControl() br.Control {
return _this.impl
}
func (_this *Control) setParent(parent GUI) {
_this.parent = parent
}
func (_this *Control) setOwner(owner GUI) {
_this.owner = owner
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/aochulai/GoMiniblink.git
git@gitee.com:aochulai/GoMiniblink.git
aochulai
GoMiniblink
GoMiniblink
7a3d1eeba729

搜索帮助

344bd9b3 5694891 D2dac590 5694891