one Background icture for differen menu's/windows

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • one Background icture for differen menu's/windows

    Hello,
    I have to use the same background picture for differen menus and windows on my screen.
    At the moment I have to draw it in the on paint section for each window, dialog,...
    My idea is to draw it only one after startup and all new window and dialog has a transparency and will have automtic the background from the main window.
    But at the moment every time I draw a new window the background from the main window will be overwritten.
    I have tried several different flags but no one helped

    Is there a possibility to draw a backgroudn picture that will be shown/used for all new window and dialogs?

    regards
    markus
  • Hello Adrian,

    I have tried it in the following way:

    C Source Code

    1. static const GUI_WIDGET_CREATE_INFO _aBatInfoCreate [ ] = {
    2. { WINDOW_CreateIndirect, "", ID_WINDOW_0, 0, 0, 320, 240, WM_CF_SHOW | WM_CF_HASTRANS },
    3. { TEXT_CreateIndirect, "", ID_TEXT_0, 0, 0, 320, 35, TEXT_CF_HCENTER | TEXT_CF_VCENTER },
    4. { TEXT_CreateIndirect, "", ID_TEXT_1, 10, 35, 320, 160, 0, 0, 0 },
    5. };
    6. //==========================================================================
    7. static void _cbBatInfo ( WM_MESSAGE * pMsg )
    8. {
    9. WM_HWIN hItem;
    10. int Id, NCode, Sel;
    11. char HelpString [ 50 ] = "";
    12. char TempString [ 0xFF ] = "";
    13. switch ( pMsg->MsgId )
    14. {
    15. case WM_NOTIFY_PARENT :
    16. NCode = pMsg->Data.v;
    17. Id = WM_GetId ( pMsg->hWinSrc );
    18. if ( Id == ID_ICONVIEW_0 )
    19. {
    20. switch ( NCode )
    21. {
    22. case WM_NOTIFICATION_RELEASED :
    23. Sel = ICONVIEW_GetSel ( pMsg->hWinSrc );
    24. if ( Sel == 0 )
    25. {
    26. ...
    27. }
    28. break;
    29. }
    30. }
    31. break;
    32. default :
    33. WM_DefaultProc ( pMsg );
    34. break;
    35. }
    36. }
    37. static void _cbBatInfo2 ( WM_MESSAGE * pMsg )
    38. {
    39. switch ( pMsg->MsgId )
    40. {
    41. case WM_PAINT :
    42. GUI_DrawBitmap ( &bmBackground, 0, 0 );
    43. break;
    44. default :
    45. WM_DefaultProc ( pMsg );
    46. break;
    47. }
    48. }
    49. //==========================================================================
    50. void CreateBatInfoWindow ( void )
    51. {
    52. WM_HWIN hWin, hIconView, hDialog;
    53. hWin = WM_CreateWindowAsChild ( 0, 0, 320, 240, WM_HBKWIN, WM_CF_SHOW, &_cbBatInfo2, 0 );
    54. hDialog = GUI_CreateDialogBox ( _aBatInfoCreate, GUI_COUNTOF(_aBatInfoCreate), &_cbBatInfo, hWin, 0, 0 );
    55. .....
    56. }
    Display All

    I run then CreateBatInfoWindow () and then I have the Dialog on the display but without the background picture of the parent window

    Do you see any error or wrong used flags in this code? Is there a example that you could provide me?

    regards
    markus