大学生
最后登录1970-1-1
在线时间 小时
注册时间2017-1-8
|
#include "DIALOG.h"
#include <includes.h>
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define ID_FRAMEWIN_0 (GUI_ID_USER + 0x00)
#define ID_TEXT_0 (GUI_ID_USER + 0x01)
#define ID_ICONVIEW_0 (GUI_ID_USER + 0x02)
extern GUI_CONST_STORAGE GUI_BITMAP bm01;
extern GUI_CONST_STORAGE GUI_BITMAP bm02;
extern GUI_CONST_STORAGE GUI_BITMAP bm03;
extern GUI_CONST_STORAGE GUI_BITMAP bm04;
extern GUI_CONST_STORAGE GUI_BITMAP bm05;
extern GUI_CONST_STORAGE GUI_BITMAP bm06;
extern GUI_CONST_STORAGE GUI_BITMAP bm07;
extern GUI_CONST_STORAGE GUI_BITMAP bm08;
extern GUI_CONST_STORAGE GUI_BITMAP bm09;
// 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, 0, 0, 240, 320, 0, 0x0, 0 },
{ TEXT_CreateIndirect, "Text", ID_TEXT_0, 22, 259, 166, 31, 0, 0x64, 0 },
{ ICONVIEW_CreateIndirect, "Iconview", ID_ICONVIEW_0, 0, 0, 240, 250, 0, 0x0, 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;
WM_HWIN IconviewWin; //ICONVIEW控件窗口
// USER START (Optionally insert additional variables)
// USER END
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
//
// Initialization of 'Framewin'
//
hItem = pMsg->hWin;
FRAMEWIN_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
//
// Initialization of 'Text'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
TEXT_SetFont(hItem, GUI_FONT_13H_ASCII);
TEXT_SetText(hItem, "Text");
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
hItem = WM_GetDialogItem(pMsg->hWin, ID_ICONVIEW_0);
ICONVIEW_SetIconAlign(hItem, ICONVIEW_IA_TOP);
ICONVIEW_SetTextColor(hItem, ICONVIEW_CI_UNSEL, GUI_BLUE);
ICONVIEW_SetTextColor(hItem, ICONVIEW_CI_SEL, GUI_GREEN);
ICONVIEW_SetFrame(hItem, GUI_COORD_X, 0);
ICONVIEW_SetFrame(hItem, GUI_COORD_Y, 0);
ICONVIEW_SetSpace(hItem, GUI_COORD_X, 65);
ICONVIEW_SetSpace(hItem, GUI_COORD_Y, 32);
ICONVIEW_SetSpace
这个地方怎么修改都显示不正常,个朋友分析一下是什么问题
ICONVIEW_SetFont(hItem, GUI_FONT_16_1);
ICONVIEW_AddBitmapItem(hItem, &bm01, "neqee");
ICONVIEW_AddBitmapItem(hItem, &bm02, "SOS");
ICONVIEW_AddBitmapItem(hItem, &bm03, "Phone");
ICONVIEW_AddBitmapItem(hItem, &bm04, "Camera");
ICONVIEW_AddBitmapItem(hItem, &bm05, "Email");
ICONVIEW_AddBitmapItem(hItem, &bm06, "NoteBook");
ICONVIEW_AddBitmapItem(hItem, &bm07, "JTV");
ICONVIEW_AddBitmapItem(hItem, &bm08, "Dollar");
// 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_ICONVIEW_0: // Notifications sent by 'Iconview'
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_MOVED_OUT:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_SCROLL_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_SEL_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;
}
void MainTask(void)
{
BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX);
CHECKBOX_SetDefaultSkin(CHECKBOX_SKIN_FLEX);
DROPDOWN_SetDefaultSkin(DROPDOWN_SKIN_FLEX);
FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX);
HEADER_SetDefaultSkin(HEADER_SKIN_FLEX);
MENU_SetDefaultSkin(MENU_SKIN_FLEX);
MULTIPAGE_SetDefaultSkin(MULTIPAGE_SKIN_FLEX);
PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX);
RADIO_SetDefaultSkin(RADIO_SKIN_FLEX);
SCROLLBAR_SetDefaultSkin(SCROLLBAR_SKIN_FLEX);
SLIDER_SetDefaultSkin(SLIDER_SKIN_FLEX);
SPINBOX_SetDefaultSkin(SPINBOX_SKIN_FLEX);
CreateFramewin();
LCD_BK_OFF();
while(1)
GUI_Delay(100);
}
// USER START (Optionally insert additional public code)
// USER END
/*************************** End of file ****************************/
|
|