Fernando_Fiore

WTL-MDI-SPLITTER with edit controls fixed

Sep 17th, 2020
40
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // MainFrm.h : interface of the CMainFrame class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4.  
  5. #pragma once
  6.  
  7. #define CHAIN_COMMANDS_MEMBER_ID_RANGE(theChainMember, idFirst, idLast) \
  8.     if(uMsg == WM_COMMAND && (LOWORD(wParam) >= idFirst && LOWORD(wParam) <=idLast) && (theChainMember.m_hWnd == GetFocus())) \
  9.         CHAIN_MSG_MAP_MEMBER(theChainMember)
  10.  
  11. //#define CHAIN_MDICLIENT_COMMANDS() \
  12. //  if((uMsg == WM_COMMAND) && (this->m_hWndMDIClient != NULL)) \
  13. //      ::SendMessage(this->m_hWndMDIClient, uMsg, wParam, lParam);
  14.  
  15.  
  16.  
  17. class CMainFrame :
  18.     public CMDIFrameWindowImpl<CMainFrame>,
  19.     public CUpdateUI<CMainFrame>,
  20.     public CMessageFilter, public CIdleHandler
  21. {
  22.     //typedef CMDISplitterFrameImpl<CMainFrame, false> _baseClass;
  23.     CHorSplitterWindow m_hsplit;
  24.     CBottom m_bottom;
  25. public:
  26.     DECLARE_FRAME_WND_CLASS(NULL, IDR_MAINFRAME)
  27.  
  28.     CMDICommandBarCtrl m_CmdBar;
  29.  
  30.     virtual BOOL PreTranslateMessage(MSG* pMsg);
  31.     virtual BOOL OnIdle();
  32.  
  33.     BEGIN_UPDATE_UI_MAP(CMainFrame)
  34.         UPDATE_ELEMENT(ID_VIEW_TOOLBAR, UPDUI_MENUPOPUP)
  35.         UPDATE_ELEMENT(ID_VIEW_STATUS_BAR, UPDUI_MENUPOPUP)
  36.     END_UPDATE_UI_MAP()
  37.  
  38.     BEGIN_MSG_MAP(CMainFrame)
  39.         MESSAGE_HANDLER(WM_CREATE, OnCreate)
  40.         MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
  41.         COMMAND_ID_HANDLER(ID_APP_EXIT, OnFileExit)
  42.         COMMAND_ID_HANDLER(ID_FILE_NEW, OnFileNew)
  43.         COMMAND_ID_HANDLER(ID_VIEW_TOOLBAR, OnViewToolBar)
  44.         COMMAND_ID_HANDLER(ID_VIEW_STATUS_BAR, OnViewStatusBar)
  45.         COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout)
  46.         COMMAND_ID_HANDLER(ID_WINDOW_CASCADE, OnWindowCascade)
  47.         COMMAND_ID_HANDLER(ID_WINDOW_TILE_HORZ, OnWindowTile)
  48.         COMMAND_ID_HANDLER(ID_WINDOW_ARRANGE, OnWindowArrangeIcons)
  49.         CHAIN_COMMANDS_MEMBER_ID_RANGE(m_bottom, ID_EDIT_CLEAR, ID_EDIT_FIND_PREVIOUS)
  50.         CHAIN_MDI_CHILD_COMMANDS()
  51.         CHAIN_MSG_MAP(CUpdateUI<CMainFrame>)
  52.         CHAIN_MSG_MAP(CMDIFrameWindowImpl<CMainFrame>)
  53.     END_MSG_MAP()
  54.  
  55. // Handler prototypes (uncomment arguments if needed):
  56. //  LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
  57. //  LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
  58. //  LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
  59.  
  60.     LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
  61.     LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
  62.     LRESULT OnFileExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
  63.     LRESULT OnFileNew(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
  64.     LRESULT OnViewToolBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
  65.     LRESULT OnViewStatusBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
  66.     LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
  67.     LRESULT OnWindowCascade(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
  68.     LRESULT OnWindowTile(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
  69.     LRESULT OnWindowArrangeIcons(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
  70. };
  71.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×