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...
#include <cursorwindow.h>
Public Member Functions | |
bool | compute_actual_width (viewport *v) |
Compute actual width of input area given window size limitations. The function return value indicates that the offset_ member changed -- this implies a need to repaint the text input region. | |
void | draw_input_area (viewport *v, bool highlighted) |
paints [ ok ] | |
void | handle_key (viewport *v, int key) |
ignores all keys | |
void | handle_paging (viewport *v) |
Use horizontal paging if necessary to insure that the character in the string under col_ is actually visible. | |
void | setColumn (int col) |
Set the current input column. | |
String (std::string const &name, std::string const &label, std::string const &default_value, int input_width) | |
Public Attributes | |
int | input_width_ |
std::string | label_ |
std::string | name_ |
std::string | value_ |
Protected Attributes | |
Dialog * | dialog_ |
bool | password_ |
this is a password string -- dont' echo its contents | |
Private Attributes | |
int | col_ |
current input column (where cursor goes) (relative to the string, not the window. | |
int | input_ |
actual_input_col_ obtained by draw_input_area when ever it is invoked. This is the left most column where input of this string occurs in its dialog window. | |
int | offset_ |
from beginning of string to first displayed char -- ie the character displayed in the input_ col. | |
int | width_ |
ACTUAL input width given window size limitations. | |
Friends | |
class | Dialog |
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.
In order for tab completion to work correctly, you will probably have to use Dialog::set_completion_directory() based on the 'current' directory you wish to present the user with. This can be obtained from the ViewerManager using ViewerManager::active_directory().
Definition at line 1241 of file cursorwindow.h.
String | ( | std::string const & | name, | |
std::string const & | label, | |||
std::string const & | default_value, | |||
int | input_width | |||
) |
< Construct a string field.
Definition at line 1277 of file cursorwindow.h.
bool compute_actual_width | ( | viewport * | v | ) |
Compute actual width of input area given window size limitations. The function return value indicates that the offset_ member changed -- this implies a need to repaint the text input region.
Definition at line 2236 of file cursorwindow.cxx.
void draw_input_area | ( | viewport * | v, | |
bool | highlighted | |||
) | [virtual] |
paints [ ok ]
Implements Element.
Definition at line 2308 of file cursorwindow.cxx.
void handle_key | ( | viewport * | v, | |
int | key | |||
) | [virtual] |
ignores all keys
Implements Element.
Definition at line 2359 of file cursorwindow.cxx.
void handle_paging | ( | viewport * | v | ) |
Use horizontal paging if necessary to insure that the character in the string under col_ is actually visible.
Definition at line 2288 of file cursorwindow.cxx.
void setColumn | ( | int | col | ) |
Set the current input column.
Definition at line 2351 of file cursorwindow.cxx.
friend class Dialog [friend, inherited] |
Definition at line 1169 of file cursorwindow.h.
int col_ [private] |
current input column (where cursor goes) (relative to the string, not the window.
Definition at line 1259 of file cursorwindow.h.
Definition at line 1166 of file cursorwindow.h.
int input_ [private] |
actual_input_col_ obtained by draw_input_area when ever it is invoked. This is the left most column where input of this string occurs in its dialog window.
Definition at line 1267 of file cursorwindow.h.
int input_width_ [inherited] |
Definition at line 1176 of file cursorwindow.h.
std::string label_ [inherited] |
Definition at line 1174 of file cursorwindow.h.
std::string name_ [inherited] |
Definition at line 1173 of file cursorwindow.h.
int offset_ [private] |
from beginning of string to first displayed char -- ie the character displayed in the input_ col.
Definition at line 1262 of file cursorwindow.h.
bool password_ [protected] |
this is a password string -- dont' echo its contents
Definition at line 1273 of file cursorwindow.h.
std::string value_ [inherited] |
Definition at line 1175 of file cursorwindow.h.
int width_ [private] |
ACTUAL input width given window size limitations.
Definition at line 1265 of file cursorwindow.h.