« Return to Thread: Why my onTableReplaced is not called?

Why my onTableReplaced is not called?

by Feng Feng :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hello all,

I have designed a subclass of FXTable as follows,

The problem is that the function onTableReplaced is never triggered after I enter some text in the table and then press enter.

Do you know why?

Thank you


class PointTable : public FXTable
{
    FXDECLARE(PointTable )
    ...
    long onKeyPress(FXObject*,FXSelector,void*);
    long onTableReplaced(FXObject*,FXSelector,void*);
    ....
}


// Map
FXDEFMAP(PointTable ) PointTableMap[]={
    FXMAPFUNC(SEL_KEYPRESS,      0, PlanPointTable::onKeyPress),
    FXMAPFUNC(SEL_REPLACED,      0,PlanPointTable::onTableReplaced),

};

// Object implementation
FXIMPLEMENT(PointTable ,FXTable,PointTable Map,ARRAYNUMBER(PointTableMap))

// onKeyPress is triggered correctly.
long PlanPointTable::onKeyPress(FXObject *obj, FXSelector sel, void* ptr)
{
     if ( !isEditable() || current.col<0 || current.col >= ncols
         || current.row<0 || current.row >= nrows)
     {
         return 1;
     }
 
     if (current.col == 0 || current.col == 2)
     {
         return 1;
     }

    return FXTable::onKeyPress(obj, sel, ptr);
}

// Replaced
long PlanPointTable::onTableReplaced(FXObject*,FXSelector,void* ptr){
 
   //... NEVER get called after I enter some text and press ENTER
  
   
    return 1;      
  }



------------------------------------------------------------------------------

_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

 « Return to Thread: Why my onTableReplaced is not called?