Selection Class Reference

A Selection object is a simpler version of a Dialog. It presents the user with a list of strings of which he/she is allowed to select exactly one -- or press the escape key to abort. To use a Selection object, do the following: More...

#include <cursorwindow.h>

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

List of all members.

Classes

class  Impl
 Instead of burdening the include/cursorwindow file with these messy implementation details, they are encapsulated in this nested type which is not implemented in the aforenamed header. More...

Public Types

enum  cmd_constant {
  activate,
  deactivate,
  resize
}
 

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

More...
typedef std::list< std::string > rep_type
 actual implementation

Public Member Functions

void operator() (viewport *vp, int cmd)
 Handles repaints when window sizes change.
void operator+= (std::string const &s)
bool popup (CursorWindow *)
 Popup the Selection and let the user select an item or abort. If this function returns true, the user aborted.
 Selection (std::string title)
 All Selections must have a title string.
 ~Selection ()
 Ah, the _destructor_. Hmmm.

Public Attributes

rep_type rep_
 container of strings that will be presented to the user. They are your strings, dork with them to your hearts content.
std::string selection_
 the user's actual selection made during the popup call. Will be null if the user aborts.

Private Attributes

Implimpl_
 private data not to be messedwith

Detailed Description

A Selection object is a simpler version of a Dialog. It presents the user with a list of strings of which he/she is allowed to select exactly one -- or press the escape key to abort. To use a Selection object, do the following:

Create your object then append strings to the selection using operator+= () then call popup() if popup returns false, the use the selection_ member as the value chosen.

To append a string, use operator+=. For example:

          Selection s("Some title");
      
            s += "line 1";
            s += "line 2";
      
          if(!s.popup(window))
          {
             // use the s.selection_ variable
          }

Definition at line 1341 of file cursorwindow.h.


Member Typedef Documentation

typedef std::list<std::string> rep_type

actual implementation

Definition at line 1372 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

Selection ( std::string  title  ) 

All Selections must have a title string.

Definition at line 3217 of file cursorwindow.cxx.

~Selection (  ) 

Ah, the _destructor_. Hmmm.

Definition at line 3233 of file cursorwindow.cxx.


Member Function Documentation

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

Handles repaints when window sizes change.

Implements repaint_handler.

Definition at line 3577 of file cursorwindow.cxx.

Here is the call graph for this function:

void operator+= ( std::string const &  s  ) 

< Append strings to rep_

Definition at line 1414 of file cursorwindow.h.

bool popup ( CursorWindow w  ) 

Popup the Selection and let the user select an item or abort. If this function returns true, the user aborted.

Draw the selection list in the center of the window and let the user pick one of the entries.

Definition at line 3258 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Impl* impl_ [private]

private data not to be messedwith

Definition at line 1377 of file cursorwindow.h.

container of strings that will be presented to the user. They are your strings, dork with them to your hearts content.

Definition at line 1382 of file cursorwindow.h.

std::string selection_

the user's actual selection made during the popup call. Will be null if the user aborts.

Definition at line 1388 of file cursorwindow.h.


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