Dialog Class Reference

A Dialog is a list of fields which which will be displayed in a viewport and the user can edit them. Users of a Dialog initalize the list of fields, each of which must be a Dialog::Element. They then let the user edit the fields. After editing is complete, the caller iterates over the fields to see what changed. More...

#include <cursorwindow.h>

Inheritance diagram for Dialog:
Inheritance graph
[legend]
Collaboration diagram for Dialog:
Collaboration graph
[legend]

List of all members.

Classes

class  Element
 An input element in a Dialog. This is an abstract base class from which you can derive -- although there are some builtins (Ok,string, etc). The popup() function will handle some keys and some will be sent to the element's handle_key method. The draw() method may be invoked multiples times within the popup() function call. More...
class  Impl
 This class holds the dialog implementation data. More...
class  Ok
 A dialog element that does nothing -- you typically use this as the last element of dialog so that the user has one last chance after entering data in the last real field to edit his work. It has not input semantics -- except wasting time. More...
class  Password
 Same as String, except that the user never gets to see what he has typed in. More...
class  String
 A String is a dialog element that prompts the user for a character string -- providing a default value. Normal keyboard editing keys are active. The 'tab' key has special interpretation. It completes the string under the cursor. That is, if you press the tab key, the string under the cursor is treated as a partial file name fragment and you are presented with the valid completions for your selection. If there is only one valid selection, it is chosen for you automatically. More...

Public Types

enum  cmd_constant {
  activate,
  deactivate,
  resize
}
 

values that will be passed to the function call operator method.

More...
typedef std::list< Element * > element_list_t
typedef element_list_t::iterator iterator

Public Member Functions

iterator begin ()
std::string const & completion_directory () const
 Get a reference to the 'current directory' which should be used by string elements when the user presses the tab key to activate 'tab completion' of file names.
 Dialog (std::string title)
 All dialogs must have a title string.
std::string element_value (std::string const &name)
 Search all elements until you find the one with the specified name and return its value. If the string is not found, you get an empty string back. If you specify an invalid name, the string will be empty as well. So specify wisely...
iterator end ()
void operator() (viewport *vp, int cmd)
 Handles repaints when window sizes change.
Dialogoperator+= (Element *e)
 Add elements to the dialog before poping it up.
bool popup (CursorWindow *)
 Popup the dialog and let the user edit the fields. If this function returns true, the user aborted.
void set_completion_directory (std::string const &s)
 Set the 'current directory' which should be observed when tab completion key strokes are interpreted by elements. This value is by default empty and.
void set_first_input_field (std::string const &s)
 Set the name of the field the cursor will go on when the popup function is called.
 ~Dialog ()
 Ah, the _destructor_. Hmmm.

Private Attributes

Implimpl_

Friends

class Impl

Detailed Description

A Dialog is a list of fields which which will be displayed in a viewport and the user can edit them. Users of a Dialog initalize the list of fields, each of which must be a Dialog::Element. They then let the user edit the fields. After editing is complete, the caller iterates over the fields to see what changed.

To allow user interaction, call 'popup()'. After the user has finished editing the last field (including, simply ok'ing its contents), the dialog automatically pops down and you can iterate over the fields.

If the user presses Esc, the dialog terminates early. The popup() function handles the user edits and returns true if the user aborts using the Esc key.

See the comments in the class Elements for a general description of a dialog's use.

Definition at line 1059 of file cursorwindow.h.


Member Typedef Documentation

typedef std::list<Element*> element_list_t

Definition at line 1206 of file cursorwindow.h.

Definition at line 1207 of file cursorwindow.h.


Member Enumeration Documentation

enum cmd_constant [inherited]

values that will be passed to the function call operator method.

Enumerator:
activate 

means you have been activated

deactivate 

some other viewport has taken focus

resize 

only the size has changed

Definition at line 793 of file cursorwindow.h.


Constructor & Destructor Documentation

Dialog ( std::string  title  ) 

All dialogs must have a title string.

Definition at line 2125 of file cursorwindow.cxx.

Here is the call graph for this function:

~Dialog (  ) 

Ah, the _destructor_. Hmmm.

Definition at line 2157 of file cursorwindow.cxx.

Here is the call graph for this function:


Member Function Documentation

Definition at line 2202 of file cursorwindow.cxx.

Here is the caller graph for this function:

std::string const & completion_directory (  )  const

Get a reference to the 'current directory' which should be used by string elements when the user presses the tab key to activate 'tab completion' of file names.

Definition at line 2186 of file cursorwindow.cxx.

Here is the caller graph for this function:

string element_value ( std::string const &  name  ) 

Search all elements until you find the one with the specified name and return its value. If the string is not found, you get an empty string back. If you specify an invalid name, the string will be empty as well. So specify wisely...

Definition at line 3782 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2210 of file cursorwindow.cxx.

Here is the caller graph for this function:

void operator() ( viewport vp,
int  cmd 
) [virtual]

Handles repaints when window sizes change.

Implements repaint_handler.

Definition at line 2986 of file cursorwindow.cxx.

Here is the call graph for this function:

CursorWindow::Dialog & operator+= ( Element e  ) 

Add elements to the dialog before poping it up.

Definition at line 2171 of file cursorwindow.cxx.

bool popup ( CursorWindow w  ) 

Popup the dialog and let the user edit the fields. If this function returns true, the user aborted.

Definition at line 2780 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void set_completion_directory ( std::string const &  s  ) 

Set the 'current directory' which should be observed when tab completion key strokes are interpreted by elements. This value is by default empty and.

Definition at line 2193 of file cursorwindow.cxx.

Here is the caller graph for this function:

void set_first_input_field ( std::string const &  s  ) 

Set the name of the field the cursor will go on when the popup function is called.

Definition at line 2089 of file cursorwindow.cxx.

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class Impl [friend]

Definition at line 1082 of file cursorwindow.h.


Member Data Documentation

Impl* impl_ [private]

Definition at line 1087 of file cursorwindow.h.


The documentation for this class was generated from the following files:
Generated on Wed Feb 29 22:53:33 2012 for CXXUtilities by  doxygen 1.6.3