Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

CMainFrame Class Reference

#include <MainFrm.h>

List of all members.

Public Methods

virtual BOOL PreCreateWindow (CREATESTRUCT &cs)
virtual ~CMainFrame ()

Protected Methods

 CMainFrame ()
afx_msg LRESULT OnProgress (WPARAM wp, LPARAM lp)
afx_msg LRESULT OnProgressMinMax (WPARAM wp, LPARAM lp)
afx_msg LRESULT OnChangeRendering (WPARAM wp, LPARAM lp)
afx_msg LRESULT OnHideBars (WPARAM wp, LPARAM lp)
afx_msg LRESULT OnShowBar (WPARAM wp, LPARAM lp)
afx_msg int OnCreate (LPCREATESTRUCT lpCreateStruct)

Protected Attributes

CProgStatusBar m_wndStatusBar
CToolBar m_wndToolBar
CReBar m_wndReBar
dialogbar m_wndDlgBar
volumebar m_wndVolumeBar
CVolumeDialog m_wndVolumeDlg


Constructor & Destructor Documentation

CMainFrame::CMainFrame   [protected]
 

Definition at line 49 of file MainFrm.cpp.

00050 {
00051         // TODO: add member initialization code here
00052         
00053 }

CMainFrame::~CMainFrame   [virtual]
 

Definition at line 55 of file MainFrm.cpp.

00056 {
00057 }


Member Function Documentation

LRESULT CMainFrame::OnChangeRendering WPARAM    wp,
LPARAM    lp
[protected]
 

Definition at line 183 of file MainFrm.cpp.

References m_wndDlgBar, m_wndVolumeBar, and m_wndVolumeDlg.

00183                                                           {
00184         //hide the toolbox
00185         if (wp == 0) {
00186                 m_wndVolumeBar.ShowWindow(SW_HIDE);
00187                 m_wndDlgBar.ShowWindow(SW_NORMAL);
00188                 
00189                 
00190                 GetMenu()->EnableMenuItem(ID_MENU_VOLUME, MF_GRAYED);
00191 
00192                 m_wndVolumeDlg.ShowWindow(SW_HIDE);
00193         }
00194         //show the toolbox
00195         else if (wp == 1) {
00196                 m_wndDlgBar.ShowWindow(SW_HIDE);
00197                 m_wndVolumeBar.ShowWindow(SW_NORMAL);
00198                 
00199                 
00200                 GetMenu()->EnableMenuItem(ID_MENU_VOLUME, MF_ENABLED);
00201 
00202 
00203                 if (!m_wndVolumeDlg.IsWindowVisible()) {
00204                         if (lp == 1)
00205                                 m_wndVolumeDlg.ShowWindow(SW_NORMAL);
00206                 }
00207                 else
00208                         m_wndVolumeDlg.ShowWindow(SW_HIDE);
00209         }
00210 
00211         RecalcLayout();
00212         DrawMenuBar();
00213         return 0;
00214 }

int CMainFrame::OnCreate LPCREATESTRUCT    lpCreateStruct [protected]
 

Definition at line 60 of file MainFrm.cpp.

References m_wndDlgBar, m_wndReBar, m_wndStatusBar, m_wndToolBar, m_wndVolumeBar, and m_wndVolumeDlg.

00061 {
00062         if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
00063                 return -1;
00064         
00065         if (!m_wndToolBar.CreateEx(this) ||
00066                 !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
00067         {
00068                 TRACE0("Failed to create toolbar\n");
00069                 return -1;      // fail to create
00070         }
00071 
00072 
00073         if (!m_wndDlgBar.Create(this, IDR_MAINFRAME, 
00074                 CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR))
00075         {
00076                 TRACE0("Failed to create dialogbar\n");
00077                 return -1;              // fail to create
00078         }
00079 
00080         if (!m_wndVolumeBar.Create(this, IDR_VOLUMEFRAME,
00081                 CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR)) {
00082                 TRACE0("Failed to create volumebar\n");
00083                 return -1;
00084         }
00085 
00086 
00087         if (!m_wndReBar.Create(this) ||
00088                 !m_wndReBar.AddBar(&m_wndToolBar, NULL, NULL, RBBS_BREAK | RBBS_GRIPPERALWAYS) ||
00089                 !m_wndReBar.AddBar(&m_wndDlgBar, NULL, NULL, RBBS_NOGRIPPER) ||
00090                 !m_wndReBar.AddBar(&m_wndVolumeBar, NULL, NULL, RBBS_NOGRIPPER))
00091         {
00092                 TRACE0("Failed to create rebar\n");
00093                 return -1;      // fail to create
00094         }
00095 
00096 
00097         if (!m_wndStatusBar.Create(this) ||
00098                 !m_wndStatusBar.SetIndicators(indicators,
00099                   sizeof(indicators)/sizeof(UINT)))
00100         {
00101                 TRACE0("Failed to create status bar\n");
00102                 return -1;      // fail to create
00103         }
00104 
00105 
00106         m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
00107                 CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00108 
00109         
00110 
00111         if (!m_wndVolumeDlg.Create(IDD_VOLUME_DIALOG, this)) {
00112                 TRACE0("Failed to create VolumeDialog!");
00113                 return -1;
00114         }
00115 
00116         m_wndDlgBar.ShowWindow(SW_HIDE);
00117         m_wndVolumeBar.ShowWindow(SW_HIDE);
00118 
00119 
00120         CMenu *optionsMenu = GetMenu()->GetSubMenu(1);
00121         optionsMenu->AppendMenu(MF_SEPARATOR);
00122 
00123         string name = "preset_";
00124         
00125 
00126         for (int i = 0; i < ((CMy3dvisApp *)AfxGetApp())->m_dNumPresets; i++) {
00127                 name[6] = i + '0';
00128                 optionsMenu->AppendMenu(MF_STRING, ID_PRESET_0 + i, name.c_str());
00129         }
00130 
00131         return 0;
00132 }

LRESULT CMainFrame::OnHideBars WPARAM    wp,
LPARAM    lp
[protected]
 

Definition at line 149 of file MainFrm.cpp.

References m_wndDlgBar, and m_wndVolumeBar.

00149                                                    {
00150         m_wndDlgBar.ShowWindow(SW_HIDE);
00151         m_wndVolumeBar.ShowWindow(SW_HIDE);
00152         
00153         RecalcLayout();
00154         DrawMenuBar();
00155         return 0;
00156 }

LRESULT CMainFrame::OnProgress WPARAM    wp,
LPARAM    lp
[protected]
 

Definition at line 171 of file MainFrm.cpp.

References m_wndStatusBar, and CProgStatusBar::OnProgress().

00171                                                    {
00172         m_wndStatusBar.OnProgress(wp); // pass to prog/status bar
00173         return 0;
00174 }

LRESULT CMainFrame::OnProgressMinMax WPARAM    wp,
LPARAM    lp
[protected]
 

Definition at line 177 of file MainFrm.cpp.

References m_wndStatusBar, and CProgStatusBar::OnProgressMinMax().

00177                                                          {
00178         m_wndStatusBar.OnProgressMinMax(wp, lp);
00179         return 0;
00180 }

LRESULT CMainFrame::OnShowBar WPARAM    wp,
LPARAM    lp
[protected]
 

Definition at line 159 of file MainFrm.cpp.

References m_wndDlgBar, and m_wndVolumeBar.

00159                                                   {
00160         if (wp == 0)
00161                 m_wndDlgBar.ShowWindow(SW_NORMAL);
00162         else if (wp == 1)
00163                 m_wndVolumeBar.ShowWindow(SW_NORMAL);
00164 
00165         RecalcLayout();
00166         DrawMenuBar();
00167         return 0;
00168 }

BOOL CMainFrame::PreCreateWindow CREATESTRUCT &    cs [virtual]
 

Definition at line 136 of file MainFrm.cpp.

00137 {
00138         if( !CFrameWnd::PreCreateWindow(cs) )
00139                 return FALSE;
00140         // TODO: Modify the Window class or styles here by modifying
00141         //  the CREATESTRUCT cs
00142 
00143         return TRUE;
00144 }


Member Data Documentation

dialogbar CMainFrame::m_wndDlgBar [protected]
 

Definition at line 56 of file MainFrm.h.

Referenced by OnChangeRendering(), OnCreate(), OnHideBars(), and OnShowBar().

CReBar CMainFrame::m_wndReBar [protected]
 

Definition at line 54 of file MainFrm.h.

Referenced by OnCreate().

CProgStatusBar CMainFrame::m_wndStatusBar [protected]
 

Definition at line 52 of file MainFrm.h.

Referenced by OnCreate(), OnProgress(), and OnProgressMinMax().

CToolBar CMainFrame::m_wndToolBar [protected]
 

Definition at line 53 of file MainFrm.h.

Referenced by OnCreate().

volumebar CMainFrame::m_wndVolumeBar [protected]
 

Definition at line 57 of file MainFrm.h.

Referenced by OnChangeRendering(), OnCreate(), OnHideBars(), and OnShowBar().

CVolumeDialog CMainFrame::m_wndVolumeDlg [protected]
 

Definition at line 58 of file MainFrm.h.

Referenced by OnChangeRendering(), and OnCreate().


The documentation for this class was generated from the following files:
Generated on Thu Jan 30 21:35:44 2003 for 3DVis by doxygen1.3-rc2