Ticket #86 (closed features: wontfix)

Opened 3 years ago

Last modified 14 months ago

Fl_Text_Display. handle events

Reported by: nobody Owned by: nobody
Priority: lowest Milestone:
Component: efltk Version: 2.0.6
Keywords: Cc:

Description (last modified by karijes) (diff)

one suggestion on Fl_Text_Display. add_modify_callback
sometimes is not enough
to control widget events. and i use small
Fl_Text_Display extension. may be it
would be useful in main efltk widget. here is

#ifndef __MY_TEXT_DISPLAY_H
#define __MY_TEXT_DISPLAY_H

#include <efltk/Fl.h>
#include <efltk/Fl_Text_Display.h>
#include <efltk/Fl_Text_Buffer.h>

struct cb_data
{   
    Fl_Callback *fun;   
    void *data; 
    cb_data():fun(NULL),data(NULL) {}
};

class My_Text_Display: public Fl_Text_Display
{
protected:
    virtual int handle(int event);
    cb_data cb_store[24];
public:
    My_Text_Display(int x, int y, int w, int h, const
char *t = NULL):Fl_Text_Display(x,y,w,h,t) {}	
    My_Text_Display(const char* l = NULL,int
layout_size=30,Fl_Align layout_al,int
label_w=-1):Fl_Text_Display(l,layout_size,layout_al,label_w)
{}
    ~My_Text_Display() {}
	
    int register_event(int event, Fl_Callback *, void
*data = NULL);
};

int My_Text_Display::handle(int event)
{
    int rc = Fl_Text_Display::handle(event);
    Fl_Callback *fun = cb_store[event].fun;
    if(!fun) return rc;
    fun((Fl_Widget *)this, cb_store[event].data);
    return 1;
}

int My_Text_Display::register_event(int event,
Fl_Callback *fun, void *data)
{
    if(event < 0 || event > 22) return 1;
    cb_store[event].fun = fun;
    cb_store[event].data = data;	
    return 0;
}

#endif

Change History

Changed 3 years ago by vljubovic

Logged In: YES 
user_id=110776

Hello, 
Sorry, we will not implement new features into efltk. This is a dead 
end project and please don't use it. We are porting EDE to fltk2 
(www.fltk.org) which has everything we need. We will only accept 
patches that fix bugs visible in EDE applications. 

Changed 21 months ago by karijes

  • priority changed from 5 to lowest
  • version changed from None to 2.0.6
  • component changed from None to efltk
  • description modified (diff)
  • milestone set to 1.2

Changed 19 months ago by vljubovic

  • milestone deleted

Changed 14 months ago by karijes

  • status changed from assigned to closed
  • resolution changed from None to wontfix
Note: See TracTickets for help on using tickets.