NXWidgets: cscrollingtextbox.cxx Source File

NXWidgets 1.19

cscrollingtextbox.cxx
Go to the documentation of this file.
1 /****************************************************************************
2 * NxWidgets/libnxwidgets/src/cscrollingtextbox.cxx
3 *
4 * Copyright (C) 2012 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 <stdint.h>
77 #include <stdbool.h>
78
79 #include "cscrollingtextbox.hxx"
80 #include "cscrollbarvertical.hxx"
81 #include "cgraphicsport.hxx"
82
83 /****************************************************************************
84 * Pre-Processor Definitions
85 ****************************************************************************/
86
87 /****************************************************************************
88 * Method Implementations
89 ****************************************************************************/
90
91 using namespace NXWidgets;
92
93 /**
94 * Constructor.
95 *
96 * @param pWidgetControl The widget control for the display.
97 * @param x The x coordinate of the text box, relative to its parent.
98 * @param y The y coordinate of the text box, relative to its parent.
99 * @param width The width of the textbox.
100 * @param height The height of the textbox.
101 * @param text Pointer to a string to display in the textbox.
102 * @param flags Standard widget flag options.
103 * @param maxRows The maximum number of rows the textbox can track. Adding
104 * text beyond this number will cause rows at the start of the text to be
105 * forgotten; text is essentially stored as a queue, and adding to the back
106 * of a full queue causes the front items to be popped off. Setting this to
107 * 0 will make the textbox track only the visible rows.
108 * @param style The style that the widget should use. If this is not
109 * specified, the widget will use the values stored in the global
110 * g_defaultWidgetStyle object. The widget will copy the properties of
111 * the style into its own internal style object.
112 */
113
114 CScrollingTextBox::CScrollingTextBox(CWidgetControl *pWidgetControl,
115 nxgl_coord_t x, nxgl_coord_t y,
116 nxgl_coord_t width, nxgl_coord_t height,
117 const CNxString &text, uint32_t flags,
118 nxgl_coord_t maxRows, CWidgetStyle *style)
119 : CNxWidget(pWidgetControl, x, y, width, height, flags, style)
120 {
121 m_scrollbarWidth = 10;
122 setBorderless(true);
123
124 m_texbox = new CMultiLineTextBox(pWidgetControl,
125 0, 0, width - m_scrollbarWidth, height,
126 text, flags, maxRows, &m_style);
127 m_texbox->addWidgetEventHandler(this);
128
129 // Create scrollbar
130
131 CRect rect;
132 m_texbox->getClientRect(rect);
133 m_scrollbar = new CScrollbarVertical(pWidgetControl,
134 width - m_scrollbarWidth, 0,
135 m_scrollbarWidth, height, &m_style);
136 m_scrollbar->setMinimumValue(0);
137 m_scrollbar->setMaximumValue(m_texbox->getCanvasHeight());
138 m_scrollbar->setPageSize(rect.getHeight());
139 m_scrollbar->setValue(0 - m_texbox->getCanvasY());
140 m_scrollbar->addWidgetEventHandler(this);
141
142 // Add children to child array
143
144 addWidget(m_texbox);
145 addWidget(m_scrollbar);
146 }
147
148 /**
149 * Set the horizontal alignment of text within the textbox.
150 *
151 * @param alignment The horizontal position of the text.
152 */
153
154 void CScrollingTextBox::setTextAlignmentHoriz(CMultiLineTextBox::TextAlignmentHoriz alignment)
155 {
156 m_texbox->setTextAlignmentHoriz(alignment);
157 }
158
159 /**
160 * Set the vertical alignment of text within the textbox.
161 *
162 * @param alignment The vertical position of the text.
163 */
164
165 void CScrollingTextBox::setTextAlignmentVert(CMultiLineTextBox::TextAlignmentVert alignment)
166 {
167 m_texbox->setTextAlignmentVert(alignment);
168 }
169
170 /**
171 * Returns the number of "pages" that the text spans. A page
172 * is defined as the amount of text that can be displayed within
173 * the textbox at one time.
174 *
175 * @return The page count.
176 */
177
178 const uint16_t CScrollingTextBox::getPageCount(void) const
179 {
180 return m_texbox->getPageCount();
181 }
182
183 /**
184 * Returns the current page.
185 *
186 * @return The current page.
187 * @see getPageCount().
188 */
189
190 const uint16_t CScrollingTextBox::getCurrentPage(void) const
191 {
192 return m_texbox->getCurrentPage();
193 }
194
195 /**
196 * Returns a pointer to the Text object that contains the
197 * wrapped text used in the textbox. It is used as the
198 * pre-processed data source for the textbox, and should
199 * not be altered.
200 *
201 * @return Pointer to the Text object.
202 */
203
204 const CText *CScrollingTextBox::getText(void) const
205 {
206 return m_texbox->getText();
207 }
208
209 /**
210 * Set the text displayed in the textbox.
211 *
212 * @param text String to display.
213 */
214
215 void CScrollingTextBox::setText(const CNxString &text)
216 {
217 m_texbox->setText(text);
218 m_scrollbar->redraw();
219 }
220
221 /**
222 * Append new text to the end of the current text
223 * displayed in the textbox.
224 *
225 * @param text String to append.
226 */
227
228 void CScrollingTextBox::appendText(const CNxString &text)
229 {
230 m_texbox->appendText(text);
231 m_scrollbar->redraw();
232 }
233
234 /**
235 * Remove all characters from the string from the start index onwards.
236 *
237 * @param startIndex Index to remove from.
238 */
239
240 void CScrollingTextBox::removeText(const unsigned int startIndex)
241 {
242 m_texbox->removeText(startIndex);
243 m_scrollbar->redraw();
244 }
245
246 /**
247 * Remove specified number of characters from the string from the
248 * start index onwards.
249 *
250 * @param startIndex Index to remove from.
251 * @param count Number of characters to remove.
252 */
253
254 void CScrollingTextBox::removeText(const unsigned int startIndex,
255 const unsigned int count)
256 {
257 m_texbox->removeText(startIndex, count);
258 m_scrollbar->redraw();
259 }
260
261 /**
262 * Set the font used in the textbox.
263 *
264 * @param font Pointer to the new font.
265 */
266
267 void CScrollingTextBox::setFont(CNxFont *font)
268 {
269 m_style.font = font;
270 m_texbox->setFont(font);
271 m_scrollbar->setFont(font);
272 }
273
274 /**
275 * Get the length of the text string.
276 *
277 * @return The length of the text string.
278 */
279
280 const unsigned int CScrollingTextBox::getTextLength(void) const
281 {
282 return m_texbox->getTextLength();
283 }
284
285 /**
286 * Sets the cursor display mode.
287 *
288 * @param cursorMode Determines cursor display mode
289 */
290
291 void CScrollingTextBox::showCursor(EShowCursor cursorMode)
292 {
293 m_texbox->showCursor(cursorMode);
294 }
295
296 /**
297 * Enables/disables cursor wrapping
298 *
299 * @param wrap True enables cursor wrapping
300 */
301
302 void CScrollingTextBox::wrapCursor(bool wrap)
303 {
304 m_texbox->wrapCursor(wrap);
305 }
306
307 /**
308 * Move the cursor to the text position specified. 0 indicates the start
309 * of the string. If position is greater than the length of the string,
310 * the cursor is moved to the end of the string.
311 *
312 * @param position The new cursor position.
313 */
314
315 void CScrollingTextBox::moveCursorToPosition(const int32_t position)
316 {
317 m_texbox->moveCursorToPosition(position);
318 m_scrollbar->redraw();
319 }
320
321 /**
322 * Get the cursor position. This is the index within the string that
323 * the cursor is currently positioned over.
324 *
325 * @return position The cursor position.
326 */
327
328 const int32_t CScrollingTextBox::getCursorPosition(void) const
329 {
330 return m_texbox->getCursorPosition();
331 }
332
333 /**
334 * Insert text at the specified index.
335 *
336 * @param text The text to insert.
337 * @param index Index at which to insert the text.
338 */
339
340 void CScrollingTextBox::insertText(const CNxString &text,
341 const unsigned int index)
342 {
343 m_texbox->insertText(text, index);
344 m_scrollbar->redraw();
345 }
346
347 /**
348 * Insert text at the current cursor position.
349 *
350 * @param text The text to insert.
351 */
352
353 void CScrollingTextBox::insertTextAtCursor(const CNxString &text)
354 {
355 m_texbox->insertTextAtCursor(text);
356 m_scrollbar->redraw();
357 }
358
359 /**
360 * Handles events raised by its sub-widgets.
361 *
362 * @param e Event arguments.
363 */
364
365 void CScrollingTextBox::handleValueChangeEvent(const CWidgetEventArgs &e)
366 {
367 if (e.getSource() != NULL)
368 {
369 if (e.getSource() == m_scrollbar)
370 {
371 if (m_texbox != NULL)
372 {
373 m_texbox->setRaisesEvents(false);
374 m_texbox->jump(0, 0 - m_scrollbar->getValue());
375 m_texbox->setRaisesEvents(true);
376 }
377 }
378 else if (e.getSource() == m_texbox)
379 {
380 if (m_scrollbar != NULL)
381 {
382 m_scrollbar->setRaisesEvents(false);
383 m_scrollbar->setMaximumValue(m_texbox->getCanvasHeight());
384 m_scrollbar->setValue(0 - m_texbox->getCanvasY());
385 m_scrollbar->setRaisesEvents(true);
386 }
387 }
388 }
389 }
390
391 /**
392 * Handles events raised by its sub-widgets.
393 *
394 * @param e Event arguments.
395 */
396
397 void CScrollingTextBox::handleScrollEvent(const CWidgetEventArgs &e)
398 {
399 if (e.getSource() != NULL)
400 {
401 if (e.getSource() == m_texbox)
402 {
403 if (m_scrollbar != NULL)
404 {
405 m_scrollbar->setRaisesEvents(false);
406 m_scrollbar->setValue(0 - m_texbox->getCanvasY());
407 m_scrollbar->setRaisesEvents(true);
408 }
409 }
410 }
411 }
412
413 /**
414 * Gets the x coordinate of the virtual canvas.
415 *
416 * @return The x coordinate of the virtual canvas.
417 */
418
419 const int32_t CScrollingTextBox::getCanvasX(void) const
420 {
421 return m_texbox->getCanvasX();
422 }
423
424 /**
425 * Gets the y coordinate of the virtual canvas.
426 *
427 * @return The y coordinate of the virtual canvas.
428 */
429
430 const int32_t CScrollingTextBox::getCanvasY(void) const
431 {
432 return m_texbox->getCanvasY();
433 }
434
435 /**
436 * Gets the width of the virtual canvas.
437 *
438 * @return The width of the virtual canvas.
439 */
440
441 const int32_t CScrollingTextBox::getCanvasWidth(void) const
442 {
443 return m_texbox->getCanvasWidth();
444 }
445
446 /**
447 * Gets the height of the virtual canvas.
448 *
449 * @return The height of the virtual canvas.
450 */
451
452 const int32_t CScrollingTextBox::getCanvasHeight(void) const
453 {
454 return m_texbox->getCanvasHeight();
455 }
456
457 /**
458 * Scroll the panel by the specified amounts.
459 *
460 * @param dx The horizontal distance to scroll.
461 * @param dy The vertical distance to scroll.
462 */
463
464 void CScrollingTextBox::scroll(int32_t dx, int32_t dy)
465 {
466 m_texbox->scroll(dx, dy);
467 }
468
469 /**
470 * Reposition the panel's scrolling region to the specified coordinates.
471 *
472 * @param x The new x coordinate of the scrolling region.
473 * @param y The new y coordinate of the scrolling region.
474 */
475
476 void CScrollingTextBox::jump(int32_t x, int32_t y)
477 {
478 m_texbox->jump(x, y);
479 }
480
481 /**
482 * Set whether or not horizontal scrolling is allowed.
483 *
484 * @param allow True to allow horizontal scrolling; false to deny it.
485 */
486
487 void CScrollingTextBox::setAllowsVerticalScroll(bool allow)
488 {
489 m_texbox->setAllowsVerticalScroll(allow);
490 }
491
492 /**
493 * Set whether or not horizontal scrolling is allowed.
494 *
495 * @param allow True to allow horizontal scrolling; false to deny it.
496 */
497
498 void CScrollingTextBox::setAllowsHorizontalScroll(bool allow)
499 {
500 // NOP
501 }
502
503 /**
504 * Sets the width of the virtual canvas.
505 *
506 * @param width The width of the virtual canvas.
507 */
508
509 void CScrollingTextBox::setCanvasWidth(const int32_t width)
510 {
511 // NOP
512 }
513
514 /**
515 * Sets the height of the virtual canvas.
516 *
517 * @param height The height of the virtual canvas.
518 */
519
520 void CScrollingTextBox::setCanvasHeight(const int32_t height)
521 {
522 // NOP
523 }
524
525 /**
526 * Returns true if vertical scrolling is allowed.
527 *
528 * @return True if vertical scrolling is allowed.
529 */
530
531 bool CScrollingTextBox::allowsVerticalScroll(void) const
532 {
533 return m_texbox->allowsVerticalScroll();
534 }
535
536 /**
537 * Returns true if horizontal scrolling is allowed.
538 *
539 * @return True if horizontal scrolling is allowed.
540 */
541
542 bool CScrollingTextBox::allowsHorizontalScroll(void) const
543 {
544 return m_texbox->allowsHorizontalScroll();
545 }
546
547 /**
548 * Draw the area of this widget that falls within the clipping region.
549 * Called by the redraw() function to draw all visible regions.
550 *
551 * @param port The CGraphicsPort to draw to.
552 * @see redraw()
553 */
554
555 void CScrollingTextBox::drawContents(CGraphicsPort *port)
556 {
557 port->drawFilledRect(0, 0, getWidth(), getHeight(), getBackgroundColor());
558 }
559
560 /**
561 * Resize the textbox to the new dimensions.
562 *
563 * @param width The new width.
564 * @param height The new height.
565 */
566
567 void CScrollingTextBox::onResize(nxgl_coord_t width, nxgl_coord_t height)
568 {
569 // Resize the children
570
571 m_texbox->resize(width - m_scrollbarWidth, height);
572 m_scrollbar->resize(m_scrollbarWidth, height);
573
574 // Move the scrollbar
575
576 m_scrollbar->moveTo(width - m_scrollbarWidth, 0);
577 }
NXWidgets::CScrollingTextBox::getCanvasY
virtual const int32_t getCanvasY(void) const
Definition: cscrollingtextbox.cxx:430
NXWidgets::CScrollbarVertical::setMinimumValue
void setMinimumValue(const int value)
Definition: cscrollbarvertical.cxx:210
NXWidgets::CNxWidget
Definition: cnxwidget.hxx:121
NXWidgets::CScrollingPanel::allowsVerticalScroll
bool allowsVerticalScroll(void) const
Definition: cscrollingpanel.hxx:236
cscrollbarvertical.hxx
NXWidgets::CScrollingTextBox::appendText
virtual void appendText(const CNxString &text)
Definition: cscrollingtextbox.cxx:228
NXWidgets::TEventArgs::getSource
const T & getSource(void) const
Definition: teventargs.hxx:127
NXWidgets::CScrollingTextBox::getCanvasHeight
virtual const int32_t getCanvasHeight(void) const
Definition: cscrollingtextbox.cxx:452
NXWidgets::CWidgetStyle
Definition: cwidgetstyle.hxx:125
NXWidgets::CScrollingTextBox::setTextAlignmentVert
virtual void setTextAlignmentVert(CMultiLineTextBox::TextAlignmentVert alignment)
Definition: cscrollingtextbox.cxx:165
NXWidgets::CRect::getHeight
nxgl_coord_t getHeight(void) const
Definition: crect.hxx:204
NXWidgets::CMultiLineTextBox::getText
virtual const CText * getText(void) const
Definition: cmultilinetextbox.hxx:484
NXWidgets::CNxWidget::moveTo
bool moveTo(nxgl_coord_t x, nxgl_coord_t y)
Definition: cnxwidget.cxx:990
NXWidgets::CWidgetControl
Definition: cwidgetcontrol.hxx:95
NXWidgets::CMultiLineTextBox::removeText
virtual void removeText(const unsigned int startIndex)
Definition: cmultilinetextbox.cxx:290
NXWidgets::CScrollingTextBox::insertText
virtual void insertText(const CNxString &text, const unsigned int index)
Definition: cscrollingtextbox.cxx:340
NXWidgets::CScrollingTextBox::getText
virtual const CText * getText(void) const
Definition: cscrollingtextbox.cxx:204
NXWidgets::CNxWidget::setRaisesEvents
void setRaisesEvents(bool raises)
Definition: cnxwidget.hxx:887
cgraphicsport.hxx
NXWidgets::CNxWidget::getBackgroundColor
nxgl_mxpixel_t getBackgroundColor(void) const
Definition: cnxwidget.hxx:716
NXWidgets::CMultiLineTextBox::wrapCursor
virtual void wrapCursor(bool wrap)
Definition: cmultilinetextbox.hxx:583
NXWidgets::CScrollingTextBox::setCanvasWidth
virtual void setCanvasWidth(const int32_t width)
Definition: cscrollingtextbox.cxx:509
NXWidgets::CMultiLineTextBox::setFont
virtual void setFont(CNxFont *font)
Definition: cmultilinetextbox.cxx:331
NXWidgets::CScrollbarVertical::setValue
void setValue(const int value)
Definition: cscrollbarvertical.cxx:233
NXWidgets::CScrollbarVertical::getValue
const int getValue(void) const
Definition: cscrollbarvertical.cxx:185
NXWidgets::CMultiLineTextBox::getCurrentPage
virtual const int getCurrentPage(void) const
Definition: cmultilinetextbox.cxx:213
NXWidgets::CMultiLineTextBox::TextAlignmentHoriz
TextAlignmentHoriz
Definition: cmultilinetextbox.hxx:123
NXWidgets::CScrollingTextBox::getCanvasX
virtual const int32_t getCanvasX(void) const
Definition: cscrollingtextbox.cxx:419
NXWidgets::EShowCursor
EShowCursor
Definition: itextbox.hxx:104
NXWidgets::CScrollingTextBox::showCursor
void showCursor(void)
Definition: cscrollingtextbox.hxx:290
NXWidgets::CMultiLineTextBox::setText
virtual void setText(const CNxString &text)
Definition: cmultilinetextbox.cxx:237
NXWidgets::CNxWidget::redraw
void redraw(void)
Definition: cnxwidget.cxx:483
NXWidgets::CScrollingTextBox::insertTextAtCursor
virtual void insertTextAtCursor(const CNxString &text)
Definition: cscrollingtextbox.cxx:353
NXWidgets::CNxWidget::resize
bool resize(nxgl_coord_t width, nxgl_coord_t height)
Definition: cnxwidget.cxx:1079
NXWidgets::CScrollingTextBox::getCanvasWidth
virtual const int32_t getCanvasWidth(void) const
Definition: cscrollingtextbox.cxx:441
NXWidgets::CScrollingTextBox::scroll
virtual void scroll(int32_t dx, int32_t dy)
Definition: cscrollingtextbox.cxx:464
NXWidgets::CScrollingTextBox::allowsVerticalScroll
virtual bool allowsVerticalScroll(void) const
Definition: cscrollingtextbox.cxx:531
NXWidgets::CScrollingTextBox::handleScrollEvent
virtual void handleScrollEvent(const CWidgetEventArgs &e)
Definition: cscrollingtextbox.cxx:397
NXWidgets::CScrollingPanel::getCanvasWidth
virtual const int32_t getCanvasWidth(void) const
Definition: cscrollingpanel.hxx:280
NXWidgets::CScrollingPanel::allowsHorizontalScroll
bool allowsHorizontalScroll(void) const
Definition: cscrollingpanel.hxx:247
NXWidgets
Definition: cbgwindow.hxx:65
NXWidgets::CNxWidget::getHeight
nxgl_coord_t getHeight(void) const
Definition: cnxwidget.hxx:593
NXWidgets::CScrollingTextBox::wrapCursor
virtual void wrapCursor(bool wrap)
Definition: cscrollingtextbox.cxx:302
NXWidgets::CMultiLineTextBox::setTextAlignmentHoriz
virtual void setTextAlignmentHoriz(TextAlignmentHoriz alignment)
Definition: cmultilinetextbox.cxx:168
NXWidgets::CNxWidget::getClientRect
void getClientRect(CRect &rect) const
Definition: cnxwidget.cxx:421
NXWidgets::CScrollingTextBox::removeText
virtual void removeText(const unsigned int startIndex)
Definition: cscrollingtextbox.cxx:240
NXWidgets::CScrollingPanel::getCanvasHeight
virtual const int32_t getCanvasHeight(void) const
Definition: cscrollingpanel.hxx:291
NXWidgets::CScrollingTextBox::getCursorPosition
virtual const int32_t getCursorPosition(void) const
Definition: cscrollingtextbox.cxx:328
NXWidgets::CNxWidget::addWidgetEventHandler
void addWidgetEventHandler(CWidgetEventHandler *eventHandler)
Definition: cnxwidget.hxx:854
NXWidgets::CMultiLineTextBox::getPageCount
virtual const int getPageCount(void) const
Definition: cmultilinetextbox.cxx:194
NXWidgets::CMultiLineTextBox::setTextAlignmentVert
virtual void setTextAlignmentVert(TextAlignmentVert alignment)
Definition: cmultilinetextbox.cxx:180
NXWidgets::CScrollingTextBox::setCanvasHeight
virtual void setCanvasHeight(const int32_t height)
Definition: cscrollingtextbox.cxx:520
NXWidgets::CNxFont
Definition: cnxfont.hxx:70
NXWidgets::CScrollingTextBox::m_scrollbarWidth
uint8_t m_scrollbarWidth
Definition: cscrollingtextbox.hxx:117
NXWidgets::CMultiLineTextBox::showCursor
virtual void showCursor(EShowCursor cursorMode)
Definition: cmultilinetextbox.cxx:369
NXWidgets::CNxWidget::setFont
virtual void setFont(CNxFont *font)
Definition: cnxwidget.cxx:474
NXWidgets::CGraphicsPort::drawFilledRect
void drawFilledRect(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, nxgl_mxpixel_t color)
Definition: cgraphicsport.cxx:280
NXWidgets::CMultiLineTextBox::insertTextAtCursor
virtual void insertTextAtCursor(const CNxString &ext)
Definition: cmultilinetextbox.cxx:446
NXWidgets::CScrollingTextBox::allowsHorizontalScroll
virtual bool allowsHorizontalScroll(void) const
Definition: cscrollingtextbox.cxx:542
NXWidgets::CText
Definition: ctext.hxx:108
NXWidgets::CScrollingTextBox::drawContents
virtual void drawContents(CGraphicsPort *port)
Definition: cscrollingtextbox.cxx:555
NXWidgets::CScrollingTextBox::setAllowsHorizontalScroll
virtual void setAllowsHorizontalScroll(bool allow)
Definition: cscrollingtextbox.cxx:498
NXWidgets::CScrollingTextBox::getPageCount
virtual const uint16_t getPageCount(void) const
Definition: cscrollingtextbox.cxx:178
NXWidgets::CScrollingTextBox::setFont
virtual void setFont(CNxFont *font)
Definition: cscrollingtextbox.cxx:267
NXWidgets::CScrollingTextBox::m_scrollbar
CScrollbarVertical * m_scrollbar
Definition: cscrollingtextbox.hxx:116
NXWidgets::CMultiLineTextBox::getTextLength
virtual const int getTextLength(void) const
Definition: cmultilinetextbox.cxx:358
NXWidgets::CScrollingPanel::getCanvasX
virtual const int32_t getCanvasX(void) const
Definition: cscrollingpanel.hxx:258
NXWidgets::CMultiLineTextBox::appendText
virtual void appendText(const CNxString &text)
Definition: cmultilinetextbox.cxx:264
NXWidgets::CScrollingTextBox::m_texbox
CMultiLineTextBox * m_texbox
Definition: cscrollingtextbox.hxx:115
NXWidgets::CWidgetEventArgs
Definition: cwidgeteventargs.hxx:127
NXWidgets::CRect
Definition: crect.hxx:101
NXWidgets::CScrollingPanel::getCanvasY
virtual const int32_t getCanvasY(void) const
Definition: cscrollingpanel.hxx:269
NXWidgets::CScrollingTextBox::setText
virtual void setText(const CNxString &text)
Definition: cscrollingtextbox.cxx:215
NXWidgets::CNxWidget::addWidget
void addWidget(CNxWidget *widget)
Definition: cnxwidget.cxx:1293
NXWidgets::CScrollingPanel::scroll
virtual void scroll(int32_t dx, int32_t dy)
Definition: cscrollingpanel.cxx:144
NXWidgets::CWidgetStyle::font
CNxFont * font
Definition: cwidgetstyle.hxx:129
NXWidgets::CMultiLineTextBox::getCursorPosition
virtual const int getCursorPosition(void) const
Definition: cmultilinetextbox.hxx:605
NXWidgets::CScrollingTextBox::moveCursorToPosition
virtual void moveCursorToPosition(const int32_t position)
Definition: cscrollingtextbox.cxx:315
NXWidgets::CScrollingTextBox::CScrollingTextBox
CScrollingTextBox(const CScrollingTextBox &scrollingTextBox)
Definition: cscrollingtextbox.hxx:148
NXWidgets::CMultiLineTextBox::insertText
virtual void insertText(const CNxString &text, const unsigned int index)
Definition: cmultilinetextbox.cxx:418
NXWidgets::CMultiLineTextBox::TextAlignmentVert
TextAlignmentVert
Definition: cmultilinetextbox.hxx:134
NXWidgets::CScrollingPanel::setAllowsVerticalScroll
void setAllowsVerticalScroll(bool allow)
Definition: cscrollingpanel.hxx:302
NXWidgets::CNxWidget::getWidth
nxgl_coord_t getWidth(void) const
Definition: cnxwidget.hxx:582
NXWidgets::CScrollbarVertical::setMaximumValue
void setMaximumValue(const int value)
Definition: cscrollbarvertical.cxx:221
NXWidgets::CNxString
Definition: cnxstring.hxx:121
NXWidgets::CMultiLineTextBox::moveCursorToPosition
virtual void moveCursorToPosition(const int position)
Definition: cmultilinetextbox.cxx:386
cscrollingtextbox.hxx
NXWidgets::CNxWidget::m_style
CWidgetStyle m_style
Definition: cnxwidget.hxx:183
NXWidgets::CScrollingTextBox::onResize
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height)
Definition: cscrollingtextbox.cxx:567
NXWidgets::CScrollingTextBox::handleValueChangeEvent
virtual void handleValueChangeEvent(const CWidgetEventArgs &e)
Definition: cscrollingtextbox.cxx:365
NXWidgets::CScrollingTextBox::setAllowsVerticalScroll
virtual void setAllowsVerticalScroll(bool allow)
Definition: cscrollingtextbox.cxx:487
NXWidgets::CScrollingTextBox::setTextAlignmentHoriz
virtual void setTextAlignmentHoriz(CMultiLineTextBox::TextAlignmentHoriz alignment)
Definition: cscrollingtextbox.cxx:154
NXWidgets::CMultiLineTextBox
Definition: cmultilinetextbox.hxx:114
NXWidgets::CScrollbarVertical
Definition: cscrollbarvertical.hxx:113
NXWidgets::CScrollingTextBox::getCurrentPage
virtual const uint16_t getCurrentPage(void) const
Definition: cscrollingtextbox.cxx:190
NXWidgets::CScrollingTextBox::getTextLength
virtual const unsigned int getTextLength(void) const
Definition: cscrollingtextbox.cxx:280
NXWidgets::CNxWidget::setBorderless
void setBorderless(bool isBorderless)
Definition: cnxwidget.cxx:461
NXWidgets::CScrollingPanel::jump
virtual void jump(int32_t x, int32_t y)
Definition: cscrollingpanel.cxx:277
NXWidgets::CScrollbarVertical::setPageSize
void setPageSize(const nxgl_coord_t pageSize)
Definition: cscrollbarvertical.cxx:259
NXWidgets::CScrollingTextBox::jump
virtual void jump(int32_t x, int32_t y)
Definition: cscrollingtextbox.cxx:476
NXWidgets::CGraphicsPort
Definition: cgraphicsport.hxx:106