23 #ifndef BAGEL_BOFLIB_GUI_LIST_BOX_H 24 #define BAGEL_BOFLIB_GUI_LIST_BOX_H 26 #include "bagel/boflib/gui/window.h" 27 #include "bagel/boflib/list.h" 28 #include "bagel/boflib/string.h" 32 #define LISTBOX_NORMAL 0 33 #define LISTBOX_SELECT 1 34 #define LISTBOX_USENOW 2 35 #define COLOR_USE_DEFAULT 0xFFFFFFFF 41 _nTextLineColor = COLOR_USE_DEFAULT;
46 RGBCOLOR _nTextLineColor;
54 void setSelectedItem(
int nItem,
bool bRepaint =
true);
56 void insertBefore(
int nIndex,
const CBofString &cString,
bool bRepaint =
true);
57 void insertAfter(
int nIndex,
const CBofString &cString,
bool bRepaint =
true);
59 void addToHead(
const CBofString &cString,
bool bRepaint =
true);
60 void addToTail(
const CBofString &cString,
bool bRepaint =
true);
62 ErrorCode delItem(
int nIndex,
bool bRepaint =
true);
63 ErrorCode deleteAll(
bool bRepaint =
true);
69 void setText(
int nIndex,
const CBofString &cStr);
71 void setTextLineColor(
int nIndex, RGBCOLOR rgbColor);
76 ErrorCode lineDown() {
81 return scrollUp(_nPageSize);
83 ErrorCode pageDown() {
84 return scrollDown(_nPageSize);
87 ErrorCode scrollUp(
int nLines);
88 ErrorCode scrollDown(
const int nLines) {
89 return scrollUp(-nLines);
92 ErrorCode scrollTo(
int nLine);
94 ErrorCode createWorkArea();
95 ErrorCode saveBackground();
96 void killBackground();
98 void setHighlightColor(RGBCOLOR cHighColor) {
99 _cHighColor = cHighColor;
101 RGBCOLOR getHighlightColor() {
105 void setTextColor(RGBCOLOR cColor) {
106 _cTextColor = cColor;
108 RGBCOLOR getTextColor() {
112 void setPointSize(
int nSize) {
119 void setWeight(
int nWeight) {
120 _nTextWeight = nWeight;
126 void setItemHeight(
int nHeight) {
127 _nItemHeight = nHeight;
129 int getItemHeight() {
133 void setFont(
int nFont) {
144 virtual ErrorCode repaintItem(
int nIndex);
145 virtual ErrorCode repaintAll();
148 virtual void onLButtonDown(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr);
149 virtual void onLButtonDblClk(uint32 nFlags,
CBofPoint *pPoint);
150 virtual void onKeyHit(uint32 lKey, uint32 lRepCount);
151 virtual void onPaint(
CBofRect *pRect);
156 virtual void clearSelection();
167 RGBCOLOR _cTextColor;
168 RGBCOLOR _cHighColor;
Definition: list_box.h:37
Definition: list_box.h:49