Main Page | Namespaces | Classes | Compounds | Files | Compound Members | Related WinForm.h00001 // 00002 // SYNTOPIA. See http://Syntopia.sourceforge.net for details and documentation. 00003 // 00004 // Author of this file: Mikael Hvidtfeldt Christensen (mikaelc@users.sourceforge.net) 00005 // 00006 00007 // WinForm.h - Main Window (form) functions. 00008 00009 #pragma warning(disable: 4786) // Dont limit identifier lengths to 250 chars. 00010 00011 #ifndef __WinForm 00012 #define __WinForm 00013 00014 #include <windows.h> 00015 #include <String> 00016 #include <map> 00017 //#include <ddraw.h> 00018 #include <mmsystem.h> 00019 #include "GUIControl.h" 00020 #include "Events.h" 00021 #include "ListBox.h" 00022 #include "Button.h" 00023 #include "TextBox.h" 00024 #include "Label.h" 00025 #include "Canvas.h" 00026 #include "divider.h" 00027 00028 namespace GUIToolkit { 00029 00031 /* 00032 * @todo fix cursor problems, small title line, and 'always behind'. 00033 */ 00034 class WinForm { 00035 00036 public: 00038 enum winTypes {standard}; 00039 00041 WinForm(int xsize, int ysize, winTypes myTypes, std::string title = "No title"); 00042 00044 ~WinForm() ; 00045 00047 void show(); 00048 00050 HWND hwnd; 00051 00052 00053 private: 00054 WNDCLASSEX wc; // Used by constructor 00055 EventHandler * myEventHandler; 00056 char g_szClassName[80]; 00057 }; 00058 00059 00060 00061 00062 00063 00064 00065 00067 class DBCanvas : public Component { 00068 public: 00069 DBCanvas(WinForm * WF, int _x0, int _y0, int _x1, int _y1); 00070 ~DBCanvas(); 00071 void Paint(HDC hdc); // Draw the Canvas on the Winform. 00072 void Rectangle(int x0, int y0, int x1, int y1); 00073 void setPixel(int x,int y, int r, int g, int b); 00074 void clear(); // set Canvas to White. 00075 int x0,y0,x1,y1; 00076 void update(); // Call this to blit to screen. 00077 private: 00078 HBITMAP OffScreen; // OffScreen pixels 00079 HDC OffScreenHdc; // Device Context to Offscreen Pixels 00080 }; 00081 00082 00083 /* 00084 class DXCanvas : public Component { 00085 public: 00086 DXCanvas(WinForm * WF, int _x0, int _y0, int _x1, int _y1); 00087 ~DXCanvas(); 00088 void Paint(HDC hdc); // Draw the Canvas on the Winform. 00089 //void Rectangle(int x0, int y0, int x1, int y1); 00090 void setPixel(int x,int y, int r, int g, int b); 00091 void clear(); // set Canvas to White. 00092 void init(); // TestHack 00093 void getDC(); // TEST HACK 00094 void releaseDC(); // TEST HACK 00095 00096 int x0,y0,x1,y1; 00097 void update(); // Call this to blit to screen. 00098 private: 00099 HBITMAP OffScreen; // OffScreen pixels 00100 HDC OffScreenHdc; // Device Context to Offscreen Pixels 00101 bool IsWindowed; // running fullscreen or windowed? 00102 LPDIRECTDRAWSURFACE lpDDSPrimary; // DirectDraw primary surface 00103 LPDIRECTDRAWSURFACE lpDDSBack; // DirectDraw back surface 00104 LPDIRECTDRAW lpDD; // DirectDraw object defined in DDRAW.H 00105 LPDIRECTDRAWCLIPPER lpClipper; 00106 DDSURFACEDESC ddsd; // Should be for backbuffer???? CHANGE 00107 00108 }; 00109 */ 00110 00111 } 00112 00113 #endif Docs made by Doxygen. Email: Mikael Christensen |