summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Browser.cxx2
-rw-r--r--src/Fl_Browser_.cxx28
-rw-r--r--src/Fl_File_Chooser2.cxx10
-rw-r--r--src/Fl_Input.cxx118
-rw-r--r--src/Fl_Input_.cxx36
-rw-r--r--src/Fl_Screen_Driver.cxx2
-rw-r--r--src/Fl_Text_Buffer.cxx14
-rw-r--r--src/Fl_Tile.cxx4
-rw-r--r--src/Fl_Value_Input.cxx2
9 files changed, 108 insertions, 108 deletions
diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx
index 80d6af811..e78ccee30 100644
--- a/src/Fl_Browser.cxx
+++ b/src/Fl_Browser.cxx
@@ -634,7 +634,7 @@ void Fl_Browser::lineposition(int line, Fl_Line_Position pos) {
}
if (final > (full_height() - H)) final = full_height() -H;
- position(final);
+ vposition(final);
}
/**
diff --git a/src/Fl_Browser_.cxx b/src/Fl_Browser_.cxx
index 29d3fada9..d2dcbc39e 100644
--- a/src/Fl_Browser_.cxx
+++ b/src/Fl_Browser_.cxx
@@ -49,7 +49,7 @@
*/
static void scrollbar_callback(Fl_Widget* s, void*) {
- ((Fl_Browser_*)(s->parent()))->position(int(((Fl_Scrollbar*)s)->value()));
+ ((Fl_Browser_*)(s->parent()))->vposition(int(((Fl_Scrollbar*)s)->value()));
}
static void hscrollbar_callback(Fl_Widget* s, void*) {
@@ -181,7 +181,7 @@ void Fl_Browser_::update_top() {
}
}
-// Change position(), top() will update when update_top() is called
+// Change vposition(), top() will update when update_top() is called
// (probably by draw() or handle()):
/**
Sets the vertical scroll position of the list to pixel position \p pos.
@@ -189,9 +189,9 @@ void Fl_Browser_::update_top() {
of the screen. Example: A position of '3' scrolls the top three pixels of
the list off the top edge of the screen.
\param[in] pos The vertical position (in pixels) to scroll the browser to.
- \see position(), hposition()
+ \see vposition(), hposition()
*/
-void Fl_Browser_::position(int pos) {
+void Fl_Browser_::vposition(int pos) {
if (pos < 0) pos = 0;
if (pos == position_) return;
position_ = pos;
@@ -204,7 +204,7 @@ void Fl_Browser_::position(int pos) {
of the screen. Example: A position of '18' scrolls the left 18 pixels of the list
off the left edge of the screen.
\param[in] pos The horizontal position (in pixels) to scroll the browser to.
- \see position(), hposition()
+ \see vposition(), hposition()
*/
void Fl_Browser_::hposition(int pos) {
if (pos < 0) pos = 0;
@@ -244,7 +244,7 @@ void Fl_Browser_::display(void* item) {
// First special case - want to display first item in the list?
update_top();
- if (item == item_first()) {position(0); return;}
+ if (item == item_first()) { vposition(0); return; }
int X, Y, W, H, Yp; bbox(X, Y, W, H);
void* l = top_;
@@ -252,11 +252,11 @@ void Fl_Browser_::display(void* item) {
int h1;
// 2nd special case - want to display item already displayed at top of browser?
- if (l == item) {position(real_position_+Y); return;} // scroll up a bit
+ if (l == item) { vposition(real_position_+Y); return; } // scroll up a bit
// 3rd special case - want to display item just above top of browser?
void* lp = item_prev(l);
- if (lp == item) {position(real_position_+Y-item_quick_height(lp)); return;}
+ if (lp == item) { vposition(real_position_+Y-item_quick_height(lp)); return; }
#ifdef DISPLAY_SEARCH_BOTH_WAYS_AT_ONCE
// search for item. We search both up and down the list at the same time,
@@ -268,9 +268,9 @@ void Fl_Browser_::display(void* item) {
if (l == item) {
if (Y <= H) { // it is visible or right at bottom
Y = Y+h1-H; // find where bottom edge is
- if (Y > 0) position(real_position_+Y); // scroll down a bit
+ if (Y > 0) vposition(real_position_+Y); // scroll down a bit
} else {
- position(real_position_+Y-(H-h1)/2); // center it
+ vposition(real_position_+Y-(H-h1)/2); // center it
}
return;
}
@@ -281,8 +281,8 @@ void Fl_Browser_::display(void* item) {
h1 = item_quick_height(lp);
Yp -= h1;
if (lp == item) {
- if ((Yp + h1) >= 0) position(real_position_+Yp);
- else position(real_position_+Yp-(H-h1)/2);
+ if ((Yp + h1) >= 0) vposition(real_position_+Yp);
+ else vposition(real_position_+Yp-(H-h1)/2);
return;
}
lp = item_prev(lp);
@@ -871,12 +871,12 @@ J1:
if (my < Y && my < py) {
int p = real_position_+my-Y;
if (p<0) p = 0;
- position(p);
+ vposition(p);
} else if (my > (Y+H) && my > py) {
int p = real_position_+my-(Y+H);
int hh = full_height()-H; if (p > hh) p = hh;
if (p<0) p = 0;
- position(p);
+ vposition(p);
}
if (type() == FL_NORMAL_BROWSER || !top_)
;
diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx
index 037598c85..c73938f5e 100644
--- a/src/Fl_File_Chooser2.cxx
+++ b/src/Fl_File_Chooser2.cxx
@@ -801,7 +801,7 @@ Fl_File_Chooser::fileNameCB()
if (dirIsRelative) {
fl_filename_absolute(pathname, sizeof(pathname), filename);
value(pathname);
- fileName->mark(fileName->position()); // no selection after expansion
+ fileName->mark(fileName->insert_position()); // no selection after expansion
} else if (filename != pathname) {
// Finally, make sure that we have a writable copy...
strlcpy(pathname, filename, sizeof(pathname));
@@ -848,7 +848,7 @@ Fl_File_Chooser::fileNameCB()
int condition = Fl::system_driver()->case_insensitive_filenames() ?
strcasecmp(pathname, directory_) : strcmp(pathname, directory_);
if (condition && (pathname[0] || strcmp("/", directory_))) {
- int p = fileName->position();
+ int p = fileName->insert_position();
int m = fileName->mark();
directory(pathname);
@@ -861,7 +861,7 @@ Fl_File_Chooser::fileNameCB()
strlcpy(pathname, tempname, sizeof(pathname));
}
- fileName->position(p, m);
+ fileName->insert_position(p, m);
}
// Other key pressed - do filename completion as possible...
@@ -922,7 +922,7 @@ Fl_File_Chooser::fileNameCB()
// Highlight it with the cursor at the end of the selection so
// s/he can press the right arrow to accept the selection
// (Tab and End also do this for both cases.)
- fileName->position(
+ fileName->insert_position(
(int) (filename - pathname + max_match),
(int) (filename - pathname + min_match));
} else if (max_match == 0) {
@@ -1527,7 +1527,7 @@ Fl_File_Chooser::value(const char *filename)
if (slash > pathname) slash[-1] = '/';
fileName->value(pathname);
- fileName->position(0, (int) strlen(pathname));
+ fileName->insert_position(0, (int) strlen(pathname));
okButton->activate();
// Then find the file in the file list and select it...
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx
index 5edbc37cc..c191bfc6e 100644
--- a/src/Fl_Input.cxx
+++ b/src/Fl_Input.cxx
@@ -54,7 +54,7 @@ void Fl_Input::draw() {
// kludge so shift causes selection to extend:
int Fl_Input::shift_position(int p) {
- return position(p, Fl::event_state(FL_SHIFT) ? mark() : p);
+ return insert_position(p, Fl::event_state(FL_SHIFT) ? mark() : p);
}
int Fl_Input::shift_up_down_position(int p) {
@@ -93,7 +93,7 @@ static const char *legal_fp_chars = ".eE+-";
// If OPTION_ARROW_FOCUS is disabled, return 1 to prevent focus navigation.
//
int Fl_Input::kf_lines_up(int repeat_num) {
- int i = position();
+ int i = insert_position();
if (!line_start(i)) {
//UNNEEDED if (input_type()==FL_MULTILINE_INPUT && !Fl::option(Fl::OPTION_ARROW_FOCUS)) return 1;
return NORMAL_INPUT_MOVE;
@@ -111,7 +111,7 @@ int Fl_Input::kf_lines_up(int repeat_num) {
// If OPTION_ARROW_FOCUS is disabled, return 1 to prevent focus navigation.
//
int Fl_Input::kf_lines_down(int repeat_num) {
- int i = position();
+ int i = insert_position();
if (line_end(i) >= size()) {
//UNNEEDED if (input_type()==FL_MULTILINE_INPUT && !Fl::option(Fl::OPTION_ARROW_FOCUS)) return 1;
return NORMAL_INPUT_MOVE;
@@ -144,66 +144,66 @@ int Fl_Input::kf_insert_toggle() {
// Delete word right
int Fl_Input::kf_delete_word_right() {
if (readonly()) { fl_beep(); return 1; }
- if (mark() != position()) return cut();
- cut(position(), word_end(position()));
+ if (mark() != insert_position()) return cut();
+ cut(insert_position(), word_end(insert_position()));
return 1;
}
// Delete word left
int Fl_Input::kf_delete_word_left() {
if (readonly()) { fl_beep(); return 1; }
- if (mark() != position()) return cut();
- cut(word_start(position()), position());
+ if (mark() != insert_position()) return cut();
+ cut(word_start(insert_position()), insert_position());
return 1;
}
// Delete to start of line
int Fl_Input::kf_delete_sol() {
if (readonly()) { fl_beep(); return 1; }
- if (mark() != position()) return cut();
- cut(line_start(position()), position());
+ if (mark() != insert_position()) return cut();
+ cut(line_start(insert_position()), insert_position());
return 1;
}
// Delete to end of line
int Fl_Input::kf_delete_eol() {
if (readonly()) { fl_beep(); return 1; }
- if (mark() != position()) return cut();
- cut(position(), line_end(position()));
+ if (mark() != insert_position()) return cut();
+ cut(insert_position(), line_end(insert_position()));
return 1;
}
int Fl_Input::kf_delete_char_right() {
if (readonly()) { fl_beep(); return 1; }
- if (mark() != position()) cut();
+ if (mark() != insert_position()) cut();
else cut(1);
return 1;
}
int Fl_Input::kf_delete_char_left() {
if (readonly()) { fl_beep(); return 1; }
- if (mark() != position()) cut();
+ if (mark() != insert_position()) cut();
else cut(-1);
return 1;
}
// Move cursor to start of line
int Fl_Input::kf_move_sol() {
- return shift_position(line_start(position())) + NORMAL_INPUT_MOVE;
+ return shift_position(line_start(insert_position())) + NORMAL_INPUT_MOVE;
}
// Move cursor to end of line
int Fl_Input::kf_move_eol() {
- return shift_position(line_end(position())) + NORMAL_INPUT_MOVE;
+ return shift_position(line_end(insert_position())) + NORMAL_INPUT_MOVE;
}
// Clear to end of line
int Fl_Input::kf_clear_eol() {
if (readonly()) { fl_beep(); return 1; }
- if (position()>=size()) return 0;
- int i = line_end(position());
- if (i == position() && i < size()) i++;
- cut(position(), i);
+ if (insert_position()>=size()) return 0;
+ int i = line_end(insert_position());
+ if (i == insert_position() && i < size()) i++;
+ cut(insert_position(), i);
return copy_cuts();
}
@@ -211,7 +211,7 @@ int Fl_Input::kf_clear_eol() {
// If OPTION_ARROW_FOCUS is disabled, return 1 to prevent focus navigation.
//
int Fl_Input::kf_move_char_left() {
- int i = shift_position(position()-1) + NORMAL_INPUT_MOVE;
+ int i = shift_position(insert_position()-1) + NORMAL_INPUT_MOVE;
return Fl::option(Fl::OPTION_ARROW_FOCUS) ? i : 1;
}
@@ -219,36 +219,36 @@ int Fl_Input::kf_move_char_left() {
// If OPTION_ARROW_FOCUS is disabled, return 1 to prevent focus navigation.
//
int Fl_Input::kf_move_char_right() {
- int i = shift_position(position()+1) + NORMAL_INPUT_MOVE;
+ int i = shift_position(insert_position()+1) + NORMAL_INPUT_MOVE;
return Fl::option(Fl::OPTION_ARROW_FOCUS) ? i : 1;
}
// Move cursor word-left
int Fl_Input::kf_move_word_left() {
- shift_position(word_start(position()));
+ shift_position(word_start(insert_position()));
return 1;
}
// Move cursor word-right
int Fl_Input::kf_move_word_right() {
- shift_position(word_end(position()));
+ shift_position(word_end(insert_position()));
return 1;
}
// Move cursor up one line and to the start of line (paragraph up)
int Fl_Input::kf_move_up_and_sol() {
- if (line_start(position())==position() && position()>0)
- return shift_position(line_start(position()-1)) + NORMAL_INPUT_MOVE;
+ if (line_start(insert_position())==insert_position() && insert_position()>0)
+ return shift_position(line_start(insert_position()-1)) + NORMAL_INPUT_MOVE;
else
- return shift_position(line_start(position())) + NORMAL_INPUT_MOVE;
+ return shift_position(line_start(insert_position())) + NORMAL_INPUT_MOVE;
}
// Move cursor down one line and to the end of line (paragraph down)
int Fl_Input::kf_move_down_and_eol() {
- if (line_end(position())==position() && position()<size())
- return shift_position(line_end(position()+1)) + NORMAL_INPUT_MOVE;
+ if (line_end(insert_position())==insert_position() && insert_position()<size())
+ return shift_position(line_end(insert_position()+1)) + NORMAL_INPUT_MOVE;
else
- return shift_position(line_end(position())) + NORMAL_INPUT_MOVE;
+ return shift_position(line_end(insert_position())) + NORMAL_INPUT_MOVE;
}
// Move to top of document
@@ -265,7 +265,7 @@ int Fl_Input::kf_bottom() {
// Select all text in the widget
int Fl_Input::kf_select_all() {
- position(0,size());
+ insert_position(0,size());
return 1;
}
@@ -348,7 +348,7 @@ int Fl_Input::handle_key() {
#endif // HAVE_LOCALECONV
// find the insert position
- int ip = position()<mark() ? position() : mark();
+ int ip = insert_position()<mark() ? insert_position() : mark();
// This is complex to allow "0xff12" hex to be typed:
if ( (!ip && (ascii == '+' || ascii == '-'))
|| (ascii >= '0' && ascii <= '9')
@@ -358,18 +358,18 @@ int Fl_Input::handle_key() {
|| (input_type()==FL_FLOAT_INPUT && ascii && strchr(legal_fp_chars, ascii)))
{
if (readonly()) fl_beep();
- else replace(position(), mark(), &ascii, 1);
+ else replace(insert_position(), mark(), &ascii, 1);
}
return 1;
}
if (del || Fl::event_length()) {
if (readonly()) fl_beep();
- else replace(position(), del ? position()-del : mark(),
+ else replace(insert_position(), del ? insert_position()-del : mark(),
Fl::event_text(), Fl::event_length());
}
if (Fl::screen_driver()->has_marked_text() && Fl::compose_state) {
- this->mark( this->position() - Fl::compose_state );
+ this->mark( this->insert_position() - Fl::compose_state );
}
return 1;
}
@@ -408,11 +408,11 @@ int Fl_Input::handle_key() {
case FL_Enter:
case FL_KP_Enter:
if (when() & FL_WHEN_ENTER_KEY) {
- position(size(), 0);
+ insert_position(size(), 0);
maybe_do_callback();
return 1;
} else if (multiline && !readonly()) {
- return replace(position(), mark(), "\n", 1);
+ return replace(insert_position(), mark(), "\n", 1);
} return 0; // reserved for shortcuts
case FL_Tab:
@@ -455,7 +455,7 @@ int Fl_Input::handle_key() {
if (readonly()) { fl_beep(); return 1; }
// insert a few selected control characters literally:
if (input_type() != FL_FLOAT_INPUT && input_type() != FL_INT_INPUT)
- return replace(position(), mark(), &ascii, 1);
+ return replace(insert_position(), mark(), &ascii, 1);
break;
}
@@ -468,17 +468,17 @@ int Fl_Input::handle(int event) {
switch (event) {
case FL_UNFOCUS:
if (Fl::screen_driver()->has_marked_text() && Fl::compose_state) {
- this->mark( this->position() );
+ this->mark( this->insert_position() );
fl_reset_spot();
}
break;
case FL_FOCUS:
switch (Fl::event_key()) {
case FL_Right:
- position(0);
+ insert_position(0);
break;
case FL_Left:
- position(size());
+ insert_position(size());
break;
case FL_Down:
up_down_position(0);
@@ -487,10 +487,10 @@ int Fl_Input::handle(int event) {
up_down_position(line_start(size()));
break;
case FL_Tab:
- position(size(),0);
+ insert_position(size(),0);
break;
default:
- position(position(),mark());// turns off the saved up/down arrow position
+ insert_position(insert_position(),mark());// turns off the saved up/down arrow position
break;
}
break;
@@ -505,12 +505,12 @@ int Fl_Input::handle(int event) {
&& !tab_nav() // with tab navigation disabled?
&& input_type() == FL_MULTILINE_INPUT // with a multiline input?
&& size() > 0 // non-empty field?
- && ((mark()==0 && position()==size()) || (position()==0 && mark()==size()))) {// while entire field selected?
+ && ((mark()==0 && insert_position()==size()) || (insert_position()==0 && mark()==size()))) {// while entire field selected?
// Set cursor to the end of the selection...
- if (mark() > position())
- position(mark());
+ if (mark() > insert_position())
+ insert_position(mark());
else
- position(position());
+ insert_position(insert_position());
return (1);
} else {
if (active_r() && window() && this == Fl::belowmouse())
@@ -521,15 +521,15 @@ int Fl_Input::handle(int event) {
case FL_PUSH:
if (Fl::dnd_text_ops()) {
- int oldpos = position(), oldmark = mark();
+ int oldpos = insert_position(), oldmark = mark();
Fl_Boxtype b = box();
Fl_Input_::handle_mouse(x()+Fl::box_dx(b), y()+Fl::box_dy(b),
w()-Fl::box_dw(b), h()-Fl::box_dh(b), 0);
- newpos = position();
- position( oldpos, oldmark );
+ newpos = insert_position();
+ insert_position( oldpos, oldmark );
if (Fl::focus()==this && !Fl::event_state(FL_SHIFT) && input_type()!=FL_SECRET_INPUT &&
- ( (newpos >= mark() && newpos < position()) ||
- (newpos >= position() && newpos < mark()) ) ) {
+ ( (newpos >= mark() && newpos < insert_position()) ||
+ (newpos >= insert_position() && newpos < mark()) ) ) {
// user clicked in the selection, may be trying to drag
drag_start = newpos;
return 1;
@@ -548,7 +548,7 @@ int Fl_Input::handle(int event) {
if (drag_start >= 0) {
if (Fl::event_is_click()) return 1; // debounce the mouse
// save the position because sometimes we don't get DND_ENTER:
- dnd_save_position = position();
+ dnd_save_position = insert_position();
dnd_save_mark = mark();
dnd_save_focus = this;
// drag the data:
@@ -568,7 +568,7 @@ int Fl_Input::handle(int event) {
copy(0);
} else if (Fl::event_is_click() && drag_start >= 0) {
// user clicked in the field and wants to reset the cursor position...
- position(drag_start, drag_start);
+ insert_position(drag_start, drag_start);
drag_start = -1;
} else if (Fl::event_clicks()) {
// user double or triple clicked to select word or whole text
@@ -584,7 +584,7 @@ int Fl_Input::handle(int event) {
case FL_DND_ENTER:
Fl::belowmouse(this); // send the leave events first
if (dnd_save_focus != this) {
- dnd_save_position = position();
+ dnd_save_position = insert_position();
dnd_save_mark = mark();
dnd_save_focus = Fl::focus();
Fl::focus(this);
@@ -608,7 +608,7 @@ int Fl_Input::handle(int event) {
return 1;
case FL_DND_LEAVE:
- position(dnd_save_position, dnd_save_mark);
+ insert_position(dnd_save_position, dnd_save_mark);
#ifdef DND_OUT_XXXX
if (!focused())
#endif
@@ -624,7 +624,7 @@ int Fl_Input::handle(int event) {
if (dnd_save_focus == this) { // if the dragged text comes from the same widget
if (!readonly()) {
// remove the selected text
- int old_position = position();
+ int old_position = insert_position();
if (dnd_save_mark > dnd_save_position) {
int tmp = dnd_save_mark;
dnd_save_mark = dnd_save_position;
@@ -632,9 +632,9 @@ int Fl_Input::handle(int event) {
}
replace(dnd_save_mark, dnd_save_position, NULL, 0);
if (old_position > dnd_save_position)
- position(old_position - (dnd_save_position - dnd_save_mark));
+ insert_position(old_position - (dnd_save_position - dnd_save_mark));
else
- position(old_position);
+ insert_position(old_position);
} // !readonly()
} // from the same widget
else if (dnd_save_focus) {
@@ -715,7 +715,7 @@ Fl_Secret_Input::Fl_Secret_Input(int X,int Y,int W,int H,const char *l)
int Fl_Secret_Input::handle(int event) {
int retval = Fl_Input::handle(event);
if (event == FL_KEYBOARD && Fl::screen_driver()->has_marked_text() && Fl::compose_state) {
- this->mark( this->position() ); // don't underline marked text
+ this->mark( this->insert_position() ); // don't underline marked text
}
return retval;
}
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index 88093bffe..a8f168b0e 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -261,10 +261,10 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
int selstart, selend;
if (Fl::focus()!=this && /*Fl::selection_owner()!=this &&*/ Fl::pushed()!=this)
selstart = selend = 0;
- else if (position() <= mark()) {
- selstart = position(); selend = mark();
+ else if (insert_position() <= mark()) {
+ selstart = insert_position(); selend = mark();
} else {
- selend = position(); selstart = mark();
+ selend = insert_position(); selstart = mark();
}
setfont();
@@ -279,8 +279,8 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
int curx, cury;
for (p=value(), curx=cury=lines=0; ;) {
e = expand(p, buf);
- if (position() >= p-value() && position() <= e-value()) {
- curx = int(expandpos(p, value()+position(), buf, 0)+.5);
+ if (insert_position() >= p-value() && insert_position() <= e-value()) {
+ curx = int(expandpos(p, value()+insert_position(), buf, 0)+.5);
if (Fl::focus()==this && !was_up_down) up_down_pos = curx;
cury = lines*height;
int newscroll = xscroll_;
@@ -405,10 +405,10 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
if (Fl::focus() == this && (
(Fl::screen_driver()->has_marked_text() && Fl::compose_state) ||
selstart == selend) &&
- position() >= p-value() && position() <= e-value()) {
+ insert_position() >= p-value() && insert_position() <= e-value()) {
fl_color(cursor_color());
// cursor position may need to be recomputed (see STR #2486)
- curx = int(expandpos(p, value()+position(), buf, 0)+.5);
+ curx = int(expandpos(p, value()+insert_position(), buf, 0)+.5);
if (readonly()) {
// Draw '^' caret cursor
fl_line((int)(xpos+curx-2.5f), Y+ypos+height-1,
@@ -629,14 +629,14 @@ void Fl_Input_::handle_mouse(int X, int Y, int /*W*/, int /*H*/, int drag) {
}
// if the multiple click does not increase the selection, revert
// to single-click behavior:
- if (!drag && (mark() > position() ?
- (newmark >= position() && newpos <= mark()) :
- (newmark >= mark() && newpos <= position()))) {
+ if (!drag && (mark() > insert_position() ?
+ (newmark >= insert_position() && newpos <= mark()) :
+ (newmark >= mark() && newpos <= insert_position()))) {
Fl::event_clicks(0);
newmark = newpos = (int) (l-value());
}
}
- position(newpos, newmark);
+ insert_position(newpos, newmark);
}
/**
@@ -656,7 +656,7 @@ void Fl_Input_::handle_mouse(int X, int Y, int /*W*/, int /*H*/, int drag) {
\return 0 if no positions changed
\see position(int), position(), mark(int)
*/
-int Fl_Input_::position(int p, int m) {
+int Fl_Input_::insert_position(int p, int m) {
int is_same = 0;
was_up_down = 0;
if (p<0) p = 0;
@@ -730,7 +730,7 @@ int Fl_Input_::up_down_position(int i, int keepmark) {
if (f <= up_down_pos) l = t; else r = t-1;
}
int j = (int) (l-value());
- j = position(j, keepmark ? mark_ : j);
+ j = insert_position(j, keepmark ? mark_ : j);
was_up_down = 1;
return j;
}
@@ -749,10 +749,10 @@ int Fl_Input_::up_down_position(int i, int keepmark) {
\see Fl::copy(const char *, int, int)
*/
int Fl_Input_::copy(int clipboard) {
- int b = position();
+ int b = insert_position();
int e = mark();
if (b != e) {
- if (b > e) {b = mark(); e = position();}
+ if (b > e) {b = mark(); e = insert_position();}
if (input_type() == FL_SECRET_INPUT) e = b;
Fl::copy(value()+b, e-b, clipboard);
return 1;
@@ -780,7 +780,7 @@ int Fl_Input_::append(const char* t, int l, char keep_selection)
int om = mark_, op = position_;
int ret = replace(end, end, t, l);
if (keep_selection) {
- position(op, om);
+ insert_position(op, om);
}
return ret;
}
@@ -1125,7 +1125,7 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) {
return 1;
} else return replace(0, size(), t, (int) (e-t));
}
- return replace(position(), mark(), t, (int) (e-t));}
+ return replace(insert_position(), mark(), t, (int) (e-t));}
case FL_SHORTCUT:
if (!(shortcut() ? Fl::test_shortcut(shortcut()) : test_shortcut()))
@@ -1259,7 +1259,7 @@ int Fl_Input_::static_value(const char* str, int len) {
xscroll_ = yscroll_ = 0;
minimal_update(0);
}
- position(readonly() ? 0 : size());
+ insert_position(readonly() ? 0 : size());
return 1;
}
diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx
index 30481ba8e..4d5e5e856 100644
--- a/src/Fl_Screen_Driver.cxx
+++ b/src/Fl_Screen_Driver.cxx
@@ -281,7 +281,7 @@ int Fl_Screen_Driver::input_widget_handle_key(int key, unsigned mods, unsigned s
{
switch (key) {
case FL_Delete: {
- int selected = (input->position() != input->mark()) ? 1 : 0;
+ int selected = (input->insert_position() != input->mark()) ? 1 : 0;
if (mods==0 && shift && selected)
return input->kf_copy_cut(); // Shift-Delete with selection (WP,NP,WOW,GE,KE,OF)
if (mods==0 && shift && !selected)
diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx
index 4733fc177..638a3d023 100644
--- a/src/Fl_Text_Buffer.cxx
+++ b/src/Fl_Text_Buffer.cxx
@@ -581,7 +581,7 @@ void Fl_Text_Buffer::unselect()
*/
int Fl_Text_Buffer::selection_position(int *start, int *end)
{
- return mPrimary.position(start, end);
+ return mPrimary.selected(start, end);
}
@@ -642,7 +642,7 @@ void Fl_Text_Buffer::secondary_unselect()
*/
int Fl_Text_Buffer::secondary_selection_position(int *start, int *end)
{
- return mSecondary.position(start, end);
+ return mSecondary.selected(start, end);
}
@@ -703,7 +703,7 @@ void Fl_Text_Buffer::unhighlight()
*/
int Fl_Text_Buffer::highlight_position(int *start, int *end)
{
- return mHighlight.position(start, end);
+ return mHighlight.selected(start, end);
}
@@ -1325,7 +1325,7 @@ void Fl_Text_Selection::set(int startpos, int endpos)
\see selected(), start(), end()
*/
-int Fl_Text_Selection::position(int *startpos, int *endpos) const {
+int Fl_Text_Selection::selected(int *startpos, int *endpos) const {
if (!mSelected) {
*startpos = 0;
*endpos = 0;
@@ -1355,7 +1355,7 @@ char *Fl_Text_Buffer::selection_text_(Fl_Text_Selection * sel) const {
int start, end;
/* If there's no selection, return an allocated empty string */
- if (!sel->position(&start, &end))
+ if (!sel->selected(&start, &end))
{
char *s = (char *) malloc(1);
*s = '\0';
@@ -1375,7 +1375,7 @@ void Fl_Text_Buffer::remove_selection_(Fl_Text_Selection * sel)
{
int start, end;
- if (!sel->position(&start, &end))
+ if (!sel->selected(&start, &end))
return;
remove(start, end);
//undoyankcut = undocut;
@@ -1393,7 +1393,7 @@ void Fl_Text_Buffer::replace_selection_(Fl_Text_Selection * sel,
/* If there's no selection, return */
int start, end;
- if (!sel->position(&start, &end))
+ if (!sel->selected(&start, &end))
return;
/* Do the appropriate type of replace */
diff --git a/src/Fl_Tile.cxx b/src/Fl_Tile.cxx
index dd02d3757..a5de6039d 100644
--- a/src/Fl_Tile.cxx
+++ b/src/Fl_Tile.cxx
@@ -93,7 +93,7 @@
Pass zero as \p oldx or \p oldy to disable drag in that direction.
*/
-void Fl_Tile::position(int oldx, int oldy, int newx, int newy) {
+void Fl_Tile::move_intersection(int oldx, int oldy, int newx, int newy) {
Fl_Widget*const* a = array();
Fl_Rect *p = bounds();
p += 2; // skip group & resizable's saved size
@@ -268,7 +268,7 @@ int Fl_Tile::handle(int event) {
else if (newy > r->y()+r->h()) newy = r->y()+r->h();
} else
newy = sy;
- position(sx,sy,newx,newy);
+ move_intersection(sx, sy, newx, newy);
if (event == FL_DRAG) {
set_changed();
do_callback(FL_REASON_DRAGGED);
diff --git a/src/Fl_Value_Input.cxx b/src/Fl_Value_Input.cxx
index 4139c1ac4..37be93e80 100644
--- a/src/Fl_Value_Input.cxx
+++ b/src/Fl_Value_Input.cxx
@@ -54,7 +54,7 @@ void Fl_Value_Input::value_damage() {
char buf[128];
format(buf);
input.value(buf);
- input.mark(input.position()); // turn off selection highlight
+ input.mark(input.insert_position()); // turn off selection highlight
}
int Fl_Value_Input::handle(int event) {