Visual studio 2005 thinks that long long int is 64 bit. The difference between
[dasher.git] / Src / Win32 / DasherWindow.h
blob0a6fba969074b08224d2e631343f13be1a449e30
1 // DasherWindow.h
2 //
3 /////////////////////////////////////////////////////////////////////////////
4 //
5 // Copyright (c) 2002 Iain Murray, Inference Group, Cavendish, Cambridge.
6 //
7 /////////////////////////////////////////////////////////////////////////////
9 #ifndef __DasherWindow_h__
10 #define __DasherWindow_h__
12 #include "resource.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"
25 class CToolbar;
26 class CGameGroup;
27 namespace Dasher {
28 class CDasher;
31 // Abstract interfaces to the Dasher engine
32 #include "../../DasherCore/DasherInterfaceBase.h"
34 #ifdef _WIN32_WCE
35 class CDasherWindow :
36 public ATL::CWindowImpl<CDasherWindow, CWindow, CWinTraits< WS_CLIPCHILDREN | WS_CLIPSIBLINGS> >,
37 public CSplitterOwner
39 #else
40 class CDasherWindow :
41 public ATL::CWindowImpl<CDasherWindow>,
42 public CSplitterOwner
44 #endif
45 public:
46 //, CWindow, CFrameWinTraits>,
48 CDasherWindow();
49 ~CDasherWindow();
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)
58 #ifndef _WIN32_WCE
59 MESSAGE_HANDLER(WM_GETMINMAXINFO,OnGetMinMaxInfo)
60 #endif
61 MESSAGE_HANDLER(WM_INITMENUPOPUP,OnInitMenuPopup)
62 MESSAGE_HANDLER(WM_SETFOCUS,OnSetFocus)
63 MESSAGE_RANGE_HANDLER(0xC000,0xFFFF,OnOther)
64 END_MSG_MAP()
66 LRESULT OnSetFocus(UINT message, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
67 LRESULT OnInitMenuPopup(UINT message, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
68 #ifndef _WIN32_WCE
69 LRESULT OnGetMinMaxInfo(UINT message, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
70 #endif
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
83 HWND Create();
85 void Show(int nCmdShow);
87 int MessageLoop();
89 #ifndef _WIN32_WCE
90 void HandleWinEvent(HWINEVENTHOOK hWinEventHook, DWORD event, HWND hwnd,
91 LONG idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime);
92 #endif
94 private:
96 // Main processing function, called by MessageLoop
97 void Main();
99 void SaveWindowState() const;
100 bool LoadWindowState();
102 Dasher::CDasher *m_pDasher;
104 HACCEL hAccelTable;
106 ///
107 /// Handle control events
110 void HandleControlEvent(int iID);
112 void HandleParameterChange(int iParameter);
114 // Widgets:
115 CToolbar *m_pToolbar;
116 CEdit *m_pEdit;
117 //CCanvas *m_pCanvas;
118 CSplitter *m_pSplitter;
119 CStatusControl *m_pSpeedAlphabetBar;
120 CGameGroup* m_pGameGroup;
121 CMenu WinMenu;
122 //CSplash *Splash;
124 CAppSettings *m_pAppSettings;
126 HICON m_hIconSm;
128 HMENU m_hMenu;
130 LPCWSTR AutoOffset;
131 LPCWSTR DialogCaption;
132 char tmpAutoOffset[25];
134 // Misc window handling
135 void Layout();
137 CGameModeHelper *m_pGameModeHelper;
141 #endif /* #ifdef __MainWindow_h__ */