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

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

Declare Sub menuhandler WXCALL ( ByVal event As wxEvent Ptr, ByVal iListener As wxInt )

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
	
	wx_frame = wxFrame_ctor( )
	wxFrame_Create( wx_frame, WX_NULL, -1, wxString_ctorUTF8("BigTest"), 440, 312, 267, 221, 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 )
	
	''
	'' create widget button0
	''
	Dim As wxButton Ptr button0
	button0 = wxButton_ctor( )
	wxButton_Create( button0, wx_panel, -1, wxString_ctorUTF8("button0"), 30, 30, -1, 24, 0, 0, 0 )
	
	
	''
	'' create widget button1
	''
	Dim As wxButton Ptr button1
	button1 = wxButton_ctor( )
	wxButton_Create( button1, wx_panel, -1, wxString_ctorUTF8("button1"), 30, 80, -1, 24, 0, 0, 0 )
	
	
	
	'' create menus
	Dim As wxMenuBar Ptr wx_menubar
	wx_menubar = wxMenuBar_ctor( )
	
	
	'' menu "&Menu 0"
	Dim As wxMenu Ptr wx_menu0
	wx_menu0 = wxMenu_ctor( wxString_ctorUTF8(""), 0 )
	wxMenuBase_Append( wx_menu0, 1, wxString_ctorUTF8("item0"), wxString_ctorUTF8("item0"), 0 )
	wxMenuBase_Append( wx_menu0, 2, wxString_ctorUTF8("item1"), wxString_ctorUTF8("item1"), 0 )
	wxMenuBar_Append( wx_menubar, wx_menu0, wxString_ctorUTF8("&Menu 0") )
	
	'' menu "&Menu 1"
	Dim As wxMenu Ptr wx_menu1
	wx_menu1 = wxMenu_ctor( wxString_ctorUTF8(""), 0 )
	wxMenuBase_AppendCheckItem( wx_menu1, 3, wxString_ctorUTF8("checkitem0"), wxString_ctorUTF8("checkitem0") )
		
		'' menu "submenuitem1"
		Dim As wxMenu Ptr wx_menu2
		wx_menu2 = wxMenu_ctor( wxString_ctorUTF8(""), 0 )
		wxMenuBase_AppendRadioItem( wx_menu2, 4, wxString_ctorUTF8("radioitem0"), wxString_ctorUTF8("radioitem0") )
		wxMenuBase_AppendRadioItem( wx_menu2, 5, wxString_ctorUTF8("radioitem1"), wxString_ctorUTF8("radioitem1") )
	
	wxMenuBase_AppendSubMenu( wx_menu1, 6, wxString_ctorUTF8("submenuitem1"), wx_menu2, wxString_ctorUTF8("submenuitem1") )
	wxMenuBar_Append( wx_menubar, wx_menu1, wxString_ctorUTF8("&Menu 1") )
	wxFrame_SetMenuBar(wx_frame, wx_menubar)
	
	
	
	wxFrame_CreateToolbar( wx_frame, wxHORIZONTAL Or wxTB_TEXT Or wxTB_FLAT, -1, 0 )
	wxToolBar_AddTool2( wxFrame_GetToolbar( wx_frame ), 7, _
						wxString_ctorUTF8(""), _
						wxBitmap_ctorByName( wxString_ctorUTF8("C:\Dokumente und Einstellungen\David\Desktop\wxC Designer\close.bmp"), wxBITMAP_TYPE_BMP ), _
						wxString_ctorUTF8(""), _
						0 )
	wxToolBar_AddSeparator( wxFrame_GetToolBar( wx_frame ) )
	wxToolBar_AddTool2( wxFrame_GetToolbar( wx_frame ), 8, _
						wxString_ctorUTF8(""), _
						wxBitmap_ctorByName( wxString_ctorUTF8("C:\Dokumente und Einstellungen\David\Desktop\wxC Designer\close.bmp"), wxBITMAP_TYPE_BMP ), _
						wxString_ctorUTF8(""), _
						0 )
	wxToolBar_Realize( wxFrame_GetToolbar( wx_frame ) )
	
	wxEvtHandler_Proxy( wx_frame, Cast(EventListener, @menuhandler) )
	wxEvtHandler_Connect( wx_frame, wxEvent_EVT_COMMAND_MENU_SELECTED( ), -1, -1, 0 )
	
	
	wxWindow_Show( wx_frame, 1 )
	wxApp_OnInit( wx_app )
	Return 1
	
End Function

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

Sub menuhandler WXCALL ( ByVal event As wxEvent Ptr, ByVal iListener As wxInt )
	
	Select Case wxEvent_GetId( event )
		Case 1
			'' stuff for selecting item item0 from menu &Menu 0 goes here
			
		Case 2
			'' stuff for selecting item item1 from menu &Menu 0 goes here
			
		Case 3
			'' stuff for selecting check item checkitem0 from menu &Menu 1 goes here
			
		Case 4
			'' stuff for selecting radio item radioitem0 from menu submenuitem1 goes here
			
		Case 5
			'' stuff for selecting radio item radioitem1 from menu submenuitem1 goes here
			
		Case 7
			'' stuff for toolbar button #1
			
		Case 8
			'' stuff for toolbar button #3
			
	End Select
	
End Sub


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