[GME-commit] GMESRC/GME/GMEActiveBrowser ActiveBrowsePropertySheet.cpp, 1.3, 1.4 ActiveBrowserPropertyFrame.cpp, 1.2, 1.3 ActiveBrowserPropertyPage.cpp, 1.65, 1.66 GMEActiveBrowserCtl.cpp, 1.18, 1.19 ActiveBrowserPropertyFrame.h, 1.1, 1.2 ActiveBrowserPropertyPage.h, 1.22, 1.23 GMEActiveBrowserCtl.h, 1.10, 1.11
Log messages of CVS commits
gme-commit at list.isis.vanderbilt.edu
Mon Jun 2 10:54:07 CDT 2008
Update of /project/gme-repository/GMESRC/GME/GMEActiveBrowser
In directory escher:/tmp/cvs-serv29567
Modified Files:
ActiveBrowsePropertySheet.cpp ActiveBrowserPropertyFrame.cpp
ActiveBrowserPropertyPage.cpp GMEActiveBrowserCtl.cpp
ActiveBrowserPropertyFrame.h ActiveBrowserPropertyPage.h
GMEActiveBrowserCtl.h
Log Message:
ActiveBrowser redraw/resize code bug fixes. One serioous bug caused Eclipse crash:
* CActiveBrowserPropertyFrame's OnSize and OnMoving handler requested
GetWindowRect instead of GetClientRect, and called MoveWindow of m_pModelessPropSheet
with that rect. As a result m_pModelessPropSheet not just resized but moved with arbitrary values
resulting a crazy flicker of 4-5 ofsetted draw in case of every little resize attempt. Finally another
handler code setted the top-left client coordinate back to (0,0), but anyway this caused crash of Eclipse.
* Replaced distinct WM_MOVE and WM_SIZE handlers with just one WIndowPosChanged handler
* Deleted Onmoving handler from CActiveBrowserPropertyFrame
* Optimalization in CActiveBrowserPropertySheet::OnSize code
CVS User: (csaba)
Index: GMEActiveBrowserCtl.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/GMEActiveBrowser/GMEActiveBrowserCtl.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** GMEActiveBrowserCtl.cpp 3 May 2007 19:01:24 -0000 1.18
--- GMEActiveBrowserCtl.cpp 2 Jun 2008 15:54:04 -0000 1.19
***************
*** 25,30 ****
//{{AFX_MSG_MAP(CGMEActiveBrowserCtrl)
ON_WM_CREATE()
- ON_WM_SIZE()
- ON_WM_MOVE()
ON_WM_WINDOWPOSCHANGED()
//}}AFX_MSG_MAP
--- 25,28 ----
***************
*** 116,120 ****
static const DWORD BASED_CODE _dwGMEActiveBrowserOleMisc =
OLEMISC_ACTIVATEWHENVISIBLE |
! OLEMISC_IGNOREACTIVATEWHENVISIBLE |
OLEMISC_SETCLIENTSITEFIRST |
OLEMISC_INSIDEOUT |
--- 114,118 ----
static const DWORD BASED_CODE _dwGMEActiveBrowserOleMisc =
OLEMISC_ACTIVATEWHENVISIBLE |
! OLEMISC_IGNOREACTIVATEWHENVISIBLE | // TODO: this ignores the previous value, why is this needed?
OLEMISC_SETCLIENTSITEFIRST |
OLEMISC_INSIDEOUT |
***************
*** 246,261 ****
void CGMEActiveBrowserCtrl::OnDraw( CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
!
! if(m_pPropFrame)
! {
!
! pdc->FillRect(rcBounds, CBrush::FromHandle((HBRUSH)GetStockObject(WHITE_BRUSH)));
! pdc->TextOut(rcBounds.left+1,rcBounds.top+1,"GME ActiveBrowser");
! m_pPropFrame->MoveWindow(rcBounds,TRUE);
! }
! else
! {
! pdc->FillRect(rcBounds, CBrush::FromHandle((HBRUSH)GetStockObject(WHITE_BRUSH)));
! pdc->TextOut(rcBounds.left+1,rcBounds.top+1,"GME ActiveBrowser");
}
}
--- 244,252 ----
void CGMEActiveBrowserCtrl::OnDraw( CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
! if (m_pPropFrame) {
! m_pPropFrame->MoveWindow(rcBounds, TRUE);
! } else {
! pdc->FillRect(rcBounds, CBrush::FromHandle((HBRUSH) GetStockObject(WHITE_BRUSH)));
! pdc->TextOut(rcBounds.left + 1, rcBounds.top + 1, "GME ActiveBrowser");
}
}
***************
*** 311,316 ****
int CGMEActiveBrowserCtrl::CreateActiveBrowser()
{
! if (m_pPropFrame == NULL)
! {
m_pPropFrame = new CActiveBrowserPropertyFrame;
CRect rect(0, 0, 0, 0);
--- 302,306 ----
int CGMEActiveBrowserCtrl::CreateActiveBrowser()
{
! if (m_pPropFrame == NULL) {
m_pPropFrame = new CActiveBrowserPropertyFrame;
CRect rect(0, 0, 0, 0);
***************
*** 318,324 ****
VERIFY(strTitle.LoadString(IDS_PROPSHT_CAPTION));
! if (!m_pPropFrame->Create(NULL, strTitle,
! WS_CHILD, rect, this))
! {
delete m_pPropFrame;
m_pPropFrame = NULL;
--- 308,312 ----
VERIFY(strTitle.LoadString(IDS_PROPSHT_CAPTION));
! if (!m_pPropFrame->Create(NULL, strTitle, WS_CHILD, rect, this)) {
delete m_pPropFrame;
m_pPropFrame = NULL;
***************
*** 343,361 ****
if (COleControl::OnCreate(lpCreateStruct) == -1)
return -1;
-
-
- return CreateActiveBrowser();
- }
! void CGMEActiveBrowserCtrl::OnSize(UINT nType, int cx, int cy)
! {
! COleControl::OnSize(nType, cx, cy);
!
! m_pPropFrame->MoveWindow(0,0,cx,cy);
}
short CGMEActiveBrowserCtrl::SetCurrentProject(LPUNKNOWN pMgaProject)
{
-
return m_pApp->m_CurrentProject.CreateCurrentProject(pMgaProject);
}
--- 331,340 ----
if (COleControl::OnCreate(lpCreateStruct) == -1)
return -1;
! return CreateActiveBrowser();
}
short CGMEActiveBrowserCtrl::SetCurrentProject(LPUNKNOWN pMgaProject)
{
return m_pApp->m_CurrentProject.CreateCurrentProject(pMgaProject);
}
***************
*** 370,374 ****
{
m_pPropFrame->m_pModelessPropSheet->m_PageAggregate.Refresh();
-
}
--- 349,352 ----
***************
*** 684,704 ****
-
- void CGMEActiveBrowserCtrl::OnMove(int x, int y)
- {
- COleControl::OnMove(x, y);
-
- }
-
void CGMEActiveBrowserCtrl::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
{
-
COleControl::OnWindowPosChanged(lpwndpos);
CRect wndRect;
GetWindowRect(wndRect);
-
- m_pPropFrame->MoveWindow(wndRect,TRUE);
}
--- 662,682 ----
void CGMEActiveBrowserCtrl::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
{
COleControl::OnWindowPosChanged(lpwndpos);
+ TRACE("Control WindowPosChanged: %d %d %d %d\n", lpwndpos->x, lpwndpos->y, lpwndpos->cx, lpwndpos->cy);
+
CRect wndRect;
GetWindowRect(wndRect);
+ TRACE("Control WndRect after: %d %d %d %d\n", wndRect.left, wndRect.top, wndRect.Width(), wndRect.Height());
+
+ CRect clientRect;
+ GetClientRect(clientRect);
+
+ TRACE("Control ClntRect after: %d %d %d %d\n", clientRect.left, clientRect.top, clientRect.Width(), clientRect.Height());
+
+ m_pPropFrame->MoveWindow(clientRect, TRUE);
}
Index: GMEActiveBrowserCtl.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/GMEActiveBrowser/GMEActiveBrowserCtl.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** GMEActiveBrowserCtl.h 3 May 2007 19:01:24 -0000 1.10
--- GMEActiveBrowserCtl.h 2 Jun 2008 15:54:04 -0000 1.11
***************
*** 78,83 ****
//{{AFX_MSG(CGMEActiveBrowserCtrl)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnMove(int x, int y);
afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
//}}AFX_MSG
--- 78,81 ----
Index: ActiveBrowsePropertySheet.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/GMEActiveBrowser/ActiveBrowsePropertySheet.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ActiveBrowsePropertySheet.cpp 6 Dec 2006 22:00:59 -0000 1.3
--- ActiveBrowsePropertySheet.cpp 2 Jun 2008 15:54:04 -0000 1.4
***************
*** 59,96 ****
void CActiveBrowserPropertySheet::OnSize(UINT nType, int cx, int cy)
{
!
!
! if( ::IsWindow(m_PageAggregate.GetSafeHwnd()) )
!
{
CTabCtrl* pTabCtrl=GetTabControl();
! pTabCtrl->MoveWindow(0,0,cx,cy,TRUE);
CRect TabRect;
! pTabCtrl->GetWindowRect(&TabRect);
! m_PageAggregate.MoveWindow(TabRect.TopLeft().x,TabRect.BottomRight().y,cx,cy,TRUE);
! SetActivePage(GetActiveIndex());
! }
- if(::IsWindow(m_PageInheritance.GetSafeHwnd()))
- {
- CTabCtrl* pTabCtrl=GetTabControl();
- pTabCtrl->MoveWindow(0,0,cx,cy,TRUE);
- CRect TabRect;
- pTabCtrl->GetWindowRect(&TabRect);
- m_PageInheritance.MoveWindow(TabRect.TopLeft().x,TabRect.BottomRight().y,cx,cy,TRUE);
SetActivePage(GetActiveIndex());
-
- }
- if(::IsWindow(m_PageMeta.GetSafeHwnd()))
- {
- CTabCtrl* pTabCtrl=GetTabControl();
- pTabCtrl->MoveWindow(0,0,cx,cy,TRUE);
- CRect TabRect;
- pTabCtrl->GetWindowRect(&TabRect);
- m_PageMeta.MoveWindow(TabRect.TopLeft().x,TabRect.BottomRight().y,cx,cy,TRUE);
- SetActivePage(GetActiveIndex());
-
}
-
}
--- 59,80 ----
void CActiveBrowserPropertySheet::OnSize(UINT nType, int cx, int cy)
{
! if (::IsWindow(m_PageAggregate.GetSafeHwnd()) ||
! ::IsWindow(m_PageInheritance.GetSafeHwnd()) ||
! ::IsWindow(m_PageMeta.GetSafeHwnd()))
{
CTabCtrl* pTabCtrl=GetTabControl();
! pTabCtrl->MoveWindow(0, 0, cx, cy, TRUE);
CRect TabRect;
! pTabCtrl->GetWindowRect(&TabRect);
!
! if (::IsWindow(m_PageAggregate.GetSafeHwnd()))
! m_PageAggregate.MoveWindow(TabRect.TopLeft().x, TabRect.BottomRight().y, cx, cy, TRUE);
! if (::IsWindow(m_PageInheritance.GetSafeHwnd()))
! m_PageInheritance.MoveWindow(TabRect.TopLeft().x, TabRect.BottomRight().y, cx, cy, TRUE);
! if (::IsWindow(m_PageMeta.GetSafeHwnd()))
! m_PageMeta.MoveWindow(TabRect.TopLeft().x, TabRect.BottomRight().y, cx, cy, TRUE);
SetActivePage(GetActiveIndex());
}
}
Index: ActiveBrowserPropertyPage.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/GMEActiveBrowser/ActiveBrowserPropertyPage.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** ActiveBrowserPropertyPage.h 4 Feb 2008 21:56:16 -0000 1.22
--- ActiveBrowserPropertyPage.h 2 Jun 2008 15:54:04 -0000 1.23
***************
*** 60,64 ****
// Called on opening the project
void OpenProject();
! void SetFoc();
// Called on closing the project
void CloseProject();
--- 60,64 ----
// Called on opening the project
void OpenProject();
! void SetFocus2();
// Called on closing the project
void CloseProject();
Index: ActiveBrowserPropertyPage.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/GMEActiveBrowser/ActiveBrowserPropertyPage.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** ActiveBrowserPropertyPage.cpp 4 Feb 2008 21:56:15 -0000 1.65
--- ActiveBrowserPropertyPage.cpp 2 Jun 2008 15:54:04 -0000 1.66
***************
*** 771,775 ****
}
! void CAggregatePropertyPage::SetFoc()
{
m_TreeAggregate.SetFocus();
--- 771,775 ----
}
! void CAggregatePropertyPage::SetFocus2()
{
m_TreeAggregate.SetFocus();
Index: ActiveBrowserPropertyFrame.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/GMEActiveBrowser/ActiveBrowserPropertyFrame.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ActiveBrowserPropertyFrame.h 1 Mar 2002 21:52:00 -0000 1.1
--- ActiveBrowserPropertyFrame.h 2 Jun 2008 15:54:04 -0000 1.2
***************
*** 37,42 ****
void OnCloseProject();
! void MoveWindow( LPCRECT lpRect, BOOL bRepaint = TRUE );
! void MoveWindow( int x, int y, int nWidth, int nHeight, BOOL bRepaint = TRUE );
void OnOpenProject();
--- 37,42 ----
void OnCloseProject();
! void MoveWindow(LPCRECT lpRect, BOOL bRepaint = TRUE);
! void MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint = TRUE);
void OnOpenProject();
***************
*** 48,53 ****
afx_msg void OnClose();
afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
! afx_msg void OnSize(UINT nType, int cx, int cy);
! afx_msg void OnMoving(UINT fwSide, LPRECT pRect);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
--- 48,52 ----
afx_msg void OnClose();
afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
! afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
Index: ActiveBrowserPropertyFrame.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/GMEActiveBrowser/ActiveBrowserPropertyFrame.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ActiveBrowserPropertyFrame.cpp 6 Dec 2006 22:00:59 -0000 1.2
--- ActiveBrowserPropertyFrame.cpp 2 Jun 2008 15:54:04 -0000 1.3
***************
*** 31,36 ****
ON_WM_CLOSE()
ON_WM_ACTIVATE()
! ON_WM_SIZE()
! ON_WM_MOVING()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
--- 31,35 ----
ON_WM_CLOSE()
ON_WM_ACTIVATE()
! ON_WM_WINDOWPOSCHANGED()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
***************
*** 110,124 ****
- void CActiveBrowserPropertyFrame::OnSize(UINT nType, int cx, int cy)
- {
-
- //CMiniFrameWnd::OnSize(nType, cx, cy);
- CRect wndRect;
- GetWindowRect(wndRect);
-
- m_pModelessPropSheet->MoveWindow(wndRect,TRUE);
-
- }
-
void CActiveBrowserPropertyFrame::OnOpenProject()
{
--- 109,112 ----
***************
*** 131,135 ****
m_pModelessPropSheet->m_PageInheritance.OpenProject();
m_pModelessPropSheet->m_PageMeta.OpenProject();
! m_pModelessPropSheet->m_PageAggregate.SetFoc();
}
--- 119,123 ----
m_pModelessPropSheet->m_PageInheritance.OpenProject();
m_pModelessPropSheet->m_PageMeta.OpenProject();
! m_pModelessPropSheet->m_PageAggregate.SetFocus2();
}
***************
*** 145,177 ****
! void CActiveBrowserPropertyFrame::OnMoving(UINT fwSide, LPRECT pRect)
{
! CMiniFrameWnd::OnMoving(fwSide, pRect);
!
! CRect wndRect;
! GetWindowRect(wndRect);
!
! m_pModelessPropSheet->MoveWindow(wndRect,TRUE);
!
}
! void CActiveBrowserPropertyFrame::MoveWindow( LPCRECT lpRect, BOOL bRepaint )
{
! CWnd::MoveWindow(lpRect,bRepaint);
! //CRect wndRect;
! //GetWindowRect(wndRect);
!
! m_pModelessPropSheet->MoveWindow(lpRect,TRUE);
!
!
}
! void CActiveBrowserPropertyFrame::MoveWindow( int x, int y, int nWidth, int nHeight, BOOL bRepaint)
{
! CWnd::MoveWindow(x,y,nWidth,nHeight,bRepaint);
!
!
! m_pModelessPropSheet->MoveWindow(0,0,nWidth,nHeight,TRUE);
}
--- 133,158 ----
! void CActiveBrowserPropertyFrame::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
{
! CMiniFrameWnd::OnWindowPosChanged(lpwndpos);
!
! CRect clientRect;
! GetClientRect(clientRect);
!
! m_pModelessPropSheet->MoveWindow(clientRect,TRUE);
}
! void CActiveBrowserPropertyFrame::MoveWindow(LPCRECT lpRect, BOOL bRepaint )
{
! CMiniFrameWnd::MoveWindow(lpRect, bRepaint);
!
! m_pModelessPropSheet->MoveWindow(lpRect, TRUE);
}
! void CActiveBrowserPropertyFrame::MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint)
{
! CMiniFrameWnd::MoveWindow(x, y, nWidth, nHeight, bRepaint);
+ m_pModelessPropSheet->MoveWindow(0, 0, nWidth, nHeight, TRUE);
}
More information about the GME-commit
mailing list