Hello,
I have two dialog boxes one larger one which fills the whole screen 800x480 other smaller one which is like a prompt window placed at center of the screen.
Both these dialog boxes have same callback function and i have respective functions to call on paint event received
let us use window1 and window2 for reference.
i maintain the indexes of the windows. when only the window1 is shown then respective onpaint is called and it is drawn ok. i call a function on button release event to create and show window2 on top of window1. Then window 2 is drawn and respective onpaint function is called. the background of the window2 i.e. window1 is not drawn ok.
I have attached an image of the screen. the gray area is the background of window1 and white area is window2.
When window 2 is created an extra white area is drawn as shown which should not be drawn.
The window1 contains normal buttons and images plus knob widget.
code on paint window 1 is
GUI_SetBkColor(BACK_COLOR);
GUI_Clear();
//other drawing operations
The window2 contains texts and buttons
the code in on paint window 2 is
GUI_SetBkColor(BACK_COLOR);
GUI_Clear();
// Rounded corner dialog box. this is used for window2
guiRect_STYP pRect;
GetClientRect(&pRect);
GUI_FillRoundedRect(pRect.x0, pRect.y0, pRect.x1, pRect.y1, ROUNDED_CORNER_RADIUS);
GUI_SetColor(COLOR_6);
// Draw horizontal and vertical line for buttons.
GUI_SetPenShape(GUI_PS_FLAT);
GUI_DrawVLine(VERTICAL_LINE_X_POSITION, VERTICAL_LINE_START_POSITION, VERTICAL_LINE_END_POSITION);
GUI_DrawHLine(HORIZONTAL_LINE_X_POSITION, HORIZONTAL_LINE_START_POSITION, HORIZONTAL_LINE_END_POSITION);
note that the callback function used is same in both cases and only different paint functions are called.
Thanks
Regards,
Anuj
I have two dialog boxes one larger one which fills the whole screen 800x480 other smaller one which is like a prompt window placed at center of the screen.
Both these dialog boxes have same callback function and i have respective functions to call on paint event received
let us use window1 and window2 for reference.
i maintain the indexes of the windows. when only the window1 is shown then respective onpaint is called and it is drawn ok. i call a function on button release event to create and show window2 on top of window1. Then window 2 is drawn and respective onpaint function is called. the background of the window2 i.e. window1 is not drawn ok.
I have attached an image of the screen. the gray area is the background of window1 and white area is window2.
When window 2 is created an extra white area is drawn as shown which should not be drawn.
The window1 contains normal buttons and images plus knob widget.
code on paint window 1 is
GUI_SetBkColor(BACK_COLOR);
GUI_Clear();
//other drawing operations
The window2 contains texts and buttons
the code in on paint window 2 is
GUI_SetBkColor(BACK_COLOR);
GUI_Clear();
// Rounded corner dialog box. this is used for window2
guiRect_STYP pRect;
GetClientRect(&pRect);
GUI_FillRoundedRect(pRect.x0, pRect.y0, pRect.x1, pRect.y1, ROUNDED_CORNER_RADIUS);
GUI_SetColor(COLOR_6);
// Draw horizontal and vertical line for buttons.
GUI_SetPenShape(GUI_PS_FLAT);
GUI_DrawVLine(VERTICAL_LINE_X_POSITION, VERTICAL_LINE_START_POSITION, VERTICAL_LINE_END_POSITION);
GUI_DrawHLine(HORIZONTAL_LINE_X_POSITION, HORIZONTAL_LINE_START_POSITION, HORIZONTAL_LINE_END_POSITION);
note that the callback function used is same in both cases and only different paint functions are called.
Thanks
Regards,
Anuj