mirror of
https://github.com/fltk/fltk.git
synced 2026-05-26 18:17:03 +08:00
o Fixed tab navigation problem with this demo
o Prevent Fl_Output from erasing if value unchanged (allows text selection and keyboard nav of the Fl_Output widget..) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9848 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <FL/Fl_Toggle_Button.H>
|
||||
#include <FL/Fl_Output.H>
|
||||
#include <FL/Fl_Table_Row.H>
|
||||
#include <FL/names.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -115,8 +116,9 @@ public:
|
||||
int sum = GetSelectionSum();
|
||||
if ( sum == -1 ) { sprintf(s, "(nothing selected)"); G_sum->color(48); }
|
||||
else { sprintf(s, "%d", sum); G_sum->color(FL_WHITE); }
|
||||
G_sum->value(s);
|
||||
G_sum->redraw();
|
||||
// Update only if different (lets one copy/paste from sum)
|
||||
if ( strcmp(s,G_sum->value()))
|
||||
{ G_sum->value(s); G_sum->redraw(); }
|
||||
}
|
||||
// Keyboard and mouse events
|
||||
int handle(int e) {
|
||||
@@ -128,9 +130,9 @@ public:
|
||||
case FL_KEYUP:
|
||||
case FL_KEYDOWN:
|
||||
case FL_DRAG: {
|
||||
//ret = 1; // *don't* indicate we 'handled' these, just update ('handling' prevents e.g. tab nav)
|
||||
UpdateSum();
|
||||
redraw();
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
case FL_FOCUS: // tells FLTK we're interested in keyboard events
|
||||
|
||||
Reference in New Issue
Block a user