[ucgui] 子窗口父窗口
它创建了3个窗口:
- 第一个作为桌面的子窗口
- 第二个作为第一个窗口的子窗口
- 第三个作为第二个窗口的子窗口
窗口创建后,使用WM_ForEachDesc()在其父窗口中移动各个窗口:
static void _cbWin(WM_MESSAGE * pMsg) {
GUI_COLOR Color;
switch (pMsg->MsgId) {
case WM_PAINT:
WM_GetUserData(pMsg->hWin, &Color, );
GUI_SetBkColor(Color);
GUI_Clear();
break;
default:
WM_DefaultProc(pMsg);
}
}
/*********************************************************************
*
* _cbDoSomething
*/
static void _cbDoSomething(WM_HWIN hWin, void * p) {
int Value = *(int *)p;
WM_MoveWindow(hWin, Value, Value);
}
/*********************************************************************
*
* MainTask
*/
void Fun(void) {
WM_HWIN hWin_1, hWin_2, hWin_3;
int Value = ;
GUI_COLOR aColor[] = {GUI_RED, GUI_GREEN, GUI_BLUE};
GUI_Init();
WM_SetDesktopColor(GUI_BLACK);
hWin_1 = WM_CreateWindow( , , , , WM_CF_SHOW, _cbWin, );
hWin_2 = WM_CreateWindowAsChild(, , , , hWin_1, WM_CF_SHOW, _cbWin, );
hWin_3 = WM_CreateWindowAsChild(, , , , hWin_2, WM_CF_SHOW, _cbWin, );
WM_SetUserData(hWin_1, &aColor[], );
WM_SetUserData(hWin_2, &aColor[], );
WM_SetUserData(hWin_3, &aColor[], );
while () {
WM_ForEachDesc(WM_HBKWIN, _cbDoSomething, (void *)&Value);
Value *= -;
GUI_Delay();
}
}
- 前两个为回调函数,Fun函数为主函数,建立3个窗口
- WM_HWIN WM_CreateWindow(int x0, int y0,
int width, int height,
U8 Style, WM_CALLBACK * cb
int NumExtraBytes); - WM_HWIN WM_CreateWindowAsChild(int x0, int y0,
int width, int height,
WM_HWIN hWinParent,
U8 Style,
WM_CALLBACK* cb
int NumExtraBytes); - void WM_ForEachDesc(WM_HWIN hWin, WM_tfForEach * pcb, void * pData);
[ucgui] 子窗口父窗口的更多相关文章
- 关于Mdi窗口-父窗口上的控件把子窗口的挡住的问题
using System.Runtime.InteropServices; [DllImport("user32")] public static extern int SetPa ...
- 更新记录后关闭子窗口并刷新父窗口的Javascript
有时我们需要在新打开的窗口里面编辑信息,等编辑完了,需要将当前窗口关闭并且刷新父窗口,以使修改生效,本文就是介绍用 javascript 来实现"更新记录后关闭子窗口并刷新父窗口" ...
- HTML中IFrame父窗口与子窗口相互操作
一.Iframe篇 //&&&&&&&&&&&&&&&&&&am ...
- JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作
一.Iframe 篇 公共部分 //父对象得到子窗口的值 //ObjectID是窗口标识,ContentID是元素ID function GetValue(ObjectID,ContentID) { ...
- 总结JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作
一.Iframe 篇 //&&&&&&&&&&&&&&&&&&a ...
- 总结js(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作
http://hi.baidu.com/yashua839/blog/item/131fdb2fe547ef221f3089af.html一.Iframe 篇 //&&&&am ...
- showModalDialog()子窗口刷新父窗口
今天再次使用showModalDialog(),发现了两个问题,一是子窗口如何刷新父窗口,二是窗口的参数问题. 1 子窗口刷新父窗口 如果是window.open();问题就好办,直接用window. ...
- mfc窗口,父窗口parentwindow,所有者窗口ownerwindow 区别
一. parent:创建者,owner:所有者 小玉的父母生下小玉,养到8岁,卖给贾府当丫头小玉的父母是parent,贾府是owner 二. 1.Pop-up窗口: 一个弹出窗口是必须具有WS_POP ...
- 窗口,父窗口parentwindow,所有者窗口ownerwindow
参考文档:http://www.cnblogs.com/fwycmengsoft/p/4026592.html 一. parent:创建者,owner:所有者 小玉的父母生下小玉,养到8岁,卖给贾府当 ...
随机推荐
- linux C学习笔记01--makefile
不知不觉毕业五年了,以前学的linux基本都忘了,重新温习起来吧! 下面是自己写的makefile文件,供新手和自己回头时查阅 CC=gcc EXE=c.out CCC=g++ EEE=cc.out ...
- PHPRPC servlet发布服务
1.服务端 web.xml PHPRPCDispacherServlet 2.客户端 controller层调用
- IIS中使用LocalDB遇到错误:error 50,Local Database Runtime error occurred.的解决办法
参见: [1] http://www.cnblogs.com/yjmyzz/archive/2009/10/26/1590033.html [2] http://blogs.msdn.com/b/sq ...
- ViewPager + Fragment实现滑动标签页
http://blog.csdn.net/lizhenmingdirk/article/details/13631813; tab与frg的区别: http://www.cnblogs.com/tia ...
- Spring 定时执行任务重复执行多次
使用spring的定时任务组件的时候,代码如下. @Scheduled(cron="0 5/5 * * * ?") public void sendWeatherSMS() { S ...
- Aborting commit: 'XXX' remains in conflict
Aborting commit: 'XXX' remains in conflict 错误 本地也删除了一个文件夹,用svn 的repo-brower 删除了服务器上的对应的文件夹 ,再次comm ...
- nginx的特点
1.热部署 我个人觉得这个很不错.在master管理进程与worker工作进程的分离设计,使的Nginx具有热部署的功能,那么在7×24小时不间断服务的前提下,升级Nginx的可执行文件 ...
- ListView和ScrollView冲突
当ListView放在ScrollView中的时候,无论你设置高度为 match_parent(填充父窗体)和wrap_content(包裹内容)都只显示一行,这是你把ListView放在Linear ...
- java多线程详解(6)-线程间的通信wait及notify方法
Java多线程间的通信 本文提纲 一. 线程的几种状态 二. 线程间的相互作用 三.实例代码分析 一. 线程的几种状态 线程有四种状态,任何一个线程肯定处于这四种状态中的一种:(1). 产生(New) ...
- hdu 5720 Wool
hdu 5720 问题描述 黎明时,Venus为Psyche定下了第二个任务.她要渡过河,收集对岸绵羊身上的金羊毛. 那些绵羊狂野不驯,所以Psyche一直往地上丢树枝来把它们吓走.地上现在有n n ...