Tab moves forward in menu, Shift-Tab moves backward.

CTRL-V no longer segfaults Fl_Text_Editor when the clipboard is empty.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2830 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2002-11-08 15:57:10 +00:00
parent e5cdd193b2
commit 4f15037e8e
3 changed files with 16 additions and 6 deletions

View File

@ -1,5 +1,10 @@
CHANGES IN FLTK 1.1.2
- Fl_Text_Editor would cause a segfault if the user
pressed CTRL-V (paste) without having any data in the
clipboard...
- The tab key moved backwards in menus instead of
forwards. Shift-tab still moves backwards.
- The redraw_label() method didn't damage the parent
window when the label was outside the widget's
bounding box.

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.19 2002/10/11 17:03:47 easysw Exp $"
// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.20 2002/11/08 15:57:10 easysw Exp $"
//
// Menu code for the Fast Light Tool Kit (FLTK).
//
@ -496,8 +496,6 @@ int menuwindow::handle(int e) {
switch (e) {
case FL_KEYBOARD:
switch (Fl::event_key()) {
case FL_Tab:
if (Fl::event_shift()&FL_SHIFT) goto BACKTAB;
case FL_BackSpace:
case 0xFE20: // backtab
BACKTAB:
@ -508,6 +506,8 @@ int menuwindow::handle(int e) {
else if (backward(pp.menu_number));
else if (pp.menubar && pp.menu_number==1) setitem(0, pp.p[0]->selected);
return 1;
case FL_Tab:
if (Fl::event_shift()) goto BACKTAB;
case FL_Down:
if (pp.menu_number || !pp.menubar) forward(pp.menu_number);
else if (pp.menu_number < pp.nummenus-1) forward(pp.menu_number+1);
@ -780,5 +780,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
}
//
// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.19 2002/10/11 17:03:47 easysw Exp $".
// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.20 2002/11/08 15:57:10 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Text_Editor.cxx,v 1.9.2.12 2002/11/05 19:53:50 matthiaswm Exp $"
// "$Id: Fl_Text_Editor.cxx,v 1.9.2.13 2002/11/08 15:57:10 easysw Exp $"
//
// Copyright 2001-2002 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
@ -29,6 +29,7 @@
#include <ctype.h>
#include <FL/Fl.H>
#include <FL/Fl_Text_Editor.H>
#include <FL/fl_ask.H>
Fl_Text_Editor::Fl_Text_Editor(int X, int Y, int W, int H, const char* l)
@ -458,6 +459,10 @@ int Fl_Text_Editor::handle(int event) {
return handle_key();
case FL_PASTE:
if (!Fl::event_text()) {
fl_beep();
return 1;
}
buffer()->remove_selection();
if (insert_mode()) insert(Fl::event_text());
else overstrike(Fl::event_text());
@ -477,5 +482,5 @@ int Fl_Text_Editor::handle(int event) {
}
//
// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.12 2002/11/05 19:53:50 matthiaswm Exp $".
// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.13 2002/11/08 15:57:10 easysw Exp $".
//