15 #include "uibasemod.h" 66 uiListBoxBody& body() {
return *body_; }
78 friend class uiListBoxBody;
82 BelowLeft, BelowMid, BelowRight };
110 uiListBoxObj*
box() {
return lb_; }
115 void setLabelText(
const uiString&,
int nr=0);
121 void setMultiChoice(
bool yn=
true);
122 void setAllowNoneChosen(
bool);
123 void setNotSelectable();
126 inline bool isEmpty()
const {
return size() == 0; }
127 bool validIdx(
int)
const;
128 bool isPresent(
const char*)
const;
129 int maxNrOfChoices()
const;
133 void setNrLines(
int);
134 void setFieldWidth(
int);
139 void removeItem(
int);
140 void removeItem(
const char*);
142 { removeItem( fs.
str() ); }
143 void setAllowDuplicates(
bool yn);
144 void addItem(
const uiString&,
bool marked=
false,
int id=-1);
147 void addItems(
const char**);
150 void insertItem(
const uiString&,
int idx=-1,
151 bool marked=
false,
int id=-1);
153 int idx=-1,
int id=-1);
155 int idx=-1,
int id=-1);
156 void setPixmap(
int,
const Color&);
157 void setPixmap(
int,
const uiPixmap&);
158 void setIcon(
int,
const char* icon_identifier);
159 void setColor(
int,
const Color&);
160 Color getColor(
int)
const;
162 void sortItems(
bool asc=
true);
164 int indexOf(
const char*)
const;
165 const char* textOfItem(
int)
const;
166 void setItemText(
int,
const uiString&);
169 int currentItem()
const;
170 const char*
getText()
const {
return textOfItem(currentItem()); }
171 void setCurrentItem(
int);
172 void setCurrentItem(
const char*);
174 { setCurrentItem( fs.
str() ); }
175 void setItemSelectable(
int,
bool);
177 int nrChosen()
const;
178 bool isChoosable(
int)
const;
179 bool isChosen(
int)
const;
180 int firstChosen()
const;
181 int nextChosen(
int prev=-1)
const;
184 void setChoosable(
int,
bool yn);
185 void setChosen(
int,
bool yn=
true);
187 void chooseAll(
bool yn=
true);
191 bool isMarked(
int)
const;
192 void setMarked(
int,
bool);
194 void setItemID(
int idx,
int id);
195 int currentItemID()
const;
196 int getItemID(
int idx)
const;
197 int getItemIdx(
int id)
const;
200 void scrollToBottom();
201 bool handleLongTabletPress();
202 void disableRightClick(
bool yn);
215 { retrievecb_ = rcb; savecb_ = wcb; }
219 void translateText();
232 void handleCheckChange(
mQtclass(QListWidgetItem*));
233 void usrChooseAll(
bool yn=
true);
236 int optimumFieldWidth(
int minwdth=20,
int maxwdth=40)
const;
237 static int cDefNrLines();
239 void updateFields2ChoiceMode();
240 void initNewItem(
int);
241 void setItemCheckable(
int,
bool);
244 void setAllItemsChecked(
bool);
245 void setItemChecked(
int,
bool);
246 void setItemChecked(
const char*,
bool);
247 bool isItemChecked(
const char*)
const;
248 int nrChecked()
const;
263 void updateCheckState();
264 void addItemNoUpdate(
const uiString&,
bool marked=
false,
269 bool isItemChecked(
int)
const;
276 int prefNrLines=0,
int prefFieldWidth=0);
279 int prefNrLines=0,
int prefFieldWidth=0);
292 BelowLeft, BelowMid, BelowRight };
301 uiListBox*
box() {
return this; }
void blockScrolling(bool yn)
Definition: uilistbox.h:203
#define mExpClass(module)
Definition: commondefs.h:160
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
ChoiceMode
What to choose from any list-type UI object.
Definition: oduicommon.h:42
BufferString rettxt_
Definition: uilistbox.h:225
Definition: uilistbox.h:84
const char * str() const
Definition: odstring.h:48
#define mQtclass(cls)
Definition: commondefs.h:229
bool isNone() const
Definition: uilistbox.h:235
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
bool scrollingblocked_
Definition: uilistbox.h:229
Definition: uilistbox.h:290
OD::String that holds an existing text string.
Definition: fixedstring.h:29
Definition: uilistbox.h:291
Definition: oduicommon.h:45
Definition: uilistbox.h:81
Definition: uilistbox.h:80
LblPos
Definition: uilistbox.h:80
ObjectSet< uiLabel > lbls_
Definition: uilistbox.h:256
The base class for most UI elements.
Definition: uiobj.h:38
uiGroup * checkgrp_
Definition: uilistbox.h:257
CallBack savecb_
Definition: uilistbox.h:227
Definition: uistring.h:89
Definition: uiparent.h:26
Set of BufferString objects.
Definition: bufstringset.h:28
ObjectSet< T >::size_type indexOf(const ObjectSet< T > &os, const S &val)
Locate object in set.
Definition: objectset.h:169
Definition: uilistbox.h:80
uiCheckBox * cb_
Definition: uilistbox.h:258
bool allowduplicates_
Definition: uilistbox.h:223
List Box.
Definition: uilistbox.h:75
Notifier< uiListBox > rightButtonClicked
Definition: uilistbox.h:209
OD::ChoiceMode choiceMode() const
Definition: uilistbox.h:117
ButtonState
Definition: keyenum.h:20
SzPolicy
How should the object's size behave? Undef : use default. Small : 1 base sz. Medium : 2* base sz + 1...
Definition: uiobj.h:58
uiLabeledListBox. Deprecated. Don't use in new code
Definition: uilistbox.h:286
OD::ChoiceMode choicemode_
Definition: uilistbox.h:221
uiMenu & rightclickmnu_
Definition: uilistbox.h:224
uiListBoxObj * box()
Definition: uilistbox.h:110
int nrLabels() const
Definition: uilistbox.h:113
CNotifier< uiListBox, int > itemChosen
Definition: uilistbox.h:206
HPos
Definition: draw.h:26
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:137
#define mFDQtclass(cls)
Definition: commondefs.h:228
Notifier< uiListBox > deleteButtonPressed
Definition: uilistbox.h:211
Off-screen pixel-based paint device.
Definition: uipixmap.h:34
OD::ButtonState buttonstate_
Definition: uilistbox.h:226
Definition: oduicommon.h:44
bool isMultiChoice() const
Definition: uilistbox.h:118
Notifier< uiListBox > leftButtonClicked
Definition: uilistbox.h:210
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
uiLabel * label(int nr=0)
Definition: uilistbox.h:114
void setCurrentItem(const FixedString &fs)
Definition: uilistbox.h:173
bool isEmpty() const
Definition: uilistbox.h:126
uiCheckBox * masterCheckBox()
Definition: uilistbox.h:112
Notifier< uiListBox > selectionChanged
Definition: uilistbox.h:205
void setItemsCheckable(bool yn)
Definition: uilistbox.h:243
const char * getText() const
Definition: uilistbox.h:170
uiGroup * checkGroup()
Definition: uilistbox.h:111
Alignment::HPos alignment() const
Definition: uilistbox.h:131
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
Alignment::HPos alignment_
Definition: uilistbox.h:222
Definition: uistring.h:218
static uiString sEmptyString()
Definition: uistrings.h:286
void offerReadWriteSelection(const CallBack &rcb, const CallBack &wcb)
Definition: uilistbox.h:213
bool isMultiChoice(OD::ChoiceMode cm)
Definition: oduicommon.h:90
uiListBox * box()
Definition: uilistbox.h:301
CallBacks object-oriented (object + method).
Definition: callback.h:57
Setup(OD::ChoiceMode icm=OD::ChooseOnlyOne, const uiString &l=uiStrings::sEmptyString(), uiListBox::LblPos lp=uiListBox::LeftTop)
Definition: uilistbox.h:87
Definition: uibutton.h:134
Notifier< uiListBox > doubleClicked
Definition: uilistbox.h:208
Helper class for uiListBox to relay Qt's messages.
Definition: i_qlistbox.h:27
void removeItem(const FixedString &fs)
Definition: uilistbox.h:141
CallBack retrievecb_
Definition: uilistbox.h:228
uiListBoxObj * lb_
Definition: uilistbox.h:255