BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { // OnCommand responds to menu and and toolbar input UNREFERENCED_PARAMETER(lParam); switch(LOWORD(wParam)) { case IDM_FILE_EXIT: OnFileExit(); return TRUE; case IDM_MODERN: ChooseColor(IDM_MODERN); return TRUE; case IDM_BLUE: ChooseColor(IDM_BLUE); return TRUE; case IDM_GREY: ChooseColor(IDM_GREY); return TRUE; case IDM_OLIVE: ChooseColor(IDM_OLIVE); return TRUE; case IDM_OCHRE: ChooseColor(IDM_OCHRE); return TRUE; case IDM_MAUVE: ChooseColor(IDM_MAUVE); return TRUE; case IDM_PINK: ChooseColor(IDM_PINK); return TRUE; case IDM_GOLD: ChooseColor(IDM_GOLD); return TRUE; case IDM_BLACK: ChooseColor(IDM_BLACK); return TRUE; case IDM_USE_THEMES: OnUseThemes(); return TRUE; case IDM_BAND_COLORS: OnBandColors(); return TRUE; case IDM_FLAT_STYLE: OnFlatStyle(); return TRUE; case IDM_LEFT_BANDS: OnLeftBands(); return TRUE; case IDM_LOCK_MENUBAR: OnLockMenuBar(); return TRUE; case IDM_ROUND_BORDERS: OnRoundBorders(); return TRUE; case IDM_SHORT_BANDS: OnShortBands(); return TRUE; case IDM_USE_LINES: OnUseLines(); return TRUE; case IDM_VIEW_ARROWS: OnViewArrows(); return TRUE; case IDM_VIEW_CARDS: OnViewCards(); return TRUE; case IDW_VIEW_STATUSBAR: OnViewStatusBar(); return TRUE; case IDW_VIEW_TOOLBAR: OnViewToolBar(); return TRUE; case IDM_HELP_ABOUT: OnHelp(); return TRUE; } return FALSE; }
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { // Process the messages from the Menu and Tool Bar UNREFERENCED_PARAMETER(lParam); switch (LOWORD(wParam)) { case IDM_FILE_NEW: OnFileNew(); return TRUE; case IDM_FILE_OPEN: OnFileOpen(); return TRUE; case IDM_FILE_SAVE: OnFileSave(); return TRUE; case IDM_FILE_SAVEAS: OnFileSaveAs(); return TRUE; case IDM_FILE_PRINT: OnFilePrint(); return TRUE; case IDM_PEN_COLOR: OnPenColor(); return TRUE; case IDM_FILE_EXIT: OnFileExit(); return TRUE; case IDW_FILE_MRU_FILE1: case IDW_FILE_MRU_FILE2: case IDW_FILE_MRU_FILE3: case IDW_FILE_MRU_FILE4: case IDW_FILE_MRU_FILE5: OnFileMRU(wParam); return TRUE; case IDW_VIEW_STATUSBAR: return OnViewStatusBar(); case IDW_VIEW_TOOLBAR: return OnViewToolBar(); case IDM_HELP_ABOUT: return OnHelp(); } return FALSE; }
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); // OnCommand responds to menu and and toolbar input switch(LOWORD(wParam)) { case IDM_FILE_EXIT: // Issue a close request to the frame PostMessage(WM_CLOSE); return TRUE; case IDM_DOCK_DEFAULT: SetRedraw(FALSE); CloseAllDockers(); LoadDefaultDockers(); SetRedraw(TRUE); RedrawWindow(0, 0, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ALLCHILDREN); return TRUE; case IDM_DOCK_CLOSEALL: CloseAllDockers(); return TRUE; case IDW_VIEW_STATUSBAR: OnViewStatusBar(); return TRUE; case IDW_VIEW_TOOLBAR: OnViewToolBar(); return TRUE; case IDM_HELP_ABOUT: // Display the help dialog OnHelp(); return TRUE; } return FALSE; }
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); // OnCommand responds to menu and and toolbar input switch(LOWORD(wParam)) { case IDM_FILE_EXIT: OnFileExit(); return TRUE; case IDM_DOCK_DEFAULT: OnDockDefault(); return TRUE; case IDM_DOCK_CLOSEALL: OnDockCloseAll(); return TRUE; case IDM_PROP_RESIZE: OnPropResize(); return TRUE; case IDM_3DBORDER: On3DBorder(); return TRUE; case IDM_NO_UNDOCK: OnNoUndocking(); return TRUE; case IDM_NO_RESIZE: OnNoResize(); return TRUE; case IDM_NO_DOCK_LR: OnNoDockLR(); return TRUE; case IDM_NO_DOCK_CLOSE: OnNoDockClose(); return TRUE; case IDM_DYNAMIC_RESIZE: OnDynamicResize(); return TRUE; case IDW_VIEW_STATUSBAR: OnViewStatusBar(); return TRUE; case IDW_VIEW_TOOLBAR: OnViewToolBar(); return TRUE; case IDM_HELP_ABOUT: OnHelp(); return TRUE; } return FALSE; }
BOOL CMainMDIFrame::OnCommand(WPARAM wParam, LPARAM lParam) { switch (LOWORD(wParam)) { case IDM_FILE_NEW: return OnFileNew(); case IDM_FILE_CLOSE: return OnFileClose(); case IDM_FILE_OPEN: return OnFileOpen(); case IDM_FILE_SAVE: return OnFileSave(); case IDM_FILE_SAVEAS: return OnFileSave(); case IDM_FILE_PRINT: return OnFilePrint(); case IDW_VIEW_STATUSBAR: return OnViewStatusBar(); case IDW_VIEW_TOOLBAR: return OnViewToolBar(); case IDW_MDI_ARRANGE: return OnMDIIconArrange(); case IDW_MDI_CASCADE: return OnMDICascade(); case IDW_MDI_CLOSEALL: return OnMDICloseAll(); case IDW_MDI_TILE: return OnMDITile(); case IDM_FILE_EXIT: return OnFileExit(); case IDM_HELP_ABOUT: return OnHelp(); default: // Pass to active child... { if (GetActiveMDIChild()) GetActiveMDIChild()->SendMessage(WM_COMMAND, wParam, lParam); } break ; } return FALSE; }
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch(LOWORD(wParam)) { case IDM_FILE_EXIT: return OnFileExit(); case IDM_VIEW_TEXT: return OnViewText(); case IDM_VIEW_LIST: return OnViewList(); case IDW_VIEW_STATUSBAR: return OnViewStatusBar(); case IDW_VIEW_TOOLBAR: return OnViewToolBar(); case IDM_HELP_ABOUT: return OnHelp(); } return FALSE; }
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { // OnCommand responds to menu and and toolbar input UNREFERENCED_PARAMETER(lParam); switch (LOWORD(wParam)) { case IDM_FILE_OPEN: // Refer to the tutorial for an example of OnFileOpen OnFileOpen(); return TRUE; case IDM_FILE_SAVE: // Refer to the tutorial for an example of OnFileSave OnFileSave(); return TRUE; case IDM_FILE_SAVEAS: // Refer to the tutorial for an example of OnFileSaveAs OnFileSave(); return TRUE; case IDM_FILE_PRINT: OnFilePrint(); return TRUE; case IDM_FILE_EXIT: // End the application ::PostMessage(m_hWnd, WM_CLOSE, 0, 0); return TRUE; case IDW_VIEW_STATUSBAR: OnViewStatusBar(); return TRUE; case IDW_VIEW_TOOLBAR: OnViewToolBar(); return TRUE; case IDM_HELP_ABOUT: // Display the help dialog OnHelp(); return TRUE; } return FALSE; }
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { // OnCommand responds to menu and and toolbar input UNREFERENCED_PARAMETER(lParam); switch(LOWORD(wParam)) { case IDM_FILE_EXIT: OnFileExit(); return TRUE; case IDM_MODELESS: OnModeless(); return TRUE; case IDM_MODAL: OnModal(); return TRUE; case IDM_WIZARD: OnWizard(); return TRUE; case IDW_VIEW_STATUSBAR: OnViewStatusBar(); return TRUE; case IDW_VIEW_TOOLBAR: OnViewToolBar(); return TRUE; case IDM_HELP_ABOUT: OnHelp(); return TRUE; } return FALSE; }
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { // OnCommand responds to menu and and toolbar input UNREFERENCED_PARAMETER(lParam); switch(LOWORD(wParam)) { case IDM_FILE_OPEN: return OnFileOpen(); case IDM_FILE_SAVE: return OnFileSave(); case IDM_FILE_SAVEAS: return OnFileSave(); case IDM_FILE_PRINT: return OnFilePrint(); case IDM_FILE_EXIT: return OnFileExit(); case IDW_VIEW_STATUSBAR: return OnViewStatusBar(); case IDW_VIEW_TOOLBAR: return OnViewToolBar(); case IDM_HELP_ABOUT: return OnHelp(); } return FALSE; }
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch (LOWORD(wParam)) { case IDM_FILE_EXIT: return OnFileExit(); case IDM_HELP_ABOUT: return OnHelp(); case IDW_VIEW_STATUSBAR: return OnViewStatusBar(); case IDW_VIEW_TOOLBAR: return OnViewToolBar(); case IDM_VIEW_LARGEICON: return OnViewLargeIcon(); case IDM_VIEW_SMALLICON: return OnViewSmallIcon(); case IDM_VIEW_LIST: return OnViewList(); case IDM_VIEW_REPORT: return OnViewReport(); case IDM_SHOW_HIDDEN: return OnShowHidden(); case IDM_VIEWMENU: return OnViewMenu(); } return FALSE; } // CMainFrame::OnCommand(...)
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); WORD wpLo = LOWORD(wParam); switch(LOWORD(wParam)) { case ID_CHECK_A: m_SdiView.OnCheckA(); return TRUE; case ID_CHECK_B: m_SdiView.OnCheckB(); return TRUE; case ID_CHECK_C: m_SdiView.OnCheckC(); return TRUE; case IDM_FILE_EXIT: OnFileExit(); return TRUE; case IDW_VIEW_STATUSBAR: OnViewStatusBar(); return TRUE; case IDW_VIEW_TOOLBAR: OnViewToolBar(); return TRUE; case IDM_HELP_ABOUT: OnHelp(); return TRUE; case ID_RADIO_A: case ID_RADIO_B: // intentionally blank case ID_RADIO_C: m_SdiView.OnRangeOfIds_Radio(wpLo - ID_RADIO_A); return TRUE; } return FALSE; }
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { // Process the messages from the (non-ribbon) Menu and Tool Bar UNREFERENCED_PARAMETER(lParam); switch (LOWORD(wParam)) { case IDM_FILE_NEW: OnFileNew(); return TRUE; case IDM_FILE_OPEN: OnFileOpen(); return TRUE; case IDM_FILE_SAVE: OnFileSave(); return TRUE; case IDM_FILE_SAVEAS: OnFileSaveAs(); return TRUE; case IDM_FILE_PRINT: OnFilePrint(); return TRUE; case IDM_FILE_EXIT: OnFileExit(); return TRUE; case IDW_FILE_MRU_FILE1: case IDW_FILE_MRU_FILE2: case IDW_FILE_MRU_FILE3: case IDW_FILE_MRU_FILE4: case IDW_FILE_MRU_FILE5: { UINT uMRUEntry = LOWORD(wParam) - IDW_FILE_MRU_FILE1; MRUFileOpen(uMRUEntry); return TRUE; } case IDM_PEN_RED: SetPenColor(RGB(255, 0, 0)); return TRUE; case IDM_PEN_BLUE: SetPenColor(RGB(0, 0, 255)); return TRUE; case IDM_PEN_GREEN: SetPenColor(RGB(0, 196, 0)); return TRUE; case IDM_PEN_BLACK: SetPenColor(RGB(0, 0, 0)); return TRUE; case IDW_VIEW_STATUSBAR: return OnViewStatusBar(); case IDW_VIEW_TOOLBAR: return OnViewToolBar(); case IDM_HELP_ABOUT: return OnHelp(); } return FALSE; }
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { // OnCommand responds to menu and and toolbar input UNREFERENCED_PARAMETER(lParam); switch(LOWORD(wParam)) { case IDM_FILE_OPEN: OnFileOpen(); return TRUE; case IDM_FILE_SAVE: OnFileSave(); return TRUE; case IDM_FILE_SAVEAS: OnFileSave(); return TRUE; case IDM_FILE_PRINT: OnFilePrint(); return TRUE; case IDM_FILE_EXIT: OnFileExit(); return TRUE; case IDW_VIEW_STATUSBAR: OnViewStatusBar(); return TRUE; case IDW_VIEW_TOOLBAR: OnViewToolBar(); return TRUE; case IDM_TOOLBAR_CUSTOMIZE: OnTBCustomize(); return TRUE; case IDM_TOOLBAR_DEFAULT: OnTBDefault(); return TRUE; case IDM_TOOLBAR_BIGICONS: OnTBBigIcons(); return TRUE; case IDM_HELP_ABOUT: OnHelp(); return TRUE; } return FALSE; }
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); // Process the messages from the Menu and Tool Bar switch (LOWORD(wParam)) { case IDM_FILE_NEW: OnFileNew(); return TRUE; case IDM_FILE_OPEN: OnFileOpen(); return TRUE; case IDM_FILE_SAVE: OnFileSave(); return TRUE; case IDM_FILE_SAVEAS: OnFileSaveAs(); return TRUE; case IDM_FILE_PRINT: OnFilePrint(); return TRUE; case IDM_PEN_RED: OnPenRed(); return TRUE; case IDM_PEN_BLUE: OnPenBlue(); return TRUE; case IDM_PEN_GREEN: OnPenGreen(); return TRUE; case IDM_PEN_BLACK: OnPenBlack(); return TRUE; case IDW_VIEW_STATUSBAR: OnViewStatusBar(); return TRUE; case IDW_VIEW_TOOLBAR: OnViewToolBar(); return TRUE; case IDM_HELP_ABOUT: OnHelp(); return TRUE; case IDM_FILE_EXIT: OnFileExit(); return TRUE; } return FALSE; }
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { CTabbedMDI* pTabbedMDI = (CTabbedMDI*)m_DockTabbedMDI.GetView(); // OnCommand responds to menu and and toolbar input switch (LOWORD(wParam)) { case IDM_FILE_NEW: OnFileNew(); return TRUE; case IDM_FILE_NEWSIMPLE: pTabbedMDI->AddMDIChild(new CViewSimple, _T("Simple"), ID_MDI_SIMPLE); return TRUE; case IDM_FILE_NEWRECT: pTabbedMDI->AddMDIChild(new CViewRect, _T("Rectangles"), ID_MDI_RECT); return TRUE; case IDM_FILE_NEWTEXT: pTabbedMDI->AddMDIChild(new CViewText, _T("TextView"), ID_MDI_TEXT); return TRUE; case IDM_FILE_NEWTREE: pTabbedMDI->AddMDIChild(new CViewClasses, _T("TreeView"), ID_MDI_CLASSES); return TRUE; case IDM_FILE_NEWLIST: pTabbedMDI->AddMDIChild(new CViewFiles, _T("ListView"), ID_MDI_FILES); return TRUE; case IDM_FILE_EXIT: // End the application ::PostQuitMessage(0); return TRUE; case IDM_CONTAINER_TOP: OnContainerTabsAtTop(); return TRUE; case IDM_TABBEDMDI_TOP: OnMDITabsAtTop(); return TRUE; case IDM_LAYOUT_DEFAULT: SetRedraw(FALSE); m_DockTabbedMDI.CloseAllDockers(); m_DockTabbedMDI.GetTabbedMDI()->CloseAllMDIChildren(); LoadDefaultDockers(); LoadDefaultMDIs(); SetRedraw(TRUE); RedrawWindow(0, 0, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_ALLCHILDREN); return TRUE; case IDM_LAYOUT_CLOSE_DOCKERS: m_DockTabbedMDI.CloseAllDockers(); return TRUE; case IDM_LAYOUT_CLOSE_MDIS: m_DockTabbedMDI.GetTabbedMDI()->CloseAllMDIChildren(); return TRUE; case IDW_VIEW_STATUSBAR: OnViewStatusBar(); return TRUE; case IDW_VIEW_TOOLBAR: OnViewToolBar(); return TRUE; case IDM_HELP_ABOUT: // Display the help dialog OnHelp(); return TRUE; default: // Pass the command on to the view window of the last active docker { if (m_pLastActiveDocker == &m_DockTabbedMDI) m_DockTabbedMDI.GetTabbedMDI()->GetActiveMDIChild()->SendMessage(WM_COMMAND, wParam, lParam); else if (m_pLastActiveDocker->IsDocked()) m_pLastActiveDocker->GetContainer()->GetActiveView()->SendMessage(WM_COMMAND, wParam, lParam); } } return FALSE; }