home *** CD-ROM | disk | FTP | other *** search
- // the implementation of class CMainFrame
- // Copyright (C) 1997 Kazutaka Hirata <khirata@jove.acs.unt.edu>
-
- #include "stdafx.h"
-
- #include "resource.h"
-
- #include "mainfram.h"
-
- IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
-
- BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
- ON_WM_CREATE()
- ON_WM_CLOSE()
- END_MESSAGE_MAP()
-
- BOOL CMainFrame::CreateToolBar(void)
- {
- if(!m_wndToolBar.Create(this)) {
- return FALSE;
- }
- m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
- CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC
- );
- m_wndToolBar.SetWindowText("Main");
- m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
- DockControlBar(&m_wndToolBar);
- return TRUE;
- }
-
- BOOL CMainFrame::CreateStatusBar(void)
- {
- static UINT nIndicators[] = {
- ID_SEPARATOR ,
- ID_INDICATOR_X ,
- ID_INDICATOR_Y ,
- ID_INDICATOR_LAYER ,
- ID_INDICATOR_ZOOM ,
- ID_INDICATOR_GRID ,
- ID_INDICATOR_COMMAND,
- };
- if(!m_wndStatusBar.Create(this)) {
- FALSE;
- }
- m_wndStatusBar.SetIndicators(nIndicators, 7);
- return TRUE;
- }
-
- int CMainFrame::OnCreate(LPCREATESTRUCT lpcs)
- {
- if(CFrameWnd::OnCreate(lpcs) == -1) {
- return -1;
- }
-
- EnableDocking(CBRS_ALIGN_ANY);
-
- if(!CreateToolBar()
- || !CreateStatusBar()) {
- return -1;
- }
-
- LoadBarState("BarSettings");
-
- return 0;
- }
-
- void CMainFrame::OnClose(void)
- {
- SaveBarState("BarSettings");
- CFrameWnd::OnClose();
- }
-