Returns a prime number equal or greater than the parameter.
unsigned int x : The minimum value.Attempts to quit the application. Calls the user-defined AppQuit() function, and exits if AppQuit returns true.
Sets the application's help file. This should be the path to an HTML help file.
const String& path : The file path.Displays a help dialog with the specified help file.
Hides the application's help viewer dialog.
Sets the top line in the help viewer to the numbered line
int n : The line to show.Sets the top line in the help viewer to the named line
const String& str : The line to show.Displays a simple message dialog with an OK button and the given message.
const char* pMsg : The format string for the message. This function works just like the standard printf(...) function.Displays an alert message dialog with an OK button and the given message.
const char* pMsg : The format string for the message. This function works just like the standard printf(...) function.Displays a simple question dialog box. The button configuration can be customized. Returns one of YES, NO, or CANCEL, depending on which button was pressed.
int pType : The button format. Possible values are YES_NO and YES_NO_CANCEL.Shows a dialog displaying some text, allows the user to edit it, and returns the new string. Returns true if the Ok button was pressed.
String& pLabel : The initial default text to display, and the string referenced is assigned to the new string if Ok is pressed.Shows a file selection dialog box. For example,
   String fn;
   bool success = ShowFileChooser("Open", "*", "", fn);
Returns whether the user actually selected a file or canceled the dialog.
Shows a directory selection dialog box. For example,
   String dir;
   bool success = ShowDirChooser("Choose Dir", dir, true);
Returns whether the user actually selected a file or canceled the dialog.
Shows a color selection dialog box. The pColor parameter specifies the inital color, and is changed to the color that the user selects. Returns true if the user clicks Ok and updates the color.
const String& pTitle : The title of the color selection dialog. A highly configurable line-based reader. It can read
directly from a FILE* pointer or a String.
It is capable of automatically trimming whitespace,
handling line continuation characters, comments, partial
comments, and comment exceptions. The reader is configured
with the configure(..) method, and the following
commands and options:
   LR_SET_TRIM_LINES: (int: 1 or 0)
   LR_SET_WHITESPACE: (char* : string of whitespace delimiters)
   LR_SET_CASE_SENSITIVE: (int: 1 or 0)
   LR_ADD_EOL_CONTINUE: (char* : pattern string)
   LR_ADD_BNL_CONTINUE: (char* : pattern string)
   LR_ADD_COMMENT_START: (char* : string)
   LR_ADD_COMMENT_EXCEPTION: (char* : string)
   LR_ADD_PARTIAL_COMMENT: (int: 1 or 0)
Pattern strings are simply normal strings where a '|' character
stands for 0 or more characters of whitespace. Thus, the pattern
"*extractelement|+" would match all of the following strings:
   '*extractelement +'
   '*extractelement+'
   '*extractelement      +'
The same pattern format is used for 'beginning-of-next-line' continuations
(BNL_CONTINUE) and 'end-of-line' continuations (EOL_CONTINUE).
Comments extend from the beginning of a line to the end of it. By
setting the ALLOW_PARTIAL_COMMENTS to true (1), then a comment
starting in the middle of a line extending to the end of it
will be remove from the input. Otherwise, comments starting in the
middle of a line will remain in the return line. If a comment start
is also a EOL continuation, and partial line comments are allowed,
the characters after the comment start are stripped, but the line
will be continued as expected.
Sample code to configure a reader for Cadence Spectre Netlists:
   LineReader reader(file, 2048);
   reader.configure(LR_SET_TRIM_LINES, LR_ARG(1));
   reader.configure(LR_SET_WHITESPACE, LR_ARG(" \t\r"));
   reader.configure(LR_SET_CASE_SENSITIVE, LR_ARG(0));
   reader.configure(LR_ADD_PARTIAL_COMMENT, LR_ARG("//"));
   reader.configure(LR_ADD_COMMENT_START, LR_ARG("//"));
   reader.configure(LR_ADD_COMMENT_START, LR_ARG("*"));
   reader.configure(LR_ADD_COMMENT_EXCEPTION, LR_ARG("*extractelement"));
   reader.configure(LR_ADD_EOL_CONTINUE, LR_ARG("\\"));
   reader.configure(LR_ADD_BNL_CONTINUE, LR_ARG("*extractelement|+"));
   String line;
   while(reader.getLine(line)) {
      ....
   }
   ....
Constructs a new LineReader object for a FILE.
FILE* finput : The file to read from.Constructs a new LineReader object for a String.
const String& cinput : The string to read from.Configure the reading options of the line reader. See the class description above for greater detail and examples.
LineReaderSetting type : The configuration command.Read one line from the reader. Returns false if the end of the file was reached, otherwise true.
String& line : The line is assigned to this parameter.Returns the number of lines read so far.
This class implements a simple interface for working
with arrays of strings. It is nothing more than a
vector of strings (i.e. Vector String ),
except that a few convenience functions are provided.
Traversing the elements in a string array involves a simple
for loop:
   StringArray args;
   ...
   for (int i=0;i args.length();i++)
     printf("%s\n", args[i].cStr());
Constructs a new string array optionally of the specified size.
int (=0) size : The initial capacity of the string array. Defaults to 0.Assigns one string array to another.
const StringArray& array : The StringArray to assign.Indexing operator to return strings in the array.
   String str = args[2];
Indexing operator to allow for assignment into the array.
   args[2] = "Hello!";
Prepends the specified string to the beginning of the array, shifting the other elements down.
const String& s : The string to prepend.Appends the specified string to the end of the array, increasing the capacity of the array if necessary.
const String& s : The string to append.Inserts a string to a specified location in the array, increasing the capacity of the array if necessary.
const String& s : The string to insert.Searches the array for a string. Returns the index of the first occurence if found, otherwise returns -1.
const String& s : The string to search for.Removes the first occurrence of the specified string, if it is found.
const String& s : The string to find and remove.Removes the string at the given index.
int index : The index of the string to remove.Empties the string array.
Increases the capacity of the string array to the given size.
int size : The new capacity of the array.Returns the number of strings in the array.
Returns the capacity of the array. Note that this not necessarily the same as length() .
A static function that creates a string array from a var-arg list of c-strings.
int n : The number of strings in the list. The string class provides a flexible alternative
to standard C-style strings. It is fully operator
overloaded to simplify programming, and is used
throughout the runtime library. It provides
a convenient printf(...) method to generate
nicely formatted text using the standard stdio printf
syntax. The class also has searching capabilities, as
well as the standard substring manipulationg methods.
The internal storage is simply a standard C-style
character array, and can be accessed directly with the
cStr() and getBuffer() methods. However,
direct manipulation of the underlying storage is not
recommended, as it may leave the string class in a volatile
state. If a large C-style buffer must be pre-allocated and
filled externally, use the getWriteBuffer() and
ungetWriteBuffer() methods.
The following
operators are also overridden for strings:
   ==, !=, , =, , =, +
Creates an empty string.
Creates a copy of the supplied string.
const char* s : The NULL-terminated string to copy.Creates a copy of the supplied string.
const String& s : The string to copy.The standard string assignment operator. Note that this copies the string memory.
const String& s : The string to assign.The standard string assignment operator. Note that this copies the string memory.
const char* s : The string to assign.The standard character assignment operator.
char ch : The character to assign.Returns a const pointer to the internal buffer. Use when calling printf(...) and other functions that require C-strings.
Returns the length of the string.
Indexing operator to return characters in the string.
   char ch = str[2];
Indexing operator to allow for assignment into the string.
   str[2] = 'c';
The string concatenation operator.
const String& s : The string to concatenate.The character concatenation operator.
char ch : The character to concatenate.A convenient string formatting function. It provides the functionality of sprintf. Note that the maximum buffer length is 2048.
const char* format : The standard printf formatting string.Returns the internal buffer directly.
Allocates a new buffer and returns it. Note that any preexisting string is lost.
Restores the string class after a getWriteBuffer operation.
Attempts to convert the string to a double value.
bool* (=NULL) success : If not NULL, this parameter indicates whether or not the conversion was successful.Attempts to convert the string to a long integer value.
bool* (=NULL) success : If not NULL, this parameter indicates whether or not the conversion was successful.Attempts to convert the string to a normal base 10 integer value.
bool* (=NULL) success : If not NULL, this parameter indicates whether or not the conversion was successful.Attempts to convert the string to a normal base 10 unsigned integer value.
bool* (=NULL) success : If not NULL, this parameter indicates whether or not the conversion was successful.Converts the string to all uppercase characters.
Converts the string to all lowercase characters.
Searches for the first occurrence of the given string. Returns the starting position of the found string, or -1 for failure.
const String& s : The string to search for.Searches for the first occurrence of a character. Returns the position of the first occurrence, or -1 for failure.
char ch : The character to search for.Returns a substring.
int pos : The starting position.Returns the first n characters of the string.
int n : The number of characters.Returns the last n characters of the string.
int n : The number of characters.Truncates the string to the specified length.
int len : The length of the string. A templated linked list collection class. The list
is singly-linked, and can be traversed using the
first() / next() methods. The list can only
store pointers to objects. Therefore, the declaration
   List SomeClass my_list;
declares a list of pointers of type SomeClass. Then, a list
traversal is of the following form:
   SomeClass *ptr = my_list.first();
   while (ptr) {
     ...
     ptr = my_list.next();
   }
Creates a new list class.
or when the the list itself is deleted.
bool b : Enable or disable auto-deletion.Empties the list of all objects, deleting them if auto-deletion is enabled.
Returns the length of the list.
Returns the first object in the collection.
Returns the next object in the collection.
Prepends an object to the beginning of the list.
type* data : A pointer to an instance of the appropriate object type.Appends an object to the end of the list.
type* data : A pointer to an instance of the appropriate object type.Inserts an object into the list at the specified position.
type* data : A pointer to an instance of the appropriate object type.Searchs the list for the specified object. NULL is returned if the object is not found, but otherwise a pointer to the object.
type* data : The object to search for.Unlinks an object from the list and returns a pointer to it. This is unaffected by auto-deletion.
type* data : The object to unlink.Removes an object from the list. If auto-deletion is enabled, the object will be delete also. Returns true if the removal succeeded.
type* data : The object to remove. A templated queue collection class. The queue
is implemented as singly-linked list, and can be
traversed from the front to the rear using the
first() / next() methods. The queue can only
store pointers to objects. Therefore, the declaration
   Queue SomeClass my_queue;
declares a list of pointers of type SomeClass. Then, a
traversal is of the following form:
   SomeClass *ptr = my_queue.first();
   while (ptr) {
     ...
     ptr = my_queue.next();
   }
Elements are added and removed from the queue using
the standard enqueue() and dequeue() methods.
Creates a new queue class.
or when the the list itself is deleted.
bool b : Enable or disable auto-deletion.Empties the queue, deleting any objects if auto-deletion is enabled.
Returns the length of the queue. This is equivalent to itemCount().
Returns the length of the queue. This is equivalent to length() .
Returns the first object in the queue.
Returns the next object in the queue.
Enqueues an object to the end of the queue.
type* data : A pointer to an instance of the appropriate object type.Removes the first item on the queue and returns it. If the queue is empty, NULL is returned.
Pushes an element back into the queue, but at the front. This essentially undoes the dequeue() operation.
type* data : A pointer to an instance of the appropriate object type.Returns the first object on the queue without removing it. NULL is returned if the queue is empty.
Determines whether the queue has items in it.
A templated stack collection class. The stack
is implemented as singly-linked list, and can be
traversed from the top to the bottom using the
first() / next() methods. The stack can only
store pointers to objects. Therefore, the declaration
   Stack SomeClass my_stack;
declares a stack of pointers of type SomeClass. Then, a stack
traversal is of the following form:
   SomeClass *ptr = my_stack.first();
   while (ptr) {
     ...
     ptr = my_stack.next();
   }
Elements are added and removed from the stack using
the standard push() and pop() routines.
Creates a new stack class.
or when the the list itself is deleted.
bool b : Enable or disable auto-deletion.Empties the stack, deleting any objects if auto-deletion is enabled.
Returns the length of the stack. This is equivalent to itemCount().
Returns the length of the stack. This is equivalent to length() .
Returns the top object in the stack.
Returns the next object in the stack.
Pushes an object to the top of the stack.
type* data : A pointer to an instance of the appropriate object type.Removes the top item on the stack and returns it. If the stack is empty, NULL is returned.
Returns the top object on the stack without removing it. NULL is returned if the stack is empty.
Determines whether the stack has items in it.
A templated string-key hash table collection class. The hash table
is implemented with a chaining algorithm, and can be traversed using the
first(..) / next(..) methods. The hash can only
store pointers to objects. Therefore, the declaration
   StrHash SomeClass my_hash;
declares a string hash of pointers of type SomeClass. To traverse the
elements in the table:
   String key = "";
   SomeClass *ptr = my_hash.first( key );
   while (ptr) {
     ...
     ptr = my_hash.next( key );
   }
Construct a new string key hash table of a specified table size.
int size : The size of the table. Note that collisions are resolved with chaining.or when the the hash itself is deleted.
bool b : Enable or disable auto-deletion.Empties the hash of all objects, deleting them if auto-deletion is enabled.
Returns the number of items in the hash.
Returns the number of items in the hash.
Resizes the hash table to the specified size. Note that this involves rehashing all the elements.
int new_size : The new size of the table.Insert a key-data pair into the table.
const String& key : The identifier key.Remove a key-data pair from the table. If auto-deletion is off, a pointer to the object is returned.
const String& key : The identifier key.Search the table for a key-data pair. A pointer to the object is returned if is found, otherwise NULL.
const String& key : The identifier key.Returns the first object in the table along with its key. Note that there is no rule imposed on what order objects are returned
String& key : This will be assigned the key of the object returned.Returns the next object in the table along with its key. Note that there is no rule imposed on what order objects are returned
String& key : This will be assigned the key of the object returned. A templated pointer-key hash table collection class. The hash table
is implemented with a chaining algorithm, and can be traversed using the
first(..) / next(..) methods. The hash can only
store pointers to objects. Therefore, the declaration
   PtrHash SomeClass my_hash;
declares a pointer-key hash of pointers of type SomeClass. To traverse the
elements in the table:
   Ptr key = NULL;
   SomeClass *ptr = my_hash.first( key );
   while (ptr) {
     ...
     ptr = my_hash.next( key );
   }
Construct a new pointer key hash table of a specified table size.
int size : The size of the table. Note that collisions are resolved with chaining.or when the the hash itself is deleted.
bool b : Enable or disable auto-deletion.Empties the hash of all objects, deleting them if auto-deletion is enabled.
Returns the number of items in the hash.
Returns the number of items in the hash.
Resizes the hash table to the specified size. Note that this involves rehashing all the elements.
int new_size : The new size of the table.Insert a key-data pair into the table.
CPtr key : The identifier key.Remove a key-data pair from the table. If auto-deletion is off, a pointer to the object is returned.
CPtr key : The identifier key.Search the table for a key-data pair. A pointer to the object is returned if is found, otherwise NULL.
CPtr key : The identifier key.Returns the first object in the table along with its key. Note that there is no rule imposed on what order objects are returned
Ptr& key : This will be assigned the key of the object returned.Returns the next object in the table along with its key. Note that there is no rule imposed on what order objects are returned
Ptr& key : This will be assigned the key of the object returned. A templated string-key hash table collection class. The hash table
is implemented with linear collision resolution, and can be traversed using the
first(..) / next(..) methods. The hash can only
store pointers to objects. Therefore, the declaration
   LinearHash SomeClass my_hash;
declares a string hash of pointers of type SomeClass. To traverse the
elements in the table:
   String key = "";
   SomeClass *ptr = my_hash.first( key );
   while (ptr) {
     ...
     ptr = my_hash.next( key );
   }
Construct a new linear string key hash table.
or when the the hash itself is deleted.
bool b : Enable or disable auto-deletion.Empties the hash of all objects, deleting them if auto-deletion is enabled.
Returns the number of items in the hash.
Returns the number of items in the hash.
Increases the table size of the hash. Note that this involves rehashing all the elements. The table is automatically grown when the load factor passes a threshold.
Insert a key-data pair into the table.
const String& key : The identifier key.Remove a key-data pair from the table. If auto-deletion is off, a pointer to the object is returned.
const String& key : The identifier key.Search the table for a key-data pair. A pointer to the object is returned if is found, otherwise NULL.
const String& key : The identifier key.Returns the first object in the table along with its key. Note that there is no rule imposed on what order objects are returned
String& key : This will be assigned the key of the object returned.Returns the next object in the table along with its key. Note that there is no rule imposed on what order objects are returned
String& key : This will be assigned the key of the object returned. This is a templated vector class. Unlike the Stack, *Hash, List,
and Queue classes, the Vector stores objects directly, not pointers
to them. That is, the declaration
   Vector int my_vec;
creates a vector of integers, and can be used just like an normal
C-style array with the [] operators. Note that if a vector
of objects is declared, for example
   Vector SomeClass my_obj_vec;
then the SomeClass class should make sure to properly override
the '=' operator, and it must also have a default constructor.
The vector class performs bounds checking, and aborts the application
if an index is out of bounds.
Constructs a new empty vector.
Constructs a new vector of the specified size.
int size : The initial size of the vector;Constructs a new vector of the specified size and fills with a default element.
int size : The size of the vector.Constructs a copy of an existing vector.
const Vector& vec : The vector to copy.Assigns one vector to another.
const Vector& vec : The vector to assign.Indexing operator to allow for assignment into the vector.
   my_vec[2] = 2.4;
Indexing operator to return elements in the vector.
   double val = my_vec[2];
Indexing operator to allow for assignment into the vector. Equivalent to the [] operator.
int i : Specifies which index to return a reference to.Indexing operator to return elements in the vector. Equivalent to the [] operator.
int i : Specifies which element to return.Resizes the vector and copies the old elements over. Returns whether the resize succeeded.
int new_size : The new size of the vector. If this is shorter than the current size, the vector is truncated which may result in data loss.Returns the length of the array.
Returns the length of the array.
Returns a pointer to the internal C-style array. Use of this function is strongly discouraged.
The Tokenizer class provides a simple way to split delimited strings into tokens. The tokenizer can be configured to recognize any set of single characters as delimiters. A tokenizer can be used either with the hasTokens() and next() methods, or with the more flexible get() and unget() methods. When get(..) is called, it returns the next token in a queue of tokens. If the token is not ready to be accepted, it can be returned to the queue in the correct order with the unget() method, which can be called as many times as required. This way, the list of tokenized items can be traversed back and forth if necessary.
Creates an empty space-delimited tokenizer.
Creates a new space-delimited tokenizer with the given input string.
const String& s : The string to tokenize.Creates a new tokenizer on the given input string with custom delimiters.
const String& s : The string to tokenize.Returns the next token in the input. Use in conjunction with hasTokens().
Determines whether the token queue is empty.
Gets the next token in the queue. Returns false if the queue was empty.
String& pTok : The string to assign the next token to.Ungets one token and puts it back on the front of the token queue. Returns false if a token could not be put back on the queue.
Clears the token queue.
Returns whether tokens remain on the input string. Use with next().
Returns the ending position of the most recently processed token in the input string.
Returns the current position of the tokenizer in the input string.
Returns the rest of the unprocessed input string.
Resets the tokenizer to a new input string. Note that this does not clear the token queue.
const String& s : The new input string.Changes the character delimiters.
const String& dlms : A string of single character delimiters.Returns the current delimiters.
A simple command button widget. The Button is generally considered to be the most commonly used user-interface component. It allows the user to initiate some action when it is pressed.
Constructs a new command button.
Causes the button to generate a Click event just as if the user had clicked on the button.
Sets the text displayed on the button.
const String& pLabel : The new button label.Returns the button's label.
A drawing area widget. This class provides general purpose
drawing functions and generates events for low-level windowing
system events. It also provides functions to draw and measure
text in various fonts. The top-left origin coordinate is (0, 0).
Important note: Drawing functions
can only be called from within the Paint() event handler!
Calling drawing functions from outside this method will result in
undefined behavior. Furthermore, changing the font, color, or
line style outside of the Paint method may work in some contexts, but
not others. To force the Canvas to generated a paint event,
call the redraw() method.
Creates a new drawing canvas.
Sets a internal flag to indicate what should be redrawn. For example, a mouse drag might set the state to '1', and call redraw(). Then the redraw method queries the state, and if it is '1', only draws what is necessary to respond to the mouse drag event. Any integer values can be used. The Canvas class itself does not query this value.
int pState : A value representing a drawing state.Returns the internal state variable. See setState() for more information.
Changes the current drawing color.
const Color& pColor : The new color.Changes the current drawing color.
const String& pName : A string-identified color. Set the Color class documentation for a list of recognized color names.Changes the current drawing color.
unsigned char r : The red value.Changes the current text drawing font.
Font pFont : The new font. Recognized typefaces are TIMES, HELVETICA, and COURIER.Changes the way pixels are copied to the screen. STANDARD mode will simply copy the new pixel value over the existing one, while INVERT and XOR identify a logical function indicated how the new pixel value will be combined with the old one.
DrawMode pMode : The drawing mode. Accepted values are STANDARD, INVERT, and XOR.Changes the current line style.
LineStyle pStyle : The new line style. Possible values are SOLID, DASHED, DOTTED, and DASHDOTTED.Sets the current clipping region. This limits all drawing to the specified region. Anything drawn outside the region will not actually be drawn. Every call to pushClip() must be accompanied by a call to popClip(), or undefined behavior will result.
int pX : The X-coordinate.Restores the previous clipping region state.
Draws a 1 pixel by 1 pixel point on the canvas with the current color.
int pX : The X-coordinate.Draws a line in the current style and color between the two points indicated.
int pX1 : The starting X-coordinate.Draws a 1-pixel wide rectangle within the given bounding box.
int pX : The X-coordinate.Fills the specified rectangular region with the current color.
int pX : The X-coordinate.Draw an elliptical outline within the specified bounding box.
int pX : The X-coordinate.Fill an elliptical area specified by bounding box with the current color.
int pX : The X-coordinate.Draws XPM image data with the top-left corner at the given position. The image is dithered on 8-bit displays. The current canvas color is used for transparent colors. Returns false if there was an error decoding the XPM data. Otherwise, returns true.
char** pData : The XPM pixmap data.Returns the size of an XPM image. Returns a size of (-1,-1) if there were errors decoding the image.
char** pData : The XPM pixmap data.Draws a 8-bit per color RGB image directly onto the canvas. Color data must be in RGB order. X, Y are where to put the top-left pixel.
unsigned char* pData : The image data.Draws a 8-bit grayscale image directly onto the canvas. X, Y are where to put the top-left pixel.
unsigned char* pData : The grayscale image data.Draws text on the canvas in the current font and style.
int pX : The X-coordinate, aligned to the left of the text.Draws text on the canvas in the current font and style.
int pX : The X-coordinate, aligned to the left of the text.Measure the size of some text in the current font.
int& pWidth : The width will be assigned to this parameter.Returns the width of the string in the current font.
const String& pStr : The string to measure.Returns the width of the text in the current font.
const char* pStr : The string to measure.Returns the height of the current font from the baseline.
Returns the number of pixels the font descends below the baseline.
A simple toggleable check box widget.
Constructs a new checkbox.
Sets the text displayed on the checkbox.
const String& pLabel : The new checkbox label.Returns the checkbox's label.
Changes the state of the checkbox. Note that this does not generate a Toggle event.
bool pState : The new state.Returns the current state of the checkbox.
Changes to the opposite state. This generates a Toggled event.
The Choice widget provides a drop-down selection box that
allows the user to choose from a list of choices. The widget
displays the current string item, and presents a popup list
when the widget is clicked on. A selection event is generated
when the user changes the current selection. The drop-down
menu of the Choice widget can display a multi-level submenu.
Text of the form "Foo/Bar/Sap" will result in a toplevel item
named "foo", a submenu "bar", and an item "sap" under the "bar"
submenu. Appending "Foo/Bar/Maple" will append an item named
"maple" under the "bar" submenu. The menu structure is:
   Foo
   +-    Bar
         +-    Sap
         +-    Maple
Constructs a new Choice widget.
Sets the choices available in the drop-down list.
const StringArray& pChoices : The array of strings to display.Returns a StringArray with the currently available choices.
Removes all the choices from the list.
Appends an item to the end of the list of choices.
const String& The : new choice.Determines whether a given string is one of the choices. Returns the index of the choice, or -1 if doesn't exit.
const String& pItem : The item to search for.Returns the index of the currently selected item.
Returns the text of the currently selected item.
Changes the current selection.
int pIndex : The index of the new selection. If the index is out of the range, nothing happens.Changes the current selection.
const String& pStr : The string to make the current selection. Nothing happens if the string is not a choice.Changes the text of one of the choices.
int pIndex : The index of the item to change.Returns the text of the item at the specified index.
int pIndex : The index of the item whose text to return.Returns the number of items in the choice.
A generic container widget that can hold other widgets. An instance of a Container cannot be created directly, but its descendent classes Window and FrameBox are frequently used.
Adds a child to the collection.
Widget* pWidget : The widget to add.Removes a child widget from the collection.
Widget* pWidget : The widget to remove.Checks if a widget is a child of this container.
Widget* pWidget : The widget to check for.Makes all the children visible.
Makes all the children not visible.
Calls the given callback function for each child widget.
void (*cb)(Widget *child, void *data) pCallback : The callback function to call.This class provides a numeric input mechanism. Most methods generally used with a slider are handled by the parent class Valuator.
Constructs a new Counter widget.
The event class describes the circumstances under which an event occured. Not all the values possibly stored in the Event class are filled in by each different type of event. Refer to each class's object event documentation to see which values are set by that type of event.
Constructs a new event object with the default values.
Returns the boolean state of the event. For example, a Toggle widget sets this to its state.
Returns the size. Generally used by Resize events.
Returns the point location of the event. Generally used by Canvas mouse events.
Returns the string of the event. Choice selections and Canvas key events are some events that set this field.
Returns the button of the event. Canvas mouse events use this field, for example.
Returns whether the Control key was pressed when the event happened. Canvas mouse and keyboard events use this field.
Returns whether the Shift key was pressed when the event happened. Canvas mouse and keyboard events use this field.
Returns whether the Alt/Meta key was pressed when the event happened. Canvas mouse and keyboard events use this field.
Returns any index that may be associated with the event. A Choice selection event fills this field, for example.
Returns any identification number that might be associated with this event. Timer events supply the id, for example.
Returns the unshifted ASCII code corresponding to the key press. This may also be a KEY_* constant for non-printing characters. Canvas key events use this field.
Indicates that the event handler accepted the event. This is used mostly for window close events. For detail on how the window closing mechanism works, see the Window class documentation.
Indicates that the event handler declined the event. This is used mostly for window close events. For detail on how the window closing mechanism works, see the Window class documentation.
A decorative container that holds other widgets while drawing a nice engraved border around them. A FrameBox is generally used to group widgets with related functionality together.
Constructs a new FrameBox.
A 2-D plotting widget that draws plots. It provides zooming
and auto-scaling capabilites, and can also automatically calculate
appropriate grid line and tick mark spacings. It also provides
two X-Y cursors. They can be locked
to a specified plot.
Note:
Modifying a plot's rendering properties, or other graphing widget properties
may require calling the redraw() method to realize the changes on the
screen.
Constructs a new graphing widget.
Plots the given data points using the specified styling, and returns the plot identifier.
PlotId id : The plot identifier. Can be NEW_PLOT to create a new plot the next available identifier.Plots the given data points using the specified styling, and returns the plot identifier.
PlotId id : The plot identifier. Can be NEW_PLOT to create a new plot the next available identifier.Plots the given data points using the specified styling, and returns the plot identifier.
PlotId id : The plot identifier. Can be NEW_PLOT to create a new plot the next available identifier.Plots the given data points using the specified styling, and returns the plot identifier.
PlotId id : The plot identifier. Can be NEW_PLOT to create a new plot the next available identifier.Disables the specified plot.
PlotId id : The plot identifier.Returns the rendering color of the plot.
PlotId id : The plot identifier.Sets the rendering color of the plot.
PlotId id : The plot identifier.Returns the current thickness with which the plot is rendered.
PlotId id : The plot identifier.Sets the line thickness of the plot.
PlotId id : The plot identifier.Changes the way the plot is rendered.
PlotId id : The plot identifier.Returns the current plot rendering style.
PlotId id : The plot identifier.Returns whether the plot is visible or not.
PlotId id : The plot identifier.Changes whether the specified plot is drawn on the graph or not.
PlotId id : The plot identifier.Returns the file name of the plot. Returns an empty string if the plot has not been saved.
PlotId id : The plot identifier.Saves the specified plot to the current file name. If the plot has not been saved yet, the saveAs() method must be called first to set the file name.
PlotId id : The plot identifier.Saves the specified plot to the specified file name, and updates the plot's file name.
PlotId id : The plot identifier.Loads plot data from the given file into the specified plot. Upon success it updates the file name.
PlotId id : The plot identifier.Set the X-coordinate of the i-th point in the specified plot.
PlotId id : The plot identifier.Set the Y-coordinate of the i-th point in the specified plot.
PlotId id : The plot identifier.Returns the i-th point of the specified plot.
PlotId id : The plot identifier.Sets the X and Y coordinates of the i-th point on the specified plot.
PlotId id : The plot identifier.Sets the X and Y coordinates of the i-th point on the specified plot.
PlotId id : The plot identifier.Returns the number of points in the specified plot.
PlotId id : The plot identifier.Automatically computes the X and Y ranges so that all the graphs are visible simultaneously. It may be necessary to call the redraw() method to ensure that the changes are reflected on the screen.
Automatically scales the graph to the given plot. The scaling may be along only one axis or both, specified by XAXIS, YAXIS, or BOTH.
PlotId id : The plot to scale the graph to.Zooms in on the graph.
Zooms out on the graph.
Changes the X-axis range to the specifed minimal and maximal values. This method returns false if the range was invalid, but otherwise generates a RangeChanged event and returns true.
double min : The minimum X value.Changes the Y-axis range to the specifed minimal and maximal values. This method returns false if the range was invalid, but otherwise generates a RangeChanged event and returns true.
double min : The minimum Y value.Changes the visiblity of the specified cursor. If the visibility of the cursor changes, a CursorVisibility is generated with the cursor id available from the Event::getId() method. There are four possible cursor ids: X1, Y1, X2, Y2.
CursorId cid : Specifies which cursor. (i.e. Graph::X1, or Graph::Y2)Returns the visibility state of a cursor.
int c : The cursor id.Returns the current position of a cursor.
int c : The cursor id.Locks the specified cursor to the given plot.
CursorId id : The cursor id.Unlocks the specified cursor from any plot that it may be locked to.
CursorId id : The cursor id.Returns the minimum X-value of the x-axis range.
Returns the maximum X-value of the x-axis range.
Returns the minimum Y-value of the y-axis range.
Returns the maximum Y-value of the y-axis range.
Changes the X-axis text label.
const String& s : The new label.Changes the Y-axis text label.
const String& s : The new label.Changes whether tick marks are draw as full dotted lines or simply ticks along the axes.
bool b : Whether to draw ticks as dotted lines or not.Sets whether the grid and tick spacing is calculated automatically.
bool b : To enable grid auto-calculation or not.Sets how many tick marks there are between each grid line in the X direction.
int i : The number of divisions.Sets how many tick marks there are between each grid line in the Y direction.
int i : The number of divisions.Sets the interval at which grid lines are drawn in the X direction.
double i : The grid spacing.Sets the interval at which grid lines are drawn in the Y direction.
double i : The grid spacing.This widget displays a static piece of text on the screen. The label can be modified with the appropriate functions.
Constructs a new label widget.
Sets the text displayed.
const String& pLabel : The new label.Returns the currently displayed text.
The ListBox widget displays a scrolling list of text lines. A user can select one line at a time, and the text list can be manipulated with the standard addition and removal functions.
Constructs a new ListBox widget.
Appends the specified string to the end of the list.
const String& s : The string to append.Prepends the specified string to the beginning of the list.
const String& s : The string to prepend.Inserts a string to a specified location in the list.
const String& s : The string to insert.Removes the string at the given index. If the index is out of range, nothing happens.
int index : The index of the string to remove.Searches the list for a string. Returns the index of the first occurence if found, otherwise returns -1.
const String& s : The string to search for.Empties the list box.
Returns the number of items in the list.
Returns the text at the specified index.
int i : Specifies which string to return.Changes the text displayed at the given index.
int index : The index of the item to change.Clears the list and inserts the items in the string array.
const StringArray& pStrs : The strings.Returns the index of the currently selected item, or -1 if no item is selected.
Changes the current selection.
int pIndex : The index of the new selection. If the index is out of the range, nothing happens.Unselects any selected items in the list.
Returns whether the ith line visible.
Scrolls the list box to set the ith element as the top line.
int i : The line index.Returns the index of the current top line visible.
Scrolls the list box to make the ith line the middle line in the view.
int i : The item's index.Scrolls the list box to make the ith line the bottom line in the view.
int i : The item's index.Returns the current scroll position as an integer value.
Sets the current scroll position.
The MenuBar widget provides a hierarchical menu widget.
The items can be standard menu items, or check items.
Accelerator shortcuts can be assigned to menu items also.
Each menu item has a unique string path
that identifies it in the hierarchy. For example, "File/New"
would identify the New item in the File menu.
For deeper menus, simply extend the hierarchy:
"Edit/Preferences/General Preferences/Set Color...". The
following sample creates a minimal menubar for a text editor.
   MenuBar *mbar = new MenuBar;
   mbar->append("File/New", false, true, 'n', MOD_CTRL);
   mbar->append("File/Open", false, false, 'o', MOD_CTRL);
   mbar->append("File/Save", false, false, 's', MOD_CTRL);
   mbar->append("File/Save As", false, true);
   mbar->append("File/Quit");
   mbar->append("Edit/Cut", false, false, 'x', MOD_CTRL);
   mbar->append("Edit/Copy", false, false, 'c', MOD_CTRL);
   mbar->append("Edit/Paste", false, false, 'v', MOD_CTRL);
   mbar->append("Help/About", false, false, 'a', MOD_ALT);
To handle menu events, simply check the event's string in the MenuBar's
Activated event handler.
   void SomeWindow::OnMenuBar1Activated( Event &pEvt ) {
     if (pEvt.getString() == "File/New") {
       // code to create a new file
     } else if (pEvt.getString() == "File/Open") {
       // code to open a file
     }
   }
Creates a new menu bar widget.
Adds all the items in the array into the menu. The items default to a standard menu item, with no separators, and no accelerators.
const StringArray& pItems : The hierarchical menu item paths.Appends a menu item onto the menu bar.
const String& pMenuPath : The hierarchical menu path identifying the item.Removes the specified menu item.
const String& pPath : The path to the menu item.Changes the state of a checkable menu item.
const String& pPath : The path to the check item.Returns the state of a check item.
const String& pPath : The path to the check item.Enables or disables a menu item. Disabled items are grayed out and cannot be selected.
const String& pPath : The path to the menu item.Returns whether a menu item is enabled or disabled.
const String& pPath : The path to the menu item.This class provides a password entry widget that masks the input characters with a symbol on the screen. The underlying text can be worked with using the methods of the TextInput base class.
Constructs a new password widget.
A simple toggleable radio button widget.
Constructs a new radio button.
Sets the text displayed on the radio button.
const String& pLabel : The new radio button label.Returns the radio button's label.
Changes the state of the radio button. Note that this does not generate a Toggle event.
bool pState : The new state.Returns the current state of the radio button.
Changes to the opposite state. This generates a Toggled event.
This class provides a horizontal or vertical scrollbar to provide scrolling capabilities, or a numeric input mechanism. Most methods generally used with a scrollbar are handled by the parent class Valuator.
Constructs a new Scrollbar widget.
Sets the orientation for the scrollbar. The default is horizontal.
bool b : True for a vertical scrollbar.Sets the dimension of the moving part of the slider. This is the fraction of the size of the whole widget. The default is 0.08.
float f : The percent of the size of the widget to make the sliding part.Returns the size of the slider as a precentage of the size of the whole widget.
Returns the integer value of the slider. To get the floating point value, use Valuator::getValue().
Sets the range, value, and slider size of the scrollbar to make a variable sized one. This method should be called from the callback, including when the data changes size, the window is resized, or the scroll position changes.
int position : The current position.Controls how big the steps are that the arrow keys make. The default is 16.
int i : The number of steps to take for an arrow key press.Returns the number of steps take for an arrow key press.
A heavy-duty multi-line text editor that can display large text files. The editor provides its own scrollbars in both the horizontal and vertical directions. The widget also provides methods for saving and loading text files, as well as for searching for text strings. The text is rendered in a fixed monospace typeface.
Constructs a new text editor widget.
Sets the text in the editor.
const String& pText : The text string.Returns the entire text in the editor.
Returns the text between the specified start and end positions.
int pStart : The starting position.Returns the character at the specified position.
int pPos : The position.Removes all the text from the editor.
Inserts text at the current insertion position.
const String& pText : The text to insert.Inserts text at the given insertion position.
int pStart : The insertion position.Removes a range of text between the given positions.
int pStart : The starting position.Replaces the range of text between the given positions with new text.
int pStart : The starting position.Replaces the current selection with new text.
const String& pText : The new text.Appends some text to the end of the buffer.
const String& pText : The text to append.Returns the length of the text stored in the editor.
Attempts to load the text file specified, returning true on success.
const String& pFileName : The file name.Attempts to save the text to the file specified, returning true on success.
const String& pFileName : The file name.Changes the current insertion position.
int pPos : The new position.Returns the current insertion position.
Cuts the selected text to the clipboard.
Copies the selected text to the clipboard.
Pastes any text on the system clipboard into the editor, replacing any selection.
Returns the position of the start of the line containing the specified position.
int pPos : The position.Returns the position of the end of the line containing the specified position.
int pPos : The position.Selects the text in the specified range.
int pStart : The starting position.Selects all of the text in the editor.
Unselects the current selection.
Searches for text starting from the given position forward. Returns whether the text was found or not.
int pStart : The starting position for the search.Searches for text starting from the given position backwards. Returns whether the text was found or not.
int pStart : The starting position for the search.Ensures that the insertion position is visible.
Returns the current tab width.
Sets the display width of tabs.
int pWidth : The tab width.This class provides a simple single line text entry widget. The underlying text can be worked with using the methods of the TextInput base class.
Constructs a new text field widget.
The TextInput class provides a base class for single line text manipulation widgets. It cannot be instantiated on its own, but its direct descendants TextEntry and PasswordEntry are frequently used in graphical applications.
Sets the text in the entry.
const String& pText : The text string.Returns the text in the entry.
Removes all the text.
Returns the length of the text stored in the entry.
Changes the current insertion position.
int pPos : The new position.Returns the current insertion position.
Changes the maximum length of an accepted string in the entry.
int l : The new maximum length.Returns the maximum length of strings accepted.
Selects the text in the specified range.
int pStart : The starting position.Selects all of the text in the editor.
Changes whether the text in the entry is editable.
bool pEditable : To enable editing or not.Returns whether the entry is user-editable.
Sets the text to the integer numeric value.
int v : The value.Sets the text to the double numeric value.
double v : The value.Gets the integer value of the text.
Gets the double value of the text.
A timer class that provides evenly spaced timeout events to an application. The timeout period is specified in seconds using a floating point value for fractional parts of seconds. A timer can be a one-time timeout or can timeout repeatedly.
Constructs a new timer.
Sets whether the timeout happens once or repeatedly, and starts the timer.
bool once : True for single timeout, false for repeated ones.Sets the timeout period and starts the timer.
double pSecs : The timeout in seconds.Returns whether the timer is a single-shot type or not.
Returns whether the timeout value in seconds
Starts the timer with the specified values.
double secs : The timeout in seconds.Stops the timer.
Returns whether the timer is currently running.
The Toggle widget provides a boolean input control. The widget can display different text for the on and off states, and the current state is reflected by a yellow indicator light.
Constructs a new toggle widget.
Changes the text displayed when the toggle is on.
const String& pText : The text label.Changes the text displayed when the toggle is off.
const String& pText : The text label.Returns the text displayed when the toggle is on.
Returns the text displayed when the toggle is off.
Changes the state of the toggle. Note that this does not generate a Toggle event.
bool pState : The new state.Returns the current state of the toggle.
Changes to the opposite state. This generates a Toggled event.
This class stores a width and a height.
Constructs a new Size object with 0 width and 0 height.
Constructs a new Size object with the given width and height.
int pWidth : The width.Returns the width.
Returns the height.
Sets the size.
int pWidth : The width. A storage unit for integral x and y coordinates. The x and y
coordinates can be accessed directly. For example:
   Point pt;
   pt.x = 1;
   pt.y = 2;
Constructs a new point.
Constructs a new point with the specified x and y values.
int x : The X-value.Sets the x and y values.
int x : The X-value.Calculates the distance between the two points. Note that this is a static function.
const Point& p1 : The first point. A storage unit for floating point x and y coordinates. The x and y
coordinates can be accessed directly. For example:
   PointF pt;
   pt.x = 1.98;
   pt.y = 2.23;
Constructs a new point with double precision coordinates.
Constructs a new PointF with the specified x and y values.
double x : The X-value.Sets the x and y values.
double x : The X-value.Calculates the distance between the two points. Note that this is a static function.
const PointF& p1 : The first point.Calculates the distance to the given point.
const PointF& p1 : The point. This class holds color information for drawing.
A database of string-identified predefined colors
is maintained for convenience. A partial list is
given here:
   "red"
   "green"
   "blue"
   "gray"
   "light gray"
   "black"
   "white"
   "yellow"
   "violet"
The R-G-B color data is stored as three unsigned char
member variables. These can be modified directly,
as shown below:
   Color my_color;
   my_color.red = 0xE2;
   my_color.green = 0xA7;
   my_color.blue = 0x09;
Constructs a new Color object, defaulting to black.
Constructs a new Color object with the specified string identifier.
const String& pName : The color's database name.Constructs a new Color object with the specified R-G-B values.
unsigned char r : The red value.Changes the color to the one specified by the name.
const String& pName : The database color name.Sets the color.
const String& pName : The color's database name.Sets the color.
unsigned char r : The red value.The Valuator class provides a base class for numeric input widgets. It cannot be instantiated on its own, but its direct descendants Scrollbar, Counter, Slider, ValueSlider, ValueInput, and ValueOutput are frequently used widgets.
Clamps the given value to the range of the slider and returns the clamped value.
double value : The value to clamp.Rounds the given value to the nearest step increment and returns the rounded value.
double value : The value to round.Returns the valuator's maximum value.
Sets the valuator's maximum value.
double max : The maximum value.Returns the valuator's minimum value.
Sets the valuator's minimum value.
double min : The minimum value.Sets the step value to 1/10^ndigits.
int ndigits : The precision value.Sets the minimum and maximum values of the valuator.
double min : The minimum value.Sets the step/increment value.
double step : The increment valueSets the step/increment value as a ratio of two integers.
int n : The numerator of the ratio.Returns the step/increment value.
Sets the value of the valuator. This does not clamp or round the value. Call those functions before setting the value.
double val : The new value.Returns the value of the valuator.
This class provides a horizontal or vertical slider to provide a numeric input mechanism. Most methods generally used with a slider are handled by the parent class Valuator.
Constructs a new ValueSlider widget.
Sets the orientation for the slider. The default is horizontal.
bool b : True for a vertical slider.This is the base class for all graphical user interface components. It provides the basic geometry management functions, as well as functions for changing visibility, focus, and parent widgets. A widget cannot be created directly.
Calling this method causes the widget to destroy itself. This deletes the object.
Changes the widget's parent container.
Container* pParent : The new parent container.Returns the parent container.
Causes the widget to be visible on the screen.
Causes the widget to be hidden from view.
Sets the foreground color of the widget. Usually this is the text label.
const Color& c : The color.Sets the background color of the widget.
const Color& c : The color.Changes whether the widget is sensitive to user interactions.
bool pEnable : Whether to enable or diable the widget.Attempts to acquire the input focus.
Changes the widget's upper-left x,y coordinates relative to its parent container.
int pX : The X coordinate.Changes the widget's size.
int pWidth : The new width.Changes the widget's position and size.
int pX : The X coordinate.Returns the widget's width in pixels.
Returns the widget's height in pixels.
Gets the widget's x-y position.
int& pX : The integer to assign the X-coordinate to.Gets the widget's position and size.
int& pX : The integer to assign the X-coordinate to.Sets the tooltip shown for the widget when the mouse hovers above it.
const String& str : The string to display. An empty string clears the tooltip.Causes the widget to redraw itself on the screen. Note that this can be used to force a Paint event for a Canvas widget.
This class provides a toplevel window on the screen. It is a descendant
of the container class, and thus can hold other widgets directly.
It generates events when it is loaded (or created), unloaded (or destroyed),
for user close requests, and when it is resized.
Note that handling Close events may not seem very straightforward.
By default, a window will ignore close events from the system (i.e. clicking
on the X close button on the window's border) and remain on the screen.
To accept a close event, the event sent to a OnClose( ) handler
must be accepted by calling the Event::accept() method.
   void MyWindow::OnClose( Event &pEvt ) {
     pEvt.accept();
   }
This close mechanism may seem overly complicated, but it allows
for a general way to ensure that a user's data can be saved
before a window is unloaded without writing the code to check
for window closability multiple places.
Constructs a new toplevel window.
Causes the window to be modal. That means that other windows in the application will be blocked until this one is unloaded. Note that once a window is made modal, it cannot be made unmodal.
bool pModal : Enable window modality or not.Enables window resizing. Once a window is made resizable, it cannot be made to require a fixed size any longer.
bool pResizable : Enable resizing or not.Centers the window on the screen.
bool pCentered : If true, the window will be centered on the screen.Changes the window's title on its border.
const String& pTitle : The new window title.Changes whether the window has a system-supplied border around it.
bool pBorder : Enable the system border or not.Causes a Close event to be generated on the window. Returns whether the close event was accepted or rejected.