| 1036 | CMainFrame::~CMainFrame() {} |
| 1037 | |
| 1038 | int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { |
| 1039 | if (CFrameWnd::OnCreate(lpCreateStruct) == -1) |
| 1040 | return -1; |
| 1041 | |
| 1042 | // Initializes the ddgr system and prepares for gr. |
| 1043 | if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) { |
| 1044 | TRACE0("Failed to create toolbar\n"); |
| 1045 | return -1; // fail to create |
| 1046 | } |
| 1047 | |
| 1048 | if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators) / sizeof(UINT))) { |
| 1049 | TRACE0("Failed to create status bar\n"); |
| 1050 | return -1; // fail to create |
| 1051 | } |
| 1052 | |
| 1053 | // Add keypad dialog bar to the right side of the app. |
| 1054 | if (!m_wndKeypadBar.Create(this, IDD_KEYPAD_DLGBAR, CBRS_RIGHT, IDC_DLGBAR_KEYPAD)) { |
| 1055 | TRACE0("Failed to create status bar\n"); |
| 1056 | return -1; // fail to create |
| 1057 | } |
| 1058 | |
| 1059 | // TODO: Remove this if you don't want tool tips or a resizeable toolbar |
| 1060 | m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); |
| 1061 | |
| 1062 | // TODO: Delete these three lines if you don't want the toolbar to |
| 1063 | // be dockable |
| 1064 | |
| 1065 | m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); |
| 1066 | EnableDocking(CBRS_ALIGN_ANY); |
| 1067 | DockControlBar(&m_wndToolBar, AFX_IDW_DOCKBAR_RIGHT); |
| 1068 | |
| 1069 | InitKeypadDialog(); |
| 1070 | DockKeypad(TRUE); // dock if tiled |
| 1071 | |
| 1072 | theApp.main_frame = MFC_Main_frame = this; |
| 1073 | |
| 1074 | return 0; |
| 1075 | } |
| 1076 | |
| 1077 | BOOL CMainFrame::PreCreateWindow(CREATESTRUCT &cs) { |
| 1078 | // TODO: Modify the Window class or styles here by modifying |