80 lines
3.3 KiB
C++
80 lines
3.3 KiB
C++
// MainFrm.h : interface of the CMainFrame class
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
|
|
class CMainFrame : public CFrameWindowImpl<CMainFrame>, public CUpdateUI<CMainFrame>,
|
|
public CMessageFilter, public CIdleHandler, public CPrintJobInfo
|
|
{
|
|
public:
|
|
DECLARE_FRAME_WND_CLASS(NULL, IDR_MAINFRAME)
|
|
|
|
CMainFrame(): m_view(*this)
|
|
{
|
|
m_printer.OpenDefaultPrinter();
|
|
m_devmode.CopyFromPrinter(m_printer);
|
|
ATLTRACE("\nIn constructor with m_Combo %x", m_Combo.m_hWnd);
|
|
|
|
};
|
|
|
|
CSplitterWindow m_wndSplit;
|
|
CCheckListViewCtrl m_wndLayers;
|
|
CSLNKDwfViewerView m_view;
|
|
CStatusBarCtrl m_status;
|
|
|
|
CComboBox m_Combo;
|
|
|
|
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
|
virtual BOOL OnIdle();
|
|
|
|
BEGIN_UPDATE_UI_MAP(CMainFrame)
|
|
UPDATE_ELEMENT(ID_VIEW_TOOLBAR, UPDUI_MENUPOPUP)
|
|
UPDATE_ELEMENT(ID_VIEW_STATUS_BAR, UPDUI_MENUPOPUP)
|
|
END_UPDATE_UI_MAP()
|
|
|
|
BEGIN_MSG_MAP(CMainFrame)
|
|
MESSAGE_HANDLER(WM_CREATE, OnCreate)
|
|
COMMAND_ID_HANDLER(ID_APP_EXIT, OnFileExit)
|
|
COMMAND_ID_HANDLER(ID_VIEW_TOOLBAR, OnViewToolBar)
|
|
COMMAND_ID_HANDLER(ID_VIEW_STATUS_BAR, OnViewStatusBar)
|
|
COMMAND_ID_HANDLER(ID_ZOOM_EXTENTS, OnZoomExtents)
|
|
COMMAND_ID_HANDLER(ID_ZOOM_IN, OnZoomIn)
|
|
COMMAND_ID_HANDLER(ID_ZOOM_OUT, OnZoomOut)
|
|
COMMAND_ID_HANDLER(ID_FILE_PRINT, OnFilePrint)
|
|
COMMAND_ID_HANDLER(ID_FILE_OPEN, OnFileOpen)
|
|
COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout)
|
|
COMMAND_ID_HANDLER(ID_VIEW_LAYERS, OnViewLayers)
|
|
COMMAND_HANDLER(IDC_COMBO, CBN_SELCHANGE, onSelChange)
|
|
CHAIN_MSG_MAP(CUpdateUI<CMainFrame>)
|
|
CHAIN_MSG_MAP(CFrameWindowImpl<CMainFrame>)
|
|
END_MSG_MAP()
|
|
|
|
// Handler prototypes (uncomment arguments if needed):
|
|
// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
|
// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
|
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
|
|
|
|
void SetDWF(const CString &dwfPath);
|
|
LRESULT onSelChange(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
|
LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
|
LRESULT OnFileExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
|
LRESULT OnFileOpen(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
|
LRESULT OnZoomExtents(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
|
LRESULT OnZoomIn(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
|
LRESULT OnZoomOut(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
|
LRESULT OnFilePrint(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
|
LRESULT OnViewToolBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
|
LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
|
LRESULT OnViewStatusBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
|
public:
|
|
LRESULT OnViewLayers(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
|
|
|
CPrinter m_printer;
|
|
CDevMode m_devmode;
|
|
CPrintPreviewWindow m_wndPreview;
|
|
|
|
virtual bool IsValidPage(UINT nPage);
|
|
virtual bool PrintPage(UINT nPage, HDC hDC);
|
|
};
|