DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2323
Version: 1.3-current
Link: http://www.fltk.org/str.php?L2323
Version: 1.3-current
/*
Test mouse input from FLTK (rev2)
Builds with: fltk-config --compile mousewheel2.cxx
*/
#include <stdio.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Widget.H>
class test_mouse : public Fl_Widget
{
public:
test_mouse(int X, int Y, int W, int H, const char *title = NULL) :
Fl_Widget(X, Y, W, H, title) { }
~test_mouse() { }
int handle(int event) {
int ret = Fl_Widget::handle(event); // gje
switch(event) {
case FL_ENTER:
case FL_FOCUS: // gje
return 1;
case FL_LEAVE:
return 1;
case FL_PUSH:
printf("push %d\n", Fl::event_button());
return 1;
case FL_RELEASE:
printf("release %d\n", Fl::event_button());
return 1;
case FL_MOVE:
return 1;
case FL_DRAG:
printf("drag %d\n", Fl::event_button());
return 1;
case FL_KEYDOWN:
return 1;
case FL_KEYUP:
return 1;
case FL_SHORTCUT:
return 1;
case FL_MOUSEWHEEL:
printf("wheel %d\n",Fl::event_dy());
return 1;
}
return(ret); // gje
}
void draw() { }
};
int main(int argc, char **argv)
{
// Build a window
Fl_Window w(100, 100, 400, 400, "Test FLTK mouse");
// Add the mouse event handler
test_mouse tmouse(0, 0, 400, 400, "test mouse");
w.end();
w.show();
return Fl::run();
}
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs