Emwin常用API函数

本文详细介绍了GUI编程中的四个关键API:文本API、图形API、字体API和颜色API。文本API涵盖了显示、绘制模式、对齐和位置等操作;图形API涉及绘制图形、位图、线条、多边形等;字体API包括了各种字体格式的支持和管理;颜色API则关注颜色的选择、转换和管理。这些API为GUI应用提供了丰富的功能和灵活性。
摘要由CSDN通过智能技术生成

目录

1.文本 API

2.图形 API

3.字体 API

4.颜色 API


1.文本 API

下表按字母顺序列出了相应类别中与文本相关的可用例程。

函数描述
显示文本
GUI_DispCEOL()将当前行从当前位置清除到行末。
GUI_DispChar()在当前位置显示单个字符。
GUI_DispCharAt()在指定位置显示单个字符。
GUI_DispChars()按指定次数显示字符。
GUI_DispString()在当前位置显示字符串。
GUI_DispStringAt()在指定位置显示字符串。
GUI_DispStringAtCEOL()在指定位置显示字符串,并清除至行末。
GUI_DispStringHCenterAt()在指定位置水平居中显示字符串。
GUI_DispStringInRect()在指定的矩形区域中显示字符串。
GUI_DispStringInRectEx()在指定的矩形区域中显示旋转的字符串。
GUI_DispStringInRectWrap()在指定的矩形区域中显示自动换行的字符串。
GUI_DispStringinRectWrapEx()在指定的矩形区域中显示旋转的和自动换行的字符串。
GUI_DispStringLen()在当前位置显示指定字符数的字符串。
GUI_WrapGetNumLines()返回用于使用给定自动换行模式在给定大小显示给定字符串需要的行号
绘制模式
GUI_GetTextMode()返回当前设置的绘制模式。
GUI_SetTextMode()设置绘制模式。
GUI_SetTextStyle()设置要使用的样式。
对齐
GUI_GetTextAlign()返回当前设置的文本对齐。
GUI_SetLBorder()设置换行后左边界的尺寸。
GUI_SetTextAlign()设置文本对象。
位置
GUI_DispNextLine()将光标移动到下一行的开始。
GUI_GotoX()设置 X 坐标。
GUI_GotoXY()设置 X 和 Y 坐标。
GUI_GotoY()设置 Y 坐标。
GUI_GetDispPosX()返回当前 X 坐标。
GUI_GetDispPosY()返回当前 Y 坐标。

2.图形 API

下表按字母顺序列出了各自类别内可用的与图形相关的函数。

函数描述
绘制相关的函数
GUI_AddRect()调整矩形的大小。
GUI_GetClientRect()返回当前可用绘制区。
GUI_GetDrawMode()返回当前绘制模式。
GUI_GetPenSize()返回当前画笔大小,单位:像素。
GUI_GetPixelIndex()返回给定位置的颜色索引。
GUI_SetClipRect()设置用于裁剪的矩形。
GUI_SetDrawMode()设置绘制模式。
GUI_SetPenSize()设置画笔大小,单位:像素。
基本绘制函数
GUI_Clear()用背景色填充显示器/激活窗口。
GUI_ClearRect()用背景色填充一个矩形区域。
GUI_CopyRect()在显示器上复制一个矩形区域。
GUI_DrawGradientH()绘制用水平颜色梯度填充的矩形。
GUI_DrawGradientV()绘制用垂直颜色梯度填充的矩形。
GUI_DrawGradientRoundedH()绘制用水平颜色梯度填充的圆角矩形。
GUI_DrawGradientRoundedV()绘制用垂直颜色梯度填充的圆角矩形。
GUI_DrawPixel()绘制单个像素。
GUI_DrawPoint()绘制点。
GUI_DrawRect()绘制矩形。
GUI_DrawRectEx()绘制矩形。
GUI_DrawRoundedFrame()绘制圆角框。
GUI_DrawRoundedRect()绘制圆角矩形。
GUI_FillRect()绘制填充的矩形。
GUI_FillRectEx()绘制填充的矩形。
GUI_FillRoundedRect()绘制填充的圆角矩形。
GUI_InvertRect()倒转矩形区域。
Alpha 混合
GUI_EnableAlpha()启用/ 禁用自动 Alpha 混合。
GUI_PreserveTrans()在绘制操作之后确保 alpha 通道仍然存在。
GUI_RestoreUserAlpha()恢复之前的用户 Alpha 混合状态。
GUI_SetAlpha()设置当前的 Alpha 混合值。(弃用)。
GUI_SetUserAlpha()设置其他值,以用于计算要使用的实际 Alpha 混合值。
绘制位图
GUI_DrawBitmap()绘制位图。
GUI_DrawBitmapEx()绘制缩放的位图。
GUI_DrawBitmapHWAlpha()在具有硬件 Alpha 混合支持的系统上绘制带 Alpha 混合
信息的位图。
GUI_DrawBitmapMag()绘制放大的位图。
绘制线条
GUI_DrawHLine()绘制水平线。
GUI_DrawLine()绘制从某个指定起点到指定终点的线条(绝对坐标)。
GUI_DrawLineRel()绘制从当前位置到按 X 和 Y 距离指定的终点的线条(相对
坐标)。
GUI_DrawLineTo()绘制从当前位置到指定终点的线条。
GUI_DrawPolyLine()绘制折线。
GUI_DrawVLine()绘制垂直线。
GUI_GetLineStyle()返回当前的线条样式。
GUI_MoveRel()相对于其当前位置移动线条指针。
GUI_MoveTo()将线条指针移动到给定位置。
GUI_SetLineStyle()设置当前的线条样式。
绘制多边形
GUI_DrawPolygon()绘制多边形的轮廓。
GUI_EnlargePolygon()扩展多边形。
GUI_FillPolygon()绘制填充的多边形。
GUI_MagnifyPolygon()放大多边形。
GUI_RotatePolygon()按指定角度旋转多边形。
绘制圆
GUI_DrawCircle()绘制圆的轮廓。
GUI_FillCircle()绘制填充的圆。
绘制椭圆
GUI_DrawEllipse()绘制椭圆的轮廓。
GUI_FillEllipse()绘制填充的椭圆。
绘制弧线
GUI_DrawArc()绘制弧线。
绘制曲线
GUI_DrawGraph()绘制曲线。
绘制 QR-codes
GUI_QR_Create()创建 QR-code 位图。
GUI_QR_Delete()删除 QR-code 位图。
GUI_QR_Draw()绘制 QR-code 位图。

3.字体 API

下表按字母顺序列出了各自类别内可用的与字体相关的例程。

函数描述
’SIF’文件相关的字体函数
GUI_SIF_CreateFont()通过将指针传递至系统独立字体数据创建和选择字体。
GUI_SIF_DeleteFont()删除使用GUI_SIF_CreateFont()创建的字体
’TTF’文件相关的字体函数
GUI_TTF_CreateFont()基于TTF 字体文件创建GUI 字体。
GUI_TTF_CreateFontAA()从带抗锯齿的 TTF 字体文件创建 GUI 字体。
GUI_TTF_DestroyCache()解除TTF 引擎的缓存。
GUI_TTF_Done()释放TTF 引擎动态分配的所有内存。
GUI_TTF_GetFamilyName()返回字体的系列名称。
GUI_TTF_GetStyleName()返回字体的样式名称。
GUI_TTF_SetCacheSize()可用于设置TTF 缓存的默认大小。
’XBF’文件相关的字体函数
GUI_XBF_CreateFont()通过将指针传递至负责从 XB 字体文件获取数据的回调函数创建和选择字体。
GUI_XBF_DeleteFont()删除使用GUI_XBF_CreateFont()创建的字体
常用字体相关的函数
GUI_GetCharDistX()返回当前字体中指定字符的宽度像素 ( X 大小)。
GUI_GetDefaultFont()返回默认字体。
GUI_GetFont()返回当前选择的字体的指针。
GUI_GetFontDistY()返回当前字体的Y 间距。
GUI_GetFontInfo()返回包含字体信息的结构。
GUI_GetFontSizeY()返回当前字体的高度像素( Y 大小)。
GUI_GetLeadingBlankCols()返回给定字符的前导空格像素列数。
GUI_GetStringDistX()返回使用当前字体的文本的X 大小。
GUI_GetTextExtend()评估使用当前字体的文本的大小。
GUI_GetTrailingBlankCols()返回给定字符的后导空格像素列数。
GUI_GetYDistOfFont()返回特定字体的Y 间距。
GUI_GetYSizeOfFont()返回特定字体的Y 大小。
GUI_IsInFont()评估特定字体中是否存在指定的字符。
GUI_SetDefaultFont()设置GUI_Init() 之后使用的默认字体。
GUI_SetFont()设置当前字体。

4.颜色 API

下表按字母顺序在各自类别中列出了可用的颜色相关函数。

函数描述
基本函数
GUI_GetBkColor()返回当前背景色。
GUI_GetBkColorIndex()返回当前背景色的索引。
GUI_GetColor()返回当前前景色。
GUI_GetColorIndex()返回当前前景色的索引。
GUI_GetDefaultColor()返回默认前景色。
GUI_GetDefaultBkColor()返回默认背景色。
GUI_SetBkColor()设置当前背景色。
GUI_SetBkColorIndex()设置当前背景色的索引。
GUI_SetColor()设置当前前景色。
GUI_SetColorIndex()设置当前前景色的索引。
GUI_SetDefaultColor()设置默认前景色。
GUI_SetDefaultBkColor()设置默认背景色。
转换函数
GUI_CalcColorDist()返回 2 种颜色之间的差值
GUI_CalcVisColorError()将差值返回给下一可用颜色
GUI_Color2Index()将颜色转换为颜色索引。
GUI_Color2VisColor()返回最接近的可用颜色
GUI_ColorIsAvailable()检查给定的颜色是否可用
GUI_Index2Color()将颜色索引转换为颜色。
emWin 图形库 图形用户界面 版本 5.12 手册修订版 0 emWin V5.12 用户参考手册 © 1997 - 2011 SEGGER Microcontroller GmbH & Co. KG 9 1 emWin 简介....................................................................................................................23 1.1 本文档的目的 ............................................................................................24 1.2 假定 .......................................................................................................24 1.3 如何使用本手册 .........................................................................................24 1.4 语法句子的印刷规范 ....................................................................................24 1.5 要求 .......................................................................................................25 1.5.1 目标系统 (硬件).......................................................................................25 1.5.2 开发环境 (编译器)....................................................................................25 1.6 特性 .......................................................................................................26 1.7 示例和演示 ...............................................................................................27 1.8 初学者套装 ...............................................................................................27 1.9 屏幕和坐标 ...............................................................................................27 1.10 如何将显示器连接到微控制器 .........................................................................28 1.11 数据类型..................................................................................................29 2 入门指南.........................................................................................................................31 2.1 推荐目录结构 ............................................................................................32 2.1.1 子目录 ....................................................................................................32 2.1.2 包含目录..................................................................................................32 2.2 添加 emWin 到目标程序...............................................................................32 2.3 创建库 ....................................................................................................33 2.3.1 改编库批处理文件以适应不同系统 ...................................................................33 2.4 要包含在项目中的 C 文件..............................................................................35 2.5 emWin 的配置 ..........................................................................................35 2.6 初始化 emWin ..........................................................................................36 2.7 有目标硬件时使用 emWin ............................................................................37 2.8 “Hello world”示例程序 .............................................................................37 3 模拟................................................................................................................................39 3.1 使用模拟..................................................................................................40 3.1.1 通过 emWin 试用版使用模拟 .........................................................................40 3.1.1.1 目录结构..................................................................................................40 3.1.1.2 Visual C++ 工作空间 .................................................................................40 3.1.1.3 编译演示程序 ............................................................................................41 3.1.1.4 编译示例..................................................................................................41 3.1.2 通过 emWin 源代码使用模拟 .........................................................................42 3.1.2.1 目录结构..................................................................................................42 3.1.2.2 Visual C++ 工作空间 .................................................................................42 3.1.2.3 编译应用程序 ............................................................................................43 3.1.3 模拟的高级功能 .........................................................................................43 3.1.3.1 暂停和恢复 ...............................................................................................43 3.1.3.2 查看系统信息 ............................................................................................43 3.1.3.3 复制到剪贴板 ............................................................................................43 3.2 设备模拟..................................................................................................44 3.2.1 生成的框架视图 .........................................................................................45 3.2.2 自定义位图视图 .........................................................................................45 3.2.3 窗口视图..................................................................................................46 3.3 设备模拟 API ............................................................................................47 3.4 硬键模拟..................................................................................................52 3.4.1 硬键模拟 API ............................................................................................5310 emWin V5.12 用户参考手册 © 1997 - 2011 SEGGER Microcontroller GmbH & Co. KG 3.5 集成 emWin 模拟到现有模拟中...................................................................... 56 3.5.1 目录结构 ................................................................................................. 56 3.5.2 使用模拟库 .............................................................................................. 56 3.5.2.1 修改 WinMain .......................................................................................... 56 3.5.2.2 应用程序示例............................................................................................ 57 3.5.3 集成到 embOS 模拟中 ................................................................................ 58 3.5.3.1 WinMain................................................................................................. 58 3.5.3.2 目标程序 (main) ....................................................................................... 59 3.5.4 GUI 模拟 API ........................................................................................... 60 4 查看器 ............................................................................................................................63 4.1 使用查看器 .............................................................................................. 64 4.1.1 使用模拟和查看器 ...................................................................................... 64 4.1.2 使用带虚拟页面的查看器 .............................................................................. 65 4.1.3 总在顶部显示............................................................................................ 65 4.1.4 打开显示输出的更多窗口 .............................................................................. 65 4.1.5 缩放....................................................................................................... 66 4.1.6 将输出复制到剪贴板 ................................................................................... 66 4.1.7 使用带多种显示的查看器 .............................................................................. 67 4.1.8 使用带多种显示的查看器 .............................................................................. 67 5 显示文本.........................................................................................................................69 5.1 基本例程 ................................................................................................. 70 5.2 文本 API ................................................................................................. 71 5.3 显示文本的例程 ......................................................................................... 72 5.4 选择文本绘制模式 ...................................................................................... 79 5.5 选择文本对齐模式 ...................................................................................... 81 5.6 设置当前文本位置 ...................................................................................... 83 5.7 返回当前文本位置 ...................................................................................... 84 5.8 清除窗口或部分窗口的例程 ........................................................................... 84 6 显示数值.........................................................................................................................85 6.1 评估 API ................................................................................................. 86 6.2 显示十进制数值 ......................................................................................... 87 6.3 显示浮点数值............................................................................................ 91 6.4 显示二进制数值 ......................................................................................... 94 6.5 显示十六进制数值 ...................................................................................... 95 6.6 emWin 版 ............................................................................................... 96 7 2-D 图形库......................................................................................................................97 7.1 图形 API ................................................................................................. 98 7.2 绘制模式 ................................................................................................100 7.3 查询当前客户区矩形 ..................................................................................102 7.4 画笔大小 ................................................................................................102 7.5 基本绘制例程...........................................................................................103 7.6 Alpha 混合 .............................................................................................110 7.7 绘制位图 ................................................................................................113 7.8 绘制流位图 .............................................................................................116 7.9 绘制线条 ................................................................................................122 7.10 绘制多边形 .............................................................................................126 7.11 绘制圆 ...................................................................................................131 7.12 绘制椭圆 ................................................................................................133 7.13 绘制弧线 ................................................................................................135 7.14 绘制线图 ................................................................................................137 7.15 绘制饼图 ................................................................................................138 7.16 保存和恢复 GUI 环境 .................................................................................139 7.17 裁剪......................................................................................................140 8 显示位图文件 ...............................................................................................................141emWin V5.12 用户参考手册 © 1997 - 2011 SEGGER Microcontroller GmbH & Co. KG 11 8.1 BMP 文件支持 ......................................................................................... 142 8.1.1 支持的格式 ............................................................................................. 142 8.1.2 BMP 文件 API ......................................................................................... 142 8.2 JPEG 文件支持 ........................................................................................ 148 8.2.1 支持的 JPEG 压缩方法 ............................................................................... 148 8.2.2 将 JPEG 文件转换为 C 源 ............................................................................ 148 8.2.3 显示 JPEG 文件........................................................................................ 148 8.2.4 存储器使用 ............................................................................................. 149 8.2.5 渐进式 JPEG 文件..................................................................................... 149 8.2.6 JPEG 文件 API ........................................................................................ 149 8.3 GIF 文件支持 .......................................................................................... 154 8.3.1 将 GIF 文件转换为 C 源.............................................................................. 154 8.3.2 显示 GIF 文件 ......................................................................................... 154 8.3.3 存储器使用 ............................................................................................. 154 8.3.4 GIF 文件 API .......................................................................................... 155 8.4 PNG 文件支持 ......................................................................................... 163 8.4.1 将 PNG 文件转换为 C 源 ............................................................................. 163 8.4.2 显示 PNG 文件 ........................................................................................ 163 8.4.3 存储器使用 ............................................................................................. 163 8.4.4 PNG 文件 API ......................................................................................... 163 8.5 使用 ...Ex() 函数获取数据 .......................................................................... 167 9 字体..............................................................................................................................169 9.1 简介 ..................................................................................................... 170 9.2 字体类型................................................................................................ 170 9.3 字体格式................................................................................................ 172 9.3.1 C 文件格式 ............................................................................................. 172 9.3.2 系统独立字体 (SIF) 格式 ............................................................................ 172 9.3.3 外部位图字体 (XBF) 格式 ........................................................................... 173 9.3.4 TrueType 字体 (TTF) 格式 ......................................................................... 174 9.4 将 TTF 文件转换为 C 源.............................................................................. 174 9.5 声明自定义字体 ....................................................................................... 175 9.6 选择字体................................................................................................ 175 9.7 字体 API................................................................................................ 176 9.8 C 文件相关的字体函数 ............................................................................... 177 9.9 “SIF”文件相关的字体函数 ........................................................................ 178 9.10 “TTF”文件相关的字体函数 ........................................................................ 179 9.11 “XBF”文件相关的字体函数........................................................................ 183 9.12 常见字体相关的函数 .................................................................................. 184 9.13 字符集 .................................................................................................. 188 9.13.1 ASCII................................................................................................... 188 9.13.2 ISO 8859-1 西方拉丁字符集....................................................................... 189 9.13.3 Unicode................................................................................................ 190 9.14 字体转换器 ............................................................................................. 191 9.14.1 添加字体................................................................................................ 191 9.15 标准字体................................................................................................ 192 9.15.1 字体标识符命名约定 .................................................................................. 192 9.15.2 字体文件命名约定..................................................................................... 193 9.15.3 字体的计量、 ROM 大小和字符集 .................................................................. 193 9.15.4 比例字体................................................................................................ 194 9.15.4.1 概述 ..................................................................................................... 194 9.15.4.2 计量、 ROM 大小和使用的文件..................................................................... 194 9.15.4.3 字符 ..................................................................................................... 196 9.15.5 比例字体,带边框..................................................................................... 202 9.15.5.1 概述 ..................................................................................................... 202 9.15.5.2 计量、 ROM 大小和使用的文件..................................................................... 202 9.15.5.3 字符 ..................................................................................................... 202 9.15.6 等宽字体................................................................................................ 203 9.15.6.1 概述 ..................................................................................................... 203 9.15.6.2 计量、 ROM 大小和使用的文件..................................................................... 204 9.15.6.3 字符 ..................................................................................................... 20512 emWin V5.12 用户参考手册 © 1997 - 2011 SEGGER Microcontroller GmbH & Co. KG 9.15.7 数字字体 (比例).....................................................................................209 9.15.7.1 概述......................................................................................................209 9.15.7.2 计量、 ROM 大小和使用的文件 .....................................................................209 9.15.7.3 字符......................................................................................................209 9.15.8 数字字体 (等宽).....................................................................................210 9.15.8.1 概述......................................................................................................210 9.15.8.2 计量、 ROM 大小和使用的文件 .....................................................................211 9.15.8.3 字符......................................................................................................211 10 位图转换器.................................................................................................................213 10.1 功能......................................................................................................214 10.2 加载位图 ................................................................................................214 10.2.1 支持的输入文件格式 ..................................................................................214 10.2.2 从文件加载 .............................................................................................214 10.2.3 使用剪贴板 .............................................................................................215 10.3 从位图生成 C 文件.....................................................................................215 10.3.1 支持的位图格式 ........................................................................................215 10.3.2 调色板信息 .............................................................................................215 10.3.3 透明性 ...................................................................................................216 10.3.4 Alpha 混合 .............................................................................................216 10.3.5 选择最佳格式...........................................................................................217 10.3.6 保存文件 ................................................................................................218 10.4 色彩转换 ................................................................................................219 10.5 生成 C 流文件 ..........................................................................................220 10.6 压缩位图 ................................................................................................220 10.7 使用定制调色板 ........................................................................................221 10.7.1 保存调色板文件 ........................................................................................221 10.7.2 C 文件格式..............................................................................................221 10.7.3 固定调色板模式的调色板文件 .......................................................................221 10.7.4 转换位图 ................................................................................................222 10.8 命令行用法 .............................................................................................222 10.8.1 命令的格式 .............................................................................................222 10.8.2 有效的命令行选项 .....................................................................................222 10.9 转换位图示例...........................................................................................224 11 颜色............................................................................................................................227 11.1 预定义的颜色...........................................................................................228 11.2 颜色条测试例程 ........................................................................................228 11.3 固定调色板模式 ........................................................................................229 11.4 固定调色板模式的详细说明 ..........................................................................230 11.5 应用程序定义的色彩转换 .............................................................................240 11.6 定制调色板模式 ........................................................................................241 11.7 颜色 API ................................................................................................241 11.8 基本颜色函数...........................................................................................242 11.9 索引和色彩转换 ........................................................................................244 12 存储设备.....................................................................................................................247 12.1 使用存储设备:图示 ..................................................................................248 12.2 支持的色彩深度 (bpp)................................................................................248 12.3 存储设备和窗口管理器................................................................................249 12.4 存储设备和多层 ........................................................................................249 12.5 内存要求 ................................................................................................249 12.6 性能......................................................................................................250 12.7 基本函数 ................................................................................................251 12.8 使用存储设备的准备操作 ... .........................................................................251 12.9 多层 / 多显示配置 .....................................................................................251 12.10 配置选项 ................................................................................................251 12.10.1 GUI_USE_MEMDEV_1BPP_FOR_SCREEN....................................................251 12.11 存储设备 API...........................................................................................251 12.12 基本函数 ................................................................................................253emWin V5.12 用户参考手册 © 1997 - 2011 SEGGER Microcontroller GmbH & Co. KG 13 12.13 分段存储设备 .......................................................................................... 266 12.14 自动设备对象 .......................................................................................... 267 12.15 测量设备对象 .......................................................................................... 269 12.16 动画函数................................................................................................ 271 12.17 动画函数 (需要使用窗口管理器)................................................................. 272 13 执行模型:单任务 / 多任务.........................................................................................277 13.1 支持的执行模型 ....................................................................................... 278 13.2 单任务系统 (超循环)............................................................................... 278 13.2.1 描述 ..................................................................................................... 278 13.2.2 超循环示例 (无 emWin).......................................................................... 278 13.2.3 优势 ..................................................................................................... 278 13.2.4 缺点 ..................................................................................................... 278 13.2.5 使用 emWin ........................................................................................... 278 13.2.6 超循环示例 (有 emWin).......................................................................... 279 13.3 多任务系统:一个任务调用 emWin ............................................................... 279 13.3.1 描述 ..................................................................................................... 279 13.3.2 优势 ..................................................................................................... 279 13.3.3 缺点 ..................................................................................................... 279 13.3.4 使用 emWin ........................................................................................... 279 13.4 多任务系统:多个任务调用 emWin ............................................................... 280 13.4.1 描述 ..................................................................................................... 280 13.4.2 优势 ..................................................................................................... 280 13.4.3 缺点 ..................................................................................................... 280 13.4.4 使用 emWin ........................................................................................... 280 13.4.5 建议 ..................................................................................................... 280 13.4.6 示例 ..................................................................................................... 280 13.5 支持多任务的 GUI 配置函数 ........................................................................ 281 13.6 支持多任务的 GUI 配置宏 ........................................................................... 283 13.7 内核接口 API .......................................................................................... 284 13.7.1 示例 ..................................................................................................... 287 14 窗口管理器 (WM) .......................................................................................................289 14.1 术语说明................................................................................................ 290 14.2 回调机制,无效化和渲染 ............................................................................ 291 14.2.1 不使用回调渲染 ....................................................................................... 291 14.2.2 使用回调渲染 .......................................................................................... 292 14.2.3 背景窗口重绘和回调 .................................................................................. 292 14.2.4 无效化 .................................................................................................. 293 14.2.5 渲染透明窗口 .......................................................................................... 293 14.2.6 自动使用存储设备..................................................................................... 293 14.2.7 自动使用多帧缓冲..................................................................................... 294 14.2.8 自动使用显示驱动缓存 ............................................................................... 294 14.3 消息 ..................................................................................................... 295 14.3.1 消息结构................................................................................................ 295 14.3.2 消息清单................................................................................................ 295 14.3.3 系统定义的消息 ....................................................................................... 296 14.3.4 指针输入设备 (PID) 消息............................................................................ 300 14.3.5 系统定义的通知代码 .................................................................................. 303 14.3.6 应用定义的消息 ....................................................................................... 303 14.4 配置选项................................................................................................ 304 14.5 WM API ................................................................................................ 305 14.5.1 使用 WM API 函数.................................................................................... 307 14.6 基本函数................................................................................................ 307 14.7 存储设备支持 (可选)............................................................................... 336 14.8 定时器相关函数 ....................................................................................... 336 14.9 小工具相关函数 ....................................................................................... 339 14.10 示例 ..................................................................................................... 342 15 窗口对象 (小工具)...................................................................................................34514 emWin V5.12 用户参考手册 © 1997 - 2011 SEGGER Microcontroller GmbH & Co. KG 15.1 基础知识 ................................................................................................346 15.1.1 可用小工具 .............................................................................................346 15.1.2 了解重绘机制...........................................................................................347 15.1.3 如何使用小工具 ........................................................................................347 15.2 配置选项 ................................................................................................349 15.3 通用小工具 API ........................................................................................350 15.3.1 用于小工具的 WM 例程...............................................................................350 15.3.2 常用例程 ................................................................................................350 15.3.3 用户绘制小工具 ........................................................................................354 15.4 BUTTON:按钮小工具 ...............................................................................356 15.4.1 配置选项 ................................................................................................356 15.4.2 通知代码 ................................................................................................357 15.4.3 键盘反应 ................................................................................................357 15.4.4 BUTTON API ..........................................................................................357 15.4.5 示例......................................................................................................370 15.5 CHECKBOX:复选框小工具.........................................................................371 15.5.1 配置选项 ................................................................................................372 15.5.2 通知代码 ................................................................................................372 15.5.3 键盘反应 ................................................................................................372 15.5.4 CHECKBOX API ......................................................................................372 15.5.5 示例......................................................................................................386 15.6 DROPDOWN:下拉列表小工具 ....................................................................387 15.6.1 配置选项 ................................................................................................388 15.6.2 通知代码 ................................................................................................388 15.6.3 键盘反应 ................................................................................................388 15.6.4 DROPDOWN API.....................................................................................388 15.6.5 示例......................................................................................................400 15.7 EDIT:“编辑”小工具 ...............................................................................402 15.7.1 配置选项 ................................................................................................402 15.7.2 通知代码 ................................................................................................402 15.7.3 键盘反应 ................................................................................................403 15.7.4 EDIT API...............................................................................................403 15.7.5 示例......................................................................................................418 15.8 FRAMEWIN:框架窗口小工具......................................................................419 15.8.1 框架窗口的结构 ........................................................................................420 15.8.2 配置选项 ................................................................................................421 15.8.3 键盘反应 ................................................................................................421 15.8.4 FRAMEWIN API ......................................................................................421 15.8.5 示例......................................................................................................442 15.9 GRAPH:图形小工具 .................................................................................443 15.9.1 图形小工具的结构 .....................................................................................443 15.9.2 创建和删除图形小工具................................................................................444 15.9.3 绘制过程 ................................................................................................444 15.9.4 支持的曲线类型 ........................................................................................444 15.9.4.1 GRAPH_DATA_XY ...................................................................................445 15.9.4.2 GRAPH_DATA_YT ...................................................................................445 15.9.5 配置选项 ................................................................................................445 15.9.5.1 图形小工具 .............................................................................................445 15.9.5.2 刻度对象 ................................................................................................445 15.9.6 键盘反应 ................................................................................................445 15.9.7 图形 API ................................................................................................445 15.9.7.1 常用例程 ................................................................................................447 15.9.7.2 GRAPH_DATA_YT 相关的例程.....................................................................455 15.9.7.3 GRAPH_DATA_XY 相关的例程.....................................................................459 15.9.7.4 刻度相关的例程 ........................................................................................463 15.9.8 示例......................................................................................................467 15.10 HEADER:标题小工具 ...............................................................................469 15.10.1 配置选项 ................................................................................................470 15.10.2 通知代码 ................................................................................................470 15.10.3 键盘反应 ................................................................................................470 15.10.4 HEADER API ..........................................................................................470emWin V5.12 用户参考手册 © 1997 - 2011 SEGGER Microcontroller GmbH & Co. KG 15 15.10.5 示例 ..................................................................................................... 482 15.11 ICONVIEW:图标视图小工具 ...................................................................... 483 15.11.1 配置选项................................................................................................ 483 15.11.2 通知代码................................................................................................ 484 15.11.3 键盘反应................................................................................................ 484 15.11.4 ICONVIEW API ...................................................................................... 484 15.11.5 示例 ..................................................................................................... 494 15.12 LISTBOX:列表框小工具 ........................................................................... 496 15.12.1 配置选项................................................................................................ 496 15.12.2 通知代码................................................................................................ 496 15.12.3 键盘反应................................................................................................ 496 15.12.4 LISTBOX API......................................................................................... 497 15.12.5 示例 ..................................................................................................... 513 15.13 LISTVIEW:Listview 小工具 ...................................................................... 514 15.13.1 配置选项................................................................................................ 515 15.13.2 通知代码................................................................................................ 515 15.13.3 键盘反应................................................................................................ 515 15.13.4 LISTVIEW API ....................................................................................... 516 15.13.5 示例 ..................................................................................................... 537 15.14 LISTWHEEL:Listwheel 小工具 .................................................................. 539 15.14.1 配置选项................................................................................................ 539 15.14.2 通知代码................................................................................................ 539 15.14.3 键盘反应................................................................................................ 539 15.14.4 LISTWHEEL API ..................................................................................... 540 15.15 MENU:菜单小工具 .................................................................................. 553 15.15.1 菜单消息................................................................................................ 554 15.15.2 数据结构................................................................................................ 555 15.15.3 配置选项................................................................................................ 555 15.15.4 键盘反应................................................................................................ 556 15.15.5 “菜单” API ........................................................................................... 556 15.15.6 示例 ..................................................................................................... 570 15.16 MESSAGEBOX:消息框小工具 .................................................................... 571 15.16.1 配置选项................................................................................................ 571 15.16.2 键盘反应................................................................................................ 571 15.16.3 MESSAGEBOX API.................................................................................. 571 15.17 MULTIEDIT:多行文本小工具 ..................................................................... 573 15.17.1 配置选项................................................................................................ 574 15.17.2 通知代码................................................................................................ 574 15.17.3 键盘反应................................................................................................ 574 15.17.4 MULTIEDIT API...................................................................................... 574 15.17.5 示例 ..................................................................................................... 584 15.18 MULTIPAGE:“多页”小工具 ..................................................................... 586 15.18.1 配置选项................................................................................................ 587 15.18.2 通知代码................................................................................................ 587 15.18.3 键盘反应................................................................................................ 587 15.18.4 MULTIPAGE API..................................................................................... 587 15.18.5 示例 ..................................................................................................... 598 15.19 PROGBAR:进度条小工具.......................................................................... 599 15.19.1 配置选项................................................................................................ 599 15.19.2 键盘反应................................................................................................ 599 15.19.3 PROGBAR API ....................................................................................... 599 15.19.4 示例 ..................................................................................................... 604 15.20 RADIO:单选按钮小工具 ........................................................................... 605 15.20.1 配置选项................................................................................................ 605 15.20.2 通知代码................................................................................................ 605 15.20.3 键盘反应................................................................................................ 606 15.20.4 RADIO API............................................................................................ 606 15.20.5 示例 ..................................................................................................... 615 15.21 SCROLLBAR:滚动条小工具....................................................................... 617 15.21.1 配置选项................................................................................................ 617 15.21.2 通知代码................................................................................................ 61716 emWin V5.12 用户参考手册 © 1997 - 2011 SEGGER Microcontroller GmbH & Co. KG 15.21.3 键盘反应 ................................................................................................617 15.21.4 SCROLLBAR API .....................................................................................618 15.21.5 示例......................................................................................................625 15.22 SLIDER:滑块小工具 ................................................................................626 15.22.1 配置选项 ................................................................................................626 15.22.2 通知代码 ................................................................................................626 15.22.3 键盘反应 ................................................................................................626 15.22.4 SLIDER API ...........................................................................................626 15.22.5 示例......................................................................................................632 15.23 文本文本小工具 ........................................................................................633 15.23.1 配置选项 ................................................................................................633 15.23.2 键盘反应 ................................................................................................633 15.23.3 文本 API ................................................................................................633 15.23.4 示例......................................................................................................639 15.24 TREEVIEW:树形视图小工具.......................................................................640 15.24.1 术语说明 ................................................................................................641 15.24.2 配置选项 ................................................................................................642 15.24.3 通知代码 ................................................................................................642 15.24.4 键盘反应 ................................................................................................642 15.24.5 TREEVIEW API .......................................................................................643 15.24.5.1 常用例程 ................................................................................................644 15.24.5.2 项目相关例程...........................................................................................657 15.24.6 示例......................................................................................................662 15.25 WINDOW:窗口小工具..............................................................................663 15.25.1 配置选项 ................................................................................................663 15.25.2 键盘反应 ................................................................................................663 15.25.3 WINDOW API.........................................................................................663 16 对话框 ........................................................................................................................665 16.1 对话框的基本原理 .....................................................................................666 16.2 创建对话框 .............................................................................................666 16.2.1 资源表 ...................................................................................................666 16.2.2 对话框过程函数 ........................................................................................667 16.2.2.1 初始化对话框...........................................................................................668 16.2.2.2 定义对话框行为 ........................................................................................669 16.3 对话框 API..............................................................................................670 16.4 对话框 ...................................................................................................670 17 GUIBuilder .................................................................................................................673 17.1 简介......................................................................................................674 17.2 入门指南 ................................................................................................675 17.3 创建对话框 .............................................................................................676 17.3.1 选择父小工具...........................................................................................676 17.3.2 在编辑器中调整大小和定位 ..........................................................................676 17.3.3 修改小工具属性 ........................................................................................676 17.3.4 向小工具添加其他函数................................................................................676 17.3.5 删除小工具属性 ........................................................................................677 17.3.6 删除小工具 .............................................................................................677 17.4 保存当前的对话框 .....................................................................................678 17.5 GUIBuilder 的输出 ...................................................................................679 17.6 修改 C 文件 .............................................................................................681 17.7 如何使用 C 文件 .......................................................................................681 18 换肤............................................................................................................................683 18.1 “皮肤”是什么? ......................................................................................684 18.2 从使用 API 函数到换肤 ...............................................................................684 18.3 可换肤的小工具 ........................................................................................685 18.4 使用皮肤 ................................................................................................685 18.4.1 运行时间配置...........................................................................................686 18.4.2 编译时间配置...........................................................................................686emWin V5.12 用户参考手册 © 1997 - 2011 SEGGER Microcontroller GmbH & Co. KG 17 18.5 简单更改 “Flex”皮肤外观 ......................................................................... 686 18.6 对 “Flex”皮肤外观所作的重大更改 .............................................................. 687 18.6.1 换肤回调机制 .......................................................................................... 687 18.6.2 更改默认皮肤的外观 .................................................................................. 687 18.6.3 命令列表................................................................................................ 688 18.7 常用的换肤 API........................................................................................ 690 18.8 BUTTON_SKIN_FLEX .............................................................................. 693 18.8.1 配置结构................................................................................................ 693 18.8.2 配置选项................................................................................................ 693 18.8.3 换肤 API................................................................................................ 694 18.8.4 命令列表................................................................................................ 695 18.9 CHECKBOX_SKIN_FLEX .......................................................................... 696 18.9.1 配置结构................................................................................................ 696 18.9.2 配置选项................................................................................................ 696 18.9.3 换肤 API................................................................................................ 697 18.9.4 命令列表................................................................................................ 698 18.10 DROPDOWN_SKIN_FLEX......................................................................... 700 18.10.1 配置结构................................................................................................ 700 18.10.2 配置选项................................................................................................ 701 18.10.3 换肤 API................................................................................................ 701 18.10.4 命令列表................................................................................................ 702 18.11 FRAMEWIN_SKIN_FLEX .......................................................................... 703 18.11.1 配置结构................................................................................................ 703 18.11.2 配置选项................................................................................................ 704 18.11.3 换肤 API................................................................................................ 704 18.11.4 命令列表................................................................................................ 705 18.12 HEADER_SKIN_FLEX .............................................................................. 708 18.12.1 配置结构................................................................................................ 708 18.12.2 配置选项................................................................................................ 708 18.12.3 换肤 API................................................................................................ 709 18.12.4 命令列表................................................................................................ 709 18.13 PROGBAR_SKIN_FLEX ............................................................................ 711 18.13.1 配置结构................................................................................................ 711 18.13.2 配置选项................................................................................................ 711 18.13.3 换肤 API................................................................................................ 712 18.13.4 命令列表................................................................................................ 712 18.14 RADIO_SKIN_FLEX ................................................................................ 715 18.14.1 配置结构................................................................................................ 715 18.14.2 配置选项................................................................................................ 716 18.14.3 换肤 API................................................................................................ 716 18.14.4 命令列表................................................................................................ 717 18.15 SCROLLBAR_SKIN_FLEX......................................................................... 719 18.15.1 配置结构................................................................................................ 719 18.15.2 配置选项................................................................................................ 720 18.15.3 换肤 API................................................................................................ 720 18.15.4 命令列表................................................................................................ 721 18.16 SLIDER_SKIN_FLEX ............................................................................... 724 18.16.1 配置结构................................................................................................ 724 18.16.2 配置选项................................................................................................ 725 18.16.3 换肤 API................................................................................................ 725 18.16.4 命令列表................................................................................................ 726 19 多缓冲 ........................................................................................................................729 19.1 工作原理................................................................................................ 730 19.1.1 双缓冲 .................................................................................................. 730 19.1.2 三缓冲 .................................................................................................. 730 19.2 要求 ..................................................................................................... 731 19.3 限制 ..................................................................................................... 731 19.4 配置 ..................................................................................................... 731 19.4.1 LCD_X_Config() .................................................................................... 731 19.4.2 LCD_X_DisplayDriver()........................................................................... 73218 emWin V5.12 用户参考手册 © 1997 - 2011 SEGGER Microcontroller GmbH & Co. KG 19.5 通过窗口管理器自动使用多个缓冲器 ...............................................................733 19.6 多缓冲 API..............................................................................................734 20 虚拟屏幕 / 虚拟页面 ...................................................................................................739 20.1 简介......................................................................................................740 20.2 要求......................................................................................................740 20.3 配置......................................................................................................741 20.4 示例.....................................................................................................741 20.4.1 基本示例 ................................................................................................741 20.4.2 使用窗口管理器的实时示例 ..........................................................................743 20.4.3 使用窗口管理器的对话框示例 .......................................................................744 20.5 虚拟屏幕 API...........................................................................................746 21 多层 / 多显示支持 .......................................................................................................747 21.1 简介......................................................................................................748 21.1.1 选择绘图操作所使用的层 .............................................................................748 21.1.2 选择窗口所使用的层 ..................................................................................748 21.1.2.1 把窗口从一层移到另一层 .............................................................................749 21.2 使用多层支持...........................................................................................751 21.2.1 透明......................................................................................................751 21.2.2 Alpha 混合 .............................................................................................752 21.2.3 硬件游标 ................................................................................................753 21.2.4 多层示例 ................................................................................................753 21.3 使用多显示支持 ........................................................................................753 21.3.1 启用多显示支持 ........................................................................................753 21.3.2 运行时间屏幕旋转 .....................................................................................754 21.3.3 多显示示例 .............................................................................................754 21.4 配置多层支持...........................................................................................754 21.5 配置多显示支持 ........................................................................................755 21.6 多层 API .......................................
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Andy.w

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值