本文整理汇总了C++中GUI_COUNTOF函数的典型用法代码示例。如果您正苦于以下问题:C++ GUI_COUNTOF函数的具体用法?C++ GUI_COUNTOF怎么用?C++ GUI_COUNTOF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GUI_COUNTOF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MainTask_2D_text_bmp
void MainTask_2D_text_bmp(void) {
int i;
horPos = ICONS_HOR_POS;
verPos = ICONS_VER_POS;
iconTouched = 0xFF;
SetemWinRunning(1);
GUI_SelectLayer(1); // select foregroung layer
GUI_SetBkColor(GUI_TRANSPARENT); // select background as transparent color
GUI_Clear(); // fill with the background color
// get the number of icons
iconNumber = GUI_COUNTOF(iconDrawFunctions);
// compute padding to fit to whole display
iconPadding = ((GUI_GetScreenSizeY() - (iconNumber * ICON_SIZE) - 2*ICONS_VER_POS) / iconNumber);
// start time measurement
timeMeasureStart();
// draw a background bitmap to the bottom LCD layer
GUI_SelectLayer(0); // select the background layer
// !! TO BE MODIFIED !!
GUI_DrawBitmap(&bmbackground, 0, 0);
GUI_SelectLayer(1); // set back the foregroung layer
// now draw our icons one by one
for (i = 0; i < iconNumber; i++)
{
iconDrawFunctions[i](horPos, verPos, ICON_SIZE);
verPos += ICON_SIZE + iconPadding;
}
// add a title text
GUI_SetTextMode(GUI_TM_TRANS);
GUI_SetFont(&GUI_FontTimesNewRoman31);
LCD_AA_SetAndMask(0xFFFFFFFF);
GUI_DispStringInRect("STM32 Player", &rect, GUI_TA_CENTER);
LCD_AA_SetAndMask(0x00FFFFFF);
// end measurement
time = timeMeasureEnd();
GUI_SetFont(&GUI_Font8_1);
sprintf (timeString, "time to render: %d,%dms", time/10, time%10);
GUI_DispStringAt(timeString, 10, 320 - 10);
// optionally we can use cursor
GUI_CURSOR_Show();
// the GUI is now rendered
// in never ending loop just check if an incon is touched
while(!tamperPushed)
{
GUI_TOUCH_GetState(&TouchState); // Get the touch position in pixel
if (TouchState.Pressed)
{
if (iconTouched == 0xFF) // no icon was touched previously
{
GUI_CURSOR_SetPosition(TouchState.x, TouchState.y); // move the cursor to current touch position
// check if the touch is in icons area
if (TouchState.x > ICONS_HOR_POS && TouchState.x < ICONS_HOR_POS + ICON_SIZE)
{
if(TouchState.y > ICONS_VER_POS && TouchState.y < ICONS_VER_POS + iconNumber*(ICON_SIZE + iconPadding))
{
// get he number of touched icon
iconTouched = (TouchState.y - ICONS_VER_POS) / (ICON_SIZE + iconPadding);
ReDrawIcon(GUI_RED, iconTouched); // draw again with hihghlight color
}
}
}
}
else
{
ReDrawIcon(GUI_WHITE, iconTouched);
iconTouched = 0xFF;
}
}
SetemWinRunning(0);
GUI_CURSOR_Hide();
}
示例2: _cbDialog
/**
* @brief Callback routine of the dialog
* @param pMsg: pointer to a data structure of type WM_MESSAGE
* @retval None
*/
static void _cbDialog(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
int Id, NCode;
RTC_TimeTypeDef RTC_TimeStructure;
RTC_DateTypeDef RTC_DateStructure;
uint8_t sec, min, hour, day, month;
uint16_t year;
uint8_t offset, max;
static uint8_t TempStr[50];
switch (pMsg->MsgId) {
case WM_PAINT:
break;
case WM_INIT_DIALOG:
RTC_GetTime(RTC_Format_BIN, &RTC_TimeStructure);
sec = RTC_TimeStructure.RTC_Seconds;
min = RTC_TimeStructure.RTC_Minutes;
hour = RTC_TimeStructure.RTC_Hours;
RTC_GetDate(RTC_Format_BIN, &RTC_DateStructure);
year = RTC_DateStructure.RTC_Year + 2000;
month = RTC_DateStructure.RTC_Month;
day = RTC_DateStructure.RTC_Date;
/* Initialization of 'System Information' */
hItem = pMsg->hWin;
FRAMEWIN_SetFont(hItem, GUI_FONT_13B_ASCII);
/* Initialization of 'Close' */
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_CLOSE_CLOCK);
BUTTON_SetFont(hItem, GUI_FONT_13B_ASCII);
/* Set date in text mode */
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_DATE);
TEXT_SetFont(hItem, GUI_FONT_13B_1);
TEXT_SetTextColor(hItem, 0x00804000);
WM_CreateWindowAsChild(80, 45, 354, 23, pMsg->hWin, WM_CF_SHOW | WM_CF_HASTRANS, _cbClockWindow , 0);
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_CLOCK);
TEXT_SetFont(hItem, &GUI_FontBauhaus9332);
TEXT_SetTextColor(hItem, 0x00804000);
/* Set Init values */
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_DATE);
/* Write date and clock */
sprintf((char *)TempStr, "%02d, %s, %04d",day , strMonth[month-1], year);
TEXT_SetText(hItem, (char *)TempStr);
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_CLOCK);
sprintf((char *)TempStr, "%02d:%02d:%02d",hour , min, sec);
TEXT_SetText(hItem, (char *)TempStr);
GetDateOffset (year, month, &offset , &max);
CALENDAR_SetDefaultSize(CALENDAR_SI_HEADER, 25 );
CALENDAR_SetDefaultSize(CALENDAR_SI_CELL_X, 30 );
CALENDAR_SetDefaultSize(CALENDAR_SI_CELL_Y, 20 );
CALENDAR_SetDefaultFont(CALENDAR_FI_CONTENT,GUI_FONT_16B_1 );
CALENDAR_SetDefaultFont(CALENDAR_FI_HEADER, GUI_FONT_16B_1) ;
CALENDAR_Create(pMsg->hWin, 15, 70, year, month, day, 2, ID_CALENDAR, WM_CF_SHOW);
WM_InvalidateWindow(pMsg->hWin);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc); /* Id of widget */
NCode = pMsg->Data.v; /* Notification code */
switch (NCode) {
case WM_NOTIFICATION_RELEASED: /* React only if released */
switch (Id) {
case ID_BUTTON_CLOSE_CLOCK:
GUI_EndDialog(pMsg->hWin, 0);
break;
case ID_BUTTON_SETTINGS_CLOCK:
GUI_CreateDialogBox(_aDialogSettingsCreate, GUI_COUNTOF(_aDialogSettingsCreate), &_cbDialogSettings, pMsg->hWin, 0, 0);
hNumPad = GUI_CreateDialogBox(_aDialogNumPad,
GUI_COUNTOF(_aDialogNumPad),
_cbDialogNumPad, WM_GetDesktopWindowEx(1), 0, 0); /* Create the numpad dialog */
WM_SetStayOnTop(hNumPad, 1);
break;
}
break;
case WM_NOTIFICATION_CHILD_DELETED:
WM_NotifyParent(WM_GetParent(pMsg->hWin), 0x500);
break;
//.........这里部分代码省略.........
示例3: Startup
/**
* @brief Benchmark window startup
* @param hWin: pointer to the parent handle.
* @param xpos: X position
* @param ypos: Y position
* @retval None
*/
static void Startup(WM_HWIN hWin, uint16_t xpos, uint16_t ypos)
{
GUI_CreateDialogBox(_aDialog, GUI_COUNTOF(_aDialog), _cbDialog, hWin, xpos, ypos);
}
示例4: _cbDialog
/**
* @brief Callback routine of the dialog
* @param pMsg: pointer to data structure of type WM_MESSAGE
* @retval None
*/
static void _cbDialog(WM_MESSAGE * pMsg)
{
WM_HWIN hItem;
GUI_RECT r;
int result;
int Id, NCode, Index;
char tmp[FILEMGR_FILE_NAME_SIZE];
switch (pMsg->MsgId)
{
case WM_INIT_DIALOG:
pImageList = (FILELIST_FileTypeDef *)k_malloc(sizeof(FILELIST_FileTypeDef));
pFileInfo = (CHOOSEFILE_INFO *)k_malloc(sizeof(CHOOSEFILE_INFO));
pImageList->ptr = 0;
file_pos = 0;
effects = 0;
ImSettings.d32 = k_BkupRestoreParameter(CALIBRATION_IMAGE_SETTINGS_BKP);
if(ImSettings.b.ss_timer == 0)
{
ImSettings.b.ss_timer = 1;
}
/* Image frame initialization */
IMAGE_Enlarge = 0;
hItem = WM_GetClientWindow(pMsg->hWin);
WM_GetClientRectEx(hItem, &r);
imFrame = WM_CreateWindowAsChild(r.x0 + 6, r.y0 + 6, r.x1 - 98, r.y1 - 78, hItem, WM_CF_SHOW, _cbImageWindow, 0);
/* Buttons initialization */
hItem = BUTTON_CreateEx(47, 155, 35, 35, pMsg->hWin, WM_CF_SHOW, 0, ID_PREVIOUS_BUTTON);
WM_SetCallback(hItem, _cbButton_previous);
hItem = BUTTON_CreateEx(94, 148, 50, 50, pMsg->hWin, WM_CF_SHOW, 0, ID_SLIDE_BUTTON);
WM_SetCallback(hItem, _cbButton_play);
slideshow_state = OFF;
hItem = BUTTON_CreateEx(154, 155, 35, 35, pMsg->hWin, WM_CF_SHOW, 0, ID_NEXT_BUTTON);
WM_SetCallback(hItem, _cbButton_next);
hItem = BUTTON_CreateEx(242, 145, 70, 30, pMsg->hWin, WM_CF_SHOW, 0, ID_ADD_BUTTON);
WM_SetCallback(hItem, _cbButton_add);
hItem = BUTTON_CreateEx(242, 175, 70, 30, pMsg->hWin, WM_CF_SHOW, 0, ID_OPEN_BUTTON);
WM_SetCallback(hItem, _cbButton_open);
hItem = BUTTON_CreateEx(196, 174, 30, 30, pMsg->hWin, WM_CF_SHOW, 0, ID_SETTINGS_BUTTON);
WM_SetCallback(hItem, _cbButton_settings);
hItem = BUTTON_CreateEx(10, 174, 30, 30, pMsg->hWin, WM_CF_SHOW, 0, ID_CLOSE_BUTTON);
WM_SetCallback(hItem, _cbButton_close);
hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_LIST);
LISTBOX_SetBkColor(hItem, LISTBOX_CI_SEL, GUI_BLUE);
LISTBOX_SetTextColor(hItem, LISTBOX_CI_SEL, GUI_WHITE);
LISTBOX_SetBkColor(hItem, LISTBOX_CI_UNSEL, GUI_BLACK);
LISTBOX_SetTextColor(hItem, LISTBOX_CI_UNSEL, GUI_CYAN);
LISTBOX_SetAutoScrollV(hItem, 1);
break;
case WM_TIMER:
playlist_select = 0;
break;
case WM_PAINT:
DrawRect3D(5, 140, 222, 67);
DrawRect3D(230, 140, 83, 67);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch (Id) {
/* Notification sent by "Button_Settings" */
case ID_SETTINGS_BUTTON:
switch (NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
GUI_CreateDialogBox(_aSettingsDialogCreate, GUI_COUNTOF(_aSettingsDialogCreate), _cbSettingsDialog, IMAGE_hWin, 0, 0);
break;
}
break;
/* Notifications sent by 'ListView' Slider */
case ID_IMAGE_LIST:
if(NCode == WM_NOTIFICATION_CLICKED)
//.........这里部分代码省略.........
示例5: _cbPlaylistDialog
/**
* @brief Callback routine of Info dialog
* @param pMsg: pointer to data structure of type WM_MESSAGE
* @retval None
*/
static void _cbPlaylistDialog(WM_MESSAGE * pMsg) {
int NCode;
int Id;
int r;
WM_HWIN hItem;
static char tmp[64];
uint32_t i = 0;
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_OKPL);
WM_SetCallback(hItem, _cbButton_okPL);
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_ADDPL);
WM_SetCallback(hItem, _cbButton_add2PL);
hItem = LISTVIEW_CreateEx(35, 30, 250, 155, pMsg->hWin, WM_CF_SHOW, 0, ID_VIDEO_LIST);
LISTVIEW_SetFont(hItem, &GUI_FontLubalGraph16);
LISTVIEW_SetTextColor(hItem, LISTVIEW_CI_UNSEL, GUI_STCOLOR_LIGHTBLUE);
LISTVIEW_SetTextColor(hItem, LISTVIEW_CI_SEL, GUI_WHITE);
LISTVIEW_SetHeaderHeight(hItem, 0);
LISTVIEW_AddColumn(hItem, 250, "", GUI_TA_VCENTER | GUI_TA_LEFT);
LISTVIEW_SetGridVis(hItem, 0);
LISTVIEW_SetAutoScrollV(hItem, 1);
WIDGET_SetEffect(hItem, &WIDGET_Effect_None);
LISTVIEW_SetTextAlign(hItem, 0, GUI_TA_HCENTER);
if(VideoList.ptr > 0)
{
for(i=0; i<VideoList.ptr; i++)
{
strcpy(FileInfo.pRoot, (char *)VideoList.file[i].name);
FILEMGR_GetFileOnly ((char *)tmp, (char *)FileInfo.pRoot);
LISTVIEW_AddRow(hItem, NULL);
LISTVIEW_SetItemText(hItem, 0, i, (char *)tmp);
}
sprintf(tmp, "PlayList [%d Item(s)]", VideoList.ptr);
FRAMEWIN_SetText(pMsg->hWin, tmp);
}
else
{
FRAMEWIN_SetText(pMsg->hWin, "PlayList [no Item]");
FileInfo.pfGetData = k_GetData;
FileInfo.pMask = acMask_video;
hItem = CHOOSEFILE_Create(WM_GetParent(pMsg->hWin), 100, 60, 240, 170, apDrives, GUI_COUNTOF(apDrives), 0, "Video files", 0, &FileInfo);
WM_MakeModal(hItem);
r = GUI_WaitForDialogExec(hItem);
if (r == 0)
{
if((strstr(FileInfo.pRoot, ".emf")) || (strstr(FileInfo.pRoot, ".EMF")))
{
if(VideoList.ptr < FILEMGR_LIST_DEPDTH)
{
strcpy((char *)VideoList.file[VideoList.ptr].name, FileInfo.pRoot);
FILEMGR_GetFileOnly ((char *)tmp, (char *)FileInfo.pRoot);
hItem = WM_GetDialogItem(pMsg->hWin, ID_VIDEO_LIST);
LISTVIEW_AddRow(hItem, NULL);
LISTVIEW_SetItemText(hItem, 0, VideoList.ptr, (char *)tmp);
VideoList.ptr++;
}
}
sprintf(tmp, "PlayList [%d Item(s)]", VideoList.ptr);
FRAMEWIN_SetText(pMsg->hWin, tmp);
}
WM_InvalidateWindow(pMsg->hWin);
}
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_BUTTON_OKPL: /* Notifications sent by 'OK' */
switch(NCode) {
case WM_NOTIFICATION_RELEASED:
GUI_EndDialog(pMsg->hWin, 0);
Video_FilePos = 0;
hPlaylistWin = 0;
break;
}
break;
case ID_BUTTON_ADDPL:
switch(NCode) {
case WM_NOTIFICATION_RELEASED:
FileInfo.pfGetData = k_GetData;
FileInfo.pMask = acMask_video;
hItem = CHOOSEFILE_Create(pMsg->hWin, 40, 20, 240, 170, apDrives, GUI_COUNTOF(apDrives), 0, "Video files", 0, &FileInfo);
WM_MakeModal(hItem);
//.........这里部分代码省略.........
示例6: Startup
/**
* @brief Camera window Startup
* @param hWin: pointer to the parent handle.
* @param xpos: X position
* @param ypos: Y position
* @retval None
*/
static void Startup(WM_HWIN hWin, uint16_t xpos, uint16_t ypos)
{
camera_disabled = 0;
CAMERA_hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, hWin, xpos, ypos);
}
示例7: _cbDialog
/**
* @brief Callback routine of dialog
* @param pMsg: pointer to data structure of type WM_MESSAGE
* @retval None
*/
static void _cbDialog(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
int Id, NCode;
TREEVIEW_ITEM_Handle hTreeView;
TREEVIEW_ITEM_INFO Info;
GUI_PID_STATE State;
switch (pMsg->MsgId)
{
case WM_INIT_DIALOG:
pFileList = (FILELIST_FileTypeDef *)k_malloc(sizeof(FILELIST_FileTypeDef));
pFileList->ptr = 0;
hPopUp = WM_CreateWindowAsChild(0,
26,
LCD_GetXSize(),
LCD_GetYSize()-26,
pMsg->hWin,
WM_CF_SHOW | WM_CF_HASTRANS ,
_cbPopup,
0);
WM_BringToBottom(hPopUp);
hItem = pMsg->hWin;
FRAMEWIN_AddCloseButton(hItem, FRAMEWIN_BUTTON_RIGHT, 0);
WM_CreateWindowAsChild(240, 320, 1, 1, pMsg->hWin, WM_CF_SHOW | WM_CF_HASTRANS, _cbMediaConnection , 0);
_RefreshBrowser(pMsg->hWin);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc); /* Id of widget */
NCode = pMsg->Data.v; /* Notification code */
switch (NCode) {
case WM_NOTIFICATION_CHILD_DELETED:
k_free(pFileList);
if(hFileInfo != 0)
{
hFileInfo = 0;
}
break;
case WM_NOTIFICATION_CLICKED: /* React only if released */
switch (Id) {
case ID_TREEVIEW:
hTreeView = TREEVIEW_GetSel(pMsg->hWinSrc);
TREEVIEW_ITEM_GetInfo(hTreeView, &Info);
if(Info.IsNode == 0)
{
GUI_TOUCH_GetState(&State);
State.x += 20;
if(State.x > 175)
{
State.x = 175;
}
State.y-= 50;
if(State.y > 150)
{
State.y -= 70;
}
_FindFullPath(pMsg->hWinSrc, hTreeView, SelectedFileName);
/* Create popup menu after touching the display */
_OpenPopup(hPopUp,
_aMenuItems,
GUI_COUNTOF(_aMenuItems),
State.x,
State.y);
}
break;
case ID_BUTTON_REFRESH:
_RefreshBrowser (pMsg->hWin);
break;
}
break;
}
break;
//.........这里部分代码省略.........
示例8: GUIDEMO_Config
/*********************************************************************
*
* GUIDEMO_Config
*/
void GUIDEMO_Config(GUIDEMO_CONFIG * pConfig) {
pConfig->apFunc = _apfTest;
pConfig->NumDemos = GUI_COUNTOF(_apfTest);
pConfig->Flags = GUIDEMO_CF_SHOW_SPRITES | GUIDEMO_CF_USE_AUTO_BK;
}
示例9: num_dialog
int num_dialog(WM_HWIN hWin)
{
int set_num;
set_num = GUI_ExecDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbCallback, hWin, 320, 80);// GUI_ExecDialogBox
return set_num;
}
示例10: _TaskerAddPage2
WM_HWIN _TaskerAddPage2(WM_HWIN hWin)
{
hParent = hWin;
return GUI_CreateDialogBox(_aDialogCreate2, GUI_COUNTOF(_aDialogCreate2), _cbDialog, WM_UNATTACHED, 0, 0);
}
示例11: _cbDialog_VNC
//.........这里部分代码省略.........
VNCSettings.ipaddr.b.addr2 = 0;
VNCSettings.ipaddr.b.addr3 = 0;
VNCSettings.maskaddr.b.addr0 = 0;
VNCSettings.maskaddr.b.addr1 = 0;
VNCSettings.maskaddr.b.addr2 = 0;
VNCSettings.maskaddr.b.addr3 = 0;
VNCSettings.gwaddr.b.addr0 = 0;
VNCSettings.gwaddr.b.addr1 = 0;
VNCSettings.gwaddr.b.addr2 = 0;
VNCSettings.gwaddr.b.addr3 = 0;
/* Save VNC settings */
_VNCServer_SaveSettings();
}
else
{
_VNCApp_GetIPAddress(IP_ADDRESS, VNCSettings.ipaddr.b.addr3, VNCSettings.ipaddr.b.addr2, VNCSettings.ipaddr.b.addr1, VNCSettings.ipaddr.b.addr0);
_VNCApp_GetIPAddress(SUBNET_MASK, VNCSettings.maskaddr.b.addr3, VNCSettings.maskaddr.b.addr2, VNCSettings.maskaddr.b.addr1, VNCSettings.maskaddr.b.addr0);
_VNCApp_GetIPAddress(GW_ADDRESS, VNCSettings.gwaddr.b.addr3, VNCSettings.gwaddr.b.addr2, VNCSettings.gwaddr.b.addr1, VNCSettings.gwaddr.b.addr0);
}
if (VNCSettings.dhcp_use.b.dhcp == 0)
{
_VNCServer_DisplayIPAddress();
}
break;
case WM_PAINT:
DrawRect3D(230, 5, 87, 120);
DrawRect3D(2, 130, 225, 80);
DrawRect3D(230, 130, 87, 80);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc); /* Id of widget */
NCode = pMsg->Data.v; /* Notification code */
switch (NCode)
{
case WM_NOTIFICATION_RELEASED: /* React only if released */
switch (Id)
{
case ID_BUTTON_SETTINGS: /* Settings */
if(hWinVNC_Settings == 0)
{
hWinVNC_Settings = GUI_CreateDialogBox(_aDialog_VNC_SETTINGS, GUI_COUNTOF(_aDialog_VNC_SETTINGS), _cbDialog_VNC_SETTINGS, hWinVNC, 0, 10);
hNumPad = GUI_CreateDialogBox(_aDialogNumPad,
GUI_COUNTOF(_aDialogNumPad),
_cbDialogNumPad, pMsg->hWin, 0, 0);
}
break;
case ID_BUTTON_START: /* Start */
if(hWinVNC_Settings == 0)
{
if (start_button == VNC_START)
{
/* change start button to hide */
start_button = VNC_HIDE;
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_START);
BUTTON_SetText(hItem, (const char*) "Hide");
/* Cange connection png pic from disconnected to connecting */
hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_STATE);
IMAGE_SetBitmap(hItem, &bmhourglass32);
hItem = WM_GetDialogItem(pMsg->hWin, ID_MULTIEDIT_VNC);
MULTIEDIT_AddText(hItem, (const char *) "TCP/IP stack initialization ... \n\r");
TCPIP_Initialized = 1;
/* Initilaize the LwIP stack */
NetworkInit(VNCSettings.dhcp_use.b.dhcp);
}
else /* start_button == VNC_HIDE */
{
if(hWinVNC_Settings == 0)
{
WM_HideWindow(pMsg->hWin);
}
}
}
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
示例12: GUI_COUNTOF
"December"};
/* Array of menu items */
static MENU_ITEM _aMenuItems[] =
{
{"Kernel Log" , ID_MENU_LOG, 0},
{"Process Viewer" , ID_MENU_PMGR, 0},
{"CPU Usage", ID_MENU_PERF, 0},
{0 , 0 , MENU_IF_SEPARATOR},
{"Cancel" , ID_MENU_EXIT, 0},
};
/* Sprite array */
static SPRITE _aSprite[] =
{
{ 640, 150, -8, -2, GUI_COUNTOF(apbmbutterfly), apbmbutterfly},
};
/* Dialog Create */
static const GUI_WIDGET_CREATE_INFO _aPerformanceDialogCreate[] = {
{ FRAMEWIN_CreateIndirect, "CPU Usage", ID_FRAMEWIN_PERFORMANCE, 100, 100, 405, 240, 0, 0x0, 0 },
{ GRAPH_CreateIndirect, "", ID_GRAPH_CPU, 6, 9, 380, 190, 0, 0x0, 0 },
{ BUTTON_CreateIndirect, "Hide", ID_BUTTON_HIDE, 166, 200, 80, 30, 0, 0x0, 0 },
};
static const GUI_WIDGET_CREATE_INFO _aKernelLogDialogCreate[] = {
{ FRAMEWIN_CreateIndirect, "Kernel Log", ID_FRAMEWIN_KERNELLOG, 100, 100, 405, 240, 0, 0x0, 0 },
{ BUTTON_CreateIndirect, "Cancel", ID_BUTTON_CANCEL_KERNELLOG, 166, 200, 80, 30, 0, 0x0, 0 },
{ MULTIEDIT_CreateIndirect, "Multiedit", ID_MULTIEDIT_KERNELLOG, 6, 9, 380, 190, 0, 0x0, 0 },
};
示例13: Create_wSaveDlg
WM_HWIN Create_wSaveDlg(void) {
WM_HWIN hWin;
hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbDialog, WM_HBKWIN, 0, 0);
return hWin;
}
示例14: MULTIPAGE_SetDefaultTextColor
/*********************************************************************
*
* MULTIPAGE_SetDefaultTextColor
*/
void MULTIPAGE_SetDefaultTextColor(GUI_COLOR Color, unsigned Index) {
if (Index < GUI_COUNTOF(MULTIPAGE__DefaultTextColor)) {
MULTIPAGE__DefaultTextColor[Index] = Color;
}
}
示例15: _cbSettingsDialog
/**
* @brief Callback function of the Settings frame
* @param pMsg: pointer to data structure of type WM_MESSAGE
* @retval None
*/
static void _cbSettingsDialog(WM_MESSAGE * pMsg)
{
int Id, NCode;
WM_HWIN hItem;
switch (pMsg->MsgId)
{
case WM_INIT_DIALOG:
/* Settings frame initialization */
hItem = pMsg->hWin;
FRAMEWIN_AddCloseButton(hItem, FRAMEWIN_BUTTON_RIGHT, 0);
/* Create and attache the MULTIPAGE dialog windows */
hItem = WM_GetDialogItem(pMsg->hWin, ID_MULTIPAGE);
hDialogCameraSettings = GUI_CreateDialogBox(_aDialogCameraSettings,
GUI_COUNTOF(_aDialogCameraSettings),
&_cbCameraSettings, WM_UNATTACHED, 0, 0);
MULTIPAGE_AddPage(hItem, hDialogCameraSettings, "Camera Settings");
hDialogFileControl = GUI_CreateDialogBox(_aDialogFileControl,
GUI_COUNTOF(_aDialogFileControl),
&_cbFileControl, WM_UNATTACHED, 0, 0);
MULTIPAGE_AddPage(hItem, hDialogFileControl, "File Settings");
MULTIPAGE_SelectPage(hItem, 0);
/* 'OK' button initialization */
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_OK);
BUTTON_SetFont(hItem, GUI_FONT_13B_1);
/* 'Cancel' button initialization */
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_CANCEL);
BUTTON_SetFont(hItem, GUI_FONT_13B_1);
break;
case WM_DELETE:
camera_disabled = 0;
hSettings = 0;
if(SD_Configured == 1)
{
BSP_CAMERA_Init(RESOLUTION_R160x120);
CAMERA_Configured = 1;
/* Apply new settings*/
SD_Configured = 0;
}
/* Delete choosfile window */
WM_DeleteWindow(chooser_select_folder);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch (Id)
{
case ID_BUTTON_OK: /* Notification sent by "OK" button */
switch (NCode)
{
case WM_NOTIFICATION_RELEASED:
/* Save camera settings before delete settings frame */
hItem = WM_GetDialogItem(hDialogCameraSettings, ID_SLIDER_0);
CameraSettings.b.brightness = SLIDER_GetValue(hItem);
hItem = WM_GetDialogItem(hDialogCameraSettings, ID_SLIDER_1);
CameraSettings.b.contrast = SLIDER_GetValue(hItem);
/* Back to normal mode (no effects) */
hItem = WM_GetDialogItem(CAMERA_hWin, ID_RADIO);
RADIO_SetValue(hItem, 0);
if(CAMERA_GetState() != CAMERA_ERROR)
{
/* Apply new settings*/
CAMERA_Set_ContrastBrightness(CameraSettings.b.contrast, CameraSettings.b.brightness);
BSP_CAMERA_BlackWhiteConfig(CAMERA_BLACK_WHITE_NORMAL);
}
GUI_EndDialog(pMsg->hWin, 0);
break;
}
break;
case ID_BUTTON_CANCEL: /* Notification sent by "Cancel" button */
switch (NCode)
{
case WM_NOTIFICATION_RELEASED:
GUI_EndDialog(pMsg->hWin, 0);
break;
}
break;
}
//.........这里部分代码省略.........