| [ Return to Bugs & Features | Roadmap 1.3 | Post Text | Post File | Prev | Next ]
STR #3003
Application: | FLTK Library |
Status: | 5 - New |
Priority: | 1 - Request for Enhancement, e.g. asking for a feature |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Core Library |
Summary: | New class Fl_Toggle_Browser for fltk-1.3.x . |
Version: | 1.3-feature |
Created By: | kdiman |
Assigned To: | Unassigned |
Fix Version: | Unassigned |
Update Notification: | |
Trouble Report Files:
[ Post File ]No files
Trouble Report Comments:
[ Post Text ]
|
#1 | kdiman 11:41 Nov 14, 2013 |
| Dear sirs.
I have Fl_Toggle_Browser, you can include it into core of fltk under FLTK license
[CODE=CPP] #include <FL/Fl.H> #include <FL/Fl_Browser.H>
class Fl_Toggle_Browser : public Fl_Browser { public: Fl_Toggle_Browser(int X, int Y, int W, int H, const char *L = 0): Fl_Browser(X,Y,W,H,L){ type(FL_MULTI_BROWSER); } virtual int handle(int e){ switch(e){ case FL_PUSH: { if ( Fl::event_button() == FL_LEFT_MOUSE ){ int X, Y, W, H; int xx, yy, ww, hh, dx, dy; dx = Fl::box_dy(box())*2; dy = Fl::box_dy(box())*2; X=Fl::event_x(); Y=Fl::event_y(); xx = x()+dx; yy = y()+dy; ww = x()+w()-(dx*2); hh = y()+h()-(dy*2); if(hscrollbar.visible()){ hh -= hscrollbar.h(); } if(scrollbar.visible()){ ww -= scrollbar.w(); } if(X >= xx && Y >= yy && X < ww && Y < hh){ void *item = NULL; if((item = find_item(Fl::event_y())) != NULL){ // FIXME : Do we need calling callbacks or not ? Fl_Browser_::select(item, !item_selected(item), 1); return 0; } } } break; } default: break; } return Fl_Browser::handle(e); } }; [/CODE]
-- The best regards. | |
[ Return to Bugs & Features | Post Text | Post File ]
|
| |