3 /////////////////////////////////////////////////////////////////////////////
5 // Copyright (c) 2002 Iain Murray, Inference Group, Cavendish, Cambridge.
7 /////////////////////////////////////////////////////////////////////////////
9 #ifndef __DasherWindow_h__
10 #define __DasherWindow_h__
14 #include "Widgets/Splitter.h"
15 #include "Widgets/StatusControl.h"
16 #include "Widgets/Menu.h"
17 #include "Widgets/SplashScreen.h"
18 #include "Widgets/WindowSelect.h"
19 #include "DasherMouseInput.h"
20 #include "AppSettings.h"
21 #include "GameModeHelper.h"
23 #include "../Common/WinOptions.h"
31 // Abstract interfaces to the Dasher engine
32 #include "../../DasherCore/DasherInterfaceBase.h"
36 public ATL::CWindowImpl
<CDasherWindow
, CWindow
, CWinTraits
< WS_CLIPCHILDREN
| WS_CLIPSIBLINGS
> >,
41 public ATL::CWindowImpl
<CDasherWindow
>,
46 //, CWindow, CFrameWinTraits>,
51 DECLARE_WND_CLASS(_T("DASHER"))
53 BEGIN_MSG_MAP( CDasherWindow
)
54 MESSAGE_HANDLER(WM_DESTROY
, OnDestroy
)
55 MESSAGE_HANDLER(WM_COMMAND
, OnCommand
)
56 MESSAGE_HANDLER(WM_CLOSE
, OnClose
)
57 MESSAGE_HANDLER(WM_SIZE
, OnSize
)
59 MESSAGE_HANDLER(WM_GETMINMAXINFO
,OnGetMinMaxInfo
)
61 MESSAGE_HANDLER(WM_INITMENUPOPUP
,OnInitMenuPopup
)
62 MESSAGE_HANDLER(WM_SETFOCUS
,OnSetFocus
)
63 MESSAGE_RANGE_HANDLER(0xC000,0xFFFF,OnOther
)
66 LRESULT
OnSetFocus(UINT message
, WPARAM wParam
, LPARAM lParam
, BOOL
& bHandled
);
67 LRESULT
OnInitMenuPopup(UINT message
, WPARAM wParam
, LPARAM lParam
, BOOL
& bHandled
);
69 LRESULT
OnGetMinMaxInfo(UINT message
, WPARAM wParam
, LPARAM lParam
, BOOL
& bHandled
);
71 LRESULT
OnOther(UINT message
, WPARAM wParam
, LPARAM lParam
, BOOL
& bHandled
);
72 LRESULT
OnDasherEvent(UINT message
, WPARAM wParam
, LPARAM lParam
, BOOL
& bHandled
);
73 LRESULT
OnGameMessage(UINT message
, WPARAM wParam
, LPARAM lParam
, BOOL
& bHandled
);
74 LRESULT
OnDasherFocus(UINT message
, WPARAM wParam
, LPARAM lParam
, BOOL
& bHandled
);
75 LRESULT
OnSize(UINT message
, WPARAM wParam
, LPARAM lParam
, BOOL
& bHandled
);
76 LRESULT
OnDestroy(UINT message
, WPARAM wParam
, LPARAM lParam
, BOOL
& bHandled
);
77 LRESULT
OnClose(UINT message
, WPARAM wParam
, LPARAM lParam
, BOOL
& bHandled
);
78 LRESULT
OnCommand(UINT message
, WPARAM wParam
, LPARAM lParam
, BOOL
& bHandled
);
81 // Create window (and children)
82 // failure returns NULL
85 void Show(int nCmdShow
);
90 void HandleWinEvent(HWINEVENTHOOK hWinEventHook
, DWORD event
, HWND hwnd
,
91 LONG idObject
, LONG idChild
, DWORD dwEventThread
, DWORD dwmsEventTime
);
96 // Main processing function, called by MessageLoop
99 void SaveWindowState() const;
100 bool LoadWindowState();
102 Dasher::CDasher
*m_pDasher
;
107 /// Handle control events
110 void HandleControlEvent(int iID
);
112 void HandleParameterChange(int iParameter
);
115 CToolbar
*m_pToolbar
;
117 //CCanvas *m_pCanvas;
118 CSplitter
*m_pSplitter
;
119 CStatusControl
*m_pSpeedAlphabetBar
;
120 CGameGroup
* m_pGameGroup
;
124 CAppSettings
*m_pAppSettings
;
131 LPCWSTR DialogCaption
;
132 char tmpAutoOffset
[25];
134 // Misc window handling
137 CGameModeHelper
*m_pGameModeHelper
;
141 #endif /* #ifdef __MainWindow_h__ */