当前位置: 首页>>代码示例>>C++>>正文


C++ WM_CreateWindowAsChild函数代码示例

本文整理汇总了C++中WM_CreateWindowAsChild函数的典型用法代码示例。如果您正苦于以下问题:C++ WM_CreateWindowAsChild函数的具体用法?C++ WM_CreateWindowAsChild怎么用?C++ WM_CreateWindowAsChild使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了WM_CreateWindowAsChild函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FRAMEWIN_CreateAsChild

FRAMEWIN_Handle FRAMEWIN_CreateAsChild( 
                                    int x0, int y0, int xsize, int ysize, WM_HWIN hParent,
                                    const char* pText, WM_CALLBACK* cb, int Flags)
{
  FRAMEWIN_Handle hObj;
  /* Create the window */
  GUI_LOCK();
  hObj = WM_CreateWindowAsChild(x0, y0, xsize/*+2*HBorder*/, ysize/*+TBorder+BBorder*/, hParent,
                        Flags, _FRAMEWIN_Callback, sizeof(FRAMEWIN_Obj) - sizeof(WM_Obj));
  if (hObj) {
    FRAMEWIN_Obj* pObj = FRAMEWIN_H2P(hObj);
    /* init widget specific variables */
    WIDGET__Init(&pObj->Widget, WIDGET_STATE_FOCUSSABLE | WIDGET_STATE_ENABLED);
    /* init member variables */
    pObj->pFont = _pDefaultFont;
    memcpy(pObj->BarColor, _aBarColor, sizeof(pObj->BarColor));
    pObj->TextColor    = 0xffffff;
    pObj->TextAlign    = GUI_TA_LEFT;
    pObj->ClientColor  = _DefaultClientColor;
    pObj->pText        = pText;
    pObj->XOff = 1;
    pObj->YOff = 1;
    pObj->cb = cb;
    CalcPositions(hObj);
    pObj->hClient = WM_CreateWindowAsChild(0, 0, 0, 0, hObj, WM_CF_SHOW, FRAMEWIN__cbClient, 0);
  }
  GUI_UNLOCK();
  return hObj;
}
开发者ID:stormbay,项目名称:DragonVer1.0,代码行数:29,代码来源:framewin.c

示例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);
  }
}
开发者ID:Trietptm-on-Coding-Algorithms,项目名称:CodeLibrary,代码行数:34,代码来源:WM_LateClipping.c

示例3: MainMenu

/**
  * @brief  Main menu
  * @param  None
  * @retval None
  */
void MainMenu(void) {
	ICONVIEW_Handle hIcon;
	WM_HWIN hStatusWin;
	int i = 0;

	WM_SetCallback(WM_GetDesktopWindowEx(1), _cbBk);

	/* create header window for status display e.g. CPU load, Bluetooth status , GPS status */
	hStatusWin = WM_CreateWindowAsChild(0, 0, LCD_GetXSize(), 20, WM_GetDesktopWindowEx(1),
										WM_CF_SHOW | WM_CF_HASTRANS , _cbStatus, 0);
	hIcon = ICONVIEW_CreateEx(0, 20, LCD_GetXSize(), LCD_GetYSize()- 26,
							  WM_GetDesktopWindowEx(1), WM_CF_SHOW | WM_CF_HASTRANS,
							  0 ,'0', 115, 95);

	ICONVIEW_SetFont(hIcon, &GUI_Font13B_ASCII);
	ICONVIEW_SetBkColor(hIcon, ICONVIEW_CI_SEL, 0x941000 | 0x80404040);
	ICONVIEW_SetSpace(hIcon, GUI_COORD_Y, 3);
	ICONVIEW_SetFrame(hIcon, GUI_COORD_Y, 1);

	/* fill Icon view with available bitmaps */
	for (i = 0; i < GUI_COUNTOF(_aBitmapItem); i++) {
		ICONVIEW_AddBitmapItem(hIcon,_aBitmapItem[i].pBitmap, _aBitmapItem[i].pText);
	}
	/*select layer with index 1*/
	GUI_SelectLayer(1);
}
开发者ID:LucianZala,项目名称:SmartEmbeddedDeviceFW,代码行数:31,代码来源:menu.c

示例4: PROGBAR_CreateEx

/*********************************************************************
*
*       PROGBAR_CreateEx
*/
PROGBAR_Handle PROGBAR_CreateEx(int x0, int y0, int xsize, int ysize, WM_HWIN hParent,
                                int WinFlags, int ExFlags, int Id)
{
  PROGBAR_Handle hObj;
  GUI_USE_PARA(ExFlags);
  hObj = WM_CreateWindowAsChild(x0, y0, xsize, ysize, hParent, WinFlags, _PROGBAR_Callback,
                                sizeof(PROGBAR_Obj) - sizeof(WM_Obj));
  if (hObj) {
    PROGBAR_Obj* pObj;
    WM_LOCK();
    pObj = (PROGBAR_Obj*) GUI_ALLOC_h2p(hObj);
    /* init widget specific variables */
    WIDGET__Init(&pObj->Widget, Id, 0);
    WIDGET_SetEffect(hObj, &WIDGET_Effect_None); /* Standard effect for progbar: None */
    INIT_ID(pObj);
    /* init member variables */
    pObj->pFont        = GUI_DEFAULT_FONT;
    pObj->BarColor[0]  = PROGBAR_DEFAULT_BARCOLOR0;
    pObj->BarColor[1]  = PROGBAR_DEFAULT_BARCOLOR1;
    pObj->TextColor[0] = PROGBAR_DEFAULT_TEXTCOLOR0;
    pObj->TextColor[1] = PROGBAR_DEFAULT_TEXTCOLOR1;
    pObj->TextAlign    = GUI_TA_CENTER;
    pObj->Max          = 100;
    pObj->Min          = 0;
    WM_UNLOCK();
  }
  return hObj;
}
开发者ID:ChunHungLiu,项目名称:ubuntu230os,代码行数:32,代码来源:PROGBAR.c

示例5: BUTTON_CreateAsChild

BUTTON_Handle BUTTON_CreateAsChild (int x0, int y0, int xsize, int ysize, WM_HWIN hParent, int Id, int Flags) {
  BUTTON_Handle hObj;
  /* Create the window */
  WM_LOCK();
  hObj = WM_CreateWindowAsChild(x0, y0, xsize, ysize, hParent,
                       Flags, _BUTTON_Callback,
                       sizeof(BUTTON_Obj)-sizeof(WM_Obj));
  if (hObj) {
    BUTTON_Obj* pObj = BUTTON_H2P(hObj);
    /* init widget specific variables */
    /* init member variables */
    BUTTON_INIT_ID(pObj);
    pObj->Widget.Id     = Id;
    pObj->pFont         = BUTTON_FONT_DEFAULT;
    pObj->aBkColor[0]   = BUTTON_BKCOLOR0_DEFAULT;
    pObj->aBkColor[1]   = BUTTON_BKCOLOR1_DEFAULT;
    pObj->aTextColor[0] = BUTTON_TEXTCOLOR0_DEFAULT;
    pObj->aTextColor[1] = BUTTON_TEXTCOLOR1_DEFAULT;
    pObj->Widget.State  = BUTTON_STATE_INACTIVE;
  } else {
    GUI_DEBUG_ERROROUT_IF(hObj==0, "BUTTON_Create failed")
  }
  WM_UNLOCK();
  return hObj;
}
开发者ID:Cee,项目名称:uCOS-II-Timebomb,代码行数:25,代码来源:button.c

示例6: TEXT_CreateEx

/*********************************************************************
*
*       TEXT_CreateEx
*/
TEXT_Handle TEXT_CreateEx(int x0, int y0, int xsize, int ysize, WM_HWIN hParent,
                          int WinFlags, int ExFlags, int Id, const char* pText)
{
  TEXT_Handle hObj;
  /* Create the window */
  #if TEXT_SUPPORT_TRANSPARENCY
    WinFlags |= WM_CF_HASTRANS;
  #endif
  WM_LOCK();
  hObj = WM_CreateWindowAsChild(x0, y0, xsize, ysize, hParent, WinFlags, TEXT_Callback,
                                sizeof(TEXT_Obj) - sizeof(WM_Obj));
  if (hObj) {
    TEXT_Obj* pObj;
    WM_HMEM hMem = 0;
    pObj = (TEXT_Obj *)GUI_ALLOC_h2p(hObj); /* Don't use use WIDGET_H2P because WIDGET_INIT_ID() has not be called at this point */
    /* init widget specific variables */
    WIDGET__Init(&pObj->Widget, Id, 0);
    /* init member variables */
    TEXT_INIT_ID(pObj);
    if (pText) {
      hMem = GUI_ALLOC_AllocZero(strlen(pText) + 1);
      if (hMem) {
        strcpy((char*) GUI_ALLOC_h2p(hMem), pText);
      }
    }
    pObj->hpText = hMem;
    pObj->Align  = ExFlags;
    pObj->Props  = TEXT__DefaultProps;
  } else {
    GUI_DEBUG_ERROROUT_IF(hObj==0, "TEXT_Create failed")
  }
  WM_UNLOCK();
  return hObj;
}
开发者ID:Arakula,项目名称:Misa-Kitara-AP,代码行数:38,代码来源:TEXT.c

示例7: LISTBOX_CreateEx

/*********************************************************************
*
*       LISTBOX_CreateEx
*/
LISTBOX_Handle LISTBOX_CreateEx(int x0, int y0, int xsize, int ysize, WM_HWIN hParent,
                                int WinFlags, int ExFlags, int Id, const GUI_ConstString* ppText)
{
  LISTBOX_Handle hObj;
  GUI_USE_PARA(ExFlags);
  hObj = WM_CreateWindowAsChild(x0, y0, xsize, ysize, hParent, WinFlags, _LISTBOX_Callback,
                                sizeof(LISTBOX_Obj) - sizeof(WM_Obj));
  if (hObj) {
    LISTBOX_Obj* pObj;
    WM_LOCK();
    pObj = LISTBOX_H2P(hObj);
     /* Init sub-classes */
    GUI_ARRAY_CREATE(&pObj->ItemArray);
   /* init widget specific variables */
    WIDGET__Init(&pObj->Widget, Id, WIDGET_STATE_FOCUSSABLE);
    pObj->Props = LISTBOX_DefaultProps;
    if (ppText) {
      /* init member variables */
      /* Set non-zero attributes */
      LISTBOX_SetText(hObj, ppText);
    }
    INIT_ID(pObj);
    LISTBOX_UpdateScrollers(hObj);
    WM_UNLOCK();
  }
  return hObj;
}
开发者ID:ChunHungLiu,项目名称:ubuntu230os,代码行数:31,代码来源:LISTBOX.c

示例8: WM_LOCK

EDIT_Handle EDIT_CreateAsChild     (int x0, int y0, int xsize, int ysize, WM_HWIN hParent, int Id, int Flags, int MaxLen) {
    EDIT_Handle hObj;
    if (MaxLen == 0) {
        MaxLen = 8;
    }
    /* Alloc memory for obj */
    WM_LOCK();
    hObj = WM_CreateWindowAsChild(x0, y0, xsize, ysize, hParent,
                                  WM_CF_SHOW | Flags, EDIT__Callback,
                                  sizeof(EDIT_Obj)-sizeof(WM_Obj));
    if (hObj) {
        EDIT_Obj* pObj = (EDIT_Obj*)WM_HMEM2Ptr(hObj);
        /* init widget specific variables */
        WIDGET__Init(&pObj->Widget, WIDGET_STATE_FOCUSSABLE  | WIDGET_STATE_ENABLED);
        pObj->Widget.Id     = Id;
        /* init member variables */
        INIT_ID(pObj);
        pObj->pFont         = _pDefaultFont;
        pObj->aBkColor[0]   = EDIT_BKCOLOR0_DEFAULT;
        pObj->aBkColor[1]   = EDIT_BKCOLOR1_DEFAULT;
        pObj->aTextColor[0] = EDIT_TEXTCOLOR0_DEFAULT;
        pObj->aTextColor[1] = EDIT_TEXTCOLOR1_DEFAULT;
        pObj->Align         = _DefaultAlign;
        pObj->Border        = _DefaultBorder;
        pObj->XSizeCursor   = 1;
        pObj->MaxLen        = MaxLen;
        if ((pObj->hpText = WM_ALLOC(MaxLen+1)) ==0) {
            GUI_DEBUG_ERROROUT("EDIT_Create failed to alloc buffer");
            EDIT_Delete(hObj);
            hObj =0;
        }
    }
    WM_UNLOCK();
    return hObj;
}
开发者ID:stormbay,项目名称:DragonVer1.0,代码行数:35,代码来源:edit.c

示例9: SLIDER_CreateEx

/*********************************************************************
*
*       SLIDER_CreateEx
*/
SLIDER_Handle SLIDER_CreateEx(int x0, int y0, int xsize, int ysize, WM_HWIN hParent,
                              int WinFlags, int ExFlags, int Id)
{
  SLIDER_Handle hObj;
  /* Create the window */
  WM_LOCK();
  #if SLIDER_SUPPORT_TRANSPARENCY
    WinFlags |= WM_CF_HASTRANS;
  #endif
  hObj = WM_CreateWindowAsChild(x0, y0, xsize, ysize, hParent, WinFlags, SLIDER_Callback, sizeof(SLIDER_Obj) - sizeof(WM_Obj));
  if (hObj) {
    SLIDER_Obj * pObj;
    U16 InitState;
    pObj = (SLIDER_Obj *)GUI_ALLOC_h2p(hObj); /* Don't use use WIDGET_H2P because WIDGET_INIT_ID() has not be called at this point */
    /* Handle SpecialFlags */
    InitState = WIDGET_STATE_FOCUSSABLE;
    if (ExFlags & SLIDER_CF_VERTICAL) {
      InitState |= WIDGET_CF_VERTICAL;
    }
    /* init widget specific variables */
    WIDGET__Init(&pObj->Widget, Id, InitState);
    /* init member variables */
    SLIDER_INIT_ID(pObj);
    pObj->Props = SLIDER__DefaultProps;
    pObj->Width       = 8;
    pObj->Max         = 100;
    pObj->Min         = 0;
    pObj->NumTicks    = -1;
  } else {
    GUI_DEBUG_ERROROUT_IF(hObj==0, "SLIDER_Create failed")
  }
  WM_UNLOCK();
  return hObj;
}
开发者ID:Jaly314,项目名称:CH-K-Lib,代码行数:38,代码来源:SLIDER.c

示例10: HSD_SLIDER_CreateEx

/**********************************************************
 *                 HSD_SLIDER_CreateEx
 *
 */
SLIDER_Handle HSD_SLIDER_CreateEx(int x0, int y0, int xSize, int ySize, WM_HWIN hParent,
                                  int WinFlags, int ExFlags, int Id)
{
   SLIDER_Handle hObj;
   
   WM_LOCK();
   hObj  = WM_CreateWindowAsChild(x0, y0, xSize, ySize, hParent, WinFlags, HSD_SLIDER_Callback, sizeof(SLIDER_Obj)-sizeof(WM_Obj));
   if(hObj)
   {
      SLIDER_Obj* pObj  = SLIDER_H2P(hObj);
      U16 InitState;
      InitState  = WIDGET_STATE_FOCUSSABLE;
      if(ExFlags & SLIDER_CF_VERTICAL)
      {
         InitState  |= WIDGET_CF_VERTICAL;
      }
      
      WIDGET__Init(&pObj->Widget, Id, InitState);
      
      pObj->aBkColor[0]  = GUI_GRAY;
      pObj->aBkColor[1]  = GUI_DARKCYAN;
      pObj->aColor[0]  = GUI_BLACK;
      pObj->aColor[1]  = GUI_ORANGE;
      pObj->Width  = 16;
      pObj->Max  = 6;
      pObj->Min  = 0;
      pObj->NumTicks  = -1;
   }
   else
   {
//INFO("Slider create failed!");   
   }
   WM_UNLOCK();
   return hObj;
}     
开发者ID:EmbededMind,项目名称:T90,代码行数:39,代码来源:HSD_SLIDER.c

示例11: EDIT_CreateEx

/*********************************************************************
*
*       EDIT_CreateEx
*/
EDIT_Handle EDIT_CreateEx(int x0, int y0, int xsize, int ysize, WM_HWIN hParent, int WinFlags, int ExFlags,
                          int Id, int MaxLen)
{
  EDIT_Handle hObj;
  GUI_USE_PARA(ExFlags);
  WM_LOCK();
  /* Alloc memory for obj */
  WinFlags |= WM_CF_LATE_CLIP;    /* Always use late clipping since widget is optimized for it. */
  hObj = WM_CreateWindowAsChild(x0, y0, xsize, ysize, hParent, WM_CF_SHOW | WinFlags, EDIT_Callback,
                                sizeof(EDIT_Obj) - sizeof(WM_Obj));
  if (hObj) {
    EDIT_Obj* pObj;
    pObj = (EDIT_Obj *)GUI_ALLOC_h2p(hObj); /* Don't use use WIDGET_H2P because WIDGET_INIT_ID() has not be called at this point */
    /* init widget specific variables */
    WIDGET__Init(&pObj->Widget, Id, WIDGET_STATE_FOCUSSABLE);
    /* init member variables */
    EDIT_INIT_ID(pObj);
    pObj->Props         = EDIT__DefaultProps;
    pObj->XSizeCursor   = 1;
    pObj->MaxLen        = (MaxLen == 0) ? 8 : MaxLen;
    pObj->BufferSize    = 0;
    pObj->hpText        = 0;
    if (_IncrementBuffer(pObj, pObj->MaxLen + 1) == 0) {
      GUI_DEBUG_ERROROUT("EDIT_Create failed to alloc buffer");
      EDIT_Delete(hObj);
      hObj = 0;
    }
  }
  WM_UNLOCK();
  return hObj;
}
开发者ID:jackeyjiang,项目名称:STM32_DGUS,代码行数:35,代码来源:EDIT.c

示例12: _DemoCreateWindowAsChild

/*******************************************************************
*
*       _DemoCreateWindowAsChild

  Demonstrates the use of WM_CreateWindowAsChild
*/
static void _DemoCreateWindowAsChild(void) {
  /* Create windows */
  _ChangeInfoText("WM_CreateWindowAsChild()");
  GUI_Delay(SPEED);
  _hChild = WM_CreateWindowAsChild(10, 50, 145, 40, _hWindow2, WM_CF_SHOW | WM_CF_MEMDEV, _cbChild, 0);
  GUI_Delay(SPEED);
}
开发者ID:piyushpandey013,项目名称:ucGUI,代码行数:13,代码来源:WM_Sample.c

示例13: SLIDER_Create

SLIDER_Handle SLIDER_Create (int x0, int y0, int xsize, int ysize, WM_HWIN hParent, int Id, int WinFlags, int SpecialFlags) {
  SLIDER_Handle hObj;
  /* Create the window */
  WM_LOCK();
  hObj = WM_CreateWindowAsChild(x0, y0, xsize, ysize, hParent,
                       WinFlags, _SLIDER_Callback, sizeof(SLIDER_Obj)-sizeof(WM_Obj));
  if (hObj) {
    SLIDER_Obj* pObj = SLIDER_H2P(hObj);
    U16 InitState;
    /* Handle SpecialFlags */
    InitState = WIDGET_STATE_ENABLED;
    if (SpecialFlags & SLIDER_CF_VERTICAL) {
      InitState |= WIDGET_CF_VERTICAL;
    }
    /* init widget specific variables */
    WIDGET__Init(&pObj->Widget, InitState);
    /* init member variables */
    SLIDER_INIT_ID(pObj);
    pObj->Widget.Id       = Id;
    pObj->aBkColor[0]   = SLIDER_BKCOLOR0_DEFAULT;
    pObj->aBkColor[1]   = SLIDER_BKCOLOR1_DEFAULT;
    pObj->aColor[0]     = SLIDER_COLOR0_DEFAULT;
    pObj->aColor[1]     = SLIDER_COLOR1_DEFAULT;
    pObj->Width = 8;
    pObj->Max =100;
    pObj->Min =0;
    pObj->NumSections = 10;
  } else {
    GUI_DEBUG_ERROROUT_IF(hObj==0, "SLIDER_Create failed")
  }
  WM_UNLOCK();
  return hObj;
}
开发者ID:Cee,项目名称:uCOS-II-Timebomb,代码行数:33,代码来源:Slider.c

示例14: k_InitMenu

/**
  * @brief  Initializes the menu.
  * @param  None.
  * @retval None.
  */
void k_InitMenu(void) 
{

  WM_HWIN  hItem;
  uint8_t i = 0;
  GUI_SetLayerVisEx (0, 0);
  GUI_DrawBitmap(&bmbackground, 0,0);     
  
  settings.d32 = k_BkupRestoreParameter(CALIBRATION_GENERAL_SETTINGS_BKP);
  
  GUI_SetLayerVisEx (0, 1);
  GUI_SelectLayer(1);
  GUI_Clear();

  WM_SetCallback(WM_HBKWIN, _cbBk);
  
  WM_CreateWindowAsChild(0,
                         0,
                         LCD_GetXSize(),
                         25,
                         WM_HBKWIN, 
                         WM_CF_SHOW | WM_CF_HASTRANS , 
                         _cbStatus, 
                         0);
     
  hIcon = ICONVIEW_CreateEx(0, 
                            26, 
                            LCD_GetXSize(), 
                            LCD_GetYSize()- 26, 
                            WM_HBKWIN, 
                            WM_CF_SHOW | WM_CF_HASTRANS | WM_CF_BGND ,
                            ICONVIEW_CF_AUTOSCROLLBAR_V,
                            ID_ICONVIEW_MENU, 
                            112, 
                            105);
  
  ICONVIEW_SetFont(hIcon, &GUI_Font13B_ASCII);
  
  ICONVIEW_SetBkColor(hIcon, ICONVIEW_CI_SEL, GUI_LIGHTBLUE |GUI_TRANSPARENT);
  
  ICONVIEW_SetSpace(hIcon, GUI_COORD_Y, 10);
  
  ICONVIEW_SetFrame(hIcon, GUI_COORD_Y, 10);
    
  for (i = 0; i < k_ModuleGetNumber(); i++)
  {
    ICONVIEW_AddBitmapItem(hIcon,module_prop[i].module->icon, (char *)module_prop[i].module->name);
  }

  if(settings.b.enable_sprite)
  {
    _ShowSprites();
  }
  
  hItem = BUTTON_CreateEx(0, 0, 40, 23, WM_HBKWIN, WM_CF_SHOW, 0, ID_BUTTON_BKGND);
  WM_SetCallback(hItem, _cbButton);
}
开发者ID:EarnestHein89,项目名称:STM32Cube_FW_F4,代码行数:62,代码来源:k_menu.c

示例15: MainTask_AppClock

/*******************************************************************
*
*       MainTask
*
********************************************************************
*/
void MainTask_AppClock(void)
{
	WM_HWIN hWinClock;
	GUI_AUTODEV AutoDev;
	PARAM       Param;

	int hour = 0;
	time_t oldtimestamp = 0;
	time_t curtimestamp = 0;
	struct tm *currUtime;

	//Init time
	curtimestamp = time(0);
	oldtimestamp = curtimestamp;
	currUtime=localtime(&curtimestamp);

	hWinClock = WM_CreateWindowAsChild(0, 0, 320, 240, WM_HBKWIN, WM_CF_SHOW, _cbClock, 0);
	WM_SelectWindow(hWinClock);
	WM_SetCreateFlags(WM_CF_MEMDEV);
	WM_SetFocus(hWinClock);
	_MoveShiftWindow(&hWinClock, MEMDEV_ANIMATION_LEFT, WM_Shift_ToLCD, 0);

	/*hWinClock = WM_CreateWindow(0, 0, 320, 240, WM_CF_SHOW, _cbClock, 0);
	WM_SetFocus(hWinClock);
	//_MoveShiftWindow(&hWinCalendar, MEMDEV_ANIMATION_LEFT, WM_Shift_ToLCD, 0);
	WM_EnableMemdev(hWinClock);*/

	/*	GUI_SetBkColor(GUI_WHITE);
	GUI_Clear();
	GUI_SetColor(GUI_BLACK);*/

	GUI_AA_EnableHiRes();
	GUI_AA_SetFactor(MAG);
	GUI_MEMDEV_CreateAuto(&AutoDev);

	while (!GUI_CheckCancel(APP_Clock))
	{
		GUI_Delay(10);
		curtimestamp = time(0);
		currUtime = localtime(&curtimestamp);
		if (1 == curtimestamp - oldtimestamp)
		{
			Param.Angle1 = (59 - currUtime->tm_sec) * 6 * (3.1415926f / 180);
			Param.Angle2 = (3599 - ((currUtime->tm_min * 60) + (currUtime->tm_sec)))*0.1*(3.1415926f / 180);
			hour = (currUtime->tm_hour>12) ? (currUtime->tm_hour - 12) : (currUtime->tm_hour);
			Param.Angle3 = (43199 - ((hour * 3600) + (currUtime->tm_min * 60) + (currUtime->tm_sec)))*0.0083333*(3.1415926f / 180);
			GUI_RotatePolygon(Param.aPoint1, _aNeedle[0], GUI_COUNTOF(_aNeedle[0]), Param.Angle1);
			GUI_RotatePolygon(Param.aPoint2, _aNeedle[1], GUI_COUNTOF(_aNeedle[1]), Param.Angle2);
			GUI_RotatePolygon(Param.aPoint3, _aNeedle[2], GUI_COUNTOF(_aNeedle[2]), Param.Angle3);
			GUI_MEMDEV_DrawAuto(&AutoDev, &Param.AutoDevInfo, &Draw, &Param);
		}
		oldtimestamp = curtimestamp;
	}
	WM_DeleteWindow(hWinClock);
	hWinClock = 0;
}
开发者ID:fzzjoy,项目名称:SimulationTrial,代码行数:62,代码来源:AppClock.c


注:本文中的WM_CreateWindowAsChild函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。