summaryrefslogtreecommitdiff
path: root/src/Fl_Text_Editor.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2020-07-01 18:03:10 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2020-07-06 20:28:20 +0200
commitf09e17c3c564e8310125a10c03397cbf473ff643 (patch)
tree8d0fd4a28e3686c33aaa140d07ddba26ab28bdc2 /src/Fl_Text_Editor.cxx
parentb0e0c355edaa2e23148cb0260ada907aec930f05 (diff)
Remove $Id$ tags, update URL's, and more
- remove obsolete svn '$Id$' tags from all source files - update .fl files and generated files accordingly - replace 'http://www.fltk.org' URL's with 'https://...' - replace bug report URL 'str.php' with 'bugs.php' - remove trailing whitespace - fix other whitespace errors flagged by Git - add and/or fix missing or wrong standard headers - convert tabs to spaces in all source files The only relevant code changes are in the fluid/ folder where some .fl files and other source files were used to generate the '$Id' headers and footers.
Diffstat (limited to 'src/Fl_Text_Editor.cxx')
-rw-r--r--src/Fl_Text_Editor.cxx70
1 files changed, 32 insertions, 38 deletions
diff --git a/src/Fl_Text_Editor.cxx b/src/Fl_Text_Editor.cxx
index bf1728377..eaab6f39e 100644
--- a/src/Fl_Text_Editor.cxx
+++ b/src/Fl_Text_Editor.cxx
@@ -1,6 +1,4 @@
//
-// "$Id$"
-//
// Copyright 2001-2018 by Bill Spitzak and others.
//
// Original code Copyright Mark Edel. Permission to distribute under
@@ -10,11 +8,11 @@
// the file "COPYING" which should have been included with this file. If this
// file is missing or damaged, see the license at:
//
-// http://www.fltk.org/COPYING.php
+// https://www.fltk.org/COPYING.php
//
-// Please report all bugs and problems on the following page:
+// Please see the following page on how to report bugs and issues:
//
-// http://www.fltk.org/str.php
+// https://www.fltk.org/bugs.php
//
#include <stdio.h>
@@ -29,10 +27,10 @@
/* Keyboard Control Matrix
-key\modifier plain Ctrl Alt Meta
- left 1/1 13/9 0/13 0/9
- right 2/2 14/10 0/14 0/10
- up 3/19 21/7 0/15 0/17
+key\modifier plain Ctrl Alt Meta
+ left 1/1 13/9 0/13 0/9
+ right 2/2 14/10 0/14 0/10
+ up 3/19 21/7 0/15 0/17
down 4/20 22/8 0/16 0/18
home 9/5 17/0 0/0 0/0
end 10/6 18/0 0/0 0/0
@@ -132,9 +130,9 @@ static struct {
{ FL_Down, FL_CTRL|FL_SHIFT, Fl_Text_Editor::kf_c_s_move },
{ FL_Page_Up, FL_CTRL|FL_SHIFT, Fl_Text_Editor::kf_c_s_move },
{ FL_Page_Down, FL_CTRL|FL_SHIFT, Fl_Text_Editor::kf_c_s_move },
-//{ FL_Clear, 0, Fl_Text_Editor::delete_to_eol },
- { 'z', FL_CTRL, Fl_Text_Editor::kf_undo },
- { '/', FL_CTRL, Fl_Text_Editor::kf_undo },
+//{ FL_Clear, 0, Fl_Text_Editor::delete_to_eol },
+ { 'z', FL_CTRL, Fl_Text_Editor::kf_undo },
+ { '/', FL_CTRL, Fl_Text_Editor::kf_undo },
{ 'x', FL_CTRL, Fl_Text_Editor::kf_cut },
{ FL_Delete, FL_SHIFT, Fl_Text_Editor::kf_cut },
{ 'c', FL_CTRL, Fl_Text_Editor::kf_copy },
@@ -421,18 +419,18 @@ int Fl_Text_Editor::kf_meta_move(int c, Fl_Text_Editor* e) {
e->show_insert_position();
}
switch (c) {
- case FL_Up: // top of buffer
+ case FL_Up: // top of buffer
e->insert_position(0);
e->scroll(0, 0);
break;
- case FL_Down: // end of buffer
+ case FL_Down: // end of buffer
e->insert_position(e->buffer()->length());
e->scroll(e->count_lines(0, e->buffer()->length(), 1), 0);
break;
- case FL_Left: // beginning of line
+ case FL_Left: // beginning of line
kf_move(FL_Home, e);
break;
- case FL_Right: // end of line
+ case FL_Right: // end of line
kf_move(FL_End, e);
break;
}
@@ -657,7 +655,7 @@ void Fl_Text_Editor::maybe_do_callback() {
int Fl_Text_Editor::handle(int event) {
static int dndCursorPos;
-
+
if (!buffer()) return 0;
switch (event) {
@@ -670,9 +668,9 @@ int Fl_Text_Editor::handle(int event) {
case FL_UNFOCUS:
show_cursor(mCursorOn); // redraws the cursor
if (Fl::screen_driver()->has_marked_text() && buffer()->selected() && Fl::compose_state) {
- int pos = insert_position();
- buffer()->select(pos, pos);
- Fl::reset_marked_text();
+ int pos = insert_position();
+ buffer()->select(pos, pos);
+ Fl::reset_marked_text();
}
if (buffer()->selected()) redraw(); // Redraw selections...
case FL_HIDE:
@@ -680,14 +678,14 @@ int Fl_Text_Editor::handle(int event) {
return 1;
case FL_KEYBOARD:
- if (active_r() && window() && this == Fl::belowmouse())
+ if (active_r() && window() && this == Fl::belowmouse())
window()->cursor(FL_CURSOR_NONE);
return handle_key();
case FL_PASTE:
if (!Fl::event_text()) {
fl_beep();
- return 1;
+ return 1;
}
buffer()->remove_selection();
if (insert_mode()) insert(Fl::event_text());
@@ -708,10 +706,10 @@ int Fl_Text_Editor::handle(int event) {
// don't let the text_display see this event
if (Fl_Group::handle(event)) return 1;
dragType = DRAG_NONE;
- if(buffer()->selected()) {
- buffer()->unselect();
- }
- int pos = xy_to_position(Fl::event_x(), Fl::event_y(), CURSOR_POS);
+ if(buffer()->selected()) {
+ buffer()->unselect();
+ }
+ int pos = xy_to_position(Fl::event_x(), Fl::event_y(), CURSOR_POS);
insert_position(pos);
Fl::paste(*this, 0);
Fl::focus(this);
@@ -729,8 +727,8 @@ int Fl_Text_Editor::handle(int event) {
return 1;
}
break;
-
- // Handle drag'n'drop attempt by the user. This is a simplified
+
+ // Handle drag'n'drop attempt by the user. This is a simplified
// implementation which allows dnd operations onto the scroll bars.
case FL_DND_ENTER: // save the current cursor position
if (Fl::visible_focus() && handle(FL_FOCUS))
@@ -740,10 +738,10 @@ int Fl_Text_Editor::handle(int event) {
/* fall through */
case FL_DND_DRAG: // show a temporary insertion cursor
insert_position(xy_to_position(Fl::event_x(), Fl::event_y(), CURSOR_POS));
- return 1;
+ return 1;
case FL_DND_LEAVE: // restore original cursor
insert_position(dndCursorPos);
- return 1;
+ return 1;
case FL_DND_RELEASE: // keep insertion cursor and wait for the FL_PASTE event
if (!dragging) buffer()->unselect(); // FL_PASTE must not destroy current selection if drag comes from outside
return 1;
@@ -769,7 +767,7 @@ detail may change in the future. Know that changing the editor's
key bindings for Tab and Shift-Tab may affect tab navigation.
\param [in] val If \p val is 0, Tab inserts a tab character (default).<br>
- If \p val is 1, Tab navigates widget focus.
+ If \p val is 1, Tab navigates widget focus.
\see tab_nav(), Fl::OPTION_ARROW_FOCUS.
\version 1.3.4 ABI feature
@@ -790,9 +788,9 @@ editor buffer.
If enabled, hitting Tab navigates focus to the next widget,
and Shift-Tab navigates focus to the previous widget.
-\returns if Tab inserts tab characters or moves the focus
-\retval 0 Tab inserts tab characters (default)
-\retval 1 Tab navigation is enabled.
+\returns if Tab inserts tab characters or moves the focus
+\retval 0 Tab inserts tab characters (default)
+\retval 1 Tab navigation is enabled.
\see tab_nav(int), Fl::OPTION_ARROW_FOCUS.
\version 1.3.4 ABI feature
@@ -800,7 +798,3 @@ and Shift-Tab navigates focus to the previous widget.
int Fl_Text_Editor::tab_nav() const {
return (bound_key_function(FL_Tab,0)==kf_ignore) ? 1 : 0;
}
-
-//
-// End of "$Id$".
-//