Minigui 编程指南 V2.0-4

Total Page:16

File Type:pdf, Size:1020Kb

Minigui 编程指南 V2.0-4 MiniGUI 编 程 指 南 版本 2.0 修订号 4 适用于 MiniGUI Ver 2.0.4/1.6.10 北京飞漫软件技术有限公司 2007 年 8 月 MiniGUI 编程指南 V2.0-4 简 介 由北京飞漫软件技术有限公司开发的 MiniGUI(http://www.minigui.com),是国内为数 不多的几大国际知名自由软件之一。其目标是为实时嵌入式操作系统建立一个跨操作系统的、 快速、稳定和轻量级的图形用户界面支持系统。我们将 MiniGUI 定义为“针对嵌入式设备的、 跨操作系统的图形界面支持系统”,属于一种“嵌入式图形中间件”软件产品。目前,MiniGUI 已成为跨操作系统的图形用户界面支持系统,可在 Linux/uClinux、eCos、VxWorks、pSOS、 ThreadX、Nucleus、uC/OS-II、OSE 等操作系统,以及 Win32 平台上运行。 目前,MiniGUI 可免费下载的稳定版本(遵循 GPL)是 MiniGUI-STR V1.6.2 和 MiniGUI V1.3.3 。你可以从北京飞漫软件技术有限公司网站的“下载”区 (http://www.minigui.com/download/cindex.shtml)下载上述 GPL 版本的源代码、开发文 档及示例程序。需要注意的是:免费下载的 MiniGUI 只能用于开发 GPL 或其它公开源码 的应用软件,如果你要利用 MiniGUI 开发专有或商业软件,则必须从北京飞漫软件技术有 限公司购买商业授权。飞漫软件将为购买 MiniGUI 商业授权的用户提供最新的 MiniGUI 增 值版产品,并提供相关的移植及开发技术支持服务。 本指南详细讲述了利用 MiniGUI 开发嵌入式应用软件的基础知识、技术资料和开发技 巧,内容涉及到 MiniGUI 编程的各个方面,包括消息循环和窗口过程、对话框和控件、图 形接口等。有关 MiniGUI 应用编程接口的详细描述,敬请参考《MiniGUI API Reference Manual》。 I MiniGUI 编程指南 V2.0-4 版权声明 《MiniGUI 编程指南》版本 2.0 修订号 4,适用于 MiniGUI Version 2.0.4/1.6.10。 版权所有 (C) 2003~2007,北京飞漫软件技术有限公司,保留所有权利。 无论您以何种方式获得该手册的全部或部分文字或图片资料,无论是普通印刷品 还是电子文档,北京飞漫软件技术有限公司仅仅授权您阅读的权利,任何形式的 格式转换、再次发布、传播以及复制其内容的全部或部分,或将其中的文字和图 片未经书面许可而用于商业目的,均被视为侵权行为,并可能导致严重的民事或 刑事处罚。 II MiniGUI 编程指南 V2.0-4 目 录 简 介................................................................................................................... I 版权声明.................................................................................................................. II 1 前言..................................................................................................................... 1 1.1 相关的文档 ................................................................................................................... 1 1.2 本指南的组织 ................................................................................................................ 2 1.3 获得本指南中的例子...................................................................................................... 2 1.4 示例程序的编译及运行环境............................................................................................ 3 1.5 版权和许可条款............................................................................................................. 4 I MiniGUI 编程基础...................................................................................... 5 2 开始 MiniGUI 编程 ................................................................................................ 7 2.1 基本的编程概念............................................................................................................. 7 2.1.1 事件驱动编程............................................................ 7 2.1.2 MiniGUI 的三种运行模式.................................................. 7 2.2 一个简单的 MiniGUI 程序............................................................................................... 9 2.2.1 头文件................................................................. 11 2.2.2 程序入口点............................................................. 11 2.2.3 MiniGUI-Processes 模式下加入层......................................... 11 2.2.4 创建和显示主窗口....................................................... 12 2.2.5 进入消息循环........................................................... 13 2.2.6 窗口过程函数........................................................... 15 2.2.7 屏幕输出............................................................... 15 2.2.8 程序的退出............................................................. 16 2.3 编译、链接和运行 ....................................................................................................... 16 2.3.1 编译 MiniGUI 程序....................................................... 16 2.3.2 MiniGUI 的函数库 ....................................................... 17 2.4 为 MiniGUI 应用程序编写 Automake/Autoconf 脚本 ................................................... 17 3 窗口和消息......................................................................................................... 23 3.1 窗口系统和窗口........................................................................................................... 23 3.1.1 什么是窗口系统......................................................... 23 3.1.2 窗口的概念............................................................. 24 3.2 MiniGUI 的窗口............................................................................................................ 24 3.2.1 窗口类型............................................................... 24 3.2.2 主窗口................................................................. 25 III MiniGUI 编程指南 V2.0-4 3.2.3 窗口风格............................................................... 26 3.2.4 主窗口的销毁........................................................... 27 3.2.5 对话框................................................................. 28 3.2.6 控件和控件类........................................................... 28 3.2.7 输入法窗口............................................................. 31 3.3 消息与消息处理........................................................................................................... 33 3.3.1 消息 ................................................................... 33 3.3.2 消息的种类............................................................. 33 3.3.3 消息队列............................................................... 34 3.3.4 消息的处理............................................................. 35 3.3.5 发送和投递消息......................................................... 37 3.3.6 MiniGUI-Processes 的专用消息处理函数 .................................. 38 3.4 几个重要的消息及其处理 ............................................................................................. 39 3.4.1 MSG_NCCREATE........................................................... 39 3.4.2 MSG_SIZECHANGING....................................................... 39 3.4.3 MSG_SIZECHANGED 和 MSG_CSIZECHANGED ................................... 40 3.4.4 MSG_CREATE............................................................. 40 3.4.5 MSG_FONTCHANGING....................................................... 40 3.4.6 MSG_FONTCHANGED........................................................ 41 3.4.7 MSG_ERASEBKGND......................................................... 41 3.4.8 MSG_PAINT.............................................................. 42 3.4.9 MSG_CLOSE.............................................................. 43 3.4.10 MSG_DESTROY........................................................... 43 3.5 通用窗口操作函数 ....................................................................................................... 44 4 对话框编程基础.................................................................................................. 47 4.1 主窗口与对话框........................................................................................................... 47 4.2 对话框模板 ................................................................................................................. 47 4.3 对话框回调函数........................................................................................................... 49 4.4 MSG_INITDIALOG 消息 .............................................................................................. 50 4.5 模态与非模态对话框.................................................................................................... 51 4.6 对话框相关的控件风格和操作函数................................................................................ 52 5 控件编程基础 ..................................................................................................... 55 5.1 控件和控件类 .............................................................................................................. 55 5.2 利用预定义控件类创建控件实例 ................................................................................... 56 5.3 控件编程涉及的内容.................................................................................................... 58 IV MiniGUI 编程指南 V2.0-4 5.4 控件专用的操作函数.................................................................................................... 61 6 控件高级编程 ..................................................................................................... 63 6.1 自定义控件 ................................................................................................................. 63 6.2 控件的子类化 .............................................................................................................. 63 6.3 控件的组合使用........................................................................................................... 64 7 菜单................................................................................................................... 69 7.1 菜单概念..................................................................................................................... 69 7.2 创建和操作菜单........................................................................................................... 69 7.2.1 创建普通菜单........................................................... 69 7.2.2 创建弹出式菜单......................................................... 70 7.2.3 MENUITEMINFO 结构...................................................... 71 7.2.4 操作菜单项............................................................. 72 7.2.5 删除和销毁菜单或菜单项................................................. 73 7.2.6 MSG_ACTIVEMENU 消息.................................................... 73 7.3 编程实例..................................................................................................................... 73 8 滚动条 ............................................................................................................... 77 8.1 滚动条概念 ................................................................................................................. 77 8.2 使能、禁止滚动条 ......................................................................................................
Recommended publications
  • Minigui Technology White Paper
    MiniGUI Technology White Paper Version 2.0 (revised edition 4) for MiniGUI V2.0.4/1.6.10 Copyright © 2002~2007, Beijing Feynman Software Technology Co., Ltd. Latest revision: 2007/07/10 You are permitted to copy and redistribute this document, provided that the document and this announcement are clean and complete. MiniGUI Technology White Paper V2.0-4 Contents 0 Foreword................................................................................... 1 1 Introduction .............................................................................. 2 1.1 What Is MiniGUI............................................................................... 2 1.2 The Origin and Evolution of MiniGUI .................................................... 2 1.3 Typical Application Fields of MiniGUI.................................................... 3 2 Features and Advantages of MiniGUI ............................................. 5 2.1 Technical Features of MiniGUI............................................................. 5 2.2 Advantages of MiniGUI...................................................................... 7 3 System Requirements to Run MiniGUI ........................................... 9 3.1 Operating Systems Supported by MiniGUI............................................ 9 3.2 Hardware Platforms Running MiniGUI .................................................. 9 3.3 Footprint of MiniGUI.......................................................................... 9 4 Software Architecture of MiniGUI ...............................................
    [Show full text]
  • Minigui Technology White Paper
    MiniGUI Technology White Paper Version 3.0 (revised edition 2) for MiniGUI V3.0 Copyright © 2002~2017, Beijing FMSoft Technology Co., Ltd. Latest revision: 2017/11/07 You are permitted to copy and redistribute this document, provided that the document and this announcement are clean and complete. MiniGUI Technology White Paper V3.0 Contents 1 Introduction ............................................................................................................. 1 1.1 What Is MiniGUI ........................................................................................................ 1 1.2 The Origin and Evolution of MiniGUI ........................................................................ 1 1.3 Typical Application Fields of MiniGUI ....................................................................... 4 Hand-held devices ...................................................................................................................................... 4 Digital-media devices and STBs .................................................................................................................. 4 Industry instruments and control systems ................................................................................................. 5 2 Features and Advantages of MiniGUI ...................................................................... 5 2.1 Technical Features of MiniGUI .................................................................................. 5 Hardware support .....................................................................................................................................
    [Show full text]
  • Embedded Linux System Design and Development
    Au0586 half title page 11/17/05 2:05 PM Page 1 EMBEDDED LINUX SYSTEM DESIGN AND DEVELOPMENT Au0586 title page 11/17/05 2:04 PM Page 1 EMBEDDED LINUX SYSTEM DESIGN AND DEVELOPMENT P. Raghavan • Amol Lad • Sriram Neelakandan Boca Raton New York Published in 2006 by Auerbach Publications Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 © 2006 by Taylor & Francis Group, LLC Auerbach is an imprint of Taylor & Francis Group No claim to original U.S. Government works Printed in the United States of America on acid-free paper 10987654321 International Standard Book Number-10: 0-8493-4058-6 (Hardcover) International Standard Book Number-13: 978-0-8493-4058-1 (Hardcover) Library of Congress Card Number 2005048179 This book contains information obtained from authentic and highly regarded sources. Reprinted material is quoted with permission, and sources are indicated. A wide variety of references are listed. Reasonable efforts have been made to publish reliable data and information, but the author and the publisher cannot assume responsibility for the validity of all materials or for the consequences of their use. No part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc.
    [Show full text]
  • Harbour Minigui User Manual V2.0 4E
    MiniGUI User Manual Version 2.0 (revised edition 4) For MiniGUI Version 2.0.4/1.6.10 Beijing Feynman Software Technology Co. Ltd. August, 2007 MiniGUI User Manual V2.0-4 Copyright Claim MiniGUI User Manual Version 2.0 (revised edition 4) for MiniGUI Ver 2.0.4/1.6.10. Copyright © 2003~2007, Beijing Feynman Software Technology Co., Ltd. All rights reserved. By whatever means you get the entire or partial text or photograph data in this guide, no matter mechanical or electronic, you are only authorized by Beijing Feynman Software Technology Co., Ltd. the reading right. Any format conversion, redistribution, dissemination, and copying its entire or partial content, or using text or photograph therein for commercial purpose without written permission will be regarded as tortuous, and may result in severe civil or criminal punishment. MiniGUI User Manual V2.0-4 Contents Copyright Claim ................................................................................. I 1 Introduction to MiniGUI Value-added Release ......................................1 1.1 A Brief Introduction................................................................................ 1 1.2 Documents for MiniGUI-VAR .................................................................... 2 1.3 MiniGUI Source Code and Samples........................................................... 3 1.4 Other Resources in the Product CD-ROM ................................................... 5 1.5 Optional Components of MiniGUI-VAR ....................................................... 5
    [Show full text]
  • Embedded Linux System Design and Development
    Au0586 half title page 11/17/05 2:05 PM Page 1 EMBEDDED LINUX SYSTEM DESIGN AND DEVELOPMENT Au0586 title page 11/17/05 2:04 PM Page 1 EMBEDDED LINUX SYSTEM DESIGN AND DEVELOPMENT TEAM FLY P. Raghavan • Amol Lad • Sriram Neelakandan Boca Raton New York Published in 2006 by Auerbach Publications Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 © 2006 by Taylor & Francis Group, LLC Auerbach is an imprint of Taylor & Francis Group No claim to original U.S. Government works Printed in the United States of America on acid-free paper 10987654321 International Standard Book Number-10: 0-8493-4058-6 (Hardcover) International Standard Book Number-13: 978-0-8493-4058-1 (Hardcover) Library of Congress Card Number 2005048179 This book contains information obtained from authentic and highly regarded sources. Reprinted material is quoted with permission, and sources are indicated. A wide variety of references are listed. Reasonable efforts have been made to publish reliable data and information, but the author and the publisher cannot assume responsibility for the validity of all materials or for the consequences of their use. No part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc.
    [Show full text]
  • Monitor System for Protection Device Based on Embedded RTOS
    J. Electromagnetic Analysis & Applications, 2009, 1: 245-248 245 doi:10.4236/jemaa.2009.14037 Published Online December 2009 (http://www.SciRP.org/journal/jemaa) Monitor System for Protection Device Based on Embedded RTOS Yang WANG, Xianggen YIN, Zhe ZHANG Electric Power Security and High Efficiency Lab, Huazhong University of Science and Technology, Wuhan, China. Email: [email protected] Received September 8th, 2009; revised September 26th, 2009; accepted September 29th, 2009. ABSTRACT For the purpose of the monitor system in digital protection, the embedded real-time operating system (RTOS) and the embedded GUI (Graphical User Interface) is introduced to design the monitor system. Combining the necessity and the application value of the operation system, the choice of embedded Linux and Qt/Embedded is completely viable for the monitor system in digital protection for generator-transformer sets. The design with embedded Linux and embedded GUI enriches system information, increases developing efficiency and improve the generality. Keywords: Real-Time, Operating System, Embedded Linux, Protection, Monitor System 1. Introduction gineering at present. Restricted by factors like cost, en- ergy consumption and chip size, embedded systems are After the development of digital protection for over 20 closely linked with their application and market. It is years in our country, The rapid development of DSP critical to design and develop embedded system products (Digital Signal Processor) and high performance embed- with the proper cost, function and performance. ded microprocessor not only make the digital protection Embedded system is used in power system for a long function more perfect and reliable, but also can gather time, including data collection, automatic equipment, and deal with more abundant data [1,2].
    [Show full text]
  • Minigui User Manual
    MiniGUI User Manual Version 2.0 (revised edition 4) For MiniGUI Version 2.0.4/1.6.10 Beijing Feynman Software Technology Co. Ltd. August, 2007 MiniGUI User Manual V2.0-4 Copyright Claim MiniGUI User Manual Version 2.0 (revised edition 4) for MiniGUI Ver 2.0.4/1.6.10. Copyright © 2003~2007, Beijing Feynman Software Technology Co., Ltd. All rights reserved. By whatever means you get the entire or partial text or photograph data in this guide, no matter mechanical or electronic, you are only authorized by Beijing Feynman Software Technology Co., Ltd. the reading right. Any format conversion, redistribution, dissemination, and copying its entire or partial content, or using text or photograph therein for commercial purpose without written permission will be regarded as tortuous, and may result in severe civil or criminal punishment. MiniGUI User Manual V2.0-4 Contents Copyright Claim ................................................................................. I 1 Introduction to MiniGUI Value-added Release ......................................1 1.1 A Brief Introduction................................................................................ 1 1.2 Documents for MiniGUI-VAR .................................................................... 2 1.3 MiniGUI Source Code and Samples........................................................... 3 1.4 Other Resources in the Product CD-ROM ................................................... 5 1.5 Optional Components of MiniGUI-VAR ....................................................... 5
    [Show full text]
  • Minigui 用户手册 V2.0-4
    MiniGUI 用 户 手 册 版本 2.0 修订号 4 适用于 MiniGUI Ver 2.0.4/1.6.10 北京飞漫软件技术有限公司 2007 年 8 月 MiniGUI 用户手册 V2.0-4 版权声明 《MiniGUI 用户手册》 版本 2.0 修订号 4,适用于 MiniGUI 版本 2.0.4/1.6.10。 版权所有 (C) 2003~2007,北京飞漫软件技术有限公司,保留所有权利。 无论您以何种方式获得该手册的全部或部分文字或图片资料,无论是普通印刷品还是电 子文档,北京飞漫软件技术有限公司仅仅授权您阅读的权利,任何形式的格式转换、再 次发布、传播以及复制其内容的全部或部分,或将其中的文字和图片未经书面许可而用 于商业目的,均被视为侵权行为,并可能导致严重的民事或刑事处罚。 MiniGUI 用户手册 V2.0-4 目 录 版权声明 .........................................................................................................................I 1 MiniGUI 增值版介绍 ....................................................................................................1 1.1 MiniGUI 增值版简介..............................................................................................................1 1.2 MiniGUI 增值版产品文档 ......................................................................................................2 1.3 MiniGUI 源代码以及示例程序 ...............................................................................................2 1.4 产品光盘中的其他资源..........................................................................................................3 1.5 可选组件产品........................................................................................................................4 1.6 关于本手册............................................................................................................................5 2 MiniGUI 的配置、编译和安装......................................................................................7 2.1 编译时配置选项的生成..........................................................................................................7
    [Show full text]
  • Embedded-Linux-120203.Pdf
    Embedded Linux Delivered and/or Customized by: These slides are made available to you under a Creative Commons Share-Alike 3.0 license. The full terms of this license are here: https://creativecommons.org/licenses/by-sa/3.0/ Attribution requirements and misc., PLEASE READ: ● This slide must remain as-is in this specific location (slide #2), everything else you are free to change; including the logo :-) ● Use of figures in other documents must feature the below “Originals at” URL immediately under that figure and the below copyright notice where appropriate. ● You are free to fill in the “Delivered and/or customized by” space on the right as you see fit. ● You are FORBIDEN from using the default “About the instructor” slide as-is or any of its contents. (C) Copyright 2003-2012, Opersys inc. These slides created by: Karim Yaghmour Originals at: www.opersys.com/training/embedded-linux 2 Course Structure and Presentation 1.About the instructor 2.Goals 3.Presentation format 4.Expected knowledge 5.Knowledge fields 6.Day-by-day outline 7.Courseware 8.Hardware 3 1. About the instructor ● Author of: ● Introduced Linux Trace Toolkit in 1999 ● Originated Adeos and relayfs (kernel/relay.c) 4 2. Goals ● To provide an in-depth understanding of an embedded Linux system©s architecture. ● To enable you to put together an embedded Linux system with as little 3rd party dependencies as possible in an architecture-independent fashion. ● To give you a hands-on experience of putting together and programming embedded Linux systems. ● To teach you how open source and free software packages are developed and how to take advantage of that development model.
    [Show full text]
  • MINIGUI-USER-MANUAL-V3.0-5E.Pdf
    MiniGUI User Manual Version 3.0 (revised edition 5) For MiniGUI Version 3.0. Beijing FMSoft Technologies Co. Ltd. Feb, 2018 Copyright Claim MiniGUI User Manual Version 3.0 (revised edition 5) for MiniGUI Ver 3.0.x. Copyright © 2003~2018, Beijing FMSoft Technologies Co., Ltd. All rights reserved. By whatever means you get the entire or partial text or photograph data in this guide, no matter mechanical or electronic, you are only authorized by Beijing FMSoft Technologies Co., Ltd. the reading right. Any format conversion, redistribution, dissemination, and copying its entire or partial content, or using text or photograph there in for commercial purpose without written permission will be regarded as tortuous, and may result in severe civil or criminal punishment. MiniGUI User Manual V3.0-5 Contents Copyright Claim .................................................................................1 1 Introduction to MiniGUI ....................................................................1 1.1 A Brief Introduction ................................................................................1 1.2 Documents for MiniGUI ...........................................................................2 1.3 MiniGUI Source Code and Samples ...........................................................2 1.4 Optional Components of MiniGUI ..............................................................3 1.5 miniStudio development tools .................................................................4 1.6 About this Manual ...................................................................................5
    [Show full text]
  • Minigui Technology White Paper
    MiniGUI Technology White Paper Version 3.2 Copyright © 2002~2018, Beijing FMSoft Technology Co., Ltd. Latest revision: 2018/02/28 You are permitted to copy and redistribute this document, provided that the document and this announcement are clean and complete. MiniGUI Technology White Paper Contents 1. Introduction ................................................................................................................................ 1 What Is MiniGUI .................................................................................................................................... 1 Goals of MiniGUI ................................................................................................................................... 1 The Origin and Evolution of MiniGUI .................................................................................................... 2 Typical Application Fields of MiniGUI.................................................................................................... 4 Smart IoT devices ........................................................................................................................................................... 4 Hand-held devices .......................................................................................................................................................... 4 Digital-media devices and STBs ...................................................................................................................................... 5 Industry instruments
    [Show full text]
  • Embedded Linux System Development Training
    Free Electrons Embedded Linux system development training Thomas Petazzoni Florent Peyraud Michael Opdenacker 1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Linux kernel Linux device drivers Free Electrons Board support code Our services Mainstreaming kernel code Kernel debugging Custom Development System integration Embedded Linux Training Embedded Linux demos and prototypes All materials released with a free license! System optimization Unix and GNU/Linux basics Application and interface development Linux kernel and drivers development Real-time Linux, uClinux Consulting and technical support Development and profiling tools Help in decision making Lightweight tools for embedded systems System architecture Root filesystem creation System design and performance review Audio and multimedia Development tool and application support System optimization Investigating issues and fixing tool bugs Rights to copy © Copyright 2004-2009, Free Electrons [email protected] Document updates available on http://free-electrons.com/doc/training/embedded-linux/ Corrections, suggestions, contributions and translations are welcome! Attribution ± ShareAlike 3.0 Latest update: May 21, 2009 You are free to copy, distribute, display, and perform the work to make derivative works to make commercial use of the work Under the following conditions Attribution. You must give the original author credit. Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. For any reuse or distribution, you must make clear to others the license terms of this work. Any of these conditions can be waived if you get permission from the copyright holder.
    [Show full text]