Guest User

Untitled

a guest
Feb 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1. bool wxTopLevelWindowMSW::Show(bool show)
  2. {
  3. // don't use wxWindow version as we want to call DoShowWindow() ourselves
  4. if ( !wxWindowBase::Show(show) )
  5. return false;
  6.  
  7. int nShowCmd;
  8. if ( show )
  9. {
  10. if ( m_maximizeOnShow )
  11. {
  12. // show and maximize
  13. nShowCmd = SW_MAXIMIZE;
  14.  
  15. // This is necessary, or no window appears
  16. #if defined( __WINCE_STANDARDSDK__) || defined(__SMARTPHONE__)
  17. DoShowWindow(SW_SHOW);
  18. #endif
  19.  
  20. m_maximizeOnShow = false;
  21. }
  22. else // just show
  23. {
  24. // we shouldn't use SW_SHOW which also activates the window for
  25. // tool frames (as they shouldn't steal focus from the main window)
  26. // nor for the currently disabled windows as they would be enabled
  27. // as a side effect
  28. if ( HasFlag(wxFRAME_TOOL_WINDOW) || !IsEnabled() )
  29. nShowCmd = SW_SHOWNA;
  30. else
  31. nShowCmd = SW_SHOW;
  32. }
  33. }
  34. else // hide
  35. {
  36. nShowCmd = SW_HIDE;
  37. }
  38.  
  39. DoShowWindow(nShowCmd);
  40.  
  41. #if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
  42. // Addornments have to be added when the frame is the correct size
  43. wxFrame* frame = wxDynamicCast(this, wxFrame);
  44. if (frame && frame->GetMenuBar())
  45. frame->GetMenuBar()->AddAdornments(GetWindowStyleFlag());
  46. #endif
  47.  
  48. // we only set pending size if we're maximized before being shown, now that
  49. // we're shown we don't need it any more (it is reset in size event handler
  50. // for child windows but we have to do it ourselves for this parent window)
  51. m_pendingSize = wxDefaultSize;
  52.  
  53. return true;
  54. }
  55.  
  56. bool wxTopLevelWindowMSW::ShowNoActivate(bool show)
  57. {
  58. // don't use wxWindow version as we want to call DoShowWindow() ourselves
  59. if ( !wxWindowBase::Show(show) )
  60. return false;
  61.  
  62. int nShowCmd;
  63. if ( show )
  64. {
  65. if ( m_maximizeOnShow )
  66. {
  67. // show and maximize
  68. nShowCmd = SW_MAXIMIZE;
  69.  
  70. // This is necessary, or no window appears
  71. #if defined( __WINCE_STANDARDSDK__) || defined(__SMARTPHONE__)
  72. DoShowWindow(SW_SHOW);
  73. #endif
  74.  
  75. m_maximizeOnShow = false;
  76. }
  77. else // just show
  78. {
  79. nShowCmd = SW_SHOWNA;
  80. }
  81. }
  82. else // hide
  83. {
  84. nShowCmd = SW_HIDE;
  85. }
  86.  
  87. DoShowWindow(nShowCmd);
  88.  
  89. #if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
  90. // Addornments have to be added when the frame is the correct size
  91. wxFrame* frame = wxDynamicCast(this, wxFrame);
  92. if (frame && frame->GetMenuBar())
  93. frame->GetMenuBar()->AddAdornments(GetWindowStyleFlag());
  94. #endif
  95.  
  96. // we only set pending size if we're maximized before being shown, now that
  97. // we're shown we don't need it any more (it is reset in size event handler
  98. // for child windows but we have to do it ourselves for this parent window)
  99. m_pendingSize = wxDefaultSize;
  100.  
  101. return true;
  102. }
Add Comment
Please, Sign In to add comment