TIFFFrame.cpp
上传用户:lbr_007
上传日期:2019-05-31
资源大小:282k
文件大小:4k
- // TIFFFrame.cpp : implementation of the TIFFFrame class
- //
- #include "stdafx.h"
- #include "TIFFSample.h"
- #include "TIFFFrame.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- CStatusBar * g_statusBar = 0;
- /////////////////////////////////////////////////////////////////////////////
- // TIFFFrame
- IMPLEMENT_DYNCREATE(TIFFFrame, CFrameWnd)
- BEGIN_MESSAGE_MAP(TIFFFrame, CFrameWnd)
- //{{AFX_MSG_MAP(TIFFFrame)
- ON_WM_CREATE()
- ON_WM_SIZE()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- static UINT indicators[] =
- {
- ID_SEPARATOR,
- ID_SEPARATOR,
- ID_SEPARATOR,
- ID_SEPARATOR,
- };
- /////////////////////////////////////////////////////////////////////////////
- // TIFFFrame construction/destruction
- TIFFFrame::TIFFFrame()
- {
- // TODO: add member initialization code here
-
- }
- TIFFFrame::~TIFFFrame()
- {
- }
- int TIFFFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
-
- if (!m_wndToolBar.CreateEx(this) ||
- !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
- {
- TRACE0("Failed to create toolbarn");
- return -1; // fail to create
- }
-
- if (!m_wndDlgBar.Create(this, IDD_DROPSIZE_DLG,
- CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR))
- {
- TRACE0("Failed to create dialogbarn");
- return -1; // fail to create
- }
- if (!m_wndReBar.Create(this) ||
- !m_wndReBar.AddBar(&m_wndDlgBar)||
- !m_wndReBar.AddBar(&m_wndToolBar))
- {
- TRACE0("Failed to create rebarn");
- return -1; // fail to create
- }
- if (!m_wndStatusBar.Create(this) ||
- !m_wndStatusBar.SetIndicators(indicators,
- sizeof(indicators)/sizeof(UINT)))
- {
- TRACE0("Failed to create status barn");
- return -1; // fail to create
- }
- g_statusBar = &m_wndStatusBar;
- if (!m_listBar.Create(this, IDD_CLICKLIST_DLG, CBRS_LEFT, ID_LEFTBAR_LIST))
- {
- TRACE0("Failed to create rebarn");
- return -1;
- }
- m_listBar.EnableDocking(CBRS_ALIGN_ANY);
- // TODO: Remove this if you don't want tool tips
- m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
- CBRS_TOOLTIPS | CBRS_FLYBY);
- UINT nID;
- UINT nStyle;
- int cxWidth;
- m_wndStatusBar.GetPaneInfo(1,nID,nStyle,cxWidth);
- nStyle = SBPS_NORMAL;
- m_wndStatusBar.SetPaneInfo(1,nID,nStyle,60);
- m_wndStatusBar.GetPaneInfo(2,nID,nStyle,cxWidth);
- nStyle = SBPS_NORMAL;
- m_wndStatusBar.SetPaneInfo(2,nID,nStyle,160);
- m_wndStatusBar.GetPaneInfo(3,nID,nStyle,cxWidth);
- nStyle = SBPS_NORMAL;
- m_wndStatusBar.SetPaneInfo(3,nID,nStyle,160);
- EnableDocking(CBRS_ALIGN_ANY);
- //DockControlBar(&m_listBar);
- m_wndDlgBar.Setup();
- return 0;
- }
- BOOL TIFFFrame::PreCreateWindow(CREATESTRUCT& cs)
- {
- if( !CFrameWnd::PreCreateWindow(cs) )
- return FALSE;
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return TRUE;
- }
- /////////////////////////////////////////////////////////////////////////////
- // TIFFFrame diagnostics
- #ifdef _DEBUG
- void TIFFFrame::AssertValid() const
- {
- CFrameWnd::AssertValid();
- }
- void TIFFFrame::Dump(CDumpContext& dc) const
- {
- CFrameWnd::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // TIFFFrame message handlers
- void TIFFFrame::OnSize(UINT nType, int cx, int cy)
- {
- CFrameWnd::OnSize(nType, cx, cy);
- }
- void TIFFFrame::HideList(void)
- {
- m_listBar.ShowWindow(SW_HIDE);
- PostMessage(WM_SIZE, 0, 0);
- }
- void TIFFFrame::ShowList(void)
- {
- m_listBar.ShowWindow(SW_SHOW);
- PostMessage(WM_SIZE, 0, 0);
- }