For anyone that might need it here is a new Requester and a new control for iGlass. The control is a radio button it uses the same graphics as the checkbox.

You use
Function Create:IGL_RadioButton(Parent:Object,Caption:String,Px:Int,Py:Int,State:Byte)
to create one. Just like the check box. Use ClickGadget() to tell if the state has changed.
The new requester is used to give the user a list of options that are mutually exclusive using the IGL_RadioButton type.
Function IGL_ChoiceBox(Title:String,Caption:String,Choice:String[],selected:Int,Icon:Int=1)
Pass in an array of choices and the index of the item you want selected by default. It returns the index of the item that is currently selected when the user clicks the okay button.
The requester code, add this to the Inc_Requester.bmx file.
' ------------------
' Create choice box
' returns the index of the selected radio button
' ------------------
Function IGL_ChoiceBox(Title:String,Caption:String,Choice:String[],selected:Int,Icon:Int=1)
' ---------------------
' Define local variable
' ---------------------
Local Request_Window_Tx:Int
Local Selected_Choice:Int = selected
' ---------------------------------
' Check the window width and height
' ---------------------------------
If IGL_TestLabelWidth(Caption)<80 Then
Request_Window_Tx=220
Else
Request_Window_Tx=IGL_TestLabelWidth(Caption)+100
EndIf
For Local c:Int=0 Until Choice.length
If IGL_TestLabelWidth(Choice[c]) > Request_Window_Tx Then
Request_Window_Tx:Int=IGL_TestLabelWidth(Choice[c])
EndIf
Next
' --------------------
' Define requester var
' --------------------
Local Request_Window_Ty:Int=IGL_TestLabelHeight(Caption)+75'+100
For Local c:Int=0 Until Choice.length
Request_Window_Ty:+IGL_TestLabelHeight(Choice[c])+20
Next
Local Request_Window_Px:Int=(GraphicsWidth()/2)-(Request_Window_Tx/2)
Local Request_Window_Py:Int=(GraphicsHeight()/2)-(Request_Window_Ty/2)
Local Request_Win:IGL_Window
Local Request_Button_Ok:IGL_PushButton
Local Request_Choice:IGL_RadioButton[] = New IGL_RadioButton[Choice.length]
Local Request_Label_Message:IGL_Label
Local Request_ReturnMessage:Byte=False
Local Request_iconask_Message:IGL_Image
' --------------------------
' Build the requester window
' --------------------------
Request_Win=IGL_Window.Create(Title,Request_Window_Px,Request_Window_Py,Request_Window_Tx,Request_Window_Ty,False,True,False)
Request_Win.Sound_File=LoadSound(IGL_MessageAlertSound)
' ---------------------------------------
' Compute the button X size and build gui
' ---------------------------------------
Local Button_Tx:Int=(Request_Window_Tx/3)-10
Request_Button_Ok=IGL_PushButton.Create(Request_Win,"Ok",(Request_Window_Tx/2)-(Button_Tx/2),Request_Window_Ty-55,Button_Tx)
Request_Label_Message=IGL_Label.Create(Request_Win,Caption,(Request_Window_Tx/2),20,2,IGL_RequesterTextColor)
' --------------------------
' Build the options
' --------------------------
For Local c:Int=0 Until Choice.length
If c=0 Then
Request_Choice[c] = IGL_RadioButton.Create(Request_Win,Choice[c],52,IGL_TestLabelHeight(Caption)+20+Request_Label_Message.py,False)
Else
Request_Choice[c] = IGL_RadioButton.Create(Request_Win,Choice[c],52,IGL_TestLabelHeight(Caption)+20+Request_Choice[c-1].py,False)
EndIf
Next
Request_Choice[selected].state=True
' -----------------------
' Create message box icon
' -----------------------
Select Icon
Case 1
Request_iconask_Message=IGL_Image.Create(Request_Win,IGL_Icon_MessageBoxASK,10,(Request_Window_Ty/2)-42,32,32,False)
Case 2
Request_iconask_Message=IGL_Image.Create(Request_Win,IGL_Icon_MessageBoxALERT,10,(Request_Window_Ty/2)-42,32,32,False)
Case 3
Request_iconask_Message=IGL_Image.Create(Request_Win,IGL_Icon_MessageBoxWARNING,10,(Request_Window_Ty/2)-42,32,32,False)
End Select
' ---------------------------
' Block the window swap event
' ---------------------------
IGL_WindowCanSwap=False
' ------------------
' Deactivate synchro
' ------------------
SetSwapInterval(0)
' ---------
' Main Loop
' ---------
While Request_ReturnMessage=0
Cls
IGL_RefreshGui()
For Local c:Int=0 Until Choice.length
If Request_Choice[c].ClickGadget() Then
For Local i:Int=0 Until Choice.length
If i<>c Then
Request_Choice[i].state=False
Else
Request_Choice[i].state=True
Selected_Choice = i
EndIf
Next
Exit
EndIf
Next
' ---------------------
' Test requester button
' ---------------------
If Request_Button_Ok<>Null Then
If Request_Button_Ok.ClickGadget() Then
Request_ReturnMessage=Selected_Choice
EndIf
EndIf
Flip
FlushMem()
Wend
' ------------------------------------------------
' Close the window (and gadget) and return message
' ------------------------------------------------
Request_Win.KillWindow()
IGL_WindowCanSwap=True
Return Request_ReturnMessage
End Function
The radio button code, add this to the file called Inc_Checkbox.bmx
' --------------
' RadioButton class
' --------------
Type IGL_RadioButton Extends IGL_Widget
Field Image_Unselect:Int
Field Image_Select:Int
Field Clicked:Int = False
' ----------------------------
' Function : Create a RadioButton
' ----------------------------
Function Create:IGL_RadioButton(Parent:Object,Caption:String,Px:Int,Py:Int,State:Byte)
Local NewRadioButton:IGL_RadioButton
NewRadioButton=New IGL_RadioButton
NewRadioButton.ID=NewRadioButton
If Parent<>Null Then
NewRadioButton.Parent=Parent
Else
NewRadioButton.Parent=IGL_MasterWindow
EndIf
NewRadioButton.Sound_File=LoadSound(IGL_ButtonClickSound)
NewRadioButton.Px=Px
NewRadioButton.Py=Py
NewRadioButton.Tx=TextWidth(Caption)
NewRadioButton.Ty=16
NewRadioButton.State=State
NewRadioButton.Caption=Caption
NewRadioButton.Label=IGL_Label.Create(NewRadioButton.ID,NewRadioButton.Caption,17,((NewRadioButton.Ty/2)-(IGL_FontHeight/2))-1,1,IGL_ButtonLabelColor)
NewRadioButton.Image_Unselect=IGL_LoadBorderImage(IGL_Checkbox_Unselect,16,NewRadioButton.Ty,Null,Null,0)
NewRadioButton.Image_Select=IGL_LoadBorderImage(IGL_Checkbox_Select,16,NewRadioButton.Ty,Null,Null,0)
IGL_AddParent(NewRadioButton.Parent,NewRadioButton.ID)
Return NewRadioButton
End Function
' ---------------------------
' Method : Refresh a Checkbox
' ---------------------------
Method Refresh(WidGetID:IGL_Widget)
Local RadioButton_Px:Int=WidGetID.ChildPx+px
Local RadioButton_Py:Int=WidGetID.ChildPy+py
If Hide=False
' -----------------------------
' Test if the gadget is disable
' -----------------------------
SetBlend AlphaBlend
If Disable=True Then
SetAlpha Alpha/2.5
Else
SetAlpha Alpha
EndIf
' -------------
' Refresh Label
' -------------
Label.Caption=Caption
SetImageFont IGL_DefaultFont
Tx=TextWidth(Caption)
' ----------------------------
' If the parent is not disable
' ----------------------------
If IGL_Widget(WidGetID).Disable=False Then
If IGL_MouseClickLeft=True And IGL_MouseEvent.TestZone(RadioButton_Px,RadioButton_Py,Tx+16,Ty,True)=True And Disable=False Then
If IGL_ComboIsOpen=False And IGL_MenuIsOpen=False Then
State=IGL_Switch(State)
Clicked=True
' -------------------
' Play the sound file
' -------------------
If Sound_File<>False And Sound_Stop=False Then
PlaySound Sound_File
Sound_Stop=True
EndIf
EndIf
Else
Sound_Stop=False
EndIf
EndIf
' -----------------
' Draw the checkbox
' -----------------
If State=True Then
IGL_DrawImage(Image_Select,RadioButton_Px,RadioButton_Py,IGL_WhiteColor)
Else
IGL_DrawImage(Image_UnSelect,RadioButton_Px,RadioButton_Py,IGL_WhiteColor)
EndIf
EndIf
' -----------------------
' Search the widget child
' -----------------------
ChildPx=RadioButton_px
ChildPy=RadioButton_Py
IGL_RefreshChild(ChildList, Self)
IGL_HideChild(ChildList,Hide)
IGL_DisableChild(ChildList,Disable)
IGL_AlphaChild(ChildList,Alpha)
' ------------------
' Reset the viewport
' ------------------
IGL_ResetGraphic()
End Method
' --------------------------------
' Method : For test a button click
' --------------------------------
Method ClickGadget()
If Clicked=True Then
Clicked=0
Return True
Else
Return False
EndIf
End Method
' ---------------------------------
' Method : Return the widget family
' ---------------------------------
Method GetFamily()
Return IGL_CheckboxFamily
End Method
' ---------------------------
' Method : Destroy a Checkbox
' ---------------------------
Method KillGadget()
Release Image_Select
Release Image_UnSelect
Label=Null
Kill=True
IGL_KillChild(ChildList)
End Method
End Type
The changes you need to make to the Inc_Master.bmx file:
in the Function IGL_AddParent add
If IGL_RadioButton(Parent) Then
IGL_RadioButton(Parent).AddChild( Child)
End If
in the Function IGL_RefreshChild add
If IGL_RadioButton(Child) Then
If IGL_Tab(IGL_RadioButton(Child).TabParent)<>Null And IGL_Tab(IGL_RadioButton(Child).TabParent).Kill=True Or IGL_RadioButton(Child).Kill=True Then
List.remove(Child)
Else
IGL_RadioButton(Child).Refresh(IGL_Widget(Parent))
EndIf
EndIf
right under the refresh code for the IGL_Checkbox
in Function IGL_KillChild
If IGL_RadioButton(Child) Then
IGL_RadioButton(Child).KillGadget()
EndIf
in Function IGL_HideChild
If IGL_RadioButton(Child) Then
IGL_RadioButton(Child).Hide=State
EndIf
in Function IGL_DisableChild
If IGL_RadioButton(Child) Then
IGL_RadioButton(Child).Disable=State
EndIf
in Function IGL_AlphaChild
If IGL_RadioButton(Child) Then
IGL_RadioButton(Child).Alpha=State
EndIf
an example
Graphics 800,600,32,60
IGL_InitGUI(1)
Global choices:String[] = ["This is choice one|second line","Choice two","And now three","Four|Line two"]
Cls
If KeyDown(KEY_ESCAPE) Then exitProg=1
IGL_ChoiceBox("Choose One","Please select an option.",choices,0)
IGL_ClearGui()
End