mCtrl 0.8.2

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_HVALUETYPE hType;
00133     MC_HVALUE hValue;
00134 } MC_GCELL;
00135 
00143 #define MC_GGM_COLUMNHEADERHEIGHT     (1 << 0)
00144 
00145 #define MC_GGM_ROWHEADERWIDTH         (1 << 1)
00146 
00147 #define MC_GGM_COLUMNWIDTH            (1 << 2)
00148 
00149 #define MC_GGM_ROWHEIGHT              (1 << 3)
00150 
00151 #define MC_GGM_PADDINGHORZ            (1 << 4)
00152 
00153 #define MC_GGM_PADDINGVERT            (1 << 5)
00154 
00156 #ifndef DOXYGEN  /* prevent documentation of these */
00157     /* Deprecated: Use @ref MC_GGM_xxxx instead in new code. */
00158     #define MC_GGF_COLUMNHEADERHEIGHT     MC_GGM_COLUMNHEADERHEIGHT
00159     #define MC_GGF_ROWHEADERWIDTH         MC_GGM_ROWHEADERWIDTH
00160     #define MC_GGF_COLUMNWIDTH            MC_GGM_COLUMNWIDTH
00161     #define MC_GGF_ROWHEIGHT              MC_GGM_ROWHEIGHT
00162     #define MC_GGF_PADDINGHORZ            MC_GGM_PADDINGHORZ
00163     #define MC_GGF_PADDINGVERT            MC_GGM_PADDINGVERT
00164 #endif
00165 
00170 typedef struct MC_GGEOMETRY_tag {
00172     DWORD fMask;
00174     WORD wColumnHeaderHeight;
00176     WORD wRowHeaderWidth;
00178     WORD wColumnWidth;
00180     WORD wRowHeight;
00182     WORD wPaddingHorz;
00184     WORD wPaddingVert;
00185 } MC_GGEOMETRY;
00186 
00191 
00205 #define MC_GM_GETTABLE            (WM_USER + 100)
00206 
00220 #define MC_GM_SETTABLE            (WM_USER + 101)
00221 
00229 #define MC_GM_GETCOLUMNCOUNT      (WM_USER + 102)
00230 
00238 #define MC_GM_GETROWCOUNT         (WM_USER + 103)
00239 
00248 #define MC_GM_RESIZE              (WM_USER + 104)
00249 
00257 #define MC_GM_CLEAR               (WM_USER + 109)
00258 
00267 #define MC_GM_SETCELL             (WM_USER + 110)
00268 
00280 #define MC_GM_GETCELL             (WM_USER + 111)
00281 
00290 #define MC_GM_SETGEOMETRY         (WM_USER + 112)
00291 
00300 #define MC_GM_GETGEOMETRY         (WM_USER + 113)
00301 
00309 
00310 #ifdef UNICODE
00311 
00312     #define MC_WC_GRID          MC_WC_GRIDW
00313 #else
00314     #define MC_WC_GRID          MC_WC_GRIDA
00315 #endif
00316 
00320 #ifdef __cplusplus
00321 }  /* extern "C" */
00322 #endif
00323 
00324 #endif  /* MCTRL_GRID_H */