📄 fg__win32adaptor_8cpp-source.html
字号:
00128 00129 <span class="comment">//##ModelId=40925CB000E5</span><a name="l00130"></a><a class="code" href="classFG__Win32Adaptor.html#a7">00130</a> <span class="keywordtype">void</span> <a class="code" href="classFG__Win32Adaptor.html#a7">FG_Win32Adaptor::DrawBitmap</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * pBmpName, <span class="keyword">const</span> <span class="keywordtype">short</span> x1, <span class="keyword">const</span> <span class="keywordtype">short</span> y1)00131 {00132 <span class="keywordtype">char</span> name[MAX_PATH + 1];00133 sprintf(name, <span class="stringliteral">"%s/%s.bmp"</span>, <a class="code" href="classFG__Win32Adaptor.html#p3">m_BmpPath</a>, pBmpName);00134 m_pDraw-><a class="code" href="classFG__OSDrawInterface.html#a9">DrawBitmap</a>(name, x1, y1);00135 }00136 00137 <span class="comment">//##ModelId=3F6EAFFE0335</span><a name="l00138"></a><a class="code" href="classFG__Win32Adaptor.html#f0">00138</a> <span class="keywordtype">long</span> FAR WINAPI <a class="code" href="classFG__Win32Adaptor.html#f0">FG_Win32Adaptor::WndProc</a>(HWND hWnd, UINT uMessage, UINT wParam, LONG lParam)00139 {00140 00141 <span class="keywordflow">switch</span> (uMessage)00142 {00143 <span class="keywordflow">case</span> WM_PAINT:00144 {00145 PAINTSTRUCT ps;00146 HDC hDC = BeginPaint(hWnd, &ps);00147 00148 ((<a class="code" href="classFG__Win32DrawInterface.html">FG_Win32DrawInterface</a> *)m_pDraw)->SetHDC(hDC);00149 <a class="code" href="structFG__Message.html">FG_Message</a> Msg(<a class="code" href="group__Utility.html#gga12a19">FG_MSG_DRAW</a>);00150 m_pAdaptor-><a class="code" href="classFG__OSAdaptor.html#a2">SendMsg</a>(& Msg);00151 00152 EndPaint(hWnd, &ps);00153 }00154 <span class="keywordflow">break</span>;00155 <span class="keywordflow">case</span> WM_KEYDOWN:00156 {00157 HDC hDC = GetDC(hWnd);00158 ((<a class="code" href="classFG__Win32DrawInterface.html">FG_Win32DrawInterface</a> *)m_pDraw)->SetHDC(hDC);00159 00160 <a class="code" href="structFG__Message.html">FG_Message</a> Msg(<a class="code" href="group__Utility.html#gga12a20">FG_MSG_KEY</a>, <a class="code" href="group__Utility.html#gga13a29">FKS_DOWN</a>);00161 <span class="keywordflow">if</span> ((wParam >= <span class="charliteral">'0'</span> && wParam <= <span class="charliteral">'9'</span>)00162 || (wParam >= <span class="charliteral">'A'</span> && wParam <= <span class="charliteral">'Z'</span>)00163 || (wParam >= <span class="charliteral">'a'</span> && wParam <= <span class="charliteral">'z'</span>))00164 Msg.<a class="code" href="structFG__Message.html#o4">lData</a> = wParam;00165 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (wParam == VK_RETURN)00166 Msg.<a class="code" href="structFG__Message.html#o4">lData</a> = <a class="code" href="group__Virtual__Key.html#ga12">FVK_ENTER</a>;00167 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (wParam == VK_LEFT)00168 Msg.<a class="code" href="structFG__Message.html#o4">lData</a> = <a class="code" href="group__Virtual__Key.html#ga14">FVK_LEFT</a>;00169 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (wParam == VK_RIGHT)00170 Msg.<a class="code" href="structFG__Message.html#o4">lData</a> = <a class="code" href="group__Virtual__Key.html#ga15">FVK_RIGHT</a>;00171 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (wParam == VK_DELETE)00172 Msg.<a class="code" href="structFG__Message.html#o4">lData</a> = <a class="code" href="group__Virtual__Key.html#ga13">FVK_DELETE</a>;00173 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (wParam == VK_TAB)00174 Msg.<a class="code" href="structFG__Message.html#o4">lData</a> = <a class="code" href="group__Virtual__Key.html#ga16">FVK_TAB</a>;00175 m_pAdaptor-><a class="code" href="classFG__OSAdaptor.html#a2">SendMsg</a>(& Msg);00176 00177 ReleaseDC(hWnd, hDC);00178 }00179 <span class="keywordflow">break</span>;00180 <span class="keywordflow">case</span> WM_KEYUP:00181 {00182 HDC hDC = GetDC(hWnd);00183 ((<a class="code" href="classFG__Win32DrawInterface.html">FG_Win32DrawInterface</a> *)m_pDraw)->SetHDC(hDC);00184 00185 <a class="code" href="structFG__Message.html">FG_Message</a> Msg(<a class="code" href="group__Utility.html#gga12a20">FG_MSG_KEY</a>, <a class="code" href="group__Utility.html#gga13a30">FKS_UP</a>);00186 <span class="keywordflow">if</span> ((wParam >= <span class="charliteral">'0'</span> && wParam <= <span class="charliteral">'9'</span>)00187 || (wParam >= <span class="charliteral">'A'</span> && wParam <= <span class="charliteral">'Z'</span>)00188 || (wParam >= <span class="charliteral">'a'</span> && wParam <= <span class="charliteral">'z'</span>))00189 Msg.<a class="code" href="structFG__Message.html#o4">lData</a> = wParam;00190 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (wParam == VK_RETURN)00191 Msg.<a class="code" href="structFG__Message.html#o4">lData</a> = <a class="code" href="group__Virtual__Key.html#ga12">FVK_ENTER</a>;00192 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (wParam == VK_LEFT)00193 Msg.<a class="code" href="structFG__Message.html#o4">lData</a> = <a class="code" href="group__Virtual__Key.html#ga14">FVK_LEFT</a>;00194 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (wParam == VK_RIGHT)00195 Msg.<a class="code" href="structFG__Message.html#o4">lData</a> = <a class="code" href="group__Virtual__Key.html#ga15">FVK_RIGHT</a>;00196 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (wParam == VK_DELETE)00197 Msg.<a class="code" href="structFG__Message.html#o4">lData</a> = <a class="code" href="group__Virtual__Key.html#ga13">FVK_DELETE</a>;00198 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (wParam == VK_TAB)00199 Msg.<a class="code" href="structFG__Message.html#o4">lData</a> = <a class="code" href="group__Virtual__Key.html#ga16">FVK_TAB</a>;00200 m_pAdaptor-><a class="code" href="classFG__OSAdaptor.html#a2">SendMsg</a>(& Msg);00201 00202 ReleaseDC(hWnd, hDC);00203 }00204 <span class="keywordflow">break</span>;00205 <span class="keywordflow">case</span> WM_LBUTTONDOWN:00206 {00207 HDC hDC = GetDC(hWnd);00208 ((<a class="code" href="classFG__Win32DrawInterface.html">FG_Win32DrawInterface</a> *)m_pDraw)->SetHDC(hDC);00209 00210 <a class="code" href="structFG__Message.html">FG_Message</a> Msg(<a class="code" href="group__Utility.html#gga12a21">FG_MSG_MOUSE</a>, <a class="code" href="group__Utility.html#gga14a32">FMS_LBUTTONDOWN</a>);00211 Msg.<a class="code" href="structFG__Message.html#o5">Point</a>.<a class="code" href="structFG__Point.html#o0">x</a> = (<a class="code" href="group__Utility.html#ga1">WORD</a>)lParam;00212 Msg.<a class="code" href="structFG__Message.html#o5">Point</a>.<a class="code" href="structFG__Point.html#o1">y</a> = (<a class="code" href="group__Utility.html#ga1">WORD</a>)((lParam & 0xffff0000) >> 16);00213 m_pAdaptor-><a class="code" href="classFG__OSAdaptor.html#a2">SendMsg</a>(& Msg);00214 00215 ReleaseDC(hWnd, hDC);00216 }00217 <span class="keywordflow">break</span>;00218 <span class="keywordflow">case</span> WM_LBUTTONUP:00219 {00220 HDC hDC = GetDC(hWnd);00221 ((<a class="code" href="classFG__Win32DrawInterface.html">FG_Win32DrawInterface</a> *)m_pDraw)->SetHDC(hDC);00222 00223 <a class="code" href="structFG__Message.html">FG_Message</a> Msg(<a class="code" href="group__Utility.html#gga12a21">FG_MSG_MOUSE</a>, <a class="code" href="group__Utility.html#gga14a33">FMS_LBUTTONUP</a>);00224 Msg.<a class="code" href="structFG__Message.html#o5">Point</a>.<a class="code" href="structFG__Point.html#o0">x</a> = (<a class="code" href="group__Utility.html#ga1">WORD</a>)lParam;00225 Msg.<a class="code" href="structFG__Message.html#o5">Point</a>.<a class="code" href="structFG__Point.html#o1">y</a> = (<a class="code" href="group__Utility.html#ga1">WORD</a>)((lParam & 0xffff0000) >> 16);00226 m_pAdaptor-><a class="code" href="classFG__OSAdaptor.html#a2">SendMsg</a>(& Msg);00227 00228 ReleaseDC(hWnd, hDC);00229 }00230 <span class="keywordflow">break</span>;00231 <span class="keywordflow">case</span> WM_TIMER:00232 {00233 HDC hDC = GetDC(hWnd);00234 ((<a class="code" href="classFG__Win32DrawInterface.html">FG_Win32DrawInterface</a> *)m_pDraw)->SetHDC(hDC);00235 00236 <a class="code" href="structFG__Message.html">FG_Message</a> Msg(<a class="code" href="group__Utility.html#gga12a22">FG_MSG_TIMER</a>);00237 m_pAdaptor-><a class="code" href="classFG__OSAdaptor.html#a2">SendMsg</a>(& Msg);00238 00239 ReleaseDC(hWnd, hDC);00240 }00241 <span class="keywordflow">break</span>;00242 <span class="keywordflow">case</span> WM_DESTROY:00243 PostQuitMessage(0);00244 <span class="keywordflow">break</span>;00245 <span class="keywordflow">default</span>:00246 <span class="keywordflow">return</span> DefWindowProc(hWnd, uMessage, wParam, lParam);00247 }00248 <span class="keywordflow">return</span> 0L;00249 }</pre></div><hr><center>由 DoxyGen 1.3.6 于 Wed Jun 9 22:34:41 2004 生成<br>版权所有 (C) 2003,2004 王咏武</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -