edit.dox 4.43 KB
Newer Older
Ercan Ersoy's avatar
Ercan Ersoy committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
/*
 EDIT.DOX

 License CC0 PUBLIC DOMAIN

 To the extent possible under law, Mark J. Olesen has waived all copyright
 and related or neighboring rights to FDOSTUI Library. This work is published
 from: United States.
*/

/*! \file edit.hpp
\brief contains edit class
*/

/*! \class edit edit.hpp
\brief Multi-line edit widget
*/

/*!
\fn edit::edit(
        int const                       i_pos_x,
        int const                       i_pos_y,
        unsigned int const              i_len_x,
        unsigned int const              i_len_y)
\brief constructor 
\param[in] i_pos_x x position to place widget
\param[in] i_pos_y y position to place widget
\param[in] i_len_x x length of widget
\param[in] i_len_y y length of widget
\returns none
*/
    
/*!
\fn virtual edit::~edit()
\brief destructor
\returns none
*/

/*!
\fn virtual void edit::draw() const
\brief draws the widget

This method should not be called directly. 
\see widget::draw for details.
*/
    
/*!
\fn virtual enum event_response edit::event_key(
        struct event_key const&         i_event)
\brief handle key event
\param[in] i_event key event to handle
\returns response how event was handled
*/

/*!
\fn virtual void edit::focus_enter()
\brief handle entering focus
\returns none
*/

/*!
\fn virtual void edit::focus_leave()
\brief handle leaving focus
\returns none
*/

/*!
\fn unsigned char const __FAR* edit::get_text()
\brief get the text buffer
\returns 0 buffer empty
\returns !0 address of buffer
*/

/*!
\fn size_t edit::get_text_length() const
\brief get the number of used bytes in the buffer
\returns >=0 number of bytes used in buffer
*/

/*!
\var edit::m_caret_x
	x location of caret
*/

/*!
\var edit::m_caret_y
	y location of caret
*/

/*!
\var edit::m_sticky_caret_x
	x location of longest x caret position. Used to position caret on 
	up/down operations.
*/

/*!
\var edit::m_cursor
	current position in buffer
*/

/*!
\var edit::m_offset_x
	horizontal scroll position/offset	
*/

/*!
\var edit::m_line_top
	visible top line (vertical scroll)
*/

/*!
\var edit::m_line_top_offset
	cursor position of top line
*/

/*!
\var edit::m_lines
	total number of lines
*/

/*!
\var edit::m_gap
	gap buffer
*/


/*!
\fn void edit::caret_set_position() const
\brief moves the cursor to the current position (m_caret)
\returns none

This routine does not alter the shape or visibility
*/

/*!
\fn bool edit::char_backspace()
\brief backspace
\returns false does not require a redraw
\returns true requires a redraw
*/

/*!
\fn bool edit::char_delete()
\brief delete character
\returns false does not require a redraw
\returns true requires a redraw
*/

/*!
\fn bool edit::char_insert(
        unsigned char const             i_char,
        enum cursor_mode const          i_cursor_mode)
\brief insert character
\param[in] i_char character to insert
\param[in] i_cursor_mode mode to insert (overwrite, insert)
\returns false does not require a redraw
\returns true requires a redraw
*/

/*!
\fn bool edit::char_insert_newline()
\brief insert new line character
\returns false does not require a redraw
\returns true requires a redraw
*/

/*!
\fn bool edit::cursor_down()
\brief move cursor down a line
\returns false does not require a redraw
\returns true requires a redraw
*/

/*!
\fn bool edit::cursor_end()
\brief move cursor to end of line
\returns false does not require a redraw
\returns true requires a redraw
*/

/*!
\fn bool edit::cursor_home()
\brief move cursor to end of line
\returns false does not require a redraw
\returns true requires a redraw
*/

/*!
\fn bool edit::cursor_left()
\brief move cursor left
\returns false does not require a redraw
\returns true requires a redraw
*/

/*!
\fn bool edit::cursor_right()
\brief move cursor right
\returns false does not require a redraw
\returns true requires a redraw
*/

/*!
\fn void edit::cursor_show()
\brief sets the cursor type/shape. Cursor shape depends on
the state of the cursor (insert/overwrite) and widget itself.
\returns none
*/

/*!
\fn bool edit::cursor_up()
\brief move cursor up a line
\returns false does not require a redraw
\returns true requires a redraw
*/

/*!
\fn bool edit::move_to_offset_x(
        unsigned char __FAR*&           io_ptr,
        size_t&                         io_offset,
        int&                            io_pos_y) const
\brief move to m_offset_x cursor position
\param[in,out] io_ptr buffer address
\param[in,out] io_offset cursor position
\param[in,out] io_pos_y y position
\returns false move not valid
\returns true move was valid
*/