NXWidgets  1.19
clistbox.cxx
Go to the documentation of this file.
1 /****************************************************************************
2  * NxWidgets/libnxwidgets/src/clistbox.cxx
3  *
4  * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
5  * Author: Gregory Nutt <gnutt@nuttx.org>
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  * 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
18  * me be used to endorse or promote products derived from this software
19  * without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  ****************************************************************************
35  *
36  * Portions of this package derive from Woopsi (http://woopsi.org/) and
37  * portions are original efforts. It is difficult to determine at this
38  * point what parts are original efforts and which parts derive from Woopsi.
39  * However, in any event, the work of Antony Dzeryn will be acknowledged
40  * in most NxWidget files. Thanks Antony!
41  *
42  * Copyright (c) 2007-2011, Antony Dzeryn
43  * All rights reserved.
44  *
45  * Redistribution and use in source and binary forms, with or without
46  * modification, are permitted provided that the following conditions are met:
47  *
48  * * Redistributions of source code must retain the above copyright
49  * notice, this list of conditions and the following disclaimer.
50  * * Redistributions in binary form must reproduce the above copyright
51  * notice, this list of conditions and the following disclaimer in the
52  * documentation and/or other materials provided with the distribution.
53  * * Neither the names "Woopsi", "Simian Zombie" nor the
54  * names of its contributors may be used to endorse or promote products
55  * derived from this software without specific prior written permission.
56  *
57  * THIS SOFTWARE IS PROVIDED BY Antony Dzeryn ``AS IS'' AND ANY
58  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
59  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
60  * DISCLAIMED. IN NO EVENT SHALL Antony Dzeryn BE LIABLE FOR ANY
61  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
62  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
63  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
64  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
65  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
66  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67  *
68  ****************************************************************************/
69 
70 /****************************************************************************
71  * Included Files
72  ****************************************************************************/
73 
74 #include <nuttx/config.h>
75 
76 #include <cstdint>
77 #include <cstdbool>
78 
79 #include "cwidgetcontrol.hxx"
80 #include "clistbox.hxx"
81 #include "cgraphicsport.hxx"
82 #include "cnxfont.hxx"
83 #include "singletons.hxx"
84 
85 /****************************************************************************
86  * Pre-Processor Definitions
87  ****************************************************************************/
88 
89 /****************************************************************************
90  * Method Implementations
91  ****************************************************************************/
92 
93 using namespace NXWidgets;
94 
95 /**
96  * Constructor.
97  *
98  * @param pWidgetControl The controlling widget for the display.
99  * @param x The x coordinate of the widget.
100  * @param y The y coordinate of the widget.
101  * @param width The width of the widget.
102  * @param height The height of the widget.
103  * @param style The style that the widget should use. If this is not
104  * specified, the widget will use the values stored in the global
105  * g_defaultWidgetStyle object. The widget will copy the properties of
106  * the style into its own internal style object.
107  */
108 
110  nxgl_coord_t x, nxgl_coord_t y,
111  nxgl_coord_t width, nxgl_coord_t height,
112  CWidgetStyle *style)
113 : CScrollingPanel(pWidgetControl, x, y, width, height, 0, style)
114 {
115  m_flags.draggable = true;
116  m_flags.doubleClickable = true;
117  m_optionPadding = 2;
119  m_lastSelectedIndex = -1;
120 
121  // Disallow horizontal scrolling
122 
124 }
125 
126 /**
127  * Destructor.
128  */
129 
131 {
133 }
134 
135 
136 /**
137  * Add a new option to the widget using default colors.
138  *
139  * @param text Text to show in the option.
140  * @param value The value of the option.
141  */
142 
143 void CListBox::addOption(const CNxString &text, const uint32_t value)
144 {
145  addOption(text, value,
148 }
149 
150 /**
151  * Add an option to the widget.
152  *
153  * @param option The option to add.
154  */
155 
157 {
158  m_options.addItem(option);
159 }
160 
161 /**
162  * Remove an option from the widget by its index.
163  *
164  * @param index The index of the option to remove.
165  */
166 
167 void CListBox::removeOption(const int index)
168 {
169  m_options.removeItem(index);
170 }
171 
172 /**
173  * Remove all options from the widget.
174  */
175 
177 {
179 }
180 
181 /**
182  * Add a new option to the widget.
183  *
184  * @param text Text to show in the option.
185  * @param value The value of the option.
186  * @param normalTextColor Color to draw the text with when not selected.
187  * @param normalBackColor Color to draw the background with when not selected.
188  * @param selectedTextColor Color to draw the text with when selected.
189  * @param selectedBackColor Color to draw the background with when selected.
190  */
191 
192 void CListBox::addOption(const CNxString &text, const uint32_t value,
193  const nxwidget_pixel_t normalTextColor,
194  const nxwidget_pixel_t normalBackColor,
195  const nxwidget_pixel_t selectedTextColor,
196  const nxwidget_pixel_t selectedBackColor)
197 {
198  addOption(new CListBoxDataItem(text, value,
199  normalTextColor, normalBackColor,
200  selectedTextColor, selectedBackColor));
201 }
202 
203 /**
204  * Select an option by its index.
205  * Redraws the widget and raises a value changed event.
206  *
207  * @param index The index of the option to select.
208  */
209 
210 void CListBox::selectOption(const int index)
211 {
212  setOptionSelected(index, true);
213 }
214 
215 /**
216  * Select an option by its index.
217  * Redraws the widget and raises a value changed event.
218  *
219  * @param index The index of the option to select.
220  */
221 
222 void CListBox::deselectOption(const int index)
223 {
224  setOptionSelected(index, false);
225 }
226 
227 /**
228  * Select all options. Does nothing if the listbox does not allow
229  * multiple selections. Redraws the widget and raises a value changed
230  * event.
231  */
232 
234 {
236 }
237 
238 /**
239  * Deselect all options.
240  * Redraws the widget and raises a value changed event.
241  */
242 
244 {
246 }
247 
248 /**
249  * Get the selected index. Returns -1 if nothing is selected. If
250  * more than one option is selected, the index of the first selected
251  * option is returned.
252  *
253  * @return The selected index.
254  */
255 
256 const int CListBox::getSelectedIndex(void) const
257 {
258  return m_options.getSelectedIndex();
259 }
260 
261 /**
262  * Sets the selected index. Specify -1 to select nothing. Resets any
263  * other selected options to deselected. Redraws the widget and raises
264  * a value changed event.
265  *
266  * @param index The selected index.
267  */
268 
269 void CListBox::setSelectedIndex(const int index)
270 {
271  setOptionSelected(index, true);
272 }
273 
274 /**
275  * Get the selected option. Returns NULL if nothing is selected.
276  *
277  * @return The selected option.
278  */
279 
281 {
282  return (const CListBoxDataItem*)m_options.getSelectedItem();
283 }
284 
285 /**
286  * Resize the scrolling canvas to encompass all options.
287  */
288 
290 {
291  // Get client area
292 
293  CRect rect;
294  getClientRect(rect);
295 
296  int oldCanvasHeight = m_canvasHeight;
297 
298  // Resize the canvas
299 
301 
302  // Ensure canvas is at least as tall as the widget
303 
305 
306  // If resize has left scroll position beyond end of canvas, adjust
307  // to compensate
308 
309  if (m_canvasY + (m_canvasHeight - getHeight()) < 0)
310  {
311  scroll(0, -(oldCanvasHeight - (m_canvasHeight - getHeight())));
312  }
313 }
314 
315 /**
316  * Sort the options alphabetically by the text of the options.
317  */
318 
319 void CListBox::sort(void)
320 {
321  m_options.sort();
322 }
323 
324 /**
325  * Get the height of a single option.
326  *
327  * @return The height of an option.
328  */
329 
330 const nxgl_coord_t CListBox::getOptionHeight(void) const
331 {
332  return getFont()->getHeight() + (m_optionPadding << 1);
333 }
334 
335 /**
336  * Handles list data changed events.
337  *
338  * @param e Event arguments.
339  */
340 
342 {
343  // Forget the last selected item as it may have changed
344 
345  m_lastSelectedIndex = -1;
346  resizeCanvas();
347  redraw();
348 }
349 
350 /**
351  * Handles list selection changed events.
352  *
353  * @param e Event arguments.
354  */
355 
357 {
358  redraw();
360 }
361 
362 /**
363  * Insert the dimensions that this widget wants to have into the rect
364  * passed in as a parameter. All coordinates are relative to the widget's
365  * parent. Value is based on the length of the largest string in the
366  * set of options.
367  *
368  * @param rect Reference to a rect to populate with data.
369  */
370 
372 {
373  nxgl_coord_t width;
374  nxgl_coord_t height;
375 
376  if (!m_flags.borderless)
377  {
379  height = m_borderSize.top + m_borderSize.bottom;
380  }
381  else
382  {
383  width = 0;
384  height = 0;
385  }
386 
387  nxgl_coord_t maxWidth = 0;
388  nxgl_coord_t optionWidth = 0;
389 
390  // Locate longest string in options
391 
392  for (int i = 0; i < m_options.getItemCount(); ++i)
393  {
394  optionWidth = getFont()->getStringWidth(m_options.getItem(i)->getText());
395 
396  if (optionWidth > maxWidth)
397  {
398  maxWidth = optionWidth;
399  }
400  }
401 
402  rect.setX(m_rect.getX());
403  rect.setY(m_rect.getY());
404  rect.setWidth(width + (m_optionPadding << 1) + maxWidth);
405  rect.setHeight(height + getOptionHeight() * 3);
406 }
407 
408 /**
409  * Check if the click is a double-click.
410  *
411  * @param x X coordinate of the click.
412  * @param y Y coordinate of the click.
413  * @return True if the click is a double-click.
414  */
415 
416 bool CListBox::isDoubleClick(nxgl_coord_t x, nxgl_coord_t y)
417 {
418  if (CNxWidget::isDoubleClick(x, y))
419  {
420  // Calculate which option was clicked
421 
422  int selectedIndex = (-m_canvasY + (y - getY())) / getOptionHeight();
423 
424  // Has the same option been clicked twice? Ignore double-clicks that
425  // occur on different items
426 
427  if (selectedIndex == m_lastSelectedIndex)
428  {
429  // Process click as a double-click
430 
431  return true;
432  }
433  }
434 
435  return false;
436 }
437 
438 /**
439  * Draw the area of this widget that falls within the clipping region.
440  * Called by the redraw() function to draw all visible regions.
441  *
442  * @param port The CGraphicsPort to draw to.
443  * @see redraw()
444  */
445 
447 {
448  // Get the drawing region (excluding the borders)
449 
450  CRect rect;
451  getRect(rect);
452 
453  // Draw background
454 
455  port->drawFilledRect(rect.getX(), rect.getY(),
456  rect.getWidth(), rect.getHeight(),
458 
459  // Calculate clipping values
460 
461  nxgl_coord_t clipX = rect.getX();
462  nxgl_coord_t clipY = rect.getY();
463  nxgl_coord_t clipHeight = rect.getHeight();
464 
465  // Precalculate values for option draw loop
466 
467  nxgl_coord_t optionHeight = getOptionHeight();
468 
469  // Ensure that we subtract 1 from topOption to ensure that the option
470  // above is drawn if it is partially visible
471 
472  int topOption = ((clipY - m_canvasY) / optionHeight) - 1;
473 
474  // Ensure that we add 2 to the bottom option to ensure that the option
475  // below is draw if it is partially visible - subbing 1 from topOption
476  // means we need to add an additional 1 to compensate
477 
478  int bottomOption = topOption + (clipHeight / optionHeight) + 2;
479 
480  // Ensure top options is not negative
481 
482  if (topOption < 0)
483  {
484  topOption = 0;
485  }
486 
487  // Ensure bottom option does not exceed number of options
488 
489  if (bottomOption >= m_options.getItemCount())
490  {
491  bottomOption = m_options.getItemCount() - 1;
492  }
493 
494  // Calculate values for loop
495 
496  int y = m_canvasY + (topOption * optionHeight);
497  int i = topOption;
498 
499  const CListBoxDataItem *item = (CListBoxDataItem *)NULL;
500 
501  // Loop through all options drawing each ones
502 
503  while (i <= bottomOption)
504  {
505  item = (const CListBoxDataItem*)m_options.getItem(i);
506 
507  // Is the option selected?
508 
509  if (item->isSelected())
510  {
511  // Draw background
512 
513  if (item->getSelectedBackColor() != getBackgroundColor())
514  {
515  port->drawFilledRect(rect.getX(), rect.getY() + y,
516  rect.getWidth(), optionHeight,
517  item->getSelectedBackColor());
518  }
519 
520  // Draw text
521 
522  struct nxgl_point_s pos;
523  pos.x = rect.getX() + m_optionPadding;
524  pos.y = rect.getY() + y + m_optionPadding;
525 
526  if (isEnabled())
527  {
528  port->drawText(&pos, &rect, getFont(), item->getText(), 0,
529  item->getText().getLength(),
530  item->getSelectedTextColor());
531  }
532  else
533  {
534  port->drawText(&pos, &rect, getFont(), item->getText(), 0,
535  item->getText().getLength(),
537  }
538  }
539  else
540  {
541  // Draw background
542 
543  if (item->getNormalBackColor() != getBackgroundColor())
544  {
545  port->drawFilledRect(clipX, y, getWidth(), optionHeight,
546  item->getNormalBackColor());
547  }
548 
549  // Draw text
550 
551  struct nxgl_point_s pos;
552  pos.x = rect.getX() + m_optionPadding;
553  pos.y = rect.getY() + y + m_optionPadding;
554 
555  if (isEnabled())
556  {
557  port->drawText(&pos, &rect, getFont(), item->getText(), 0,
558  item->getText().getLength(),
559  item->getNormalTextColor());
560  }
561  else
562  {
563  port->drawText(&pos, &rect, getFont(), item->getText(), 0,
564  item->getText().getLength(),
566  }
567  }
568 
569  i++;
570  y += optionHeight;
571  }
572 }
573 
574 /**
575  * Draw the area of this widget that falls within the clipping region.
576  * Called by the redraw() function to draw all visible regions.
577  *
578  * @param port The CGraphicsPort to draw to.
579  * @see redraw()
580  */
581 
583 {
584  // Stop drawing if the widget indicates it should not have an outline
585 
586  if (!isBorderless())
587  {
588  port->drawBevelledRect(0, 0, getWidth(), getHeight(),
590  }
591 }
592 
593 /**
594  * Determines which item was clicked and selects or deselects it as
595  * appropriate. Also starts the dragging system.
596  *
597  * @param x The x coordinate of the click.
598  * @param y The y coordinate of the click.
599  */
600 
601 void CListBox::onClick(nxgl_coord_t x, nxgl_coord_t y)
602 {
603  // Calculate which option was clicked
604 
606 
607  const CListBoxDataItem *item =
609 
610  if (!item)
611  {
612  return; // No item at click position
613  }
614 
615  // Are we selecting or de-selecting?
616 
617  if (item->isSelected())
618  {
619  // Deselecting
620 
622  }
623  else
624  {
625  // Selecting
626 
628  }
629 
630  startDragging(x, y);
631 }
632 
633 /**
634  * Selects the clicked item and deselects all others.
635  *
636  * @param x The x coordinate of the click.
637  * @param y The y coordinate of the click.
638  */
639 
640 void CListBox::onDoubleClick(nxgl_coord_t x, nxgl_coord_t y)
641 {
642  // Calculate which option was clicked
643 
644  int newSelectedIndex = (-m_canvasY + (y - getY())) / getOptionHeight();
645 
646  // Double-click - select the item exclusively
647 
649  setSelectedIndex(newSelectedIndex);
651 }
652 
653 /**
654  * Select or deselect an option by its index. Does not deselect any other selected options.
655  * Set index to -1 to select nothing.
656  * Redraws the widget and raises a value changed event.
657  *
658  * @param index The index of the option to select.
659  * @param selected True to select the option, false to deselect it.
660  */
661 
662 void CListBox::setOptionSelected(const int index, bool selected)
663 {
664  m_options.setItemSelected(index, selected);
665 }
virtual void getPreferredDimensions(CRect &rect) const
Definition: clistbox.cxx:371
const bool isSelected(void) const
WidgetBorderSize m_borderSize
Definition: cnxwidget.hxx:208
bool isBorderless(void) const
Definition: cnxwidget.hxx:549
nxgl_mxpixel_t getShadowEdgeColor(void) const
Definition: cnxwidget.hxx:749
nxwidget_pixel_t getNormalTextColor(void) const
nxwidget_pixel_t getNormalBackColor(void) const
nxgl_coord_t getHeight(void) const
Definition: crect.hxx:204
virtual const CListDataItem * getItem(const int index) const
Definition: clistdata.hxx:260
virtual bool isDoubleClick(nxgl_coord_t x, nxgl_coord_t y)
Definition: cnxwidget.cxx:687
virtual void removeOption(const int index)
Definition: clistbox.cxx:167
virtual void sort(void)
Definition: clistbox.cxx:319
virtual void handleListDataSelectionChangedEvent(const CListDataEventArgs &e)
Definition: clistbox.cxx:356
CListData m_options
Definition: clistbox.hxx:117
void getRect(CRect &rect) const
Definition: cnxwidget.cxx:448
virtual void resizeCanvas(void)
Definition: clistbox.cxx:289
virtual void setSelectedIndex(const int index)
Definition: clistbox.cxx:269
virtual void onClick(nxgl_coord_t x, nxgl_coord_t y)
Definition: clistbox.cxx:601
nxgl_coord_t getWidth(void) const
Definition: crect.hxx:181
void drawBevelledRect(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, nxgl_mxpixel_t shineColor, nxgl_mxpixel_t shadowColor)
nxgl_coord_t getX(void) const
Definition: crect.hxx:160
virtual void onDoubleClick(nxgl_coord_t x, nxgl_coord_t y)
Definition: clistbox.cxx:640
virtual void removeItem(const int index)
Definition: clistdata.cxx:159
nxgl_mxpixel_t getBackgroundColor(void) const
Definition: cnxwidget.hxx:716
virtual void deselectAllOptions(void)
Definition: clistbox.cxx:243
void removeListDataEventHandler(IListDataEventHandler *eventHandler)
Definition: clistdata.cxx:346
nxwidget_pixel_t getSelectedBackColor(void) const
virtual void selectAllOptions(void)
Definition: clistbox.cxx:233
uint8_t m_optionPadding
Definition: clistbox.hxx:118
virtual bool isDoubleClick(nxgl_coord_t x, nxgl_coord_t y)
Definition: clistbox.cxx:416
virtual const CListDataItem * getSelectedItem(void) const
Definition: clistdata.cxx:255
uint8_t nxwidget_pixel_t
Definition: nxconfig.hxx:442
bool isEnabled(void) const
Definition: cnxwidget.cxx:381
nxgl_coord_t getStringWidth(const CNxString &text) const
Definition: cnxfont.cxx:142
nxgl_mxpixel_t getEnabledTextColor(void) const
Definition: cnxwidget.hxx:782
virtual void sort(void)
Definition: clistdata.cxx:271
nxgl_coord_t getHeight(void) const
Definition: cnxwidget.hxx:593
void setHeight(nxgl_coord_t height)
Definition: crect.hxx:261
virtual ~CListBox(void)
Definition: clistbox.cxx:130
void getClientRect(CRect &rect) const
Definition: cnxwidget.cxx:421
virtual const nxgl_coord_t getOptionHeight(void) const
Definition: clistbox.cxx:330
virtual const int getSelectedIndex(void) const
Definition: clistbox.cxx:256
virtual const int getSelectedIndex(void) const
Definition: clistdata.cxx:222
void setX(nxgl_coord_t x)
Definition: crect.hxx:229
nxgl_mxpixel_t getSelectedBackgroundColor(void) const
Definition: cnxwidget.hxx:727
virtual const int getItemCount(void) const
Definition: clistdata.hxx:284
virtual void removeAllItems(void)
Definition: clistdata.cxx:202
void drawFilledRect(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, nxgl_mxpixel_t color)
void setAllowsHorizontalScroll(bool allow)
virtual void deselectItem(const int index)
Definition: clistdata.cxx:193
CNxFont * getFont(void) const
Definition: cnxwidget.hxx:705
virtual void handleListDataChangedEvent(const CListDataEventArgs &e)
Definition: clistbox.cxx:341
const CNxString & getText(void) const
virtual const CListBoxDataItem * getSelectedOption(void) const
Definition: clistbox.cxx:280
virtual void drawBorder(CGraphicsPort *port)
Definition: clistbox.cxx:582
nxgl_mxpixel_t getShineEdgeColor(void) const
Definition: cnxwidget.hxx:738
void addListDataEventHandler(IListDataEventHandler *eventHandler)
Definition: clistdata.hxx:341
const uint8_t getHeight(void) const
Definition: cnxfont.hxx:229
nxwidget_pixel_t getSelectedTextColor(void) const
CWidgetEventHandlerList * m_widgetEventHandlers
Definition: cnxwidget.hxx:191
virtual void setOptionSelected(const int index, const bool selected)
Definition: clistbox.cxx:662
const unsigned int getLength(void) const
Definition: cnxstring.hxx:325
virtual void selectItem(const int index)
Definition: clistdata.cxx:182
virtual void scroll(int32_t dx, int32_t dy)
virtual void deselectOption(const int index)
Definition: clistbox.cxx:222
virtual void drawContents(CGraphicsPort *port)
Definition: clistbox.cxx:446
nxgl_coord_t getY(void) const
Definition: cnxwidget.cxx:261
void setWidth(nxgl_coord_t width)
Definition: crect.hxx:250
nxgl_coord_t getWidth(void) const
Definition: cnxwidget.hxx:582
virtual void deselectAllItems(void)
Definition: clistdata.cxx:299
nxgl_coord_t getY(void) const
Definition: crect.hxx:170
CListBox(const CListBox &listBox)
Definition: clistbox.hxx:175
virtual void selectAllItems(void)
Definition: clistdata.cxx:282
nxgl_mxpixel_t getDisabledTextColor(void) const
Definition: cnxwidget.hxx:771
virtual void addOption(const CNxString &text, const uint32_t value)
Definition: clistbox.cxx:143
virtual void removeAllOptions(void)
Definition: clistbox.cxx:176
virtual void setItemSelected(const int index, const bool selected)
Definition: clistdata.cxx:317
void setY(nxgl_coord_t y)
Definition: crect.hxx:240
void startDragging(nxgl_coord_t x, nxgl_coord_t y)
Definition: cnxwidget.cxx:1542
void drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font, const CNxString &string)
virtual void addItem(const CNxString &text, const uint32_t value)
Definition: clistdata.cxx:119
virtual void selectOption(const int index)
Definition: clistbox.cxx:210
nxgl_mxpixel_t getSelectedTextColor(void) const
Definition: cnxwidget.hxx:793