本文整理汇总了C++中WM_GetId函数的典型用法代码示例。如果您正苦于以下问题:C++ WM_GetId函数的具体用法?C++ WM_GetId怎么用?C++ WM_GetId使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了WM_GetId函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _cbBkWin
/*********************************************************************
*
* _cbBkWin
*/
static void _cbBkWin(WM_MESSAGE * pMsg) {
const WM_KEY_INFO * pKeyInfo;
int NCode;
int Id;
switch (pMsg->MsgId) {
case WM_KEY:
pKeyInfo = (const WM_KEY_INFO*)pMsg->Data.p;
if (pKeyInfo->PressedCnt > 0) {
switch (pKeyInfo->Key) {
case GUI_KEY_TAB:
WM_SetFocusOnNextChild(pMsg->hWin);
break;
case GUI_KEY_BACKTAB:
WM_SetFocusOnPrevChild(pMsg->hWin);
break;
case GUI_KEY_ESCAPE:
_Break = 1;
break;
}
}
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 GUI_ID_BUTTON0:
_AppSelection = APP_DASHBOARD;
break;
case GUI_ID_BUTTON1:
_AppSelection = APP_CASHTERMINAL;
break;
}
break;
}
break;
case WM_PAINT:
GUI_DrawGradientV(0, 0, 639, 479, GUI_BLUE, GUI_BLACK);
GUI_SetFont(&GUI_FontAA2_32);
GUI_SetTextMode(GUI_TM_TRANS);
GUI_SetColor(GUI_WHITE);
GUI_DispStringHCenterAt("emWin VGA Demonstration\n", 400, 44);
GUI_SetFont(&GUI_FontAA2_21);
GUI_DispStringHCenterAt("Press the 'Dashboard' or the 'Cash Terminal'\nbutton to start one of the applications\n", 320, 150);
GUI_DrawBitmap(&bmSeggerLogo, 30, 30);
break;
}
}
示例2: _cbCallback
/*********************************************************************
*
* _cbCallback
*/
static void _cbCallback(WM_MESSAGE * pMsg) {
int i;
int NCode, Id;
WM_HWIN hDlg, hItem;
hDlg = pMsg->hWin;
switch (pMsg->MsgId) {
case WM_PAINT:
_OnPaint();
return;
case WM_INIT_DIALOG:
for (i = 0; i < 3; i++) {
hItem = WM_GetDialogItem(hDlg, GUI_ID_SLIDER0 + i);
SLIDER_SetRange(hItem, 0, 255);
SLIDER_SetValue(hItem, _aColorSep[i]);
/* Init EDIT-widgets */
hItem = WM_GetDialogItem(hDlg, GUI_ID_EDIT0 + i);
EDIT_SetDecMode(hItem, _aColorSep[i], 0, 255, 0, 0);
}
break;
case WM_KEY:
switch (((WM_KEY_INFO*)(pMsg->Data.p))->Key) {
case GUI_KEY_ESCAPE:
;
break;
case GUI_KEY_ENTER:
GUI_EndDialog(hDlg, 0);
break;
}
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 */
if (Id == GUI_ID_OK) { /* OK Button */
GUI_EndDialog(hDlg, 0);
}
if (Id == GUI_ID_CANCEL) { /* Cancel Button */
GUI_EndDialog(hDlg, 1);
}
break;
case WM_NOTIFICATION_VALUE_CHANGED: /* Value has changed */
_OnValueChanged(hDlg, Id);
break;
}
break;
default:
WM_DefaultProc(pMsg);
}
}
示例3: _cbDialogMain
/*********************************************************************
*
* _cbDialogMain
*
* Function description
* Callback routine of DialogMain
*/
static void _cbDialogMain(WM_MESSAGE * pMsg) {
WM_HWIN hDlg;
WM_HWIN hItem;
int Id;
hDlg = pMsg->hWin;
switch (pMsg->MsgId) {
case WM_PAINT:
break;
case WM_INIT_DIALOG:
//
// Init progress bars
//
hItem = WM_GetDialogItem(hDlg, GUI_ID_PROGBAR0);
WIDGET_SetEffect(hItem, &WIDGET_Effect_3D);
_SetProgbarValue(GUI_ID_PROGBAR0, _aTemp1[GUI_COUNTOF(_aTemp1) - 1]);
hItem = WM_GetDialogItem(hDlg, GUI_ID_PROGBAR1);
WIDGET_SetEffect(hItem, &WIDGET_Effect_3D);
_SetProgbarValue(GUI_ID_PROGBAR1, _aTemp2[GUI_COUNTOF(_aTemp2) - 1]);
//
// Init edit widgets
//
hItem = WM_GetDialogItem(hDlg, GUI_ID_EDIT0);
EDIT_SetDecMode(hItem, _TempMin, 0, 999, 0, 0);
WM_DisableWindow(hItem);
hItem = WM_GetDialogItem(hDlg, GUI_ID_EDIT1);
EDIT_SetDecMode(hItem, _TempMax, 0, 999, 0, 0);
WM_DisableWindow(hItem);
//
// Init temperature window *
//
hItem = WM_GetClientWindow(WM_GetDialogItem(hDlg, ID_TEMPERATURE));
_pcbCallbackTemperature = WM_SetCallback(hItem, _cbTemperature);
_UpdateTextColors(hDlg);
break;
case WM_NOTIFY_PARENT:
if (pMsg->Data.v == WM_NOTIFICATION_RELEASED) {
Id = WM_GetId(pMsg->hWinSrc); // Id of widget
switch (Id) {
case GUI_ID_BUTTON0:
WM_SetFocus(_hDialogColor);
GUI_SetOrg(0, 240);
break;
}
}
break;
default:
WM_DefaultProc(pMsg);
}
}
示例4: _cbKernelLogDialog
/**
* @brief Callback function of the kernel log dialog
* @param pMsg: pointer to data structure of type WM_MESSAGE
* @retval None
*/
static void _cbKernelLogDialog(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
int NCode;
int Id;
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
hItem = pMsg->hWin;
FRAMEWIN_SetTitleVis(hItem, 0);
hItem = WM_GetDialogItem(pMsg->hWin, ID_MULTIEDIT_KERNELLOG);
MULTIEDIT_SetFont(hItem, GUI_FONT_8_1);
MULTIEDIT_SetTextColor(hItem, MULTIEDIT_CI_READONLY, GUI_GREEN);
MULTIEDIT_SetBkColor(hItem, MULTIEDIT_CI_READONLY, GUI_BLACK);
MULTIEDIT_SetReadOnly(hItem, 1);
MULTIEDIT_SetText(hItem, (char *)pLOG_CacheBuffer);
MULTIEDIT_SetCursorOffset(hItem, LOG_IN_ptr);
MULTIEDIT_SetAutoScrollV(hItem, 1);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_BUTTON_CANCEL_KERNELLOG: /* Notifications sent by 'Cancel' button */
switch(NCode) {
case WM_NOTIFICATION_RELEASED:
GUI_EndDialog(pMsg->hWin, 0);
hLog = 0;
break;
}
break;
case ID_MULTIEDIT_KERNELLOG: /* Notifications sent by 'Multiedit' */
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
break;
case WM_NOTIFICATION_VALUE_CHANGED:
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
示例5: WM__GetDialogItem
/*******************************************************************
*
* WM_DialogItem
Recursively scan window and its child windows until dialog item is
found or all children have been scanned.
*/
WM_HWIN WM__GetDialogItem(WM_HWIN hWin, int Id) {
WM_HWIN hi;
WM_HWIN r =0;
WM_Obj* pWin = WM_H2P(hWin);
hi = pWin->hFirstChild;
while (hi) {
/* This windows Id matching ? */
if (WM_GetId(hi) == Id)
return hi;
/* Any child windows Id matching ? */
if ((r = WM__GetDialogItem(hi, Id)) != 0)
break;
hi = WM_HANDLE2PTR(hi)->hNext;
}
return r;
}
示例6: _cbMessageBox
/**
* @brief callback for Message Box
* @param pMsg : pointer to data structure
* @retval None
*/
static void _cbMessageBox(WM_MESSAGE* pMsg) {
WM_HWIN hWin;
int Id;
hWin = pMsg->hWin;
switch (pMsg->MsgId) {
case WM_NOTIFY_PARENT:
if (pMsg->Data.v == WM_NOTIFICATION_RELEASED) {
Id = WM_GetId(pMsg->hWinSrc);
GUI_EndDialog(hWin, (Id == GUI_ID_OK) ? 1 : 0);
}
break;
default:
WM_DefaultProc(pMsg);
}
}
示例7: _cbDialog
void _cbDialog(WM_MESSAGE * pMsg)
{
WM_HWIN hItem;
int NCode;
int Id;
switch (pMsg->MsgId) {
case WM_TIMER:
hItem = WM_GetDialogItem(pMsg->hWin, ID_LISTVIEW_0);
// _DispThread(hItem);
WM_RestartTimer(pMsg->Data.v, 200);
break;
case WM_INIT_DIALOG:
WM_CreateTimer(WM_GetClientWindow(pMsg->hWin), 0, 100, 0);
hItem = WM_GetDialogItem(pMsg->hWin, ID_LISTVIEW_0);
LISTVIEW_AddColumn(hItem, 60, "Thread", GUI_TA_HCENTER | GUI_TA_VCENTER);
LISTVIEW_AddColumn(hItem, 40, "Priority", GUI_TA_HCENTER | GUI_TA_VCENTER);
LISTVIEW_AddColumn(hItem, 40, "Stack", GUI_TA_HCENTER | GUI_TA_VCENTER);
LISTVIEW_AddColumn(hItem, 50, "Status", GUI_TA_HCENTER | GUI_TA_VCENTER);
LISTVIEW_SetGridVis(hItem, 1);
_DispThread(hItem);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id)
{
case GUI_ID_BUTTON0: // Notifications sent by 'Button'
switch(NCode)
{
case WM_NOTIFICATION_RELEASED:
GUI_EndDialog(pMsg->hWin, 0);
GUI_EndDialog(hParent, 0);
break;
}
break;
}
default:
WM_DefaultProc(pMsg);
break;
}
}
示例8: _cbClock
static void _cbClock(WM_MESSAGE *pMsg)
{
int NCode, Id;
//PARAM pParam;
switch (pMsg->MsgId)
{
case WM_PAINT:
GUI_SetBkColor(GUI_WHITE);
GUI_Clear();
GUI_SetColor(GUI_BLACK);
_ShowButton(pMsg->hWin);
GUI_DrawBitmap(&bmwatch, 37, 0);
//GUI_AA_FillPolygon(pParam.aPoint1, GUI_COUNTOF(_aNeedle[0]), MAG * LCD_GetXSize() / 2, MAG * (LCD_GetYSize() / 2));
// GUI_AA_FillPolygon(pParam.aPoint2, GUI_COUNTOF(_aNeedle[1]), MAG * LCD_GetXSize() / 2, MAG * (LCD_GetYSize() / 2));
//GUI_AA_FillPolygon(pParam.aPoint3, GUI_COUNTOF(_aNeedle[2]), MAG * LCD_GetXSize() / 2, MAG * (LCD_GetYSize() / 2));
GUI_FillCircle(160, 120, 3);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc); /* Id of widget */
NCode = pMsg->Data.v; /* Notification code */
switch (NCode)
{
case WM_NOTIFICATION_CLICKED:
switch (Id)
{
case BUTTON_ID_EXIT:
GUI_SetAppIndex(APP_MainMenu);
GUI_SetAppDirection(MEMDEV_ANIMATION_LEFT);
_MoveShiftWindow(&pMsg->hWin, MEMDEV_ANIMATION_RIGHT, 1, 1);
GUI_SetCancel(APP_Clock);
GUI_ClearHalt();
break;
default:
break;
}
}
break;
default:
WM_DefaultProc(pMsg);
}
}
示例9: _cbCallback
/*
*********************************************************************************************************
* 函 数 名: _cbCallback
* 功能说明: 对话框回调函数
* 形 参: pMsg 回调参数
* 返 回 值: 无
*********************************************************************************************************
*/
static void _cbCallback(WM_MESSAGE * pMsg)
{
int i;
int NCode, Id;
WM_HWIN hDlg, hItem;
hDlg = pMsg->hWin;
switch (pMsg->MsgId)
{
case WM_INIT_DIALOG:
hItem = WM_GetDialogItem(hDlg, GUI_ID_RADIO0);
for (i = 0; i < GUI_COUNTOF(_apLabel); i++)
{
RADIO_SetText(hItem, _apLabel[i], i);
}
_SetFont(hDlg);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch (NCode)
{
case WM_NOTIFICATION_VALUE_CHANGED:
_SetFont(hDlg);
break;
/* 两个按钮的消息处理 */
case WM_NOTIFICATION_RELEASED:
if (Id == GUI_ID_OK)
{
GUI_EndDialog(hDlg, 0);
}
if (Id == GUI_ID_CANCEL)
{
GUI_EndDialog(hDlg, 1);
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
}
}
示例10: _cbCallback
/*********************************************************************
*
* _cbCallback
*/
static void _cbCallback(WM_MESSAGE * pMsg) {
WM_HWIN hDlg;
WM_HWIN hWinSrc;
int Id;
int NCode;
hWinSrc = pMsg->hWinSrc;
hDlg = pMsg->hWin;
switch (pMsg->MsgId) {
case WM_PAINT:
GUI_SetColor(GUI_BLACK);
GUI_DrawBitmap(&bmLogoBitmap, 30, 80);
GUI_SetFont(&GUI_Font24B_ASCII);
GUI_SetFont(&GUI_Font16B_ASCII);
GUI_DispStringHCenterAt("www.segger.com", 30 + bmLogoBitmap.XSize / 2, 80 + bmLogoBitmap.YSize);
GUI_DispStringHCenterAt("Virtual screen sample", 160, 20);
break;
case WM_INIT_DIALOG:
FRAMEWIN_SetFont(hDlg, &GUI_Font24B_ASCII);
FRAMEWIN_SetTextAlign(hDlg, GUI_TA_HCENTER);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(hWinSrc); /* Id of widget */
NCode = pMsg->Data.v; /* Notification code */
switch (NCode) {
case WM_NOTIFICATION_RELEASED:
switch (Id) {
case ID_BUTTON_SETUP:
ExecSetup();
break;
case ID_BUTTON_CALIBRATION:
ExecCalibration();
break;
case ID_BUTTON_ABOUT:
ExecAbout();
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
}
}
示例11: myButton
static void myButton (WM_MESSAGE *pMsg)
{
int index = 0;
const WM_KEY_INFO* pInfo;
switch(pMsg->MsgId)
{
case WM_SET_FOCUS:
index = WM_GetId(pMsg->hWin) - GUI_ID_BUTTON0;
if(pMsg->Data.v == 0)
{
BUTTON_SetBkColor(buttons[index], BUTTON_CI_UNPRESSED, pColors->btBkColor);
//TEXT_SetBkColor(Texts[index], pSkin->MntSetWin_bkNOFOCUS);
}
else
{
BUTTON_SetBkColor(buttons[index], BUTTON_CI_UNPRESSED, pColors->btFocusBkColor);
//TEXT_SetBkColor(Texts[index], GUI_DARKMAGENTA);
}
BUTTON_Callback(pMsg);
break;
case WM_KEY:
pInfo = (WM_KEY_INFO*)pMsg->Data.p;
switch(pInfo->Key)
{
case GUI_KEY_ENTER:
case GUI_KEY_LEFT:
case GUI_KEY_RIGHT:
BUTTON_Callback(pMsg);
break;
default:
break;
}
break;
default:
BUTTON_Callback(pMsg);
break;
}
}
示例12: _cbFileInfoDialog
/**
* @brief Callback routine of Info dialog
* @param pMsg: pointer to data structure of type WM_MESSAGE
* @retval None
*/
static void _cbFileInfoDialog(WM_MESSAGE * pMsg) {
int NCode;
int Id;
WM_HWIN hItem;
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_OK_MESSAGE);
WM_SetCallback(hItem, _cbButton_okMessage);
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_FILENAME);
TEXT_SetFont(hItem, &GUI_FontAvantGarde32);
hItem = WM_GetDialogItem(pMsg->hWin, (ID_TEXT_FILENAME+2));
TEXT_SetFont(hItem, &GUI_FontAvantGarde32);
break;
case WM_PAINT:
GUI_DrawBitmap(&bmwarning, 260, 60);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_BUTTON_OK_MESSAGE: /* Notifications sent by 'OK' */
switch(NCode) {
case WM_NOTIFICATION_RELEASED:
GUI_EndDialog(pMsg->hWin, 0);
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
示例13: _cbFileControl
/**
* @brief Callback function of the File Control page
* @param pMsg: pointer to data structure of type WM_MESSAGE
* @retval None
*/
static void _cbFileControl(WM_MESSAGE * pMsg)
{
WM_HWIN hItem;
int NCode;
int Id;
switch (pMsg->MsgId)
{
case WM_INIT_DIALOG:
/* Initialization of 'Brightness' */
hItem = WM_GetDialogItem(pMsg->hWin, ID_FOLDER_CAPTION);
TEXT_SetFont(hItem, GUI_FONT_13B_1);
hItem = WM_GetDialogItem(pMsg->hWin, ID_FOLDER);
EDIT_SetText(hItem, (char *)capture_folder);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id)
{
case ID_BROWSE: /* Notifications sent by 'Radio' */
switch(NCode)
{
case WM_NOTIFICATION_RELEASED:
pFileInfo->pfGetData = k_GetData;
pFileInfo->pMask = acMask_folder;
chooser_select_folder = CHOOSEFILE_Create(CAMERA_hWin, 67, 20, 385, 215, apDrives, GUI_COUNTOF(apDrives), 0, "Select a folder", 0, pFileInfo);
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
示例14: _cbBk
/**
* @brief Callback routine of desktop window
* @param pMsg: pointer to a data structure of type WM_MESSAGE
* @retval None
*/
static void _cbBk(WM_MESSAGE* pMsg) {
uint32_t NCode, Id, sel;
static uint32_t module_mutex = 0;
switch (pMsg->MsgId) {
case WM_PAINT:
GUI_SetBkColor(GUI_TRANSPARENT);
GUI_Clear();
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch (NCode) {
case WM_NOTIFICATION_CLICKED:
if ('0' == Id) {
sel = ICONVIEW_GetSel(pMsg->hWinSrc);
if (sel < GUI_COUNTOF(_aBitmapItem)) {
if (0 == module_mutex) {
module_mutex = 1;
_apModules[sel](pMsg->hWinSrc);
current_module = sel;
}
}
}
break;
case 0x500:
module_mutex = 0;
current_module = 0xFF;
ICONVIEW_SetSel(pMsg->hWinSrc, -1);
break;
default:
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
示例15: _cbDialogIntro
/*********************************************************************
*
* _cbDialogIntro
*
* Function description
* Callback routine of DialogIntro
*/
static void _cbDialogIntro(WM_MESSAGE * pMsg) {
GUI_RECT Rect;
WM_HWIN hDlg;
int Id;
unsigned i;
int ySizeText;
int yPos;
yPos = 40;
hDlg = pMsg->hWin;
switch (pMsg->MsgId) {
case WM_PAINT:
WM_GetClientRect(&Rect);
GUI_SetBkColor(GUI_WHITE);
GUI_SetColor(GUI_BLACK);
GUI_Clear();
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("Virtual screens", 160, 5);
GUI_SetFont(&GUI_Font13B_ASCII);
GUI_DrawBitmap(&_bmLogoBitmap, (Rect.x1 - _bmLogoBitmap.XSize) / 2, yPos);
ySizeText = GUI_GetFontSizeY();
yPos += _bmLogoBitmap.YSize + 15;
for (i = 0; i < GUI_COUNTOF(_apDialogIntro); i++) {
GUI_DispStringHCenterAt(_apDialogIntro[i], Rect.x1 / 2, yPos);
yPos += ySizeText;
}
break;
case WM_NOTIFY_PARENT:
if (pMsg->Data.v == WM_NOTIFICATION_RELEASED) {
Id = WM_GetId(pMsg->hWinSrc); // Id of widget
if (Id == GUI_ID_BUTTON0) {
GUI_EndDialog(hDlg, 0);
}
}
break;
default:
WM_DefaultProc(pMsg);
}
}