Home

Add

Edit

Without Linenumbers

Code in Textfield

Download

  1. #INCLUDE "wx-c 0.9.2/wx.bi"
    
  2. 
    
  3. Declare Function App_OnInit WXCALL ( ) As wxBool
    
  4. Declare Function App_OnExit WXCALL ( ) As wxInt
    
  5. 
    
  6. Declare Sub textctrl0_event WXCALL ( Byval event As wxEvent Ptr, Byval iListener As wxInt )
    
  7. Declare Sub button0_event WXCALL ( Byval event As wxEvent Ptr, Byval iListener As wxInt )
    
  8. Declare Sub button1_event WXCALL ( Byval event As wxEvent Ptr, Byval iListener As wxInt )
    
  9. 
    
  10. Dim Shared As wxApp Ptr wx_app
    
  11. Dim Shared As wxFrame Ptr wx_frame
    
  12. Dim Shared As wxPanel Ptr wx_panel
    
  13. Dim Shared As wxTextCtrl Ptr textctrl0
    
  14. Dim Shared As Integer Vara
    
  15. Function App_OnInit WXCALL ( ) As wxBool
    
  16.     
    
  17.     wx_frame = wxFrame_ctor( )
    
  18.     wxFrame_Create( wx_frame, WX_NULL, -1, wxString_ctorUTF8("Zahlenraten"), 309, 153, 400, 116, wxFRAME_DEFAULT_STYLE Or wxCLOSE_BOX Xor wxMAXIMIZE_BOX Xor wxRESIZE_BORDER, WX_NULL )
    
  19.     wx_panel = wxPanel_ctor2( wx_frame, -1, -1, -1, -1, -1, 0, WX_NULL )
    
  20.     
    
  21.     ''
    
  22.     '' create widget textctrl0
    
  23.     ''
    
  24.     textctrl0 = wxTextCtrl_ctor( )
    
  25.     wxTextCtrl_Create( textctrl0, wx_panel, -1, wxString_ctorUTF8("0"), 80, 20, 280, 21, 0, 0, 0 )
    
  26.     
    
  27.     wxEvtHandler_Proxy( textctrl0, Cast(EventListener, @textctrl0_event) )
    
  28.     wxEvtHandler_Connect( textctrl0, wxEvent_EVT_COMMAND_TEXT_ENTER( ), -1, -1, 0 )
    
  29.     
    
  30.     ''
    
  31.     '' create widget button0
    
  32.     ''
    
  33.     Dim As wxButton Ptr button0
    
  34.     button0 = wxButton_ctor( )
    
  35.     wxButton_Create( button0, wx_panel, -1, wxString_ctorUTF8("Raten!"), 250, 50, 100, 24, 0, 0, 0 )
    
  36.     
    
  37.     wxEvtHandler_Proxy( button0, Cast(EventListener, @button0_event) )
    
  38.     wxEvtHandler_Connect( button0, wxEvent_EVT_COMMAND_BUTTON_CLICKED( ), -1, -1, 0 )
    
  39.     
    
  40.     ''
    
  41.     '' create widget button1
    
  42.     ''
    
  43.     Dim As wxButton Ptr button1
    
  44.     button1 = wxButton_ctor( )
    
  45.     wxButton_Create( button1, wx_panel, -1, wxString_ctorUTF8("Beenden"), 110, 50, -1, 24, 0, 0, 0 )
    
  46.     
    
  47.     wxEvtHandler_Proxy( button1, Cast(EventListener, @button1_event) )
    
  48.     wxEvtHandler_Connect( button1, wxEvent_EVT_COMMAND_BUTTON_CLICKED( ), -1, -1, 0 )
    
  49.     
    
  50.     wxWindow_Show( wx_frame, 1 )
    
  51.     wxApp_OnInit( wx_app )
    
  52.     Return 1
    
  53.     
    
  54. End Function
    
  55. 
    
  56. Function App_OnExit WXCALL ( ) As wxInt
    
  57.     
    
  58.     Return wxApp_OnExit( wx_app )
    
  59.     
    
  60. End Function
    
  61. 
    
  62. Sub textctrl0_event WXCALL ( Byval event As wxEvent Ptr, Byval iListener As wxInt )
    
  63.     Select Case wxEvent_GetEventType( event )
    
  64.         Case wxEvent_EVT_COMMAND_TEXT_ENTER
    
  65.             ''stuff
    
  66.             Vara = wxTextCtrl_GetValue(textctrl0)
    
  67.     End Select
    
  68.     
    
  69. End Sub
    
  70. 
    
  71. Sub button0_event WXCALL ( Byval event As wxEvent Ptr, Byval iListener As wxInt )
    
  72.     
    
  73.     Select Case wxEvent_GetEventType( event )
    
  74.         Case wxEvent_EVT_COMMAND_BUTTON_CLICKED
    
  75.             ''stuff
    
  76.             If Vara = 0 Then 
    
  77.                 Print "TREU!"
    
  78.             Else
    
  79.                 Print "UNTREU!"
    
  80.             Endif
    
  81.     End Select
    
  82.     
    
  83. End Sub
    
  84. 
    
  85. Sub button1_event WXCALL ( Byval event As wxEvent Ptr, Byval iListener As wxInt )
    
  86.     
    
  87.     Select Case wxEvent_GetEventType( event )
    
  88.         Case wxEvent_EVT_COMMAND_BUTTON_CLICKED
    
  89.             ''stuff
    
  90.             End
    
  91.     End Select
    
  92.     
    
  93. End Sub
    
  94. 
    
  95. 
    
  96. ''main
    
  97. wx_app = wxApp_ctor( )
    
  98. wxApp_RegisterVirtual ( wx_app, @App_OnInit, @App_OnExit )
    
  99. wxApp_Run(0, 0)