コード例 #1
0
/**
  * @brief  set the GUI profile
  * @param  None.
  * @retval None
  */
void k_SetGuiProfile(void)
{

  settings.d32 = k_BkupRestoreParameter(CALIBRATION_GENERAL_SETTINGS_BKP);

  if(settings.b.disable_flex_skin == 0)
  {
    FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX);
    PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX);
    RADIO_SetDefaultSkin(RADIO_SKIN_FLEX);
    SCROLLBAR_SetDefaultSkin(SCROLLBAR_SKIN_FLEX);
    SLIDER_SetDefaultSkin(SLIDER_SKIN_FLEX);
    SPINBOX_SetDefaultSkin(SPINBOX_SKIN_FLEX);
    BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX);
    DROPDOWN_SetDefaultSkin(DROPDOWN_SKIN_FLEX);

    FRAMEWIN_SetDefaultTextColor(0, GUI_DARKGRAY);
    FRAMEWIN_SetDefaultTextColor(1, GUI_DARKGRAY);
  }
  else
  {
    FRAMEWIN_SetDefaultTextColor(0, GUI_WHITE);
    FRAMEWIN_SetDefaultTextColor(1, GUI_WHITE);
  }

  FRAMEWIN_SetDefaultFont(GUI_FONT_24_ASCII);

  FRAMEWIN_SetDefaultClientColor(GUI_LIGHTGRAY | 0x20F50000);
  FRAMEWIN_SetDefaultTitleHeight(25);

  TREEVIEW_SetDefaultBkColor(TREEVIEW_CI_SEL, GUI_LIGHTGRAY | 0x20E50000);
  TREEVIEW_SetDefaultBkColor(TREEVIEW_CI_UNSEL, GUI_LIGHTGRAY | 0x20E50000);
  TREEVIEW_SetDefaultTextColor(TREEVIEW_CI_SEL, GUI_BLUE);
  TREEVIEW_SetDefaultFont(GUI_FONT_20_ASCII);

  WINDOW_SetDefaultBkColor(GUI_LIGHTGRAY | 0x20E50000);
  MULTIPAGE_SetDefaultBkColor(GUI_LIGHTGRAY | 0x20E50000, 0);
  MULTIPAGE_SetDefaultBkColor(GUI_LIGHTGRAY | 0x20E50000, 1);
  MULTIPAGE_SetDefaultFont(GUI_FONT_20_ASCII);
  CHECKBOX_SetDefaultBkColor(GUI_LIGHTGRAY | 0x20E50000);

  CALENDAR_SetDefaultSize(CALENDAR_SI_HEADER, 40 );
  CALENDAR_SetDefaultSize(CALENDAR_SI_CELL_X, 33 );
  CALENDAR_SetDefaultSize(CALENDAR_SI_CELL_Y, 33 );

  MULTIPAGE_SetDefaultBkColor (GUI_WHITE, 1);

  SPINBOX_SetDefaultButtonSize(25);
  LISTVIEW_SetDefaultGridColor(GUI_WHITE);
  SCROLLBAR_SetDefaultWidth(16);

  HEADER_SetDefaultBkColor(0x00C5903E);
  HEADER_SetDefaultTextColor(GUI_WHITE);
  SCROLLBAR_SetDefaultColor(GUI_LIGHTGRAY | 0x20F50000, SCROLLBAR_CI_THUMB);
  SCROLLBAR_SetDefaultColor(GUI_LIGHTGRAY | 0x20F50000, SCROLLBAR_CI_SHAFT);
  SCROLLBAR_SetDefaultColor(GUI_LIGHTGRAY | 0x20F50000, SCROLLBAR_CI_ARROW);
  CHOOSEFILE_SetDelim('/');
  GUI_SetDefaultFont(GUI_FONT_13_ASCII);
}
コード例 #2
0
/**
  * @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; 
    }
    break;
    
  default:
    WM_DefaultProc(pMsg);
    break;
  }
}