IGlass GUI for blitzmax - IV

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

Scott Shaver(Posted 2005) [#1]
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


Filax(Posted 2005) [#2]
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 :)


Scott Shaver(Posted 2005) [#3]
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.


Filax(Posted 2005) [#4]
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 :



It is ok for you ?


Scott Shaver(Posted 2005) [#5]
Excellent! Thank you so much for getting to this quickly.


Filax(Posted 2005) [#6]
Nothing :)


Scott Shaver(Posted 2005) [#7]
Here are some screen shots from QuestMaster: http://www.scottshaver2000.com/forum/viewtopic.php?p=465#465


SoggyP(Posted 2005) [#8]
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.


Scott Shaver(Posted 2005) [#9]
IGL_InitGUI(1)
IGL_InitBackground("./IGL_Demos/Background_01.png")


SoggyP(Posted 2005) [#10]
Hello.
[Edited]
Spotted problem, thanks.

Goodbye.


SoggyP(Posted 2005) [#11]
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.


Filax(Posted 2005) [#12]
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)




SoggyP(Posted 2005) [#13]
Hello.

Thanks.

Goodbye.


Gabriel(Posted 2005) [#14]
OK, I gave in and bought it. I'm sure it'll prove useful.


Filax(Posted 2005) [#15]
Cool :) Many thanks :) i hope you like it :)


Scott Shaver(Posted 2005) [#16]
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.


Gabriel(Posted 2005) [#17]
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.


Filax(Posted 2005) [#18]
Sybixus : Thanks i'll fix it for the next release.

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


Scott Shaver(Posted 2005) [#19]
Umm, I didn't know there was such a beast. Is there an example in the demos?

...
Found it thanks


Filax(Posted 2005) [#20]
of course :) look IGlass_Label.bmx


computercoder(Posted 2005) [#21]
Scott, Game looks nice so far :-) So is it gonna be for Linux too?


Scott Shaver(Posted 2005) [#22]
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. :(


Filax(Posted 2005) [#23]
Iglass is compatible with : PC,MAC, LINUX


Filax(Posted 2005) [#24]
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")


Arowx(Posted 2005) [#25]
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?


Kuron(Posted 2005) [#26]
The new version coming soon 1.5.3
WooHoo!!! Can't wait :c)


tonyg(Posted 2005) [#27]
Why have I started getting...
Compile error
Identifier 'IGL_Timer' not found
when running the examples?


Filax(Posted 2005) [#28]
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


tonyg(Posted 2005) [#29]
Nearly, might have been mixing 1.51 mod with 1.52 examples.
Replaced it with what is *definately* 1.52 mod and all OK.


Filax(Posted 2005) [#30]
Cool :)


Arowx(Posted 2005) [#31]
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.


Filax(Posted 2005) [#32]
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



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


Beaker(Posted 2005) [#33]
filax - can you watch your swearing, please?


Filax(Posted 2005) [#34]
? what ?? don't understand ?


tonyg(Posted 2005) [#35]
I think it was the term used to describe a malicious bug...


Filax(Posted 2005) [#36]
I dont' know ! lol :) Beaker can you clarify ?


Scott Shaver(Posted 2005) [#37]
Yeah I'm sure that was it, check the fourth post. It has been edited to bleep out a word you used. :)


Scott Shaver(Posted 2005) [#38]
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


LUA Script (MyScript.lua)



Filax(Posted 2005) [#39]
I understand nothing to LUA :/


Arowx(Posted 2005) [#40]
Cheers filax I've updated Value with the methods you have provided. It's updating nicely now.

Regards

Merx


Filax(Posted 2005) [#41]
Cool :) i have update Iglass for the next release :)

This method work now with :
Scrollbar
Value
Progress


Scott Shaver(Posted 2005) [#42]
filax, can we get a radio button type?


Filax(Posted 2005) [#43]
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 :)


Scott Shaver(Posted 2005) [#44]
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.


tonyg(Posted 2005) [#45]
Hmmm.. I got that using 1.5.1 examples with 1.5.2 modules and vice versa.


Scott Shaver(Posted 2005) [#46]
tonyg, can you try to compile the following and tell me what you get?




Filax(Posted 2005) [#47]
Scott this is a problem link with the igl module, do you copy
this module under pub.mod ?


tonyg(Posted 2005) [#48]
Hi Scott, same problem as yourself with 'import' and OK with 'include'.
I'm sure my problem was something else.


Scott Shaver(Posted 2005) [#49]
Thanks tonyg, that confirms it is a change that has to be made in iGlass some how to support the import command.


Scott Shaver(Posted 2005) [#50]
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.


The radio button code, add this to the file called Inc_Checkbox.bmx


The changes you need to make to the Inc_Master.bmx file:


an example



Filax(Posted 2005) [#51]
Bravo scott ! i'm alway happy to see my customer's use my software :)


Scott Shaver(Posted 2005) [#52]
:) 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.


Filax(Posted 2005) [#53]
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 :)


Scott Shaver(Posted 2005) [#54]
started fresh iglass thread here:

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


Hummelpups(Posted 2005) [#55]
Just recieved IGlass. Fantastic work filax! I love it...

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