#if !defined RQLISTBOX_H
#define RQLISTBOX_H
#include <windows.h>
#include "rqfont.h"
#include "rqcanvas.h"
#include "rqcontrol.h"
#include "rqdefs.h"
class RQListBox: public RQControl
{
private:
char *tempItem;
char **tempItems;
int tempItemsCount;
void freeTempItems();
void saveItems();
void loadItems();
protected:
HWND handle;
char *caption;
int itemIndex, itemHeight;
bool sorted;
void messageHandler(HWND, UINT, WPARAM, LPARAM);
HWND getHandle() { return handle; }
RQControl* getParent() { return parent; }
void recreateHandle();
public:
RQListBox();
~RQListBox();
RQFont font;
RQCanvas canvas;
void setParent(RQControl&);
void setItemIndex(int itemIndex);
int getItemIndex();
int getItemCount();
void setItem(int index, const char*);
const char* getItem(int index);
void setItemHeight(int);
int getItemHeight();
void setSorted(bool);
bool getSorted();
void addItem(const char*);
void insertItem(const int, const char*);
void deleteItem(const int);
void clear();
void (*onChange)(RQListBox&);
void (*onDrawItem)(int index, int state, RECT rect, RQListBox&);
};
#endif
|