#Include "wx-c 0.9.2/wx.bi"

Declare Function App_OnInit WXCALL ( ) As wxBool
Declare Function App_OnExit WXCALL ( ) As wxInt

Declare Sub button0_event WXCALL ( ByVal event As wxEvent Ptr, ByVal iListener As Long )
Declare Sub button1_event WXCALL ( ByVal event As wxEvent Ptr, ByVal iListener As Long )
Declare Sub button2_event WXCALL ( ByVal event As wxEvent Ptr, ByVal iListener As Long )
Declare Sub button3_event WXCALL ( ByVal event As wxEvent Ptr, ByVal iListener As Long )

Dim Shared As wxApp Ptr wx_app
Dim Shared As wxFrame Ptr wx_frame
Dim Shared As wxPanel Ptr wx_panel

Function App_OnInit WXCALL ( ) As wxBool
    
    wxImage_InitAllHandlers( )
    
    wx_frame = wxFrame_ctor( )
    wxFrame_Create( wx_frame, WX_NULL, -1, wxString_ctorUTF8("ChgGateway"), 483, 184, 266, 275, wxFRAME_DEFAULT_STYLE Or wxCLOSE_BOX Xor wxMAXIMIZE_BOX Xor wxRESIZE_BORDER, WX_NULL )
    wx_panel = wxPanel_ctor2( wx_frame, -1, -1, -1, -1, -1, 0, WX_NULL )
    
    '' Application Icon
    Dim As wxIcon Ptr appIcon
    Dim As wxBitmap Ptr iconImage
    appIcon = wxIcon_ctor( )
    iconImage = wxBitmap_ctor( )
    wxBitmap_LoadFile( iconImage, wxString_ctorUTF8("media/icon.ico"), wxBITMAP_TYPE_ICO )
    wxIcon_CopyFromBitmap( appIcon, iconImage )
    wxFrame_SetIcon( wx_frame, appIcon )
    
    ''
    '' create widget stattext0
    ''
    Dim As wxStaticText Ptr stattext0
    stattext0 = wxStaticText_ctor( )
    wxStaticText_Create( stattext0, wx_panel, -1, wxString_ctorUTF8("ChgGateway"), 10, 10, -1, -1, 0, 0 )
    
    Dim As wxFont Ptr font = wxFont_ctorDef( )
    wxFont_SetPointSize( font, 20 )
    wxWindow_SetFont( stattext0, font )
    
    Dim As wxColour Ptr col = wxColour_ctor( )
    wxColour_Set( col, 0, 0, 255, 0 )
    wxWindow_SetForegroundColour( stattext0, col )
    
    ''
    '' create widget stattext1
    ''
    Dim As wxStaticText Ptr stattext1
    stattext1 = wxStaticText_ctor( )
    wxStaticText_Create( stattext1, wx_panel, -1, wxString_ctorUTF8("für LAN-Verbindungen"), 10, 55, -1, -1, 0, 0 )
    
    
    ''
    '' create widget stattext2
    ''
    Dim As wxStaticText Ptr stattext2
    stattext2 = wxStaticText_ctor( )
    wxStaticText_Create( stattext2, wx_panel, -1, wxString_ctorUTF8("Host"), 10, 80, -1, -1, 0, 0 )
    
    
    ''
    '' create widget stattext3
    ''
    Dim As wxStaticText Ptr stattext3
    stattext3 = wxStaticText_ctor( )
    wxStaticText_Create( stattext3, wx_panel, -1, wxString_ctorUTF8("Gateway"), 10, 110, -1, -1, 0, 0 )
    
    
    ''
    '' create widget stattext4
    ''
    Dim As wxStaticText Ptr stattext4
    stattext4 = wxStaticText_ctor( )
    wxStaticText_Create( stattext4, wx_panel, -1, wxString_ctorUTF8("DNS-Server"), 10, 140, -1, -1, 0, 0 )
    
    
    ''
    '' create widget stattext5
    ''
    Dim As wxStaticText Ptr stattext5
    stattext5 = wxStaticText_ctor( )
    wxStaticText_Create( stattext5, wx_panel, -1, wxString_ctorUTF8("WINS-Server"), 10, 170, -1, -1, 0, 0 )
    
    wxWindow_Enable( stattext5, WX_FALSE )
    
    
    ''
    '' create widget stattext6
    ''
    Dim As wxStaticText Ptr stattext6
    stattext6 = wxStaticText_ctor( )
    wxStaticText_Create( stattext6, wx_panel, -1, wxString_ctorUTF8("xxx.xxx.xxx.xxx"), 100, 80, -1, -1, 0, 0 )
    
    
    ''
    '' create widget stattext7
    ''
    Dim As wxStaticText Ptr stattext7
    stattext7 = wxStaticText_ctor( )
    wxStaticText_Create( stattext7, wx_panel, -1, wxString_ctorUTF8("xxx.xxx.xxx.xxx"), 100, 110, -1, -1, 0, 0 )
    
    
    ''
    '' create widget staticbox0
    ''
    Dim As wxStaticBox Ptr staticbox0
    staticbox0 = wxStaticBox_ctor( )
    wxStaticBox_Create( staticbox0, wx_panel, -1, wxString_ctorUTF8("Status"), 200, 10, 50, 50, 0, 0 )
    
    
    ''
    '' create widget image0
    ''
    Dim As wxBitmap Ptr picimage0, picimage0_1
    Dim As wxStaticBitmap Ptr image0
    
    picimage0 = wxBitmap_ctor( )
    picimage0_1 = wxBitmap_ctor( )
    image0 = wxStaticBitmap_ctor( )
    
    wxBitmap_LoadFile( picimage0, wxString_ctorUTF8("media/rot.bmp"), wxBITMAP_TYPE_BMP )
    wxBitmap_LoadFile( picimage0_1, wxString_ctorUTF8("media/gruen.bmp"), wxBITMAP_TYPE_BMP )
    wxStaticBitmap_Create( image0, wx_panel, -1, picimage0, 210, 26, -1, -1, 0, 0 )
    'wxStaticBitmap_SetBitmap( image0, picimage0_1 )
    
    
    ''
    '' create widget radio0
    ''
    Dim As wxArrayString Ptr radio0_str
    radio0_str = wxArrayString_ctor( )
    wxArrayString_Add( radio0_str, wxString_ctorUTF8( "getrennt" ) )
    wxArrayString_Add( radio0_str, wxString_ctorUTF8( "verbunden" ) )
    Dim As wxRadioBox Ptr radio0
    radio0 = wxRadiobox_ctor( )
    wxRadiobox_Create( radio0, wx_panel, -1, wxString_ctorUTF8("Status setzen"), wxPoint_ctor(10, 200), wxSize_ctor(160, 40), radio0_str, 0, wxHORIZONTAL, 0, 0 )
    wxRadiobox_SetSelection( radio0, 0 )
    
    
    ''
    '' create widget button0
    ''
    Dim As wxButton Ptr button0
    button0 = wxButton_ctor( )
    wxButton_Create( button0, wx_panel, -1, wxString_ctorUTF8("Ping"), 210, 105, 40, 24, 0, 0, 0 )
    
    wxEvtHandler_Proxy( button0, Cast(EventListener, @button0_event) )
    wxEvtHandler_Connect( button0, wxEvent_EVT_COMMAND_BUTTON_CLICKED( ), -1, -1, 0 )
    
    ''
    '' create widget button1
    ''
    Dim As wxButton Ptr button1
    button1 = wxButton_ctor( )
    wxButton_Create( button1, wx_panel, -1, wxString_ctorUTF8("Ping"), 210, 135, 40, 24, 0, 0, 0 )
    
    wxEvtHandler_Proxy( button1, Cast(EventListener, @button1_event) )
    wxEvtHandler_Connect( button1, wxEvent_EVT_COMMAND_BUTTON_CLICKED( ), -1, -1, 0 )
    
    ''
    '' create widget button2
    ''
    Dim As wxButton Ptr button2
    button2 = wxButton_ctor( )
    wxButton_Create( button2, wx_panel, -1, wxString_ctorUTF8("Ping"), 210, 165, 40, 24, 0, 0, 0 )
    
    wxEvtHandler_Proxy( button2, Cast(EventListener, @button2_event) )
    wxEvtHandler_Connect( button2, wxEvent_EVT_COMMAND_BUTTON_CLICKED( ), -1, -1, 0 )
    
    wxWindow_Enable( button2, WX_FALSE )
    
    ''
    '' create widget choice0
    ''
    Dim As wxArrayString Ptr choice0_str
    choice0_str = wxArrayString_ctor( )
    wxArrayString_Add( choice0_str, wxString_ctorUTF8( "" ) )
    Dim As wxChoice Ptr choice0
    choice0 = wxChoice_ctor( )
    wxChoice_Create( choice0, wx_panel, -1, 100, 135, 95, 20, choice0_str, 0, 0, 0 )
    wxChoice_SetColumns( choice0, 0 )
    
    
    ''
    '' create widget choice1
    ''
    Dim As wxArrayString Ptr choice1_str
    choice1_str = wxArrayString_ctor( )
    wxArrayString_Add( choice1_str, wxString_ctorUTF8( "" ) )
    Dim As wxChoice Ptr choice1
    choice1 = wxChoice_ctor( )
    wxChoice_Create( choice1, wx_panel, -1, 100, 165, 95, 20, choice1_str, 0, 0, 0 )
    wxChoice_SetColumns( choice1, 0 )
    
    wxWindow_Enable( choice1, WX_FALSE )
    
    ''
    '' create widget button3
    ''
    Dim As wxButton Ptr button3
    button3 = wxButton_ctor( )
    wxButton_Create( button3, wx_panel, -1, wxString_ctorUTF8("Quit"), 175, 205, 75, 35, 0, 0, 0 )
    
    wxEvtHandler_Proxy( button3, Cast(EventListener, @button3_event) )
    wxEvtHandler_Connect( button3, wxEvent_EVT_COMMAND_BUTTON_CLICKED( ), -1, -1, 0 )
    
    wxWindow_Show( wx_frame, 1 )
    
    'Hier einen Thread starten, der den Rest macht
    
    wxApp_OnInit( wx_app )
    Return 1
    
End Function

Function App_OnExit WXCALL ( ) As wxInt
    
    Return wxApp_OnExit( wx_app )
    
End Function

Sub button0_event WXCALL ( ByVal event As wxEvent Ptr, ByVal iListener As Long )
    
    Select Case wxEvent_GetEventType( event )
        Case wxEvent_EVT_COMMAND_BUTTON_CLICKED
            ''stuff
    End Select
    
End Sub

Sub button1_event WXCALL ( ByVal event As wxEvent Ptr, ByVal iListener As Long )
    
    Select Case wxEvent_GetEventType( event )
        Case wxEvent_EVT_COMMAND_BUTTON_CLICKED
            ''stuff
    End Select
    
End Sub

Sub button2_event WXCALL ( ByVal event As wxEvent Ptr, ByVal iListener As Long )
    
    Select Case wxEvent_GetEventType( event )
        Case wxEvent_EVT_COMMAND_BUTTON_CLICKED
            ''stuff
    End Select
    
End Sub

Sub button3_event WXCALL ( ByVal event As wxEvent Ptr, ByVal iListener As Long )
    
    Select Case wxEvent_GetEventType( event )
        Case wxEvent_EVT_COMMAND_BUTTON_CLICKED
            ''stuff
            End
    End Select
    
End Sub


''main
wx_app = wxApp_ctor( )
wxApp_RegisterVirtual ( wx_app, @App_OnInit, @App_OnExit )
wxApp_Run(0, 0)
