2007-12-30 16:41:49 +00:00
|
|
|
#ifndef __GCOMBOBOX_H
|
|
|
|
#define __GCOMBOBOX_H
|
|
|
|
|
|
|
|
#include "gtextbox.h"
|
2008-09-09 11:03:47 +00:00
|
|
|
#include "gtree.h"
|
2007-12-30 16:41:49 +00:00
|
|
|
|
|
|
|
class gComboBox : public gTextBox
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
gComboBox(gContainer *parent);
|
2008-09-09 11:03:47 +00:00
|
|
|
~gComboBox();
|
2007-12-30 16:41:49 +00:00
|
|
|
|
|
|
|
int count();
|
|
|
|
int index();
|
|
|
|
char* itemText(int ind);
|
|
|
|
virtual int length();
|
|
|
|
//char** list();
|
|
|
|
virtual bool isReadOnly();
|
2008-09-09 11:03:47 +00:00
|
|
|
bool isSorted();
|
2007-12-30 16:41:49 +00:00
|
|
|
virtual char *text();
|
|
|
|
|
|
|
|
void setIndex(int vl);
|
2008-04-17 10:18:25 +00:00
|
|
|
void setItemText(int ind, const char *txt);
|
2007-12-30 16:41:49 +00:00
|
|
|
//void setList(char **vl);
|
|
|
|
virtual void setReadOnly(bool vl);
|
|
|
|
void setSorted(bool vl);
|
2008-04-17 10:18:25 +00:00
|
|
|
virtual void setText(const char *vl);
|
2007-12-30 16:41:49 +00:00
|
|
|
|
|
|
|
//"Methods"
|
|
|
|
void popup();
|
2008-04-17 10:18:25 +00:00
|
|
|
void add(const char *vl, int pos = -1);
|
2007-12-30 16:41:49 +00:00
|
|
|
virtual void clear();
|
2008-04-17 10:18:25 +00:00
|
|
|
int find(const char *ptr);
|
2007-12-30 16:41:49 +00:00
|
|
|
void remove(int pos);
|
|
|
|
|
|
|
|
virtual void resize(int w, int h);
|
|
|
|
virtual void setRealBackground(gColor vl);
|
|
|
|
virtual void setRealForeground(gColor vl);
|
|
|
|
virtual void setFont(gFont *f);
|
|
|
|
virtual void setFocus();
|
|
|
|
|
|
|
|
//"Signals"
|
|
|
|
void (*onClick)(gComboBox *sender);
|
|
|
|
|
|
|
|
//"Private"
|
|
|
|
bool sort;
|
|
|
|
GtkCellRenderer *cell;
|
|
|
|
virtual int minimumHeight();
|
2008-06-26 09:49:06 +00:00
|
|
|
bool _no_click;
|
2008-09-09 11:03:47 +00:00
|
|
|
gTree *tree;
|
|
|
|
bool _model_dirty;
|
|
|
|
int _last_key;
|
2009-05-15 17:57:29 +00:00
|
|
|
GtkWidget *_button;
|
2008-09-09 11:03:47 +00:00
|
|
|
|
|
|
|
void updateModel();
|
|
|
|
void updateSort();
|
|
|
|
char *indexToKey(int index);
|
|
|
|
char* find(GtkTreePath *path) { return tree->pathToKey(path, false); }
|
2008-09-26 02:25:29 +00:00
|
|
|
void checkIndex();
|
2009-05-15 17:57:29 +00:00
|
|
|
void updateFocusHandler();
|
2007-12-30 16:41:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|