Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

ht_text_editor Class Reference

#include <textedit.h>

Inheritance diagram for ht_text_editor:

ht_text_viewer ht_view Object List of all members.

Public Member Functions

void init (bounds *b, bool own_textfile, ht_textfile *textfile, ht_list *lexers, UINT edit_options)
virtual void done ()
virtual void config_changed ()
virtual char * func (UINT i, bool execute)
virtual void handlemsg (htmsg *msg)
virtual void get_pindicator_str (char *buf)
virtual cursor_mode get_cursor_mode ()
bool concat_lines (UINT a)
void delete_chars (UINT line, UINT ofs, UINT count)
void delete_lines (UINT line, UINT count)
void indent (UINT line, UINT start, UINT size)
void insert_chars (UINT line, UINT ofs, void *chars, UINT len)
void insert_lines (UINT line, UINT count)
void split_line (UINT a, UINT pos)
void unindent (UINT line, UINT start, UINT size)
void textoperation_apply (ht_undo_data *ud)
void redo ()
void show_protocol ()
void undo (bool place_cursor_first)

Protected Member Functions

void clipboard_cut_cmd ()
void clipboard_delete_cmd ()
void clipboard_paste_cmd ()
virtual vcp get_bgcolor ()
bool save ()

Protected Attributes

UINT edit_options
ht_text_editor_undoundo_list
bool auto_indent
bool overwrite_mode

Member Function Documentation

void ht_text_editor::clipboard_cut_cmd  )  [protected]
 

Definition at line 2068 of file textedit.cc.

References ht_text_viewer::clipboard_copy_cmd(), and clipboard_delete_cmd().

Referenced by handlemsg().

void ht_text_editor::clipboard_delete_cmd  )  [protected]
 

Definition at line 2074 of file textedit.cc.

References ht_text_viewer::ht_undo_data_delete_block, text_viewer_pos::line, ht_text_viewer::physical_cursorx(), text_viewer_pos::pofs, textoperation_apply(), and UINT.

Referenced by clipboard_cut_cmd(), and handlemsg().

void ht_text_editor::clipboard_paste_cmd  )  [protected]
 

Definition at line 2086 of file textedit.cc.

References clipboard_getsize(), clipboard_paste(), ht_text_viewer::ht_undo_data_insert_block, text_viewer_pos::line, malloc(), ht_text_viewer::physical_cursorx(), text_viewer_pos::pofs, textoperation_apply(), and UINT.

Referenced by handlemsg().

bool ht_text_editor::concat_lines UINT  a  ) 
 

Definition at line 2100 of file textedit.cc.

References delete_lines(), ht_textfile::getline(), ht_textfile::getlinelength(), ht_textfile::has_line(), insert_chars(), text_viewer_pos::line, malloc(), ht_text_viewer::normalize_selection(), NULL, text_viewer_pos::pofs, and UINT.

Referenced by ht_undo_data_join_line::apply(), delete_text_block(), and ht_undo_data_split_line::unapply().

void ht_text_editor::config_changed  )  [virtual]
 

Reimplemented from ht_text_viewer.

Definition at line 2143 of file textedit.cc.

References auto_indent, ht_text_viewer::config_changed(), and get_config_dword().

void ht_text_editor::delete_chars UINT  line,
UINT  ofs,
UINT  count
 

Definition at line 2149 of file textedit.cc.

References ht_textfile::delete_chars(), text_viewer_pos::line, text_viewer_pos::pofs, text_viewer_pos_compare(), and UINT.

Referenced by ht_undo_data_overwrite_string::apply(), ht_undo_data_delete_string2::apply(), ht_undo_data_delete_string::apply(), delete_text_block(), and split_line().

void ht_text_editor::delete_lines UINT  line,
UINT  count
 

Definition at line 2166 of file textedit.cc.

References ht_textfile::delete_lines(), text_viewer_pos::line, ht_text_viewer::normalize_selection(), and UINT.

Referenced by concat_lines(), and delete_text_block().

void ht_text_editor::done  )  [virtual]
 

Reimplemented from ht_text_viewer.

Definition at line 2059 of file textedit.cc.

References ht_clist::destroy(), ht_text_viewer::done(), and undo_list.

char * ht_text_editor::func UINT  i,
bool  execute
[virtual]
 

Reimplemented from ht_text_viewer.

Definition at line 2174 of file textedit.cc.

References app, cmd_file_save, cmd_file_saveas, ht_streamfile::cntl(), FCNTL_MODS_IS_DIRTY, ht_text_viewer::func(), ht_layer_streamfile::get_filename(), ht_text_editor_undo::mark_clean(), ht_view::sendmsg(), UINT, and undo_list.

vcp ht_text_editor::get_bgcolor  )  [protected, virtual]
 

Reimplemented from ht_text_viewer.

Definition at line 2197 of file textedit.cc.

References ht_view::getcolor(), palidx_generic_input_focused, palidx_generic_input_unfocused, and vcp.

cursor_mode ht_text_editor::get_cursor_mode  )  [virtual]
 

Reimplemented from ht_text_viewer.

Definition at line 2203 of file textedit.cc.

References cm_normal, cm_overwrite, cursor_mode, and overwrite_mode.

void ht_text_editor::get_pindicator_str char *  buf  )  [virtual]
 

Reimplemented from ht_text_viewer.

Definition at line 2208 of file textedit.cc.

References buf, ht_streamfile::cntl(), FCNTL_MODS_IS_DIRTY, ht_text_viewer::get_lexer(), ht_syntax_lexer::getname(), and NULL.

void ht_text_editor::handlemsg htmsg *  msg  )  [virtual]
 

Reimplemented from ht_text_viewer.

Definition at line 2218 of file textedit.cc.

References auto_indent, buf, clearmsg(), clipboard_cut_cmd(), clipboard_delete_cmd(), clipboard_paste_cmd(), cmd_edit_cut, cmd_edit_delete, cmd_edit_paste, cmd_file_save, cmd_text_editor_delete_line, cmd_text_editor_protocol, cmd_text_editor_redo, cmd_text_editor_undo, cmd_text_viewer_change_highlight, cmd_text_viewer_goto, ht_text_viewer::cursor_pput(), ht_view::dirtyview(), edit_options, ht_text_viewer::get_line_indent(), ht_text_viewer::get_line_length(), ht_textfile::getline(), ht_textfile::getlinelength(), ht_text_viewer::handlemsg(), ht_textfile::has_line(), ht_snprintf(), ht_text_viewer::ht_undo_data_delete_block, ht_text_viewer::ht_undo_data_delete_string, ht_text_viewer::ht_undo_data_delete_string2, ht_text_viewer::ht_undo_data_insert_string, ht_text_viewer::ht_undo_data_join_line, ht_text_viewer::ht_undo_data_overwrite_string, ht_text_viewer::ht_undo_data_split_line, indent(), ht_static_context_menu::init(), ht_static_context_menu::insert_entry(), ht_static_context_menu::insert_separator(), K_Alt_Backspace, K_Alt_D, K_Alt_P, K_Alt_R, K_Alt_U, K_Alt_V, K_Alt_X, K_Backspace, K_Control_Delete, K_Control_Y, K_Delete, K_Insert, K_Return, K_Shift_Delete, K_Shift_Insert, text_viewer_pos::line, ht_textfile::linecount(), msg_contextmenuquery, msg_keypressed, msg_retval, NULL, overwrite_mode, ht_text_viewer::physical_cursorx(), text_viewer_pos::pofs, redo(), save(), ht_view::sendmsg(), show_protocol(), TEXTEDITOPT_INPUTTABS, textoperation_apply(), UINT, undo(), and undo_list.

void ht_text_editor::indent UINT  line,
UINT  start,
UINT  size
 

Definition at line 2463 of file textedit.cc.

References ht_textfile::insert_chars(), malloc(), size, and UINT.

Referenced by ht_undo_data_join_line::apply(), ht_undo_data_split_line::apply(), ht_undo_data_overwrite_string::apply(), ht_undo_data_insert_string::apply(), handlemsg(), and insert_text_block().

void ht_text_editor::init bounds *  b,
bool  own_textfile,
ht_textfile textfile,
ht_list lexers,
UINT  edit_options
 

Definition at line 2043 of file textedit.cc.

References edit_options, ht_text_editor_undo::init(), Object::init(), NULL, overwrite_mode, TEXTEDITOPT_UNDO, UINT, and undo_list.

Referenced by ht_app::create_window_file_text(), and ht_aviewer::showComments().

void ht_text_editor::insert_chars UINT  line,
UINT  ofs,
void *  chars,
UINT  len
 

Definition at line 2476 of file textedit.cc.

References ht_textfile::insert_chars(), len, text_viewer_pos::line, text_viewer_pos::pofs, text_viewer_pos_compare(), and UINT.

Referenced by ht_undo_data_overwrite_string::apply(), ht_undo_data_insert_string::apply(), concat_lines(), split_line(), ht_undo_data_overwrite_string::unapply(), ht_undo_data_delete_string2::unapply(), and ht_undo_data_delete_string::unapply().

void ht_text_editor::insert_lines UINT  line,
UINT  count
 

Definition at line 2493 of file textedit.cc.

References ht_textfile::insert_lines(), text_viewer_pos::line, ht_text_viewer::normalize_selection(), and UINT.

Referenced by split_line().

void ht_text_editor::redo  ) 
 

Definition at line 2668 of file textedit.cc.

References ht_streamfile::cntl(), FCNTL_MODS_CLEAR_DIRTY, ht_text_editor_undo::is_clean(), ht_text_editor_undo::redo(), and undo_list.

Referenced by handlemsg(), and show_protocol().

bool ht_text_editor::save  )  [protected]
 

Definition at line 2501 of file textedit.cc.

References ht_layer_streamfile::copy_to(), ht_stream::copy_to(), ht_view::dirtyview(), ht_temp_file::done(), errorbox, FAM_READ, FAM_WRITE, ht_stream::get_error(), ht_layer_streamfile::get_filename(), ht_layer_streamfile::get_layered(), ht_temp_file::init(), ht_text_editor_undo::mark_clean(), NULL, ht_temp_file::pstat(), ht_streamfile::pstat(), ht_layer_streamfile::seek(), ht_streamfile::seek(), ht_stream::set_access_mode(), ht_textfile::set_layered_assume(), pstat_t::size, pstat_t::size_high, ht_streamfile::truncate(), and undo_list.

Referenced by handlemsg().

void ht_text_editor::show_protocol  ) 
 

Definition at line 2559 of file textedit.cc.

References align_left, app, buf, button_ok, ht_clist::count(), ht_view::databuf_get(), ht_dialog::done(), FS_KILLER, FS_MOVE, FS_TITLE, ht_clist::get(), ht_text_editor_undo::get_current_position(), ht_view::getbounds(), ht_text_listbox::getID(), ht_listbox::gotoItemByPosition(), ht_window::insert(), ht_text_listbox::insert_str(), ht_text_editor_undo::is_clean(), redo(), ht_dialog::run(), UINT, undo(), undo_list, and ht_text_listbox::update().

Referenced by handlemsg().

void ht_text_editor::split_line UINT  a,
UINT  pos
 

Definition at line 2618 of file textedit.cc.

References delete_chars(), ht_textfile::getline(), ht_textfile::getlinelength(), insert_chars(), insert_lines(), text_viewer_pos::line, malloc(), ht_text_viewer::normalize_selection(), NULL, text_viewer_pos::pofs, text_viewer_pos_compare(), and UINT.

Referenced by ht_undo_data_split_line::apply(), and ht_undo_data_join_line::unapply().

void ht_text_editor::textoperation_apply ht_undo_data ud  ) 
 

Definition at line 2658 of file textedit.cc.

References ht_undo_data::apply(), ht_text_editor_undo::insert_undo(), and undo_list.

Referenced by clipboard_delete_cmd(), clipboard_paste_cmd(), and handlemsg().

void ht_text_editor::undo bool  place_cursor_first  ) 
 

Definition at line 2676 of file textedit.cc.

References ht_streamfile::cntl(), FCNTL_MODS_CLEAR_DIRTY, ht_text_editor_undo::is_clean(), ht_text_editor_undo::undo(), and undo_list.

Referenced by handlemsg(), and show_protocol().

void ht_text_editor::unindent UINT  line,
UINT  start,
UINT  size
 

Definition at line 2471 of file textedit.cc.

References ht_textfile::delete_chars(), size, and UINT.

Referenced by delete_text_block(), ht_undo_data_join_line::unapply(), ht_undo_data_split_line::unapply(), ht_undo_data_overwrite_string::unapply(), and ht_undo_data_insert_string::unapply().


Member Data Documentation

bool ht_text_editor::auto_indent [protected]
 

Definition at line 373 of file textedit.h.

Referenced by config_changed(), and handlemsg().

UINT ht_text_editor::edit_options [protected]
 

Definition at line 371 of file textedit.h.

Referenced by handlemsg(), and init().

bool ht_text_editor::overwrite_mode [protected]
 

Definition at line 374 of file textedit.h.

Referenced by get_cursor_mode(), handlemsg(), and init().

ht_text_editor_undo* ht_text_editor::undo_list [protected]
 

Definition at line 372 of file textedit.h.

Referenced by done(), func(), handlemsg(), init(), redo(), save(), show_protocol(), textoperation_apply(), and undo().


The documentation for this class was generated from the following files:
Generated on Fri May 7 21:16:04 2004 by doxygen 1.3.5