IGlass GUI for blitzmax - III

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

Scott Shaver(Posted 2005) [#1]
Sorry about the double post but I thought it was a good time to start another thread. I hate long threads.

Links to previous threads: ( for Rik :) )
http://www.blitzbasic.com/Community/posts.php?topic=46725
http://www.blitzbasic.com/Community/posts.php?topic=47927

Bugs found in 1.5.2

IGL_ColorSelector: the sliders only allow you to pick odd values. Please add single step arrows to the ends of the sliders or find another way to solve this problem.

Some of the demos won't run because they use incorrect method calls:
IGlass_Custom_toolbar
IGlass_Skin Test
IGlass_Widget_color


Gabriel(Posted 2005) [#2]
Couple questions.

1) Is IGlass happy using the Direct3d renderer?

2) Are those skins in the last thread now available to registered users?


RiK(Posted 2005) [#3]
Scott, when you post an extension thread its usually nice to include a link to the originals in your first post... :)


Gabriel(Posted 2005) [#4]
Bump.


Scott Shaver(Posted 2005) [#5]
I haven't tried using DX with iGlass.

I think the new skins were going to be in a skin pack he wants to sell.

filax????


Filax(Posted 2005) [#6]
?? What ??? talking about skin ?

Euhhh ... for the moment i'm making some skins for my hown usage,
but it's a good idea to sell skin pack with low cost :) thanks for
the idea scott :)

But don't panic ! i'll send some for free to my customer's :)


Scott Shaver(Posted 2005) [#7]
I would really like to see the skins you showed in message five of this thread made available, especially the first one.

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

BTW a while ago you asked if I was doing anything with iGlass. Well the map editor you know about and now I am working on this.

http://www.scottshaver2000.com/forum/viewforum.php?f=19


Gabriel(Posted 2005) [#8]
?? What ??? talking about skin ?



Right the skins in the skin pack Scott pointed to. Deux asked if they would be free, and your reply was "maybe to registered users." I just wondered if they had been or would be made available to registered users.

My most pressing concern is whether it works with the D3D renderer or not.


Scott Shaver(Posted 2005) [#9]
I just tried forcing the DX driver and it seems to work fine.


Filax(Posted 2005) [#10]
Iglass work with opengl framework and Dx framework.
I use Iglasss succesfully with the great tool framework asistant.

Scott :
www.scottshaver2000.com/forum/viewforum.php?f=19

I have try to find screenshot ?? but ???


Scott Shaver(Posted 2005) [#11]
No screen shots yet, I'm waiting until I get something nice to look at.


Scott Shaver(Posted 2005) [#12]
@filax: How do you change the font iGlass uses? I would like to be able to create my own font and have it used in the gadgets. Are there any pitfalls I should know about when trying to do this? Can I change the font in the middle of the program? Can I assign a particular font to a particular gadget?


Filax(Posted 2005) [#13]
Maybe ! you can try to use your hown font but there is no guaranted
with the result ! i have try to create all widget with the font height
var but i have not try with other fonts.

If you want to make a game style menu maybe use custom button
with bitmap font ?


Scott Shaver(Posted 2005) [#14]
I need a better font for my current project. So HOW do i replace the font that iGlass is using? Please tell me I can do it in the program and it isn't a matter of overwritting the existing font file.


Filax(Posted 2005) [#15]
Good news :) i have try another TTF font to replace Arial and it works
: ) but keep the font size for the moment :)

And important !! keep the BLITZ.FON for inputbox else they
generate error !!!!

Method :

Open the file Inc_Scheme.bmx

And modify this section



And replace the arial.ttf by other font and don't forget to copy this
new ttf file under :

IGlass_1.5.3\IGL_Classe

and

IGlass_1.5.3

But don't touch the BLITZ.FON et don't change font size !!!


Scott Shaver(Posted 2005) [#16]
Have you noticed you are missing the Incbin stuff for the Mac compile? Is that why I keep having the weird gliches on the Mac with the font?


Scott Shaver(Posted 2005) [#17]
I think I'm going to do some work rearranging your init methods so we can tell the system what skin and what fonts we want to use at run time.

This will eleminate the need for having multiple iGlass copies (one in each project), or manually moving files around each time you compile (multiple projects using the same IGlass copy but wanting different skins).


Scott Shaver(Posted 2005) [#18]
Isee the problem you had now, since Incbin can't be used at runtime you had to hard code the values. Hmm, I think I have another way to handle that, off to try something...


Filax(Posted 2005) [#19]
I'm happy you understand me :)

The best method for incbin will be :

Local MyFile:String="C:\TOTO.BMP"
Incbin Myfile

But for the moment this stuff don't work ... i'm obliged to duplicate
all widget bitmap variable ....

And the incbin with some font on mac os X don't work correctly
(work perfectly on linux and win 32 ...) but mark said :

"That normal your font is bugged ...." .... If you want mark :)
french people are stupid it's well-know.

But the system is not completly perfect on the 3 OS ....


bruZard(Posted 2005) [#20]
short question:
How to know if the close button of an window is clicked??

**excuse my f***'n english**


Filax(Posted 2005) [#21]
If i'm remember :

MyWindow02=IGL_Window.Create("Window 02",100,100,450,350,False,True,True)

Do

If MyWindow02.Button_Close.ClickGadget()=True Then
End
EndIf

Loop


Note to Scott Shaver :

I'm thinking to the color selector, but , do you know that you can
use mouse wheel under scrollbar to inc or dec value :) ?


Scott Shaver(Posted 2005) [#22]
What we need is a compiler directive like #define in C. Then you could simply say the program has to include this at the top:

?define IGL_SKIN_NAME="Default_Skin"

then in the IGL code you could do:

IGL_Window_Title_Left_Select="incbin::./IGL_Graphics/IGL_SKIN_NAME/Window_title_left_se.png"
Incbin "./IGL_Graphics/IGL_SKIN_NAME/Window_title_left_se.png"

This of course doesn't fix the runtime issues but it does make it so you wouldn't have to be copying files all over the place.

For run time skin changing the files can't be incbin'd and a number of your BMX files would have to be changed.

On the colorselector, no i didn't know the mouse wheel worked. I just tried it and yes it did work for me, nice. It would still be nice to have the arrows at the ends of the scroll bars though. :)


Filax(Posted 2005) [#23]
Ok, no problem for arrow ;)


SillyPutty(Posted 2005) [#24]
Hi Filax, I am having trouble trying to lock a window to screen, I am trying to make a toolbox on the right of my editor, and dont want it to move.

However, I am told by the compiler that identifier "Lock" is not found.

Any ideas ?


Avon(Posted 2005) [#25]
Hi Deux. This is how to create a window and "lock" it so it can't be moved:
Global MyWindow01:IGL_Window
MyWindow01 = IGL_Window.Create("Window 1",0,0,512,256,False,True,True)
MyWindow01.Lock = True
Hope this helps.


Filax(Posted 2005) [#26]
Yes Avon is right :)


SillyPutty(Posted 2005) [#27]
Man I did that, hehe, dont know what I did wrong, but no doubt I messed up somehow, thanks, will check it out when I get home !

Thanks for the response :)


Scott Shaver(Posted 2005) [#28]
Bug reports/enhancment request (1.5.1)

1> It seems you can't disable a button that is assigned to a tab.
2> The listbox needs a sort method
3> Add a method to the IGL_Tab control to make a specific tab active by name. ActivateTab("My Tab Name")


Filax(Posted 2005) [#29]
Hi Scott for the bug and the Tab it's not really a bug
but i'm very desapointed by the method to use for
disable a TAB and the child gadget : But if you want to
disable gadget under tab made this :

Load the file IGL_Classe/Inc_Master.bmx
and comment the block



And the gadget disable will be ok, but ! if you disable the Tab
all gadgets under tab will not be disabled ! i'm searching a method
to do this.

The listbox have now a sorting method :)

and for your problem about ActivateTab add this piece of code
between




Scott Shaver(Posted 2005) [#30]
Thanks filax, one more thing it seems if you create an empty text field it gets a single space placed in it.

Global MANameValue:IGL_Input=IGL_Input.Create(IGL_MasterWindow,"",460,10,20)
IGL_AssignToTab(MANameValue,MATab,"My Tab")



Filax(Posted 2005) [#31]
Why you use the IGL_MasterWindow ??? if you want a gadget directly on the screen use simply "False"

I dont' understand the problem ?? i have try :



But it seem to not have problem ?


Scott Shaver(Posted 2005) [#32]
Okay I must being doing something wrong somewhere else. Thanks.


Scott Shaver(Posted 2005) [#33]
just a note to change the iGlass font when using the Framework command you need to import.

Import BRL.freetypefont


Filax(Posted 2005) [#34]
ok thanks scott i will modify this


Scott Shaver(Posted 2005) [#35]
For the next release it will take a little work but you could rewrite the Input type to handle variable size fonts by using something like this:

Local n=IGL_InputFont.CharToGlyph( caption[i] )
If n<0 Continue

Local glyph:TImageGlyph=IGL_InputFont.LoadGlyph(n)
glyph._advance <-- this is how far forward the character will move us


using the TImageGlyph type you can move the cursor in the input box correctly. Look at the max2d.mod\imagefont.bmx file, look at the Draw method.

This would be great. Also It would be nice if we could specify a scaling factor for the fonts in the widgets.


Filax(Posted 2005) [#36]
Pfiuuu :) you want to kill me ? :)

For the inputbox stuff, if you want to make an example in a temporary
Iglass build and to send me the result by email ? improve greatly the
next release for me :) because i have try to make only one font
in iglass but the inputbox problem break my head !!!

Because the problem is not the cursor keymoving when the
inputbox is selected, the problem is : when i click on the gadget
to put directly the cursor at the good place ! analyze the string
glyph size to find the correct cursor placement is very complicated !

But for your problem with font size ? it's a little bit complicated
due to Iglass skining, example for the pushbutton (y size limited)





Scott Shaver(Posted 2005) [#37]
ROFL! Sorry, just making suggestions that I think would really improve iGlass. :) I'll see if I can't figure out how to do what I want and if I can I'll send it to you.

I have other things on the top of my list for right now. :P


Filax(Posted 2005) [#38]
Lol :) just wait a little time :) else iglass will have only 2 release :)


Scott Shaver(Posted 2005) [#39]
Another thing to add:

When you are using a scroll bar can you lock the mouse to it so if you go outside the bar it is still controlled by the mouse (until the button is released)? This would be very nice for the bars on the list box.


RiK(Posted 2005) [#40]
ha ha, what's with the pic filax?

I am going to have to get me one of those uniforms!


Gabriel(Posted 2005) [#41]
When you are using a scroll bar can you lock the mouse to it so if you go outside the bar it is still controlled by the mouse (until the button is released)? This would be very nice for the bars on the list box.


I agree. Most professional GUI's work this way.


By the way, Filax, I just went to try and purchase IGlass a few moments ago and your site is down. Bandwidth exceeded, apparently.


Filax(Posted 2005) [#42]
Yes my user's eat all my bandwidth :) but the problem will be solved in
one/two day.

Counter reset :)


Kuron(Posted 2005) [#43]
I bought IGlass yesterday and I absolutely love it. It brings an entirely new level of professionalism to the games I am working on. Well worth the $32 IMHO ;c) Thank you for making such a great system available.

I look forward to trying your Packer once your site gets back online.


Filax(Posted 2005) [#44]
Thanks !!! I'm happy when customer tell me that :) i have many many
worked on IGlass to offer a simple but powerfull GUI system :)

For the packer don't panic :) My user's have eat all my bandwith :)
comme back the first september :) bandwith counter reset :)

Kiss from france :)


SoggyP(Posted 2005) [#45]
Hello.

I would also like to complement you on your product.

Hint Hint.

Can you get in touch. Please.

Goodbye.


Scott Shaver(Posted 2005) [#46]
filax new bug report:

The IGL_Frame type appears to be broken. You can put up a frame but if you add children to it that are active (buttons, listbox, etc..) they don't respond to the mouse. Also they get draw onto the background as well as in the frame.

Second, this might be a BMax issue. Using the same proportional font in the IGL_Label widget on Mac OSX and Windows the printed strings come out slightly different lengths. I noticed this in the help screens for my QuestMaster project. Long strings can vary by as much as 20 pixels.


Filax(Posted 2005) [#47]
Hi Scott

Can you post a screenshot because i don't understand the problem with frame.

For the difference between font rendering on mac and pc what are you
talking ?


Scott Shaver(Posted 2005) [#48]
Not sure what else can be said about the label/font issue. The text in an IGL_Label control appears to be longer on Windows than it is on Mac OSX. So "The quick brow fox" on windows take up more pixels on Windows than is does on Mac. (with a proportional font, not fixed width)

Here is a shot of the Frame issue. It seem that frames don't have the code to deal with children correctly. It should work like the children of IGL_tab but it doesn't.




Booticus(Posted 2005) [#49]
"When you are using a scroll bar can you lock the mouse to it so if you go outside the bar it is still controlled by the mouse (until the button is released)? This would be very nice for the bars on the list box."


"I agree. Most professional GUI's work this way."

Me too!! That would be soooooo great! Thats my only LITTLE complaint about iGlass. Other than that its fantastic!!!!


Hotcakes(Posted 2005) [#50]
I agree. Most professional GUI's work this way.

Yeh, except for Windows. I always hated that.


Filax(Posted 2005) [#51]
Scott

The frame don't have child/parent setup. And you button is setuped
to False ? :) Setup your button with the good windows ID and place
manualy this button under the frame.

Frame are only here to segment button familly the Child/parent
is only for TABS for the moment.


Kuron(Posted 2005) [#52]
Filax:

IGlass left my testers stunned. I ported one of my WIP games from PB to BM and they were blown away by the new UI. Thank you a million times over!!

Depending on what they looked like, I would be interested in additional skin packs. I would also be interested in some really nice looking "icon" packs that would fit in with the GUI themes.

Please do not be tempted to abandon IGlass when the MAX GUI comes out. Most of us will likely prefer to keep using IGlass. I know I always use BlitzUI over the B+ GUI.

Downloaded the Packer and it is great!! You definitely have a permanent place in the credits from now on, lol.


Scott Shaver(Posted 2005) [#53]
Filax,

I figured as much and I did revert to placing the controls over the top of the frame. I was just hoping I was doing something wrong because it would make rearragning the interface so much easier if the frame could have children.

As for the window the only one I have is the IGL_MasterWindow because I place tabs directly on it and then my controls in the tab.

Any would on some additional skins. I'd probably be willing to pay for a good pack of them.


Scott Shaver(Posted 2005) [#54]
Filax,

the code below works on the Mac but not on windows, what am I doing wrong? The frame should be displayed on the tab.

EDIT:

I guess I'm not doing anything wrong I just tried another test and frames don't work in tabs in the Windows version, only when they are put directly in a window. Please give me a fix for this, I'm stuck until it works.


Strict 

Framework BRL.GlMax2D

Import BRL.freetypefont
Import BRL.System
Import BRL.Basic
Import BRL.pngloader
Import BRL.Retro
Import pub.igl
?Win32
	SetGraphicsDriver(GLMax2DDriver())
?MacOS			
	Import "BMaxMacWindows.m"
?

' --------------------------
' Load IGL gui ! important !
' --------------------------
Include "./IGlass1.5.1/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(IGL_MasterWindow,"tab",100,0,350,440)

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

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


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




Scott Shaver(Posted 2005) [#55]
Filax I started a fresh thread here:

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


Cartman(Posted 2005) [#56]
Anyone have an idea on how to do this?

I'm trying to have a message box popup over my game. I have a draw routine that gets called. But I can't get the IGL_MessageBox method to draw over the current screen contents, it seems to just want to draw over an IGL_BackgroundImage.

Currently I'm setting the IGL_BackgroundImage to a generic background when the person has chosen to exit the level. Then draw the Message box. This works, however it's not as nice as if I could draw the message box over the game.

Any suggestions would be appreciated.

Thanks
-Keith


Scott Shaver(Posted 2005) [#57]
If your game draw code isn't using iGlass widgets you will probably have to do something weird. For example in my map editor I had to create a type derived from IGL_Widget, or whatever it is called, and add that to the screen. This way iGlass handled calling the draw code in the correct order.

...

I just looked I extended IGL_Frame and put my map drawing code in the Refresh() method.

What we need here is a new parameter to IGL_InitGUI() that is a function pointer. That function would get called in the IGL_RefreshGui() function right after iGlass draws the background but before it draws the rest of the widgets.

I suppose you could go edit the Inc_IGlass.bmx file and add a call to your graphics drawing routines right after the background image is drawn. right around line 122


Filax(Posted 2005) [#58]
Pfiuuu ! :) To many questions :)


SoggyP :
Many thanks :)


Kuron :
Why abandon Iglass :) people like it :) I think buy blitzmax
gui for use it for professional software, but i keep and update
my Iglass system to make game or little utilities :)


Cartman :
I think your solution is : Made a function who redraw your game
like RefreshGame

And call this function to the Inc_Requester at the line numbered 526/527 :



Like that Iglass will refresh the GUI And You game :) Do you
understand ? I use this method under FilaxTeroid to refresh my
main menu :)

PS : Make a COPY of your Iglass Classe directory of course
before made change under IGlass, else update overwrite you
modifications !



Scott :
"the code below works on the Mac but not on windows, what am I doing wrong? The frame should be displayed on the tab."

It's very strange because there is the same GUI for Mac PC et
Linux (only minor changes between version) ? Maybe a blitzmax
bug ?

I have many many PAO work at my job for the moment but :(
and not enought time to blitz :( snif :(

To help me can you prepare me a little zip file ready to compile ?
with your code ? (Media files etc ..) ? and when i have five minute
i 'll try.


For the skin question :
I'm preparing my skin pack, i have 4 nice skins, but not enought
time to terminate my pack :( but i will try to finish him for one or
three week.

If my boss let me leave ...

Hard, hard to be graphic artist and coder at the same time :)


Scott Shaver(Posted 2005) [#59]
go ahead and use the code I posted above, just remove the background image. I looked through the code for iGlass but couldn't find any reason for it not to work other than the IGL_GrabImage which I don't have the source for, maybe there is a problem with generating a pixmap or something.


Cartman(Posted 2005) [#60]
Thanks. THat worked for me. I had to also set the IGL_Background to null to fix it. Works great.

Thanks


Beaker(Posted 2005) [#61]
New thread:
www.blitzbasic.com/Community/posts.php?topic=50689