23#ifndef BAGEL_BOFLIB_GUI_LIST_BOX_H
24#define BAGEL_BOFLIB_GUI_LIST_BOX_H
26#include "bagel/spacebar/boflib/gui/window.h"
27#include "bagel/spacebar/boflib/list.h"
28#include "bagel/boflib/string.h"
33#define LISTBOX_NORMAL 0
34#define LISTBOX_SELECT 1
35#define LISTBOX_USENOW 2
36#define COLOR_USE_DEFAULT 0xFFFFFFFF
42 _nTextLineColor = COLOR_USE_DEFAULT;
47 COLORREF _nTextLineColor;
55 void setSelectedItem(
int nItem,
bool bRepaint =
true);
57 void insertBefore(
int nIndex,
const CBofString &cString,
bool bRepaint =
true);
58 void insertAfter(
int nIndex,
const CBofString &cString,
bool bRepaint =
true);
60 void addToHead(
const CBofString &cString,
bool bRepaint =
true);
61 void addToTail(
const CBofString &cString,
bool bRepaint =
true);
63 ErrorCode delItem(
int nIndex,
bool bRepaint =
true);
64 ErrorCode deleteAll(
bool bRepaint =
true);
70 void setText(
int nIndex,
const CBofString &cStr);
72 void setTextLineColor(
int nIndex, COLORREF rgbColor);
77 ErrorCode lineDown() {
82 return scrollUp(_nPageSize);
84 ErrorCode pageDown() {
85 return scrollDown(_nPageSize);
88 ErrorCode scrollUp(
int nLines);
89 ErrorCode scrollDown(
const int nLines) {
90 return scrollUp(-nLines);
93 ErrorCode scrollTo(
int nLine);
95 ErrorCode createWorkArea();
96 ErrorCode saveBackground();
97 void killBackground();
99 void setHighlightColor(COLORREF cHighColor) {
100 _cHighColor = cHighColor;
102 COLORREF getHighlightColor() {
106 void setTextColor(COLORREF cColor) {
107 _cTextColor = cColor;
109 COLORREF getTextColor() {
113 void setPointSize(
int nSize) {
120 void setWeight(
int nWeight) {
121 _nTextWeight = nWeight;
127 void setItemHeight(
int nHeight) {
128 _nItemHeight = nHeight;
130 int getItemHeight() {
134 void setFont(
int nFont) {
145 virtual ErrorCode repaintItem(
int nIndex);
146 virtual ErrorCode repaintAll();
149 virtual void onLButtonDown(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr);
150 virtual void onLButtonDblClk(uint32 nFlags,
CBofPoint *pPoint);
151 virtual void onKeyHit(uint32 lKey, uint32 lRepCount);
152 virtual void onPaint(
CBofRect *pRect);
168 COLORREF _cTextColor;
169 COLORREF _cHighColor;
Definition: list_box.h:50
virtual void clearSelection()
Definition: list_box.h:38