IGlass GUI for blitzmax - IV

BlitzMax Forums/BlitzMax Programming/IGlass GUI for blitzmax - IV

Starting fresh Thread

Links to previous threads:

http://www.blitzbasic.com/Community/posts.php?topic=46725 IGlass GUI for blitzmax - I

http://www.blitzbasic.com/Community/posts.php?topic=47927 IGlass GUI for blitzmax - II

http://www.blitzbasic.com/Community/posts.php?topic=50160 IGlass GUI for blitzmax - III

I really don't know Scott :(( maybe replace

Global mainMenuBG:TImage = LoadImage("interface/QMMainMenuBG.png",FILTEREDIMAGE|MASKEDIMAGE)
IGL_BackgroundImage=mainMenuBG

By a IGL_StaticImage ?

I'll look your code soon as possible :) don't panic :)

Just so you know this has nothing to do with the background image. It is some issue with the frame being assigned to a tab. The assignment works but the frame doesn't appear to get drawn. I put the background up so I could see if the frame was being drawn somewhere else.

Hi Scott i have find this malicious ***** bug :)

Open the file Inc_Frame.bmx and line numbered : 32

Replace :
NewFrame.Parent=Parent


By
If Parent<>Null Then
NewFrame.Parent=Parent
Else
NewFrame.Parent=IGL_MasterWindow
EndIf

And try this example :

Strict 

' --------------------------
' Load IGL gui ! important !
' --------------------------
Include "./IGL_Classe/Inc_IGlass.bmx"
Global exitProgram:Int = 0 							' should we exit the program

Graphics 800,600,32,60
IGL_InitGUI(1)

Local VCTab:IGL_Tab = IGL_Tab.Create(False,"tab|test",100,20,350,440)

Local DemoFrame:IGL_Frame=IGL_Frame.Create(False,"Demographics",10,80,160,180)
IGL_AssignToTab(DemoFrame,VCTab,"tab")

Local MyButton0:IGL_PushButton=IGL_PushButton.Create(False,"Window alpha 10%",10,40,160)
IGL_AssignToTab(MyButton0,VCTab,"tab")

While exitProgram=0
	Cls
	If KeyDown(KEY_ESCAPE) Then exitProgram=1
	IGL_RefreshGui()
	Flip
	FlushMem()
Wend 
IGL_ClearGui()
End


It is ok for you ?

Excellent! Thank you so much for getting to this quickly.

Nothing :)

Here are some screen shots from QuestMaster: http://www.scottshaver2000.com/forum/viewtopic.php?p=465#465

Hello.

Finally got it and must say I'm pleased with it so far. However, for some reason - even though everything else is happy - it will not recognise IGL_Background.

Any ideas?

Goodbye.

IGL_InitGUI(1)
IGL_InitBackground("./IGL_Demos/Background_01.png")

Hello.
[Edited]
Spotted problem, thanks.

Goodbye.

Hello.

Ok, what's the problem here?
Strict

Include "IGlass_1.5.2\IGL_Classe\Inc_IGlass.bmx"
Graphics 800,600,0
IGL_InitGUI(1)
Global MyWindow01:IGL_Window
MyWindow01=IGL_Window.Create("Window 01",50,50,600,400)

local MyCombo:IGL_Combo
MyCombo=IGL_Combo.Create(MyWindow01,60,130,160)
MyCombo.CreateItem("Combo item number 1")
MyCombo.CreateItem("Combo item number 2")

While Not KeyHit(KEY_ESCAPE)
Cls

IGL_RefreshGui()

Flip
FlushMem()
Wend

IGL_ClearGui()
End


I've traced the error to the following segment in IGL_RefreshChild under inc_master.bmx:
		If IGL_Combo(Child) Then			
			If IGL_Tab(IGL_Combo(Child).TabParent)<>Null And IGL_Tab(IGL_Combo(Child).TabParent).Kill=True Or IGL_Combo(Child).Kill=True  Then 
				List.remove(Child)
			Else
				IGL_Combo(Child).Refresh(IGL_Widget(Parent))
			EndIf
		EndIf

specifically the IGL_Combo(Child).Refresh(IGL_Widget(Parent)) line

Any suggestions? It doesn't seem to happen with other controls.

Goodbye.

SoggyP

I have made a test with your combo, it seem to have a little bug
when you don't activate an item before, i'll correct this !

for the moment add this line
MyCombo.ActivateItem("Combo item number 2")

After :
Local MyCombo:IGL_Combo
MyCombo=IGL_Combo.Create(MyWindow01,60,130,160)
MyCombo.CreateItem("Combo item number 1",IGL_Icon_Default)
MyCombo.CreateItem("Combo item number 2",IGL_Icon_Default)

Strict

Include "IGL_Classe\Inc_IGlass.bmx"

Graphics 800,600,0

IGL_InitGUI(1)

Global MyWindow01:IGL_Window
MyWindow01=IGL_Window.Create("Window 01",50,50,600,400)

Local MyCombo:IGL_Combo
MyCombo=IGL_Combo.Create(MyWindow01,60,130,160)
MyCombo.CreateItem("Combo item number 1",IGL_Icon_Default)
MyCombo.CreateItem("Combo item number 2",IGL_Icon_Default)
MyCombo.ActivateItem("Combo item number 2")


While Not KeyHit(KEY_ESCAPE)
Cls

IGL_RefreshGui()

Flip
FlushMem()
Wend

IGL_ClearGui()
End


Hello.

Thanks.

Goodbye.

OK, I gave in and bought it. I'm sure it'll prove useful.

Cool :) Many thanks :) i hope you like it :)

filax,

any chance of getting a new control that is a scrollable text field that is NOT editable? This would be great for putting instructions up on the screen.

Just reading through the demos at the moment. The IGlass_Skin_Test.bmx demo needs updating. It appears to be passing the color components on the call to IGL_ColorSelector()

If you change the call to

IGL_ColorSelector("Color selector",MyColorIGlass2)


And add the following code in the section headed ' COLOR ICON

Local MyColorIGlass2:IGL_Color
MyColorIGlass2=IGL_Color.Create(0,100,255)


It compiles and runs just fine.

Sybixus : Thanks i'll fix it for the next release.

Scott Shaver : Why don't use a multiline label text :) ?

Umm, I didn't know there was such a beast. Is there an example in the demos?

...
Found it thanks

of course :) look IGlass_Label.bmx

Scott, Game looks nice so far :-) So is it gonna be for Linux too?

Yep, I just don't have alinux box to compile on right now. I have an extra PC at home if it isn't fried I'll set it up as a linux machine eventually. But I think a number of the components got blasted when I had a wicked power surge at home. :(

Iglass is compatible with : PC,MAC, LINUX

The new version coming soon 1.5.3 : I have added a new control

IGL_BufferImage

This control alow to create an image buffer and add the possibility
to modify the image buffer.

---------------
Version 1.5.3 :
---------------

-----------------
Command changed :
-----------------
- New sound for button click and requester
- Font name changed

-----------
Bugs fixed :
-----------
- You can disable a gadget under a TAB
- You can add a frame under a TAB (malicious ****ing bug)
- Minor bug with combo, when you forget to activate an item (fixed)

---------------
Commands added :
---------------
A new control is added "Buffered Image widget" :) it's very simple to use, Look at the example : IGlass_Image_Buffer.bmx
A new method is added for the listbox SortItems() use it to sort listbox items example : MyList.SortItems() or MyList.SortItems(False) ' ascending off
A new method is added for the tabs ActivateTab() use it for activate a tab panel from the caption.example MyTab01.ActivateTab("Tab 01")

Hi Gents,

I should be able to set the value of IGL_Value.Value e.g.

Global MyValue:IGL_Value
MyValue=IGL_Value.Create(MyWindow01,"My Value :",150,50,5,50,1,0,100,True)
MyValue.Value=50

It's just that it does not appear to work for the following code:

Type IGL_WorkStep Extends IGL_Window

Field progressBar:IGL_Progress
Field value:IGL_Value
Field maxValue:Int

Function CreateIt:IGL_WorkStep(Caption:String, Px:Int, Py:Int, Tx:Int, Ty:Int)
Local newWorkStep:IGL_WorkStep = New IGL_WorkStep

Local BLock:Byte = False
Local BMinimize:Byte = False
Local BClose:Byte = False

newWorkStep.Setup(Caption, Px, Py, Tx, Ty, BLock, BMinimize, BClose, IGL_NormalWindow)

Return newWorkStep
End Function

Method Setup(Caption:String, Px:Int, Py:Int, Tx:Int, Ty:Int, BLock:Byte, BMinimize:Byte, BClose:Byte, IGL_NormalWindow:Int)

Super.Setup(Caption, Px, Py, Tx, Ty, BLock, BMinimize, BClose, IGL_NormalWindow)

'Add progress bar
progressBar = IGL_Progress.Create(Self, "Qty", 5, 20, 95, 125, 0, 999999)

'Add value
value = IGL_Value.Create(Self,"Qty",30,0,6,0,1.0,-1000.0,1000.0,True)
End Method

Method setQty(qty:Int)
value.Value = qty
progressBar.Value = value.Value' = qty'qty
If qty > maxValue Then
maxValue = qty
progressBar.Maximum = maxValue
value.Maximum = maxValue
EndIf
End Method

End Type

I belive the line value.Value = qty should update the IGL_Value however the component does not update but the progress bar does?

The new version coming soon 1.5.3
WooHoo!!! Can't wait :c)

Why have I started getting...
Compile error
Identifier 'IGL_Timer' not found
when running the examples?

Maybe because you don't put igl.mod under your mod/pub.mod directory :)

Merx : I have try to run your example but there is many error :) can
you please, make me a valid example for testing ? And add me clear
comment for help me ?

Cheers

Nearly, might have been mixing 1.51 mod with 1.52 examples.
Replaced it with what is *definately* 1.52 mod and all OK.

Cool :)

Hi filax I've changed the IGL_Window class as follows...

' AR Extract key methods from Create Function to allow extensible construction
' --------------------------
' Method : Setup Window
' --------------------------
Method Setup(Caption:String,Px:Int,Py:Int,Tx:Int,Ty:Int,BLock:Byte=True,BMinimize:Byte=True,BClose:Byte=True,ClassType:Int=IGL_NormalWindow)
Self.ID=Self
Self.Caption=Caption
Self.ClassType=ClassType

Self.Title_Height=20 ' dont touch

Self.Px=Px
Self.Py=Py
Self.Tx=Tx
Self.Ty=Ty-Self.Title_Height

' ----------------------
' Make titlebar and body
' ----------------------
If Self.ClassType<>IGL_VirtualWindow Then
Self.Image_Title_Left_Select=LoadImage(ResizePixmap(LoadPixmap(IGL_Window_Title_Left_Select),15,Self.Title_Height))

Self.Image_Title_Corner_Width=ImageWidth(Self.Image_Title_Left_Select)
Self.Image_Title_Middle_Select=LoadImage(ResizePixmap(LoadPixmap(IGL_Window_Title_Middle_Select),Self.Tx-(Self.Image_Title_Corner_Width*2),Self.Title_Height))
Self.Image_Title_Right_Select=LoadImage(ResizePixmap(LoadPixmap(IGL_Window_Title_Right_Select),15,Self.Title_Height))

Self.Image_Title_Left_Unselect=LoadImage(ResizePixmap(LoadPixmap(IGL_Window_Title_Left_Unselect),15,Self.Title_Height))
Self.Image_Title_Middle_Unselect=LoadImage(ResizePixmap(LoadPixmap(IGL_Window_Title_Middle_Unselect),Self.Tx-(Self.Image_Title_Corner_Width*2),Self.Title_Height))
Self.Image_Title_Right_Unselect=LoadImage(ResizePixmap(LoadPixmap(IGL_Window_Title_Right_Unselect),15,Self.Title_Height))

Self.Image_Body=IGL_LoadBorderImage(IGL_Window_Body,Self.Tx,Self.Ty,IGL_Color.ARGB(IGL_WindowBorderLightColor),IGL_Color.ARGB(IGL_WindowBorderDarkColor),1)
EndIf

' --------------------
' Add button to window
' --------------------
Local Button_Px:Int
Local Button_Py:Int=Self.Title_Height

Local Label_Py:Int=0-((IGL_FontHeight/2)+(Self.Title_Height/2)+2)
Local Label_Px:Int=Self.Tx/2

If BClose=True Then
Button_Px=Tx-(Self.Title_Height+2)
Self.Button_Close=IGL_CustomButton.Create(Self.ID,"",Button_Px,-Button_Py,Self.Title_Height-1,Self.Title_Height-1,IGL_Window_Close_Highlight,IGL_Window_Close_Unselect,IGL_Window_Close_Select,0)
Self.Button_Close.ToolTip="Close"
EndIf

If BMinimize=True Then
If BClose=True Then
Button_Px=Tx-((Self.Title_Height+1)*2)
Else
Button_Px=Tx-(Self.Title_Height+2)
EndIf

Self.Button_Minimize=IGL_CustomButton.Create(Self.ID,"",Button_Px,-Button_Py,Self.Title_Height-1,Self.Title_Height-1,IGL_Window_Minimize_Highlight,IGL_Window_Minimize_Unselect,IGL_Window_Minimize_Select,0)
Self.Button_Minimize.ToolTip="Minimize"
EndIf

If BLock=True Then
Self.Button_Lock=IGL_CustomButton.Create(Self.ID,"",5,-Button_Py,Self.Title_Height-1,Self.Title_Height-1,IGL_Window_Lock_Highlight,IGL_Window_Lock_Unselect,IGL_Window_Lock_Select,0)
Self.Button_Lock.ToolTip="Lock"
EndIf

Self.Label=IGL_Label.Create(Self.ID,Self.Caption, Label_Px,Label_Py,2,IGL_WindowTitleSelectColor)
Self.Color=IGL_Color.Create(255,255,255)
Self.Blend=ALPHABLEND

IGL_DisableAllWindow()
Self.State=True

' --------------------------
' Add this entry to the list
' --------------------------
ListAddLast IGL_WindowList,Self

End Method


' --------------------------
' Function : Create a Window
' --------------------------
Function Create:IGL_Window(Caption:String,Px:Int,Py:Int,Tx:Int,Ty:Int,BLock:Byte=True,BMinimize:Byte=True,BClose:Byte=True,ClassType:Int=IGL_NormalWindow)
Local NewWindow:IGL_Window

NewWindow=New IGL_Window
'AR Uses Setup to ensure values are set
NewWindow.Setup(Caption, Px, Py, Tx, Ty, BLock, BMinimize, BClose, ClassType)
Rem
NewWindow.ID=NewWindow
....... setup now does this
End Rem
Return NewWindow
End Function

This is to allow extended windows classes to be created. However the problem appears to be with the value widgets display value not being refreshed.

Ok, i'll look the problem !

If i understand the value gadget are not refresh when you change :
MYValue.Value ?

The solution is :
MYValue.Input_Value.Caption=XXXX

It's a little bit different than other gadget, because the value gadget
are made with other gadget !! i'll correct this under the documentation.

Conclusion :
You get the ValueGadget value with MyVa=MYGadget.Value
You modify the ValueGadget value with MYValue.Input_Value.Caption=XXXX

It's a little bit stupid :) i know but i'llchange this for the next release.

If you want make a quick fix add this lines

	' --------------------------------
	' Method : Return the widget value
	' --------------------------------
	Method GetValue:Float()
		Return Float(Input_Value.Caption)
	End Method
	
	' -----------------------------
	' Method : Set the widget value
	' -----------------------------
	Method SetValue(Value:Float)
		If Value>Maximum Then Value=Maximum
		If Value<Minimum Then Value=Minimum
				
		If Integer=True
			Input_Value.Caption=Int(Value)
		Else
			Input_Value.Caption=Value	
		EndIf
	End Method


Under the file Inc_Value.bmx after the line 172

New command added for the next IGlass release :
- 2 new method added for progress gadget, GetValue() and SetValue(), look at the example : IGlass_Progress.bmx
- 2 new method added for scrollbar gadget, GetValue() and SetValue(), look at the example : IGlass_Scrollbar.bmx
- 2 new method added for value gadget, GetValue() and SetValue(), look at the example : IGlass_Value.bmx

filax - can you watch your swearing, please?

? what ?? don't understand ?

I think it was the term used to describe a malicious bug...

I dont' know ! lol :) Beaker can you clarify ?

Yeah I'm sure that was it, check the fourth post. It has been edited to bleep out a word you used. :)

Don't know if the rest of you are using LUA scripting with iGlass but here is a small example. It prints some text to the console and then adds a couple of numbers and then pops up a message box in iGlass and the exits the program.

BMax Code
Strict 

Framework BRL.GlMax2D

Import BRL.freetypefont
Import BRL.System
Import BRL.Basic
Import BRL.pngloader
Import BRL.Retro
Import pub.igl
Import pub.luascript
?Win32
	SetGraphicsDriver(GLMax2DDriver())
?
Global exitProg:Int=0

Include "../IGlass1.5.1/IGL_Classe/Inc_IGlass.bmx"
Global lua:ScriptEngine = New ScriptEngine

lua.AddFunction(MaxPrint, "MaxPrint")
lua.AddFunction(Add, "Add")
lua.AddFunction(Quit, "Quit")
lua.AddFunction(GuiMessage, "GuiMessage")

Function GuiMessage(luaVM:Byte Ptr)
	Local t:String = String.FromCString(lua_tostring(luaVM,-2))
	Local s:String = String.FromCString(lua_tostring(luaVM,-1))
	lua_pop(lua.m_lua_state,1)
	lua_pop(lua.m_lua_state,1)
	IGL_MessageBox(t,s,1)
	Return 0
EndFunction

Function Quit(luaVM:Byte Ptr)
	Print "Exiting program."
	exitProg=1
	Return 0
EndFunction

Function MaxPrint(luaVM:Byte Ptr)
	Print String.FromCString(lua_tostring(luaVM,-1))
	Return 0
EndFunction

Function Add(luaVM:Byte Ptr)
	Local a:Double = lua_tonumber(luaVM,-1)
	Local b:Double = lua_tonumber(luaVM,-2)
	lua_pop(lua.m_lua_state,1)
	lua_pop(lua.m_lua_state,1)
	lua.ReturnNumberToLua(lua.m_lua_state, a+b)
	Return 1
EndFunction

Graphics 800,600,32,60
IGL_InitGUI(1)

While exitProg=0
	Cls
	lua.RunScriptFile("MyScript.lua")
	IGL_RefreshGui()
	Flip
	FlushMem()
Wend 
IGL_ClearGui()
End


LUA Script (MyScript.lua)
print("-----------------------------------------------------------------");
print("Running a Lua Script file.");
MaxPrint("Printing this from a lua script using a BMax lua function.")

ans=Add(2,5)
print("2+5="..ans)

ans=Add(5,6)
print("5+6="..ans)

GuiMessage("Title","This is my message.")
print("-----------------------------------------------------------------");

Quit()


I understand nothing to LUA :/

Cheers filax I've updated Value with the methods you have provided. It's updating nicely now.

Regards

Merx

Cool :) i have update Iglass for the next release :)

This method work now with :
Scrollbar
Value
Progress

filax, can we get a radio button type?

Hum ... I think its possible via an extend of the checkbox class
i don't think made this for the release 1.5.3, but possible after :)

Hey filax I've got another request. Can you please change the code so we can use

import "../IGlass1.5.1/IGL_Classe/Inc_IGlass.bmx"

instead of include. This will speed up compiles and in my case will make managing the project I'm working on much easier. Right now I have 40-50 code files and I can only import the ones that don't reference iGlass. This is because when I try to use import with iglass I get

"Identifier IGL_Timer not found" in the inc_master file. Where is this misterious IGL_Timer? It isn't defined in any of the source files.

Hmmm.. I got that using 1.5.1 examples with 1.5.2 modules and vice versa.

tonyg, can you try to compile the following and tell me what you get?

Strict 

Framework BRL.GlMax2D

Import BRL.freetypefont
Import BRL.System
Import BRL.Basic
Import BRL.pngloader
Import BRL.Retro
Import pub.igl
Import pub.luascript
?Win32
	SetGraphicsDriver(GLMax2DDriver())
?
Global exitProg:Int=0

Import "../IGlass1.5.1/IGL_Classe/Inc_IGlass.bmx"

Global lua:ScriptEngine = New ScriptEngine
lua.AddFunction(Quit, "Quit")
lua.AddFunction(QMMsgBox, "QMMsgBox")

Rem
LUA Script Function

Put a message box on the screen and wait for the user to click a button in it.

ans=QMMsgBox("Window Title","This is the message text.",MSGBOX_OK,MSGBOX_ICON_ALERT)

Returns which button was clicked.
EndRem
Function QMMsgBox(luaVM:Byte Ptr)
	Local title:String = String.FromCString(lua_tostring(luaVM,1))
	Local caption:String = String.FromCString(lua_tostring(luaVM,2))
	Local boxtype:Double = lua_tonumber(luaVM,3)
	Local boxicon:Double = lua_tonumber(luaVM,4)
	lua_pop(lua.m_lua_state,1)
	lua_pop(lua.m_lua_state,1)
	lua_pop(lua.m_lua_state,1)
	lua_pop(lua.m_lua_state,1)
	Local val:Double=IGL_MessageBox(title,caption,boxtype,boxicon)
	lua.ReturnNumberToLua(lua.m_lua_state,val)
	Return 1
EndFunction

Function Quit(luaVM:Byte Ptr)
	Print "Exiting program."
	exitProg=1
	Return 0
EndFunction

Graphics 800,600,32,60
IGL_InitGUI(1)

While exitProg=0
	Cls
	If KeyDown(KEY_ESCAPE) Then exitProg=1
	lua.RunScriptFile("MyScript.lua")
	IGL_RefreshGui()
	Flip
	FlushMem()
Wend 
IGL_ClearGui()
End



Scott this is a problem link with the igl module, do you copy
this module under pub.mod ?

Hi Scott, same problem as yourself with 'import' and OK with 'include'.
I'm sure my problem was something else.

Thanks tonyg, that confirms it is a change that has to be made in iGlass some how to support the import command.

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


Bravo scott ! i'm alway happy to see my customer's use my software :)

:) and I'm happy to be using it.

Any chance you could include that stuff in the next release? (beg, beg, beg :) ) If you do maybe you could provide graphics for the radio button, instead of using the checkbox graphics.

BTW I made those changes in 1.5.1 I think they should work in 1.5.2 as well but I didn't try it because I'm waiting for 1.5.3 before I upgrade.

For this request type ? hum , why not :) not for the release 1.5.3
because i must test this before include this stuff under the final build !
and i must integrate the radio button for the release 1.5.4, when it's
done :) but don't panic i'll do it :)

started fresh iglass thread here:

http://www.blitzbasic.com/Community/posts.php?topic=51146

Just recieved IGlass. Fantastic work filax! I love it...

Edit: Sorry for posting in the wrong thread, I forgott I still were here ~.~