{"id":21088104,"url":"https://github.com/twgh/xc-elementui","last_synced_at":"2025-05-16T11:32:24.822Z","repository":{"id":261361350,"uuid":"884079833","full_name":"twgh/xc-elementui","owner":"twgh","description":"使用 xcgui 仿 Elementui，元素样式具有一致性，快速开发界面。","archived":false,"fork":false,"pushed_at":"2025-02-05T13:35:10.000Z","size":485,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T01:01:38.835Z","etag":null,"topics":["desktop-app","direct2d","directui","elementui","go","go-gui","golang","golang-tool","gui","gui-application","gui-framework","gui-library","gui-toolkit","windows","windows-app","windows-desktop","windows-gui","xcgui"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/twgh/xc-elementui","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twgh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-06T05:18:02.000Z","updated_at":"2025-02-05T13:35:13.000Z","dependencies_parsed_at":"2025-02-05T14:37:37.928Z","dependency_job_id":null,"html_url":"https://github.com/twgh/xc-elementui","commit_stats":null,"previous_names":["twgh/xc-elementui"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twgh%2Fxc-elementui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twgh%2Fxc-elementui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twgh%2Fxc-elementui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twgh%2Fxc-elementui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twgh","download_url":"https://codeload.github.com/twgh/xc-elementui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254522215,"owners_count":22085067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["desktop-app","direct2d","directui","elementui","go","go-gui","golang","golang-tool","gui","gui-application","gui-framework","gui-library","gui-toolkit","windows","windows-app","windows-desktop","windows-gui","xcgui"],"created_at":"2024-11-19T21:14:45.118Z","updated_at":"2025-05-16T11:32:19.810Z","avatar_url":"https://github.com/twgh.png","language":"Go","readme":"\u003ch1 align=\"center\"\u003exc-elementui\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/twgh/xcgui\"\u003e\u003cimg src=\"https://img.shields.io/badge/xcgui-1.3.392-blue\" alt=\"xcgui\"\u003e\u003c/a\u003e\n   \u003ca href=\"https://golang.org\"\u003e \u003cimg src=\"https://img.shields.io/badge/golang-≥1.16-blue\" alt=\"golang\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pkg.go.dev/github.com/twgh/xc-elementui\"\u003e\u003cimg src=\"https://img.shields.io/badge/go.dev-reference-brightgreen\" alt=\"GoDoc\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/twgh/xc-elementui/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-brightgreen\" alt=\"License\"\u003e\u003c/a\u003e\n    \u003cbr\u003e\u003cbr\u003e\n    \u003ca href=\"https://github.com/twgh/xc-elementui/tree/main/example\"\u003e程序示例\u003c/a\u003e\u0026nbsp;\u0026nbsp;\n\t\u003ca href=\"https://pkg.go.dev/github.com/twgh/xc-elementui\"\u003e项目文档\u003c/a\u003e\u0026nbsp;\u0026nbsp;\n\u003c/p\u003e\n\n\n\n\n\n## 介绍\n\n- 使用 [xcgui](https://github.com/twgh/xcgui) 仿 [Elementui](https://element.eleme.cn/#/zh-CN/component/installation)，元素样式具有一致性，快速开发界面。\n- 内置 2000+ [Font Awesome](https://fa6.dashgame.com/) 免费图标，风格一致，开箱即用。\n\n## 获取\n\n```bash\ngo get -u github.com/twgh/xc-elementui\n```\n\n## 动态链接库下载\n\n程序运行时需要把 `xcgui.dll` 放到程序运行目录。\n\n在开发时最好是放到 `C:\\Windows\\System32` 目录，这样就不需要频繁把dll放到不同程序的运行目录了。\n\n#### 文件直链\n\n| 64位 | [点击下载](https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui.dll?version=latest) |\n| ---- | ------------------------------------------------------------ |\n| 32位 | [点击下载](https://pkggo-generic.pkg.coding.net/xcgui/file/xcgui-32.dll?version=latest) |\n\n\n## 按钮例子\n\n[![按钮例子](https://gitee.com/twgh/xc-elementui/raw/main/example/AllButton/1.png)](https://github.com/twgh/xc-elementui/tree/main/example/AllButton)\n\n## 简单用法\n\n```go\npackage main\n\nimport (\n\t\"github.com/twgh/xc-elementui/eui\"\n\t\"github.com/twgh/xcgui/app\"\n\t\"github.com/twgh/xcgui/font\"\n\t\"github.com/twgh/xcgui/imagex\"\n\t\"github.com/twgh/xcgui/svg\"\n\t\"github.com/twgh/xcgui/window\"\n\t\"github.com/twgh/xcgui/xc\"\n\t\"github.com/twgh/xcgui/xcc\"\n\t\"time\"\n)\n\nvar (\n\ta *app.App\n\tw *window.Window\n\te *eui.Elementui\n)\n\nfunc main() {\n\ta = app.New(true)\n\ta.EnableAutoDPI(true).EnableDPI(true)\n\t// 设置默认字体\n\ta.SetDefaultFont(font.NewEX(\"微软雅黑\", 10, xcc.FontStyle_Regular).Handle)\n\t// 设置默认窗口图标\n\ta.SetWindowIcon(imagex.NewBySvgStringW(svg_element).Handle)\n\n\t// 创建窗口\n\tw = window.New(0, 0, 500, 400, \"xc-elementui 简单例子\", 0, xcc.Window_Style_Default|xcc.Window_Style_Drag_Window)\n\t// 设置窗口边框大小\n\tw.SetBorderSize(0, 32, 0, 0)\n\t// 设置窗口阴影, 圆角\n\tw.SetTransparentType(xcc.Window_Transparent_Shadow).SetShadowInfo(8, 255, 10, false, 0).SetTransparentAlpha(255)\n\t// 窗口启用布局, 水平垂直居中, 自动换行\n\tw.EnableLayout(true).SetSpace(10).SetSpaceRow(10).SetAlignH(xcc.Layout_Align_Center).SetAlignV(xcc.Layout_Align_Center).EnableAutoWrap(true)\n\n\t// 创建Elementui对象\n\te = eui.NewElementui(12, w.GetDPI())\n\n\t// 默认按钮\n\te.CreateButton(0, 0, 0, 0, \"默认按钮\", w.Handle)\n\t// 主要按钮\n\te.CreateButton(0, 0, 0, 0, \"主要按钮\", w.Handle, eui.ButtonOption{Style: eui.ButtonStyle_Primary})\n\t// 图标+文字按钮 成功按钮\n\te.CreateButton(0, 0, 0, 0, \"图标文字\", w.Handle, eui.ButtonOption{IconName: \"fa-house-medical-flag\", Style: eui.ButtonStyle_Success})\n\t// 图标+文字按钮 信息按钮 朴素按钮\n\te.CreateButton(0, 0, 0, 0, \"朴素按钮\", w.Handle, eui.ButtonOption{IconName: \"fa-jet-fighter\", Style: eui.ButtonStyle_Info, IsPlain: true})\n\t// 图标+文字按钮 禁用状态 警告按钮\n\te.CreateButton(0, 0, 0, 0, \"禁用状态\", w.Handle, eui.ButtonOption{IconName: \"fa-wpexplorer\", Style: eui.ButtonStyle_Warning}).Enable(false)\n\t// 图标+文字 圆角按钮 警告按钮\n\te.CreateButton(0, 0, 0, 0, \"圆角按钮\", w.Handle, eui.ButtonOption{IconName: \"fa-circle-radiation\", IsRound: true, Style: eui.ButtonStyle_Warning})\n\t// 图标按钮 危险按钮\n\te.CreateButton(0, 0, 56, 40, \"\", w.Handle, eui.ButtonOption{IconName: \"fa-volcano\", Style: eui.ButtonStyle_Danger})\n\t// 圆形图标按钮 主要按钮\n\te.CreateButton(0, 0, 40, 40, \"\", w.Handle, eui.ButtonOption{IconName: \"fa-text-height\", IsCircle: true, Style: eui.ButtonStyle_Primary})\n\n\t// 图标按钮 默认按钮 自定义svg图标\n\tsvgElement := svg.NewByStringW(svg_element).SetSize(20, 20)\n\tbtn0 := e.CreateButton(0, 0, 0, 0, \"点我加载\", w.Handle, eui.ButtonOption{HSvg: svgElement.Handle, Style: eui.ButtonStyle_Primary})\n\tbtn0.Event_BnClick1(func(hEle int, pbHandled *bool) int {\n\t\tbtn0.SetLoading(true, 0, \"\")\n\t\tgo func() {\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t\t/*\n\t\t\t\t在这里做一些加载数据的操作, 比如读取数据库数据\n\t\t\t*/\n\t\t\txc.XC_CallUT(func() {\n\t\t\t\t/*\n\t\t\t\t\t拿到数据库数据后, 如果要赋予ui元素数据, 要在这里操作ui元素\n\t\t\t\t*/\n\t\t\t\tbtn0.SetLoading(false, 0, \"\")\n\t\t\t})\n\t\t}()\n\t\treturn 0\n\t})\n\n\tw.Show(true)\n\ta.Run()\n\ta.Exit()\n}\n\nconst svg_element = `\u003csvg t=\"1731392844936\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"5912\" width=\"24\" height=\"24\"\u003e\u003cpath d=\"M903.84 705.78c-0.23 37.18-19.54 45.46-19.54 45.46S551.44 943.85 529.8 955.9c-21.43 9.22-35.79 0-35.79 0S145.74 753.64 133.03 744.75C120.31 735.86 120 722 120 722s0.35-400.51 0-419.07c-0.36-18.53 22.77-32.47 22.77-32.47l348-201.44c21.43-11.32 42.27 0 42.27 0s307.45 178.96 341.5 198.18c33.42 15.89 29.29 48.71 29.29 48.71s0.2 355.3 0.01 389.87z m-138.96-402c-71.26-41.08-239.11-138.46-239.11-138.46s-16.39-8.87-33.21 0L219.33 322.95s-18.15 10.92-17.89 25.42c0.28 14.52 0 327.98 0 327.98s0.24 10.85 10.22 17.8c9.99 6.96 283.45 165.24 283.45 165.24s11.26 7.22 28.09 0c17-9.43 278.34-160.17 278.34-160.17s15.15-6.48 15.31-35.6c0.07-8.37 0.1-40.96 0.1-81.86L509.24 768.42V697c0-29.33 22.67-48.69 22.67-48.69l272.17-164.2c10.27-10.76 12.39-27.94 12.81-34.45v-72.39L509.24 563.88v-74.65c0-29.36 19.45-42.21 19.45-42.21l236.2-143.26v0.02z m0 0\" fill=\"#FDDD48\" p-id=\"5913\"\u003e\u003c/path\u003e\u003c/svg\u003e`\n```\n\n\n## 其它组件预期效果\n\n![预期效果](https://gitee.com/twgh/image/raw/master/xc-elementui/yuqi.jpg)\n\n## 开发进度\n\n- [x] 按钮\n- [ ] 输入框\n- [ ] 单选框\n- [ ] 多选框\n- [ ] 开关按钮\n- [ ] 文字链接\n- [ ] 选择器\n- [ ] 时间选择器\n- [ ] 日期选择器\n- [ ] 滑块\n- [ ] 计数器\n- [ ] 颜色选择器\n- [ ] 标签\n- [ ] 进度条\n- [ ] 导航菜单\n- [ ] 标签页\n- [ ] 步骤条\n- [ ] 文字提示\n- [ ] 弹出框\n- [ ] 卡片\n- [ ] 折叠面板\n- [ ] ...\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwgh%2Fxc-elementui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwgh%2Fxc-elementui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwgh%2Fxc-elementui/lists"}