Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ying32 committed Dec 1, 2018
2 parents bb1c1e5 + 93dc055 commit 9787a22
Show file tree
Hide file tree
Showing 91 changed files with 3,223 additions and 324 deletions.
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@


Librarys binaries
[![Librarys](https://img.shields.io/github/downloads/ying32/govcl/latest/Librarys-1.2.1.zip.svg)](https://github.com/ying32/govcl/releases/download/v1.2.1/Librarys-1.2.1.zip)
[![Librarys](https://img.shields.io/github/downloads/ying32/govcl/latest/Librarys-1.2.2.zip.svg)](https://github.com/ying32/govcl/releases/download/v1.2.2/Librarys-1.2.2.zip)
**Note: The "libvcl" library binary (libvcl. dll, libvclx64. dll) contained in the compression package is only for preview and test purposes. Please compile the "libvcl" source code for official use. please refer to the instructions in [UILIbSrcources](UILibSources/README.md).**


res2go Tool
[![res2go](https://img.shields.io/badge/downloads-res2go%201.0.10-blue.svg)](Tools/res2go)
[![res2go](https://img.shields.io/badge/downloads-res2go%201.0.11-blue.svg)](Tools/res2go)
**Note: Designed in Delphi/Lazarus, code written in Golang.**

### usage:
Expand Down Expand Up @@ -140,17 +140,25 @@ type TMainForm struct {
Btn1 *vcl.TButton
}

type TAboutForm struct {
*vcl.TForm
Btn1 *vcl.TButton
}

var (
mainForm *TMainForm
aboutForm *TAboutForm
)

func main() {
vcl.Application.Initialize()
vcl.Application.SetMainFormOnTaskBar(true)
vcl.Application.CreateForm(mainFormBytes, &mainForm)
vcl.Application.CreateForm("./about.gfm", &aboutForm)
vcl.Application.Run()
}

// -- TMainForm

func (f *TMainForm) OnFormCreate(sender vcl.IObject) {

Expand All @@ -159,6 +167,16 @@ func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
func (f *TMainForm) OnBtn1Click(sender vcl.IObject) {
vcl.ShowMessage("Hello!")
}

// -- TAboutForm

func (f *TAboutForm) OnFormCreate(sender vcl.IObject) {

}

func (f *TAboutForm) OnBtn1Click(sender vcl.IObject) {
vcl.ShowMessage("Hello!")
}
```
**Method 3 needs to be used in conjunction with the UI designer or the res2go tool.**

Expand All @@ -183,10 +201,13 @@ A: My English is bad. You can try using Google Translate [Chinese WIKI](https://

----

* Windows: Copy "libvcl.dll" or "libvclx64.dll" or "liblcl.dll" to the current exe directory or system environment path.
* Windows: Copy "libvcl.dll" or "libvclx64.dll" or "liblcl.dll" to the current exe directory or system environment path.
* Go environment variable: `GOARCH = amd64 386` `GOOS = windows` `CGO_ENABLED=0`

* Linux: Copy the "liblcl.so" executable directory (you can also copy liblcl.so to the `/usr/lib/` directory and use it as a public library).
* Linux: Copy the "liblcl.so" executable directory (you can also copy liblcl.so to the `/usr/lib/` directory and use it as a public library).
* Go environment variable: `GOARCH = amd64` `GOOS = linux` `CGO_ENABLED=1`

* MacOS: Copy the "liblcl.dylib" executable directory (Note for MacOS: you need to create the info.plist file yourself), or refer to: [App packaging on MacOS](https://gitee.com/ying32/govcl/wikis/pages?title=APP%E6%89%93%E5%8C%85&parent=FAQ%2FMac-OS)
* MacOS: Copy the "liblcl.dylib" executable directory (Note for MacOS: you need to create the info.plist file yourself), or refer to: [App packaging on MacOS](https://gitee.com/ying32/govcl/wikis/pages?title=APP%E6%89%93%E5%8C%85&parent=FAQ%2FMac-OS)
* Go environment variable: `GOARCH = 386` `GOOS = darwin` `CGO_ENABLED=1`

---
29 changes: 25 additions & 4 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@


GUI库二进制下载:
[![Librarys](https://img.shields.io/github/downloads/ying32/govcl/latest/Librarys-1.2.1.zip.svg)](https://github.com/ying32/govcl/releases/download/v1.2.1/Librarys-1.2.1.zip)
[![Librarys](https://img.shields.io/github/downloads/ying32/govcl/latest/Librarys-1.2.2.zip.svg)](https://github.com/ying32/govcl/releases/download/v1.2.2/Librarys-1.2.2.zip)
**注:压缩包内包含的“libvcl”库二进制(libvcl.dll、libvclx64.dll)仅供预览和测试使用。正式使用请自行编译“libvcl”源代码,具体编译方法参考[UILIbSrcources](UILibSources/README.zh-CN.md)中的说明。**


res2go工具下载
[![res2go](https://img.shields.io/badge/downloads-res2go%201.0.10-blue.svg)](Tools/res2go)
[![res2go](https://img.shields.io/badge/downloads-res2go%201.0.11-blue.svg)](Tools/res2go)
**注:用Delphi/Lazarus设计界面,用Golang写代码。**

---
Expand Down Expand Up @@ -142,17 +142,25 @@ type TMainForm struct {
Btn1 *vcl.TButton
}

type TAboutForm struct {
*vcl.TForm
Btn1 *vcl.TButton
}

var (
mainForm *TMainForm
aboutForm *TAboutForm
)

func main() {
vcl.Application.Initialize()
vcl.Application.SetMainFormOnTaskBar(true)
vcl.Application.CreateForm(mainFormBytes, &mainForm)
vcl.Application.CreateForm("./about.gfm", &aboutForm)
vcl.Application.Run()
}

// -- TMainForm

func (f *TMainForm) OnFormCreate(sender vcl.IObject) {

Expand All @@ -161,6 +169,16 @@ func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
func (f *TMainForm) OnBtn1Click(sender vcl.IObject) {
vcl.ShowMessage("Hello!")
}

// -- TAboutForm

func (f *TAboutForm) OnFormCreate(sender vcl.IObject) {

}

func (f *TAboutForm) OnBtn1Click(sender vcl.IObject) {
vcl.ShowMessage("Hello!")
}
```
**方法三需要配合UI设计器或者res2go工具使用。**

Expand All @@ -182,8 +200,11 @@ func (f *TMainForm) OnBtn1Click(sender vcl.IObject) {

----

* Windows: 复制"libvcl.dll"或者"libvclx64.dll"或者“liblcl.dll”到当前exe目录或系统环境路径下。
* Windows: 复制"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)
* 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 = 386` `GOOS = darwin` `CGO_ENABLED=1`
Binary file modified Screenshot/1_macOS.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshot/2_macOS.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshot/3_macOS.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshot/4_macOS.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshot/5_macOS.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshot/6_macOS.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 21 additions & 8 deletions Screenshot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@
* 四态图像按钮(image button)
![图像按钮](imagebutton.jpg)
* 从资源中加载窗口(resouce form)
![basicResForm_Windows](basicResForm_windows_vcl.jpg)
![basicResForm_Windows](basicResForm_windows_vcl.jpg)
* libvcl MiniWebview
![miniweb_libvcl_win](miniweb_libvcl_win.jpg)
* liblcl MiniWebview
![miniweb_liblcl_win](miniweb_liblcl_win.jpg)
* 基于bass的mp3Player
![mp3Player_win](mp3Player_win.jpg)

---
## Linux
### Ubuntu 16.04
Expand All @@ -40,6 +47,8 @@
![截图5](5_linux.jpg)
* 四态图像按钮
![截图6](6_linux.jpg)
* 基于bass的mp3Player Linux Mint
![mp3Player_linux](mp3Player_linux.jpg)

* Deepin
![basicResForm_Deepin](basicResForm_linux_deepin.jpg)
Expand All @@ -55,16 +64,20 @@
## MacOS

* test1
<img src="1_macOS.jpg" width="602" height="424" />
![1_macOS](1_macOS.jpg)
* test2
<img src="2_macOS.jpg" width="602" height="424" />
![2_macOS](2_macOS.jpg)
* 自绘
<img src="3_macOS.jpg" width="400" height="621" />
![3_macOS](3_macOS.jpg)
* 复选列表框
<img src="4_macOS.jpg" width="324" height="263" />
![4_macOS](4_macOS.jpg)
* 标准控件
<img src="5_macOS.jpg" width="501" height="725" />
![5_macOS](5_macOS.jpg)
* 四态图像按钮
<img src="6_macOS.jpg" width="306" height="422" />
![6_macOS](6_macOS.jpg)
* 资源窗口
<img src="basicResForm_macos.jpg" width="987" height="620" />
![basicResForm_macos](basicResForm_macos.jpg)
* liblcl MiniWebview cocoa接口
![miniweb_liblcl_win](miniweb_liblcl_macOS_cocoa.jpg)
* 基于bass的mp3Player
![mp3Player_liblcl_macOS](mp3Player_liblcl_macOS.jpg)
Binary file modified Screenshot/basicResForm_macos.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshot/miniweb_liblcl_macOS_cocoa.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshot/miniweb_liblcl_win.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshot/miniweb_libvcl_win.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshot/mp3Player_liblcl_macOS.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshot/mp3Player_linux.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshot/mp3Player_win.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions Tools/res2go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ usage: res2go [-path "C:\project\"] [-outpath "C:\xxx\"] [-outmain true] [-outre
-encrypt Using the encrypted format of the *.gfm file, the default is false.
-usestr When the -outbytes flag is true, adding this parameter will output the bytes as characters, the default is false.
-origfn The generated .go file uses the original delphi/lazarus unit name, the default is false.
-pause After the end, pause according to the option, for example: -pause "ew", indicating that there is a fault or warning, you can choose "e", "w", "a" e=error, w=warning, a=ignore other options, always display.
-h -help Show help.
-v -version Show Version.
```
Expand All @@ -36,7 +37,7 @@ Open the IDE: Menu -> Tools -> Configure Tools -> Add
Title The name displayed on the menu
Program res2go program full file name (including path)
Working directory Working directory, no need to fill
Parameters Command line arguments (the code will be generated in the gocode directory under the current project directory after running): -path "$PATH($PROJECT)" -outpath "$PATH($PROJECT)/gocode"
Parameters Command line arguments (the code will be generated in the gocode directory under the current project directory after running): -path "$PATH($PROJECT)" -outpath "$PATH($PROJECT)/gocode" -pause "ew"
```

* Lazarus IDE
Expand All @@ -46,7 +47,7 @@ Open the IDE: Menu -> Tools -> Configure External Tools -> Add
```
Title The name displayed on the menu
Program Filename res2go program full file name (including path)
Parameters Command line arguments (the code will be generated in the gocode directory under the current project directory after running): -path "$Path($ProjFile())" -outpath "$Path($ProjFile())/gocode"
Parameters Command line arguments (the code will be generated in the gocode directory under the current project directory after running): -path "$Path($ProjFile())" -outpath "$Path($ProjFile())/gocode" -pause "ew"
Working Directory Working directory, no need to fill
Lazarus can also fill in the shortcut keys and set them in the Key group.
Expand Down
5 changes: 3 additions & 2 deletions Tools/res2go/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
-encrypt 使用加密格式的*.gfm文件,默认为false。
-usestr 当-outbytes标识为true时,加上此参数会以字符形式输出字节,默认为true。
-origfn 生成的.go文件使用原始的delphi/lazarus单元名,默认为false。
-pause 结束后根据选项暂停,比如: -pause "ew",表示有错或者警告,可选为“e”,“w”,“a” e=错误,w=警告,a=忽略其它选项,总是显示。
-h -help 显示帮助。
-v -version 显示版本号。
```
Expand All @@ -36,7 +37,7 @@
Title 菜单栏显示的名字
Program res2go程序全文件名(含路径)
Working directory 工作目录,可不填
Parameters 命令行参数(填这句,运行后会在当前工程目录下的gocode生成代码): -path "$PATH($PROJECT)" -outpath "$PATH($PROJECT)/gocode"
Parameters 命令行参数(填这句,运行后会在当前工程目录下的gocode生成代码): -path "$PATH($PROJECT)" -outpath "$PATH($PROJECT)/gocode" -pause "ew"
```

* Lazarus IDE
Expand All @@ -46,7 +47,7 @@ Parameters 命令行参数(填这句,运行后会在当前工程目
```
Title 菜单栏显示的名字
Program Filename res2go程序全文件名(含路径)
Parameters 命令行参数(填这句,运行后会在当前工程目录下的gocode生成代码): -path "$Path($ProjFile())" -outpath "$Path($ProjFile())/gocode"
Parameters 命令行参数(填这句,运行后会在当前工程目录下的gocode生成代码): -path "$Path($ProjFile())" -outpath "$Path($ProjFile())/gocode" -pause "ew"
Working directory 工作目录,可不填
Lazarus 还可以额外填写快捷键,在Key分组里面设置。
Expand Down
Binary file modified Tools/res2go/res2go.zip
Binary file not shown.
Loading

0 comments on commit 9787a22

Please sign in to comment.