Linux multi-monitor fullscreen support
[ryzomcore.git] / nel / tools / logic / logic_editor_dll / MainFrm.cpp
blob1f3751265a3f10d280db08c2a725b7f74899b402
1 // MainFrm.cpp : implementation of the CMainFrame class
2 //
4 #include "stdafx.h"
5 #include "logic_editor.h"
7 #include "MainFrm.h"
8 #include "ChildFrm.h"
9 #include "logic_editorDoc.h"
11 #ifdef _DEBUG
12 #define new DEBUG_NEW
13 #undef THIS_FILE
14 static char THIS_FILE[] = __FILE__;
15 #endif
17 /////////////////////////////////////////////////////////////////////////////
18 // CMainFrame
20 IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
22 BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
23 //{{AFX_MSG_MAP(CMainFrame)
24 // NOTE - the ClassWizard will add and remove mapping macros here.
25 // DO NOT EDIT what you see in these blocks of generated code !
26 ON_WM_CREATE()
27 ON_WM_CLOSE()
28 //}}AFX_MSG_MAP
29 END_MESSAGE_MAP()
31 static UINT indicators[] =
33 ID_SEPARATOR, // status line indicator
34 ID_INDICATOR_CAPS,
35 ID_INDICATOR_NUM,
36 ID_INDICATOR_SCRL,
39 /////////////////////////////////////////////////////////////////////////////
40 // CMainFrame construction/destruction
42 CMainFrame::CMainFrame()
44 // TODO: add member initialization code here
45 CreateX = 0;
46 CreateY = 0;
47 CreateCX = 0;
48 CreateCY = 0;
49 Exit = false;
52 CMainFrame::~CMainFrame()
56 /////////////////////////////////////////////////////////////////////////////
57 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
59 if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
60 return -1;
62 if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
63 | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
64 !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
66 TRACE0("Failed to create toolbar\n");
67 return -1; // fail to create
70 if (!m_wndStatusBar.Create(this) ||
71 !m_wndStatusBar.SetIndicators(indicators,
72 sizeof(indicators)/sizeof(UINT)))
74 TRACE0("Failed to create status bar\n");
75 return -1; // fail to create
78 // TODO: Delete these three lines if you don't want the toolbar to
79 // be dockable
80 m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
81 EnableDocking(CBRS_ALIGN_ANY);
82 DockControlBar(&m_wndToolBar);
84 return 0;
87 /////////////////////////////////////////////////////////////////////////////
88 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
90 if ((CreateCX != 0)&&(CreateCY != 0))
92 cs.x = CreateX;
93 cs.y = CreateY;
94 cs.cx = CreateCX;
95 cs.cy = CreateCY;
98 if( !CMDIFrameWnd::PreCreateWindow(cs) )
99 return FALSE;
100 // TODO: Modify the Window class or styles here by modifying
101 // the CREATESTRUCT cs
103 return TRUE;
106 /////////////////////////////////////////////////////////////////////////////
107 void CMainFrame::OnClose()
109 Exit = true;
113 //-----------------------------------------------
114 // load
116 //-----------------------------------------------
117 void CMainFrame::load( const TCHAR * fileName )
119 // child frame
120 CChildFrame *pChild = (CChildFrame *) GetActiveFrame();
121 ASSERT_VALID(pChild);
123 // editor doc
124 CLogic_editorDoc *pDoc = static_cast<CLogic_editorDoc *> (pChild->GetActiveDocument());
125 ASSERT_VALID(pDoc);
126 pDoc->load( fileName );
128 } // load //
133 /////////////////////////////////////////////////////////////////////////////
134 // CMainFrame diagnostics
136 #ifdef _DEBUG
137 void CMainFrame::AssertValid() const
139 CMDIFrameWnd::AssertValid();
142 void CMainFrame::Dump(CDumpContext& dc) const
144 CMDIFrameWnd::Dump(dc);
147 #endif //_DEBUG
151 /////////////////////////////////////////////////////////////////////////////
152 // CMainFrame message handlers