本文整理汇总了C++中WM_GetClientWindow函数的典型用法代码示例。如果您正苦于以下问题:C++ WM_GetClientWindow函数的具体用法?C++ WM_GetClientWindow怎么用?C++ WM_GetClientWindow使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了WM_GetClientWindow函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _ToggleFullScreenMode
/*********************************************************************
*
* _ToggleFullScreenMode
*
* Purpose:
* This routine switches between full screen mode and normal mode by hiding or showing the
* widgets of the dialog, enlarging/shrinking the graph widget and modifying some other
* attributes of the dialog widgets.
*/
static void _ToggleFullScreenMode(WM_HWIN hDlg) {
static int FullScreenMode;
static GUI_RECT Rect;
static unsigned ScalePos;
WM_HWIN hGraph, hButton;
hGraph = WM_GetDialogItem(hDlg, GUI_ID_GRAPH0);
hButton = WM_GetDialogItem(hDlg, GUI_ID_BUTTON0);
FullScreenMode ^= 1;
if (FullScreenMode) {
/* Enter the full screen mode */
WM_HWIN hClient;
GUI_RECT RectInside;
hClient = WM_GetClientWindow(hDlg);
BUTTON_SetText(hButton, "Back");
WM_MoveWindow(hButton, 0, 11);
FRAMEWIN_SetTitleVis(hDlg, 0);
WM_GetInsideRectEx(hClient, &RectInside);
WM_GetWindowRectEx(hGraph, &Rect);
WM_ForEachDesc(hClient, _ForEach, &FullScreenMode); /* Hide all descendants */
WM_SetWindowPos(hGraph, WM_GetWindowOrgX(hClient), WM_GetWindowOrgX(hClient), RectInside.x1, RectInside.y1);
ScalePos = GRAPH_SCALE_SetPos(_hScaleH, RectInside.y1 - 105);
} else {
/* Return to normal mode */
BUTTON_SetText(hButton, "Full Screen");
WM_MoveWindow(hButton, 0, -11);
WM_ForEachDesc(WM_GetClientWindow(hDlg), _ForEach, &FullScreenMode); /* Show all descendants */
WM_SetWindowPos(hGraph, Rect.x0, Rect.y0, Rect.x1 - Rect.x0 + 1, Rect.y1 - Rect.y0 + 1);
FRAMEWIN_SetTitleVis(hDlg, 1);
GRAPH_SCALE_SetPos(_hScaleH, ScalePos);
}
}
示例2: _ShowDemo
/*********************************************************************
*
* _ShowDemo
*/
static void _ShowDemo(void) {
WM_HWIN hWin0;
WM_HWIN hWin1;
WM_HWIN hWin2;
WM_HWIN hFrame1;
WM_HWIN hFrame2;
WM_HWIN hClient1;
WM_HWIN hClient2;
WM_SetCallback(WM_HBKWIN, _cbBkWin);
hFrame1 = FRAMEWIN_CreateEx( 10, 30, 140, 140, 0, WM_CF_SHOW, FRAMEWIN_CF_MOVEABLE, 0, "Early Clipping", _cbFrameWin1);
hFrame2 = FRAMEWIN_CreateEx(170, 30, 140, 140, 0, WM_CF_SHOW, FRAMEWIN_CF_MOVEABLE, 0, "Late Clipping", _cbFrameWin2);
hClient1 = WM_GetClientWindow(hFrame1);
hClient2 = WM_GetClientWindow(hFrame2);
_hWin1 = WM_CreateWindowAsChild(0, 0, WM_GetWindowSizeX(hClient1), WM_GetWindowSizeY(hClient1), hClient1, WM_CF_SHOW, _cbFrameWin1, 0);
_hWin2 = WM_CreateWindowAsChild(0, 0, WM_GetWindowSizeX(hClient2), WM_GetWindowSizeY(hClient2), hClient2, WM_CF_SHOW | WM_CF_LATE_CLIP, _cbFrameWin2, 0);
_hBut1 = BUTTON_CreateEx( 10, 210, 140, 20, 0, WM_CF_SHOW, 0, 1);
_hBut2 = BUTTON_CreateEx(170, 210, 140, 20, 0, WM_CF_SHOW, 0, 2);
hWin0 = FRAMEWIN_CreateEx( 60, 80, 40, 40, 0, WM_CF_SHOW | WM_CF_STAYONTOP, FRAMEWIN_CF_MOVEABLE, 0, "Top 0", _cbTop);
hWin1 = FRAMEWIN_CreateEx(220, 80, 40, 40, 0, WM_CF_SHOW | WM_CF_STAYONTOP, FRAMEWIN_CF_MOVEABLE, 0, "Top 1", _cbTop);
hWin2 = FRAMEWIN_CreateEx(140, 170, 40, 40, 0, WM_CF_SHOW | WM_CF_STAYONTOP, FRAMEWIN_CF_MOVEABLE, 0, "Top 2", _cbTop);
FRAMEWIN_SetResizeable(hWin0, 1);
FRAMEWIN_SetResizeable(hWin1, 1);
FRAMEWIN_SetResizeable(hWin2, 1);
BUTTON_SetText(_hBut1, "Invalidate");
BUTTON_SetText(_hBut2, "Reset counters");
while(1) {
GUI_Delay(50);
}
}
示例3: _ShowMessageBox
/**
* @brief Show Message Box
* @param hWin: pointer to the parent handle
* @param pTitle: pointer to the title
* @param pText: pointer to the text
* @retval int
*/
static int _ShowMessageBox(WM_HWIN hWin, const char* pTitle, const char* pText, int YesNo)
{
WM_HWIN hFrame, hClient, hBut;
int r = 0;
/* Create frame win */
hFrame = FRAMEWIN_CreateEx(25, 82, 190, 90, hWin, WM_CF_SHOW, FRAMEWIN_CF_MOVEABLE, 0, pTitle, &_cbMessageBox);
FRAMEWIN_SetClientColor (hFrame, GUI_WHITE);
FRAMEWIN_SetFont (hFrame, &GUI_Font16B_ASCII);
FRAMEWIN_SetTextAlign (hFrame, GUI_TA_HCENTER);
/* Create dialog items */
hClient = WM_GetClientWindow(hFrame);
TEXT_CreateEx(10, 7, 170, 30, hClient, WM_CF_SHOW, GUI_TA_HCENTER, 0, pText);
if (YesNo) {
hBut = BUTTON_CreateEx(97, 45, 55, 18, hClient, WM_CF_SHOW, 0, GUI_ID_CANCEL);
BUTTON_SetText (hBut, "No");
hBut = BUTTON_CreateEx(32, 45, 55, 18, hClient, WM_CF_SHOW, 0, GUI_ID_OK);
BUTTON_SetText (hBut, "Yes");
} else {
hBut = BUTTON_CreateEx(64, 45, 55, 18, hClient, WM_CF_SHOW, 0, GUI_ID_OK);
BUTTON_SetText (hBut, "Ok");
}
WM_SetFocus(hFrame);
WM_MakeModal(hFrame);
r = GUI_ExecCreatedDialog(hFrame);
return r;
}
示例4: _DemoDropDownAsChild
/*******************************************************************
*
* _DemoDropDownAsChild
*/
static void _DemoDropDownAsChild(void) {
WM_HWIN hFrame;
WM_HWIN hDropDown;
/* Display titel */
GUI_SetBkColor(0xB00000);
GUI_SetColor(0xFFFFFF);
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("Dropdown as child - Sample", 160, 5);
GUI_Delay(SPEED / 2);
/* Create framewin */
GUI_SetFont(&GUI_Font8x16);
GUI_SetTextAlign(GUI_TA_LEFT);
GUI_DispStringAtCEOL("using", 5, 40);
GUI_DispStringAtCEOL("FRAMEWIN_Create", 5, 55);
GUI_Delay(SPEED);
hFrame = FRAMEWIN_Create("DropDown", NULL, WM_CF_SHOW, 80, 80, 160, 140);
FRAMEWIN_SetFont(hFrame, &GUI_Font16B_ASCII);
FRAMEWIN_SetActive(hFrame, 1);
GUI_Delay(SPEED * 0.75);
/* Create listbox */
GUI_DispStringAtCEOL("DROPDOWN_CreateEx", 5, 55);
GUI_Delay(SPEED);
hDropDown = DROPDOWN_CreateEx(20, 20, 120, 65, WM_GetClientWindow(hFrame), WM_CF_SHOW, 0, 0);
GUI_Delay(SPEED * 0.75);
/* Show serveral functions of listbox */
_ShowSeveralFunctions(hDropDown);
/* Delete framewin widget */
GUI_DispStringAtCEOL("FRAMEWIN_Delete", 5, 55);
GUI_Delay(SPEED);
FRAMEWIN_Delete(hFrame);
GUI_Delay(SPEED * 0.75);
/* Clear display */
GUI_Clear();
GUI_Delay(SPEED * 1.5);
}
示例5: xCreateDialogBoxArray
/*********************************************************************
*
* xCreateDialogBoxArray
*/
WM_HWIN xCreateDialogBoxArray(const xDIALOGBOX_Obj* paDialogBox,
int NumDialogBox,
WM_CALLBACK* cb,
WM_HWIN hParent,
int x0, int y0)
{
WM_HWIN hDialog;
WM_HWIN hDialogClient;
if((NumDialogBox <= 0) || (paDialogBox==NULL) || (paDialogBox->paWidget->pfCreateIndirect==NULL) )return 0;
//Creat Parent Window
DEBUGOUT("xCreateDialogBoxArray: Create Parent Win\r\n");
hDialog = paDialogBox->paWidget->pfCreateIndirect(paDialogBox->paWidget, hParent, x0, y0, cb); /* Create parent window */
hDialogClient = WM_GetClientWindow(hDialog);
WIDGET_OrState(hDialog, paDialogBox->paWidget->Flags);
WM_ShowWindow(hDialog);
WM_ShowWindow(hDialogClient);
while (--NumDialogBox > 0)
{
WM_HWIN hChildDialog;
paDialogBox++;
DEBUGOUT("xCreateDialogBoxArray: Create Child DownCounter:%d\r\n", NumDialogBox);
hChildDialog = GUI_CreateDialogBox(paDialogBox->paWidget, paDialogBox->NumWidgets, paDialogBox->cb, hDialogClient, 0, 0); /* Create child Dialog */
WM_ShowWindow(hChildDialog);
}
DEBUGOUT("xCreateDialogBoxArray: Create Child DownCounter:%d\r\n", NumDialogBox);
DEBUGOUT("xCreateDialogBoxArray: Create Child OK\r\n", NumDialogBox);
WM_SetFocusOnNextChild(hDialog); /* Set the focus to the first child */
WM_SendMessageNoPara(hDialogClient, WM_INIT_DIALOG);
return hDialog;
}
示例6: _cbFrameWinVideo
/*********************************************************************
*
* _cbFrameWinVideo
*/
static void _cbFrameWinVideo(WM_MESSAGE* pMsg) {
switch (pMsg->MsgId) {
case WM_PAINT:
if (_IsCompletelyVis) {
GUI_SetBkColor(GUI_DARKGREEN);
GUI_Clear();
GUI_SetColor(GUI_WHITE);
GUI_DispStringAt("Completely visible", 5, 5);
} else {
GUI_SetBkColor(GUI_GRAY);
GUI_Clear();
GUI_SetColor(GUI_WHITE);
GUI_DispStringAt("Not completely visible", 5, 5);
}
break;
case WM_NOTIFY_VIS_CHANGED:
{
WM_HWIN hWin;
int IsCompletelyVis;
hWin = WM_GetClientWindow(pMsg->hWin);
IsCompletelyVis = WM_IsCompletelyVisible(hWin);
if (_IsCompletelyVis != IsCompletelyVis) {
_IsCompletelyVis = IsCompletelyVis;
WM_InvalidateWindow(hWin); /* Only required if content changes if partially hidden */
}
}
break;
default:
WM_DefaultProc(pMsg);
}
}
示例7: MainTask
/*
*********************************************************************************************************
* 函 数 名: MainTask
* 功能说明: GUI主函数
* 形 参: 无
* 返 回 值: 无
*********************************************************************************************************
*/
void MainTask(void)
{
int Value = 0;
WM_HWIN hDlgFrame;
/* 初始化 */
GUI_Init();
// TOUCH_Calibration();
GUI_CURSOR_Show();
WM_SetCallback(WM_HBKWIN, _cbBkWindow);
WM_SetCreateFlags(WM_CF_MEMDEV);
hDlgFrame = 0;
while(1)
{
WM_HWIN hDlg, hText;
char acText[3] = {0};
GUI_Delay(100);
/* 如果对话框被关闭就重新的将其再打开 */
if (!WM_IsWindow(hDlgFrame))
{
Value = 0;
hDlgFrame = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbCallback, 0, 0, 0);
}
Value = (Value + 1) % 100;
acText[0] = '0' + Value / 10;
acText[1] = '0' + Value % 10;
hDlg = WM_GetClientWindow(hDlgFrame);
hText = WM_GetDialogItem(hDlg, GUI_ID_TEXT0);
TEXT_SetText(hText, acText);
}
}
示例8: _DemoListBoxAsChild
/*******************************************************************
*
* _DemoListBoxAsChild
*/
static void _DemoListBoxAsChild(void) {
FRAMEWIN_Handle hFrame;
LISTBOX_Handle hListBox;
/* Display titel */
GUI_SetBkColor(0xB00000);
GUI_SetColor(0xFFFFFF);
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("Listbox as child - Sample", 160, 5);
GUI_Delay(SPEED / 2);
/* Create framewin */
GUI_SetFont(&GUI_Font8x16);
GUI_SetTextAlign(GUI_TA_LEFT);
GUI_DispStringAtCEOL("using", 5, 40);
GUI_DispStringAtCEOL("FRAMEWIN_Create", 5, 55);
GUI_Delay(SPEED);
hFrame = FRAMEWIN_Create("List box", NULL, WM_CF_SHOW, 100, 80, 120, 140);
FRAMEWIN_SetFont(hFrame, &GUI_Font16B_ASCII);
FRAMEWIN_SetActive(hFrame, 1);
GUI_Delay(SPEED * 0.75);
/* Create listbox */
GUI_DispStringAtCEOL("LISTBOX_CreateAsChild", 5, 55);
GUI_Delay(SPEED);
hListBox = LISTBOX_CreateAsChild(_ListBox, WM_GetClientWindow(hFrame), 0, 0, 0, 0, WM_CF_SHOW);
GUI_Delay(SPEED * 0.75);
/* Show serveral functions of listbox */
_ShowSeveralFunctions(hListBox);
/* Delete framewin widget */
GUI_DispStringAtCEOL("FRAMEWIN_Delete", 5, 55);
GUI_Delay(SPEED);
FRAMEWIN_Delete(hFrame);
GUI_Delay(SPEED * 0.75);
/* Clear display */
GUI_Clear();
GUI_Delay(SPEED * 1.5);
}
示例9: _OnValueChanged
/*********************************************************************
*
* _OnValueChanged
*/
static void _OnValueChanged(WM_HWIN hDlg, int Id) {
unsigned Index;
unsigned v;
WM_HWIN hSlider;
WM_HWIN hEdit;
Index = 0;
v = 0;
if ((Id >= GUI_ID_SLIDER0) && (Id <= GUI_ID_SLIDER2)) {
Index = Id - GUI_ID_SLIDER0;
//
// SLIDER-widget has changed, update EDIT-widget
//
hSlider = WM_GetDialogItem(hDlg, GUI_ID_SLIDER0 + Index);
hEdit = WM_GetDialogItem(hDlg, GUI_ID_EDIT0 + Index);
v = SLIDER_GetValue(hSlider);
EDIT_SetValue(hEdit, v);
} else if ((Id >= GUI_ID_EDIT0) && (Id <= GUI_ID_EDIT2)) {
Index = Id - GUI_ID_EDIT0;
//
// If EDIT-widget has changed, update SLIDER-widget
//
hSlider = WM_GetDialogItem(hDlg, GUI_ID_SLIDER0 + Index);
hEdit = WM_GetDialogItem(hDlg, GUI_ID_EDIT0 + Index);
v = EDIT_GetValue(hEdit);
SLIDER_SetValue(hSlider, v);
}
_duty[Index] = v;
//
// At last invalidate dialog client window
//
WM_InvalidateWindow(WM_GetClientWindow(hDlg));
}
示例10: GUI_CreateDialogBox
/*********************************************************************
*
* GUI_CreateDialogbox
*/
WM_HWIN GUI_CreateDialogBox(const GUI_WIDGET_CREATE_INFO* paWidget, int NumWidgets, WM_CALLBACK* cb, WM_HWIN hParent,
int x0, int y0)
{
WM_HWIN hDialog, hDialogClient;
hDialog = paWidget->pfCreateIndirect(paWidget, hParent, x0, y0, cb); /* Create parent window */
if (!hDialog) {
return 0;
}
hDialogClient = WM_GetClientWindow(hDialog);
WIDGET_OrState(hDialog, paWidget->Flags);
WM_ShowWindow(hDialog);
WM_ShowWindow(hDialogClient);
while (--NumWidgets > 0) {
WM_HWIN hChild;
paWidget++;
hChild = paWidget->pfCreateIndirect(paWidget, hDialogClient, 0, 0, 0); /* Create child window */
if (!hChild) {
WM_DeleteWindow(hDialog);
return 0;
}
WM_ShowWindow(hChild);
}
WM_SetFocusOnNextChild(hDialog); /* Set the focus to the first child */
WM_SendMessageNoPara(hDialogClient, WM_INIT_DIALOG);
return hDialog;
}
示例11: _OnSkinChanged
static void _OnSkinChanged(WM_MESSAGE * pMsg,int val)
{
int i = 0;
WM_MESSAGE myMsg;
if(agentConf.Skin != val)
{
agentConf.Skin = val;
pSkin = &(SysWinSkins[val]);
WINDOW_SetBkColor(pMsg->hWin, pSkin->bkColor);
for(i=0; i<SLD_NUM; i++)
{
HSD_SLIDER_SetBkColor(Slideres[i], pSkin->sldBk);
HSD_SLIDER_SetFocusBkColor(Slideres[i], pSkin->sldBk);
HSD_SLIDER_SetSlotColor(Slideres[i],pSkin->sldSlot);
HSD_SLIDER_SetFocusSliderColor(Slideres[i], pSkin->sldFocusSlider);
HSD_SLIDER_SetFocusSlotColor(Slideres[i], pSkin->sldSlot);
}
myMsg.hWin = WM_GetClientWindow(menuWin);
myMsg.Data.v = val;
myMsg.MsgId = USER_MSG_SKIN;
WM_SendMessage (myMsg.hWin, &myMsg);
myMsg.hWin = confirmWin;
WM_SendMessage (myMsg.hWin, &myMsg);
}
}
示例12: CreateWindow
/*********************************************************************
*
* MainTask
*/
void CreateWindow(void) {
WM_HWIN hMultiPage;
WM_HWIN hFrameWin;
WM_HWIN hDialog;
//
// Check if recommended memory for the sample is available
//
if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
GUI_ErrorOut("Not enough memory available.");
return;
}
WM_SetCallback(WM_HBKWIN, _cbBkWindow);
//
// Create the frame window
//
hFrameWin = FRAMEWIN_Create("Sample", NULL, WM_CF_SHOW, 0, 0, 240, 152);
FRAMEWIN_SetClientColor(hFrameWin, GUI_GREEN);
FRAMEWIN_SetActive(hFrameWin, 1);
FRAMEWIN_SetMoveable(hFrameWin, 1);
//
// Create the MULTIPAGE widget
//
hMultiPage = MULTIPAGE_CreateEx(7, 6, 220, 120, WM_GetClientWindow(hFrameWin), WM_CF_SHOW, 0, 0);
GUI_Delay(500);
//
// Create and attach the MULTIPAGE dialog windows
//
hDialog = GUI_CreateDialogBox(_aDialogCreate1, GUI_COUNTOF(_aDialogCreate1), NULL, WM_UNATTACHED, 0, 0);
MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 1");
GUI_Delay(500);
hDialog = GUI_CreateDialogBox(_aDialogCreate2, GUI_COUNTOF(_aDialogCreate2), NULL, WM_UNATTACHED, 0, 0);
MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 2");
GUI_Delay(500);
hDialog = GUI_CreateDialogBox(_aDialogCreate3, GUI_COUNTOF(_aDialogCreate3), NULL, WM_UNATTACHED, 0, 0);
MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 3");
GUI_Delay(500);
hDialog = GUI_CreateDialogBox(_aDialogCreate4, GUI_COUNTOF(_aDialogCreate4), _cbDialog4, WM_UNATTACHED, 0, 0);
MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 4");
GUI_Delay(500);
hDialog = GUI_CreateDialogBox(_aDialogCreate5, GUI_COUNTOF(_aDialogCreate5), NULL, WM_UNATTACHED, 0, 0);
MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 5");
GUI_Delay(500);
hDialog = GUI_CreateDialogBox(_aDialogCreate6, GUI_COUNTOF(_aDialogCreate6), NULL, WM_UNATTACHED, 0, 0);
MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 6");
GUI_Delay(500);
//
// Demonstrate the use of MULTIPAGE_SetAlign
//
MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_RIGHT);
GUI_Delay(500);
MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_RIGHT | MULTIPAGE_ALIGN_BOTTOM);
GUI_Delay(500);
MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_LEFT | MULTIPAGE_ALIGN_BOTTOM);
while (1) {
GUI_Delay(100);
}
}
示例13: _DemoHeaderFrameWin
/*********************************************************************
*
* _DemoHeaderFrameWin
*/
static void _DemoHeaderFrameWin(void) {
FRAMEWIN_Handle hFrameWin;
_ChangeMainText("HEADER control inside a FRAMEWIN");
hFrameWin = FRAMEWIN_Create("Title", _cbWindow, WM_CF_SHOW, 10, 80, 300, 140);
FRAMEWIN_SetActive(hFrameWin, 1);
_hHeader = HEADER_CreateAttached(WM_GetClientWindow(hFrameWin), 1234, 0);
_Demo();
FRAMEWIN_Delete(hFrameWin);
}
示例14: MainTask
/*********************************************************************
*
* MainTask
*/
void MainTask(void) {
WM_HWIN hMultiPage;
WM_HWIN hFrameWin;
WM_HWIN hDialog;
//
// Enable use of memory devices
//
WM_SetCreateFlags(WM_CF_MEMDEV);
GUI_Init();
WM_SetCallback(WM_HBKWIN, _cbBkWindow);
//
// Create the frame window
//
hFrameWin = FRAMEWIN_Create("FrameWindow", NULL, WM_CF_SHOW, 40, 44, 240, 152);
FRAMEWIN_SetClientColor(hFrameWin, GUI_GREEN);
FRAMEWIN_SetActive(hFrameWin, 1);
FRAMEWIN_SetMoveable(hFrameWin, 1);
//
// Create the MULTIPAGE widget
//
hMultiPage = MULTIPAGE_CreateEx(7, 6, 220, 120, WM_GetClientWindow(hFrameWin), WM_CF_SHOW, 0, 0);
GUI_Delay(500);
//
// Create and attach the MULTIPAGE dialog windows
//
hDialog = GUI_CreateDialogBox(_aDialogCreate1, GUI_COUNTOF(_aDialogCreate1), NULL, WM_UNATTACHED, 0, 0);
MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 1");
GUI_Delay(500);
hDialog = GUI_CreateDialogBox(_aDialogCreate2, GUI_COUNTOF(_aDialogCreate2), NULL, WM_UNATTACHED, 0, 0);
MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 2");
GUI_Delay(500);
hDialog = GUI_CreateDialogBox(_aDialogCreate3, GUI_COUNTOF(_aDialogCreate3), NULL, WM_UNATTACHED, 0, 0);
MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 3");
GUI_Delay(500);
hDialog = GUI_CreateDialogBox(_aDialogCreate4, GUI_COUNTOF(_aDialogCreate4), _cbDialog4, WM_UNATTACHED, 0, 0);
MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 4");
GUI_Delay(500);
hDialog = GUI_CreateDialogBox(_aDialogCreate5, GUI_COUNTOF(_aDialogCreate5), NULL, WM_UNATTACHED, 0, 0);
MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 5");
GUI_Delay(500);
hDialog = GUI_CreateDialogBox(_aDialogCreate6, GUI_COUNTOF(_aDialogCreate6), NULL, WM_UNATTACHED, 0, 0);
MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 6");
GUI_Delay(500);
//
// Demonstrate the use of MULTIPAGE_SetAlign
//
MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_RIGHT);
GUI_Delay(500);
MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_RIGHT | MULTIPAGE_ALIGN_BOTTOM);
GUI_Delay(500);
MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_LEFT | MULTIPAGE_ALIGN_BOTTOM);
while (1) {
GUI_Delay(100);
}
}
示例15: MainTask
/*********************************************************************
*
* MainTask
*/
void MainTask(void) {
int Index;
GUI_Init();
//
// Check if recommended memory for the sample is available
//
if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
GUI_ErrorOut("Not enough memory available.");
return;
}
#if GUI_SUPPORT_MEMDEV
WM_SetCreateFlags(WM_CF_MEMDEV);
#endif
WM_SetDesktopColor(GUI_BLACK);
//
// Initialize the temperature arrays
//
_InitRandomData(_aTemp1, GUI_COUNTOF(_aTemp1));
_InitRandomData(_aTemp2, GUI_COUNTOF(_aTemp2));
//
// Execute the intro dialog
//
GUI_ExecDialogBox(_aDialogIntro, GUI_COUNTOF(_aDialogIntro), _cbDialogIntro, WM_HBKWIN, 0, 0);
//
// Execute the color and the temperature dialog
//
_hDialogColor = GUI_CreateDialogBox(_aDialogColor, GUI_COUNTOF(_aDialogColor), _cbDialogColor, WM_HBKWIN, 0, 0);
_hDialogMain = GUI_CreateDialogBox(_aDialogMain, GUI_COUNTOF(_aDialogMain), _cbDialogMain, WM_HBKWIN, 0, 0);
//
// Add new temperatures...
//
Index = GUI_COUNTOF(_aTemp1) - 1;
while (1) {
WM_HWIN hItem;
GUI_Delay(100); // Wait a while
//
// Shift the color arrays
//
memmove(_aTemp1, _aTemp1 + 1, sizeof(_aTemp1) - 2);
memmove(_aTemp2, _aTemp2 + 1, sizeof(_aTemp2) - 2);
//
// Add new values
//
_aTemp1[Index] = _GetRandomValue(_aTemp1[Index - 1]);
_aTemp2[Index] = _GetRandomValue(_aTemp2[Index - 1]);
//
// Update windows
//
hItem = WM_GetClientWindow(WM_GetDialogItem(_hDialogMain, ID_TEMPERATURE));
WM_InvalidateWindow(hItem);
_SetProgbarValue(GUI_ID_PROGBAR0, _aTemp1[Index]);
_SetProgbarValue(GUI_ID_PROGBAR1, _aTemp2[Index]);
}
}