ucGUI问题求助(定义了12个DROPDOWN控帛不能显示)
[复制链接]
/*
******************************************************************
** uCGUIBuilder **
** Version: 4.0.0.0 **
** 2012 / 04 **
** CpoyRight to: wyl **
** Email:ucguibuilder@163.com **
** This text was Created by uCGUIBuilder **
******************************************************************/
#include
#include "GUI.h"
#include "DIALOG.h"
#include "WM.h"
#include "BUTTON.h"
#include "CHECKBOX.h"
#include "DROPDOWN.h"
#include "EDIT.h"
#include "FRAMEWIN.h"
#include "LISTBOX.h"
#include "MULTIEDIT.h"
#include "RADIO.h"
#include "SLIDER.h"
#include "TEXT.h"
#include "PROGBAR.h"
#include "SCROLLBAR.h"
#include "LISTVIEW.h"
#define GUI_ID_DROPDOWN10 (GUI_ID_USER+400)
#define GUI_ID_DROPDOWN11 (GUI_ID_USER+401)
//EventsFunctionList
//EndofEventsFunctionList
/*********************************************************************
*
* static data
*
**********************************************************************
*/
/*********************************************************************
*
* Dialog resource
*
* This table conatins the info required to create the dialog.
* It has been created by ucGUIbuilder.
*/
static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
{ FRAMEWIN_CreateIndirect, "Caption", 0, 0, 0, 480,272,FRAMEWIN_CF_MOVEABLE,0},
{ DROPDOWN_CreateIndirect, NULL, GUI_ID_DROPDOWN0, 1, 28, 58, 120, 0,0},
{ TEXT_CreateIndirect, "TEXT0", GUI_ID_TEXT0, 126,31, 35, 12, 0,0},
{ BUTTON_CreateIndirect, "BUTTON0", GUI_ID_BUTTON0, 250,190,84, 40, 0,0},
{ BUTTON_CreateIndirect, "BUTTON0", GUI_ID_BUTTON1, 367,190,84, 40, 0,0},
{ DROPDOWN_CreateIndirect, NULL, GUI_ID_DROPDOWN1, 62, 28, 58, 80, 0,0},
{ DROPDOWN_CreateIndirect, NULL, GUI_ID_DROPDOWN2, 160,28, 58, 80, 0,0},
{ TEXT_CreateIndirect, "TEXT0", GUI_ID_TEXT0, 285,31, 35, 12, 0,0},
{ DROPDOWN_CreateIndirect, NULL, GUI_ID_DROPDOWN3, 221,28, 58, 80, 0,0},
{ DROPDOWN_CreateIndirect, NULL, GUI_ID_DROPDOWN4, 320,28, 58, 80, 0,0},
{ TEXT_CreateIndirect, "TEXT0", GUI_ID_TEXT0, 445,31, 35, 12, 0,0},
{ DROPDOWN_CreateIndirect, NULL, GUI_ID_DROPDOWN5, 381,28, 58, 80, 0,0},
{ DROPDOWN_CreateIndirect, NULL, GUI_ID_DROPDOWN6, 1, 79, 58, 80, 0,0},
{ TEXT_CreateIndirect, "TEXT0", GUI_ID_TEXT0, 126,82, 35, 12, 0,0},
{ DROPDOWN_CreateIndirect, NULL, GUI_ID_DROPDOWN7, 62, 79, 58, 80, 0,0},
{ DROPDOWN_CreateIndirect, NULL, GUI_ID_DROPDOWN8, 160,79, 58, 80, 0,0},
{ TEXT_CreateIndirect, "TEXT0", GUI_ID_TEXT0, 285,82, 35, 12, 0,0},
{ DROPDOWN_CreateIndirect, NULL, GUI_ID_DROPDOWN9, 221,79, 58, 80, 0,0},
{ DROPDOWN_CreateIndirect, NULL, GUI_ID_DROPDOWN10, 320,79, 58, 80, 0,0},
{ TEXT_CreateIndirect, "TEXT0", GUI_ID_TEXT0, 445,82, 35, 12, 0,0},
{ DROPDOWN_CreateIndirect, NULL, GUI_ID_DROPDOWN11, 381,79, 58, 80, 0,0}
};
/*****************************************************************
** FunctionName:void PaintDialog(WM_MESSAGE * pMsg)
** Function: to initialize the Dialog items
**
** call this function in _cbCallback --> WM_PAINT
*****************************************************************/
void PaintDialog(WM_MESSAGE * pMsg)
{
WM_HWIN hWin = pMsg->hWin;
}
/*****************************************************************
** FunctionName:void InitDialog(WM_MESSAGE * pMsg)
** Function: to initialize the Dialog items
**
** call this function in _cbCallback --> WM_INIT_DIALOG
*****************************************************************/
void InitDialog(WM_MESSAGE * pMsg)
{
WM_HWIN hWin = pMsg->hWin;
//
//FRAMEWIN
//
FRAMEWIN_SetClientColor(hWin,0xe0e0e0);
FRAMEWIN_SetTextAlign(hWin,GUI_TA_VCENTER|GUI_TA_CENTER);
FRAMEWIN_SetTitleHeight(hWin,20);
//
//GUI_ID_DROPDOWN0
//
DROPDOWN_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN0),0,0xffffff);
DROPDOWN_SetAutoScroll(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN0),1);
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN0),"0");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN0),"1");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN0),"2");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN0),"3");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN0),"4");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN0),"5");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN0),"6");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN0),"7");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN0),"8");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN0),"9");
//
//GUI_ID_TEXT0
//
TEXT_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_TEXT0),0xe0e0e0);
//
//GUI_ID_BUTTON0
//
BUTTON_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_BUTTON0),BUTTON_CI_UNPRESSED,0xe0e0e0);
//
//GUI_ID_BUTTON1
//
BUTTON_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_BUTTON1),BUTTON_CI_UNPRESSED,0xe0e0e0);
//
//GUI_ID_DROPDOWN1
//
DROPDOWN_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN1),0,0xffffff);
DROPDOWN_SetAutoScroll(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN1),1);
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN1),"0");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN1),"1");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN1),"2");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN1),"3");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN1),"4");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN1),"5");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN1),"6");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN1),"7");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN1),"8");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN1),"9");
//
//GUI_ID_DROPDOWN2
//
DROPDOWN_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN2),0,0xffffff);
DROPDOWN_SetAutoScroll(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN2),1);
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN2),"0");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN2),"1");
//
//GUI_ID_TEXT0
//
TEXT_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_TEXT0),0xe0e0e0);
//
//GUI_ID_DROPDOWN3
//
DROPDOWN_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN3),0,0xffffff);
DROPDOWN_SetAutoScroll(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN3),1);
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN3),"0");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN3),"1");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN3),"2");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN3),"3");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN3),"4");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN3),"5");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN3),"6");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN3),"7");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN3),"8");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN3),"9");
//
//GUI_ID_DROPDOWN4
//
DROPDOWN_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN4),0,0xffffff);
DROPDOWN_SetAutoScroll(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN4),1);
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN4),"0");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN4),"1");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN4),"2");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN4),"3");
//
//GUI_ID_TEXT0
//
TEXT_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_TEXT0),0xe0e0e0);
//
//GUI_ID_DROPDOWN5
//
DROPDOWN_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN5),0,0xffffff);
DROPDOWN_SetAutoScroll(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN5),1);
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN5),"0");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN5),"1");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN5),"2");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN5),"3");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN5),"4");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN5),"5");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN5),"6");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN5),"7");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN5),"8");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN5),"9");
//
//GUI_ID_DROPDOWN6
//
DROPDOWN_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN6),0,0xffffff);
DROPDOWN_SetAutoScroll(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN6),1);
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN6),"0");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN6),"1");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN6),"2");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN6),"3");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN6),"4");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN6),"5");
//
//GUI_ID_TEXT0
//
TEXT_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_TEXT0),0xe0e0e0);
//
//GUI_ID_DROPDOWN7
//
DROPDOWN_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN7),0,0xffffff);
DROPDOWN_SetAutoScroll(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN7),1);
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN7),"0");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN7),"1");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN7),"2");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN7),"3");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN7),"4");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN7),"5");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN7),"6");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN7),"7");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN7),"8");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN7),"9");
//
//GUI_ID_DROPDOWN8
//
DROPDOWN_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN8),0,0xffffff);
DROPDOWN_SetAutoScroll(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN8),1);
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN8),"0");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN8),"1");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN8),"2");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN8),"3");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN8),"4");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN8),"5");
//
//GUI_ID_TEXT0
//
TEXT_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_TEXT0),0xe0e0e0);
//
//GUI_ID_DROPDOWN9
//
DROPDOWN_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN9),0,0xffffff);
DROPDOWN_SetAutoScroll(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN9),1);
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN9),"0");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN9),"1");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN9),"2");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN9),"3");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN9),"4");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN9),"5");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN9),"6");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN9),"7");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN9),"8");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN9),"9");
//
//GUI_ID_DROPDOWN10
//
DROPDOWN_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN10),0,0xffffff);
DROPDOWN_SetAutoScroll(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN10),1);
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN10),"0");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN10),"1");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN10),"2");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN10),"3");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN10),"4");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN10),"5");
//
//GUI_ID_TEXT0
//
TEXT_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_TEXT0),0xe0e0e0);
//
//GUI_ID_DROPDOWN5
//
DROPDOWN_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN11),0,0xffffff);
DROPDOWN_SetAutoScroll(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN11),1);
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN11),"0");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN11),"1");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN11),"2");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN11),"3");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN11),"4");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN11),"5");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN11),"6");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN11),"7");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN11),"8");
DROPDOWN_AddString(WM_GetDialogItem(hWin,GUI_ID_DROPDOWN11),"9");
}
/*********************************************************************
*
* Dialog callback routine
*/
static void _cbCallback(WM_MESSAGE * pMsg)
{
int NCode, Id;
WM_HWIN hWin = pMsg->hWin;
switch (pMsg->MsgId)
{
case WM_PAINT:
PaintDialog(pMsg);
break;
case WM_INIT_DIALOG:
InitDialog(pMsg);
break;
case WM_KEY:
switch (((WM_KEY_INFO*)(pMsg->Data.p))->Key)
{
case GUI_KEY_ESCAPE:
GUI_EndDialog(hWin, 1);
break;
case GUI_KEY_ENTER:
GUI_EndDialog(hWin, 0);
break;
}
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch (Id)
{
case GUI_ID_OK:
if(NCode==WM_NOTIFICATION_RELEASED)
GUI_EndDialog(hWin, 0);
break;
case GUI_ID_CANCEL:
if(NCode==WM_NOTIFICATION_RELEASED)
GUI_EndDialog(hWin, 0);
break;
case GUI_ID_BUTTON1:
if(NCode==WM_NOTIFICATION_RELEASED)
GUI_EndDialog(hWin, 0);
break;
}
break;
default:
WM_DefaultProc(pMsg);
}
}
void GuiPage7(void)
{
GUI_ExecDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbCallback, 0, 0, 0);
}