From: <sag...@us...> - 2014-07-05 16:55:57
|
Revision: 4184 http://sourceforge.net/p/modplug/code/4184 Author: saga-games Date: 2014-07-05 16:55:51 +0000 (Sat, 05 Jul 2014) Log Message: ----------- [Fix] CenterWindow still didn't work as intended. Simply implement our own version... Modified Paths: -------------- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp trunk/OpenMPT/mptrack/PatternEditorDialogs.h trunk/OpenMPT/mptrack/View_pat.cpp Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2014-07-03 21:56:48 UTC (rev 4183) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2014-07-05 16:55:51 UTC (rev 4184) @@ -652,8 +652,8 @@ } -bool CEditCommand::ShowEditWindow(PATTERNINDEX pat, const PatternCursor &cursor) -//------------------------------------------------------------------------------ +bool CEditCommand::ShowEditWindow(PATTERNINDEX pat, const PatternCursor &cursor, CWnd *parent) +//-------------------------------------------------------------------------------------------- { editPos.pattern = pat; const ROWINDEX row = editPos.row = cursor.GetRow(); @@ -702,10 +702,13 @@ _stprintf(s, _T("Note Properties - Row %d, Channel %d"), row, chn + 1); SetWindowText(s); - SetParent(CMainFrame::GetMainFrame()); - // Note: Centering against a child window seems to be buggy. - CenterWindow(CMainFrame::GetMainFrame()); - + CRect rectParent, rectWnd; + parent->GetWindowRect(&rectParent); + GetClientRect(&rectWnd); + SetWindowPos(CMainFrame::GetMainFrame(), + rectParent.left + (rectParent.Width() - rectWnd.right) / 2, + rectParent.top + (rectParent.Height() - rectWnd.bottom) / 2, + -1, -1, SWP_NOSIZE | SWP_NOACTIVATE); ShowWindow(SW_RESTORE); return true; } Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.h =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2014-07-03 21:56:48 UTC (rev 4183) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2014-07-05 16:55:51 UTC (rev 4184) @@ -134,7 +134,7 @@ CEditCommand(CSoundFile &sndFile); public: - bool ShowEditWindow(PATTERNINDEX pat, const PatternCursor &cursor); + bool ShowEditWindow(PATTERNINDEX pat, const PatternCursor &cursor, CWnd *parent); protected: void InitAll() { InitNote(); InitVolume(); InitEffect(); } Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2014-07-03 21:56:48 UTC (rev 4183) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2014-07-05 16:55:51 UTC (rev 4184) @@ -643,7 +643,7 @@ } if (m_pEditWnd) { - m_pEditWnd->ShowEditWindow(m_nPattern, m_Cursor); + m_pEditWnd->ShowEditWindow(m_nPattern, m_Cursor, this); return true; } return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |