コード例 #1
0
ファイル: win.c プロジェクト: FXRer/STM32F4_DISCOVERY
/*********************************************************************
*
*       _cbDialog
*/
static void _cbDialog(WM_MESSAGE * pMsg) {
  WM_HWIN hItem;
  int     NCode;
  int     Id;
  // USER START (Optionally insert additional variables)
  // USER END

  switch (pMsg->MsgId)
  {
  	  case WM_INIT_DIALOG:
  	  {

//			  hItem = WM_GetDialogItem(pMsg->hWin, ID_FRAMEWIN_0);
////			  FRAMEWIN_SetResizeable(hItem,1);
//			  FRAMEWIN_SetFont(hItem,GUI_FONT_COMIC24B_ASCII);
////			  FRAMEWIN_SetMoveable(hItem,1);
////			  GUI_ExecCreatedDialog(hItem);
  		  hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
  		  BUTTON_SetSkin(hItem,BUTTON_SKIN_FLEX);

  		  hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_1);
  		  BUTTON_SetSkin(hItem,BUTTON_SKIN_FLEX);
			//
			// Initialization of 'Edit'
			//
			hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0);
			EDIT_SetText(hItem, "blabalbalablablaba");
			//
			// Initialization of 'Listwheel'
			//

			hItem = WM_GetDialogItem(pMsg->hWin, ID_LISTWHEEL_0);
			LISTWHEEL_SetLBorder(hItem,10);
			LISTWHEEL_SetFont(hItem,GUI_FONT_COMIC24B_ASCII);
			LISTWHEEL_AddString(hItem, "jeden");
			LISTWHEEL_AddString(hItem, "dwa");
			LISTWHEEL_AddString(hItem, "trzy");
			LISTWHEEL_AddString(hItem, "cztery");
			LISTWHEEL_AddString(hItem, "piec");
			LISTWHEEL_AddString(hItem, "szesc");
			LISTWHEEL_AddString(hItem, "siedem");
			//
			// Initialization of 'Checkbox'
			//
			hItem = WM_GetDialogItem(pMsg->hWin, ID_CHECKBOX_0);
			CHECKBOX_SetText(hItem, "Check");
			//
			// Initialization of 'Checkbox'
			//
			hItem = WM_GetDialogItem(pMsg->hWin, ID_CHECKBOX_1);
			CHECKBOX_SetText(hItem, "Check");
			// USER START (Optionally insert additional code for further widget initialization)
			// USER END
			 hItem=WM_GetDialogItem(pMsg->hWin,ID_PROGBAR_0);
		     PROGBAR_SetMinMax(hItem,0,15);
		     PROGBAR_SetSkin(hItem,PROGBAR_SKIN_FLEX);

    	break;
  	  }
  case WM_NOTIFY_PARENT:
    Id    = WM_GetId(pMsg->hWinSrc);
    NCode = pMsg->Data.v;
    switch(Id) {
    case ID_EDIT_0: // Notifications sent by 'Edit'
      switch(NCode)
      {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
		  WM_DeleteWindow(hBox);
		  hBox = MESSAGEBOX_Create("Keyboard not supported yet!","ERROR", GUI_MESSAGEBOX_CF_MOVEABLE);
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_0: // Notifications sent by 'Button'
      switch(NCode)
      {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      	  case WM_NOTIFICATION_RELEASED:
		  {

			  CreateMojeokno2();
			  hItem=WM_GetDialogItem(pMsg->hWin,ID_PROGBAR_0);
			  PROGBAR_SetValue(hItem,il++);
			break;
		  }

      }
      break;
    case ID_BUTTON_1: // Notifications sent by 'Button'
      switch(NCode)
      {
		  case WM_NOTIFICATION_CLICKED:
		  {

			break;
		  }
		  case WM_NOTIFICATION_RELEASED:
		  {

			  CreateGraph();
//			  WM_DeleteWindow(hBox);
//			  hBox = MESSAGEBOX_Create("Release the BUTTON !","ERROR", GUI_MESSAGEBOX_CF_MOVEABLE);
//			  WM_DeleteWindow(hBox);
			break;

		  }
      }
      break;
    case ID_LISTWHEEL_0: // Notifications sent by 'Listwheel'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_SEL_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_CHECKBOX_0: // Notifications sent by 'Checkbox'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_CHECKBOX_1: // Notifications sent by 'Checkbox'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    // USER START (Optionally insert additional code for further Ids)
    // USER END
    }
    break;
  // USER START (Optionally insert additional message handling)
  // USER END
  default:
    WM_DefaultProc(pMsg);
    break;
  }
}
コード例 #2
0
ファイル: inuse1.c プロジェクト: masuchen/chargingmachine
/*********************************************************************
*
*       _cbDialog
*/
static void _cbDialog(WM_MESSAGE * pMsg)
{
    WM_HWIN hItem;
    int     NCode;
    int     Id;
    // USER START (Optionally insert additional variables)
    // USER END
    GUI_DrawBitmap(&bmlogo,40,10);
#if(Gradient_Rectangle)
    {
        GUI_DrawGradientRoundedH(220,120,580,380,20,REC_color1,REC_color2);
    }
#endif

#if(RoundedFrame)
    GUI_SetColor(GUI_GREEN);
    GUI_DrawRoundedFrame(218,118,582,382,20,3);
#endif

#if(FillRoundedRect)
    GUI_SetColor(RoundedRect);
    GUI_FillRoundedRect(220,120,580,380,20);
#endif

    switch (pMsg->MsgId)
        {
        case WM_INIT_DIALOG:
            //
            // Initialization of 'inuse'
            //


            hItem = pMsg->hWin;
            FRAMEWIN_SetTitleVis(hItem, 0);
            FRAMEWIN_SetClientColor( hItem, framewin_backcolor);
            FRAMEWIN_SetFont(hItem, GUI_FONT_8_1);
            FRAMEWIN_SetText(hItem, "Framewin");
            FRAMEWIN_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
            FRAMEWIN_SetTextColor(hItem, 0x00000000);


            hItem = pMsg->hWin;
            FRAMEWIN_SetTitleVis(hItem, 0);

            hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_1);
            BUTTON_SetFont(hItem, &GUI_Fonthz_song30);
            BUTTON_SetText(hItem, "返回 ");
#if(Button_3Dskin)
            BUTTON_SetSkin(hItem,BUTTON_SKIN_FLEX);
#endif
#if(!Button_3Dskin)
            BUTTON_SetBkColor( hItem,BUTTON_CI_UNPRESSED,Button_unpress_color);
            BUTTON_SetBkColor( hItem,BUTTON_CI_PRESSED,Button_press_color);
#endif

            //
            // Initialization of 'Button'
            //
            hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
            BUTTON_SetFont(hItem, &GUI_Fonthz_song30);
            BUTTON_SetText(hItem, "停止充电 ");
#if(Button_3Dskin)
            BUTTON_SetSkin(hItem,BUTTON_SKIN_FLEX);
#endif
#if(!Button_3Dskin)
            BUTTON_SetBkColor( hItem,BUTTON_CI_UNPRESSED,Button_unpress_color);
            BUTTON_SetBkColor( hItem,BUTTON_CI_PRESSED,Button_press_color);
#endif
            //
            // Initialization of 'Button'
            //
            //
            // Initialization of 'Edit'
            //
            hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0);
            EDIT_EnableBlink( hItem,1 ,0);
            EDIT_SetDecMode(hItem,0,0,99,0,0);
            EDIT_SetFont(hItem, GUI_FONT_32_ASCII);
            EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
            //
            // Initialization of 'Edit'
            //
            hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_1);
            EDIT_EnableBlink( hItem,1 ,0);
            EDIT_SetDecMode(hItem,0,0,99,0,0);
            EDIT_SetFont(hItem, GUI_FONT_32_ASCII);
            EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
            EDIT_SetTextColor(hItem, EDIT_CI_ENABLED, 0x00000000);
            //
            // Initialization of 'Edit'
            //
            hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_2);
            EDIT_EnableBlink( hItem,1 ,0);
            EDIT_SetDecMode(hItem,0,0,99,0,0);
            EDIT_SetFont(hItem, GUI_FONT_32_ASCII);
            EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
            EDIT_SetTextColor(hItem, EDIT_CI_ENABLED, 0x00000000);
            //
            // Initialization of 'Edit'
            //
            hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_3);
            EDIT_EnableBlink( hItem,1 ,0);
            EDIT_SetDecMode(hItem,0,0,9999,0,0);
            EDIT_SetFont(hItem, GUI_FONT_32_ASCII);
            EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
            EDIT_SetTextColor(hItem, EDIT_CI_ENABLED, 0x00000000);
            //
            // Initialization of 'cddianliang'
            //
            hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
            TEXT_SetFont(hItem, &GUI_Fonthz_song24);

            TEXT_SetText(hItem, "使用电量 ");
            TEXT_SetTextAlign(hItem, GUI_TA_RIGHT);
            TEXT_SetTextColor(hItem, 0x00000000);
            //
            // Initialization of 'Text'
            //
            hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_1);
            TEXT_SetFont(hItem, &GUI_Fonthz_song24);

            TEXT_SetText(hItem, "使用时间 ");
            TEXT_SetTextColor(hItem, 0x00000000);
            TEXT_SetTextAlign(hItem, GUI_TA_RIGHT);
            //
            // Initialization of 'Text'
            //
            hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_2);
            TEXT_SetFont(hItem, &GUI_Fonthz_song24);

            TEXT_SetText(hItem, "消费金额 ");
            TEXT_SetTextAlign(hItem, GUI_TA_RIGHT);
            TEXT_SetTextColor(hItem, 0x00000000);
            //
            // Initialization of 'Text'
            //
            hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_3);
            TEXT_SetFont(hItem, &GUI_Fonthz_song24);

            TEXT_SetText(hItem, "账户余额 ");
            TEXT_SetTextAlign(hItem, GUI_TA_RIGHT);
            TEXT_SetTextColor(hItem, 0x00000000);

            hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_4);
            TEXT_SetTextAlign(hItem, GUI_TA_LEFT | GUI_TA_TOP);
            TEXT_SetText(hItem, "安徽绿建科技有限公司 ");
            TEXT_SetTextColor(hItem, 0x00000000);
            TEXT_SetFont(hItem, &GUI_FontSong_60);
            //
            // Initialization of 'Text'
            //
            hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_5);
            TEXT_SetTextAlign(hItem, GUI_TA_LEFT | GUI_TA_TOP);
            TEXT_SetTextColor(hItem, 0x00000000);
            TEXT_SetText(hItem, "ANHUI GREEN BUILDING TECHNOLOGY CO.,LTD.");
            TEXT_SetFont(hItem, GUI_FONT_24_ASCII);
            // USER START (Optionally insert additional code for further widget initialization)
            // USER END
            break;
        case WM_NOTIFY_PARENT:
            Id    = WM_GetId(pMsg->hWinSrc);
            NCode = pMsg->Data.v;
            switch(Id)
                {
                case ID_BUTTON_0: // Notifications sent by 'Button'
                    switch(NCode)
                        {
                        case WM_NOTIFICATION_CLICKED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                        case WM_NOTIFICATION_RELEASED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
//                        op=ensure;
//                        handle_button();
                        
                        GUI_EndDialog( pMsg->hWin,1);
                        Createensure();
                            break;
                            // USER START (Optionally insert additional code for further notification handling)
                            // USER END
                        }
                    break;
                case ID_BUTTON_1: // Notifications sent by 'Button'
                    switch(NCode)
                        {
                        case WM_NOTIFICATION_CLICKED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                        case WM_NOTIFICATION_RELEASED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            GUI_EndDialog( pMsg->hWin,1);
                            Createwindow0();
                            break;
                            // USER START (Optionally insert additional code for further notification handling)
                            // USER END
                        }
                    break;
                case ID_EDIT_0: // Notifications sent by 'Edit'
                    switch(NCode)
                        {
                        case WM_NOTIFICATION_CLICKED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                        case WM_NOTIFICATION_RELEASED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                        case WM_NOTIFICATION_VALUE_CHANGED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                            // USER START (Optionally insert additional code for further notification handling)
                            // USER END
                        }
                    break;
                case ID_EDIT_1: // Notifications sent by 'Edit'
                    switch(NCode)
                        {
                        case WM_NOTIFICATION_CLICKED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                        case WM_NOTIFICATION_RELEASED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                        case WM_NOTIFICATION_VALUE_CHANGED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                            // USER START (Optionally insert additional code for further notification handling)
                            // USER END
                        }
                    break;
                case ID_EDIT_2: // Notifications sent by 'Edit'
                    switch(NCode)
                        {
                        case WM_NOTIFICATION_CLICKED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                        case WM_NOTIFICATION_RELEASED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                        case WM_NOTIFICATION_VALUE_CHANGED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                            // USER START (Optionally insert additional code for further notification handling)
                            // USER END
                        }
                    break;
                case ID_EDIT_3: // Notifications sent by 'Edit'
                    switch(NCode)
                        {
                        case WM_NOTIFICATION_CLICKED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                        case WM_NOTIFICATION_RELEASED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                        case WM_NOTIFICATION_VALUE_CHANGED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                            // USER START (Optionally insert additional code for further notification handling)
                            // USER END
                        }
                    break;
                    // USER START (Optionally insert additional code for further Ids)
                    // USER END
                }
            break;
            // USER START (Optionally insert additional message handling)
            // USER END
        default:
            WM_DefaultProc(pMsg);
            break;
        }
}
コード例 #3
0
/*********************************************************************
*
*       _cbDialog
*/
static void _cbDialog(WM_MESSAGE * pMsg)
{
    WM_HWIN hItem;
    int     NCode;
    int     Id;
    // USER START (Optionally insert additional variables)
    // USER END
    GUI_DrawBitmap(&bmlogo,40,10);
#if(Gradient_Rectangle)
    {
        GUI_DrawGradientRoundedH(220,120,580,380,20,REC_color1,REC_color2);
    }
#endif

#if(RoundedFrame)
    GUI_SetColor(GUI_GREEN);
    GUI_DrawRoundedFrame(218,118,582,382,20,3);
#endif

#if(FillRoundedRect)
    GUI_SetColor(RoundedRect);
    GUI_FillRoundedRect(220,120,580,380,20);
#endif

    switch (pMsg->MsgId)
        {
        case WM_INIT_DIALOG:
            //
            // Initialization of 'ICcard'
            //
            hItem = pMsg->hWin;
            FRAMEWIN_SetTitleVis(hItem, 0);
            FRAMEWIN_SetClientColor( hItem, BACKCOLOR);
            FRAMEWIN_SetFont(hItem, GUI_FONT_8_1);
            FRAMEWIN_SetText(hItem, "Framewin");
            FRAMEWIN_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
            FRAMEWIN_SetTextColor(hItem, 0x00000000);
            //
            // Initialization of 'Button'
            //
//    hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
//    BUTTON_SetFont(hItem, &GUI_Fonthz_song30);
//    BUTTON_SetText(hItem, "返回 ");
//  #if(Button_3Dskin)
//            BUTTON_SetSkin(hItem,BUTTON_SKIN_FLEX);
//#endif
//#if(!Button_3Dskin)
//            BUTTON_SetBkColor( hItem,BUTTON_CI_UNPRESSED,Button_unpress_color);
//            BUTTON_SetBkColor( hItem,BUTTON_CI_PRESSED,Button_press_color);
//#endif
            //
            // Initialization of 'Button'
            //
            hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_1);
            BUTTON_SetFont(hItem, GUI_FONT_13_1);
            BUTTON_SetText(hItem, "exit");
#if(Button_3Dskin)
            BUTTON_SetSkin(hItem,BUTTON_SKIN_FLEX);
#endif
#if(!Button_3Dskin)
            BUTTON_SetBkColor( hItem,BUTTON_CI_UNPRESSED,Button_unpress_color);
            BUTTON_SetBkColor( hItem,BUTTON_CI_PRESSED,Button_press_color);
#endif
            hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
            TEXT_SetTextAlign(hItem, GUI_TA_LEFT | GUI_TA_TOP);
            TEXT_SetText(hItem, "安徽绿建科技有限公司 ");
            TEXT_SetTextColor(hItem, 0x00000000);
            TEXT_SetFont(hItem, &GUI_FontSong_60);
            //
            // Initialization of 'Text'
            //
            hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_1);
            TEXT_SetTextAlign(hItem, GUI_TA_LEFT | GUI_TA_TOP);
            TEXT_SetTextColor(hItem, 0x00000000);
            TEXT_SetText(hItem, "ANHUI GREEN BUILDING TECHNOLOGY CO.,LTD.");
            TEXT_SetFont(hItem, GUI_FONT_24_ASCII);

            //
            // Initialization of 'Text'
            //
            hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_2);
            TEXT_SetFont(hItem, &GUI_Fonthz_song30);
            TEXT_SetWrapMode(hItem,GUI_WRAPMODE_WORD);
            TEXT_SetText(hItem, "非常抱歉无法识别,请重刷 ");
            TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
            TEXT_SetTextColor(hItem, 0x00FFFFFF);
            // USER START (Optionally insert additional code for further widget initialization)
            // USER END
            break;
        case WM_NOTIFY_PARENT:
            Id    = WM_GetId(pMsg->hWinSrc);
            NCode = pMsg->Data.v;
            switch(Id)
                {
                case ID_BUTTON_0: // Notifications sent by 'Button'
                    switch(NCode)
                        {
                        case WM_NOTIFICATION_CLICKED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                        case WM_NOTIFICATION_RELEASED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                            // USER START (Optionally insert additional code for further notification handling)
                            // USER END
                        }
                    break;
                case ID_BUTTON_1: // Notifications sent by 'Button'
                    switch(NCode)
                        {
                        case WM_NOTIFICATION_CLICKED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                        case WM_NOTIFICATION_RELEASED:
                            // USER START (Optionally insert code for reacting on notification message)
                            // USER END
                            break;
                            // USER START (Optionally insert additional code for further notification handling)
                            // USER END
                        }
                    break;
                    // USER START (Optionally insert additional code for further Ids)
                    // USER END
                }
            break;
            // USER START (Optionally insert additional message handling)
            // USER END
        default:
            WM_DefaultProc(pMsg);
            break;
        }
}