Changes between Version 2 and Version 3 of WxWidgetsPort
- Timestamp:
- 10/29/09 12:33:01 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WxWidgetsPort
v2 v3 190 190 Similarly with properties and fields 191 191 {{{ 192 TextCtrl = TextCtrl(this, ... -> .textCtrl = TextCtrl(this, ...192 TextCtrl = new TextCtrl(this, ... -> .textCtrl = TextCtrl(this, ... 193 193 MenuBar = menuBar -> .menuBar = menuBar 194 194 Log.SetActiveTarget( textCtrl ) -> Log.setActiveTarget(.textCtrl) # static class … … 278 278 15. Adding eventHandlers 279 279 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]] 281 281 Otherwise normal cobra mapping for method names and reference to methods (vs method calls)apply;[[br]] 282 282 Methodnames in Cobra must start with a lower case letter and calls to this instance names … … 288 288 so 289 289 {{{ 290 EVENT += EventListener( MethodName ) in C# becomes290 EVENT += new EventListener( MethodName ) in C# becomes 291 291 listen .EVENT, EventListener( ref .methodName ) 292 292 293 EVENT += EventListener( EH_METHOD_NAME ) in C# becomes293 EVENT += new EventListener( EH_METHOD_NAME ) in C# becomes 294 294 listen .EVENT, EventListener( ref .eh_METHOD_NAME ) 295 295 }}} 296 296 e.g. 297 297 {{{ 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 ) 301 301 -> 302 302 listen .columnClick, EventListener(ref .onColumnClick) … … 308 308 {{{EVT_MENU((int)MENU_ENUM_VALUE, new EventListener(MethodName)); }}} 309 309 the equivalent in cobra becomes 310 {{{.evt_MENU(MENU_ENUM_VALUE to int, newEventListener(ref .methodName))}}}310 {{{.evt_MENU(MENU_ENUM_VALUE to int, EventListener(ref .methodName))}}} 311 311 312 312 e.g. … … 331 331 static public void main() 332 332 }}} 333 ->333 to 334 334 {{{ 335 335 def main is shared has STAThread