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 FXLISTBOX_H
00025
#define FXLISTBOX_H
00026
00027
#ifndef FXPACKER_H
00028
#include "FXPacker.h"
00029
#endif
00030
00031
namespace FX {
00032
00033
00034
00035
enum {
00036
LISTBOX_NORMAL = 0
00037 };
00038
00039
00040
class FXButton;
00041
class FXMenuButton;
00042
class FXList;
00043
class FXPopup;
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
class FXAPI FXListBox :
public FXPacker {
00056 FXDECLARE(FXListBox)
00057 protected:
00058 FXButton *field;
00059 FXMenuButton *button;
00060 FXList *list;
00061 FXPopup *pane;
00062 protected:
00063 FXListBox(){}
00064
private:
00065 FXListBox(
const FXListBox&);
00066 FXListBox &operator=(
const FXListBox&);
00067
public:
00068
long onFocusUp(
FXObject*,FXSelector,
void*);
00069
long onFocusDown(
FXObject*,FXSelector,
void*);
00070
long onFocusSelf(
FXObject*,FXSelector,
void*);
00071
long onFieldButton(
FXObject*,FXSelector,
void*);
00072
long onListUpdate(
FXObject*,FXSelector,
void*);
00073
long onListChanged(
FXObject*,FXSelector,
void*);
00074
long onListClicked(
FXObject*,FXSelector,
void*);
00075
long onCmdSetValue(
FXObject*,FXSelector,
void*);
00076
long onCmdGetIntValue(
FXObject*,FXSelector,
void*);
00077
long onCmdSetIntValue(
FXObject*,FXSelector,
void*);
00078
public:
00079
enum {
00080 ID_LIST=FXPacker::ID_LAST,
00081 ID_FIELD,
00082 ID_LAST
00083 };
00084
public:
00085
00086
00087 FXListBox(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_SUNKEN|FRAME_THICK|LISTBOX_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);
00088
00089
00090
virtual void create();
00091
00092
00093
virtual void detach();
00094
00095
00096
virtual void destroy();
00097
00098
00099
virtual void layout();
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 FXint getNumItems() const;
00115
00116
00117 FXint getNumVisible() const;
00118
00119
00120
void setNumVisible(FXint nvis);
00121
00122
00123 FXbool isItemCurrent(FXint index) const;
00124
00125
00126 virtual
void setCurrentItem(FXint index);
00127
00128
00129 FXint getCurrentItem() const;
00130
00131
00132 FXString getItem(FXint index) const;
00133
00134
00135 FXint setItem(FXint index,const FXString& text,FXIcon* icon=NULL,
void* ptr=NULL);
00136
00137
00138 FXint fillItems(const FXchar** strings,FXIcon* icon=NULL,
void* ptr=NULL);
00139
00140
00141 FXint fillItems(const FXString& strings,FXIcon* icon=NULL,
void* ptr=NULL);
00142
00143
00144 FXint insertItem(FXint index,const FXString& text,FXIcon* icon=NULL,
void* ptr=NULL);
00145
00146
00147 FXint appendItem(const FXString& text,FXIcon* icon=NULL,
void* ptr=NULL);
00148
00149
00150 FXint prependItem(const FXString& text,FXIcon* icon=NULL,
void* ptr=NULL);
00151
00152
00153 FXint moveItem(FXint newindex,FXint oldindex);
00154
00155
00156
void removeItem(FXint index);
00157
00158
00159
void clearItems();
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171 FXint findItem(const FXString& text,FXint start=-1,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183 FXint findItemByData(const
void *ptr,FXint start=-1,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
00184
00185
00186
void setItemText(FXint index,const FXString& text);
00187
00188
00189 FXString getItemText(FXint index) const;
00190
00191
00192
void setItemIcon(FXint index,FXIcon* icon,FXbool owned=FALSE);
00193
00194
00195 FXIcon* getItemIcon(FXint index) const;
00196
00197
00198
void setItemData(FXint index,
void* ptr) const;
00199
00200
00201
void* getItemData(FXint index) const;
00202
00203
00204 FXbool isPaneShown() const;
00205
00206
00207
void sortItems();
00208
00209
00210
void setFont(FXFont* fnt);
00211
00212
00213 FXFont* getFont() const;
00214
00215
00216 virtual
void setBackColor(FXColor clr);
00217
00218
00219 FXColor getBackColor() const;
00220
00221
00222
void setTextColor(FXColor clr);
00223
00224
00225 FXColor getTextColor() const;
00226
00227
00228
void setSelBackColor(FXColor clr);
00229
00230
00231 FXColor getSelBackColor() const;
00232
00233
00234
void setSelTextColor(FXColor clr);
00235
00236
00237 FXColor getSelTextColor() const;
00238
00239
00240 FXListSortFunc getSortFunc() const;
00241
00242
00243
void setSortFunc(FXListSortFunc func);
00244
00245
00246
void setHelpText(const FXString& txt);
00247
00248
00249 const FXString& getHelpText() const;
00250
00251
00252
void setTipText(const FXString& txt);
00253
00254
00255 const FXString& getTipText() const;
00256
00257
00258 virtual
void save(FXStream& store) const;
00259
00260
00261 virtual
void load(FXStream& store);
00262
00263
00264 virtual ~FXListBox();
00265 };
00266
00267 }
00268
00269 #endif