Code: Select all
#include once "fltk-c.bi"
' test of:
' Fl_Wizard http://www.fltk.org/doc-1.3/classFl__Wizard.html
sub WindowCB cdecl (self as Fl_Widget ptr, pUserdata as any ptr)
Fl_WindowHide Fl_WidgetAsWindow(self)
end sub
sub BackCB cdecl (self as Fl_Widget ptr, wiz as any ptr)
Fl_WizardPrev wiz
end sub
sub NextCB cdecl (self as Fl_Widget ptr, wiz as any ptr)
Fl_WizardNext wiz
end sub
sub DoneCB cdecl (self as Fl_Widget ptr, win as any ptr)
WindowCB win,0
end sub
'
' main
'
dim as Fl_Window ptr win = Fl_WindowNew(400,300,"Example Wizard")
dim as Fl_Wizard ptr wiz = Fl_WizardNew(0,0,400,300)
dim as Fl_Multiline_Output ptr mOut
dim as Fl_Group ptr grp
' Wizard: page 1
grp = Fl_GroupNew(0,0,400,300)
Fl_WidgetSetCallbackArg Fl_ButtonNew(290,265,100,25,"Next"),@NextCB,wiz
mOut = Fl_Multiline_OutputNew(10,30,380,220,"Welcome")
Fl_WidgetSetLabelSize mOut,20 : Fl_WidgetSetAlign mOut,FL_ALIGN_TOP or FL_ALIGN_LEFT
Fl_Input_SetValue mOut,"This is First page"
Fl_GroupEnd grp
' Wizard: page 2
grp = Fl_GroupNew(0,0,400,300)
Fl_WidgetSetCallbackArg Fl_ButtonNew(290,265,100,25,"Next"),@NextCB,wiz
Fl_WidgetSetCallbackArg Fl_ButtonNew(180,265,100,25,"Back"),@BackCB,wiz
mOut = Fl_Multiline_OutputNew(10,30,380,220,"Terms And Conditions")
Fl_WidgetSetLabelSize mOut,20 : Fl_WidgetSetAlign mOut,FL_ALIGN_TOP or FL_ALIGN_LEFT
Fl_Input_SetValue mOut,"This is the Second page"
Fl_GroupEnd grp
' Wizard: page 3
grp = Fl_GroupNew(0,0,400,300)
Fl_WidgetSetCallbackArg Fl_ButtonNew(290,265,100,25,"Finish"),@DoneCB,win
Fl_WidgetSetCallbackArg Fl_ButtonNew(180,265,100,25,"Back"),@BackCB,wiz
mOut = Fl_Multiline_OutputNew(10,30,380,220,"Finish")
Fl_WidgetSetLabelSize mOut,20 : Fl_WidgetSetAlign mOut,FL_ALIGN_TOP or FL_ALIGN_LEFT
Fl_Input_SetValue mOut,"This is the Last page"
Fl_GroupEnd grp
Fl_GroupEnd wiz
Fl_WindowEnd win
Fl_WidgetSetCallback win,@WindowCB
Fl_WindowShow win
Fl_Run