初级会员
- 积分
- 98
- 金钱
- 98
- 注册时间
- 2015-1-9
- 在线时间
- 0 小时
|
5金钱
#include <stddef.h>
#include "GUI.h"
#include "WM.h"
#include "WM.h"
#include "BUTTON.h"
#include "LISTBOX.h"
#include "SLIDER.h"
const char *a[]={"a","j","w","m","e","w"} ;
SLIDER_Handle slider ;
BUTTON_Handle button ;
void Paintyinyue(WM_MESSAGE * pMsg)
{
WM_HWIN hWin = pMsg->hWin;
GUI_SetBkColor(GUI_BLUE); //设置桌面背景色
GUI_Clear();
button = BUTTON_CreateAsChild( 355,385,93,34,hWin,0,WM_CF_SHOW); //创建一个按钮
LISTBOX_CreateAsChild(a,hWin ,277,145,171,84,WM_CF_SHOW) ; //创建一个listbox
slider = SLIDER_Create( 11, 385,154,44,hWin,1,WM_CF_SHOW,0) ;//创建一个滑动条
SLIDER_SetRange(slider,0,100) ; //设置滑动条的范围
GUI_SetColor(GUI_BLACK); //设置字体颜色
GUI_SetFont(&GUI_Font32_ASCII) ;
GUI_DispStringAt("-",60, 359);
GUI_DispStringAt("+", 144,359);
GUI_Delay(1);
}
static void _cbCallback(WM_MESSAGE * pMsg)
{
int NCode, Id;
WM_HWIN hWin = pMsg->hWin;
switch (pMsg->MsgId)
{
case WM_PAINT:
 aintyinyue(pMsg);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch (Id)
{
//消息处理
}
break;
default:
WM_DefaultProc(pMsg);
}
}
/*********************************************************************
*
* MainTask
*
**********************************************************************
*/
void MainTask(void)
{
WM_HWIN WMyinyue = WM_CreateWindow( 180, 10, 500, 450, WM_CF_SHOW | WM_CF_MEMDEV, _cbCallback, 0);
while(1){
WM_Exec();
}
}
|
|