GME  13
ActiveBrowsePropertySheet.cpp
Go to the documentation of this file.
00001 // ActiveBrowsePropertySheet.cpp : implementation file
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "resource.h"
00006 #include "ActiveBrowsePropertySheet.h"
00007 
00008 #ifdef _DEBUG
00009 #undef THIS_FILE
00010 static char BASED_CODE THIS_FILE[] = __FILE__;
00011 #endif
00012 
00014 // CActiveBrowserPropertySheet
00015 
00016 IMPLEMENT_DYNAMIC(CActiveBrowserPropertySheet, CPropertySheet)
00017 
00018 CActiveBrowserPropertySheet::CActiveBrowserPropertySheet(CWnd* pWndParent)
00019          : CPropertySheet(IDS_PROPSHT_CAPTION, pWndParent)
00020 {
00021         // Add all of the property pages here.  Note that
00022         // the order that they appear in here will be
00023         // the order they appear in on screen.  By default,
00024         // the first page of the set is the active one.
00025         // One way to make a different property page the 
00026         // active one is to call SetActivePage().
00027 
00028         AddPage(&m_PageAggregate);
00029         AddPage(&m_PageInheritance);
00030         AddPage(&m_PageMeta);
00031         m_PageAggregate.m_parent = this;
00032         m_PageInheritance.m_parent = this;
00033         m_PageMeta.m_parent = this;
00034 }
00035 
00036 CActiveBrowserPropertySheet::~CActiveBrowserPropertySheet()
00037 {
00038 }
00039 
00040 
00041 BEGIN_MESSAGE_MAP(CActiveBrowserPropertySheet, CPropertySheet)
00042         //{{AFX_MSG_MAP(CActiveBrowserPropertySheet)
00043         ON_WM_SIZE()
00044         //}}AFX_MSG_MAP
00045 END_MESSAGE_MAP()
00046 
00047 
00049 // CActiveBrowserPropertySheet message handlers
00050 
00051 void CActiveBrowserPropertySheet::PostNcDestroy()
00052 {
00053         CPropertySheet::PostNcDestroy();
00054         delete this;
00055 }
00056 
00057 
00058 
00059 void CActiveBrowserPropertySheet::OnSize(UINT nType, int cx, int cy) 
00060 {
00061         if (::IsWindow(m_PageAggregate.GetSafeHwnd()) ||
00062                 ::IsWindow(m_PageInheritance.GetSafeHwnd()) ||
00063                 ::IsWindow(m_PageMeta.GetSafeHwnd()))
00064         {
00065                 CTabCtrl* pTabCtrl=GetTabControl();
00066                 pTabCtrl->MoveWindow(0, 0, cx, cy, TRUE);
00067                 CRect TabRect;
00068                 pTabCtrl->GetWindowRect(&TabRect);
00069 
00070                 if (::IsWindow(m_PageAggregate.GetSafeHwnd()))
00071                         m_PageAggregate.MoveWindow(TabRect.TopLeft().x, TabRect.BottomRight().y, cx, cy, TRUE);
00072                 if (::IsWindow(m_PageInheritance.GetSafeHwnd()))
00073                         m_PageInheritance.MoveWindow(TabRect.TopLeft().x, TabRect.BottomRight().y, cx, cy, TRUE);
00074                 if (::IsWindow(m_PageMeta.GetSafeHwnd()))
00075                         m_PageMeta.MoveWindow(TabRect.TopLeft().x, TabRect.BottomRight().y, cx, cy, TRUE);
00076 
00077                 SetActivePage(GetActiveIndex());
00078         }
00079 }
00080 
00081 
00082 
00083 BOOL CActiveBrowserPropertySheet::PreTranslateMessage(MSG* pMsg) 
00084 {
00085         // TODO: Add your specialized code here and/or call the base class
00086 
00087         return CPropertySheet::PreTranslateMessage(pMsg);
00088 }
00089 
00090 void CActiveBrowserPropertySheet::nextTab( bool pOrder)
00091 {
00092         SetActivePage( ( GetActiveIndex() + ( pOrder? 1:( GetPageCount() -1))) % GetPageCount());
00093 }
00094