Textdraw(3)                                                        Textdraw(3)



NNAAMMEE
       Textdraw -

SSYYNNOOPPSSIISS
       Inherits LLiisstt.

       Inherited by FFuulllleeddiitt, and PPllaayyeerr.


   PPuubblliicc MMeetthhooddss
       string ggoottooxxyy__ccooddee (int x, int y)
       void ggoottooxxyy (int x, int y)
       void ccllss ()
       protected int __ggeettnn (int n, string str)
       protected string __ggeett__llaasstt__aannssii (string str)
       void hheellpp__ffrraammee (string text)
       varargs string sspplliiccee__tteexxtt (string left, string right, int width)
       string rreeccoolloorr (string orig, string std_color)
       void ddrraawwbbooxx (int x, int y, int width, int height, string color)
       varargs string * aadddd__tteexxtt (string *window, string data, int width, int
           max_height)
       varargs string ccoolluummnnss (string *words, int term_width, int width)
       void ddrraaww__tteerrmmiinnaall (string *window, int x, int y, object user)
       void ddeebbuugg__lliisstt ()
       void lliinnee__iinnppuutt__iinntteerrffaaccee (string c)

   SSttaattiicc PPuubblliicc MMeetthhooddss
       void ddiissppllaayy__lliinnee__iinnppuutt ()
       varargs void lliinnee__iinnppuutt (int _xleft, int _width, int _line, int _curs,
           string _edit_return_func, string initial_text)

   PPuubblliicc AAttttrriibbuutteess
       nosave int ffiirrssttcchhaarr
       nosave int xxlleefftt
       nosave int bbooxxwwiiddtthh
       nosave int lliinnee
       nosave int ccuurrss
       nosave string lliinnee__eeddiitt__kkeeyybbuuff
       nosave string ccuurrrr__bbuuff
       nosave string eeddiitt__rreettuurrnn__ffuunncc

DDEETTAAIILLEEDD DDEESSCCRRIIPPTTIIOONN
       This is a file designed to contain functions that will simplify the
       life of anyone trying to do complex things using ANSI codes. Most of
       these functions are layered on top of the built in ANSI support, so
       they might not do what you want if the player has ANSI turned off. You
       should check this with this_player()->query_ansi(), which will return
       true if the player has ANSI turned on.

       Definition at line 14 of file textdraw.c.

MMEEMMBBEERR FFUUNNCCTTIIOONN DDOOCCUUMMEENNTTAATTIIOONN
   pprrootteecctteedd ssttrriinngg __ggeett__llaasstt__aannssii ((ssttrriinngg ssttrr))
       Gets the most recently used ANSI code from the string.

       Definition at line 84 of file textdraw.c.

       Referenced by help_frame().

   pprrootteecctteedd iinntt __ggeettnn ((iinntt nn,, ssttrriinngg ssttrr))
       Gets the position of the n'th underbar or dash, used by help_frame.

       Definition at line 73 of file textdraw.c.

       Referenced by help_frame().

   vvaarraarrggss ssttrriinngg** aadddd__tteexxtt ((ssttrriinngg ** wwiinnddooww,, ssttrriinngg ddaattaa,, iinntt wwiiddtthh,, iinntt
       mmaaxx__hheeiigghhtt))
       Utility functions that allows you to do a scrolling terminal window
       inside of a frame (or whatever) on the screen. The terminal window data
       is an array of strings. Strings processed in this fashion are assumed
       to have already been translated to their ANSI codes (which is normal
       given the methods used for string capture).

       Definition at line 317 of file textdraw.c.

       Referenced by Fulledit::catch_tell().

   vvooiidd ccllss (())
       Clears screen and moves cursor to upper-left corner.

       Definition at line 68 of file textdraw.c.

   vvaarraarrggss ssttrriinngg ccoolluummnnss ((ssttrriinngg ** wwoorrddss,, iinntt tteerrmm__wwiiddtthh,, iinntt wwiiddtthh))
       PPaarraammeetteerrss::

       _w_o_r_d_s  The words to be displayed in column form.

       _t_e_r_m___w_i_d_t_h
              (Optional) The width of the terminal on which the words are to
              be displayed; defaults to the width of this_player()'s terminal.

       _w_i_d_t_h  (Optional) The width of each column, in spaces. If you don't
              specify a width, it will be autodetected to match the width of
              the longest entry plus two spaces.

       RReettuurrnnss::
           A string with _s_n_i_p_p_e_t_s arranged into columns, each column _w_i_d_t_h
           characters wide. Generally, you don't need to specify _w_i_d_t_h,
           because the function will autodetect the width (it is an optional
           parameter); however, if your strings contain color codes, this will
           confuse the width detection, and you should specify it.The column
           format will arrange the text in order vertically. So if your list
           of words is alphabetized, the alphabetical ordering will have the
           earliest letters on the left, the later letters on the right,
           instead of top-to-bottom.

       Definition at line 365 of file textdraw.c.

   vvooiidd ddeebbuugg__lliisstt (())
       A debug function, used for checking on the state of an input box.

       Definition at line 444 of file textdraw.c.

       References boxwidth, curr_buf, curs, edit_return_func, firstchar, line,
       line_edit_keybuf, and xleft.

   vvooiidd ddiissppllaayy__lliinnee__iinnppuutt (()) [[ssttaattiicc]]
       Displays the contents of a line input box.

       Definition at line 450 of file textdraw.c.

       References boxwidth, curr_buf, curs, firstchar, gotoxy(), line, and
       xleft.

       Referenced by line_input(), and line_input_interface().

   vvooiidd ddrraaww__tteerrmmiinnaall ((ssttrriinngg ** wwiinnddooww,, iinntt xx,, iinntt yy,, oobbjjeecctt uusseerr))
       Draws the text stored in the array 'window' to the screen. The left
       side of the first line of text is at x, y, with other text arranged
       vertically below it. Note that this function uses the EFUN tell_object,
       which will bypass any text capturing you have. As usual this doesn't do
       quite what you want if you don't have ANSI enabled. Passing in the user
       is also important, since this_player() will generally not correspond to
       the person viewing the terminal. This does use ~CEOL so don't try
       putting a border on the right side (or be willing to redraw it each
       time).

       Definition at line 424 of file textdraw.c.

       References gotoxy_code().

       Referenced by Fulledit::catch_tell().

   vvooiidd ddrraawwbbooxx ((iinntt xx,, iinntt yy,, iinntt wwiiddtthh,, iinntt hheeiigghhtt,, ssttrriinngg ccoolloorr))
       Draws a box on the screen in this style:

       ,-. | | `-'

       Definition at line 297 of file textdraw.c.

       References gotoxy().

       Referenced by Fulledit::input_box(), and Fulledit::mainmenu().

   vvooiidd ggoottooxxyy ((iinntt xx,, iinntt yy))
       Moves the cursor to an x,y on the screen. The upper left corner is 1,1
       and the x increases to the right, y increases downward. Note that this
       function, unlike the built in code, will also work for values of x and
       y over 99.

       Definition at line 63 of file textdraw.c.

       References gotoxy_code().

       Referenced by display_line_input(), Fulledit::draw_line(),
       Fulledit::draw_text(), drawbox(), Fulledit::exit_editor(),
       Fulledit::input_box(), Fulledit::mainmenu(), and
       Fulledit::start_edit().

   ssttrriinngg ggoottooxxyy__ccooddee ((iinntt xx,, iinntt yy))
       Figures out the ~ codes to do an adjusted gotoxy. Although there is no
       limit on the absolute coordinates which are allowed by the ANSI codes
       for moving the cursor, the tilde codes are limited by their 4-digit
       nature to two digit numbers. Thus, the highest position you can go to
       is 99, 99 (~9999). You can get around this limit by adding relative
       cursor movement onto the absolute one, such as ~9940~X+29 to goto 128,
       40. This function will generate these codes for you.

       Definition at line 27 of file textdraw.c.

       Referenced by draw_terminal(), and gotoxy().

   vvooiidd hheellpp__ffrraammee ((ssttrriinngg tteexxtt))
       Prints out a text file inside of a help frame. The internal coloring of
       the help file is still handled within it.

       Definition at line 100 of file textdraw.c.

       References _get_last_ansi(), _getn(), and line.

   vvaarraarrggss vvooiidd lliinnee__iinnppuutt ((iinntt __xxlleefftt,, iinntt __wwiiddtthh,, iinntt __lliinnee,, iinntt __ccuurrss,,
       ssttrriinngg __eeddiitt__rreettuurrnn__ffuunncc,, ssttrriinngg iinniittiiaall__tteexxtt)) [[ssttaattiicc]]
       This function is designed to help you build full-blown text editors.
       This function has several 'state' variables which are stored inside of
       the textdraw object, meaning you must inherit the textdraw object (you
       can't use this function with call_other). Also, you cannot stack it --
       one line_input must finish before the next one is started.

       Definition at line 538 of file textdraw.c.

       References boxwidth, curr_buf, curs, display_line_input(),
       edit_return_func, firstchar, line, line_edit_keybuf, and xleft.

       Referenced by Fulledit::input_box().

   vvooiidd lliinnee__iinnppuutt__iinntteerrffaaccee ((ssttrriinngg cc))
       An internal function used by line_input to handle the interface.

       Definition at line 461 of file textdraw.c.

       References boxwidth, curr_buf, curs, display_line_input(),
       edit_return_func, firstchar, and line_edit_keybuf.

   ssttrriinngg rreeccoolloorr ((ssttrriinngg oorriigg,, ssttrriinngg ssttdd__ccoolloorr))
       Applies an alternative coloring scheme for the say/tell/shout etc.
       commands. This also has the effect of filtering out tilde codes.

       Definition at line 262 of file textdraw.c.

   vvaarraarrggss ssttrriinngg sspplliiccee__tteexxtt ((ssttrriinngg lleefftt,, ssttrriinngg rriigghhtt,, iinntt wwiiddtthh))
       Splices _l_e_f_t with _r_i_g_h_t, giving a two-column format. No spacing is
       placed between the blocks of text. The left block of text should have
       all lines be of equal width (it will work if they aren't, but you might
       not like the effect). The right block of text should already be
       linewrapped to whatever width is necessary.

       This will handle ANSI color codes, but they should already be converted
       to the ANSI format: ESC[0;35;45m. You should use process_ansi or
       process_codes to do this.

       The optional _w_i_d_t_h parameter is to allow you to specify line width.
       This will probably be necessary if your left-side image uses ANSI
       codes.

       Definition at line 227 of file textdraw.c.

MMEEMMBBEERR DDAATTAA DDOOCCUUMMEENNTTAATTIIOONN
   nnoossaavvee iinntt bbooxxwwiiddtthh
       Internal, used by line input boxes.

       Definition at line 439 of file textdraw.c.

       Referenced by debug_list(), display_line_input(), line_input(), and
       line_input_interface().

   nnoossaavvee ssttrriinngg ccuurrrr__bbuuff
       Internal, used by line input boxes.

       Definition at line 441 of file textdraw.c.

       Referenced by debug_list(), display_line_input(), line_input(), and
       line_input_interface().

   nnoossaavvee iinntt ccuurrss
       Internal, used by line input boxes.

       Definition at line 439 of file textdraw.c.

       Referenced by debug_list(), display_line_input(), line_input(), and
       line_input_interface().

   nnoossaavvee ssttrriinngg eeddiitt__rreettuurrnn__ffuunncc
       Internal, used by line input boxes.

       Definition at line 441 of file textdraw.c.

       Referenced by debug_list(), line_input(), and line_input_interface().

   nnoossaavvee iinntt ffiirrssttcchhaarr
       Internal, used by line input boxes.

       Definition at line 439 of file textdraw.c.

       Referenced by debug_list(), display_line_input(), line_input(), and
       line_input_interface().

   nnoossaavvee iinntt lliinnee
       Internal, used by line input boxes.

       Definition at line 439 of file textdraw.c.

       Referenced by debug_list(), Player::display_file(),
       display_line_input(), help_frame(), and line_input().

   nnoossaavvee ssttrriinngg lliinnee__eeddiitt__kkeeyybbuuff
       Internal, used by line input boxes.

       Definition at line 441 of file textdraw.c.

       Referenced by debug_list(), line_input(), and line_input_interface().

   nnoossaavvee iinntt xxlleefftt
       Internal, used by line input boxes.

       Definition at line 439 of file textdraw.c.

       Referenced by debug_list(), display_line_input(), and line_input().


AAUUTTHHOORR
       Generated automatically by Doxygen for Walraven from the source code.



Walraven                          8 Jan 2004                       Textdraw(3)
