00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FXTABLEBOX_H
00025 #define FXTABLEBOX_H
00026
00027 #ifndef FXPACKER_H
00028 #include <fox/FXPacker.h>
00029 using namespace FX;
00030 #endif
00031 namespace FXEX {
00032
00033
00034 enum {
00035 TABLEBOX_NO_REPLACE = 0,
00036 TABLEBOX_REPLACE = 0x00020000,
00037 TABLEBOX_INSERT_BEFORE = 0x00040000,
00038 TABLEBOX_INSERT_AFTER = 0x00060000,
00039 TABLEBOX_INSERT_FIRST = 0x00080000,
00040 TABLEBOX_INSERT_LAST = 0x00090000,
00041 TABLEBOX_STATIC = 0x00100000,
00042 TABLEBOX_NORMAL = 0
00043 };
00044
00045
00046
00047
00048 class FXAPI FXTableBox : public FXPacker {
00049 FXDECLARE(FXTableBox)
00050
00051 protected:
00052 FXTextField *text;
00053 FXMenuButton *button;
00054 FXIconList *list;
00055 FXPopup *pane;
00056 FXint visible;
00057 FXint boundcol;
00058
00059 protected:
00060 FXTableBox(){}
00061
00062 virtual void layout();
00063
00064 private:
00065 FXTableBox(const FXTableBox&);
00066 FXTableBox &operator=(const FXTableBox&);
00067
00068 public:
00069 long onFocusUp(FXObject*,FXSelector,void*);
00070 long onFocusDown(FXObject*,FXSelector,void*);
00071 long onChanged(FXObject*,FXSelector,void*);
00072 long onCommand(FXObject*,FXSelector,void*);
00073 long onTextButton(FXObject*,FXSelector,void*);
00074 long onTextChanged(FXObject*,FXSelector,void*);
00075 long onTextCommand(FXObject*,FXSelector,void*);
00076 long onListClicked(FXObject*,FXSelector,void*);
00077 long onFwdToText(FXObject*,FXSelector,void*);
00078 long onUpdFmText(FXObject*,FXSelector,void*);
00079
00080 public:
00081 enum {
00082 ID_LIST=FXPacker::ID_LAST,
00083 ID_TEXT,
00084 ID_LAST
00085 };
00086
00087 public:
00088
00089
00090 FXTableBox(FXComposite *p,FXint cols,FXint nvis,FXint bcol,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=TABLEBOX_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
00091
00092
00093 virtual void create();
00094
00095
00096 virtual void detach();
00097
00098
00099 virtual void destroy();
00100
00101
00102 virtual void enable();
00103
00104
00105 virtual void disable();
00106
00107
00108 virtual FXint getDefaultWidth();
00109
00110
00111 virtual FXint getDefaultHeight();
00112
00113
00114 FXbool isEditable() const;
00115
00116
00117 void setEditable(FXbool edit=TRUE);
00118
00119
00120 void setText(const FXString& txt);
00121
00122
00123 FXString getText() const;
00124
00125
00126 void setTextNumCols(FXint cols);
00127
00128
00129 FXint getTextNumCols() const;
00130
00131
00132 FXint getNumVisible() const;
00133
00134
00135 void setNumVisible(FXint nvis);
00136
00137
00138 void setComboStyle(FXuint mode);
00139
00140
00141 FXuint getComboStyle() const;
00142
00143
00144 FXint getBoundCol() const;
00145
00146
00147 void setBoundCol(FXint bcol);
00148
00149
00150 FXint getNumRows() const;
00151
00152
00153 FXint getNumCols() const;
00154
00155
00156 FXHeader* getHeader() const;
00157
00158
00159 void appendHeader(const FXString& text,FXIcon *icon=NULL,FXint size=1);
00160
00161
00162 void removeHeader(FXint index);
00163
00164
00165 void setHeaderText(FXint index,const FXString& text);
00166
00167
00168 FXString getHeaderText(FXint index) const;
00169
00170
00171 void setHeaderIcon(FXint index,FXIcon *icon);
00172
00173
00174 FXIcon* getHeaderIcon(FXint index) const;
00175
00176
00177 void setHeaderSize(FXint index,FXint size);
00178
00179
00180 FXint getHeaderSize(FXint index) const;
00181
00182
00183 FXint getNumHeaders() const;
00184
00185
00186
00187
00188 FXIconItem *getItem(FXint index) const;
00189
00190
00191
00192
00193 FXint setItem(FXint index,FXIconItem* item);
00194
00195
00196 FXint setItem(FXint index,const FXString& text,FXIcon *big=NULL,FXIcon* mini=NULL,void* ptr=NULL);
00197
00198
00199
00200
00201 FXint insertItem(FXint index,FXIconItem* item);
00202
00203
00204 FXint insertItem(FXint index,const FXString& text,FXIcon *big=NULL,FXIcon* mini=NULL,void* ptr=NULL);
00205
00206
00207
00208
00209 FXint appendItem(FXIconItem* item);
00210
00211
00212 FXint appendItem(const FXString& text,FXIcon *big=NULL,FXIcon* mini=NULL,void* ptr=NULL);
00213
00214
00215
00216
00217 FXint prependItem(FXIconItem* item);
00218
00219
00220 FXint prependItem(const FXString& text,FXIcon *big=NULL,FXIcon* mini=NULL,void* ptr=NULL);
00221
00222
00223 void removeItem(FXint index);
00224
00225
00226 void clearItems();
00227
00228
00229 FXint getItemWidth() const;
00230
00231
00232 FXint getItemHeight() const;
00233
00234
00235
00236
00237
00238
00239
00240
00241 FXint findItem(const FXString& text,FXint start=-1,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
00242
00243
00244 void makeItemVisible(FXint index);
00245
00246
00247 void setItemText(FXint index,const FXString& text);
00248
00249
00250 FXString getItemText(FXint index) const;
00251
00252
00253 void setItemColText(FXint index,const FXString& text,FXint col=-1);
00254
00255
00256 FXString getItemColText(FXint index,FXint col=-1) const;
00257
00258
00259 void setItemBigIcon(FXint index,FXIcon* icon);
00260
00261
00262 FXIcon* getItemBigIcon(FXint index) const;
00263
00264
00265 void setItemMiniIcon(FXint index,FXIcon* icon);
00266
00267
00268 FXIcon* getItemMiniIcon(FXint index) const;
00269
00270
00271 void setItemData(FXint index,void* ptr);
00272
00273
00274 void* getItemData(FXint index) const;
00275
00276
00277 FXbool isItemSelected(FXint index) const;
00278
00279
00280 FXbool isItemCurrent(FXint index) const;
00281
00282
00283 FXbool isItemVisible(FXint index) const;
00284
00285
00286 FXbool isItemEnabled(FXint index) const;
00287
00288
00289 FXint hitItem(FXint index,FXint x,FXint y,FXint ww=1,FXint hh=1) const;
00290
00291
00292 void updateItem(FXint index);
00293
00294
00295 FXbool selectInRectangle(FXint x,FXint y,FXint w,FXint h);
00296
00297
00298 FXbool enableItem(FXint index);
00299
00300
00301 FXbool disableItem(FXint index);
00302
00303
00304 FXbool selectItem(FXint index);
00305
00306
00307 FXbool deselectItem(FXint index);
00308
00309
00310 FXbool toggleItem(FXint index);
00311
00312
00313 void setCurrentItem(FXint index);
00314
00315
00316 FXint getCurrentItem() const;
00317
00318
00319 void setAnchorItem(FXint index);
00320
00321
00322 FXint getAnchorItem() const;
00323
00324
00325 FXint getCursorItem() const;
00326
00327
00328 FXbool extendSelection(FXint index);
00329
00330
00331 FXbool killSelection();
00332
00333
00334 void sortItems();
00335
00336
00337 void setItemSpace(FXint s);
00338
00339
00340 FXint getItemSpace() const;
00341
00342
00343 FXIconListSortFunc getSortFunc() const;
00344
00345
00346 void setSortFunc(FXIconListSortFunc func);
00347
00348
00349 FXuint getListStyle() const;
00350
00351
00352 void setListStyle(FXuint style);
00353
00354
00355 void setFont(FXFont* fnt);
00356
00357
00358 FXFont* getFont() const;
00359
00360
00361 void setBackColor(FXColor clr);
00362
00363
00364 FXColor getBackColor() const;
00365
00366
00367 FXColor getTextColor() const;
00368
00369
00370 void setTextColor(FXColor clr);
00371
00372
00373 FXColor getSelBackColor() const;
00374
00375
00376 void setSelBackColor(FXColor clr);
00377
00378
00379 FXColor getSelTextColor() const;
00380
00381
00382 void setSelTextColor(FXColor clr);
00383
00384
00385 void setHelpText(const FXString& txt);
00386
00387
00388 FXString getHelpText() const;
00389
00390
00391 void setTipText(const FXString& txt);
00392
00393
00394 FXString getTipText() const;
00395
00396
00397 virtual void save(FXStream& store) const;
00398
00399
00400 virtual void load(FXStream& store);
00401
00402
00403 virtual ~FXTableBox();
00404 };
00405
00406 }
00407 #endif // FXTABLEBOX_H