AnsweredAssumed Answered

eGUI: main screen is not rewritten after return from activated screen

Question asked by robroz on May 14, 2013
Latest reply on May 17, 2013 by robroz

Hi,

 

I must be missing something obvious. I'm coding and trying to use simple window, that will display message and have OK button on it.

I call this child windows with :

D4D_ActivateScreen(&screen_msg, D4D_FALSE);

 

and then call this from child screen when OK button is pressed :

D4D_EscapeScreen();

 

Child window shows up - works ok, but when I click on OK button, main screen doesn't redraw properly so screen looks like freezed and doesn't change at all...

 

If I add title bar and click on close icon it works ok, and main screen show up...

 

I must be doing wrong something obvious and I can't see it. I'm attaching code of child window below.

 

Thanks  in advance,

 

regards,

Bul.

/*!
* \file    screen_text.c
*
* This file simply displays a message
*
*/

#include "lcd.h"
#include "d13_common.h"
#include "D13_GUI_Skin.h"

D4D_EXTERN_SCREEN(screen_main);

D4D_CLR_SCHEME ScreenColorSchemeMsg;

D4D_CHAR  str_message[50]=" ";

// Button object "Ok"
#define SCR_MSG_BTN_SIZEX       BTN_SIZEX
#define SCR_MSG_BTN_SIZEY       BTN_SIZEY

#define SCR_MSG_BTN_POSX        130
#define SCR_MSG_BTN_POSY        180

/*****************************************************************************
*
* Graphic objects callback/events functions declaration
*
*
*****************************************************************************/

//Button Ok OnClick CallBack
static void Screenmsg_OnClickBtnOk(D4D_OBJECT* pThis);

/*****************************************************************************
*
* Graphic object declarations
*
*
*****************************************************************************/
/* Declaration of label */
D4D_DECLARE_STD_LABEL(Screenmsg_lbl_Message_txt, str_message, 160, 110, 50, 50, FONT_ARIAL16_BOLD)

/* Declaration of button */
//D4D_DECLARE_TXT_RBUTTON(Screenmsg_btn_Ok, "Ok", SCR_MSG_BTN_POSX, SCR_MSG_BTN_POSY, SCR_MSG_BTN_SIZEX, SCR_MSG_BTN_SIZEY, BTN_RADIUS, FONT_BERLIN_SANS_FBDEMI12, Screenmsg_OnClickBtnOk)
D4D_DECLARE_RBUTTON(Screenmsg_btn_Ok, "Ok", SCR_MSG_BTN_POSX, SCR_MSG_BTN_POSY, SCR_MSG_BTN_SIZEX, SCR_MSG_BTN_SIZEY, BTN_RADIUS, (D4D_BTN_MSG), NULL, NULL, NULL, FONT_BERLIN_SANS_FBDEMI12, NULL, Screenmsg_OnClickBtnOk,NULL)
//D4D_DECLARE_RBUTTON(Screenset_number_btn_Back, "Nazaj", SCR_set_number_BTN_BACK_POSX, SCR_set_number_BTN_BACK_POSY, SCR_set_number_BTN_SIZEX, SCR_set_number_BTN_SIZEY, BTN_RADIUS, (D4D_BTN_SET_NUMBER), NULL, NULL, NULL, FONT_ARIAL16_BOLD, NULL, Screenset_number_OnClickBtnBack,NULL)


/*****************************************************************************
*
* eGUI/D4D screen declaration
*
*
*****************************************************************************/
/* Declare the screen and all its objects */
D4D_DECLARE_STD_SCREEN_BEGIN(screen_msg, Screenmsg_)
    D4D_DECLARE_SCREEN_OBJECT(Screenmsg_lbl_Message_txt)
    D4D_DECLARE_SCREEN_OBJECT(Screenmsg_btn_Ok)
D4D_DECLARE_SCREEN_END()

/*****************************************************************************
*
* Local variables
*
*
*****************************************************************************/


/*****************************************************************************
*
* Graphic objects callback/events functions declaration
*
*
*****************************************************************************/

//Button Ok OnClick CallBack
static void Screenmsg_OnClickBtnOk(D4D_OBJECT* pThis)
{
  D4D_UNUSED(pThis);

  //Go back to the main screen
  D4D_EscapeScreen();
}


/* called on screen initialization proces */
static void Screenmsg_OnInit()
{
//  D4D_TEXT_PROPERTIES def_txtProperties, right_txtProperties, left_txtProperties;
  D4D_TEXT_PROPERTIES def_txtProperties;
  // Labels text propeties initialization
  def_txtProperties.bits.bAlignHoriz = D4D_TXT_PRTY_ALIGN_H_CENTER;
  D4D_SetTextProperties(&Screenmsg_lbl_Message_txt, def_txtProperties);


    D4D_LabelSetText(&Screenmsg_lbl_Message_txt,str_screen_msg_lbl);

}

/***********************************************************************/
/* called with each screen activation */
static void Screenmsg_OnActivate()
{
  /* Customize the color scheme to make sure text is blue*/
  ScreenColorSchemeMsg = *D4D_GetDefaultScheme();
//  ScreenColorSchemeMsg.fore = D4D_COLOR_BLUE;
  D4D_SetDefaultScheme(&ScreenColorSchemeMsg);  
}

/***********************************************************************/
/* called periodically in each D4D_poll runs */
static void Screenmsg_OnMain()
{
}

/***********************************************************************/
/* called with each screen deactivation */
static void Screenmsg_OnDeactivate()
{

}

/***********************************************************************/
/* called with each internal message for this screen */
static Byte Screenmsg_OnObjectMsg(D4D_MESSAGE* pMsg)
{
    D4D_UNUSED(pMsg);
    return 0;
}

/***********************************************************************/


Outcomes