Exemple #1
0
void InitDialog_LimT(WM_MESSAGE * pMsg)
{
	int i;
    WM_HWIN hWin = pMsg->hWin;

    //
    //FRAMEWIN
    //
    FRAMEWIN_AddCloseButton(hWin, FRAMEWIN_BUTTON_RIGHT, 0);
    FRAMEWIN_AddMaxButton(hWin, FRAMEWIN_BUTTON_RIGHT, 1);
    FRAMEWIN_AddMinButton(hWin, FRAMEWIN_BUTTON_RIGHT, 2);

	for(i=GUI_ID_BUTTON_TCOMM;i<GUI_ID_BUTTON_TMAIN+1;i++)
	{

	BUTTON_SetFont(WM_GetDialogItem(hWin,i),&GUI_FontHZ_SongTi_16);
	
	}

	LISTVIEW_SetAutoScrollV(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW_RESULT_T),1);

    LISTVIEW_SetFont(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW_RESULT_T),&GUI_FontHZ_SongTi_16);
	
	LISTVIEW_SetRowHeight(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW_RESULT_T),20);

	// 60 
	LISTVIEW_AddColumn(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW_RESULT_T),20,"O",GUI_TA_VCENTER|GUI_TA_LEFT);
	LISTVIEW_AddColumn(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW_RESULT_T),20,"M",GUI_TA_VCENTER|GUI_TA_LEFT);
	LISTVIEW_AddColumn(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW_RESULT_T),50,"D",GUI_TA_VCENTER|GUI_TA_LEFT);
    LISTVIEW_AddColumn(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW_RESULT_T),50,"V1",GUI_TA_VCENTER|GUI_TA_LEFT);
    LISTVIEW_AddColumn(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW_RESULT_T),50,"V2",GUI_TA_VCENTER|GUI_TA_LEFT);
	LISTVIEW_AddColumn(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW_RESULT_T),50,"Res",GUI_TA_VCENTER|GUI_TA_LEFT);
	LISTVIEW_AddColumn(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW_RESULT_T),2,"---",GUI_TA_VCENTER|GUI_TA_LEFT);
	// LISTBOX_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW0),0,0xffffff);
}
/*********************************************************************
*
*       GUIDEMO_DemoFrameWin
*/
void GUIDEMO_DemoFrameWin(void) {
    FRAMEWIN_Handle hFrame;
    LISTBOX_Handle hListBox;
    int xSize = LCD_GetXSize();
    int ySize = LCD_GetYSize();
    int i, x, y, w, h;
    const GUI_FONT* pFont = &GUI_FontComic18B_1;
    GUI_COLOR DesktopColorOld;
#if GUIDEMO_LARGE
    GUIDEMO_ShowIntro("Frame Window & Listbox", NULL);
#else
    GUIDEMO_ShowIntro("Frame Window\n & Listbox", NULL);
#endif
    DesktopColorOld = GUIDEMO_SetBkColor(GUI_RED);
    DesktopColorOld = WM_SetDesktopColor(DesktopColorOld);      /* Automatically update desktop window */
    x = BORDER;
#if GUIDEMO_LARGE
    y = 75;
#else
    y = BORDER;
#endif
    w = xSize - x - BORDER;
    h = ySize - y - BORDER;
    if (w > 140) {
        w = 140;
    }
    if (h > 120) {
        h = 120;
    }
    hFrame = FRAMEWIN_Create("Select language", NULL, WM_CF_SHOW, x, y, w, h);
    FRAMEWIN_SetActive(hFrame, 1);
    FRAMEWIN_SetMoveable(hFrame, 1);
    FRAMEWIN_AddMaxButton(hFrame, FRAMEWIN_BUTTON_RIGHT, 0);
    FRAMEWIN_AddMinButton(hFrame, FRAMEWIN_BUTTON_RIGHT, 1);
    FRAMEWIN_SetFont(hFrame, &GUI_Font13_ASCII);
    hListBox = LISTBOX_CreateAsChild(_asLang, WM_GetClientWindow(hFrame), 0, 0, 0, 0, WM_CF_SHOW | WM_SF_ANCHOR_LEFT | WM_SF_ANCHOR_TOP | WM_SF_ANCHOR_RIGHT | WM_SF_ANCHOR_BOTTOM);
    WM_SetFocus(hListBox);
    LISTBOX_SetFont(hListBox, pFont);
    GUIDEMO_Wait();
    for (i = 0; (i < 10) && !GUIDEMO_CheckCancel(); i++) {
        LISTBOX_IncSel(hListBox);
        GUIDEMO_Delay(250);
    }
    for (i = 0; (i < 10) && !GUIDEMO_CheckCancel(); i++) {
        LISTBOX_DecSel(hListBox);
        GUIDEMO_Delay(250);
    }
    GUIDEMO_Delay(500);
    LISTBOX_Delete(hListBox);
    FRAMEWIN_Delete(hFrame);
    WM_SetDesktopColor(DesktopColorOld);
}
void InitDialog(WM_MESSAGE * pMsg)
{
    WM_HWIN hWin = pMsg->hWin;

    FRAMEWIN_SetTextAlign(hWin,GUI_TA_VCENTER|GUI_TA_CENTER);
	
    FRAMEWIN_AddCloseButton(hWin, FRAMEWIN_BUTTON_RIGHT, 0);
    FRAMEWIN_AddMaxButton(hWin, FRAMEWIN_BUTTON_RIGHT, 1);
    FRAMEWIN_AddMinButton(hWin, FRAMEWIN_BUTTON_RIGHT, 2);
		FRAMEWIN_SetTitleHeight(hWin,18);
	
		SLIDER_SetRange(WM_GetDialogItem(hWin,GUI_ID_SLIDER0),5,250);
		SLIDER_SetValue(WM_GetDialogItem(hWin,GUI_ID_SLIDER0),200);
	
		EDIT_SetTextAlign(WM_GetDialogItem(hWin,GUI_ID_EDIT0),GUI_TA_VCENTER|GUI_TA_CENTER);
		EDIT_SetTextAlign(WM_GetDialogItem(hWin,GUI_ID_EDIT1),GUI_TA_VCENTER|GUI_TA_CENTER);
		EDIT_SetTextAlign(WM_GetDialogItem(hWin,GUI_ID_EDIT2),GUI_TA_VCENTER|GUI_TA_CENTER);
		EDIT_SetTextAlign(WM_GetDialogItem(hWin,GUI_ID_EDIT3),GUI_TA_VCENTER|GUI_TA_CENTER);
		EDIT_SetTextAlign(WM_GetDialogItem(hWin,GUI_ID_EDIT4),GUI_TA_VCENTER|GUI_TA_CENTER);	

}
Exemple #4
0
/*********************************************************************
*
*       _DemoMultiedit
*/
static void _DemoMultiedit(void) {
  GUI_RECT Rect;
  int WinFlags;
  _hFrame = 1;
  _Overwrite = 0;
  _ReadOnly  = 0;
  _Password  = 0;
  /* Create framewin */
  _ChangeInfoText("Create framewin", SPEED);
  _hFrame = FRAMEWIN_CreateEx(60, 80, 200, 120, WM_HBKWIN, WM_CF_SHOW, 0, 0, "Notepad", 0);
  _hClient = WM_GetClientWindow(_hFrame);
  _pcbFrameWin       = WM_SetCallback(_hFrame,  _cbFrameWin);
  _pcbFrameWinClient = WM_SetCallback(_hClient, _cbFrameWinClient);
  /* Set framewin properties */
  FRAMEWIN_SetMoveable(_hFrame, 1);
  FRAMEWIN_SetActive(_hFrame, 1);
  FRAMEWIN_SetTextAlign(_hFrame, GUI_TA_HCENTER | GUI_TA_VCENTER);
  FRAMEWIN_SetFont(_hFrame, &GUI_Font8x12_ASCII);
  FRAMEWIN_SetTitleHeight(_hFrame, 16);
  /* Add framewin buttons */
  if (_ChangeInfoText("Add framewin buttons", SPEED)) return;
  FRAMEWIN_AddCloseButton(_hFrame, FRAMEWIN_BUTTON_LEFT,  0);
  FRAMEWIN_AddMaxButton(_hFrame, FRAMEWIN_BUTTON_RIGHT, 0);
  FRAMEWIN_AddMinButton(_hFrame, FRAMEWIN_BUTTON_RIGHT, 1);
  WM_InvalidateWindow(_hFrame);
  /* Create buttons */
  if (_ChangeInfoText("Add option buttons", SPEED)) return;
  _hWrapButton = _CreateLButton("None",   0, 36, 16, _hClient, ID_NONEWRAP);
                 _CreateLButton("Word",  37, 36, 16, _hClient, ID_WORDWRAP);
                 _CreateLButton("Char",  74, 36, 16, _hClient, ID_CHARWRAP);
                 _CreateRButton("PSW",   52, 25, 16, _hClient, ID_PASSWORD);
                 _CreateRButton("OVR",   26, 25, 16, _hClient, ID_OVERWRITE);
                 _CreateRButton("R/O",    0, 25, 16, _hClient, ID_READONLY);
  _SetButtonState(_hWrapButton, 1);
  /* Create multiedit */
  if (_ChangeInfoText("using\nMULTIEDIT_CreateEx", SPEED)) return;
  WinFlags = WM_CF_SHOW | WM_CF_ANCHOR_RIGHT | WM_CF_ANCHOR_LEFT | WM_CF_ANCHOR_TOP | WM_CF_ANCHOR_BOTTOM;
  WM_GetClientRectEx(_hClient, &Rect);
  _hMEdit = MULTIEDIT_CreateEx(0, 0, 0, Rect.y1 - 16 + 1, _hClient, WinFlags, MULTIEDIT_CF_INSERT, 0, 0, "");
  _pcbMultiEdit = WM_SetCallback(_hMEdit,  _cbMultiEdit);
  MULTIEDIT_SetAutoScrollH(_hMEdit, 1);
  MULTIEDIT_SetAutoScrollV(_hMEdit, 1);
  WM_SetFocus(_hMEdit);
  if (_ChangeInfoText("using\nMULTIEDIT_SetText", SPEED)) return;
  MULTIEDIT_SetText(_hMEdit, "This sample demonstrates the use of a multiedit widget!");
  if (_ChangeInfoText("using\nMULTIEDIT_SetFont", SPEED)) return;
  MULTIEDIT_SetFont(_hMEdit, &GUI_Font16_1);
  if (_ChangeInfoText("using\nMULTIEDIT_SetTextColor", SPEED)) return;
  MULTIEDIT_SetTextColor(_hMEdit, 0, 0xE00000);
  if (_ChangeInfoText("using\nMULTIEDIT_SetBkColor", SPEED)) return;
  MULTIEDIT_SetBkColor(_hMEdit, 0, 0xD0FFFF);
  if (_ChangeInfoText("using\nMULTIEDIT_SetWrapWord", SPEED)) return;
  MULTIEDIT_SetWrapWord(_hMEdit);
  _SetButtonState(_hWrapButton, 0);
  _hWrapButton = WM_GetDialogItem(_hClient, ID_WORDWRAP);
  _SetButtonState(_hWrapButton, 1);
  if (_ChangeInfoText("using\nMULTIEDIT_SetHBorder", SPEED)) return;
  MULTIEDIT_SetHBorder(_hMEdit, 3);
  if (_ChangeInfoText("using\nMULTIEDIT_SetPrompt", SPEED)) return;
  MULTIEDIT_SetPrompt(_hMEdit, "Type: ");
  if (_ChangeInfoText("Play with multiedit...", SPEED)) return;
  while (_hFrame) {
    GUI_Delay(100);
  }
}
void MeasureData_InitDialog (WM_MESSAGE* pMsg) {
	WM_HWIN hWin = pMsg->hWin;
	//
	//FRAMEWIN
	//
	FRAMEWIN_SetBarColor(hWin, 1, 0xff901e);
	FRAMEWIN_SetClientColor(hWin, 0xc0c0c0);
	FRAMEWIN_SetTextColor(hWin, 0xcc3299);
	FRAMEWIN_SetFont(hWin, &GUI_Font16B_ASCII);
	FRAMEWIN_SetTextAlign(hWin, GUI_TA_VCENTER | GUI_TA_CENTER);
	FRAMEWIN_AddCloseButton(hWin, FRAMEWIN_BUTTON_RIGHT, 0);
	FRAMEWIN_AddMaxButton(hWin, FRAMEWIN_BUTTON_RIGHT, 1);
	FRAMEWIN_AddMinButton(hWin, FRAMEWIN_BUTTON_RIGHT, 2);
	FRAMEWIN_SetTitleHeight(hWin, 16);
	//
	//GUI_ID_TEXT0
	//
	TEXT_SetBkColor(WM_GetDialogItem(hWin, GUI_ID_TEXT0), 0xc0c0c0);
	TEXT_SetTextColor(WM_GetDialogItem(hWin, GUI_ID_TEXT0), 0x228b22);
	TEXT_SetFont(WM_GetDialogItem(hWin, GUI_ID_TEXT0), &GUI_Font24B_ASCII);
	//
	//GUI_ID_TEXT2
	//
	TEXT_SetBkColor(WM_GetDialogItem(hWin, GUI_ID_TEXT2), 0xc0c0c0);
	TEXT_SetTextColor(WM_GetDialogItem(hWin, GUI_ID_TEXT2), 0x4763ff);
	TEXT_SetFont(WM_GetDialogItem(hWin, GUI_ID_TEXT2), &GUI_Font24B_ASCII);
	//
	//GUI_ID_TEXT1
	//
	TEXT_SetBkColor(WM_GetDialogItem(hWin, GUI_ID_TEXT1), 0xc0c0c0);
	TEXT_SetTextColor(WM_GetDialogItem(hWin, GUI_ID_TEXT1), 0xe16941);
	TEXT_SetFont(WM_GetDialogItem(hWin, GUI_ID_TEXT1), &GUI_Font24B_ASCII);
	//
	//GUI_ID_EDIT1
	//
	EDIT_SetFont(WM_GetDialogItem(hWin, GUI_ID_EDIT1), &GUI_Font24B_ASCII);
	EDIT_SetTextAlign(WM_GetDialogItem(hWin, GUI_ID_EDIT1), GUI_TA_VCENTER | GUI_TA_LEFT);
	//
	//GUI_ID_EDIT2
	//
	EDIT_SetFont(WM_GetDialogItem(hWin, GUI_ID_EDIT2), &GUI_Font24B_ASCII);
	EDIT_SetTextAlign(WM_GetDialogItem(hWin, GUI_ID_EDIT2), GUI_TA_VCENTER | GUI_TA_LEFT);
	//
	//GUI_ID_EDIT3
	//
	EDIT_SetFont(WM_GetDialogItem(hWin, GUI_ID_EDIT3), &GUI_Font24B_ASCII);
	EDIT_SetTextAlign(WM_GetDialogItem(hWin, GUI_ID_EDIT3), GUI_TA_VCENTER | GUI_TA_LEFT);
	//
	//GUI_ID_EDIT4
	//
	EDIT_SetTextColor(WM_GetDialogItem(hWin, GUI_ID_EDIT4), 0, 0x228b22);
	EDIT_SetFont(WM_GetDialogItem(hWin, GUI_ID_EDIT4), &GUI_Font24B_ASCII);
	EDIT_SetTextAlign(WM_GetDialogItem(hWin, GUI_ID_EDIT4), GUI_TA_VCENTER | GUI_TA_CENTER);
	//
	//GUI_ID_EDIT5
	//
	EDIT_SetTextColor(WM_GetDialogItem(hWin, GUI_ID_EDIT5), 0, 0xff901e);
	EDIT_SetFont(WM_GetDialogItem(hWin, GUI_ID_EDIT5), &GUI_Font24B_ASCII);
	EDIT_SetTextAlign(WM_GetDialogItem(hWin, GUI_ID_EDIT5), GUI_TA_VCENTER | GUI_TA_CENTER);
	//
	//GUI_ID_EDIT6
	//
	EDIT_SetTextColor(WM_GetDialogItem(hWin, GUI_ID_EDIT6), 0, 0x4763ff);
	EDIT_SetFont(WM_GetDialogItem(hWin, GUI_ID_EDIT6), &GUI_Font24B_ASCII);
	EDIT_SetTextAlign(WM_GetDialogItem(hWin, GUI_ID_EDIT6), GUI_TA_VCENTER | GUI_TA_CENTER);
}