Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

UTextbox Class Reference

Textbox gadget: base class for handling text. More...

#include <ugadgets.hpp>

Inheritance diagram for UTextbox:

UBox UGroup UTextfield UCombobox List of all members.

Public Member Functions

 UTextbox (const UArgs &=UArgs::none)
 constructor; see also ~UGroup() and the creator shortcut utextbox()
virtual const UStylegetStyle (UContext *) const
 returns the contextual UStyle of this object

Static Public Member Functions

static const UStylemakeStyle ()
 creates the Style of this object.

Static Public Attributes

static UStylestyle = null
 corresponding Ubit UStyle

Friends

UTextboxutextbox (const UArgs &a=UArgs::none)
 creator shortcut that is equivalent to *new UTextbox().

Detailed Description

Textbox gadget: base class for handling text.

The main puropose of this class is to display text. Use UTextfield to edit a single line of text and UFlowbox or UTextarea to edit multi-line text regions.

By opposition to UBox objects, UTextbox, UTexfield, UFlowbox... keep their initial size. For this reason, they are well suited for displaying text that is dynamically changed (the layout of the GUI will be more stable and calculated faster).

Geometry (default behavior):

Default Properties:

Examples:

      UTextbox& tb1 = utextbox( "This textbox will display this string" )

      UStr& msg = ustr("error message");
      UTextbox& tb2 = utextbox( UPix::ray + "Warning: Error: " + msg );

      msg = "another message";    // changes 'msg' and updates 'txb2'

      // collates the text enclosed in the textbox and copies it to 's'
      // 's' will contain:  "Warning: Error: another message"
      UStr s = tb2.copyText();
  

Callbacks and Editable text: The UTextfield subclass provides text edition:

      utextfield( "bla bla" ); 
  
This is functionally equivalent to:
      utextbox( uedit() + "bla bla" );
  
See: classes UTextfield and UEdit for callbacks and other functions.


Member Function Documentation

virtual const UStyle& UTextbox::getStyle UContext *   )  const [virtual]
 

returns the contextual UStyle of this object

This virtual function calls the makeStyle() static function that was redefined for this specific class

Reimplemented from UBox.

const UStyle & UTextbox::makeStyle  )  [static]
 

creates the Style of this object.

This static function is redefined by each class that derives from UGroup. It is called by the virtual function UGroup::getStyle()

Reimplemented from UBox.


The documentation for this class was generated from the following files:
Generated on Thu May 19 12:40:33 2005 for Ubit[Eric.Lecolinet@enst.fr] by  doxygen 1.4.2