|
我用guibuilder做了三个button和一个edit,生成的C文件我移植到开发板上,但是在屏上没有显示,只能看到设置的窗口大小和颜色变化,下面是maintask的代码:麻烦看看哪里有问题呢,还有我在开发板上跑配套教程的例子在屏上都没有显示,不知道什么原因
/*
*********************************************************************************************************
*
* Ä£¿éÃû3Æ : GUI½çÃæèÎÎñ
* ÎļtÃû3Æ : MainTask.c
* °æ ±¾ : V1.0
* Ëμ Ã÷ : GUIèÎÎñ
*
* DT¸Ä¼Ç¼ :
* °æ±¾oÅ èÕÆú ×÷Õß ËμÃ÷
* V1.0 2015-09-28 Eric2013 1. ST1ì¼t¿aμ½V3.6.1°æ±¾
* 2. BSPÇy¶ˉ°üV1.2
* 3. STemWin°æ±¾V5.28
*
* Copyright (C), 2015-2020, °2¸»à3μç×ó www.armfly.com
*
*********************************************************************************************************
*/
#include "includes.h"
#include "MainTask.h"
/*********************************************************************
* *
* SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
* *
**********************************************************************
* *
* C-file generated by: *
* *
* GUI_Builder for emWin version 5.28 *
* Compiled Jan 30 2015, 16:41:06 *
* (c) 2015 Segger Microcontroller GmbH & Co. KG *
* *
**********************************************************************
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
*/
// USER START (Optionally insert additional includes)
// USER END
#include "DIALOG.h"
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define ID_FRAMEWIN_0 (GUI_ID_USER + 0x00)
#define ID_BUTTON_0 (GUI_ID_USER + 0x01)
#define ID_BUTTON_1 (GUI_ID_USER + 0x02)
#define ID_BUTTON_2 (GUI_ID_USER + 0x03)
#define ID_EDIT_0 (GUI_ID_USER + 0x04)
// USER START (Optionally insert additional defines)
// USER END
/*********************************************************************
*
* Static data
*
**********************************************************************
*/
// USER START (Optionally insert additional static data)
// USER END
/*********************************************************************
*
* _aDialogCreate
*/
static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
{ FRAMEWIN_CreateIndirect, "Framewin", ID_FRAMEWIN_0, 7, 22, 800, 480, 0, 0x0, 0 },
{ BUTTON_CreateIndirect, "Button0", ID_BUTTON_0, 449, 57, 145, 56, 0, 0x0, 0 },
{ BUTTON_CreateIndirect, "Button1", ID_BUTTON_1, 450, 162, 145, 58, 0, 0x0, 0 },
{ BUTTON_CreateIndirect, "Button2", ID_BUTTON_2, 451, 266, 142, 61, 0, 0x0, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT_0, 240, 171, 138, 42, 0, 0x64, 0 },
// USER START (Optionally insert additional widgets)
// USER END
};
/*********************************************************************
*
* Static code
*
**********************************************************************
*/
// USER START (Optionally insert additional static code)
// USER END
/*********************************************************************
*
* _cbDialog
*/
static void _cbDialog(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
int NCode;
int Id;
// USER START (Optionally insert additional variables)
// USER END
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
//
// Initialization of 'Button0'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
BUTTON_SetFont(hItem, GUI_FONT_24B_ASCII);
//
// Initialization of 'Button1'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_1);
BUTTON_SetFont(hItem, GUI_FONT_24B_ASCII);
//
// Initialization of 'Button2'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_2);
BUTTON_SetFont(hItem, GUI_FONT_24B_ASCII);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0);
EDIT_SetText(hItem, "armfly");
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetTextColor(hItem, EDIT_CI_ENABLED, 0x008080FF);
// USER START (Optionally insert additional code for further widget initialization)
// USER END
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_BUTTON_0: // Notifications sent by 'Button0'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
// USER START (Optionally insert additional code for further notification handling)
// USER END
}
break;
case ID_BUTTON_1: // Notifications sent by 'Button1'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
// USER START (Optionally insert additional code for further notification handling)
// USER END
}
break;
case ID_BUTTON_2: // Notifications sent by 'Button2'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
// USER START (Optionally insert additional code for further notification handling)
// USER END
}
break;
case ID_EDIT_0: // Notifications sent by 'Edit'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
// USER START (Optionally insert additional code for further notification handling)
// USER END
}
break;
// USER START (Optionally insert additional code for further Ids)
// USER END
}
break;
// USER START (Optionally insert additional message handling)
// USER END
default:
WM_DefaultProc(pMsg);
break;
}
}
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* CreateFramewin
*/
WM_HWIN CreateFramewin(void);
WM_HWIN CreateFramewin(void) {
WM_HWIN hWin;
hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
return hWin;
}
// USER START (Optionally insert additional public code)
// USER END
/*************************** End of file ****************************/
/* 񄠨 */
int i;
char acText[] = "www.armfly.com www.armfly.taobao.com Eric2013";
GUI_RECT Rect = {10, 10, 59, 59};
GUI_WRAPMODE aWm[] = {GUI_WRAPMODE_NONE,
GUI_WRAPMODE_CHAR,
GUI_WRAPMODE_WORD};
/*
*********************************************************************************************************
* oˉ êy Ãû: MainTask
* 1|ÄüËμÃ÷: GUIÖ÷oˉêy
* DÎ 2ΣoÎT
* ·μ »Ø Öμ: ÎT
*********************************************************************************************************
*/
void MainTask(void)
{
GUI_Init();
/*12.7 BUTTON*/
GUI_SetFont(GUI_FONT_24B_ASCII);
WM_SetDesktopColor(GUI_WHITE);
WM_SetCreateFlags(WM_CF_MEMDEV);
CreateFramewin();
/*
GUI_CURSOR_Show();
GUI_SetTextMode(GUI_TM_TRANS);
for (i = 0; i < 3; i++)
{
GUI_SetColor(GUI_BLUE);
GUI_FillRectEx(&Rect);
GUI_SetColor(GUI_WHITE);
GUI_DispStringInRectWrap(acText, &Rect, GUI_TA_LEFT, aWm);
Rect.x0 += 60;
Rect.x1 += 60;
} */
while (1)
{
GUI_Delay(10);
}
}
/***************************** °2¸»à3μç×ó www.armfly.com (END OF FILE) *********************************/ |
|