Code: Select all
'================================================
'Code generated by RC2CODE - RC To Code Generator
'Very first stage project, use at your own risk
'Contact Loe at webhasta[at]telkom.net
'================================================
#include once "wx-c/wx.bi"
'#include once "C:\FbEdit\Projects\wxresize\wxresize.bi" 'exported names of resource file
'=========================================================================
'Defined constant in .rc file.
'=========================================================================
type trect
as integer x,y,w,h
end type
type tpoint
as integer x,y
end type
#define wxCLOSE_BOX &h1000
#define IDD_DLG1 1000
#define IDC_EDT1 1001
#define IDC_BTN1 1002
#define IDC_CBO1 1003
'=========================================================================
'Include file of control
'=========================================================================
'=========================================================================
'Global variable
'=========================================================================
dim shared app as wxApp ptr
dim shared as wxDialog ptr IDD_DLG1ptr
'========================================================================
'Dialog callback procedure declaration
'=========================================================================
declare Function IDD_DLG1_Init(byval parent as uinteger) as integer
declare function IDD_DLG1_OnExit() as integer
declare sub IDD_DLG1_IDC_CBO1_Sample(Byval CTLIDptr as wxCombobox ptr)
declare Sub IDD_DLG1_OnSize(byval event as wxEvent ptr, byval iListener as integer)
declare sub IDD_DLG1_IDC_BTN1_Clicked(byval event as wxEvent ptr, byval iListener as integer)
declare SUB IDD_DLG1_IDC_CBO1_Selected(byval event as wxEvent ptr, byval iListener as integer)
sub IDD_DLG1_IDC_CBO1_Sample(Byval CTLIDptr as wxCombobox ptr)
wxCombobox_append(CTLIDptr,strptr("row 0"))
wxCombobox_append(CTLIDptr,strptr("row 1"))
wxCombobox_append(CTLIDptr,strptr("row 2"))
wxCombobox_append(CTLIDptr,strptr("row 3"))
end sub
Sub IDD_DLG1_OnSize(byval event as wxEvent ptr, byval iListener as integer)
Dim sz As trect
dim as wxWindow ptr wxw
wxw=wxEvent_GetEventObject(event)
wxWindow_GetClientRect(wxw,@sz)
wxWindow_SetSize(wxWindow_FindWindowId(wxw,IDC_EDT1), sz.x,sz.y,sz.w,sz.h-20,1)
wxWindow_SetSize(wxWindow_FindWindowId(wxw,IDC_BTN1), sz.x,sz.y+sz.h-20,sz.w\2,20,1)
wxWindow_SetSize(wxWindow_FindWindowId(wxw,IDC_CBO1), sz.x+sz.w\2,sz.y+sz.h-20,sz.w\2,20,1)
end sub
sub IDD_DLG1_IDC_BTN1_Clicked(byval event as wxEvent ptr, byval iListener as integer)
wxMsgBox( 0,"IDC_BTN1_Clicked","Event",0,wxSize(-1,-1))
end sub
SUB IDD_DLG1_IDC_CBO1_Selected(byval event as wxEvent ptr, byval iListener as integer)
dim wxCb as wxCombobox ptr
wxCb=wxEvent_GetEventObject(event)
wxMsgBox( 0,"IDC_CBO1_Selected " & *wxString_mb_str(wxComboBox_GetStringSelection(wxcb)),"Event",0,wxSize(-1,-1))
end Sub
'=========================================================================
'Initial code of control
'=========================================================================
app = wxApp( )
wxApp_RegisterVirtual( app, @IDD_DLG1_init, @IDD_DLG1_OnExit)
wxApp_Run(0,0)
end 0
'=========================================================================
'Dialog callback procedure
'=========================================================================
Function IDD_DLG1_Init(byval parent as uinteger) as integer
dim as wxFrame ptr IDD_DLG1_FramePtr = wxFrame( )
wxFrame_Create(IDD_DLG1_FramePtr,0,-1,"IDD_DLG",wxSize(15,16),wxSize(233,190),wxRESIZE_BORDER or wxCAPTION or wxSYSTEM_MENU or wxClose_Box,"frame")
IDD_DLG1ptr = wxPanel( )
wxPanel_Create(IDD_DLG1ptr,IDD_DLG1_FramePtr,IDD_DLG1,0,0,0,0)
wxEvtHandler_proxy(IDD_DLG1ptr, @IDD_DLG1_OnSize)
wxEvtHandler_connect(IDD_DLG1ptr, wxEvent_EVT_SIZE( ),IDD_DLG1,-1,0)
/'rem above code for child dialog, and open following rem'/
'IDD_DLG1ptr = wxDialog()
'wxDialog_Create(IDD_DLG1ptr,parent,IDD_DLG1,"IDD_DLG",wxSize(15,16),wxSize(233,190),wxRESIZE_BORDER or wxCAPTION or wxSYSTEM_MENU or wxClose_Box,"")
dim as wxTextCtrl ptr IDC_EDT1ptr=wxTextCtrl()
wxTextCtrl_Create(IDC_EDT1ptr,IDD_DLG1ptr,IDC_EDT1,"",wxSize(0,0),wxSize(225,137),0 or 0,0,0)
dim as wxButton ptr IDC_BTN1ptr = wxButton( )
wxButton_Create(IDC_BTN1ptr,IDD_DLG1ptr,IDC_BTN1,"IDC_BTN",wxsize(0,141),wxsize(104,20),0 or 0,0,0)
'connect the button to the button event handler sub
wxEvtHandler_proxy(IDC_BTN1ptr, @IDD_DLG1_IDC_BTN1_Clicked)
wxEvtHandler_connect(IDC_BTN1ptr, wxEvent_EVT_COMMAND_BUTTON_CLICKED( ),IDC_BTN1,-1,0)
dim as wxCombobox ptr IDC_CBO1ptr=wxCombobox()
wxCombobox_Create(IDC_CBO1ptr,IDD_DLG1ptr,IDC_CBO1,"",wxSize(108,141),wxSize(117,24),0,0,wxCB_DROPDOWN,0,0)
IDD_DLG1_IDC_CBO1_Sample(IDC_CBO1ptr)
'connect the combobox to the combobox event handler sub
wxEvtHandler_proxy(IDC_CBO1ptr, @IDD_DLG1_IDC_CBO1_Selected)
wxEvtHandler_connect(IDC_CBO1ptr, wxEvent_EVT_COMMAND_COMBOBOX_SELECTED(),IDC_CBO1,-1,0)
'wxWindow_CenterOnScreen(IDD_DLG1Ptr, wxBOTH )
/'rem below code for child dialog, and open above rem'/
wxWindow_CenterOnScreen(IDD_DLG1_FramePtr, wxBOTH )
wxWindow_Show(IDD_DLG1_FramePtr, 1 )
function = wxApp_OnInit(app)
End Function
function IDD_DLG1_OnExit() as integer
function = wxApp_OnExit(app)
end function
because some hardware installation problem, not with FB nor wx reason.