mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-05-10 10:19:47 +08:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6509ef98e4 | |||
| c928c271e8 | |||
| 02e702b285 | |||
| af3138c146 | |||
| 6e6adf3b85 | |||
| e84b33c5ca | |||
| ac6b409f3a | |||
| 1bbe95582a | |||
| 3ecf35963d | |||
| 276d2c5fe3 | |||
| a9339f9b9f | |||
| 7fac2aab35 |
@@ -0,0 +1,72 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
project(PathEditor VERSION 3.0 LANGUAGES C)
|
||||||
|
|
||||||
|
# 启用资源编译器以处理 .rc 文件
|
||||||
|
enable_language(RC)
|
||||||
|
|
||||||
|
# 设置 C 标准
|
||||||
|
set(CMAKE_C_STANDARD 17)
|
||||||
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_C_EXTENSIONS OFF) # 禁用特定编译器的扩展(如 gnu17),强制使用标准 C17
|
||||||
|
|
||||||
|
# 定义源文件
|
||||||
|
set(SOURCES
|
||||||
|
src/main.c
|
||||||
|
src/utils.c
|
||||||
|
src/registry.c
|
||||||
|
src/callbacks.c
|
||||||
|
src/ui.c
|
||||||
|
src/globals.c
|
||||||
|
ico/resources.rc
|
||||||
|
)
|
||||||
|
|
||||||
|
# 创建 GUI 可执行文件(WIN32 属性会自动添加 -mwindows 参数)
|
||||||
|
add_executable(${PROJECT_NAME} WIN32 ${SOURCES})
|
||||||
|
|
||||||
|
# 添加宏定义
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||||
|
_WIN32
|
||||||
|
UNICODE
|
||||||
|
_UNICODE
|
||||||
|
)
|
||||||
|
|
||||||
|
# 添加编译选项
|
||||||
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||||
|
-Wall
|
||||||
|
-O2
|
||||||
|
-fexec-charset=UTF-8
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# 设置头文件搜索路径
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE
|
||||||
|
${CMAKE_SOURCE_DIR}/include
|
||||||
|
${CMAKE_SOURCE_DIR}/libs/IUP/include
|
||||||
|
)
|
||||||
|
|
||||||
|
# 设置库文件搜索路径
|
||||||
|
target_link_directories(${PROJECT_NAME} PRIVATE
|
||||||
|
${CMAKE_SOURCE_DIR}/libs/IUP
|
||||||
|
)
|
||||||
|
|
||||||
|
# 链接所需库
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
|
iup
|
||||||
|
iupcd
|
||||||
|
gdi32
|
||||||
|
comdlg32
|
||||||
|
comctl32
|
||||||
|
uuid
|
||||||
|
ole32
|
||||||
|
advapi32
|
||||||
|
)
|
||||||
|
|
||||||
|
# 编译完成后,仅将程序实际需要的核心 DLL 文件复制到构建输出目录
|
||||||
|
set(IUP_REQUIRED_DLLS "${CMAKE_CURRENT_SOURCE_DIR}/libs/IUP/iup.dll")
|
||||||
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
|
${IUP_REQUIRED_DLLS}
|
||||||
|
"$<TARGET_FILE_DIR:${PROJECT_NAME}>"
|
||||||
|
COMMENT "Copying required DLLs to build directory..."
|
||||||
|
)
|
||||||
@@ -18,9 +18,9 @@ CFLAGS = -Wall -O2 -I$(INCLUDE_DIR) -I$(LOCAL_INCLUDE_DIR) -D_WIN32 -DUNICODE -D
|
|||||||
LDFLAGS = -L$(LIB_DIR) -liup -liupcd -lgdi32 -lcomdlg32 -lcomctl32 -luuid -lole32 -ladvapi32 -mwindows
|
LDFLAGS = -L$(LIB_DIR) -liup -liupcd -lgdi32 -lcomdlg32 -lcomctl32 -luuid -lole32 -ladvapi32 -mwindows
|
||||||
|
|
||||||
# Source
|
# Source
|
||||||
SRC = src/main.c src/utils.c src/registry.c src/callbacks.c src/ui.c
|
SRC = src/main.c src/utils.c src/registry.c src/callbacks.c src/ui.c src/globals.c
|
||||||
RES = ico/resources.rc
|
RES = ico/resources.rc
|
||||||
OBJ = $(OBJ_DIR)/main.o $(OBJ_DIR)/utils.o $(OBJ_DIR)/registry.o $(OBJ_DIR)/callbacks.o $(OBJ_DIR)/ui.o $(OBJ_DIR)/resources.o
|
OBJ = $(OBJ_DIR)/main.o $(OBJ_DIR)/utils.o $(OBJ_DIR)/registry.o $(OBJ_DIR)/callbacks.o $(OBJ_DIR)/ui.o $(OBJ_DIR)/globals.o $(OBJ_DIR)/resources.o
|
||||||
EXE = $(BIN_DIR)/PathEditor.exe
|
EXE = $(BIN_DIR)/PathEditor.exe
|
||||||
|
|
||||||
all: $(BIN_DIR) $(OBJ_DIR) $(EXE)
|
all: $(BIN_DIR) $(OBJ_DIR) $(EXE)
|
||||||
@@ -49,6 +49,9 @@ $(OBJ_DIR)/callbacks.o: src/callbacks.c
|
|||||||
$(OBJ_DIR)/ui.o: src/ui.c
|
$(OBJ_DIR)/ui.o: src/ui.c
|
||||||
$(CC) $(CFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
$(OBJ_DIR)/globals.o: src/globals.c
|
||||||
|
$(CC) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
$(OBJ_DIR)/resources.o: ico/resources.rc
|
$(OBJ_DIR)/resources.o: ico/resources.rc
|
||||||
$(WINDRES) -i $< -o $@
|
$(WINDRES) -i $< -o $@
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,13 @@
|
|||||||
|
|
||||||
* **轻量级**:原生 C 语言编写,无臃肿依赖,运行速度极快。
|
* **轻量级**:原生 C 语言编写,无臃肿依赖,运行速度极快。
|
||||||
|
|
||||||
|
## 🏗️ 架构与二次开发
|
||||||
|
|
||||||
|
本项目注重代码的模块化和可维护性,非常适合作为 C 语言桌面程序开发的参考:
|
||||||
|
|
||||||
|
* **统一配置中心**:所有的 UI 尺寸、间距、颜色等常量配置均提取在 `include/config.h` 中,只需修改宏定义即可轻松定制属于你的专属界面风格。
|
||||||
|
* **清晰的全局状态**:全局变量和常量被独立分离在 `src/globals.c` / `include/globals.h` 中管理,使得核心业务逻辑更加整洁。
|
||||||
|
|
||||||
## 📦 下载与安装
|
## 📦 下载与安装
|
||||||
|
|
||||||
您可以从 [Releases](https://github.com/LHY0125/PathEditor/releases) 页面下载最新的安装包 (`PathEditorSetup.exe`)。
|
您可以从 [Releases](https://github.com/LHY0125/PathEditor/releases) 页面下载最新的安装包 (`PathEditorSetup.exe`)。
|
||||||
@@ -47,11 +54,13 @@
|
|||||||
|
|
||||||
* Windows 操作系统
|
* Windows 操作系统
|
||||||
* GCC 编译器 (推荐 MinGW-w64)
|
* GCC 编译器 (推荐 MinGW-w64)
|
||||||
* Make 工具
|
* CMake 工具 (推荐使用 CMake 构建)
|
||||||
* IUP 库 (已包含在 `libs` 目录下)
|
* IUP 库 (已包含在 `libs` 目录下)
|
||||||
* Inno Setup 6 (仅打包需要)
|
* Inno Setup 6 (仅打包需要)
|
||||||
|
|
||||||
### 编译步骤
|
### 编译步骤 (推荐使用 CMake)
|
||||||
|
|
||||||
|
本项目已迁移至 CMake 构建系统,支持生成更标准的构建文件并集成到各大 IDE。
|
||||||
|
|
||||||
1. 克隆仓库:
|
1. 克隆仓库:
|
||||||
|
|
||||||
@@ -60,14 +69,20 @@
|
|||||||
cd PathEditor
|
cd PathEditor
|
||||||
```
|
```
|
||||||
|
|
||||||
2. 编译项目:
|
2. 使用 CMake 配置和编译:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mingw32-make
|
# 生成构建系统 (以 MinGW 为例)
|
||||||
|
cmake -B build -G "MinGW Makefiles"
|
||||||
|
|
||||||
|
# 编译项目
|
||||||
|
cmake --build build
|
||||||
```
|
```
|
||||||
|
|
||||||
3. 运行:
|
3. 运行:
|
||||||
编译成功后,可执行文件位于 `bin/PathEditor.exe`。
|
编译成功后,可执行文件位于 `build/PathEditor.exe`。
|
||||||
|
|
||||||
|
*(注:项目依然保留了传统的 `mingw32-make` 方式,您可以直接在根目录运行 `mingw32-make` 进行编译,产物位于 `bin/` 目录。)*
|
||||||
|
|
||||||
### 打包 (可选)
|
### 打包 (可选)
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -1,7 +1,4 @@
|
|||||||
@echo off
|
@echo off
|
||||||
echo Copying DLLs...
|
|
||||||
if not exist bin mkdir bin
|
|
||||||
copy /Y "libs\iup-3.31_Win64_dllw6_lib\*.dll" bin\
|
|
||||||
|
|
||||||
echo Building Installer...
|
echo Building Installer...
|
||||||
"D:\Program Files (x86)\Inno Setup 6\ISCC.exe" "dist\installer.iss"
|
"D:\Program Files (x86)\Inno Setup 6\ISCC.exe" "dist\installer.iss"
|
||||||
|
|||||||
Vendored
+2
-2
@@ -37,8 +37,8 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
|
|||||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "d:\Code\doing_exercises\programs\PathEditor\bin\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "d:\Code\doing_exercises\programs\PathEditor\build\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "d:\Code\doing_exercises\programs\PathEditor\bin\*.dll"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "d:\Code\doing_exercises\programs\PathEditor\build\*.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
#ifndef CONFIG_H
|
||||||
|
#define CONFIG_H
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// UI的配置常量
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// 应用程序名称
|
||||||
|
#define APP_NAME "PathEditor" // 编辑环境变量应用程序名称
|
||||||
|
#define APP_NAME_READONLY "PathEditor (只读模式)" // 编辑环境变量只读模式标题
|
||||||
|
|
||||||
|
// 对话框设置
|
||||||
|
#define UI_DLG_SIZE "800x800" // 对话框默认大小 (像素)
|
||||||
|
#define UI_DLG_MINSIZE "800x800" // 对话框最小大小 (像素)
|
||||||
|
|
||||||
|
// 列表控件设置
|
||||||
|
#define UI_LIST_ITEM_PADDING "5x5" // 列表项内边距
|
||||||
|
#define UI_LIST_BACKCOLOR "255 255 255" // 列表背景颜色
|
||||||
|
|
||||||
|
// 按钮设置
|
||||||
|
#define UI_BTN_RASTERSIZE "100x32" // 按钮默认大小
|
||||||
|
|
||||||
|
// 布局间隙和边距
|
||||||
|
#define UI_VBOX_GAP "5" // 垂直布局项间隙
|
||||||
|
#define UI_VBOX_MARGIN "0x0" // 垂直布局外边距
|
||||||
|
#define UI_VBOX_ALL_MARGIN "10x10" // 垂直布局总外边距
|
||||||
|
#define UI_VBOX_ALL_GAP "5" // 垂直布局总间隙
|
||||||
|
|
||||||
|
#define UI_HBOX_GAP "10" // 水平布局项间隙
|
||||||
|
#define UI_HBOX_MARGIN "10x10" // 水平布局外边距
|
||||||
|
#define UI_HBOX_ALIGNMENT "ACENTER" // 水平布局对齐方式
|
||||||
|
|
||||||
|
#endif // CONFIG_H
|
||||||
@@ -3,6 +3,16 @@
|
|||||||
|
|
||||||
#include <iup.h>
|
#include <iup.h>
|
||||||
|
|
||||||
|
// 定义 Windows 消息常量
|
||||||
|
#ifndef WM_COPYGLOBALDATA
|
||||||
|
#define WM_COPYGLOBALDATA 0x0049
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// 消息过滤器常量
|
||||||
|
#ifndef MSGFLT_ADD
|
||||||
|
#define MSGFLT_ADD 1
|
||||||
|
#endif
|
||||||
|
|
||||||
// 注册表路径常量
|
// 注册表路径常量
|
||||||
#define REG_PATH_SYS L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"
|
#define REG_PATH_SYS L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"
|
||||||
#define REG_PATH_USER L"Environment"
|
#define REG_PATH_USER L"Environment"
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,14 @@
|
|||||||
|
#include "globals.h"
|
||||||
|
#include <windows.h>
|
||||||
|
#include <iup.h>
|
||||||
|
|
||||||
|
// 全局变量定义
|
||||||
|
StringList raw_sys_paths = {0};
|
||||||
|
StringList raw_user_paths = {0};
|
||||||
|
|
||||||
|
// 全局控件定义
|
||||||
|
Ihandle *dlg, *tabs_main, *list_sys, *list_user, *lbl_status; // 主窗口、标签页、系统路径列表、用户路径列表、状态标签
|
||||||
|
Ihandle *btn_new, *btn_edit, *btn_browse, *btn_del, *btn_up, *btn_down; // 右侧按钮
|
||||||
|
Ihandle *btn_ok, *btn_cancel, *btn_help; // 确认取消帮助按钮
|
||||||
|
Ihandle *btn_clean; // 一键清理按钮
|
||||||
|
Ihandle *txt_search; // 搜索框
|
||||||
+16
-26
@@ -8,26 +8,15 @@
|
|||||||
#include "registry.h"
|
#include "registry.h"
|
||||||
#include "callbacks.h"
|
#include "callbacks.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
// 定义 Windows 消息常量
|
/*
|
||||||
#ifndef WM_COPYGLOBALDATA
|
!编译命令:
|
||||||
#define WM_COPYGLOBALDATA 0x0049
|
cmake -B build -G "MinGW Makefiles"
|
||||||
#endif
|
cmake --build build
|
||||||
|
!打包命令:
|
||||||
#ifndef MSGFLT_ADD
|
build_installer.bat
|
||||||
#define MSGFLT_ADD 1
|
*/
|
||||||
#endif
|
|
||||||
|
|
||||||
// 全局变量定义
|
|
||||||
StringList raw_sys_paths = {0};
|
|
||||||
StringList raw_user_paths = {0};
|
|
||||||
|
|
||||||
// 全局控件定义
|
|
||||||
Ihandle *dlg, *tabs_main, *list_sys, *list_user, *lbl_status; // 主窗口、标签页、系统路径列表、用户路径列表、状态标签
|
|
||||||
Ihandle *btn_new, *btn_edit, *btn_browse, *btn_del, *btn_up, *btn_down; // 右侧按钮
|
|
||||||
Ihandle *btn_ok, *btn_cancel, *btn_help; // 确认取消帮助按钮
|
|
||||||
Ihandle *btn_clean; // 一键清理按钮
|
|
||||||
Ihandle *txt_search; // 搜索框
|
|
||||||
|
|
||||||
// 主函数
|
// 主函数
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
@@ -80,8 +69,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
// 上部布局:Tabs + 按钮
|
// 上部布局:Tabs + 按钮
|
||||||
Ihandle *hbox_main = IupHbox(tabs_main, vbox_btns, NULL);
|
Ihandle *hbox_main = IupHbox(tabs_main, vbox_btns, NULL);
|
||||||
IupSetAttribute(hbox_main, "GAP", "10");
|
IupSetAttribute(hbox_main, "GAP", UI_HBOX_GAP);
|
||||||
IupSetAttribute(hbox_main, "MARGIN", "10x10");
|
IupSetAttribute(hbox_main, "MARGIN", UI_HBOX_MARGIN);
|
||||||
|
|
||||||
// 状态标签
|
// 状态标签
|
||||||
lbl_status = IupLabel("状态: 就绪");
|
lbl_status = IupLabel("状态: 就绪");
|
||||||
@@ -97,13 +86,14 @@ int main(int argc, char **argv)
|
|||||||
hbox_main,
|
hbox_main,
|
||||||
hbox_bottom,
|
hbox_bottom,
|
||||||
NULL);
|
NULL);
|
||||||
IupSetAttribute(vbox_all, "MARGIN", "10x10");
|
IupSetAttribute(vbox_all, "MARGIN", UI_VBOX_ALL_MARGIN);
|
||||||
IupSetAttribute(vbox_all, "GAP", "5");
|
IupSetAttribute(vbox_all, "GAP", UI_VBOX_ALL_GAP);
|
||||||
|
|
||||||
// 创建对话框
|
// 创建对话框
|
||||||
dlg = IupDialog(vbox_all);
|
dlg = IupDialog(vbox_all);
|
||||||
IupSetAttribute(dlg, "TITLE", "编辑环境变量 (IUP版)");
|
IupSetAttribute(dlg, "TITLE", APP_NAME); // 对话框标题
|
||||||
IupSetAttribute(dlg, "SIZE", "500x400"); // 稍微调大一点
|
IupSetAttribute(dlg, "RASTERSIZE", UI_DLG_SIZE); // 对话框初始大小 (像素)
|
||||||
|
IupSetAttribute(dlg, "MINSIZE", UI_DLG_MINSIZE); // 对话框最小大小 (像素)
|
||||||
IupSetAttribute(dlg, "MINBOX", "NO");
|
IupSetAttribute(dlg, "MINBOX", "NO");
|
||||||
IupSetAttribute(dlg, "MAXBOX", "NO");
|
IupSetAttribute(dlg, "MAXBOX", "NO");
|
||||||
|
|
||||||
@@ -111,7 +101,7 @@ int main(int argc, char **argv)
|
|||||||
if (!check_admin())
|
if (!check_admin())
|
||||||
{
|
{
|
||||||
IupMessage("警告", "程序未以管理员身份运行,您只能查看,无法保存更改!");
|
IupMessage("警告", "程序未以管理员身份运行,您只能查看,无法保存更改!");
|
||||||
IupSetAttribute(dlg, "TITLE", "编辑环境变量 (只读模式)");
|
IupSetAttribute(dlg, "TITLE", APP_NAME_READONLY); // 对话框标题 (只读模式)
|
||||||
IupSetAttribute(lbl_status, "TITLE", "状态: 只读模式 (权限不足)");
|
IupSetAttribute(lbl_status, "TITLE", "状态: 只读模式 (权限不足)");
|
||||||
|
|
||||||
// 禁用修改类按钮
|
// 禁用修改类按钮
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "callbacks.h"
|
#include "callbacks.h"
|
||||||
|
#include "config.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
// 创建列表控件
|
// 创建列表控件
|
||||||
@@ -8,8 +9,8 @@ Ihandle *create_path_list()
|
|||||||
{
|
{
|
||||||
Ihandle *list = IupFlatList();
|
Ihandle *list = IupFlatList();
|
||||||
IupSetAttribute(list, "EXPAND", "YES");
|
IupSetAttribute(list, "EXPAND", "YES");
|
||||||
IupSetAttribute(list, "ITEMPADDING", "5x5");
|
IupSetAttribute(list, "ITEMPADDING", UI_LIST_ITEM_PADDING);
|
||||||
IupSetAttribute(list, "BACKCOLOR", "255 255 255");
|
IupSetAttribute(list, "BACKCOLOR", UI_LIST_BACKCOLOR);
|
||||||
IupSetAttribute(list, "BORDER", "YES");
|
IupSetAttribute(list, "BORDER", "YES");
|
||||||
IupSetAttribute(list, "CANFOCUS", "YES");
|
IupSetAttribute(list, "CANFOCUS", "YES");
|
||||||
IupSetAttribute(list, "HLINE", "NO");
|
IupSetAttribute(list, "HLINE", "NO");
|
||||||
@@ -40,14 +41,14 @@ Ihandle *create_main_buttons()
|
|||||||
IupSetCallback(btn_down, "ACTION", (Icallback)btn_down_cb);
|
IupSetCallback(btn_down, "ACTION", (Icallback)btn_down_cb);
|
||||||
IupSetCallback(btn_clean, "ACTION", (Icallback)btn_clean_cb);
|
IupSetCallback(btn_clean, "ACTION", (Icallback)btn_clean_cb);
|
||||||
|
|
||||||
// 设置按钮大小 (宽度和高度都增加约1/4)
|
// 设置按钮大小
|
||||||
IupSetAttribute(btn_new, "RASTERSIZE", "100x32");
|
IupSetAttribute(btn_new, "RASTERSIZE", UI_BTN_RASTERSIZE);
|
||||||
IupSetAttribute(btn_edit, "RASTERSIZE", "100x32");
|
IupSetAttribute(btn_edit, "RASTERSIZE", UI_BTN_RASTERSIZE);
|
||||||
IupSetAttribute(btn_browse, "RASTERSIZE", "100x32");
|
IupSetAttribute(btn_browse, "RASTERSIZE", UI_BTN_RASTERSIZE);
|
||||||
IupSetAttribute(btn_del, "RASTERSIZE", "100x32");
|
IupSetAttribute(btn_del, "RASTERSIZE", UI_BTN_RASTERSIZE);
|
||||||
IupSetAttribute(btn_up, "RASTERSIZE", "100x32");
|
IupSetAttribute(btn_up, "RASTERSIZE", UI_BTN_RASTERSIZE);
|
||||||
IupSetAttribute(btn_down, "RASTERSIZE", "100x32");
|
IupSetAttribute(btn_down, "RASTERSIZE", UI_BTN_RASTERSIZE);
|
||||||
IupSetAttribute(btn_clean, "RASTERSIZE", "100x32");
|
IupSetAttribute(btn_clean, "RASTERSIZE", UI_BTN_RASTERSIZE);
|
||||||
|
|
||||||
Ihandle *vbox_btns = IupVbox(
|
Ihandle *vbox_btns = IupVbox(
|
||||||
btn_new, btn_edit, btn_browse, btn_del,
|
btn_new, btn_edit, btn_browse, btn_del,
|
||||||
@@ -56,9 +57,9 @@ Ihandle *create_main_buttons()
|
|||||||
IupFill(),
|
IupFill(),
|
||||||
btn_up, btn_down,
|
btn_up, btn_down,
|
||||||
NULL);
|
NULL);
|
||||||
IupSetAttribute(vbox_btns, "GAP", "5");
|
IupSetAttribute(vbox_btns, "GAP", UI_VBOX_GAP);
|
||||||
IupSetAttribute(vbox_btns, "MARGIN", "0x0");
|
IupSetAttribute(vbox_btns, "MARGIN", UI_VBOX_MARGIN);
|
||||||
|
|
||||||
return vbox_btns;
|
return vbox_btns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,14 +75,14 @@ Ihandle *create_bottom_buttons()
|
|||||||
IupSetCallback(btn_cancel, "ACTION", (Icallback)btn_cancel_cb);
|
IupSetCallback(btn_cancel, "ACTION", (Icallback)btn_cancel_cb);
|
||||||
IupSetCallback(btn_help, "ACTION", (Icallback)btn_help_cb);
|
IupSetCallback(btn_help, "ACTION", (Icallback)btn_help_cb);
|
||||||
|
|
||||||
IupSetAttribute(btn_ok, "RASTERSIZE", "100x32");
|
IupSetAttribute(btn_ok, "RASTERSIZE", UI_BTN_RASTERSIZE);
|
||||||
IupSetAttribute(btn_cancel, "RASTERSIZE", "100x32");
|
IupSetAttribute(btn_cancel, "RASTERSIZE", UI_BTN_RASTERSIZE);
|
||||||
IupSetAttribute(btn_help, "RASTERSIZE", "100x32");
|
IupSetAttribute(btn_help, "RASTERSIZE", UI_BTN_RASTERSIZE);
|
||||||
|
|
||||||
Ihandle *hbox_bottom = IupHbox(lbl_status, IupFill(), btn_help, btn_ok, btn_cancel, NULL);
|
Ihandle *hbox_bottom = IupHbox(lbl_status, IupFill(), btn_help, btn_ok, btn_cancel, NULL);
|
||||||
IupSetAttribute(hbox_bottom, "GAP", "10");
|
IupSetAttribute(hbox_bottom, "GAP", UI_HBOX_GAP);
|
||||||
IupSetAttribute(hbox_bottom, "MARGIN", "10x10");
|
IupSetAttribute(hbox_bottom, "MARGIN", UI_HBOX_MARGIN);
|
||||||
IupSetAttribute(hbox_bottom, "ALIGNMENT", "ACENTER");
|
IupSetAttribute(hbox_bottom, "ALIGNMENT", UI_HBOX_ALIGNMENT);
|
||||||
|
|
||||||
return hbox_bottom;
|
return hbox_bottom;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user