Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
twgh committed May 3, 2024
1 parent e95e500 commit e96d5cf
Show file tree
Hide file tree
Showing 106 changed files with 4,577 additions and 3,077 deletions.
13 changes: 7 additions & 6 deletions README-en.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 align="center">XCGUI</h1>
<p align="center">
<a href="https://github.com/twgh/xcgui/releases"><img src="https://img.shields.io/badge/release-1.3.382-blue" alt="release"></a>
<a href="http://www.xcgui.com"><img src="https://img.shields.io/badge/XCGUI-3.3.8-blue" alt="XCGUI"></a>
<a href="https://github.com/twgh/xcgui/releases"><img src="https://img.shields.io/badge/release-1.3.390-blue" alt="release"></a>
<a href="http://www.xcgui.com"><img src="https://img.shields.io/badge/XCGUI-3.3.9-blue" alt="XCGUI"></a>
<a href="https://golang.org"> <img src="https://img.shields.io/badge/golang-1.16-blue" alt="golang"></a>
<a href="https://pkg.go.dev/github.com/twgh/xcgui"><img src="https://img.shields.io/badge/go.dev-reference-brightgreen" alt="GoDoc"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-brightgreen" alt="License"></a>
Expand All @@ -19,6 +19,7 @@




## Introduction

English | [简体中文](./README.md)
Expand All @@ -28,7 +29,7 @@ English | [简体中文](./README.md)
- DirectUI design idea: there is no sub-window in the window, the interface elements are all logical areas (no HWND handle, safe, flexible), all UI elements are developed independently (not restricted by the system), more flexible to achieve various Program interface to meet the needs of different users.
- Has a free UI designer tool: rapid development tools, what you see is what you get, a highly customizable system (DIY), making UI development easier.
- Support Direct2D, hardware acceleration, can make full use of hardware features to create high-performance, high-quality 2D graphics.
- [wiki](https://github.com/twgh/xcgui/wiki) There is a simple introductory tutorial, you can take a look when you have time.
- [WIKI](https://github.com/twgh/xcgui/wiki) There is a simple introductory tutorial, you can take a look when you have time.

## Get

Expand Down Expand Up @@ -98,13 +99,13 @@ It is best to put it in the `C:\Windows\System32` directory during development,
64bit

```bash
curl -fL "https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui.dll?version=latest" -o xcgui.dll
iwr https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui.dll?version=latest -OutFile xcgui.dll
```

32bit

```bash
curl -fL "https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui-32.dll?version=latest" -o xcgui.dll
iwr https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui-32.dll?version=latest -OutFile xcgui.dll
```

#### (3)Download using the getxcgui tool
Expand Down Expand Up @@ -196,7 +197,7 @@ In some cases, it is more convenient to mix the native functions in the xc packa

All the structures of xcgui are also in the xc package.

[Goland](https://www.jetbrains.com/go/?from=xcgui) is recommended for development for the best development experience. The comment format I'm using looks the best in Goland.
[Goland](https://www.jetbrains.com/go/?from=xcgui) is recommended for development for the best development experience.

## Event

Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 align="center">XCGUI</h1>
<p align="center">
<a href="https://github.com/twgh/xcgui/releases"><img src="https://img.shields.io/badge/release-1.3.382-blue" alt="release"></a>
<a href="http://www.xcgui.com"><img src="https://img.shields.io/badge/XCGUI-3.3.8-blue" alt="XCGUI"></a>
<a href="https://github.com/twgh/xcgui/releases"><img src="https://img.shields.io/badge/release-1.3.390-blue" alt="release"></a>
<a href="http://www.xcgui.com"><img src="https://img.shields.io/badge/XCGUI-3.3.9-blue" alt="XCGUI"></a>
<a href="https://golang.org"> <img src="https://img.shields.io/badge/golang-1.16-blue" alt="golang"></a>
<a href="https://pkg.go.dev/github.com/twgh/xcgui"><img src="https://img.shields.io/badge/go.dev-reference-brightgreen" alt="GoDoc"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-brightgreen" alt="License"></a>
Expand All @@ -20,6 +20,7 @@




## 介绍

[English](./README-en.md) | 简体中文
Expand All @@ -29,7 +30,7 @@
- DirectUI设计思想:在窗口内没有子窗口,界面元素都是逻辑上的区域(无HWND句柄,安全,灵活),所有UI元素都是自主开发(不受系统限制),更加灵活的实现各种程序界面,满足不同用户的需求。
- 拥有免费的UI设计器:快速开发工具,所见即所得,高度自定义系统(DIY),让UI开发变的更加简单。
- 支持Direct2D,硬件加速,能更大程度的发挥硬件特性,创建高性能,高质量的2D图形。
- [wiki](https://github.com/twgh/xcgui/wiki) 里有简单的入门教程,有空可以看一下,少走弯路。
- [WIKI](https://github.com/twgh/xcgui/wiki) 里有简单的入门教程,有空可以看一下,少走弯路。
- 有完善的 [中文官方文档](http://www.xcgui.com/doc-ui/)[官方资源社区](http://mall.xcgui.com)
- 官方QQ群(人多用各种语言的都有):[2283812](https://jq.qq.com/?_wv=1027&k=AiXY4uMc),只聊Go语言版的QQ群:[793788011](https://jq.qq.com/?_wv=1027&k=bkKgsYYk)

Expand Down Expand Up @@ -101,13 +102,13 @@ func main() {
64位

```bash
curl -fL "https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui.dll?version=latest" -o xcgui.dll
iwr https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui.dll?version=latest -OutFile xcgui.dll
```

32位

```bash
curl -fL "https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui-32.dll?version=latest" -o xcgui.dll
iwr https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui-32.dll?version=latest -OutFile xcgui.dll
```

#### (3)使用getxcgui工具下载
Expand Down Expand Up @@ -191,19 +192,19 @@ var svgIcon = `<svg t="1669088647057" class="icon" viewBox="0 0 1024 1024" versi

xcc包里都是常量,像这样使用:`xcc.Window_Transparent_Shadow`

需要用到xcc包常量的参数注释都是类似这样的,复制`Window_Transparent_`[xcc包](https://pkg.go.dev/github.com/twgh/xcgui/xcc#pkg-constants)里搜索即可看到相关常量注释:
需要用到xcc包常量的参数注释都是类似这样的,复制`Window_Transparent_` [xcc包](https://pkg.go.dev/github.com/twgh/xcgui/xcc#pkg-constants) 里搜索即可看到相关常量注释:

[![注释](https://s4.ax1x.com/2021/12/22/TQvQzt.png)](https://github.com/twgh/xcgui/blob/main/window/windowbase.go#L630)

## 命令介绍

xc包里包含xcgui.dll里所有的API,有一千多个函数,可以直接使用,封装好的类都在其他包里。
xc包里包含xcgui.dll里所有的API,有近2000个函数,不习惯使用类的可以直接使用,封装好的类都在其他包里。

在某些情况下,把xc包里的原生函数与封装好的类混合起来使用会更加方便。

炫彩所有的结构体也都在xc包里。

建议使用 [Goland](https://www.jetbrains.com/go/?from=xcgui) 进行开发,以获得最好的开发体验。本项目所使用的注释格式在Goland里看起来是最好的。
建议使用 [Goland](https://www.jetbrains.com/go/?from=xcgui) 进行开发,以获得最好的开发体验。

## 事件

Expand Down
18 changes: 10 additions & 8 deletions adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,36 @@ import (
"github.com/twgh/xcgui/xc"
)

// 数据适配器.
// adapter 数据适配器.
type adapter struct {
objectbase.ObjectBase
}

// 数据适配器_增加引用计数.
func (a *adapter) AddRef() int {
func (a *adapter) AddRef() int32 {
return xc.XAd_AddRef(a.Handle)
}

// 数据适配器_释放引用计数.
func (a *adapter) Release() int {
func (a *adapter) Release() int32 {
return xc.XAd_Release(a.Handle)
}

// 数据适配器_取引用计数.
func (a *adapter) GetRefCount() int {
func (a *adapter) GetRefCount() int32 {
return xc.XAd_GetRefCount(a.Handle)
}

// 数据适配器_销毁.
func (a *adapter) Destroy() int {
return xc.XAd_Destroy(a.Handle)
func (a *adapter) Destroy() *adapter {
xc.XAd_Destroy(a.Handle)
return a
}

// 数据适配器_启用自动销毁.
//
// bEnable: 是否启用.
func (a *adapter) EnableAutoDestroy(bEnable bool) int {
return xc.XAd_EnableAutoDestroy(a.Handle, bEnable)
func (a *adapter) EnableAutoDestroy(bEnable bool) *adapter {
xc.XAd_EnableAutoDestroy(a.Handle, bEnable)
return a
}

0 comments on commit e96d5cf

Please sign in to comment.