home *** CD-ROM | disk | FTP | other *** search
/ Game Programming in C++ - Start to Finish / GameProgrammingS.iso / developer_install / CEGUISDK-0.4.1-VC6-Native.exe / {app} / Samples / common / include / Win32CEGuiRendererSelector.h < prev   
Encoding:
C/C++ Source or Header  |  2005-03-10  |  3.6 KB  |  121 lines

  1. /************************************************************************
  2.     filename:   Win32CEGuiRendererSelector.h
  3.     created:    24/9/2004
  4.     author:     Paul D Turner
  5. *************************************************************************/
  6. /*************************************************************************
  7.     Crazy Eddie's GUI System (http://www.cegui.org.uk)
  8.     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
  9.  
  10.     This library is free software; you can redistribute it and/or
  11.     modify it under the terms of the GNU Lesser General Public
  12.     License as published by the Free Software Foundation; either
  13.     version 2.1 of the License, or (at your option) any later version.
  14.  
  15.     This library is distributed in the hope that it will be useful,
  16.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18.     Lesser General Public License for more details.
  19.  
  20.     You should have received a copy of the GNU Lesser General Public
  21.     License along with this library; if not, write to the Free Software
  22.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  23. *************************************************************************/
  24. #ifndef _Win32CEGuiRendererSelector_h_
  25. #define _Win32CEGuiRendererSelector_h_
  26.  
  27. #if defined( __WIN32__ ) || defined( _WIN32 )
  28. #   define WIN32_LEAN_AND_MEAN
  29. #   include "windows.h"
  30. #endif
  31.  
  32. #include "CEGuiRendererSelector.h"
  33.  
  34.  
  35. /*!
  36. \brief
  37.     Class representing a modal renderer selection dialog under Win32.
  38. */
  39. class Win32CEGuiRendererSelector : public CEGuiRendererSelector
  40. {
  41. public:
  42.     /*!
  43.     \brief
  44.         Constructor
  45.     */
  46.     Win32CEGuiRendererSelector();
  47.  
  48.  
  49.     /*!
  50.     \brief
  51.         Destructor.
  52.     */
  53.     virtual ~Win32CEGuiRendererSelector();
  54.  
  55.  
  56.     /*!
  57.     \brief
  58.         Displays a dialog allowing the user to select a renderer to be used.
  59.  
  60.     \return
  61.         false if the user cancelled.
  62.     */
  63.     virtual bool    inkokeDialog();
  64.  
  65.  
  66. protected:
  67.     /*************************************************************************
  68.         Static methods
  69.     *************************************************************************/
  70.     /*!
  71.     \brief
  72.         Create a Win32 dialog template for the requester.
  73.     */
  74.     static LPDLGTEMPLATE createDialogTemplate();
  75.  
  76.  
  77.     /*!
  78.     \brief
  79.         Win32 dialog procedure function.
  80.     */
  81.     static INT_PTR CALLBACK dialogProcedure(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  82.  
  83.  
  84.     /*!
  85.     \brief
  86.         Take an input pointer, return closest pointer that is aligned on a DWORD (4 byte) boundary.
  87.  
  88.     \note
  89.         This is taken from the DynDlg sample in the Win32 Platform SDK.
  90.     */
  91.     static LPBYTE alignPointer(LPBYTE buff);
  92.  
  93.  
  94.     /*!
  95.     \brief
  96.         Converts the Ansi string in 'pAnsiIn' into wide characters and copies the result
  97.         into the WORD array at 'pWCStr'.
  98.  
  99.     \note
  100.         This is taken from the DynDlg sample in the Win32 Platform SDK.
  101.  
  102.     \param outBuff
  103.         Pointer to the destination buffer.
  104.  
  105.     \param pAnsiIn
  106.         Input ANSI string.
  107.  
  108.     \return
  109.         The number of wide characters copied, including the trailing wide char NULL.
  110.     */
  111.     static int copyAnsiToWideChar(LPBYTE outBuff, PTSTR ansiString);
  112.  
  113.  
  114.     /*************************************************************************
  115.         Data fields
  116.     *************************************************************************/
  117.     LPDLGTEMPLATE   d_template;
  118. };
  119.  
  120. #endif  // end of guard _Win32CEGuiRendererSelector_h_
  121.