Associate
April 22, 2016
Question
stm32f746g-disco and emWin (Does not work create a window)
- April 22, 2016
- 3 replies
- 1427 views
Posted on April 22, 2016 at 12:44
In GUIBuilder.exe do simple box (box + text), call the function CreateWindow - that does not work.
Distorted window background and distorted text labels.
The reason I can not find.
If you have a board stm32f746g-disco it can flash Hex file can be a problem with the card.
Thank you.
Source:
Changed only BASIC_HelloWorld.c
I start with stm32f746g-disco
. For examples in STM32CubeF7 in particular STM32Cube_FW_F7_V1.3.0\Projects\STM32746G-Discovery\Applications\STemWin\ STemWin_HelloWorld. Compiles example in Keil uVision5 (without optimization) - it's OK, HelloWorld displays. Create a button:hButton = BUTTON_Create(0, 0, 100, 50, GUI_ID_OK, WM_CF_SHOW);
BUTTON_SetText(hButton, ''Test'');
GUI_Exec(); It's okay.
In GUIBuilder.exe do simple box (box + text), call the function CreateWindow - that does not work.
Distorted window background and distorted text labels.
The reason I can not find.
If you have a board stm32f746g-disco it can flash Hex file can be a problem with the card.
Thank you.
Source:
Changed only BASIC_HelloWorld.c
#include ''GUI.h''
#include ''DIALOG.h''
WM_HWIN CreateWindow(void);
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* MainTask
*/
void MainTask(void)
{
static BUTTON_Handle hButton;
static WM_HWIN hWin;
/*
// All ok
hButton = BUTTON_Create(0, 0, 100, 50, GUI_ID_OK, WM_CF_SHOW);
BUTTON_SetText(hButton, ''Test'');
*/
/**/
// Don't work
CreateWindow();
/**/
GUI_Exec();
while (1);
}
/*************************** End of file ****************************/
Added only WindowDLG.c
// USER START (Optionally insert additional includes)
// USER END
#include ''DIALOG.h''
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define ID_WINDOW_0 (GUI_ID_USER + 0x00)
#define ID_TEXT_0 (GUI_ID_USER + 0x01)
// USER START (Optionally insert additional defines)
// USER END
/*********************************************************************
*
* Static data
*
**********************************************************************
*/
// USER START (Optionally insert additional static data)
// USER END
/*********************************************************************
*
* _aDialogCreate
*/
static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
{ WINDOW_CreateIndirect, ''Window'', ID_WINDOW_0, 0, 0, 480, 272, 0, 0x0, 0 },
{ TEXT_CreateIndirect, ''Text'', ID_TEXT_0, 100, 100, 80, 20, 0, 0x64, 0 },
// USER START (Optionally insert additional widgets)
// USER END
};
/*********************************************************************
*
* Static code
*
**********************************************************************
*/
// USER START (Optionally insert additional static code)
// USER END
/*********************************************************************
*
* _cbDialog
*/
static void _cbDialog(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
// USER START (Optionally insert additional variables)
// USER END
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
//
// Initialization of 'Window'
//
hItem = pMsg->hWin;
WINDOW_SetBkColor(hItem, 0x00FF0000);
//
// Initialization of 'Text'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
TEXT_SetText(hItem, ''Test'');
TEXT_SetTextColor(hItem, 0x00FFFFFF);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, GUI_FONT_13_1);
// USER START (Optionally insert additional code for further widget initialization)
// USER END
break;
// USER START (Optionally insert additional message handling)
// USER END
default:
WM_DefaultProc(pMsg);
break;
}
}
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* CreateWindow
*/
WM_HWIN CreateWindow(void);
WM_HWIN CreateWindow(void) {
WM_HWIN hWin;
hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
return hWin;
}
// USER START (Optionally insert additional public code)
// USER END
/*************************** End of file ****************************/
The files from:
https://www.dropbox.com/s/7di6rs13ucjlfks/Inc.rar?dl=0
,https://www.dropbox.com/s/kx4cdmukq3zubiv/Src.rar?dl=0
andhttps://www.dropbox.com/s/f42dz0gquxg96vh/MDK-ARM.rar?dl=0
. Hex file:https://www.dropbox.com/s/4vtpvuvzoqmslpf/STM32746G_DISCOVERY_Button.rar?dl=0
- all okhttps://www.dropbox.com/s/ycsg242jm4nsy9h/STM32746G_DISCOVERY_Window.rar?dl=0
- don't work