• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GUI_COUNTOF函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了GUI_COUNTOF函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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(); 
}
开发者ID:GreenYo0413,项目名称:stm32f429-lcd-demo,代码行数:82,代码来源:main_2D_text_bmp.c


示例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; 
//.........这里部分代码省略.........
开发者ID:descent,项目名称:STM32f429I-Discovery_Demo,代码行数:101,代码来源:demo_clock.c


示例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);
}
开发者ID:nidhiyanandh,项目名称:STM32Cube_FW_F4_V1.5.0_GCC_Makefile,代码行数:11,代码来源:benchmark_win.c


示例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)
//.........这里部分代码省略.........
开发者ID:nidhiyanandh,项目名称:STM32Cube_FW_F4_V1.5.0_GCC_Makefile,代码行数:101,代码来源:imagebrowser_win.c


示例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);
//.........这里部分代码省略.........
开发者ID:RadMie,项目名称:STM32F7DiscoveryBase,代码行数:101,代码来源:video_player_win.c


示例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);
}
开发者ID:eemei,项目名称:library-stm32f4,代码行数:12,代码来源:camera_win.c


示例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;

//.........这里部分代码省略.........
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:101,代码来源:filebrowser_win.c


示例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;
}
开发者ID:satyanarayangullapalli,项目名称:arm_lpc_1788_sdk,代码行数:9,代码来源:SEGGERDEMO.c


示例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;
}
开发者ID:weimingtom,项目名称:stm32-gui,代码行数:6,代码来源:num_dialog.c


示例10: _TaskerAddPage2

WM_HWIN _TaskerAddPage2(WM_HWIN hWin)
{
    hParent = hWin;
    return GUI_CreateDialogBox(_aDialogCreate2, GUI_COUNTOF(_aDialogCreate2), _cbDialog, WM_UNATTACHED, 0, 0);
}
开发者ID:jeenter,项目名称:CH-K-Lib,代码行数:5,代码来源:tasker_page2.c


示例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;
  }
}
开发者ID:pierreroth64,项目名称:STM32Cube_FW_F4,代码行数:101,代码来源:vncserver_win.c


示例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 },
};
开发者ID:nidhiyanandh,项目名称:STM32Cube_FW_F4_V1.5.0_GCC_Makefile,代码行数:30,代码来源:k_menu.c


示例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;
}
开发者ID:jameskongnet,项目名称:dds,代码行数:6,代码来源:_wSaveDlgDLG.c


示例14: MULTIPAGE_SetDefaultTextColor

/*********************************************************************
*
*       MULTIPAGE_SetDefaultTextColor
*/
void MULTIPAGE_SetDefaultTextColor(GUI_COLOR Color, unsigned Index) {
  if (Index < GUI_COUNTOF(MULTIPAGE__DefaultTextColor)) {
    MULTIPAGE__DefaultTextColor[Index] = Color;
  }
}
开发者ID:Jaly314,项目名称:CH-K-Lib,代码行数:9,代码来源:MULTIPAGE_Default.c


示例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;
    }
//.........这里部分代码省略.........
开发者ID:eemei,项目名称:library-stm32f4,代码行数:101,代码来源:camera_win.c


示例16: Startup

/**
  * @brief  Game 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)
{
  frame = 0;
  SystemWin = GUI_CreateDialogBox(_aDialog, GUI_COUNTOF(_aDialog), _cbDialog, hWin, xpos, ypos);
  hTimer = WM_CreateTimer(SystemWin, 0, 100, 0);
}
开发者ID:CamelShoko,项目名称:RadioYuN,代码行数:13,代码来源:settings_win.c


示例17: _cbDialog


//.........这里部分代码省略.........
                                          hItem, 
                                          WM_CF_SHOW | WM_CF_LATE_CLIP, 
                                          _cbCameraWindow, 
                                          0);
    
    /* Buttons initialization */
    hItem = BUTTON_CreateEx(266, 175, 30, 30, pMsg->hWin, WM_CF_SHOW, 0, ID_BUTTON_CLOSE);
    WM_SetCallback(hItem, _cbButton_close);
    
    hItem = BUTTON_CreateEx(256, 79, 50, 50, pMsg->hWin, WM_CF_SHOW, 0, ID_BUTTON_CAPTURE);
    WM_SetCallback(hItem, _cbButton_capture);
    
    hItem = BUTTON_CreateEx(266, 14, 30, 30, pMsg->hWin, WM_CF_SHOW, 0, ID_BUTTON_SETTINGS);
    WM_SetCallback(hItem, _cbButton_settings);
    
    _Check_DefaultPath (capture_folder);
    FrameAvailable = 0;
    break;

  case WM_NOTIFY_PARENT:
    Id    = WM_GetId(pMsg->hWinSrc);
    NCode = pMsg->Data.v;
    
    if(hSettings == 0)
    {
      switch(Id)
      {
      case ID_RADIO:
        if(NCode == WM_NOTIFICATION_VALUE_CHANGED)
        {
          hItem = WM_GetDialogItem(pMsg->hWin, ID_RADIO);
          if(CAMERA_GetState() != CAMERA_ERROR)
          {
            CAMERA_SelectEffect(RADIO_GetValue(hItem));
          }
        }
        break;
      case ID_BUTTON_CLOSE: /* Notifications sent by 'Close' */
        switch(NCode)
        {
        case WM_NOTIFICATION_RELEASED:
          k_free(pFileInfo);
          CAMERA_Stop();
          GUI_EndDialog(pMsg->hWin, 0);
          break;
        }
        break;
      case ID_BUTTON_CAPTURE: /* Notifications sent by 'OK' */
        switch(NCode)
        {
        case WM_NOTIFICATION_RELEASED:
          /* Show Hint */
          if(CAMERA_GetState() == CAMERA_OK)
          {
            
            Hint = WM_CreateWindowAsChild(100,
                                          90,
                                          120, 32,
                                          pMsg->hWin,
                                          WM_CF_SHOW , 
                                          _cbHint, 
                                          0);
            
            GUI_Exec();
            if(CAMERA_GetState() == CAMERA_OK)
            {             
              CAMERA_SaveToFile(capture_folder);
            }
            WM_DeleteWindow(Hint);
          }
          break;
        }
        break;
      case ID_BUTTON_SETTINGS: /* Notifications sent by 'Settings' */
        switch(NCode)
        {
        case WM_NOTIFICATION_RELEASED:
          camera_disabled = 1;
          hSettings = GUI_CreateDialogBox(_aSettingsDialogCreate, GUI_COUNTOF(_aSettingsDialogCreate), _cbSettingsDialog, CAMERA_hWin, 0, 0);
          break;
        }
        break;
      }
    }
    break;
  case WM_DELETE:
    tmp_param = k_BkupRestoreParameter(CALIBRATION_CAMERA_SETTING_BKP);
    
    /* check if new settings have to be saved */
    if(CameraSettings.d32 != tmp_param)
    {
      k_BkupSaveParameter(CALIBRATION_CAMERA_SETTING_BKP, CameraSettings.d32); 
    }
    break;
    
  default:
    WM_DefaultProc(pMsg);
    break;
  }
}
开发者ID:eemei,项目名称:library-stm32f4,代码行数:101,代码来源:camera_win.c


示例18: mainWinCreate

/*********************************************************************
*
*       CreateWindow
*/
WM_HWIN mainWinCreate(void) {
  WM_HWIN hWin;
		hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
  return hWin;
}
开发者ID:zkan51,项目名称:NEVTEX,代码行数:9,代码来源:mainwin.c


示例19: _cbPopup

/**
  * @brief  Callback routine of popup menu.
  * @param  pMsg: pointer to data structure of type WM_MESSAGE
  * @retval None
  */
static void _cbPopup(WM_MESSAGE * pMsg) {

  K_GET_DIRECT_OPEN_FUNC * pfOpen;
  MENU_MSG_DATA* pData;
  TREEVIEW_ITEM_Handle  hTreeView;
  TREEVIEW_ITEM_INFO    Info;
  WM_HWIN hItem;
  char ext[4];
  switch (pMsg->MsgId)
  {
  case WM_INIT_DIALOG:
    break;

  case WM_MENU:
    /* Process the menu message */
    pData = (MENU_MSG_DATA*)pMsg->Data.p;

    switch (pData->MsgType)
    {
    case MENU_ON_ITEMSELECT:
      /* Menu item has been selected */
      switch (pData->ItemId)
      {
      case ID_MENU_OPENFILE:
        k_GetExtOnly(SelectedFileName, ext);
        pfOpen = k_ModuleCheckLink(ext);

        if(pfOpen != NULL)
        {
          pfOpen(SelectedFileName);
        }
        else
        {
          _ShowMessageBox(hExplorerWin, "File Browser", "No external module is linked to\n this extension!", 0);
        }
        break;

      case ID_MENU_DELETE:
        if (_ShowMessageBox(hExplorerWin, "File Browser", "Are you sure you want to\ndelete selected file?", 1))
        {
           f_unlink (SelectedFileName);
          _RefreshBrowser(hExplorerWin);
        }
        break;

      case ID_MENU_PROPRIETIES:
        if(hFileInfo == 0)
        {
          hFileInfo = GUI_CreateDialogBox(_aFileInfoDialogCreate,
                                          GUI_COUNTOF(_aFileInfoDialogCreate),
                                          _cbFileInfoDialog,
                                          hExplorerWin,
                                          5,
                                          75);
        }
        break;

      case ID_MENU_EXIT:
        break;
      }

      hItem = WM_GetDialogItem(hExplorerWin, ID_TREEVIEW);
      hTreeView = TREEVIEW_GetSel(hItem);
      TREEVIEW_ITEM_GetInfo(hTreeView, &Info);
      if(Info.IsNode == 0)
      {
        /*Force Deselect item */
        hTreeView = TREEVIEW_GetItem(hItem, hTreeView, TREEVIEW_GET_PARENT);
        TREEVIEW_SetSel(hItem, hTreeView);
      }

    }
    break;
  default:
    WM_DefaultProc(pMsg);
    break;
  }
}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:83,代码来源:filebrowser_win.c


示例20: _cbBk

/**
  * @brief  Callback routine of desktop window.
  * @param  pMsg: pointer to data structure of type WM_MESSAGE
  * @retval None
  */
static void _cbBk(WM_MESSAGE * pMsg) {
  
  MENU_MSG_DATA* pData;
  uint32_t NCode, Id;
  static uint8_t sel = 0;
  
  switch (pMsg->MsgId) 
  {

  case WM_MENU:
    /* Process the menu message */
    pData = (MENU_MSG_DATA*)pMsg->Data.p;
    switch (pData->MsgType) 
    {
    case MENU_ON_ITEMSELECT:
      /* A menu item has been selected */
      switch (pData->ItemId) 
      {  
        
      case ID_MENU_LOG:
        if (hLog == 0)
        {
          hLog = GUI_CreateDialogBox(_aKernelLogDialogCreate, 
                                     GUI_COUNTOF(_aProcessManagerDialogCreate), 
                                     _cbKernelLogDialog, 
                                     pMsg->hWin, 
                                     FRAMEWIN_CF_MOVEABLE | WM_CF_FGND | WM_CF_STAYONTOP, 
                                     50);  
        }
        else
        {
          WM_ShowWindow(hLog);
          WM_BringToTop(hLog);
        }        
        break;
        
      case ID_MENU_PMGR:
        if(hProcess == 0)
        {
          hProcess = GUI_CreateDialogBox(_aProcessManagerDialogCreate, 
                                         GUI_COUNTOF(_aProcessManagerDialogCreate), 
                                         _cbProcessManagerDialog, 
                                         pMsg->hWin, 
                                         FRAMEWIN_CF_MOVEABLE | WM_CF_FGND | WM_CF_STAYONTOP, 
                                         50);  
        }
        else
        {
          WM_ShowWindow(hProcess);
          WM_BringToTop(hProcess);
        }
        break;
        
      case ID_MENU_PERF:
        if(hPerformance == 0)
        {
          hPerformance = GUI_CreateDialogBox(_aPerformanceDialogCreate, 
                                             GUI_COUNTOF(_aPerformanceDialogCreate), 
                                             _cbPerformanceDialog, 
                                             pMsg->hWin, 
                                             FRAMEWIN_CF_MOVEABLE | WM_CF_FGND | WM_CF_STAYONTOP, 
                                             50);
        }
        else
        {
          WM_ShowWindow(hPerformance);
          WM_BringToTop(hPerformance);
        }
        break;
        
      case ID_MENU_EXIT:
        break;
      }
    }
    break;
      
  case WM_PAINT:
    
    GUI_SetBkColor(GUI_WHITE);
    GUI_Clear();	
  
    if(hIcon)
    {
      WM_BringToBottom(hIcon);
    }
    break;
    
  case WM_NOTIFY_PARENT:
    Id    = WM_GetId(pMsg->hWinSrc);     
    NCode = pMsg->Data.v;  
    
    switch (NCode) 
    {        
    case WM_NOTIFICATION_CLICKED:   
      if (Id == ID_ICONVIEW_MENU)
//.........这里部分代码省略.........
开发者ID:nidhiyanandh,项目名称:STM32Cube_FW_F4_V1.5.0_GCC_Makefile,代码行数:101,代码来源:k_menu.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GUI_Clear函数代码示例发布时间:2022-05-30
下一篇:
C++ GUI_ALLOC_h2p函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap