Wiki

Changes between Version 2 and Version 3 of WxWidgetsPort

Show
Ignore:
Timestamp:
10/29/09 12:33:01 (15 years ago)
Author:
hopscc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WxWidgetsPort

    v2 v3  
    190190    Similarly with properties and fields 
    191191{{{ 
    192     TextCtrl = TextCtrl(this, ...   ->  .textCtrl = TextCtrl(this, ... 
     192    TextCtrl = new TextCtrl(this, ...   ->      .textCtrl = TextCtrl(this, ... 
    193193    MenuBar = menuBar               ->  .menuBar = menuBar 
    194194    Log.SetActiveTarget( textCtrl ) ->  Log.setActiveTarget(.textCtrl) # static class 
     
    27827815. Adding eventHandlers 
    279279    Cobra uses the '''listen''' statement to register event handlers where C# uses an override on  
    280     the += operator.  !WxWidgets wraps method calls in an !EventHandler class instance.[[br]] 
     280    the += operator.  !WxWidgets wraps method calls in an !EventHandler delegate class instance.[[br]] 
    281281    Otherwise normal cobra mapping for method names and reference to methods (vs method calls)apply;[[br]] 
    282282    Methodnames in Cobra must start with a lower case letter and calls to this instance names  
     
    288288    so  
    289289    {{{ 
    290     EVENT += EventListener( MethodName ) in C# becomes 
     290    EVENT += new EventListener( MethodName ) in C# becomes 
    291291    listen .EVENT,      EventListener( ref .methodName )  
    292292 
    293     EVENT += EventListener( EH_METHOD_NAME ) in C# becomes 
     293    EVENT += new EventListener( EH_METHOD_NAME ) in C# becomes 
    294294    listen .EVENT,      EventListener( ref .eh_METHOD_NAME )  
    295295    }}} 
    296296    e.g. 
    297297    {{{ 
    298     ColumnClick += EventListener( OnColumnClick ) 
    299     ItemSelect  +=  EventListener( OnItemSelect ) 
    300     ColumnRightClick +=  EventListener( OnColumnRightClick ) 
     298    ColumnClick += new EventListener( OnColumnClick ) 
     299    ItemSelect  +=  new EventListener( OnItemSelect ) 
     300    ColumnRightClick +=  new EventListener( OnColumnRightClick ) 
    301301        -> 
    302302    listen .columnClick,    EventListener(ref .onColumnClick)  
     
    308308        {{{EVT_MENU((int)MENU_ENUM_VALUE, new EventListener(MethodName)); }}} 
    309309    the equivalent in cobra becomes 
    310         {{{.evt_MENU(MENU_ENUM_VALUE to int,    new EventListener(ref .methodName))}}} 
     310        {{{.evt_MENU(MENU_ENUM_VALUE to int, EventListener(ref .methodName))}}} 
    311311                 
    312312    e.g.     
     
    331331static public void main() 
    332332    }}} 
    333     -> 
     333    to 
    334334    {{{ 
    335335def main is shared has STAThread