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

Re: Why my onTableReplaced is not called?

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View in Thread

On Thursday 25 June 2009, Feng Feng wrote:

> Hello Jeroen,
>
> >When acceptInput(true) is invoked via FXTable receiving ID_ACCEPT_INPUT from
> >the edit-control, it sends a SEL_REPLACED to its target.
> >It does NOT send a SEL_REPLACED to itself....
>
> If I change the acceptInput as follows:
>
> // Done with editing cell
> FXbool PlanPointTable::acceptInput(FXbool notify){
>     if(editor){
>         FXTableRange tablerange=input;
>         setItemFromControl(input.fm.row,input.fm.col,editor);
>         cancelInput();
>         if(notify && target){
>             //target->tryHandle(this,FXSEL(SEL_REPLACED,message),(void*)&tablerange);
>             tryHandle(this,FXSEL(SEL_REPLACED,0),(void*)¤t);  <========== modified!!!
>         }
>         return true;
>     }
>     return false;
> }
>
> Does this modification cause me problems in other places?

The target of FXTable is supposed to receive SEL_REPLACED, etc. messages.  

Its probably easier to simply overload acceptInput() and call the base class:


        FXbool PlanPointTable::acceptInput(FXbool notify){
  if(FXTable::acceptInput(notify)){
                        // do your thing
                        return true;
                }
                return false;
        }


Or something to that effect.  Self messages shouldn't be necessary very often, btw.



                - Jeroen

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

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