CursorWindow Class Reference

Before directly using this class, you should consider reading text_windows. More...

#include <cursorwindow.h>

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

List of all members.

Classes

class  Dialog
 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...
class  FileSelector
struct  input_event
 An input_event is _any_ kind of input from the user, including keys, screen resizes, etc. If NoKey is the type, then the event should be ignored. More...
class  Message
 A Message object is a simpler version of a Dialog. It does not allow the user to make any selections -- it just presents the user with a scrolloing list of lines of test. When the user presses enter, the message goes away. More...
struct  resize_handler
 A resize_handler gets invoked if the user resizes the window. But only if you have specified the resize handler to use by calling the set_resize_handler() method. If you don't make such a call, the window size change event will be reported by the read_input() function. If you do make the setting, you will not receive any ResizeKey events. If you are using viewports, the resize_handler's job is mainly to enforce your viewport resize policy. That is, you use this function to scale the viewports after a resize. If you are not using viewports, this function's job will be to repaint the window correctly. If you are using viewports, the resizing event will automatically invoke their repaint methods after first invoking your resize_handler. See the file lib/cursorwindow.c and look for function resize_viewports() to see what a resize_handler has to do. Note that you can't use that code directly. If you are using a resize_handler of your own construction, you should maintain your own list of viewports over which can iterate. More...
struct  row_col
 A pair of integers representing a row and a column. More...
class  Selection
 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...
class  viewport
 Before directly using this class, you should consider reading text_windows. More...
class  Window
 This class holds the real CursorWindow datastructures. It is hidden from view because its inclusion is unnecessary and because curses might be included which adds all kinds of annoying macros into your compilation stream. More...

Public Types

typedef OstreamableBuffer
< CursorWindow, char,
std::char_traits< char > > 
buf_type
typedef char char_type
enum  edit_function_names {
  func_unknown,
  func_up,
  func_down,
  func_left,
  func_right,
  func_ic,
  func_dc,
  func_home,
  func_end,
  func_prior,
  func_next,
  func_dc_prev,
  func_tab,
  func_btab,
  func_top,
  func_bottom,
  func_esc,
  func_enter,
  func_data,
  func_clreol,
  func_nextwd,
  func_prevwd,
  func_upword,
  func_dnword,
  func_undo,
  func_find,
  func_findnxt,
  func_findprv,
  func_repl,
  func_replnext,
  func_help,
  func_mark,
  func_dl,
  func_db,
  func_cb,
  func_wb,
  func_paste,
  func_goto,
  func_matching,
  func_dw,
  func_join,
  func_insline,
  func_to_edit,
  func_reread,
  func_switch,
  func_insfile,
  user_function_0 = 0x100
}
 

Symbolic names for the normal text edit functions you might need to perform in a dialog window. Associated with a CursorWindow there is a mapping between key values (integers) and edit function enumeraion values. You can add your own functions to the window's edit function map -- but dialog handler won't use them for anything. To add your own functions, use numeric identifiers bigger than 'user_function_0'. There can be only intepretation of a given curses key value, but more than one key may map to the same edit function.

More...
typedef traits_type::int_type int_type
enum  key_names {
  first_function_key = 0x100,
  key_f1,
  key_f2,
  key_f3,
  key_f4,
  key_f5,
  key_f6,
  key_f7,
  key_f8,
  key_f9,
  key_f10,
  key_f11,
  key_f12,
  key_up,
  key_down,
  key_left,
  key_right,
  key_home,
  key_end,
  key_prior,
  key_next,
  key_ic,
  key_dc,
  key_bs,
  key_btab,
  key_sf1,
  key_sf2,
  key_sf3,
  key_sf4,
  key_sf5,
  key_sf6,
  key_sf7,
  key_sf8,
  key_sf9,
  key_sf10,
  key_sf11,
  key_sf12,
  key_sup,
  key_sdown,
  key_sleft,
  key_sright,
  key_shome,
  key_send,
  key_sprior,
  key_snext,
  key_sic,
  key_sdc,
  last_function_key
}
 

the names of function keys

More...
typedef traits_type::off_type off_type
typedef traits_type::pos_type pos_type
enum  text_attributes {
  normal,
  reversed,
  underlined,
  blinking,
  bold,
  reverse_ul,
  reverse_bold,
  rev_ul_bold,
  bold_ul
}
 

Names for text attribute values. Note that they are mutually exclusive.

More...
typedef std::char_traits< char > traits_type

Public Member Functions

void beep ()
 Produce an audible alarm.
void box (int width, int height, bool filled, std::string title)
 Draw a box starting at the current cursor position that is width columns wide and height columns tall (running down from the current cursor position.
void box (int width, int height, bool filled, char const *title=0)
 Draw a box starting at the current cursor position that is width columns wide and height columns tall (running down from the current cursor position.
void box (int width, int height, bool filled, char const *title_string, unsigned length)
 Draw a box starting at the current cursor position that is width columns wide and height columns tall (running down from the current cursor position.
void clear_error ()
 Clear out the current error flag. Doesn't delete the string.
void close ()
 Close the cursor window if it is open. Repaint the terminal screen with the saved contents if possible. Note that this does not damage any data structures -- it just closes the window and sets the flag. See resize_viewports() below.
row_col curpos () const
 Get the current cursor position.
 CursorWindow ()
 Construct a cursor window but do not open it.
char const * error () const
 Get a string representation of the most recent error if any. If no error has occurred, then null is returned. All methods first clear the error condition and set it only if there is an error.
void fill_to_eol (char c=' ')
 Fill the rest of the current line, starting at the current cursor position, with a specified character -- defaulting to space.
void fill_to_eos (char c=' ')
 Fill the rest of the current screen, starting at the current cursor position, with a specified character -- defaulting to space.
int get_viewports (std::list< viewport > *viewports)
 Get a list of the currently extant viewports. Returns the count of viewports as well. The viewports returned are not the owner of the physical screen are valid ONLY until the next creation or deletion of a viewport.
void needs_resized ()
 Called to force a complete repaint of the window.
std::auto_ptr< viewportnew_viewport (viewport::repaint_handler *, viewport::position p=viewport::tiled)
 Create a new viewport. The default position descriptor is 'tiled'. See CursorWindow::viewport for details.
bool open ()
 Attempt to open the cursor window -- return true on failure. If possible, save the current terminal screen contents. Note that this only opens the curses terminal window, it does not affect any data structures. See resize_viewports() below.
void ostreamable_helper (char c)
 Helper function used by base class, Ostreamable, to actually perform io when you use syntax of the form:
input_event read_input ()
 Attempt to read an input event. If wait is true, then wait indefinitely for such an event. If wait is false, wait about 1/10 of a second before return a NoKey event if there are no keys available. Note that this call also flushes any pending output to the screen so that you can see it before pressing any keys. See CursorWindow:: refresh() or viewport::refresh(). If the screen is resized, you may or may not receive an input_event -- based on whether a resize handler has been registered with the window.
void refresh ()
 Flush pending output to the physical window. You call this when you have written stuff that doesn't get displayed because you are not calling read_event();.
void repaint_all ()
 repaint everything.
void resize_viewports (row_col const &old_size, row_col const &new_size)
 After you have manually closed and then reopened the terminal window usinging open() and close(), above, you should call resize_viewports() to re-layout the viepworts given any screen sized changes that occurred while the window was closed. This means that before closing, you should save the old screen size and then inquire it again after the open.
void set_curpos (row_col rc)
 Move the cursor to the specified row and column.
void set_curpos (int row, int col)
void set_error (char const *)
 Set a new error string. The window does not take ownership of the error string.
void set_resize_handler (resize_handler *)
 Instruct the CursorWindow to inform you of resize events by calling the operator method of a specified object rather than by returning a ResizeKey event when you call read_input.
void set_text_attribute (int)
 Set the current text attribute.
row_col size () const
 Get the width in columns and the height in rows of the actual window. Note that you cannot force this information but must live with the size you get.
int text_attribute () const
 Get the current text attribute.
void write (long c, int length=1)
 Write specified number of characters to the window in the default text attribute at the current cursor position. The default repeat count is 1.
void write (std::string const &s, size_t length=1000000)
 Ditto.
void write (char const *s)
 Write a string in the current text attributes at the current cursor position and move the cursor.
void write (char const *, size_t length)
 Write a specified number of characters to the current cursor position and move the cursor.
 ~CursorWindow ()
 Close the cursor window if it is open and then destruct it.

Static Public Member Functions

static std::string func_name (int funcvalue)
 func_name is a function that returns a string value for each editor function in the above list. If you add your own, they will show up in this list ass 'user function' or some such thing.
static std::string key_name (int keyvalue)
static std::string select_file (std::string const &title, std::string const &dir_file_pattern, CursorWindow *w)

Static Public Attributes

static int active_mark_att = CursorWindow::reverse_ul
 highlighted (selected) and marked lines
static int active_title_att = CursorWindow::reverse_bold
 window title bar color
static int bottom_att = CursorWindow::underlined
 bottom line of window highlights
static int dialog_normal_att = CursorWindow::reverse_bold
 body of dialogs
static int dialog_title_att = CursorWindow::rev_ul_bold
 title of dialogs
static std::map< int, int > func
 func is the all important key to edit function map. See CursorWindow::edit_function_names commentary above. Whenever you press a key, the dialog popup() method uses this table to figure out if you are pressing a key which is bound to an edit function or just a plain old data key. Feel free to add new bindings if you want but be careful about removing existing bindings -- like the arrow keys!
static int highlighted_att = CursorWindow::reversed
 highlighted (selected) but not marked
static int inactive_mark_att = CursorWindow::bold
 marked but not highlighted (not selected)
static int inactive_title_att = CursorWindow::bold_ul
 window title bar color
static int normal_att = CursorWindow::normal
 normal text color
static std::string word
 This string is nothing more than a list of characters which are valid word characters. Feel free to use this but be careful about elimnating letters, numbers, etc. See std::find_first_of() for a way to use this easily.

Private Member Functions

void destroy_viewport (viewport *)

Private Attributes

Windowwindow_
 the real implementation of window

Friends

class SaveRestoreActiveWindow
class viewport

Detailed Description

Before directly using this class, you should consider reading text_windows.

Note! when debugging programs using viewers, you must start the program first then attach to it using the debugger's 'attach processid' feature (or dbx -debug pdi feature). To debug the startup code, before the first keyboard input wait, set the environment variable, WAIT_FOR_DEBUGGER=1 before running the program. When the debugger attaches to the running process, you will be in a wait loop. Use the debugger's print mechanism or the assign mechanism to change the stop variable to 0. Then you can continue debugging as normal.

A CursorWindow is a rectangular grid of character cells which can be written into, read from, etc. It is used for interacting with human beings inside of xterm and console windows. A CursorWindow represents the entire xterm window or screen window on NT. If you want to use subwindows, use a CursorWindow::viewport. There are some builtin popup windows, and you can make more of your own using viewports. See CursorWindow::Dialog and CursorWindow::Selection.

A CursorWindow is a thin wrapper around some commonly used "curses" functions but does attempt to include them all. On NT, these functions are simulated as well. The kinds of textual decorations are limited.

You can only have one 'opened' cursor window at a time. If you need multiple CursorWindow objects, make sure only one is open at a time. The close() method and the open() method can be used to control this.

A CursorWindow should be viewed as a simplistic curses window -- it is by no means a sophisticated one. Here are the limitations:

1 foreground color and 1 background color defined for the whole window. It is possible to have reversed video characters, however.

individual character cells can be normal, reverse video, underlined, or blinking -- but not combinations thereof.

the upper left if 0,0.

writing into the window moves the cursor.

it is possible to read input from the user or to read character cell contents (or their attributes).

user input can contain normal characters, control characters, function keys, arrow keys, paging keys, screen resize flags, etc. It is not possible to detect modifier keys separately from the data keys they affect.

no alternate character sets are supported and the exact character set used is dependent on the platform and other factors not under program control.

As stated earlier, a CursorWindow represents an entire xterm screen -- or console window on NT. If you want to access subwindows, use a CursorWindow::viewport. See the nested class below.

CursorWindow has some important nested types:

    CursorWindow::viewport  -- A subwindow on top of a CursorWindow.
                                   If you need popup windows or window
                                   partitions, use these.
  
    CursorWindow::Dialog    -- An input form which can be popped
                                   up in a subwindow as needed to collect
                                   information from the user.  You can
                                   prompt for a Enter key press (Ok field),
                                   string inputs (String field), etc.
  
    CursorWindow::Selection -- An input form that lets the user select
                                   one of a list of items.

Associated with all cursor windows, there is a static map of keys to edit functions. See func -- which can be used as an array of key values which map to edit functions one might need in dealing with Dialog's. You can change the key mappings, add new ones, or use the map for your own purposes so long as you don't eliminate key mappings needed to fill out dialogs.

The Esc key has an annoying limitation. Whenever you press it, you must wait 1 second (1 whole second) before pressing any other keys or the Esc key will be lost. This is due to unix wierdness with key mappings. On NT, this wait is not needed.

There is also a std::string of word characters which. You can use the std::find_first_of() algorithm with this string to find words in strings.

On unix, the CursorWindow blocks and unblocks the following signals:

Note also that if you use other signals it is possible that their occurrence will damage the screen layout though the curses calls to minimize this are used.

Note that on unix, with a true curses implementation of this functionality, the TERMINFO used will not be the default terminfo. Instead, a directory will be created in the user's home directory that contains both the source for the terminfo actually used and the compiled terminfo. In this way, you can edit the source and manually recompile the terminfo once it is automatically created for you. See "$HOME/.tools_home". This directory is created the first time you run any program using this curses interface. If you have trouble with the function keys, you can edit the xterm.info files and recompile using "/usr/bin/tic".

CursorWindow derives from Ostreamable -- which means that can be used as the target of operator<< for a small subset of the stream output operations. See Ostreamable for more details.

Definition at line 55 of file cursorwindow.h.


Member Typedef Documentation

typedef OstreamableBuffer<CursorWindow , char , std::char_traits<char > > buf_type [inherited]

Definition at line 102 of file streamable.h.

typedef char char_type [inherited]

Definition at line 96 of file streamable.h.

typedef traits_type::int_type int_type [inherited]

Definition at line 98 of file streamable.h.

typedef traits_type::off_type off_type [inherited]

Definition at line 99 of file streamable.h.

typedef traits_type::pos_type pos_type [inherited]

Definition at line 100 of file streamable.h.

typedef std::char_traits<char > traits_type [inherited]

Definition at line 97 of file streamable.h.


Member Enumeration Documentation

Symbolic names for the normal text edit functions you might need to perform in a dialog window. Associated with a CursorWindow there is a mapping between key values (integers) and edit function enumeraion values. You can add your own functions to the window's edit function map -- but dialog handler won't use them for anything. To add your own functions, use numeric identifiers bigger than 'user_function_0'. There can be only intepretation of a given curses key value, but more than one key may map to the same edit function.

If you add new items to the edit_function_names list, make sure that you add mappings and names for those functions and in cursorwindow.c. See the CursorWindow::CursorWindow() for an example.

Feel free to stick application specific functions in the func[] map but don't create names for them here -- simply keep your own enum of the func names and make the first one have the value 'user_function_0' plus one.

Note also that if you wish to change the key bindings used by the dialog input mechanism, you need only modify CursorWindow::func to suit your liking.

Enumerator:
func_unknown 

unknown function -- not a real function

func_up 
func_down 
func_left 
func_right 
func_ic 

toggle insert character mode (rarely used, not implemented)

func_dc 

delete the character under the cursor

func_home 

move to left of line

func_end 

move to right of line

func_prior 

prev page -- page up

func_next 

next page -- page down

func_dc_prev 

delete char before current one (backspace key?)

func_tab 

tab right

func_btab 

back tab

func_top 

top of this file or page being edited

func_bottom 

bottom of this file or page being edited

func_esc 

esc key pressed

func_enter 

enter key pressed

func_data 

normal data keys

func_clreol 

clear to end of line

func_nextwd 

move to next word

func_prevwd 

move to prev word

func_upword 

uppercase the current word and move to next

func_dnword 

lowercase the current word and move to the next

func_undo 

undo most recent change

func_find 

find first

func_findnxt 

find next

func_findprv 

find prev

func_repl 

replace first

func_replnext 

replace n

func_help 

get application specific help (default is F1 key)

func_mark 

mark the current line

func_dl 

delete line

func_db 

delete block

func_cb 

copy block

func_wb 

write block to a file

func_paste 

paste text into edit session

func_goto 

prompt for a line number to goto

func_matching 

find matching character -- used on {...}, [...], etc

func_dw 

delete word

func_join 

join this line with the next line

func_insline 

insert blank line

func_to_edit 

convert a view only session to an edit session

func_reread 

verify that the disk copy of your edit session hasn't changed

func_switch 

switch to alternate source (given your current edit file, find another)

func_insfile 

insert a file above the current line

user_function_0 

Definition at line 512 of file cursorwindow.h.

enum key_names

the names of function keys

Enumerator:
first_function_key 
key_f1 
key_f2 
key_f3 
key_f4 
key_f5 
key_f6 
key_f7 
key_f8 
key_f9 
key_f10 
key_f11 
key_f12 
key_up 
key_down 
key_left 
key_right 
key_home 
key_end 
key_prior 
key_next 
key_ic 
key_dc 
key_bs 
key_btab 

next the shifted function keys -- which might be alt or ctrl function keys depending on the implementation -- but only one form is supported here -- and further shifted versions may (like the function keys themselves) may not be available

key_sf1 
key_sf2 
key_sf3 
key_sf4 
key_sf5 
key_sf6 
key_sf7 
key_sf8 
key_sf9 
key_sf10 
key_sf11 
key_sf12 
key_sup 
key_sdown 
key_sleft 
key_sright 
key_shome 
key_send 
key_sprior 
key_snext 
key_sic 
key_sdc 
last_function_key 

don't use this for anything

Definition at line 486 of file cursorwindow.h.

Names for text attribute values. Note that they are mutually exclusive.

Enumerator:
normal 

normal text with decoration

reversed 

reversed video

underlined 

normal text + underlining

blinking 

normal text + blinking

bold 

normal text + bold

reverse_ul 

reverse video + underlined

reverse_bold 

reverse video + bold

rev_ul_bold 

reverse video + bold +underlined

bold_ul 

bold + underlined

Definition at line 463 of file cursorwindow.h.


Constructor & Destructor Documentation

CursorWindow (  ) 

Construct a cursor window but do not open it.

Definition at line 917 of file cursorwindow.cxx.

~CursorWindow (  ) 

Close the cursor window if it is open and then destruct it.

Definition at line 1054 of file cursorwindow.cxx.

Here is the call graph for this function:


Member Function Documentation

void beep (  ) 

Produce an audible alarm.

Definition at line 1262 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void box ( int  width,
int  height,
bool  filled,
std::string  title 
)

Draw a box starting at the current cursor position that is width columns wide and height columns tall (running down from the current cursor position.

If the filled flag is true, the box will be filled with blanks before the border is drawn.

Draw the title string, if specified, inside the top border of the box to serve as a title.

Definition at line 443 of file cursorwindow.h.

Here is the call graph for this function:

void box ( int  width,
int  height,
bool  filled,
char const *  title = 0 
)

Draw a box starting at the current cursor position that is width columns wide and height columns tall (running down from the current cursor position.

If the filled flag is true, the box will be filled with blanks before the border is drawn.

Draw the title string, if specified, inside the top border of the box to serve as a title.

Definition at line 428 of file cursorwindow.h.

Here is the call graph for this function:

void box ( int  width,
int  height,
bool  filled,
char const *  title_string,
unsigned  length 
)

Draw a box starting at the current cursor position that is width columns wide and height columns tall (running down from the current cursor position.

If the filled flag is true, the box will be filled with blanks before the border is drawn.

If the string is not null, and the length is not 0, the string will be drawn inside the top border of the box to indicate that it is the 'title' of the box

Definition at line 1377 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void clear_error (  ) 

Clear out the current error flag. Doesn't delete the string.

Definition at line 234 of file cursorwindow.h.

Here is the call graph for this function:

void close (  ) 

Close the cursor window if it is open. Repaint the terminal screen with the saved contents if possible. Note that this does not damage any data structures -- it just closes the window and sets the flag. See resize_viewports() below.

Definition at line 1067 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

row_col curpos (  )  const

Get the current cursor position.

Definition at line 1237 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void destroy_viewport ( viewport  )  [private]
char const * error (  )  const

Get a string representation of the most recent error if any. If no error has occurred, then null is returned. All methods first clear the error condition and set it only if there is an error.

Definition at line 1093 of file cursorwindow.cxx.

void fill_to_eol ( char  c = ' '  ) 

Fill the rest of the current line, starting at the current cursor position, with a specified character -- defaulting to space.

Definition at line 1346 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void fill_to_eos ( char  c = ' '  ) 

Fill the rest of the current screen, starting at the current cursor position, with a specified character -- defaulting to space.

Definition at line 1356 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

string func_name ( int  funcvalue  )  [static]

func_name is a function that returns a string value for each editor function in the above list. If you add your own, they will show up in this list ass 'user function' or some such thing.

Definition at line 1000 of file cursorwindow.cxx.

Here is the caller graph for this function:

int get_viewports ( std::list< viewport > *  viewports  ) 

Get a list of the currently extant viewports. Returns the count of viewports as well. The viewports returned are not the owner of the physical screen are valid ONLY until the next creation or deletion of a viewport.

Definition at line 3743 of file cursorwindow.cxx.

string key_name ( int  keyvalue  )  [static]

Definition at line 1484 of file cursorwindow.cxx.

Here is the caller graph for this function:

void needs_resized (  ) 

Called to force a complete repaint of the window.

Definition at line 1108 of file cursorwindow.cxx.

std::auto_ptr< viewport > new_viewport ( viewport::repaint_handler h,
viewport::position  p = viewport::tiled 
)

Create a new viewport. The default position descriptor is 'tiled'. See CursorWindow::viewport for details.

Note that you can also create a viewport using viewport::vsplit() or viewport::hsplit(). These are meant for use with tiled windows which will be contiguous with one another -- although you can manually adjust the positions.

Creating a viewport does not activate it and does not draw it. Use the 'activate()' method of the viewport to do both.

Definition at line 1832 of file cursorwindow.cxx.

Here is the caller graph for this function:

bool open (  ) 

Attempt to open the cursor window -- return true on failure. If possible, save the current terminal screen contents. Note that this only opens the curses terminal window, it does not affect any data structures. See resize_viewports() below.

Definition at line 1076 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void ostreamable_helper ( char  c  ) 

Helper function used by base class, Ostreamable, to actually perform io when you use syntax of the form:

window << "stuff";

Definition at line 1603 of file cursorwindow.h.

Here is the call graph for this function:

CursorWindow::input_event read_input (  ) 

Attempt to read an input event. If wait is true, then wait indefinitely for such an event. If wait is false, wait about 1/10 of a second before return a NoKey event if there are no keys available. Note that this call also flushes any pending output to the screen so that you can see it before pressing any keys. See CursorWindow:: refresh() or viewport::refresh(). If the screen is resized, you may or may not receive an input_event -- based on whether a resize handler has been registered with the window.

Note that on unix, this function uses SIGALRM, and it does not save/restore the alarm timer value or signal handler.

Definition at line 1137 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void refresh (  ) 

Flush pending output to the physical window. You call this when you have written stuff that doesn't get displayed because you are not calling read_event();.

Definition at line 1117 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void repaint_all (  ) 

repaint everything.

Definition at line 5148 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void resize_viewports ( row_col const &  old_size,
row_col const &  new_size 
)

After you have manually closed and then reopened the terminal window usinging open() and close(), above, you should call resize_viewports() to re-layout the viepworts given any screen sized changes that occurred while the window was closed. This means that before closing, you should save the old screen size and then inquire it again after the open.

Definition at line 4384 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

string select_file ( std::string const &  title,
std::string const &  dir_file_pattern,
CursorWindow w 
) [static]

Definition at line 3641 of file cursorwindow.cxx.

Here is the call graph for this function:

void set_curpos ( row_col  rc  ) 

Move the cursor to the specified row and column.

Definition at line 1248 of file cursorwindow.cxx.

Here is the call graph for this function:

void set_curpos ( int  row,
int  col 
)
Parameters:
col Move the cursor to the specified row and column.

Definition at line 359 of file cursorwindow.h.

Here is the caller graph for this function:

void set_error ( char const *  s  ) 

Set a new error string. The window does not take ownership of the error string.

Definition at line 1100 of file cursorwindow.cxx.

Here is the caller graph for this function:

void set_resize_handler ( CursorWindow::resize_handler h  ) 

Instruct the CursorWindow to inform you of resize events by calling the operator method of a specified object rather than by returning a ResizeKey event when you call read_input.

Definition at line 1533 of file cursorwindow.cxx.

Here is the caller graph for this function:

void set_text_attribute ( int  a  ) 

Set the current text attribute.

Definition at line 1476 of file cursorwindow.cxx.

Here is the caller graph for this function:

row_col size (  )  const

Get the width in columns and the height in rows of the actual window. Note that you cannot force this information but must live with the size you get.

Definition at line 1255 of file cursorwindow.cxx.

Here is the caller graph for this function:

int text_attribute (  )  const

Get the current text attribute.

Definition at line 1469 of file cursorwindow.cxx.

void write ( long  c,
int  length = 1 
)

Write specified number of characters to the window in the default text attribute at the current cursor position. The default repeat count is 1.

Write a character multiple times in the current text attributes at the current cursor position and move the cursor.

Definition at line 1308 of file cursorwindow.cxx.

Here is the call graph for this function:

void write ( std::string const &  s,
size_t  length = 1000000 
)

Ditto.

Definition at line 391 of file cursorwindow.h.

Here is the call graph for this function:

void write ( char const *  s  ) 

Write a string in the current text attributes at the current cursor position and move the cursor.

Definition at line 383 of file cursorwindow.h.

Here is the call graph for this function:

void write ( char const *  s,
size_t  length 
)

Write a specified number of characters to the current cursor position and move the cursor.

Write a string in the current text attributes at the current cursor position and move the cursor.

Definition at line 1269 of file cursorwindow.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class SaveRestoreActiveWindow [friend]

Definition at line 176 of file cursorwindow.h.

friend class viewport [friend]

Definition at line 191 of file cursorwindow.h.


Member Data Documentation

int active_mark_att = CursorWindow::reverse_ul [static]

highlighted (selected) and marked lines

Definition at line 184 of file cursorwindow.h.

int active_title_att = CursorWindow::reverse_bold [static]

window title bar color

Definition at line 182 of file cursorwindow.h.

int bottom_att = CursorWindow::underlined [static]

bottom line of window highlights

Definition at line 186 of file cursorwindow.h.

int dialog_normal_att = CursorWindow::reverse_bold [static]

body of dialogs

Definition at line 188 of file cursorwindow.h.

int dialog_title_att = CursorWindow::rev_ul_bold [static]

title of dialogs

Definition at line 189 of file cursorwindow.h.

std::map< int, int > func [static]

func is the all important key to edit function map. See CursorWindow::edit_function_names commentary above. Whenever you press a key, the dialog popup() method uses this table to figure out if you are pressing a key which is bound to an edit function or just a plain old data key. Feel free to add new bindings if you want but be careful about removing existing bindings -- like the arrow keys!

Definition at line 592 of file cursorwindow.h.

int highlighted_att = CursorWindow::reversed [static]

highlighted (selected) but not marked

Definition at line 187 of file cursorwindow.h.

int inactive_mark_att = CursorWindow::bold [static]

marked but not highlighted (not selected)

Definition at line 185 of file cursorwindow.h.

int inactive_title_att = CursorWindow::bold_ul [static]

window title bar color

Definition at line 183 of file cursorwindow.h.

int normal_att = CursorWindow::normal [static]

normal text color

Definition at line 181 of file cursorwindow.h.

Window* window_ [private]

the real implementation of window

Definition at line 1628 of file cursorwindow.h.

string word [static]

This string is nothing more than a list of characters which are valid word characters. Feel free to use this but be careful about elimnating letters, numbers, etc. See std::find_first_of() for a way to use this easily.

Definition at line 602 of file cursorwindow.h.


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