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


C++ GUI_EndDialog函数代码示例

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


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

示例1: _cbCallback

/*********************************************************************
*
*       _cbCallback
*/
static void _cbCallback(WM_MESSAGE * pMsg) {
  int Sel, NCode, Id;
  WM_HWIN hDlg, hItem;
  GUI_PID_STATE * pState;
  hDlg = pMsg->hWin;
  switch (pMsg->MsgId) {
    case WM_INIT_DIALOG:
      hItem = WM_GetDialogItem(hDlg, GUI_ID_EDIT0);
      EDIT_SetDecMode(hItem, 30,   0, 999, 0, 0);    /* Select decimal mode */
      WM_DisableWindow(hItem);
      break;
    case WM_KEY:
      switch (((WM_KEY_INFO*)(pMsg->Data.p))->Key) {
        case GUI_KEY_ESCAPE:
          GUI_EndDialog(hDlg, 1);
          break;
        case GUI_KEY_ENTER:
          GUI_EndDialog(hDlg, 0);
          break;
      }
      break;
    case WM_TOUCH_CHILD:
      Id = WM_GetId(pMsg->hWinSrc);      /* Id of widget */
      switch (Id) {
        case GUI_ID_TEXT0:
        case GUI_ID_TEXT1:
        case GUI_ID_TEXT2:
          pState = (GUI_PID_STATE *)((WM_MESSAGE *)pMsg->Data.p)->Data.p;
          if (pState) {
            if (pState->Pressed) {
              WM_HWIN hRadio = WM_GetDialogItem(hDlg, GUI_ID_RADIO0);
              RADIO_SetValue(hRadio, Id - GUI_ID_TEXT0);    /* Use the text beside the radio button to 
                                                               set the value of the radio button */
            }
          }
          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_OK:
              GUI_EndDialog(hDlg, 0);
              break;
            case GUI_ID_CANCEL:
              GUI_EndDialog(hDlg, 1);
              break;
          }
          break;
        case WM_NOTIFICATION_VALUE_CHANGED:
          hItem = WM_GetDialogItem(hDlg, GUI_ID_RADIO0);
          Sel   = RADIO_GetValue(hItem);
          hItem = WM_GetDialogItem(hDlg, GUI_ID_EDIT0);
          WM_SetEnableState(hItem, Sel == 2);      
          break;
      }
      break;
    default:
      WM_DefaultProc(pMsg);
  }
}
开发者ID:dadianxukong,项目名称:gps,代码行数:68,代码来源:DIALOG_Radio.c

示例2: _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;
  uint32_t tmp_param = 0;


  switch (pMsg->MsgId)
  {
  case WM_INIT_DIALOG:

    WM_MakeModal(pMsg->hWin);
    /* 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);

    /* '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);

    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_1);
    TEXT_SetFont(hItem, GUI_FONT_13B_1);

    hItem = WM_GetDialogItem(pMsg->hWin, ID_SPINBOX_0);

    SPINBOX_SetRange(hItem, 1, 10);

    if(ImSettings.b.ss_timer > 0)
    {
       SPINBOX_SetValue(hItem, ImSettings.b.ss_timer);
    }
    else
    {
      ImSettings.b.ss_timer = 1;
      SPINBOX_SetValue(hItem, 1);
    }

    break;

  case WM_NOTIFY_PARENT:
    Id = WM_GetId(pMsg->hWinSrc);
    NCode = pMsg->Data.v;

    switch (Id)
    {
    /* Notification sent by "OK" button */
    case ID_BUTTON_OK:
      switch (NCode) {

      case WM_NOTIFICATION_RELEASED:

        /* Save image settings before delete settings frame */
        hItem = WM_GetDialogItem(pMsg->hWin, ID_SPINBOX_0);
        ImSettings.b.ss_timer = SPINBOX_GetValue(hItem);

        WM_RestartTimer(hTimerTime, (ImSettings.b.ss_timer * 1000));

        tmp_param = k_BkupRestoreParameter(CALIBRATION_IMAGE_SETTINGS_BKP);

        /* check if new settings have to be saved */
        if(ImSettings.d32 != tmp_param)
        {
          k_BkupSaveParameter(CALIBRATION_IMAGE_SETTINGS_BKP, ImSettings.d32);
        }

        GUI_EndDialog(pMsg->hWin, 0);
        break;
      }
      break;
    /* Notification sent by "Cancel" button */
    case ID_BUTTON_CANCEL:
      switch (NCode) {
      case WM_NOTIFICATION_RELEASED:
        GUI_EndDialog(pMsg->hWin, 0);
        break;
      }
      break;
    }
    break;

  }
}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:94,代码来源:imagebrowser_win.c

示例3: _cbProcessManagerDialog

/**
  * @brief  Callback function of the process manager dialog
  * @param  pMsg: pointer to data structure of type WM_MESSAGE
  * @retval None
  */
static void _cbProcessManagerDialog(WM_MESSAGE * pMsg) {
  WM_HWIN  hItem;
  int      NCode;
  int      Id, Idx;

  switch (pMsg->MsgId) {
    
  case WM_INIT_DIALOG:

    hItem = pMsg->hWin;
    FRAMEWIN_SetTitleVis(hItem, 0);
    
    hItem = WM_GetDialogItem(pMsg->hWin, ID_LISTVIEW_PROCESSMANAGER);
    LISTVIEW_AddColumn(hItem, 170, "Tasks", GUI_TA_HCENTER | GUI_TA_VCENTER);
    LISTVIEW_AddColumn(hItem, 60, "Priority", GUI_TA_HCENTER | GUI_TA_VCENTER);
    LISTVIEW_AddColumn(hItem, 70, "State", GUI_TA_HCENTER | GUI_TA_VCENTER);
    
    LISTVIEW_SetGridVis(hItem, 1);
    LISTVIEW_SetTextAlign(hItem, 0, GUI_TA_LEFT);
    LISTVIEW_SetTextAlign(hItem, 1, GUI_TA_HCENTER);
    LISTVIEW_SetTextAlign(hItem, 2, GUI_TA_HCENTER);
    HEADER_SetDragLimit(LISTVIEW_GetHeader(hItem), 1);
    LISTVIEW_SetCompareFunc(hItem, 1, LISTVIEW_CompareDec);
    LISTVIEW_SetTextColor(hItem, LISTVIEW_CI_SELFOCUS, GUI_LIGHTBLUE);  
  
    for (Idx = 0; Idx < 16 ; Idx ++)
    {
      LISTVIEW_AddRow(hItem, NULL);
    }
  
    _UpdateProcessManagerView(hItem);
    
    WM_CreateWindowAsChild(470, 0, 10, 10, pMsg->hWin, WM_CF_SHOW | WM_CF_HASTRANS, _cbTaskWindow , 0); 
    break;

  case WM_PAINT:
    hItem = WM_GetDialogItem(pMsg->hWin, ID_LISTVIEW_PROCESSMANAGER);
    _UpdateProcessManagerView(hItem);
    break;

  case WM_NOTIFY_PARENT:
    Id    = WM_GetId(pMsg->hWinSrc);
    NCode = pMsg->Data.v;
    switch(Id) {
    case ID_BUTTON_CANCEL_PROCESSMANAGER: /* Notifications sent by 'Cancel' button */
      switch(NCode) {
      case WM_NOTIFICATION_RELEASED:
        GUI_EndDialog(pMsg->hWin, 0);
        hProcess = 0;       
        break;
      }
      break;
    case ID_LISTVIEW_PROCESSMANAGER: /* Notifications sent by 'Listview' */
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        break;
      case WM_NOTIFICATION_RELEASED:
        break;
      case WM_NOTIFICATION_SEL_CHANGED:
        break;
      }
      break;
    }
    break;
  default:
    WM_DefaultProc(pMsg);
    break;
  }
}
开发者ID:EarnestHein89,项目名称:STM32Cube_FW_F4,代码行数:74,代码来源:k_menu.c

示例4: win_tr_cas_announce_list_keypress

SIGNAL_HANDLER  int win_tr_cas_announce_list_keypress(const char* widgetname, void *usrdata)
{
	GUI_Event *event = NULL;
	uint32_t nListViewSel = 0;
	uint32_t deleteSel;
	ca_delete_data_t delete_data = {0};
	ca_get_date_t get_data = {0};
	char config[10] = {0};
	uint32_t gMail_sel = 0;
	char strNewNum[10] = {0};

	event = (GUI_Event *)usrdata;
	switch (event->type)
	{
	case GUI_MOUSEBUTTONDOWN:
		break;

	case GUI_KEYDOWN:
		switch (event->key.sym)
		{
		case KEY_RED://删除单封公告
			GUI_GetProperty("win_tr_cas_announce_list_listview", "select", &nListViewSel);
			if (s_announceGetCount.totalnum > 0)
			{
				deleteSel = nListViewSel;
				if (nListViewSel >= (s_announceGetCount.totalnum - 1))
				{
					nListViewSel--;
				}
				
				delete_data.date_type = DVB_CA_CURTAIN_INFO;
				delete_data.pos = deleteSel;
				app_cas_api_delete(&delete_data);
				s_announceGetCount.date_type = DVB_CA_CURTAIN_INFO;
				app_cas_api_get_count(&s_announceGetCount);
				GUI_SetProperty("win_tr_cas_announce_list_listview", "update_all", NULL);
				GUI_SetProperty("win_tr_cas_announce_list_listview","select",(void*)&nListViewSel);
				sprintf(config, "%d", s_announceGetCount.totalnum);
				GUI_SetProperty("win_tr_cas_announce_list_text_count", "string", (void *)config);
				sprintf(config, "%d", s_announceGetCount.newnum);
				GUI_SetProperty("win_tr_cas_announce_list_text_new_count", "string", (void *)config);
			}
			else
			{
				app_popmsg(POP_DIALOG_X_START, POP_DIALOG_Y_START,"No Announce",POPMSG_TYPE_OK);
			}
			break;
			
		case KEY_BLUE://删除全部邮件
			if (s_announceGetCount.totalnum > 0)
			{
				delete_data.date_type = DVB_CA_CURTAIN_INFO;
				app_cas_api_delete_all(&delete_data);
                
				s_announceGetCount.date_type = DVB_CA_CURTAIN_INFO;
				app_cas_api_get_count(&s_announceGetCount);

				GUI_SetProperty("win_tr_cas_announce_list_listview", "update_all", NULL);
				sprintf(config, "%d", s_announceGetCount.totalnum);
				GUI_SetProperty("win_tr_cas_announce_list_text_count", "string", (void *)config);
				sprintf(config, "%d", s_announceGetCount.newnum);
				GUI_SetProperty("win_tr_cas_announce_list_text_new_count", "string", (void *)config);
			}
			else
			{
				app_popmsg(POP_DIALOG_X_START, POP_DIALOG_Y_START,"No Announce",POPMSG_TYPE_OK);
			}
			break;
			
		case KEY_MENU:
		case KEY_EXIT:
		case KEY_RECALL:
			GUI_EndDialog("win_tr_cas_announce_list");
			return EVENT_TRANSFER_STOP;
		
		case KEY_OK:
			GUI_GetProperty("win_tr_cas_announce_list_listview","select",(void*)&gMail_sel);
			if ( 0 == s_announceGetCount.totalnum)
			{
				app_popmsg(POP_DIALOG_X_START, POP_DIALOG_Y_START, "No Announce", POPMSG_TYPE_OK);
			}
			else
			{	
				get_data.date_type = DVB_CA_CURTAIN_INFO;
				get_data.pos = gMail_sel; // 行
				get_data.ID = TR_ANNOUNCE_CONTENT_ID;
				if (NULL != app_cas_api_get_data(&get_data))
				{
					s_announceGetCount.date_type = DVB_CA_CURTAIN_INFO;
					app_cas_api_get_count(&s_announceGetCount);
					sprintf(strNewNum, "%d", s_announceGetCount.newnum);
					GUI_SetProperty("win_tr_cas_announce_list_text_new_count", "string", (void *)strNewNum);
					
					GUI_CreateDialog("win_tr_cas_announce_content");
				}
				else
				{
					app_popmsg(POP_DIALOG_X_START, POP_DIALOG_Y_START, "No Announce", POPMSG_TYPE_OK);
				}
			}
//.........这里部分代码省略.........
开发者ID:github188,项目名称:GX3113C_JIMO,代码行数:101,代码来源:win_tr_cas_announce_list.c

示例5: _cbDialog


//.........这里部分代码省略.........
    GUI_SetColor(GUI_STCOLOR_LIGHTBLUE);
    GUI_SetPenSize(5);
    GUI_DrawBitmap(&bmconnect, 7, 45);
    GUI_DrawCircle(332, 215, 40);
    GUI_AA_FillCircle(332, 215, 45);
    
    GUI_AA_FillRoundedRect(230, 182, 440, 250, 20);
    
    GUI_SetColor(GUI_WHITE);
    GUI_AA_FillCircle(332, 215, 42);
    GUI_SetBkColor(GUI_WHITE);
    GUI_AA_FillRoundedRect(233, 185, 437, 247, 20);
    
    GUI_SetColor(GUI_STCOLOR_LIGHTBLUE);
    GUI_AA_FillCircle(332, 215, 33);
    
    break;    

  case WM_NOTIFY_PARENT:
    Id    = WM_GetId(pMsg->hWinSrc);    /* Id of widget */
    NCode = pMsg->Data.v;               /* Notification code */
    
    
    switch(Id) {  
      
    case START_VNC: /* Notifications sent by 'Start' */
      switch(NCode) {
      case WM_NOTIFICATION_RELEASED:
        
        if((VNC_GetState() == VNC_IDLE)||
          (VNC_GetState() == VNC_INIT))
        {
          VNC_SERVER_LogMessage("Starting VNC connection...");
          hItem = WM_GetDialogItem(pMsg->hWin, ID_VNC_CONNECTION);
          IMAGE_SetBitmap(hItem, &bmno_connection);
          
          VNC_SetState (VNC_INIT);
          WM_Exec();
          VNC_SERVER_Start();
        }     
        else
        {
          VNC_SERVER_Stop();
        }
        break;
        
      case WM_NOTIFICATION_CLICKED:
        hItem = WM_GetDialogItem(pMsg->hWin, START_VNC);
        WM_InvalidateWindow(hItem);
        WM_Update(hItem);   
        break;
      }
      break;
    case GO_BACKGROUND: /* Notifications sent by 'Background' */
      switch(NCode) {
      case WM_NOTIFICATION_RELEASED:
        WM_HideWindow(pMsg->hWin);
        module_prop[k_ModuleGetIndex(&vnc_server)].win_state = 1;
        ST_AnimatedIconView_SetItemText(hIcon,k_ModuleGetIndex(&vnc_server),"vnc server[B]");
        ST_AnimatedIconView_SetDualTextColor(hIcon, ICONVIEW_CI_SEL, GUI_STCOLOR_LIGHTBLUE, GUI_STCOLOR_DARKBLUE    ); 
        break;
      }
      break;
      
    case ID_BUTTON_EXIT: 
      switch(NCode) {
      case WM_NOTIFICATION_RELEASED:
        if(VNC_GetState() != VNC_IDLE)
        {
          VNC_SERVER_Stop();
        }
        GUI_EndDialog(pMsg->hWin, 0);
        break;
      }
      break; 
      
    case ID_LOCK: 
      switch(NCode) {
      case WM_NOTIFICATION_RELEASED:
        if(VNC_GetState() == VNC_IDLE)
        {
          if(VNC_GetLockState())
          {
            VNC_SetLockState(0);
          }
          else
          {
            VNC_SetLockState(1);
          }
        }
        break;
      }
      break; 
    }
    break;
  default:
    WM_DefaultProc(pMsg);
    break;
  }      
}
开发者ID:MrZANE42,项目名称:verisure1512,代码行数:101,代码来源:vnc_server_win.c

示例6: _cbDialog


//.........这里部分代码省略.........
          time_start = GUI_GetTime()+ time_start - time_pause ;
          hItem = WM_GetDialogItem(pMsg->hWin, PLAY_BUTTON_VIDEO);
          BUTTON_SetBitmapEx(hItem, 0, &bmButtonPlay, 16, 6);
          BUTTON_SetBitmapEx(hItem, 1, &bmButtonPlayPauseOff,16, 6);
          VideoPlayer_State = VIDEO_PLAY;
        }        
        break;
      }
      break;
    case PREV_BUTTON_VIDEO: /* Notifications sent by 'Button' */
      switch(NCode) {
      case WM_NOTIFICATION_RELEASED:
        if(VideoPlayer_State != VIDEO_IDLE)
        {
          ImageOffset = 0;  
          time_start = GUI_GetTime();
          VideoPlayer_State = VIDEO_PLAY;
          f_close(&Video_File);
          goto_previous_file();
          hItem = WM_GetDialogItem(pMsg->hWin, ID_VIDEO_FILE);
          TEXT_SetText(hItem, (char *)FILEMGR_FileList.file[FILEMGR_FileList.idx].line);   
          hItem = WM_GetDialogItem(pMsg->hWin, PLAY_BUTTON_VIDEO);
          BUTTON_SetBitmapEx(hItem, 0, &bmButtonPlay, 16, 6);
          BUTTON_SetBitmapEx(hItem, 1, &bmButtonPlayPauseOff,6, 6);
        }
        break;
      }
      break;
      
      
    case ID_VIDEO_EXIT:
      switch(NCode) {
      case WM_NOTIFICATION_RELEASED:
        {
          GUI_EndDialog(pMsg->hWin, 0);
        }
        break;        
      }
      break;
      
    case ID_VIDEO_PROGRESS: /* Notifications sent by 'Progress Bar' */
      switch(NCode) {
        
      case WM_NOTIFICATION_CLICKED:
        {
          progress_bar = 1;
          hItem = WM_GetDialogItem(pMsg->hWin, ID_VIDEO_PROGRESS);
          ImageOffset = (Video_File.fsize * SLIDER_GetValue(hItem))/100;
          offset =ImageOffset - Video_File.fptr;
          time_start -= (offset / frame_speed);
          
          
        }
        break;
        
      case WM_NOTIFICATION_RELEASED:
        progress_bar = 0;
        break;
      }
      break;
      
      
    case NEXT_BUTTON_VIDEO: /* Notifications sent by 'Button' */
      switch(NCode) {
      case WM_NOTIFICATION_RELEASED:
        
        if(VideoPlayer_State != VIDEO_IDLE)
        {       
          ImageOffset = 0; 
          VideoPlayer_State = VIDEO_PLAY;          
          time_start = GUI_GetTime();
          f_close(&Video_File);
          goto_next_file();      
          hItem = WM_GetDialogItem(pMsg->hWin, ID_VIDEO_FILE);
          TEXT_SetText(hItem, (char *)FILEMGR_FileList.file[FILEMGR_FileList.idx].line);
          hItem = WM_GetDialogItem(pMsg->hWin, PLAY_BUTTON_VIDEO);
          BUTTON_SetBitmapEx(hItem, 0, &bmButtonPlay, 16, 6);
          BUTTON_SetBitmapEx(hItem, 1, &bmButtonPlayPauseOff,16, 6);   
        }     
        break;
      }
      break;
    case STOP_BUTTON_VIDEO: /* Notifications sent by 'Button' */
      switch(NCode) {
      case WM_NOTIFICATION_RELEASED:
        VideoPlayer_State = VIDEO_IDLE;
        f_close(&Video_File);
        hItem = WM_GetDialogItem(pMsg->hWin, PLAY_BUTTON_VIDEO);
        BUTTON_SetBitmapEx(hItem, 0, &bmButtonPlayPauseOn, 16, 6);
        BUTTON_SetBitmapEx(hItem, 1, &bmButtonPlayPauseOff,16, 6);     
        break;
      }
      break;
    }
    break;
  default:
    WM_DefaultProc(pMsg);
    break;
  }
}
开发者ID:descent,项目名称:STM32f429I-Discovery_Demo,代码行数:101,代码来源:demo_video.c

示例7: _cbDialog


//.........这里部分代码省略.........

        hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_2);
        BUTTON_SetText(hItem, "led3");

        hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_3);
        BUTTON_SetText(hItem, "led4");

        hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_4);
        BUTTON_SetText(hItem, "Cancel");
        break;
      case WM_NOTIFY_PARENT:
        Id    = WM_GetId(pMsg->hWinSrc);
        NCode = pMsg->Data.v;
        switch(Id) {
        case ID_SLIDER_0: // Notifications sent by 'Slider'
            switch(NCode)
            {
                case WM_NOTIFICATION_VALUE_CHANGED:
                    _gFreq = SLIDER_GetValue(WM_GetDialogItem(pMsg->hWin, ID_SLIDER_0));
                break;
            }
            break;
        case ID_RADIO_0:
          switch(NCode) {
          case WM_NOTIFICATION_CLICKED:
            break;
          case WM_NOTIFICATION_RELEASED:
            break;
          case WM_NOTIFICATION_VALUE_CHANGED:
              _gMode = RADIO_GetValue(WM_GetDialogItem(pMsg->hWin, ID_RADIO_0));
              if(_gMode == LED_WATERLAMP)
              {
                  WM_CreateTimer(WM_GetClientWindow(pMsg->hWin), 0, 200, 0);
              }
              
            break;
          }
          break;
          
        case ID_BUTTON_0:
          switch(NCode) {
          case WM_NOTIFICATION_CLICKED:
                if(_gMode == LED_CONTROL)
                {
                    led = 0;
                    rt_device_control(dev_led, RT_DEVICE_CTRL_LED_TOGGLE, &led); 
                }
                break;
          }
          break;

        case ID_BUTTON_1:
          switch(NCode) {
          case WM_NOTIFICATION_CLICKED:
                if(_gMode == LED_CONTROL)
                {
                    led = 1;
                    rt_device_control(dev_led, RT_DEVICE_CTRL_LED_TOGGLE, &led); 
                }
            break;
          }
          break;
        case ID_BUTTON_2:
          switch(NCode) {
          case WM_NOTIFICATION_CLICKED:
                if(_gMode == LED_CONTROL)
                {
                    led = 2;
                    rt_device_control(dev_led, RT_DEVICE_CTRL_LED_TOGGLE, &led); 
                }
            break;
          }
          break;
        case ID_BUTTON_3:
          switch(NCode) {
          case WM_NOTIFICATION_CLICKED:
                if(_gMode == LED_CONTROL)
                {
                    led = 3;
                    rt_device_control(dev_led, RT_DEVICE_CTRL_LED_TOGGLE, &led); 
                }
            break;
          }
          break;
        case ID_BUTTON_4: // Notifications sent by 'Button'
          switch(NCode) {
          case WM_NOTIFICATION_RELEASED:
                    GUI_EndDialog(pMsg->hWin, 0);
            break;

          }
          break;
        }
        break;

  default:
    WM_DefaultProc(pMsg);
    break;
  }
}
开发者ID:guzhaoyuan,项目名称:smartCar,代码行数:101,代码来源:gui_led.c

示例8: _cbCallback

/*********************************************************************
*
*       _cbCallback
*/
static void _cbCallback(WM_MESSAGE * pMsg) {
  int NCode, Id;
  WM_HWIN hDlg, hListBox, hItem;
  hDlg = pMsg->hWin;
  hListBox = WM_GetDialogItem(hDlg, GUI_ID_MULTIEDIT0);
  switch (pMsg->MsgId) {
    case WM_INIT_DIALOG:
      LISTBOX_SetText(hListBox, _ListBox);
      LISTBOX_AddString(hListBox, "Français");
      LISTBOX_AddString(hListBox, "Japanese");
      LISTBOX_AddString(hListBox, "Italiano");
      LISTBOX_AddString(hListBox, "Español");
      LISTBOX_AddString(hListBox, "Greek");
      LISTBOX_AddString(hListBox, "Hebrew");
      LISTBOX_AddString(hListBox, "Dutch");
      LISTBOX_AddString(hListBox, "Other language ...");
      LISTBOX_SetScrollStepH(hListBox, 6);
      LISTBOX_SetAutoScrollH(hListBox, 1);
      LISTBOX_SetAutoScrollV(hListBox, 1);
      LISTBOX_SetOwnerDraw(hListBox, _OwnerDraw);
      hItem  = WM_GetDialogItem(hDlg, GUI_ID_CHECK1);
      CHECKBOX_Check(hItem);
      break;
    case WM_KEY:
      switch (((WM_KEY_INFO*)(pMsg->Data.p))->Key) {
        case GUI_KEY_ESCAPE:
          GUI_EndDialog(hDlg, 1);
          break;
        case GUI_KEY_ENTER:
          GUI_EndDialog(hDlg, 0);
          break;
      }
      break;
    case WM_TOUCH_CHILD:
      WM_SetFocus(hListBox);
      break;
    case WM_NOTIFY_PARENT:
      Id    = WM_GetId(pMsg->hWinSrc);      /* Id of widget */
      NCode = pMsg->Data.v;                 /* Notification code */
      hItem  = WM_GetDialogItem(hDlg, Id);
      switch (NCode) {
        case WM_NOTIFICATION_SEL_CHANGED:
          LISTBOX_InvalidateItem(hListBox, LISTBOX_ALL_ITEMS);
          break;
        case WM_NOTIFICATION_RELEASED:      /* React only if released */
          switch (Id) {
            case GUI_ID_OK:
              GUI_EndDialog(hDlg, 0);
              break;
            case GUI_ID_CANCEL:
              GUI_EndDialog(hDlg, 1);
              break;
            case GUI_ID_CHECK0:
              _MultiSel ^= 1;
              LISTBOX_SetMulti(hListBox, _MultiSel);
              WM_SetFocus(hListBox);
              LISTBOX_InvalidateItem(hListBox, LISTBOX_ALL_ITEMS);
              break;
            case GUI_ID_CHECK1:
              _OwnerDrawn ^= 1;
              if (_OwnerDrawn) {
                LISTBOX_SetOwnerDraw(hListBox, _OwnerDraw);
              } else {
                LISTBOX_SetOwnerDraw(hListBox, NULL);
              }
              LISTBOX_InvalidateItem(hListBox, LISTBOX_ALL_ITEMS);
              break;
          }
          break;
      }
      break;
    default:
      WM_DefaultProc(pMsg);
  }
}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:79,代码来源:WIDGET_ListBoxOwnerDraw.c

示例9: _cbCallback

/*********************************************************************
*
*       _cbCallback
*/
static void _cbCallback(WM_MESSAGE * pMsg) {
  int NCode, Id;
  WM_HWIN hEdit0, hEdit1, hEdit2, hEdit3, hListBox, hDropd0, hDropd1;
  WM_HWIN hWin = pMsg->hWin;
  switch (pMsg->MsgId) {
    case WM_INIT_DIALOG:
      /* Get window handles for all widgets */
      hEdit0   = WM_GetDialogItem(hWin, GUI_ID_EDIT0);
      hEdit1   = WM_GetDialogItem(hWin, GUI_ID_EDIT1);
      hEdit2   = WM_GetDialogItem(hWin, GUI_ID_EDIT2);
      hEdit3   = WM_GetDialogItem(hWin, GUI_ID_EDIT3);
      hListBox = WM_GetDialogItem(hWin, GUI_ID_LISTBOX0);
      hDropd0  = WM_GetDialogItem(hWin, GUI_ID_DROPDOWN0);
      hDropd1  = WM_GetDialogItem(hWin, GUI_ID_DROPDOWN1);
      /* Initialize all widgets */
      EDIT_SetText(hEdit0, "EDIT widget 0");
      EDIT_SetText(hEdit1, "EDIT widget 1");
      EDIT_SetTextAlign(hEdit1, GUI_TA_LEFT);
      EDIT_SetHexMode(hEdit2, 0x1234, 0, 0xffffff);
      EDIT_SetBinMode(hEdit3, 0x1234, 0, 0xffff);
      LISTBOX_SetText(hListBox, _apListBox);
      WM_DisableWindow (WM_GetDialogItem(hWin, GUI_ID_CHECK1));
      CHECKBOX_Check(  WM_GetDialogItem(hWin, GUI_ID_CHECK0));
      CHECKBOX_Check(  WM_GetDialogItem(hWin, GUI_ID_CHECK1));
      SLIDER_SetWidth( WM_GetDialogItem(hWin, GUI_ID_SLIDER0), 5);
      SLIDER_SetValue( WM_GetDialogItem(hWin, GUI_ID_SLIDER1), 50);
      SCROLLBAR_CreateAttached(hListBox, SCROLLBAR_CF_VERTICAL);
      DROPDOWN_AddString(hDropd0, "Item 0");
      DROPDOWN_AddString(hDropd0, "Item 1");
      DROPDOWN_AddString(hDropd0, "Item 2");
      DROPDOWN_AddString(hDropd1, "Item 0");
      DROPDOWN_AddString(hDropd1, "Item 1");
      DROPDOWN_AddString(hDropd1, "Item 2");
      DROPDOWN_AddString(hDropd1, "Item 3");
      DROPDOWN_AddString(hDropd1, "Item 4");
      break;
    case WM_KEY:
      switch (((WM_KEY_INFO*)(pMsg->Data.p))->Key) {
      case GUI_KEY_ESCAPE:
        GUI_EndDialog(hWin, 1);
        break;
      case GUI_KEY_ENTER:
        GUI_EndDialog(hWin, 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(hWin, 0);
          }
          if (Id == GUI_ID_CANCEL) {      /* Cancel Button */
            GUI_EndDialog(hWin, 1);
          }
          break;
      }
      break;
    default:
      WM_DefaultProc(pMsg);
  }
}
开发者ID:huangfeng007,项目名称:ChuangKeUnion-1st,代码行数:68,代码来源:dialog_all.c

示例10: _cbplaybackwin


//.........这里部分代码省略.........
    GUI_DrawHLine(479, 0, 640);
    GUI_DrawLine(639, 0, 639, 480);   
    GUI_DrawLine(0, 0, 0, 480);

    /* Background for total time */
    GUI_SetColor(0x00DCA939);
    GUI_AA_FillRoundedRect((-30), 5, 90, 65, 30);
    
    /*Video Information */
    GUI_AA_FillRoundedRect(150, 5, 500, 65, 30);
    
    /*H/W Information */
    GUI_AA_FillRoundedRect(538, 180, 780, 320, 30);    
    
    break;
    
    
  case WM_NOTIFY_PARENT:
    Id    = WM_GetId(pMsg->hWinSrc);    /* Id of widget */
    NCode = pMsg->Data.v;               /* Notification code */
 
    
    switch(Id) {
      
    case ID_BUTTON_EXIT_FROM_VIDEO: 
      switch(NCode) {
      case WM_NOTIFICATION_RELEASED:

        if(VideoPlayer_State != VIDEO_IDLE)
        {
          _StopPlay(&hvideo, &Video_File);
        }
        
        GUI_EndDialog(pMsg->hWin, 0);
        SelLayer = 0;
        GUI_SetLayerVisEx (1, 0);
        GUI_SelectLayer(0); 
        WM_HideWindow(hFrame);        
        WM_Exec();        
        WM_DeleteWindow(hFrame);
        WM_InvalidateWindow(VideoWin);
        break;
      }
      break;

    case ID_BUTTON_MENU: 
      switch(NCode) {
      case WM_NOTIFICATION_RELEASED:

        if(VideoPlayer_State != VIDEO_IDLE)
        {
          _StopPlay(&hvideo, &Video_File);
        }
        
        GUI_EndDialog(pMsg->hWin, 0);
        SelLayer = 0;
        GUI_SetLayerVisEx (1, 0);
        GUI_SelectLayer(0); 
        WM_DeleteWindow(hFrame);
        WM_HideWindow(VideoWin);        
        WM_Exec();
        WM_DeleteWindow(VideoWin);
        break;
      }
      break;
      
开发者ID:vlsi1217,项目名称:STM32F7Cube,代码行数:66,代码来源:video_player_win.c

示例11: _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(60, 30, 300, 250, pMsg->hWin, WM_CF_SHOW, 0, ID_VIDEO_LIST);

    LISTVIEW_SetFont(hItem, &GUI_Font16_1);
    LISTVIEW_SetTextColor(hItem, LISTVIEW_CI_UNSEL, 0x00DCA939);
    LISTVIEW_SetTextColor(hItem, LISTVIEW_CI_SEL, GUI_WHITE);
    LISTVIEW_SetHeaderHeight(hItem, 0);
    LISTVIEW_AddColumn(hItem, 300, "", 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);
        hItem = WM_GetDialogItem(pMsg->hWin, ID_VIDEO_LIST);
        
        LISTVIEW_AddRow(hItem, NULL);         
        LISTVIEW_SetItemText(hItem, 0, i, (char *)tmp);
      }
    }     
    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); 
        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, 48, 30, 330, 240, apDrives, GUI_COUNTOF(apDrives), 0, "Video files", 0, &FileInfo);
        WM_MakeModal(hItem);
        r = GUI_ExecCreatedDialog(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++;
            }
          }
          WM_InvalidateWindow(pMsg->hWin);
        }
        
        break;
      }
      break;        
      
    }
    break;
  default:
    WM_DefaultProc(pMsg);
    break;
  }
}
开发者ID:vlsi1217,项目名称:STM32F7Cube,代码行数:99,代码来源:video_player_win.c

示例12: _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;

  static uint8_t sel = 0;
  
  switch (pMsg->MsgId) {
  case WM_INIT_DIALOG:

    memset(Video_Path, 0, 256);   
    
    hItem = BUTTON_CreateEx(574, 0, 65, 65, pMsg->hWin, WM_CF_SHOW, 0, ID_BUTTON_EXIT);
    WM_SetCallback(hItem, _cbButton_exit); 
    
    hItem = ST_AnimatedIconView_CreateEx(100, 
                                         70, 
                                         LCD_GetXSize() - 0, 
                                         LCD_GetYSize() - 30, 
                                         pMsg->hWin, 
                                         WM_CF_SHOW | WM_CF_HASTRANS ,
                                         0,
                                         ID_ICONVIEW_SUBMENU, 
                                         200, 
                                         250, 5, 5);    
    
    
    ST_AnimatedIconView_SetDualFont(hItem, GUI_FONT_20_1, GUI_FONT_20_1);
    
    ST_AnimatedIconView_SetSpace(hItem, GUI_COORD_Y, 5);
    ST_AnimatedIconView_SetSpace(hItem, GUI_COORD_X, 25);
    ST_AnimatedIconView_SetFrame(hItem, GUI_COORD_Y, 10);
    ST_AnimatedIconView_SetFrame(hItem, GUI_COORD_X, 5);
    
    ST_AnimatedIconView_SetSel(hItem, -1);
    
    ST_AnimatedIconView_SetTextColor(hItem, ICONVIEW_CI_UNSEL, 0x00DCA939);
    ST_AnimatedIconView_SetBkColor(hItem, ICONVIEW_CI_UNSEL, GUI_WHITE);
    ST_AnimatedIconView_SetBkColor(hItem, ICONVIEW_CI_SEL, GUI_WHITE);
    
    ST_AnimatedIconView_SetDualTextColor(hItem, ICONVIEW_CI_SEL, 0x00DCA939, 0x00522000);  
    
    ST_AnimatedIconView_AddIcon(hItem, open_file, 0, "Play video");   
    ST_AnimatedIconView_AddIcon(hItem, add_video, 0, "Add to playlist");    
    
    break;     

  case WM_PAINT: 
    GUI_SetColor(GUI_BLACK);
    GUI_DrawLine(639, 0, 639, 480);   

    break;
    
  case WM_NOTIFY_PARENT:
    Id    = WM_GetId(pMsg->hWinSrc);    /* Id of widget */
    NCode = pMsg->Data.v;               /* Notification code */   
    
    switch(Id) {
    case ID_BUTTON_EXIT: 
      switch(NCode) {
      case WM_NOTIFICATION_RELEASED:
        GUI_EndDialog(pMsg->hWin, 0);
        break;
      }
      break; 
      
      
    case ID_ICONVIEW_SUBMENU: 
      switch(NCode) {
      case WM_NOTIFICATION_RELEASED:      
        sel = ST_AnimatedIconView_GetSel(pMsg->hWinSrc);
        
        if(sel == 0)
        {

          osDelay(100);  
          /* Playlist not empty, so start play first item */
          if(VideoList.ptr > 0)
          {  
            GUI_SetLayerVisEx (1, 1);
            GUI_SelectLayer(1); 
            playbackwin = WM_CreateWindowAsChild(-1, 0, 640, 480, WM_GetDesktopWindowEx(1), WM_CF_SHOW, _cbplaybackwin , 0);
            WM_CreateWindowAsChild(0, 70, 640, 300, WM_GetDesktopWindowEx(1), WM_CF_SHOW | WM_CF_HASTRANS, _cbTouch , 0);             
            GUI_SelectLayer(0);
            _StartPlay(&hvideo, (char *)VideoList.file[0].name, &Video_File, 0, 0);
            VideoPlayer_State = VIDEO_PLAY;
            hFrame = WM_CreateWindowAsChild(-1, 0, 640, 480,pMsg->hWin, WM_CF_SHOW, _cbVideoWindow , 0);    
            GUI_SelectLayer(1);
            
          }
          else
          {/* There is no item yet in the playlist: Show hint message */
            hItem = GUI_CreateDialogBox(_aFileInfoDialogCreate, 
                                GUI_COUNTOF(_aFileInfoDialogCreate), 
                                _cbFileInfoDialog, 
                                pMsg->hWin, 
//.........这里部分代码省略.........
开发者ID:vlsi1217,项目名称:STM32F7Cube,代码行数:101,代码来源:video_player_win.c

示例13: _cbCallback

/*********************************************************************
*
*       _cbCallback
*/
static void _cbCallback(WM_MESSAGE * pMsg) {
  WM_HWIN hDlg;
  WM_HWIN hItem;
  int     i;
  int     NCode;
  int     Id;

  hDlg = pMsg->hWin;
  switch (pMsg->MsgId) {
    case WM_INIT_DIALOG:
      for (i = 0; i < 3; i++) {
        hItem = WM_GetDialogItem(hDlg, GUI_ID_SLIDER0 + i);
        SLIDER_SetRange(hItem, 0, 100);
        SLIDER_SetValue(hItem, _duty[i]);
        //
        // Init EDIT-widgets
        //
        hItem = WM_GetDialogItem(hDlg, GUI_ID_EDIT0 + i);
        EDIT_SetDecMode(hItem, _duty[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_BUTTON3) {        // Stop Button
        	  AzimuthalMotor.dutyCycle(0);
        	  AzimuthalMotor.start();

        	  VerticalMotor.dutyCycle(0);
        	  VerticalMotor.start();

        	  ClawMotor.dutyCycle(0);
        	  ClawMotor.start();
          }
          if (Id == GUI_ID_BUTTON0) {       // Azimuthal Button
        	  VerticalMotor.dutyCycle(0);
        	  VerticalMotor.start();

        	  ClawMotor.dutyCycle(0);
        	  ClawMotor.start();

        	  AzimuthalMotor.dutyCycle(_duty[0]);
        	  AzimuthalMotor.start();
          }
          if (Id == GUI_ID_BUTTON1) {        // Vertical Button
        	  AzimuthalMotor.dutyCycle(0);
        	  AzimuthalMotor.start();

        	  ClawMotor.dutyCycle(0);
        	  ClawMotor.start();

        	  VerticalMotor.dutyCycle(_duty[1]);
        	  VerticalMotor.start();
          }
          if (Id == GUI_ID_BUTTON2) {        // Claw Button
        	  AzimuthalMotor.dutyCycle(0);
        	  AzimuthalMotor.start();

        	  VerticalMotor.dutyCycle(0);
        	  VerticalMotor.start();

        	  ClawMotor.dutyCycle(_duty[2]);
        	  ClawMotor.start();
          }
          if (Id == GUI_ID_BUTTON4) {        // Forward Button
        	  HAL_GPIO_WritePin(GPIOI, GPIO_PIN_3, GPIO_PIN_RESET);
          }
          if (Id == GUI_ID_BUTTON5) {        // Reverse Button
        	  HAL_GPIO_WritePin(GPIOI, GPIO_PIN_3, GPIO_PIN_SET);
          }
          break;
        case WM_NOTIFICATION_VALUE_CHANGED: // Value has changed
          _OnValueChanged(hDlg, Id);
          break;
      }
      break;
    default:
      WM_DefaultProc(pMsg);
  }
}
开发者ID:smithcts,项目名称:SMART_Rail_System,代码行数:99,代码来源:Slider_Menu_GUI.cpp

示例14: Main_cbCallback

/*********************************************************************
*
*       _cbCallback
*
* Function description
*   Callback function of the dialog
*/
void Main_cbCallback (WM_MESSAGE* pMsg) {
	int NCode, Id;
	WM_HWIN hDlg;
	WM_HWIN hItem;

	hDlg = pMsg->hWin;
	switch (pMsg->MsgId) {
		case WM_INIT_DIALOG:
			OSC_InitDialog(pMsg);
			hItem = WM_GetDialogItem(hDlg, GUI_ID_GRAPH0);
			g_Disp.hItemGraph_OSC = hItem;
			//
			// Set graph attributes
			//
			MemDisp(200, 200);
			GRAPH_SetGridDistY(hItem, 25);
			GRAPH_SetGridVis(hItem, 1);
			GRAPH_SetGridFixedX(hItem, 1);
			GRAPH_SetUserDraw(hItem, Main_UserDraw);
			//
			// Create and add vertical scale
			//
			g_hScaleV = GRAPH_SCALE_Create(SCALE_V_Pos, GUI_TA_RIGHT, GRAPH_SCALE_CF_VERTICAL, 25);
			GRAPH_SCALE_SetTextColor(g_hScaleV, GUI_YELLOW);
			GRAPH_AttachScale(hItem, g_hScaleV);
			//
			// Create and add horizontal scale
			//
			g_hScaleH = GRAPH_SCALE_Create(SCALE_H_Pos, GUI_TA_HCENTER, GRAPH_SCALE_CF_HORIZONTAL, 50);
			GRAPH_SCALE_SetTextColor(g_hScaleH, GUI_DARKGREEN);
			GRAPH_AttachScale(hItem, g_hScaleH);
		case WM_PAINT:
			OSC_PaintDialog(pMsg);
			break;
		case WM_KEY:
			switch (((WM_KEY_INFO*)(pMsg->Data.p))->Key) {
				case GUI_KEY_ESCAPE:
					GUI_EndDialog(hDlg, 1);
					break;
				case GUI_KEY_ENTER:
					GUI_EndDialog(hDlg, 0);
					break;
			}
			break;
		case WM_NOTIFY_PARENT:
			Id = WM_GetId(pMsg->hWinSrc);
			NCode = pMsg->Data.v;
			switch (Id) {
				case GUI_ID_OK:
					if (NCode == WM_NOTIFICATION_RELEASED)
						GUI_EndDialog(hDlg, 0);
					break;
				case GUI_ID_CANCEL:
					if (NCode == WM_NOTIFICATION_RELEASED)
						GUI_EndDialog(hDlg, 0);
					break;
				case __ZoomPlusID: //Zoom+
					if (NCode == WM_NOTIFICATION_RELEASED)
						g_OSCInfo.Time_rat = Safe_Return (g_OSCInfo.Time_rat + 1, eReslt_rat_Begin, eReslt_rat_End) ;
					break;
				case __ZoomSubID: //Zoom-
					if (NCode == WM_NOTIFICATION_RELEASED)
						g_OSCInfo.Time_rat = Safe_Return (g_OSCInfo.Time_rat - 1, eReslt_rat_Begin, eReslt_rat_End) ;
					break;
				case __AmpliPlusID: //Zoom+
					if (NCode == WM_NOTIFICATION_RELEASED)
						g_OSCInfo.Ampli_rat = Safe_Return (g_OSCInfo.Ampli_rat + 1, eReslt_rat_Begin, eReslt_rat_End) ;
					break;
				case __AmpliSubID: //Zoom-
					if (NCode == WM_NOTIFICATION_RELEASED)
						g_OSCInfo.Ampli_rat = Safe_Return (g_OSCInfo.Ampli_rat - 1, eReslt_rat_Begin, eReslt_rat_End) ;
					break;
				case __MeasureID: //Measure
					if (NCode == WM_NOTIFICATION_RELEASED)
						if (g_GUICon.MeasureState == eClose) {//打开Measure
							CloseAllBSPDLG();
							WindowSwitch(g_Disp.BSP_MersureDlg, eOpen);
							g_GUICon.MeasureState = eOpen;
						}
						else {//关闭Measure
							CloseAllBSPDLG();
						}
					break;
				case __NumpadID: //开关Singal控制面板
					if (NCode == WM_NOTIFICATION_RELEASED)
						if (g_GUICon.NumpadState == eClose) {//打开NumPad
							CloseAllBSPDLG();
							WindowSwitch(g_Disp.BSP_NumpadDlg, eOpen);
							g_GUICon.NumpadState = eOpen;
						}
						else {//关闭NumPad
							CloseAllBSPDLG();
						}
//.........这里部分代码省略.........
开发者ID:kashimotoxiang,项目名称:OSC_STM32F407,代码行数:101,代码来源:GUIGraph.c

示例15: _cbKBDlgCallback

/*******************************************************************************************************
 *
 *         函数名称: 
 *
 *         函数功能: 
 *
 *         入口参数: 
 *
 *         出口参数: 无
 *
 *             说明:
 *
 *******************************************************************************************************/
void _cbKBDlgCallback(WM_MESSAGE * pMsg) 
{
    int NCode;
    int id;
    int i;
    ///static  U32 input_num ;
    WM_MESSAGE Msg = {0};
    
    char str_buff[10];
      
    WM_HWIN hWin = pMsg->hWin;
    
    switch (pMsg->MsgId) 
    {
        case WM_CREATE:
            break;
        case WM_PAINT:
            //TextNumPaintDialog(pMsg);
            break;        
        case WM_INIT_DIALOG:
            InitKBDlg(pMsg);
            break;        
        case WM_KEY:
            switch (((WM_KEY_INFO*)(pMsg->Data.p))->Key) 
            {
                case GUI_KEY_ESCAPE:
                    GUI_EndDialog(pMsg->hWin, 1);
                    break;
                case GUI_KEY_ENTER:
                    GUI_EndDialog(pMsg->hWin, 0);
                    break;
            }
            break;
            
         case WM_NOTIFY_PARENT:
            id = WM_GetId(pMsg->hWinSrc); 
            NCode = pMsg->Data.v;        
            switch (NCode) 
            {
				case WM_NOTIFICATION_RELEASED:
                    switch (id)
                    {                
                        case GUI_ID_OK:
                            GUI_EndDialog(hWin, 0);
                  
                            break;
                        case GUI_ID_CANCEL:
                            GUI_EndDialog(hWin, 0);
                            break;
                        case GUI_ID_BUTTON_OK:
                            GUI_EndDialog(hWin, ParentParam);
                            Msg.MsgId   = WM_USER_SFKB_END;
                            Msg.Data.v  = BCD2UINT16(ParentParam);
                            Msg.hWin    = hMain;      
                            Msg.hWinSrc = hWin;

                            WM_SendMessage(hMain, &Msg);
                            break;
                        case GUI_ID_BUTTON_CANCEL:
                            GUI_EndDialog(hWin, -1);
                       
                            break;
                        default:
                            break;
                    }  
                    break;                    
                case WM_NOTIFICATION_CLICKED:
                    switch(id)
                    {  
                        case GUI_ID_BUTTON_CLR:  //清除
                            ParentParam = 0;
                            goto update_edit;
                        case GUI_ID_BUTTON_BK_SPC: //退格
                            ParentParam = ParentParam >> 4;
                            goto update_edit;
                        case GUI_ID_BUTTON_OK:
                            //GUI_EndDialog(hWin, input_num);
                            break;
                        case GUI_ID_BUTTON_CANCEL:
                            //GUI_EndDialog(hWin, -1);
                            break;
                        case GUI_ID_BUTTON_NUM1:
                        case GUI_ID_BUTTON_NUM2:
                        case GUI_ID_BUTTON_NUM3:
                        case GUI_ID_BUTTON_NUM4:
                        case GUI_ID_BUTTON_NUM5:
                        case GUI_ID_BUTTON_NUM6:
//.........这里部分代码省略.........
开发者ID:meterhu,项目名称:stm32F4,代码行数:101,代码来源:SoftKBDlg.c


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