diff options
author | Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com> | 2017-10-07 12:02:58 +0200 |
---|---|---|
committer | Andras Mantia <andras@kdab.com> | 2017-10-10 17:25:20 +0000 |
commit | 71ee09416e70babeebf7e831000ebfb3b6f8bfab (patch) | |
tree | 3a57fa504a46c410be13c3fc04526c7a9c24ad5f /src/Authoring/Studio/MainFrm.cpp | |
parent | c9d1de61e52c6bbaed8626eabe9cc1795edf764b (diff) |
MFC cleanup
Change-Id: If9a9f07ba9505712f3007a96c09a8cac42e8b0b7
Task-Id: BOUL-753
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Studio/MainFrm.cpp')
-rw-r--r-- | src/Authoring/Studio/MainFrm.cpp | 117 |
1 files changed, 0 insertions, 117 deletions
diff --git a/src/Authoring/Studio/MainFrm.cpp b/src/Authoring/Studio/MainFrm.cpp index 22abbfd8..5e372b51 100644 --- a/src/Authoring/Studio/MainFrm.cpp +++ b/src/Authoring/Studio/MainFrm.cpp @@ -81,10 +81,6 @@ // Constants const long PLAYBACK_TIMER_TIMEOUT = 10; // 10 milliseconds -#ifdef KDAB_TEMPORARILY_REMOVED -ON_MESSAGE(WM_STUDIO_MESSAGE_ROUTER, OnMsgRouterMsg) -#endif - //============================================================================== /** * Constructor @@ -296,23 +292,6 @@ int CMainFrame::OnCreate() theDialogs->ResetSettings(theMostRecentOpen); } -#ifdef KDAB_TEMPORARILY_REMOVED - - // Change the background color for the menu bar - if (IsMenu(theMenu)) { - MENUINFO theMenuInfo = { 0 }; - theMenuInfo.cbSize = sizeof(MENUINFO); - theMenuInfo.fMask = MIM_BACKGROUND; - - CBrush *theNewBrush = new CBrush(); - CColor theBaseColor(CStudioPreferences::GetMenuBarBaseColor()); - theNewBrush->CreateSolidBrush( - RGB(theBaseColor.GetRed(), theBaseColor.GetGreen(), theBaseColor.GetBlue())); - theMenuInfo.hbrBack = *theNewBrush; // Brush you want to draw - - SetMenuInfo(theMenu, &theMenuInfo); - } -#endif // Create the view manager m_PaletteManager = new CPaletteManager(this); @@ -325,88 +304,6 @@ int CMainFrame::OnCreate() return 0; } -#ifdef KDAB_TEMPORARILY_REMOVED - -// If we want things to look good then on the *first* paint we want to actually -// paint over the background. I don't know why, but if you were to paint -// the entire background on every message you would get some flashing. -void CMainFrame::OnPaint() -{ - static bool needsPaint = true; - if (needsPaint) { - needsPaint = false; - RECT theRect; - ::GetClientRect(GetSafeHwnd(), &theRect); - CBrush theBrush; - ::CColor theColor = CStudioPreferences::GetBaseColor(); - DWORD theColorRef = RGB(theColor.GetRed(), theColor.GetGreen(), theColor.GetBlue()); - theBrush.CreateSolidBrush(theColor); - CPaintDC dc(this); - dc.FillRect(&theRect, &theBrush); - } - CFrameWnd::OnPaint(); -} -//============================================================================== -void CMainFrame::OnInitMenu(CMenu *inMenu) -{ - ReleaseFocus(); - // Emulate a Control ModifierUp on the Sceneview to "unstick" the Alt-Key/Scale Tool - m_SceneView->HandleModifierUp(CHotKeys::KEY_MENU, 0, 0); - CFrameWnd::OnInitMenu(inMenu); -} - -::CString CMainFrame::m_WindowClass; - -::CString CMainFrame::GetWindowClass() -{ - if (m_WindowClass.GetLength() == 0) { - ::CColor theColor = CStudioPreferences::GetBaseColor(); - DWORD theRefColor = RGB(theColor.GetRed(), theColor.GetGreen(), theColor.GetBlue()); - HBRUSH theBrush = ::CreateSolidBrush(theRefColor); - m_WindowClass = AfxRegisterWndClass(0, 0, theBrush, 0); - } - return m_WindowClass; -} - -BOOL CMainFrame::PreCreateWindow(CREATESTRUCT &cs) -{ - if (!CFrameWnd::PreCreateWindow(cs)) - return FALSE; - - // TODO: Modify the Window class or styles here by modifying - cs.lpszClass = GetWindowClass(); - return TRUE; -} - -BOOL CMainFrame::DestroyWindow() -{ - // Save before we destroy anything - SaveLayout(); - - SAFE_DELETE(m_PaletteManager); - - g_StudioApp.GetCore()->GetDispatch()->RemovePresentationChangeListener(this); - g_StudioApp.GetCore()->GetDispatch()->RemoveFileOpenListener(this); - g_StudioApp.GetCore()->GetDispatch()->RemoveClientPlayChangeListener(this); - - SAFE_DELETE(m_RecentItems); - - // In order to help debug why image lists sometimes crash on shutdown - // This will help identify whcih cone is causing the problem - m_ClientToolsImageList.DeleteImageList(); - m_ClientToolsImageListHot.DeleteImageList(); - m_ClientToolsImageListDisabled.DeleteImageList(); - m_PlaybackImageList.DeleteImageList(); - m_PlaybackImageListHot.DeleteImageList(); - m_PlaybackImageListDisabled.DeleteImageList(); - m_EditCameraToolsImageList.DeleteImageList(); - m_EditCameraToolsImageListHot.DeleteImageList(); - m_EditCameraToolsImageListDisabled.DeleteImageList(); - - return CFrameWnd::DestroyWindow(); -} -#endif - //============================================================================== /** * Called when a new presenation is created. We have to wait to associate the @@ -692,20 +589,6 @@ void CMainFrame::OnUpdateEditPaste() } } -#ifdef KDAB_TEMPORARILY_REMOVED -//============================================================================= -/** - * Router for forwarding messages onto the MsgRouter. - * This is used for posting messages between threads. - */ -LRESULT CMainFrame::OnMsgRouterMsg(WPARAM inWParam, LPARAM inLParam) -{ - CMsgRouter::GetInstance()->HandleMessage(inWParam, inLParam); - - return TRUE; -} -#endif - //============================================================================= /** * Called when a tool mode changes from a modifier key |