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 void OnAbortOperation (WPARAM wp, LPARAM lp)
afx_msg LRESULT OnShowAbort (WPARAM wp, LPARAM lp)
afx_msg LRESULT OnHideAbort (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
CAbortDialog m_wndAbortDiag


Constructor & Destructor Documentation

CMainFrame::CMainFrame   [protected]
 

Definition at line 54 of file MainFrm.cpp.

00055 {
00056         // TODO: add member initialization code here
00057         
00058 }

CMainFrame::~CMainFrame   [virtual]
 

Definition at line 60 of file MainFrm.cpp.

00061 {
00062 }


Member Function Documentation

void CMainFrame::OnAbortOperation WPARAM    wp,
LPARAM    lp
[protected]
 

Definition at line 232 of file MainFrm.cpp.

References m_wndAbortDiag.

00232                                                       {
00233         m_wndAbortDiag.ShowWindow(SW_HIDE);
00234         ((CMy3dvisApp *)AfxGetApp())->Abort();
00235 }

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

Definition at line 196 of file MainFrm.cpp.

References m_wndDlgBar, m_wndVolumeBar, and m_wndVolumeDlg.

00196                                                           {
00197         //hide the toolbox
00198         if (wp == 0) {
00199                 m_wndVolumeBar.ShowWindow(SW_HIDE);
00200                 m_wndDlgBar.ShowWindow(SW_NORMAL);
00201                 
00202                 
00203                 GetMenu()->EnableMenuItem(ID_MENU_VOLUME, MF_GRAYED);
00204 
00205                 m_wndVolumeDlg.ShowWindow(SW_HIDE);
00206         }
00207         //show the toolbox
00208         else if (wp == 1) {
00209                 m_wndDlgBar.ShowWindow(SW_HIDE);
00210                 m_wndVolumeBar.ShowWindow(SW_NORMAL);
00211                 
00212                 
00213                 GetMenu()->EnableMenuItem(ID_MENU_VOLUME, MF_ENABLED);
00214 
00215 
00216                 if (!m_wndVolumeDlg.IsWindowVisible()) {
00217                         if (lp == 1)
00218                                 m_wndVolumeDlg.ShowWindow(SW_NORMAL);
00219                 }
00220                 else
00221                         m_wndVolumeDlg.ShowWindow(SW_HIDE);
00222         }
00223 
00224         RecalcLayout();
00225         DrawMenuBar();
00226         return 0;
00227 }

int CMainFrame::OnCreate LPCREATESTRUCT    lpCreateStruct [protected]
 

Definition at line 65 of file MainFrm.cpp.

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

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

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

Definition at line 244 of file MainFrm.cpp.

References m_wndAbortDiag.

00244                                                     {
00245         m_wndAbortDiag.ShowWindow(SW_HIDE);
00246         UpdateWindow();
00247         return 0;
00248 }

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

Definition at line 162 of file MainFrm.cpp.

References m_wndDlgBar, and m_wndVolumeBar.

00162                                                    {
00163         m_wndDlgBar.ShowWindow(SW_HIDE);
00164         m_wndVolumeBar.ShowWindow(SW_HIDE);
00165         
00166         RecalcLayout();
00167         DrawMenuBar();
00168         return 0;
00169 }

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

Definition at line 184 of file MainFrm.cpp.

References m_wndStatusBar, and CProgStatusBar::OnProgress().

00184                                                    {
00185         m_wndStatusBar.OnProgress(wp); // pass to prog/status bar
00186         return 0;
00187 }

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

Definition at line 190 of file MainFrm.cpp.

References m_wndStatusBar, and CProgStatusBar::OnProgressMinMax().

00190                                                          {
00191         m_wndStatusBar.OnProgressMinMax(wp, lp);
00192         return 0;
00193 }

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

Definition at line 237 of file MainFrm.cpp.

References m_wndAbortDiag.

00237                                                     {
00238         m_wndAbortDiag.ShowWindow(SW_SHOWNORMAL);
00239         UpdateWindow();
00240         return 0;
00241 }

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

Definition at line 172 of file MainFrm.cpp.

References m_wndDlgBar, and m_wndVolumeBar.

00172                                                   {
00173         if (wp == 0)
00174                 m_wndDlgBar.ShowWindow(SW_NORMAL);
00175         else if (wp == 1)
00176                 m_wndVolumeBar.ShowWindow(SW_NORMAL);
00177 
00178         RecalcLayout();
00179         DrawMenuBar();
00180         return 0;
00181 }

BOOL CMainFrame::PreCreateWindow CREATESTRUCT &    cs [virtual]
 

Definition at line 149 of file MainFrm.cpp.

00150 {
00151         if( !CFrameWnd::PreCreateWindow(cs) )
00152                 return FALSE;
00153         // TODO: Modify the Window class or styles here by modifying
00154         //  the CREATESTRUCT cs
00155 
00156         return TRUE;
00157 }


Member Data Documentation

CAbortDialog CMainFrame::m_wndAbortDiag [protected]
 

Definition at line 61 of file MainFrm.h.

Referenced by OnAbortOperation(), OnCreate(), OnHideAbort(), and OnShowAbort().

dialogbar CMainFrame::m_wndDlgBar [protected]
 

Definition at line 57 of file MainFrm.h.

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

CReBar CMainFrame::m_wndReBar [protected]
 

Definition at line 55 of file MainFrm.h.

Referenced by OnCreate().

CProgStatusBar CMainFrame::m_wndStatusBar [protected]
 

Definition at line 53 of file MainFrm.h.

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

CToolBar CMainFrame::m_wndToolBar [protected]
 

Definition at line 54 of file MainFrm.h.

Referenced by OnCreate().

volumebar CMainFrame::m_wndVolumeBar [protected]
 

Definition at line 58 of file MainFrm.h.

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

CVolumeDialog CMainFrame::m_wndVolumeDlg [protected]
 

Definition at line 59 of file MainFrm.h.

Referenced by OnChangeRendering(), and OnCreate().


The documentation for this class was generated from the following files:
Generated on Thu Jan 23 12:32:16 2003 by doxygen1.3-rc2