1 Star 0 Fork 43

opsfast / govcl

forked from 不在乎y / govcl 
Clone or download
README.md
Copy Edit Web IDE Raw Normal History
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
## 一个跨平台的Golang GUI库,底层绑定自Delphi VCL和Lazarus LCL  
不在乎y   Update README.md 2018-06-06
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
* 中文   * [English](README.en-US.md)   
不在乎y   Update README 2018-05-27
不在乎y   move gitee.com/ying32/govcl -> github.com/ying32/govcl 2018-06-01
----
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
**从1.2.0版本开始govcl将最低要求go1.9。**  
不在乎y   Update README 2018-11-20
不在乎y   Update README 2018-11-01
----
不在乎y   Update README.md 2018-05-11
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
[![license](https://img.shields.io/badge/开源协议-Apache%20License%202.0-green.svg)](https://github.com/ying32/govcl/blob/master/LICENSE)![Minimum Go version](https://img.shields.io/badge/最低Go版本-1.9.0-green.svg)[![screenshots](https://img.shields.io/badge/例程截图-查看-green.svg)](https://github.com/ying32/govcl/tree/master/Screenshot)[![Chinese Wiki](https://img.shields.io/badge/维基-中文WIKI-green.svg)](https://gitee.com/ying32/govcl/wikis/pages)[![Chinese Chat](https://img.shields.io/badge/QQ群-点击加入:263106281-red.svg)](https://jq.qq.com/?_wv=1027&k=5Sv7Qiq)
不在乎y   Update README 2019-06-03
[![Update log](https://img.shields.io/badge/更新日志-查看-blue.svg)](https://github.com/ying32/govcl/wiki/%E6%9B%B4%E6%96%B0%E6%97%A5%E5%BF%97(What's-new))
不在乎y   Update README 2019-06-03
[![Support govcl](https://img.shields.io/badge/支持govcl-赞助作者-blueviolet.svg)](Donation.md)  
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
![Support Platform](https://img.shields.io/badge/支持的平台-Windows%20%7C%20Linux%20%7C%20Mac%20OS-green.svg)  **注: linux和macOS由于底层使用了lcl库,则部分组件、属性和方法无效。**
不在乎y   Update README 2018-11-01
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
**如果你想要支持linux arm及linux 32bit则需要自己编译对应的liblcl二进制。**   
不在乎y   Update README.md 2018-08-06
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
预编译GUI库二进制下载:     
不在乎y   version: v1.2.5 2019-07-01
[![Librarys](https://img.shields.io/github/downloads/ying32/govcl/latest/Librarys-1.2.5.zip.svg)](https://github.com/ying32/govcl/releases/download/v1.2.5/Librarys-1.2.5.zip)  
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
**注:压缩包内包含的“libvcl”库二进制(libvcl.dll、libvclx64.dll)仅供预览和测试使用。正式使用请自行编译“libvcl”源代码,具体编译方法参考[UILIbSrcources](UILibSources/README.md)中的说明。**  
不在乎y   Update README.md 2018-08-06
不在乎y   Update README.md 2018-08-07
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
res2go工具下载  
不在乎y   version: v1.2.5 2019-07-01
[![res2go](https://img.shields.io/badge/downloads-res2go%201.0.15-blue.svg)](Tools/res2go)  
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
**注:用Delphi/Lazarus设计界面,用Golang写代码。**    
不在乎y   Update README.md 2017-09-28
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
---
不在乎y   Update README 2019-06-27
### 使用方法  #### 步骤一:获取govcl代码  
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
> go get github.com/ying32/govcl  
不在乎y   update README.md 2018-01-05
不在乎y   Update README 2019-06-27
#### 步骤二:编写代码    
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
* 方法一:  
不在乎y   Update README.md 2018-09-06
```golang
不在乎y   update README.md 2018-01-11
package mainimport (
不在乎y   move gitee.com/ying32/govcl -> github.com/ying32/govcl 2018-06-01
   "github.com/ying32/govcl/vcl"
不在乎y   update README.md 2018-01-11
)func main() {    vcl.Application.Initialize()
不在乎y   Update README 2018-11-15
    mainForm := vcl.Application.CreateForm()
不在乎y   update README.md 2018-01-11
    mainForm.SetCaption("Hello")    mainForm.EnabledMaximize(false)    mainForm.ScreenCenter()
不在乎y   Update README 2018-11-15
    btn := vcl.NewButton(mainForm)    btn.SetParent(mainForm)    btn.SetCaption("Hello")    btn.SetOnClick(func(sender vcl.IObject) {        vcl.ShowMessage("Hello!")    })
不在乎y   update README.md 2018-01-11
    vcl.Application.Run()}
不在乎y   Update README.md 2018-09-06
```  
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
* 方法二:  
不在乎y   Update README.md 2018-09-06
```golangpackage mainimport (   "github.com/ying32/govcl/vcl")type TMainForm struct {
不在乎y   Update README.md 2018-09-06
    *vcl.TForm    Btn1     *vcl.TButton
不在乎y   Update README.md 2018-09-06
}
不在乎y   Update README 2018-11-20
type TAboutForm struct {    *vcl.TForm    Btn1    *vcl.TButton}
不在乎y   Update README.md 2018-09-06
var (
不在乎y   Update README.md 2018-09-06
    mainForm *TMainForm
不在乎y   Update README 2018-11-20
    aboutForm *TAboutForm
不在乎y   Update README.md 2018-09-06
)func main() {    vcl.Application.Initialize()
不在乎y   Update README.md 2018-09-06
    vcl.Application.SetMainFormOnTaskBar(true)    vcl.Application.CreateForm(&mainForm)
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
    // 创建完后关联子组件事件
不在乎y   Update README 2018-11-20
    vcl.Application.CreateForm(&aboutForm, true)
不在乎y   Update README.md 2018-09-06
    vcl.Application.Run()
不在乎y   Update README.md 2018-09-06
}
不在乎y   Update README 2018-11-20
// -- TMainForm
不在乎y   Update README.md 2018-09-06
func (f *TMainForm) OnFormCreate(sender vcl.IObject) {    f.SetCaption("Hello")    f.Btn1 = vcl.NewButton(f)
不在乎y   Update README.md 2018-09-06
    f.Btn1.SetParent(f)    f.Btn1.SetBounds(10, 10, 88, 28)    f.Btn1.SetCaption("Button1")    f.Btn1.SetOnClick(f.OnButtonClick)  
不在乎y   Update README.md 2018-09-06
}func (f *TMainForm) OnButtonClick(sender vcl.IObject) {
不在乎y   Update README.md 2018-09-06
    vcl.ShowMessage("Hello!")
不在乎y   Update README.md 2018-09-06
}
不在乎y   update README.md 2018-01-11
不在乎y   Update README 2018-11-20
// -- TAboutFormfunc (f *TAboutForm) OnFormCreate(sender vcl.IObject) {    f.SetCaption("Hello")    f.Btn1 = vcl.NewButton(f)
不在乎y   Update README 2018-11-20
    //f.Btn1.SetName("Btn1")
不在乎y   Update README 2018-11-20
    f.Btn1.SetParent(f)    f.Btn1.SetBounds(10, 10, 88, 28)    f.Btn1.SetCaption("Button1")}func (f *TAboutForm) OnBtn1Click(sender vcl.IObject) {    vcl.ShowMessage("Hello!")}
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
不在乎y   update README.md 2018-01-11
```
不在乎y   Update README.md 2018-09-06
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
* 方法三:  
不在乎y   Update README.md 2018-09-06
```golangpackage mainimport (   "github.com/ying32/govcl/vcl")type TMainForm struct {
不在乎y   Update README.md 2018-09-06
    *vcl.TForm    Btn1     *vcl.TButton
不在乎y   Update README.md 2018-09-06
}
不在乎y   Update README 2018-11-22
type TAboutForm struct {    *vcl.TForm    Btn1    *vcl.TButton}
不在乎y   Update README.md 2018-09-06
var (
不在乎y   Update README.md 2018-09-06
    mainForm *TMainForm
不在乎y   Update README 2018-11-22
    aboutForm *TAboutForm
不在乎y   Update README.md 2018-09-06
)func main() {    vcl.Application.Initialize()
不在乎y   Update README.md 2018-09-06
    vcl.Application.SetMainFormOnTaskBar(true)    vcl.Application.CreateForm(mainFormBytes, &mainForm)
不在乎y   Update README 2018-11-22
    vcl.Application.CreateForm("./about.gfm", &aboutForm)
不在乎y   Update README.md 2018-09-06
    vcl.Application.Run()
不在乎y   Update README.md 2018-09-06
}
不在乎y   Update README 2018-11-22
// -- TMainForm
不在乎y   Update README.md 2018-09-06
func (f *TMainForm) OnFormCreate(sender vcl.IObject) {    }
不在乎y   Update README.md 2018-09-06
func (f *TMainForm) OnBtn1Click(sender vcl.IObject) {    vcl.ShowMessage("Hello!")
不在乎y   Update README.md 2018-09-06
}
不在乎y   Update README 2018-11-22
// -- TAboutFormfunc (f *TAboutForm) OnFormCreate(sender vcl.IObject) { }func (f *TAboutForm) OnBtn1Click(sender vcl.IObject) {    vcl.ShowMessage("Hello!")}
不在乎y   Update README.md 2018-09-06
```
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
**方法三需要配合UI设计器或者res2go工具使用。**  
不在乎y   Update README.md 2018-09-06
不在乎y   update README.md 2018-01-11
不在乎y   Update README 2019-06-27
#### 步骤三:复制对应的二进制    * Windows: 根据编译的二进制是32还是64位的,复制对应的"libvcl.dll"或者"libvclx64.dll"或者“liblcl.dll”到当前exe目录或系统环境路径下。   * Go环境变量: `GOARCH = amd64 386` `GOOS = windows` `CGO_ENABLED=0`   * Linux: 复制"liblcl.so"可执行文件目录下(也可复制liblcl.so到`/usr/lib/`目录中,作为公共库使用)。    * Go环境变量: `GOARCH = amd64` `GOOS = linux` `CGO_ENABLED=1`* MacOS: 复制"liblcl.dylib"可执行文件目录下(MacOS下注意:需要自行创建info.plist文件),或者参考:[MacOS上应用打包](https://gitee.com/ying32/govcl/wikis/pages?title=APP%E6%89%93%E5%8C%85&parent=FAQ%2FMac-OS)   * Go环境变量: `GOARCH = amd64` `GOOS = darwin` `CGO_ENABLED=1`  
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
----
不在乎y   Update README.md 2018-08-26
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
### 注意:  
不在乎y   Update README.md 2018-08-26
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
**当使用"liblcl"库时,是以兼容"libvcl"库形式运行的,所以有部分组件和组件的方法、属性及事件不可用。**  ----
不在乎y   Update README.md 2018-05-27
不在乎y   Update README.md 2018-08-26
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
### API文档
不在乎y   Update README.md 2018-08-26
不在乎y   Modified: `REAMD.md` is displayed in Chinese by default. 2019-05-24
* [Delphi VCL组件文档WIKI](http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Category:VCL_Reference)  * [Lazarus LCL组件文档WIKI](http://wiki.freepascal.org/LCL_Components)  * [Windows API文档](https://msdn.microsoft.com/zh-cn/library/ms123401.aspx)
Go
1
https://gitee.com/opsfast/govcl.git
git@gitee.com:opsfast/govcl.git
opsfast
govcl
govcl
master

Search