aboutsummaryrefslogtreecommitdiff
path: root/Src/Wasabi/api/skin/widgets/xuigrid.h
blob: 084c7d4c3e65313b5053c580b1625e7431419d14 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef __GRID_H
#define __GRID_H

#include <api/wnd/wndclass/guiobjwnd.h>
#include <tataki/bitmap/autobitmap.h>
#include <tataki/region/region.h>

#define GRID_PARENT GuiObjectWnd 

// -----------------------------------------------------------------------
class Grid : public GRID_PARENT {
  
  public:

    Grid();
    virtual ~Grid();

    virtual int onPaint(Canvas *c); 
    virtual int setXuiParam(int xuihandle, int xmlattributeid, const wchar_t *xmlattributename, const wchar_t *value);

    void setGridImage(const wchar_t *elementname, int what);
    virtual void getGridRect(RECT *r) { getClientRect(r); }

    virtual api_region *getRegion() { return &reg; }
    virtual int onInit();
    virtual int onResize();
protected:
	/*static */void CreateXMLParameters(int master_handle);
  private:
    void doPaint(Canvas *canvas, int dorgn=0);

    enum {
      GRID_SETTOPLEFT= 0,
      GRID_SETTOP,
      GRID_SETTOPRIGHT,
      GRID_SETLEFT,
      GRID_SETMIDDLE,
      GRID_SETRIGHT,
      GRID_SETBOTTOMLEFT,
      GRID_SETBOTTOM,
      GRID_SETBOTTOMRIGHT,
    };
		static XMLParamPair params[];

    int myxuihandle;

    AutoSkinBitmap topleft,    top,    topright;
    AutoSkinBitmap left,       middle, right;
    AutoSkinBitmap bottomleft, bottom, bottomright;
    RegionI reg;
};


// -----------------------------------------------------------------------
extern const wchar_t GridXuiObjectStr[];
extern char GridXuiSvcName[];
class GridXuiSvc : public XuiObjectSvc<Grid, GridXuiObjectStr, GridXuiSvcName> {};

#endif