Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

cardwindow.h

Go to the documentation of this file.
00001 #ifndef CARDBOARD_INCLUDED
00002 #define CARDBOARD_INCLUDED
00003 
00004 #define MAXBUTTONS      32
00005 #define MAXCARDSTACKS   32
00006 #define MAXDROPZONES    8
00007 
00008 #include "dropzone.h"
00009 #include "cardlib.h"
00010 
00011 class CardRegion;
00012 class CardButton;
00013 
00014 LRESULT CALLBACK CardWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
00015 
00016 class CardWindow
00017 {
00018     friend class CardRegion;
00019     friend class CardButton;
00020 
00021     friend void RegisterCardWindow();
00022 
00023 public:
00024 
00025     CardWindow();
00026     ~CardWindow();
00027 
00028     //
00029     //  Basic windowing support
00030     //
00031     BOOL Create(HWND hwndParent, DWORD dwExStyle, DWORD dwStyle, int x, int y, int width, int height);
00032     BOOL Destroy();
00033 
00034     operator HWND() { return m_hWnd; }
00035 
00036     CardButton *CreateButton (int id, TCHAR *szText, UINT uStyle, bool fVisible, int x, int y, int width, int height);
00037     CardRegion *CreateRegion (int id, bool fVisible, int x, int y, int xoffset, int yoffset);
00038 
00039     CardButton *CardButtonFromId(int id);
00040     CardRegion *CardRegionFromId(int id);
00041 
00042     bool DeleteButton(CardButton *pButton);
00043     bool DeleteRegion(CardRegion *pRegion);
00044     bool DeleteAll();
00045 
00046     void     SetBackColor(COLORREF cr);
00047     COLORREF GetBackColor();
00048     void     SetBackCardIdx(UINT uBackIdx);
00049     UINT     GetBackCardIdx();
00050     void     SetBackImage(HBITMAP hBitmap);
00051 
00052     void EmptyStacks(void);
00053     void Redraw(void);
00054     void Update(void);
00055 
00056     bool DistributeStacks(int nIdFrom, int nNumStacks, UINT xJustify, int xSpacing, int nStartX);
00057     void SetResizeProc(pResizeWndProc proc);
00058     int  GetWidth() { return nWidth; }
00059     int  GetHeight() { return nHeight; }
00060 
00061     //
00062     //  Dropzone support
00063     //
00064     bool      RegisterDropZone(int id, RECT *rect, pDropZoneProc proc);
00065     bool      DeleteDropZone(int id);
00066 
00067 private:
00068 
00069     int       GetNumDropZones() { return nNumDropZones; }
00070     DropZone* GetDropZoneFromRect(RECT *rect);
00071 
00072     //
00073     //  Window procedure - don't call
00074     //
00075        LRESULT CALLBACK WndProc    (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
00076 static LRESULT CALLBACK CardWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
00077 
00078     //
00079     //  Private functions
00080     //
00081     void Paint(HDC hdc);
00082     void PaintCardRgn(HDC hdc, int dx, int dy, int width, int height, int sx, int sy);
00083 
00084     HPALETTE CreateCardPalette();
00085 
00086     CardButton *CardButtonFromPoint(int x, int y);
00087     CardRegion *CardRegionFromPoint(int x, int y);
00088     CardRegion *GetBestStack(int x, int y, int w, int h);
00089 
00090     //
00091     //  Private members
00092     //
00093 
00094     HWND m_hWnd;            //window handle!
00095     int  nWidth, nHeight;
00096 
00097     UINT    nBackCardIdx;   //all stacks share this card index by default
00098 
00099     HBITMAP hbmBackImage;
00100     HDC     hdcBackImage;
00101 
00102 
00103     CardButton  * Buttons[MAXBUTTONS];
00104     int           nNumButtons;
00105 
00106     CardRegion  * Regions[MAXCARDSTACKS];
00107     int           nNumCardRegions;
00108 
00109     DropZone    * dropzone[MAXDROPZONES];
00110     int           nNumDropZones;
00111 
00112     COLORREF  crBackgnd;
00113 
00114     pResizeWndProc  ResizeWndCallback;
00115 
00116 
00117 };
00118 
00119 
00120 #endif

Generated on Thu Feb 9 04:59:29 2012 for ReactOS by doxygen 1.6.3

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.