mCtrl 0.8.1

mCtrl/grid.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2010-2011 Martin Mitas
00003  *
00004  * This library is free software; you can redistribute it and/or modify it
00005  * under the terms of the GNU Lesser General Public License as published by
00006  * the Free Software Foundation; either version 2.1 of the License, or
00007  * (at your option) any later version.
00008  * 
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU Lesser General Public License for more details.
00013  * 
00014  * You should have received a copy of the GNU Lesser General Public License
00015  * along with this library; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00017  */
00018 
00019 #ifndef MCTRL_GRID_H
00020 #define MCTRL_GRID_H
00021 
00022 #include <mCtrl/defs.h>
00023 #include <mCtrl/value.h>
00024 #include <mCtrl/table.h>
00025 
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029 
00030 
00069 BOOL MCTRL_API mcGrid_Initialize(void);
00070 
00076 void MCTRL_API mcGrid_Terminate(void);
00077 
00078 
00084 #define MC_WC_GRIDW            L"mCtrl.grid"
00085 
00086 #define MC_WC_GRIDA             "mCtrl.grid"
00087 
00094 
00096 #define MC_GS_NOTABLECREATE          (0x00000001L)
00097 
00099 #define MC_GS_NOGRIDLINES            (0x00000002L)
00100 
00102 #define MC_GS_COLUMNHEADERNONE       (0x00000000L)
00103 
00104 #define MC_GS_COLUMNHEADERNUMBERED   (0x00001000L)
00105 
00106 #define MC_GS_COLUMNHEADERALPHABETIC (0x00002000L)
00107 
00108 #define MC_GS_COLUMNHEADERCUSTOM     (0x00003000L)
00109 
00111 #define MC_GS_ROWHEADERNONE          (0x00000000L)
00112 
00113 #define MC_GS_ROWHEADERNUMBERED      (0x00004000L)
00114 
00115 #define MC_GS_ROWHEADERALPHABETIC    (0x00008000L)
00116 
00117 #define MC_GS_ROWHEADERCUSTOM        (0x0000C000L)
00118 
00125 typedef struct MC_GCELL_tag {
00127     WORD wCol;
00129     WORD wRow;
00131     MC_VALUETYPE hType;
00133     MC_VALUE hValue;
00134 } MC_GCELL;
00135 
00143 #define MC_GGF_COLUMNHEADERHEIGHT     (1 << 0)
00144 
00145 #define MC_GGF_ROWHEADERWIDTH         (1 << 1)
00146 
00147 #define MC_GGF_COLUMNWIDTH            (1 << 2)
00148 
00149 #define MC_GGF_ROWHEIGHT              (1 << 3)
00150 
00151 #define MC_GGF_PADDINGHORZ            (1 << 4)
00152 
00153 #define MC_GGF_PADDINGVERT            (1 << 5)
00154 
00160 typedef struct MC_GGEOMETRY_tag {
00162     DWORD fMask;
00164     WORD wColumnHeaderHeight;
00166     WORD wRowHeaderWidth;
00168     WORD wColumnWidth;
00170     WORD wRowHeight;
00172     WORD wPaddingHorz;
00174     WORD wPaddingVert;
00175 } MC_GGEOMETRY;
00176 
00181 
00195 #define MC_GM_GETTABLE            (WM_USER + 100)
00196 
00210 #define MC_GM_SETTABLE            (WM_USER + 101)
00211 
00219 #define MC_GM_GETCOLUMNCOUNT      (WM_USER + 102)
00220 
00228 #define MC_GM_GETROWCOUNT         (WM_USER + 103)
00229 
00238 #define MC_GM_RESIZE              (WM_USER + 104)
00239 
00247 #define MC_GM_CLEAR               (WM_USER + 109)
00248 
00257 #define MC_GM_SETCELL             (WM_USER + 110)
00258 
00270 #define MC_GM_GETCELL             (WM_USER + 111)
00271 
00280 #define MC_GM_SETGEOMETRY         (WM_USER + 112)
00281 
00290 #define MC_GM_GETGEOMETRY         (WM_USER + 113)
00291 
00299 
00300 #ifdef UNICODE
00301 
00302     #define MC_WC_GRID          MC_WC_GRIDW
00303 #else
00304     #define MC_WC_GRID          MC_WC_GRIDA
00305 #endif
00306 
00310 #ifdef __cplusplus
00311 }  /* extern "C" */
00312 #endif
00313 
00314 #endif  /* MCTRL_GRID_H */