libt3widget
|
Class implementing an edit widget. More...
Classes | |
class | autocomplete_panel_t |
struct | implementation_t |
class | view_parameters_t |
Public Member Functions | |
void | autocomplete (void) |
Perform autocompletion, or pop-up autocompletion choice menu. | |
virtual void | bad_draw_recheck (void) |
void | cut_copy (bool cut) |
Apply the cut or copy action. | |
edit_window_t (text_buffer_t *_text=NULL, const view_parameters_t *params=NULL) | |
Create a new edit_window_t. | |
void | find_next (bool backward) |
Apply the find-next action. | |
void | find_replace (bool replace) |
Show the find or replace dialog. | |
virtual void | force_redraw (void) |
bool | get_auto_indent (void) |
Get automatic indent. | |
bool | get_indent_aware_home (void) |
Get indent aware home. | |
bool | get_show_tabs (void) |
Get show tabs. | |
bool | get_tab_spaces (void) |
Get tab indents with spaces. | |
int | get_tabsize (void) |
Get the size of a tab. | |
text_buffer_t * | get_text (void) const |
Get the text currently displayed. | |
wrap_type_t | get_wrap (void) |
Get the wrap type. | |
void | goto_line (int line) |
Move the cursor to the specified line. | |
void | goto_line (void) |
Show the Goto Line dialog. | |
void | indent_selection (void) |
Indent the current selection. | |
void | insert_special (void) |
Show the Insert Special Character dialog. | |
virtual bool | is_child (window_component_t *widget) |
void | paste (void) |
Apply the paste action. | |
virtual bool | process_key (key_t key) |
virtual bool | process_mouse_event (mouse_event_t event) |
void | redo (void) |
Apply the redo action. | |
view_parameters_t * | save_view_parameters (void) |
Save the current view parameters, to allow them to be restored later. | |
void | save_view_parameters (view_parameters_t *params) |
Save the current view parameters, to allow them to be restored later. | |
void | select_all (void) |
Select the whole text. | |
void | set_auto_indent (bool _auto_indent) |
Set automatic indent. | |
void | set_autocompleter (autocompleter_t *_autocompleter) |
Set the autocompleter to use. | |
virtual void | set_child_focus (window_component_t *target) |
void | set_find_dialog (find_dialog_t *_find_dialog) |
Set the find_dialog_t to use. | |
void | set_finder (finder_t *_finder) |
Set the finder_t to use. | |
virtual void | set_focus (focus_t focus) |
void | set_indent_aware_home (bool _indent_aware_home) |
Set indent aware home. | |
void | set_show_tabs (bool _show_tabs) |
Set show_tabs. | |
virtual bool | set_size (optint height, optint width) |
void | set_tab_spaces (bool _tab_spaces) |
Set tab indents with spaces. | |
void | set_tabsize (int _tabsize) |
Set the size of a tab. | |
void | set_text (text_buffer_t *_text, const view_parameters_t *params=NULL) |
Set the text to display. | |
void | set_wrap (wrap_type_t wrap) |
Set the wrap type. | |
void | undo (void) |
Apply the undo action. | |
void | unindent_selection (void) |
Unindent the current selection. | |
virtual void | update_contents (void) |
![]() | |
virtual bool | accepts_focus (void) |
Query whether this widget accepts focus. | |
virtual void | force_redraw (void) |
virtual void | hide (void) |
virtual bool | is_enabled (void) |
Query the enabled status of this widget. | |
virtual bool | is_hotkey (key_t key) |
Query whether key is a hotkey for this widget. | |
virtual bool | is_shown (void) |
Query the visibility status of this widget. | |
virtual bool | process_mouse_event (mouse_event_t event) |
Process a mouse event. | |
virtual void | set_anchor (window_component_t *anchor, int relation) |
Set this widget's anchor. | |
virtual void | set_enabled (bool enable) |
Set the enabled status of this widget. | |
virtual void | set_focus (focus_t focus) |
virtual void | set_position (optint top, optint left) |
virtual void | show (void) |
![]() | |
virtual void | force_redraw (void)=0 |
Request that this window_component_t be completely redrawn. | |
virtual t3_window_t * | get_base_window (void) |
Retrieve the t3_window_t for this window_component_t. | |
virtual void | hide (void)=0 |
Hide the window_component_t. | |
virtual bool | process_key (key_t key)=0 |
Handle a key press by the user. | |
virtual void | set_focus (focus_t focus)=0 |
Set whether this window_component_t has the input focus. | |
virtual void | set_position (optint top, optint left)=0 |
Move the window_component_t to a specified position. | |
virtual bool | set_size (optint height, optint width)=0 |
Set the size of this window_component_t. | |
virtual void | show (void)=0 |
Display the window_component_t. | |
virtual void | update_contents (void)=0 |
Update the contents of the window. | |
window_component_t (void) | |
Base constructor. | |
virtual | ~window_component_t (void) |
Base destructor. | |
![]() | |
void | grab_mouse (void) |
Grab all future mouse events. | |
void | register_mouse_target (t3_window_t *target) |
Register a window to receive mouse events. | |
void | release_mouse_grab (void) |
Release a previous mouse grab. | |
void | unregister_mouse_target (t3_window_t *target) |
Unregister a window to receive mouse events. | |
![]() | |
center_component_t (void) | |
Create a new center_component_t. | |
virtual void | set_center_window (window_component_t *_center_window) |
Set the window_component_t to center over. | |
![]() | |
virtual bool | is_child (window_component_t *component)=0 |
Determine whether a window_compnent_t is a child of the container_t. | |
virtual void | set_child_focus (window_component_t *target)=0 |
Set the focus to a specific window component. | |
![]() | |
virtual void | bad_draw_recheck (void)=0 |
Function called on reception of the terminal_settings_changed signal. | |
bad_draw_recheck_t (void) | |
Base constructor. | |
virtual | ~bad_draw_recheck_t (void) |
Base destructor. |
Protected Member Functions | |
void | activate_autocomplete (bool autocomplete_single) |
Activate the autocomplete panel. | |
virtual void | draw_info_window (void) |
Draw the information in the info_window. | |
void | ensure_cursor_on_screen (void) |
Ensure that the cursor is visible. | |
void | update_repaint_lines (int start, int end) |
Change the lines to start and end repainting. | |
text_coordinate_t | xy_to_text_coordinate (int x, int y) |
Convert coordinates relative to the edit window to a text_coordinate_t. | |
![]() | |
void | init_unbacked_window (int height, int width, bool register_as_mouse_target=false) |
Initialize the window with an unbacked t3_window_t with height and width . | |
void | init_window (int height, int width, bool register_as_mouse_target=true) |
Initialize the window with a t3_window_t with height and width . | |
widget_t (int height, int width, bool register_as_mouse_target=true) | |
Constructor which creates a default t3_window_t with height and width . | |
widget_t (void) | |
Constructor which does not create a default t3_window_t. | |
![]() | |
mouse_target_t (bool use_window=true) | |
![]() | |
virtual bool | set_widget_parent (window_component_t *widget) |
Make widget a child window of this container_t, by setting its parent window. | |
virtual void | unset_widget_parent (window_component_t *widget) |
Unset the parent window for a widget . |
Protected Attributes | |
cleanup_t3_window_ptr | info_window |
Window for other information, such as buffer name. | |
text_buffer_t * | text |
Buffer holding the text currently displayed. | |
![]() | |
bool | enabled |
Widget is enabled. | |
bool | redraw |
Widget requires redrawing on next update_contents call. | |
bool | shown |
Widget is shown. | |
![]() | |
cleanup_t3_window_ptr | window |
The t3_window_t used for presenting this item on screen (see libt3window). | |
![]() | |
window_component_t * | center_window |
The window_component_t to center over. |
Additional Inherited Members | |
![]() | |
enum | focus_t { FOCUS_OUT, FOCUS_SET, FOCUS_IN_FWD, FOCUS_IN_BCK, FOCUS_REVERT } |
![]() | |
static bool | handle_mouse_event (mouse_event_t event) |
Class implementing an edit widget.
t3_widget::edit_window_t::edit_window_t | ( | text_buffer_t * | _text = NULL , |
const view_parameters_t * | params = NULL |
||
) |
Create a new edit_window_t.
_text | The text to display in the edit_window_t. |
params | The view parameters to set. |
|
protected |
Activate the autocomplete panel.
autocomplete_single | Should the autocomplete be automatic if there is only one option. |
The autocomplete panel activate, only if there is a possible autocompletion.
void t3_widget::edit_window_t::autocomplete | ( | void | ) |
Perform autocompletion, or pop-up autocompletion choice menu.
void t3_widget::edit_window_t::cut_copy | ( | bool | cut | ) |
Apply the cut or copy action.
cut | A boolean indicating whether a cut (true ) should be performed, or a copy (false ). The selected text is stored in copy_buffer. |
|
protectedvirtual |
Draw the information in the info_window.
This function is called whenever the info_window changes size and therefore needs to be redrawn.
|
protected |
Ensure that the cursor is visible.
void t3_widget::edit_window_t::find_next | ( | bool | backward | ) |
Apply the find-next action.
backward | Boolean indicating whether to reverse the direction of the search relative to the original search direction. |
void t3_widget::edit_window_t::find_replace | ( | bool | replace | ) |
Show the find or replace dialog.
bool t3_widget::edit_window_t::get_auto_indent | ( | void | ) |
Get automatic indent.
bool t3_widget::edit_window_t::get_indent_aware_home | ( | void | ) |
Get indent aware home.
bool t3_widget::edit_window_t::get_show_tabs | ( | void | ) |
Get show tabs.
bool t3_widget::edit_window_t::get_tab_spaces | ( | void | ) |
Get tab indents with spaces.
int t3_widget::edit_window_t::get_tabsize | ( | void | ) |
Get the size of a tab.
text_buffer_t * t3_widget::edit_window_t::get_text | ( | void | ) | const |
Get the text currently displayed.
wrap_type_t t3_widget::edit_window_t::get_wrap | ( | void | ) |
Get the wrap type.
void t3_widget::edit_window_t::goto_line | ( | int | line | ) |
Move the cursor to the specified line.
void t3_widget::edit_window_t::goto_line | ( | void | ) |
Show the Goto Line dialog.
void t3_widget::edit_window_t::indent_selection | ( | void | ) |
Indent the current selection.
void t3_widget::edit_window_t::insert_special | ( | void | ) |
Show the Insert Special Character dialog.
void t3_widget::edit_window_t::paste | ( | void | ) |
Apply the paste action.
The text to paste is taken from copy_buffer.
void t3_widget::edit_window_t::redo | ( | void | ) |
Apply the redo action.
edit_window_t::view_parameters_t * t3_widget::edit_window_t::save_view_parameters | ( | void | ) |
Save the current view parameters, to allow them to be restored later.
void t3_widget::edit_window_t::save_view_parameters | ( | view_parameters_t * | params | ) |
Save the current view parameters, to allow them to be restored later.
void t3_widget::edit_window_t::select_all | ( | void | ) |
Select the whole text.
void t3_widget::edit_window_t::set_auto_indent | ( | bool | _auto_indent | ) |
Set automatic indent.
void t3_widget::edit_window_t::set_autocompleter | ( | autocompleter_t * | _autocompleter | ) |
Set the autocompleter to use.
void t3_widget::edit_window_t::set_find_dialog | ( | find_dialog_t * | _find_dialog | ) |
Set the find_dialog_t to use.
In some cases it can be useful not to use the global find_dialog_t. This function allows one to set the find_dialog_t used.
void t3_widget::edit_window_t::set_finder | ( | finder_t * | _finder | ) |
void t3_widget::edit_window_t::set_indent_aware_home | ( | bool | _indent_aware_home | ) |
Set indent aware home.
void t3_widget::edit_window_t::set_show_tabs | ( | bool | _show_tabs | ) |
Set show_tabs.
void t3_widget::edit_window_t::set_tab_spaces | ( | bool | _tab_spaces | ) |
Set tab indents with spaces.
void t3_widget::edit_window_t::set_tabsize | ( | int | _tabsize | ) |
Set the size of a tab.
void t3_widget::edit_window_t::set_text | ( | text_buffer_t * | _text, |
const view_parameters_t * | params = NULL |
||
) |
Set the text to display.
The previously displayed text will be replaced, without deleting. Use get_text to retrieve the current text_buffer_t before calling this function to make sure you have a reference to the current buffer that you can use to delete the old text_buffer_t.
void t3_widget::edit_window_t::set_wrap | ( | wrap_type_t | wrap | ) |
Set the wrap type.
void t3_widget::edit_window_t::undo | ( | void | ) |
Apply the undo action.
void t3_widget::edit_window_t::unindent_selection | ( | void | ) |
Unindent the current selection.
|
protected |
Change the lines to start and end repainting.
It is acceptable to pass start
and end
in reverse order.
|
protected |
Convert coordinates relative to the edit window to a text_coordinate_t.
|
protected |
Window for other information, such as buffer name.
|
protected |
Buffer holding the text currently displayed.