BlitzUI - Finished and Free

Community Forums/Showcase/BlitzUI - Finished and Free

Odds On(Posted 2003) [#1]
Those of you who look at the worklogs might have already heard about BlitzUI. BlitzUI is an application development tool for Blitz2D, Blitz3D, and BlitzPlus. It supports all the common windows controls including multi-line text areas, tree views, list boxes, radio buttons etc. (Full list is below)

The backbone of BlitzUI is an API style SendMessage( ) function which you use to communicate with all the controls etc. (More info on our site)

The download comes with compiled versions of the GUI editor and the Colour Scheme Editor so u can get started without even having to look at any code.

Be sure to check out the samples and help files to help you get started (Help file contains a full command reference with examples and full descriptions.)

Menus (With Sub Menus) - Menu Items have optional icon and can be checked
Buttons (Multi-line captions supported and optional image.. can also be grouped to create toggle buttons)
Check Box
Combo Box
Group Box
Image Box
Label (Multi-line support and can be left, center or right aligned)
List Box (Optional icons)
Progress Bar
Radio Button
Scroll Bar
Spinner (Option of integer or float.. increment can be custom set)
Text Box (Multi-line support.. vertical scrollbar appears when needed)
Tree View

Dock(Posted 2003) [#2]
I had a play around with this, and I'm really impressed! It's very solid, and seems quite straightforward. It's smooth and slickly executed. Congratulations. ^_^

Is there any means of skinning the windows, etc, in a similar manner to Trillian or Windows XP? I would imagine some people would want to use cute rounded corners, or perhaps gradients on their toolbars. Another great thing would be the ability for the windows to 'snap' to one another, like Winamp, Paintshop Pro 8, and Trillian. Finally, how about the ability to extend and collapse menus by double clicking on the toolbar?

I had some problems with the file browser on the Model Viewer example. If you scroll half way down the file list, and then click the down arrow, it scrolls all the way back to the top again. The up arrow does the same thing, which makes them kinda useless.

Unfortunately, I personally don't have any immediate application for menus and UI such as this. None of my game ideas have customisation or menu interaction, but if I needed one I would definitely consider this ^_^

DarkNature(Posted 2003) [#3]
Dude! What a generous contribution. You're a star!

I will play with this properly later on, when I get home, but it sure looks pretty cool.

Thanks for sharing.

Have fun.

BlitzSupport(Posted 2003) [#4]
I'll be downloading that later -- looks top-notch!

Odds On(Posted 2003) [#5]
Thanks everyone, and thanks Dock for the suggestions and bug report.. I'll get on it straight away.

There's no easy way to skin windows with rounded corners etc. since all the drawing is done with the blitz 2d drawing commands (Rect mostly) for maximum speed. However, BlitzUI has it's own 2d command set so u can draw circles and images etc on top of windows.

JaviCervera(Posted 2003) [#6]
WOW! It's probably one of the best looking gui libraries i've ever seen... i will port my current project to BlitzUI. Is there any problem in using BlitzUI for shareware or commercial applications?

Sterling(Posted 2003) [#7]
Wooooohooo heeeyyyy hey hey.....this is good!

You been workin on this in secret!

Thanks for sharing!

Odds On(Posted 2003) [#8]
Thanks Jedive and Sterling, there's no license or fee or anything like that needed if you want to use it in a commercial app.

I like to work on certain projects in silence because there's much less pressure and noone to let down if something goes wrong.. I work much better this way :)

poopla(Posted 2003) [#9]
Very nice indeed. If team-plasma had any desire to use it rather then our own partially completed UI, would it be a problem? Just checking :). I wouldnt think so as plasma is also/will be on release, open source.

Odds On(Posted 2003) [#10]
It wouldn't be a problem T-Bogard, it would be great in fact :)

Rob Farley(Posted 2003) [#11]
I've just had a quick play and this seems REALLY good, thanks for this, if I use it in anything I'll make sure you get the credit.

Wiebo(Posted 2003) [#12]
WoW! This is really good! thanks for sharing

Beaker(Posted 2003) [#13]
Very nice work. Thanks for sharing.

Yappy(Posted 2003) [#14]
excellent work - looks great

Ice9(Posted 2003) [#15]
Very nice work

Synchronist(Posted 2003) [#16]
First rate! Thanks for sharing with the community!

wedoe(Posted 2003) [#17]
Looking good :)

R0B0T0(Posted 2003) [#18]
Looks great, downloading now. Thank you for donating your hard work! I know this will be useful to me.

Klapster(Posted 2003) [#19]
This is fantastic Fullernator, thanks so much for sharing it!

Yapp, you got some *serious* competition mate ;)

AndyBoy_UK(Posted 2003) [#20]
I ve downloaded this as well, most impressive. Nice work mate.

Red Ocktober(Posted 2003) [#21]


This is better than great man... you've really outdone yourself.


Qcat(Posted 2003) [#22]
Nice!! Work

NobodyInParticular(Posted 2003) [#23]
Very impressive to say the least, works very well...

Odds On(Posted 2003) [#24]
Thanks everyone! I didn't expect it to get so much attention :D I really appreciate the support!

elias_t(Posted 2003) [#25]
Wow !

Very good stuff..

Thanks Fullnerator.

simonh(Posted 2003) [#26]
This is excellent...thanks for sharing.

I am planning on giving it a good thrashing by using it for a mini-editor (also freeware), I'm planning to work on soon.

Neuro(Posted 2003) [#27]
Fullernator, didnt you use to work with 3drad?

Odds On(Posted 2003) [#28]
yea I did Neuro.. been a while since I've used it tho. I don't even have it installed anymore :)

Neuro(Posted 2003) [#29]
I don't blame ya...;-)

Synchronist(Posted 2003) [#30]

I would assume that you're going to be fixing some user discovered bugs or possibly adding further enhancements, would you consider incorporating a version number so the changed versions can be identified? Thx.

Odds On(Posted 2003) [#31]
Hi CodeMeister,

Do you mean in the filenames or somewhere in the source? The updates already on the site are numbered, etc

Synchronist(Posted 2003) [#32]
Hi Fullernator,
In the source would be my preference as you've so graciously made it available. The reason I'm asking is that it would be convenient for myself and others to contribute fixes and enhancements and be able to say, "This code was patched against BlitzUI version xx.xx", or something similar. What do you think?

BTW, I think your BlitzUI is an absolute Godsend!
Many thanks!

Odds On(Posted 2003) [#33]
Thats a pretty good idea.. I think trying to keep track of patches for something like this is an impossible task though.. I included patches for the first 2 updates but even then it was confusing and you had to download both patches to get the most up to date version so I decided simply to upload the entire thing each time so you can be certain you have the latest version.

Synchronist(Posted 2003) [#34]
I know what you mean, keeping track of patches can be a real headache...
You could approach it from a "maintainers" standpoint, like they do with the Linux kernal patches. Anyone who would like to contribute code enhancements, etc, could email you the new code for your approval and inclusion into any new releases. That way you control new release versions with whatever feature(s) you think are good for the BlitzUI application. This also allows you to control the update release frequency without getting tied up in "update mania". Just a thought.
The nice thing about this method is that you'll get the benefit of having others who program in Blitz to help mature your application.
The BlitzUI program is immensely useful now and I believe it will become a "got to have" tool for UI development as it continues to develop.

Odds On(Posted 2003) [#35]
Yea, that would be the only sane way to do it I think :)

For now I will just keep taking feature requests and bug reports and release an update soon after.. seems to be working so far at least :D

Wiebo(Posted 2003) [#36]
Man, i just discovered the help files that come with this program! I'm even more impressed now! Awesome work.
The only thing I can think of is that you should add a snap-to-grid option in the UI editor! I've decided to use this gui for my next 3d-editor program. I will probably come with more stuff as I get to work with your gui.

mrtricks(Posted 2003) [#37]
This is absolutely brilliant!

A couple of things maybe I'm not understanding (for starters):
1. When you go into settings in the Editor and change the project window size, the editor window doesn't change from 640x480. Is that something I'm not doing?
2. In the supplied documentation, I don't seem to be able to get into any pages for the Sendmessage commands. There are so many and I really wouldn't have a clue how to use any of them...

Utterly great stuff though and even better for being free.

Odds On(Posted 2003) [#38]
You have to exit BlitzUI and reopen it for the resolution to change because everything gets wiped from memory when you change resolution. Remember to use File > Exit cos using the X in the corner doesn't exit blitz3d apps properly, so the settings aren't saved and BlitzUI isn't freed from memory.

With the SendMessage commands.. as you said there are a lot of them and will take a very long time to document correctly. I've tried to make them as understandable as possible though.. for example:

SendMessage( mytextbox, "TM_SETTEXT", 0, "Sample text." )

Adds the text "Sample text." to line 1 of the specified textbox.

SendMessage( mywindow, "WM_CLOSE" )

Closes the specified window.

X = SendMessage( mybutton, "BM_GETPOS", True )
Y = SendMessage( mybutton, "BM_GETPOS", "", True )

Inserts the X and Y positions of the specified button into the variables X and Y respectivly.

Hope this helps,

mrtricks(Posted 2003) [#39]
Certainly does! Looking forward to more documentation coming out as it comes. Thanks again.

DrakeX(Posted 2003) [#40]
this is awesome :D

thank you

(and hehe it's robin, the guy who made magic world)

mrtricks(Posted 2003) [#41]
I've been found out! Hey DrakeX - check out Total Terrain 2 - click the link in my sig (not the picture... the yellow text)

Sorry to hijack the thread: although the first thing I'm going to use BlitzUI for is TT2...

Odds On(Posted 2003) [#42]
cool :) I'm looking forward to see what people do with BlitzUI. In a few days I'm gonna release another update.. hopefully most of SendMessage() will be documented and the following things will be added:

- HideGadget( ID )
- ShowGadget( ID )
- Scroll bars in combo boxes
- Userlib with all BlitzUI functions (for highlighting and quick help)

DrakeX(Posted 2003) [#43]
robin -- i would download it if i could, i get 404s when i click the download link. but am i correct in assuming it's basically a very advanced version of the terrains that were in MW?

Wiebo(Posted 2003) [#44]
Fullernator: I could make the files for BlitzUI syntax highlighting and quick help for UltraEdit as external editor

mrtricks(Posted 2003) [#45]
DrakeX, that's odd. Download works fine for me. And yes, it is.

@ Fullernator - waiting patiently :)

Odds On(Posted 2003) [#46]
I've just uploaded update 4 to the site :)

Changes include:

Scroll bars in combo boxes
Object and Handle used to improve performance

I've also uploaded the help files and colour schemes as separate downloads.

Wiebo, that would be great!

JaviCervera(Posted 2003) [#47]
ey Fullernator, one doubt... how can I know when a window has been closed?

Odds On(Posted 2003) [#48]
Select app\Event
Select app\WindowEvent
Case thiswindow
Select app\WindowEventData
Case "Closed"
;Do this
End Select
End Select
End Select

or if you're not using an event handling structure you could simple use

If SendMessage( thiswindow, "WM_VISIBLE" ) = False
;Do this
End If

JaviCervera(Posted 2003) [#49]
thx Fuller, now it works. Once again, congratulations fot this awesome library ^_^. Glad to see that you're using the .decls file trick i discovered to highlight the functions in the IDE :)

R0B0T0(Posted 2003) [#50]
Hmmm.. I've come across a problem in the UI editor using the newest version. I'm not able to select anything using the combo/list boxes, so I can't change gadget settings, resolution etc.

Otherwise though, it works beautifully :)

Wiebo(Posted 2003) [#51]
Ok, i will make them if you add a grid in the gui editor =]

LAB[au](Posted 2003) [#52]
I am using the mouse to pick 3D objects and I would like to combine it with BlitzUI, is there a way to know (for all gadgets/windows) if the mouse at the moment the mousebutton is hit is over the windows or not? Sorry to bother you but I didn't find it (yet).

Odds On(Posted 2003) [#53]
oops, sorry about that slight glitch.. I've just uploaded the fixed version (still update 4).

hehe, sounds fair Wiebo :).. a grid will be in the next update.

So far this is what I have planned for Update 5:

- Horizontal scrolling in multiline text boxes.
- Complete documentation for SendMessage messages.
- Grid in the gui editor.
- Expandable panels (Like in 3dsmax)

I'll probably add a few more colour schemes (If you make any yourself and your feeling generous, send the .cs file to cfuller@...). I'm also gonna add a Directory Selecter function. Can anyone think of anything else you want me to add?

- Right Click Menus

Odds On(Posted 2003) [#54]
LAB[au], you can use

If app\MB1 = 1 ;Mouse Click
If app\overWin = Null ;Not over window
;Select 3d object

I also recommend using NoActiveGadgets() with app\overWin to make sure no menus or combo boxes are currently open when you click.

LAB[au](Posted 2003) [#55]
It works for me. Thanks.

R0B0T0(Posted 2003) [#56]
Wow, thats the fastest support I've ever had, and this is a free program :)

Here's a few suggestions I'd like to see implemented if possible (in the UI editor)

-gadgets attached to a tab page move with the tab when it is repositioned.
-gadget nudging via the arrow keys
-multi-select or grouping to move many gadgets at once.

also, it would be nice to be able to create bottom-oriented tabs.

Thanks again for releasing (and supporting!) such a useful and well executed library!

mrtricks(Posted 2003) [#57]
Fullernator... I've found a couple of bugs which you may want to address.

1) The UI Editor crashes out with an illegal memory address. I had made one window with some stuff, then another, then I deleted the first one, then when I clicked back onto the second one to edit it, it crashed. Happens every time.

2) In the compiled code, there is a comma missing from the line that sets up sliders, just before the RGB data, which I had to put in manually.

3) I can't seem to get the shortcut keys to work.

I'm really enjoying working with it. One feature that I would find REALLY useful in the editor is the ability to copy items, ie to make several similar sliders etc - also to be able to move an item from one window to another: it would save a lot of work in duplicating a load of stuff because I want to put it in a different window.

R0B0T0(Posted 2003) [#58]
A few more niggly requests:

-The use of number pad keys in text fields, spinners etc.
-Double clicking auto selects all text in gadget

Looks like you have your hands full ;)

JaviCervera(Posted 2003) [#59]
Hm Fuller, it seems that in the last update, text boxes does not scroll. I have a single line text box, which contains the name of a file. When the name of the file is longer than the size of the box, it does not scroll while i'm writing. If I remember right, this was working right in older version of BlitzUI.

Hey I sent you 3 new colour schemes to your e-mail, did you receive them?

AndyBoy_UK(Posted 2003) [#60]
Cheers for the updates Fullernator, its a wicked system.

Will post a link to any app developed with it, and of course youre credits are on teh splash page :)

mrtricks(Posted 2003) [#61]
That crash I mentioned -- it DIDN'T happen if I deleted all the gadgets in the window before deleting the window.

Also, setting a group of buttons to be toggled like radio buttons doesn't seem to work yet, unless I'm doing it wrong: My understanding is that only one will be pushed in, and will pop out if you click on another in the group. But I could have all four pushed in at once...

Odds On(Posted 2003) [#62]
Thanks for the suggestions and bug reports.. I'll be releasing an update with as much of it done as possible soon.

I can already confirm that the following is fixed/added.

- Nudging with arrow keys in gui editor
- Cloning in gui editor (Hold down CTRL, click on a control and drag the mouse)
- Compile error fixed (missing comma in slider code)
- Numpad numbers work in text boxes
- Double clicking in text box selects all text
- Single line text box scrolling bug fixed
- 3 new colour schemes added
- Several examples added

ROBOT0, multi-selection would be very complicated to do so unless I rewrite the gui editor it probably isn't gonna happen :(. Bottom orientated tabs is on the list of things to do, and so is reposition gadgets owned by tabs.

mrtricks, I can't recreate the crashing bug here.. could you run BlitzUI with debugging enabled and try and narrow down the problem? to use shortcuts you have to do:

If ShortCut( "Ctrl", 24 ) = True ;Ctrl + O pressed
;Do this

The next update has an example of it in action. Grouping buttons should work as well.. click on a button in the gui editor and go to the Edit window for it.. then tick the Toggle Button checkbox. Do the same for all the other buttons and make sure the ID is the same for all buttons in the same toggle group.

Qcat(Posted 2003) [#63]
Cool anther out stansing update!!!

Litobyte(Posted 2003) [#64]
Hey Chris, I was away from forums...

Thanks for the amazing contribution!!!
(sorry If hadn't time to test it)

I will have a play soon with it! ;

dynaman(Posted 2003) [#65]
[edit] - well it worked right after I posted this, don't know why though...

I keep getting a cannot find database lgdb message when trying to download the file (or trying to login to the site)

Any ideas?

Odds On(Posted 2003) [#66]
hmm.. I don't know why it would do that when trying to download the file. I know it does it when trying to login though.

there's a direct link to the latest version.

fredborg(Posted 2003) [#67]
Fullernator you're an everyday hero! I'm gonna use this :)


JaviCervera(Posted 2003) [#68]
Ey Fuller... another bug. It seems that I cannot add sub-nodes into a node tree.

mrtricks(Posted 2003) [#69]
I've got it up and running! TOTAL TERRAIN 2 now houses BlitzUI under its hood, and looks lovely for it! There's a download of v0.29 over at BlitzShowcase, so you can see the GUI working in situ.

Click for screenshot (Not embedded into the forum post because it's quite big and it's just annoying when a big screen is in the post :)

@ Chris: I worked out what I was doing wrong with grouped buttons and shortcuts -- honestly, this is just a dream to use... I even managed to work out how to use all the SendMessages I need without documentation: it's just so logically set out. I'll try to recreate that crash for you sometime tomorrow.

Odds On(Posted 2003) [#70]
Jedive, I know about that problem and it's been fixed :) Tree Views basically aren't supported in the gui editor currently, but they are fully supported in this new update which I will probably be releasing tomorrow (It's becoming quite a large update). The updates won't be as frequent after this next update because I need to spend more time on other projects.

mrtricks, it's great to see a tool using BlitzUI so soon :D especially one as powerful and useful as Total Terrain 2.

JaviCervera(Posted 2003) [#71]
Here's a VERY early pic from a project I am porting to BlitzUI (in fact, i have decided to start it from scratch). It's a very intuitive map editor, and (i hope) powerful. It contains a scalable window which does not stretch the buffer like Blitz does in Graphics mode 3.

R0B0T0(Posted 2003) [#72]
Awesome, can't wait for the next update! Sounds like you are going to address almost everything I need. It's funny, I was going to suggest cloning by CTRL method, but you are 1 step ahead ;)

I've been stuck at a dead end with my 3d game editor for a few months, I have the code but I'm at the stage where I need the GUI and it seemed daunting to tackle. This is a godsend, thanks again!

Peter(Posted 2003) [#73]
Great library, Fullernator !!!

I was away for the weekend, but with my notenook at hand.

And after fiddling around with BlitzUI I thouth I should do scrollbars for ComboBoxes on my own. But back at home, what a surprise, it's all done.

But I would like to add a few ideas to the above.

- Please make the GadgetStrip optional (ComboBox, ListBox)
- the ScrollBar of the ComboBox should have the same width
as the button of the ComboBox


Odds On(Posted 2003) [#74]
BlitzUI Update 5 is ready :D

I've implemented as many of the suggestions as I can, but there were a couple that I couldn't (and 1 or 2 that will be in a future update).

Jedive, 3d architect is looking good :)

dynaman(Posted 2003) [#75]
[edit] - dany I see you already added it!

Played with this last night - very good stuff.

Is it possible to add in keypad support?

Odds On(Posted 2003) [#76]
Thanks dynaman, I thought I added keypad support but for some reason GetKey() doesn't return anything when I click on any of the keypad numbers (with or without Num Lock).

Anyone have any idea why?

Koriolis(Posted 2003) [#77]
It looks like a bug, or at least a missing feature.

I've coded that rapidly, it works.
Function GetKey_()
	Local k% = GetKey()
	If k Then
		Return k
		Select True
			Case KeyHit(71) Return Asc("7")
			Case KeyHit(72) Return Asc("8")
			Case KeyHit(73) Return Asc("9")
			Case KeyHit(75) Return Asc("4")
			Case KeyHit(76) Return Asc("5")
			Case KeyHit(77) Return Asc("6")
			Case KeyHit(79) Return Asc("1")
			Case KeyHit(80) Return Asc("2")
			Case KeyHit(81) Return Asc("3")
			Case KeyHit(82) Return Asc("0")
			Case KeyHit(83) Return Asc(".")
		End Select
End Function

Odds On(Posted 2003) [#78]
Nice one Koriolis! I've uploaded it again using your code :D

Koriolis(Posted 2003) [#79]
I just realize I didn't even said it myself (I thought I had...) : this is an awsaome work! Thanks a lot.

Reda Borchardt(Posted 2003) [#80]
This is bloody amazing, breathtaking, earth-shattering and I don't know what else. This is the coolest thing since the release of Blitz3D itself.

This has become an integral part of Blitz3D for me.

Kind regards
Reda Borchardt

Paul "Taiphoz"(Posted 2003) [#81]
Can I ask one question..

Can this be used royalty free ??

Odds On(Posted 2003) [#82]
yep :)

dynaman(Posted 2003) [#83]
Any idea on when the docs for sendmessage and the different types of events will be done? If you need any help I could volunteer. I like the way the sendmessage and events systems seem to be laid out, very well done. (slap my head and say "why didn't I think of that" well done)

Peter(Posted 2003) [#84]
Attention !!!
Bug Report:

If you have a window with a ComboBox that, if activated, extends out of the windows boundaries, the area out of the window is not recognized as a part of it (e.g. you could not click on the bottom ScrollBar button if it is out of the window)


Odds On(Posted 2003) [#85]
dynaman, I'll try and get it done as soon as I can. Hopefully won't be too long.

Peter, thanks for the bug report. I've uploaded update 5 again with the fixed code.

Paul "Taiphoz"(Posted 2003) [#86]
Well all I can say is that your BLUDDY MAD cos I would have sold this.

Oh and did I mention that Im glad your MAD :)

This is an amazing set of functions m8 well done and I cant wait to re do some of my editors with blutzui

mrtricks(Posted 2003) [#87]
Hi Chris; I dl'd #5 update, but the zip file was corrupt. Any others had this problem?

Also, in the docs, there is no mention of commands like AddListBoxItem etc. I really need to know how they work at the moment and I can't figure it out by looking at your example codes...

ALSO: One other compiling error I noticed... the X and Y starting positions of all windows is set to -1, regardless of what it is in the editor. Don't know if this is still true in #5, for obvious reasons.

This thread is getting pretty heavy... Maybe we need a new forum just for this!

Odds On(Posted 2003) [#88]
I just tried downloading it and it seemed fine.. maybe you downloaded while I was uploading the new version or something. If it does it again I'll reupload it.

The docs are a bit incomplete at the moment, but I have a bit more time to work on them now so I'll release an updated version soon hopefully :)

AddListBoxItem() is used like this

lst = ListBox( 10, 10, 100, 100 )
AddListBoxItem( lst, 0, "Item" )

the first parameter is the handle to the list box
the second parameter is the position to add the item to (0 = end of list)
the third parameter is the caption
the fourth parameter is an optional icon (can be an image handle or a filename)

AddComboBoxItem() is exactly the same :)

Yavin, hehe Im not mad, just generous.

Do you think I should create a forum on my site?

mrtricks(Posted 2003) [#89]
Thanks mate! I'll try dl'ing again.

I had figured out AddListBoxItem, but I didn't know if there were any others. Is there a DeleteListBoxItem or ChangeListBoxItem etc, or do you have to REFRESH and add all but the one you're deleting? Also, are the only choices of positioning either a number or the end? Can you insert an item in between two existing items or will it always obliterate the one already there?

As for forums, I tend to only look at the ones here. But I think there'd be enough material to put on a forum just for this...

Odds On(Posted 2003) [#90]
I should probably add a DeleteListBoxItem() command, but for now you can use

SendMessage( lst, "LM_DELETEITEM", Index )

If there are 6 items in the list box and you delete item 4, items 5 and 6 move up a place.

AddListBoxItem() doesn't insert the item you add inbetween 2 existing items, it just replaces anything that is in the same spot you're adding to.

makakoman(Posted 2003) [#91]

Great function library. Thanks alot. Are you planning on adding a sort function to the file dialogs? It is difficult to find the right directory when they are listed in unsorted order.

Thanks again,

Odds On(Posted 2003) [#92]
I think Blitz already sorts them into the same order they are in windows explorer.. I guess I could code it to list them alphabetically at some point.

fredborg(Posted 2003) [#93]
I'm using this to sort listbox items, feel free to include it:
Function SortListBoxItems( ID = 0, sortalpha = True, sorticon = False)
	; sortalpha = Sort alphabetically if true
	; sorticon  = Sort by icon if true
	; Bubblesort by Simon Armstrong
	If ID = 0
		gad.ListBox = First ListBox
		For gad.ListBox = Each ListBox
			If gad\ID = ID
	Local cb,cbb,cbbb,flag,tmp$

	; Sort by Alpha
	If sortalpha	
		While flag
			cbb = gad\count-1
			While cbb<>cb
				cbbb = cbb-1
				If cbbb<0 Exit
				If gad\Item[cbb]<gad\Item[cbbb] 
					tmp = gad\Item[cbbb]
					gad\Item[cbbb] = gad\Item[cbb]
					gad\Item[cbb] = tmp
					tmp = gad\Icon[cbbb]
					gad\Icon[cbbb] = gad\Icon[cbb]
					gad\Icon[cbb] = tmp
					tmp = gad\IconSource[cbbb]
					gad\IconSource[cbbb] = gad\IconSource[cbb]
					gad\IconSource[cbb] = tmp				
	End If

	; Sort by icon
	If sorticon
		While flag
			cbb = gad\count-1
			While cbb<>cb
				cbbb = cbb-1
				If cbbb<0 Exit
				If gad\IconSource[cbb]<gad\IconSource[cbbb]
					tmp = gad\Item[cbbb]
					gad\Item[cbbb] = gad\Item[cbb]
					gad\Item[cbb] = tmp
					tmp = gad\Icon[cbbb]
					gad\Icon[cbbb] = gad\Icon[cbb]
					gad\Icon[cbb] = tmp
					tmp = gad\IconSource[cbbb]
					gad\IconSource[cbbb] = gad\IconSource[cbb]
					gad\IconSource[cbb] = tmp
	End If

End Function
Probably not up to date, as I'm not using the newest version...


Peter(Posted 2003) [#94]
Attention !!!
Bug Alert:

Fullernator, thx for fixing the ComboBox Bug, but there is still a glitch with it. If a window with an extending ComboBox (like I described above) is on top of another window(e.g. OpenFile dialog on top of the main application window) and you click on the activated ComboBox outside of the dialog window, BlitzUI thinks one had clicked on the main window.

Next, I think there is a memory leak in your code. Everytime, when a new image (via handle) is assigned to the same Image/ImageBox you create a new image using CopyImage without freeing the memory of the previously used image.


Odds On(Posted 2003) [#95]
Peter, thanks for the bug reports. They'll be fixed by the next update.

_PJ_(Posted 2003) [#96]
Are the patches cumulative?
Do I have to download the original PLUS ALL the pdates or just the latest?

dynaman(Posted 2003) [#97]
Just the latest.

LAB[au](Posted 2003) [#98]

I am not sure how to do this. I want to disable a function whenever something is inputed in textboxes, is there an available pointer to such information? I guess yes because there is a cursor appearing in the textbox. I putted an extra variable in the updatetexbox function but perhaps there is allready something for it?


Odds On(Posted 2003) [#99]
If you need to know when the text box is active then you can do:

txt.TextBox = Object.TextBox( thistextbox )
if txt\Active = true
;Not active

Ziltch(Posted 2003) [#100]
Wow, just what I was looking for!!

Thanks for sharing.

Peter(Posted 2003) [#101]
Hi Fullernator,

I would like to see that images/imageboxes are generating an (mouse)event if clicked.

Or is there already a method to detect if a ImageBox was clicked?


Odds On(Posted 2003) [#102]
image boxes return the mouse x and y position if the mouse is over the image so you can just do something like:

Select app\GadgetEvent
    Case myimgbox
        if app\GadgetEventData > ""
            if app\MB1 = 1 ;Mouse click
End Select

The mouse x and y is stored in app\GadgetEventData in the format X/Y. BlitzUI has a Parse function so all u have to do to retrieve either coordinate is:

mouseX = Parse( app\GadgetEventData, 0, "/" )
mouseY = Parse( app\GadgetEventData, 1, "/" )

Imphenzia(Posted 2003) [#103]
Just had a quick look at the Gui today... amazing stuff! and thanks for sharing!

mrtricks(Posted 2003) [#104]
I've created a much more fully featured File Selector (both save and load) for BlitzUI. Includes double click, extension filtering (multiple groups of extensions with description), overwrite warning, new folder creation, illegal character warning... It's very simple to include into your programs in with the BlitzUI code and should be flexible enough for almost any purpose.

Get it from the code archives now. Hope it's good for some people... If anyone notices anything wrong with it, can you let me know on [a]contact@...]?


BTW, this is a simple program to illustrate the point. It loads an image, then you can save it. Save this in a folder, then save the archive code as "" in the same folder, then run this.

Graphics 640, 480, 32, 2
SetBuffer BackBuffer(  )
Include ""
;Load fonts and mouse cursors
;and collect information
Initialise(  )

Include ""

Global win1 = Window(10,10,100,60,"click these","0",1,0,0,0)
Global btn1 = Button(2,2,40,21,"save","0",1,0,0)
Global btn000002 = Button(50,2,40,21,"open","0",1,0,0)
Global img111


	If img111 Then DrawImage img111,500,40

	;Draw the GUI and update the mouse
	UpdateGUI(  )
	;Event Handling
	Select app\Event
			Select app\WindowEvent
			End Select
			Select app\MenuEvent
			End Select
			Select app\GadgetEvent

				;save dialogue
				Case btn1
				fi$="All Files (.*);Image Files (.bmp .jpg .tif)*"
				fi$=fi$+";Blitz Code (.bb);Executables (.exe)"
				SAVE_DIALOGUE( fi$ , "" )

				;open dialogue
				Case btn000002
				fi$="All Files (.*);Image Files (.bmp .jpg .tif)*"
				fi$=fi$+";Blitz Code (.bb);Executables (.exe)"
				OPEN_DIALOGUE( fi$ )

			End Select
	End Select
	;Draw the mouse
	DrawMouse(  )
	;Reset all GUI events
	ResetEvents(  )

Until KeyHit( 1 ) Or app\Quit = True
;Free all images and controls created by BlitzUI
Destroy(  )

Function SAVE(f$)
	If img111 Then SaveImage(img111,f$)
End Function

Function OPEN(f$)
	If img111>0 Then FreeImage img111
	ResizeImage img111,100,100
End Function

Odds On(Posted 2003) [#105]
Wow! Thanks for the contribution mrtricks :D Its nice and easy to integrate it into a BlitzUI app :)

R0B0T0(Posted 2003) [#106]
Nice one mrtricks, I was just about to tackle this myself:) Thanks for posting, I'll be giving this a try tonight.

Peter(Posted 2003) [#107]

there is another possible memory leak in your BlitzUI code.

In your DeleteWindow() function you do not free the Icon images of the ListBox and the ComboBox gadgets.

feature wishlist:

A DeleteGadget() function would be nice.

extending the usability of ScrollBars - clicking into the white area of the scrollbar, between the top button and the middle button and between the middle button and the bottom button should scroll one 'page' up/down.


poopla(Posted 2003) [#108]
hmm... when will we see tab pages in use? I could use them :).

poopla(Posted 2003) [#109]
Also, I dont see a way to use menu/menu items in the version I have here. Is there a newer version?

[Edit] I see there are some updates :) But still no way to use tabs or files?


Odds On(Posted 2003) [#110]

Thanks for letting me know about the DeleteWindow() function. Someone else has also requested that feature for scrollbars so I'll be sure to add it :) A DeleteGadget() function should be easy to add as well.


Tab pages and menus have been usable from day one... to create a menu you would do:

win = Window( 10, 10, 200, 200, "Window", 0, True, True )
mnuFile = MenuTitle( "File" )
mnuFileNew = MenuItem( mnuFile, "New", "Ctrl+N" )

To use tabs you would do:

win = Window( 10, 10, 200, 200, "Window", 0, True, True )
;Gadgets created here go on the window
tab = Tab( 5, 5, 100, 100 )
TabPage( "Tab One" )
;Gadgets created here go on tab one
TabPage( "Tab Two" )
;Gadgets created here go on tab two
;Gadgets created here go on the window

mrtricks(Posted 2003) [#111]
I've found that "WM_GETCAPTION" and "WM_SETCAPTION" do not work, unless the method of using them is not obvious...

Also, it would be great if the mousewheel scrolled down listboxes...

Also: if a combo box has too many items, they go off the screen and you cannot access the bottom ones: scrolling?

ALSO with combo boxes, if one is just above another and you open the top one, sometimes the closed one below pastes over the top combo's list. Some kind of method to draw the open combo list last might help.

One last consideration for the future: how about a window with a see-through portion? That way you could have a camera view in a window, and multiple camera windows... If not that, maybe an option to selectively draw windows when rendering. That way you could draw a window, then render a camera view on that, then another window and another camera view on that, then the actual tool windows... see what I'm getting at?

You must be REALLY busy right now with this! It's just fantastic.

Odds On(Posted 2003) [#112]
oops.. "WM_GETCAPTION" and "WM_SETCAPTION" are actually "WM_GETTEXT" and "WM_SETTEXT".. after writing that part of the docs I decided to change it to match with all the other gadgets but never updated the docs.

mouse wheel support is on the list of stuff to add :)

Scrolling in combo boxes was added in one of the recent updates.. use it like this:

cbo = ComboBox( 10, 10, 200, 20, 16, 5 )

First 4 parameters are standard (X, Y, W, H), 5th parameter is item height and 6th parameter is max number of items to show before a scroll bar is needed (Leave as 0 for no scrolling)

To stop combo boxes overlapping like that you have to create the combo boxes in reverse order (highest one last). It's a pain I know but not a great deal I can do about it since BlitzUI draws the controls in the order they were created.

Cameras and viewports will hopefully be ready by the next release :). I've found you don't need to do any fancy stuff to the window you just have to hide and show the camera when needed.

poopla(Posted 2003) [#113]
Fullernator, what about through the editor?

poopla(Posted 2003) [#114]
I see! Very nice, great work fullernator.

Aoneweb(Posted 2003) [#115]
I have clicked most of the links on this page but cant get to the BlitzUI download, is the server down?

poopla(Posted 2003) [#116]
How (through the editor, do ya instruct a gadget to be in a certain page? Im loving BlitzUI btw, this thing rocks, ill be using it alot. Is there a chance of window skins? Or did I miss that they are already in?

R0B0T0(Posted 2003) [#117]
Create a tab (by dragging it to the size you want in a window). Then add one or more tab pages, and any gadgets you create inside a tab page will be visible when that tab page is selected.

There are colour schemes, but no skins as of now.

poopla(Posted 2003) [#118]
Aye, the schemes are a start, but skins are pretty nice to have supported.

Odds On(Posted 2003) [#119]
Aoneweb, yes the server is down.. our host is upgrading their servers I think so I'm not sure how long it will be down.

In the meantime I'll put a temporary page on my server so you can download it as long as my PC is on :)

[link removed]


The server is no longer down.. you can get it from the original link now :)

mrtricks(Posted 2003) [#120]
Cool, got my windows captions working now :)

Another command that I can't get working is CM_GETPOS. It works okay to get the X figure, but doing CM_GETPOS,1 for the Y figure (like WM_GETPOS for the windows) comes up with the same figure as the X.

Also: it would be great to add a command CM_GETOPEN or something which tells you if the combo box is open or not... the reason that would be good is for a function I made to test if the mouse is over the window - and I want to do another one to see if it's over the combo box, as the combo box goes below the bottom of the window when open.

Chris, what have you done? I haven't slept for days from making GUI's of everything that moves! :)

Odds On(Posted 2003) [#121]
There are a few things I'm not happy about with BlitzUI at the moment so the next update is going to be fairly big I think :P One of the things is the CM_GETPOS example you gave.. to get the Y position you have to leave the first parameter of SendMessage blank (empty string). If you set it to False (which is how it should be) it still thinks you want the X position.

A few other things I'm not happy about are stuff like combo boxes and list boxes.. the items are currently stored in an array which make them hard to move around etc. I'm gonna change them to use Types for the items. I'm also adding a lot more functions for them (eg DeleteComboBoxItem())

The NoActiveGadgets() function will tell you if a combo box or a menu is open.

haven't slept for days eh? I recommend making an application that counts sheep :) don't test it too much while developing it though.. wouldn't want you to fall asleep or anything :D

Aoneweb(Posted 2003) [#122]
Thanks fullernator I have downloaded your very cool app

mrtricks(Posted 2003) [#123]
The NoActiveGadgets() might just about do for now, but for what I need to do it would be useful to know if a PARTICULAR gadget is open. Thanks for the lowdown on the CM_GETPOS - odd that it's not the same as the Window equivalent...

Techlord(Posted 2003) [#124]




poopla(Posted 2003) [#125]
@Fullernator: Is there any chance of fully skinned windows rather then just the OS look? That would be a really nice addition.

Doiron(Posted 2003) [#126]
A tiled image instead of a fixed color for the background would already be nice.

As everyone said, thanks for your excellent work Fullernator: I am using this GUI for my next project. :)

poopla(Posted 2003) [#127]
To get a particular window to always be drawn on top of all other windows, could I not simply write "window\alwaysontop = true"? It doesnt seem to work.

[Edit] Also, how do we add tool tips through the editor?

Smurfpuss(Posted 2003) [#128]
need some help making a world editor for my game and well having some prob using blitzui

Case btn002
heightmapFilename$ = FileDialog( "Open File", CurrentDir(), ".bmp" )
If heightmapFilename$ > ""
If FileType( heightmapFilename$ ) = 1 And ( Right( Lower( heightmapFilename$ ), 4 ) = ".bmp")
SendMessage( txt002, "TM_SETTEXT", 0, heightmapFilename$ )
Case spn002
SendMessage( spn002, "SM_GETVALUE", Terxscale#)
ScaleEntity TERRAINNAME$,terxscale#/256,teryscale#,terzscale#/256
Case spn003
SendMessage( spn003, "SM_GETVALUE", Teryscale#)
ScaleEntity TERRAINNAME$,terxscale#/256,teryscale#,terzscale#/256
Case spn004
SendMessage( spn004, "SM_GETVALUE", Terzscale#)
ScaleEntity TERRAINNAME$,terxscale#/256,teryscale#,terzscale#/256

Like the terrain dosent seem to scale it only dissapers from the screen

Pete Rigz(Posted 2003) [#129]
If your 'getting' values from gadgets it should be:
terxscale#=SendMessage( spn002, "SM_GETVALUE" )
Teryscale#=SendMessage( spn003, "SM_GETVALUE" ) 
etc etc.

Odds On(Posted 2003) [#130]
T-Bogard, tool-tips can't be added through the editor yet... setting a window to always be on top isn't as simple as setting that variable to true.. the window has to be set to the first window in the type (gad.Window = First Window) and app\topWin should also be set as the window (app\topWin = gad).

Smurfpuss, Rigz answered your question :) Thanks Rigz.

poopla(Posted 2003) [#131]
thanks Fullernator

poopla(Posted 2003) [#132]
@Fullernator: How do I find out if there is a window currently being clicked or dragged anywhere on screen?

[Edit] Still loving BlitzUI, this is the most intuitive blitz GUI ive used thus far. Btw, does the lack of response to my Q's about window skins mean theres no chance? :)

Odds On(Posted 2003) [#133]

to find out if a window is being dragged you can do

win.Window = Object.Window( thiswindow )
if win\Dragging = true
    ;window is being dragged
    ;window is not being dragged
I'm not sure about window skins just yet. They would be a very nice feature to have but they would require lots of images, and one of the main aims of BlitzUI was speed so I don't know... Maybe there could be two versions or I could make it an optional feature which can be turned on by setting a variable to true or something.

Doiron(Posted 2003) [#134]
I'm not sure about window skins just yet. They would be a very nice feature to have but they would require lots of images, and one of the main aims of BlitzUI was speed so I don't know... Maybe there could be two versions or I could make it an optional feature which can be turned on by setting a variable to true or something.

As I said before, what about a simple BG tiled image for a start? I know, I have the source so I could do it myself though. :)

Odds On(Posted 2003) [#135]
Doiron, the thing is, even though adding a simple tiled background to a window would be easy it would probably create some undesired effects on gadgets. Most gadgets (buttons, combo boxes, progress bar, scroll bar, spinner etc) have at least some invisible parts to them (Buttons are drawn using 2 hollow rectangles) so you would see the window background through the gadgets.

steve.jr(Posted 2003) [#136]
Just to say thanks for a wonderful addition to blitzplus


Smurfpuss(Posted 2003) [#137]
Thanks Rigz

Gabriel(Posted 2003) [#138]
I've been using XLnt up until now, and I'm very happy with it. But a quick play with this, and I think this is great too. Two fantastic free GUI's for Blitz. We're spoiled.

Great work. The mutt's nuts as they say ;)

Peter(Posted 2003) [#139]

could your GUI be used to build Context (Right Click) Menus?


Smurfpuss(Posted 2003) [#140]
Need some help for my prodject saving and loading files

dosen't seem to work all the time to load the file

This is the save function
Function SaveNoe( Filename$ )
File = WriteFile( Filename$ )
WriteString File, SendMessage( Tername$, "TM_GETTEXT" )
WriteString File, SendMessage( Termap$ , "TM_GETTEXT" )
WriteInt File, SendMessage( Txscale%, "SM_GETVALUE" );Terrain xscale
WriteInt File, SendMessage( Tyscale%, "SM_GETVALUE" );Terrain yscale
WriteInt File, SendMessage( Tzscale%, "SM_GETVALUE" );Terrain zscale
WriteInt File, SendMessage( xpos%, "SM_GETVALUE" );Terrain x pos
WriteInt File, SendMessage( ypos%, "SM_GETVALUE" );Terrain y pos
WriteInt File, SendMessage( zpos%, "SM_GETVALUE" );Terrain z pos
WriteInt File, SendMessage( Lod%, "SM_GETVALUE" );Terrain z pos
;WriteInt File,camx%;Cam x
;WriteInt File,camy%;Cam y
;WriteInt File,camz%;Cam y

;WriteInt File, SendMessage( xscale, "SM_GETVALUE" )
;WriteInt File, SendMessage( xscale, "SM_GETVALUE" )

;writestring File, OpenDir
;writestring File, SaveDir
;writestring File, ImageDir
;WriteInt File, Terxpos%
;WriteInt File, Terypos%
;WriteInt File, Terzpos%
;WriteString File, heightmapFilename$
;WriteInt File, nDepth
;WriteInt File, nMode
CurrFile$ = Filename$
AppTitle "Nova Editor - " + Filename$

CloseFile File

End Function
This is the load function i have made
Function LoadNoe(Filename$)
File = ReadFile( Filename$)
Tername$ =ReadString$(File)
Termap$ =ReadString$(File)
Txscale% =ReadInt(File)
Tyscale% =ReadInt(File)
Tzscale% =ReadInt(File)
AppTitle "Nova Editor 0.03b- " + tername$
CloseFile file
Tername$ =LoadTerrain(Termap$)
ScaleEntity Tername$,Txscale% ,Tyscale% ,Tzscale%
PositionEntity Tername$,xpos%,ypos%,zpos%
TerrainDetail Tername$,Lod%,True
End Function

But it dosen't seem to get it right like the save function i think is right but not the load pleas help

Odds On(Posted 2003) [#141]
Peter, context (right click) menus aren't supported yet.. but I intend to add them to the next version.

Smurfpuss, the code looks fine and it should work... what specifically isn't working? Looking at the code and the info you gave me all I could suggest is using floats instead of integers for a few of those values.

Try printing the each value you read from the file to the screen so you know if it's loading the correct values or not.

Rimmsy(Posted 2003) [#142]
Full, great library. How hard would it be to make a version of the editor to export blitz+ code like Lee's GUI editor that came with plus?

This would be fantastic.


Smurfpuss(Posted 2003) [#143]
Well i have and it does print it correctly on to the screen but some times it dosen't print any thing at all why like dosen't it close the file or it hangs up or some thing

poopla(Posted 2003) [#144]
I don't see any reference to the prospect of a generic file requester. Any chance of this happening?

Odds On(Posted 2003) [#145]
Rims, thanks :).. It wouldn't be too hard to make it export blitz+ code but I'm not going to add it because it would be a bit pointless because the whole point of BlitzUI is so you don't have to use the Blitz+ gadgets (If you use it with Blitz+)

Smurfpuss, if you want you can send me the entire project to my email address (cfuller@...), if not then there's nothing else I can do to help.

T-Bogard, if you download the Extras pack you will find a file requester in there... also, mr tricks made one which he submitted to the code archives.

poopla(Posted 2003) [#146]
Oh, thank you! :)

poopla(Posted 2003) [#147]
Seem to be having trouble getting the file requester in the "extras" DL to return anything...

Odds On(Posted 2003) [#148]
Smurfpuss, don't know why I never noticed this before but there are 2 major things wrong with your code.

1. All BlitzUI control handles return an integer id, using a string as a handle could cause wierd things to happen.

2. You're using the same handle to create a textbox control as you are to read in the value of a string. Basically your doing this:

mytxtbox$ = TextBox()
mytxtbox$ = "a string"

so naturally, when you try to reference the text box after doing that BlitzUI isn't going to recognise it.

Bot Builder(Posted 2003) [#149]
Holy crap! this is just as good, if not better than blitzplus. Nice work! I'll probably use it in my level editer for my game.

I also have a little UI editer error:

The X/Y positions for an object don't change as you nudge it. if you click on the object, it updates.

Odds On(Posted 2003) [#150]
Thanks bot :) I'll fix that bug.

Recently, I've been toying with the idea of creating an all-in-one GUI editor along the lines of VB. You would open something like BlitzUI Editor, and instead of just designing your interface and exporting to blitz code it would allow you to add interaction from the editor by writing blitz code (or maybe a custom language) for each gadget etc.

What are everyone's thoughts on this?

Qcat(Posted 2003) [#151]
Hi Fullernator

Has I was a VB user for many years I wood love to see this, it wood be nice to be able to attach blitz code to Gui Events with in the editor

An idea I had(Not sure it is a good one) was to have the Gui Editor export all the Gadget setup code into an include witch cood then be called from the main program. This way it might be possible to re load the gui lay out into the editor for tweaking rather than having to have to change the exported code manly!!. I am not sure if this wood work in reality like I say it was just an idea


Odds On(Posted 2003) [#152]
yea, one of the main things I want to try and implement is being able to modify the appearance of the GUI at any stage of development, not just before you start coding. An include file might be the way to do that.. the GUI code would be the main code file, and the interaction etc would be the include file. I would have to adjust the GUI export code to include calls to functions, eg:

;GUI Code




Until whenever

Then in the include file you would have all the My..() functions.

Qcat(Posted 2003) [#153]

That Sounds like it wood work well!

Smurfpuss(Posted 2003) [#154]
Well can you pleas send me back the code with the changes you mean like if no i won't understand any thing like :?

dirkduck(Posted 2003) [#155]
Wow, this is really nice! Good job with it. The only thing is that I can't find any help documents covering a lot of the commands (<whatever>M_GETSIZE for example). I'm wondering how do do things like get the x and y size's from a window, but I dont know how to, and can't find the help for them. Are you planning on adding them? Thanks

IPete2(Posted 2003) [#156]

Many thanks, and good luck with your other projects.

Best regards


Odds On(Posted 2003) [#157]
Smurfpuss, I'll email the code to you after I type this reply.

dirkduck, thanks :).. the help files for the SendMessage parameters aren't done yet, but I do intend to do them. I'll use WM_GETSIZE as an example since you mentioned it:

windowX = SendMessage( mywindow, "WM_GETSIZE", True )
windowY = SendMessage( mywindow, "WM_GETSIZE", "", True )

Hope that helps.

Now that I think about it Smurfpuss, I can't really make the changes to the code for you because I don't know what variable names you want to use or anything. Just remember that you cant use the same variable for two things (handle to a gadget and hold text for example) at once.

dirkduck(Posted 2003) [#158]
Thanks for the example! So just supplying an empty parameter after the M_<message> will get the 'second' value if there is one?

poopla(Posted 2003) [#159]
is it possible we could specify a default color for image boxes? I have one that is like 500x400, and I'd rather not use a image. So being able to specify either an image or a default color would be great. Since there is no "whiteboard" type thing in there yet.

Odds On(Posted 2003) [#160]
dirkduck, yes it is.

T-Bogard, sure I can that.. it'll be in the next version :)

poopla(Posted 2003) [#161]
Thanks :D. I really need to know how I tell if a cetain TapPage is open... How long till those sendmessage procedures docs are written? :)

Smurfpuss(Posted 2003) [#162]
is it in some way possible when using spinner to make the value go - like i have the min value 0 to 100 but i whant it to be ablle to go -100 to 100

Odds On(Posted 2003) [#163]
T-Bogard, use:

opentabpage = SendMessage( mytab, "TM_GETINDEX" )

mytab is a handle to a Tab gadget, not a TabPage gadget. The docs will be written when they're done ;)

Smurfpuss, yea it is possible:

spinner = Spinner( 10, 10, 80, 20, 0,-100, 100 )

The first 4 parameters are X, Y, Width and Height.. the next 3 are the starting value, min value and max value.

If you want to do it in BlitzUI Editor, select the spinner and click Edit from the Modify tab.

Smurfpuss(Posted 2003) [#164]
i will try that and pleas don't forgget about the e-mail pleas!! :)

Odds On(Posted 2003) [#165]
Smurfpuss, I edited my post yesterday.. I thought you saw it:

"I can't really make the changes to the code for you because I don't know what variable names you want to use or anything. Just remember that you cant use the same variable for two things (handle to a gadget and hold text for example) at once."

Smurfpuss(Posted 2003) [#166]
well i tryid having handel$=gadget and writestring$ file,handel$

but it dosen't seem to work like well i get text in the file but when i load it and use a the text command to print it it dosen't print every time like i will have to run the program 5 times and when i add the values to


can't finde heightmap error

like it does print correctly when i use text 10,10,handel$

but not all the time some times the screen is black no text

Odds On(Posted 2003) [#167]
you can't do that though.. with that code you're just writing the handle of the gadget to the file.

handle$ = TextBox()
handle$ = ReadString( File )
^ Example of VERY BAD code.

handle = TextBox()
txt$ = ReadString( File )
^ Example of GOOD code.

Smurfpuss(Posted 2003) [#168]
well wouldent it be


Odds On(Posted 2003) [#169]
no.. that is the same example of VERY BAD coding that I just gave in the previous post. Let me put it another way:

myvariable = 2
myvariable = 7
"myvariable = 7" is giving "myvariable" a new value.. so now every time you reference "myvariable" it will equal 7 and not 2. Just like with your code, every time you reference "handel$" it will equal wotever string it just read from the file, and not the textbox... as soon as you give "handel$" a different value, the TextBox might as well not exist because you can no longer do anything with it (eg read text from it, write text to it) which is why your code isn't working.

The correct way to do the example you just gave would be like:

handel = textbox() ;NOTE: No $ symbol
txt$ = ReadString( File ) ;Read a string from the file (location of a terrain file maybe)
SendMessage( handel, "TM_SETTEXT", 0, txt$ ) ;Put the string you just read from the file into the textbox.
terrain = LoadTerrain( txt$ ) ;Load the terrain
Obviously there's a lot of code missing from that like opening the file etc, but you already have that in your original code.

dirkduck(Posted 2003) [#170]
Hey Fullernator. Is there a common 'Open' dialog command (simmilar to BP's, just the standard Open dialog) like the one you used in the GUI Editor? Or does that have to be hardcoded?

Odds On(Posted 2003) [#171]
Yes there is.. there's 2 main ones to choose from. The first one comes in the Extras pack which you can download from the site.. the second one was made by mr tricks which was submitted to the code archives.

If you don't like either of those 2 you could open the BlitzUI Editor source code and find the creation code for the Open Dialog and copy it into your own source code (along with the RefreshDialog() function. Then you can use it like any other window you create (although I don't recommend this method because the code is scattered all over the place)

poopla(Posted 2003) [#172]
any chance of us getting nested tab's? :) They don't seem to work like this right now. On a side not, are we able to control what gadgets are drawn? Is there an internal variable we can possibly access to control this?

[Edit] May I take a crazy stab in the dark and assume that if Visible is set to true, it will draw the gadget, if set to false, it doesnt? :) Hope it's that easy.

Odds On(Posted 2003) [#173]
Nested tabs are planned, yes.

yep it is.. HideGadget() and ShowGadget() will hide/show the gadget.. one thing I realised when working on my application is that if you're using BlitzUI in BlitzPlus you need to rename those two functions to something else (eg BUIHideGagdet() BUIShowGadget() because HideGadget() and ShowGadget() are internal Blitz+ commands.

poopla(Posted 2003) [#174]
Thanks, Fullernator. Im pushing BlitzGUI to it's limits, and all the help is greatly appreciated. :) Great work on this.

Smurfpuss(Posted 2003) [#175]
This is driving me madcan any one help me with my load and save function like i can't get it to work

graphics3d 800, 600, 32, 2
setbuffer backbuffer( )
AppTitle "Nova Editor 0.03b"

Include ""
Include "extras/"
Include ""
Initialise( )
;//Main Menu
winMain = Window( 0, 0,-1, 24, "", 0, False, True )
mnuFile = MenuTitle( "File" )
mnuFileOpen = MenuItem( mnuFile, "Open...", "Ctrl+O", imgOpen )
mnuFileSave = MenuItem( mnuFile, "Save...", "", imgSave)
mnuFileCompile = MenuItem( mnuFile, "Compile", "")
MenuBar( )
mnuFileExit = MenuItem( mnuFile, "Exit" )
mnuCreate = MenuTitle( "Create" )
mnuCreateTerrain = MenuItem( mnuCreate, "Terrain..." )
mnuCreateSky = MenuItem( mnuCreate, "Sky..." )
mnuCreateSprite = MenuItem( mnuCreate, "Sprite..." )
mnuCreateWater = MenuItem( mnuCreate, "Water..." )
mnuCreateTexture = MenuItem( mnuCreate, "Texture..." )
MenuBar( )
mnuCreatewireframeon = MenuItem( mnuCreate, "WireFrame On" )
mnuCreatewireframeoff = MenuItem( mnuCreate, "WireFrame Off" )
mnuEdit = MenuTitle( "Edit" )
mnuEditAdd = MenuItem( mnuEdit, "Add Object...")
mnuEditRemove = MenuItem( mnuEdit, "Remove Object" )
mnuHelp = MenuTitle( "Help" )
mnuHelpHelp = MenuItem( mnuHelp, "Help...")
MenuBar( )
mnuHelpAbout = MenuItem( mnuHelp, "About" )

;// Terrain Window
winterrain = Window( 170, 73, 391, 281, "Terrain", "0", 1, 0, 0, 1 )
btn006 = Button( 325, 225, 60, 25, "Cancel", "0", 1, 0, 0 )
btn002 = Button( 332, 26, 20, 15, "...", "0", 1, 0, 0 )
Tershading = CheckBox( 118, 184, "Shading", 0 )
Termorph = CheckBox( 118, 167, "Vertex Morph", 0 )
lbl017 = Label( 16, 169, "Lod:", 0 )
lbl015 = Label( 16, 150, "Detail", 0 )
lbl014 = Label( 250, 114, "Roll:", 0 )
lbl013 = Label( 250, 96, "Yaw:", 0 )
lbl012 = Label( 250, 77, "Pitch:", 0 )
lbl011 = Label( 118, 114, "zpos:", 0 )
lbl010 = Label( 119, 96, "ypos:", 0 )
lbl009 = Label( 118, 77, "xpos:", 0 )
lbl008 = Label( 13, 115, "ZScale:", 0 )
lbl007 = Label( 14, 96, "YScale:", 0 )
lbl006 = Label( 13, 77, "XScale:", 0 )
lbl005 = Label( 250, 61, "Rotation", 0 )
lbl004 = Label( 118, 61, "Position", 0 )
lbl003 = Label( 13, 60, "Dimension", 0 )
lbl002 = Label( 8, 27, "Heightmap:", 0 )
lbl001 = Label( 8, 7, "Terrain Name:", 0 )
lbl021 = Label( 8, 45, "Texture:", 0 )
sld004 = Slider( 80, 184, 0, 0, 0.0, 0.0, 100.0, 1, 0, "210,210,210", "210,210,210" )
sld003 = Slider( 89, 205, 0, 1, 0.0, 0.0, 100.0, 1, 0, "210,210,210", "210,210,210" )
Lod = Spinner( 39, 167, 74, 17, 0.0, 1000.0, 8000.0, 100.0, 0, 0 )
TZscale = Spinner( 50, 116, 60, 15, 0.0, 1.0, 400.0, 1.0, 0, 0 )
TYscale = Spinner( 50, 96, 60, 15,0.0, 1.0, 400.0, 1.0, 0, 0 )
TXscale = Spinner( 50, 74, 60, 15, 0.0, 1.0, 400.0, 1.0, 0, 0 )
xpos# = Spinner( 153, 116, 60, 15, 0.0, 1.0, 1000.0, 1.0, 0, 0 )
ypos# = Spinner( 153, 96, 60, 15, 0.0, 1.0, 1000.0, 1.0, 0, 0 )
zpos# = Spinner( 153, 74, 60, 15,0.0, 1.0, 1000.0, 1.0, 0, 0 )
pitch = Spinner( 280, 116, 60, 15, 0.0, 1.0, 100.0, 1.0, 0, 0 )
yaw = Spinner( 280, 96, 60, 15, 0.0, 1.0, 100.0, 1.0, 0, 0 )
roll = Spinner( 280, 74, 60, 15,0.0, 1.0, 100.0, 1.0, 0, 0 )
Termap = TextBox( 80, 26, 250, 15, 0, 0, 18, 10, 0 )
Tername = TextBox( 80, 7, 250, 15, 0, 0, 18, 10, 0 )
TERRAINNAME =SendMessage( Tername, "TM_GETTEXT" )
SendMessage( winTerrain, "WM_CLOSE" )

;//Sprite Window
winSprite = Window( 125, 17, 652, 509, "Sprite Lib ", "0", 1, 0, 1, 1 )
btn025 = Button( 388, 267, 121, 25, "Cancel", "0", 1, 0, 0 )
btn024 = Button( 388, 240, 121, 25, "Random", "0", 1, 0, 0 )
btn023 = Button( 388, 212, 121, 25, "Apply", "0", 1, 0, 0 )
btn022 = Button( 395, 160, 240, 25, "Remove Sprite", "0", 1, 0, 0 )
btn021 = Button( 395, 131, 240, 25, "Add Sprite", "0", 1, 0, 0 )
btn020 = Button( 395, 102, 240, 25, "Delete Category", "0", 1, 0, 0 )
btn019 = Button( 395, 74, 240, 25, "New Category", "0", 1, 0, 0 )
btn018 = Button( 395, 46, 240, 25, "Change Category", "0", 1, 0, 0 )
btn017 = Button( 395, 18, 240, 25, "Default", "0", 1, 0, 0 )
grp004 = GroupBox( 388, 6, 255, 200, "CateGories" )
grp003 = GroupBox( 2, 6, 380, 425, "Sprites" )
imgbox010 = ImageBox( 132, 75, 60, 60, "0", 0, 0, 1 )
imgbox009 = ImageBox( 68, 75, 60, 60, "0", 0, 0, 1 )
imgbox008 = ImageBox( 318, 12, 60, 60, "0", 0, 0, 1 )
imgbox007 = ImageBox( 68, 12, 60, 60, "0", 0, 0, 1 )
imgbox006 = ImageBox( 131, 12, 60, 60, "0", 0, 0, 1 )
imgbox005 = ImageBox( 256, 12, 60, 60, "0", 0, 0, 1 )
imgbox004 = ImageBox( 5, 75, 60, 60, "0", 0, 0, 1 )
imgbox003 = ImageBox( 194, 12, 60, 60, "0", 0, 0, 1 )
imgbox002 = ImageBox( 5, 12, 60, 60, "0", 0, 0, 1 )
lbl025 = Label( 4, 449, "Sprite Path:", 0 )
txt012 = TextBox( 63, 445, 573, 21, 0, 0, 18, 10, 0 )
SendMessage( txt012, "TM_SETTEXT", 0, "" )
SendMessage( winSprite, "WM_CLOSE" )

;// Sky Window
winSky = Window( 130, 52, 514, 352, "Setup Skybox", "0", 1, 0, 1, 1 )
btn016 = Button( 443, 300, 66, 25, "Cancel", "0", 1, 0, 0 )
btn015 = Button( 366, 300, 75, 25, "Delete SkyBox", "0", 1, 0, 0 )
btn014 = Button( 294, 300, 70, 25, "Apply", "0", 1, 0, 0 )
btn013 = Button( 10, 191, 70, 25, "Change Color", "0", 1, 0, 0 )
btn012 = Button( 10, 156, 60, 25, "Load Floor", "0", 1, 0, 0 )
btn011 = Button( 10, 129, 60, 25, "Load Top", "0", 1, 0, 0 )
btn010 = Button( 11, 102, 60, 25, "Load Left", "0", 1, 0, 0 )
btn009 = Button( 10, 75, 60, 25, "Load Back", "0", 1, 0, 0 )
btn008 = Button( 10, 46, 60, 25, "Load Right", "0", 1, 0, 0 )
btn007 = Button( 10, 20, 60, 25, "Load Front", "0", 1, 0, 0 )
lbl022 = Label( 10, 292, "Z Scale:", 0 )
lbl021 = Label( 10, 272, "Y Scale:", 0 )
lbl020 = Label( 10, 251, "X Scale:", 0 )
lbl019 = Label( 10, 227, "Mesh Properties", 0 )
lbl018 = Label( 10, 3, "MapFiles", 0 )
sld016 = Slider( 52, 292, 100, 15, 0.0, 0.0, 100.0, 1, 0, "210,210,210", "210,210,210" )
sld015 = Slider( 52, 270, 100, 16, 0.0, 0.0, 100.0, 1, 0, "210,210,210", "210,210,210" )
sld014 = Slider( 52, 250, 100, 15, 0.0, 0.0, 100.0, 1, 0, "210,210,210", "210,210,210" )
txt009 = TextBox( 84, 191, 300, 25, 0, 0, 18, 10, 0 )
txt008 = TextBox( 73, 156, 300, 25, 0, 0, 18, 10, 0 )
txt007 = TextBox( 73, 129, 300, 25, 0, 0, 18, 10, 0 )
txt006 = TextBox( 73, 102, 300, 25, 0, 0, 18, 10, 0 )
txt005 = TextBox( 73, 75, 300, 25, 0, 0, 18, 10, 0 )
txt004 = TextBox( 73, 47, 300, 25, 0, 0, 18, 10, 0 )
txt003 = TextBox( 73, 20, 300, 25, 0, 0, 18, 10, 0 )
SendMessage( winSky, "WM_CLOSE" )

;// Browse Image Dialog
winImage = Window(-1, -1, 300, 195, "Open Image", 0, True, False, False, True )
lstImage = ListBox( 2, 2, 292, 150 )
btnImageUp = Button( 2, 147, 20, 20, "", imgOpen )
btnImageCancel = Button( 152, 147, 70, 20, "Cancel" )
btnImageOk = Button( 224, 147, 70, 20, "Open" )
SendMessage( winImage, "WM_CLOSE" )

;// Settings Window
winSettings = Window( -1,-1, 297, 197, "Settings", 0, True, False, False, True )
radSettingsMode1 = Radio( 10, 10, "Full Screen" )
radSettingsMode2 = Radio( 10, 25, "Windowed" )
radSettingsDMode16 = Radio( 10, 50, "16 Bit", False, 2 )
radSettingsDMode32 = Radio( 150, 50, "32 Bit", False, 2 )
cboSettingsDMode16 = ComboBox( 10, 65, 130, 20 )
cboSettingsDMode32 = ComboBox( 150, 65, 130, 20 )
text1 =Label( 10, 105, "Width:" )
txtSettingsWidth = TextBox( 50, 101, 60, 20, False, "Integer" )
text2 =Label( 180, 105, "Height:" )
txtSettingsHeight = TextBox( 220, 101, 60, 20, False, "Integer" )
btnSettingsCancel = Button( 135, 140, 70, 20, "Cancel" )
btnSettingsOk = Button( 210, 140, 70, 20, "Ok" )
SendMessage( winSettings, "WM_CLOSE" )

;// Texture Window
wintex = Window( 152, 72, 422, 189, "Texture", "0", 1, 0, 1, 1 )
loadtex = Button( 379, 8, 20, 15, "...", "0", 1, 0, 0 )
ExpandTex = CheckBox( 144, 34, "Expanded Textures", 0 )
chk002 = CheckBox( 144, 54, "Tiled Textures", 0 )
imgbox001 = ImageBox( 7, 33, 125, 120, TextureFilename$ , 0, 0, 1 )
lbl001 = Label( 6, 9, "Landscape Texture:", 0 )
texbox = TextBox( 104, 8, 273, 15, 0, 0, 18, 10, 1 )
SendMessage( winTex, "WM_CLOSE" )

;// Picker Window
Dim colour (384,3)
Global Spectrum = CreateSpectrum( )
Global SelCol = CreateImage(82,44)
Global CurCol = CreateImage(82,44)
Global Picker = Window(-1,-1,351,352,"Color Picker",0,1,0,0,0)
Global Colors = ImageBox(2,2,258,258,Spectrum,1,0,1)
Label(267,2,"Selected Color:",0)
Global SelectedCol = ImageBox(262,18,83,45,SelCol,1,0,1)
Label(269,66,"Current Color:",0)
Global Current = ImageBox(262,82,83,45,CurCol,1,0,1)
Global RedT = Spinner(213,262,46,20,RedSel,0,255)
Global RedS = Slider(35,266,176,12,RedSel,0,255)
Global GreenT = Spinner(213,283,46,20,GreenSel,0,255)
Global GreenS = Slider(35,287,176,12,GreenSel,0,255)
Global BlueT = Spinner(213,304,46,20,BlueSel,0,255)
Global BlueS = Slider(35,308,176,12,BlueSel,0,255)
Global Pick = Button(262,198,83,40,"Pick Color",0,1,0,0)
Global Reset = Button(262,241,83,40,"Reset",0,1,0,0)
Global Cancel = Button(262,284,83,40,"Cancel",0,1,0,0)
SendMessage( Picker, "WM_CLOSE" )
SendMessage( SelectedCol, "IM_SETDRAWMODE", 1 )
SendMessage( Current, "IM_SETDRAWMODE", 1 )
SendMessage( winTerrain, "WM_CLOSE" )
;// Test Window
Debug = Window( 157, 54, 287, 170, "Debug", "0", 1, 0, 1, 1 )
lbl001 = Label( 8, 6, "Name:", 0 )
lbl002 = Label( 8, 26, "Xscale:", 0 )
lbl003 = Label( 8, 44, "Yscale:", 0 )
lbl004 = Label( 8, 61, "Zscale:", 0 )
lbl005 = Label( 8, 86, "xpos#:", 0 )
lbl006 = Label( 8, 102, "ypos#:", 0 )
lbl007 = Label( 8, 117, "zpos#:", 0 )
Scalex = Label( 46, 26, "", 0 )
ScaleY = Label( 46, 42, "", 0 )
Scalez = Label( 46, 59, "", 0 )
Posx = Label( 45, 86, " ", 0 )
Posy = Label( 46, 100, " ", 0 )
Posz = Label( 46, 116, " ", 0 )
SendMessage( Debug, "WM_CLOSE" )

;// Propertis Window
winpropertis = Window( 610, 23, 190, 558, "Properties", "0", 0, 1, 0, 0 )
mnut001 = MenuTitle( "File" )
mnui001 = MenuItem( mnut001, "Close", "", "0", 0, 0, 0 )
tab001 = Tab( 0, 25, 186, 508 )
tabp001 = TabPage( "Terrain", "" )
SendMessage( tabp001, "TM_SETSIZE", 55, 20 )
grp001 = GroupBox( 6, 6, 174, 190, "Terrain" )
lbl001 = Label( 14, 18, "Name:", 0 )
lbl002 = Label( 53, 18, "", 0 )
lbl003 = Label( 12, 37, "Scalex:", 0 )
lbl004 = Label( 53, 37, "", 0 )
lbl005 = Label( 12, 54, "ScaleY:", 0 )
lbl006 = Label( 53, 54, "", 0 )
lbl007 = Label( 12, 71, "ScaleZ:", 0 )
lbl008 = Label( 53, 71, "", 0 )
tabp002 = TabPage( "Env", "" )
SendMessage( tabp002, "TM_SETSIZE", 55, 20 )
tabp003 = TabPage( "Objects", "" )
CloseTab( )
SendMessage( lbl004 , "LM_SETTEXT", terxscale# )

SendMessage( winpropertis, "WM_SETLOCKED" )
;//Water Window
RealisticWater = Window( 146, 32, 300, 85, "Real Water", "0", 1, 0, 1, 1 )
loadwatertex = Button( 265, 3, 20, 15, "...", "0", 1, 0, 0 )
watertex = Label( 3, 3, "Texture:", 0 )
lbl001 = Label( 4, 30, "Height:", 0 )
WaterHeight = Spinner( 41, 29, 50, 15, 0.0, 0.0, 100.0, 1.0, 0, 0)
watertex = TextBox( 47, 3, 216, 15, 0, 0, 18, 10, 0 )
SendMessage( RealisticWater , "WM_CLOSE" )

;//Console Window
winconsole = Window( 0, 580, 800, 20, "", "0", 0, 0, 0, 0 )
x = Label( 2, 2, "x:", 0 )
xmove = Label( 14, 2, "", 0 )
y = Label( 109, 2, "Y:", 0 )
ymove = Label( 120, 2, "", 0 )
z = Label( 206, 2, "z:", 0 )
zmove = Label( 216, 2, "", 0 )
lbl001 = Label( 326, 2, "Value:", 0 )
value = Label( 362, 2, "", 0 )
SendMessage( winconsole , "WM_SETLOCKED" )
SendMessage( winconsole , "WM_SETLOCKED" )
;//End Windows

;// Camera
camPivot = CreatePivot( )
cam = CreateCamera( camPivot )
CameraRange cam, 1.0, 5000.0
PositionEntity cam, 0.0, 0.0,0.0
;// Light
light = CreateLight( )



If app\MB1 = 2
RX = RX + app\MYS / 2
RY = RY + app\MXS /-2

If KeyDown(200) Then
MoveEntity cam,0,0,15.0

If KeyDown(208) Then
MoveEntity cam,0,0,-15.0

If KeyDown(203) Then
TurnEntity cam,0,2.0,0

If KeyDown(205) Then
TurnEntity cam,0,-2.0,0

If KeyDown(78) Then
MoveEntity cam,0,-10.0,0

If KeyDown(74) Then
MoveEntity cam,0,10.0,0


UpdateGUI( )

;//Event Handling
Select app\Event

Select app\MenuEvent
;// OPEN
Case mnuFileOpen
Filename$ = FileDialog( "Open File", CurrentDir(), ".noe" )
If Filename$ > ""
If FileType( Filename$ ) = 1 And ( Right( Lower( Filename$ ), 4 ) = ".noe" )
LoadNoe(Filename$ )
Case mnuFileSave
If CurrFile = ""
SaveNoe( "TEST2.noe" )

;//Terrain Window
Case mnuCreateTexture
SendMessage( winTex, "WM_OPEN" )
Case mnuCreatewireframeon
WireFrame True
Case mnuCreatewireframeoff
WireFrame False
;// Create Terrain
Case mnuCreateTerrain
SendMessage( winTerrain, "WM_OPEN" )
SendMessage( tabp002, "LM_SETTEXT", TERRAINNAME )
SendMessage( mnuCreateWater, "MM_ENABLE" )
;// Add Texture
Case mnuCreateTexture
TextureFilename$ = FileDialog( "Open File", CurrentDir(), ".Bmp;.Jpg" )
If Filename$ > ""
If FileType( TextureFilename$) = 1 And ( Right( Lower( TextureFilename$), 4 ) = ".bmp" Or Right( Lower( TextureFilename$), 2 ) = ".Jpg" )
tex=LoadTexture( TextureFilename$)
EntityTexture TERRAINNAME ,tex,0,1
;// Create Water Plain
Case mnuCreateWater
SendMessage( RealisticWater , "WM_OPEN" )
bed = CreatePlane()
bedt = LoadTexture("water.bmp")
ScaleTexture bedt,150,150
EntityTexture bed,bedt
MoveEntity bed,0,Waters ,0

;// Exit
Case mnuFileExit
app\Quit = True
End Select
Select app\GadgetEvent

Case btn002
heightmapFilename$ = FileDialog( "Open File", CurrentDir(), ".bmp" )
If heightmapFilename$ > ""
If FileType( heightmapFilename$ ) = 1 And ( Right( Lower( heightmapFilename$), 4 ) = ".bmp")
SendMessage( Termap, "TM_SETTEXT", 0, heightmapFilename$ )
TERRAINNAME =LoadTerrain(heightmapFilename$)

Case loadtex
texFilename$ = FileDialog( "Open File", CurrentDir(), ".bmp" )
If texFilename$ > ""
If FileType( texFilename$ ) = 1 And ( Right( Lower( texFilename$ ), 4 ) = ".bmp")
SendMessage( Termap, "TM_SETTEXT", 0, texFilename$ )
Tex=LoadTexture(texFilename$ )
SendMessage( Texbox, "TM_SETTEXT", 0, texFilename$ )
EntityTexture TERRAINNAME ,tex,0,1

Case Txscale
terxscale# =SendMessage( Txscale , "SM_GETVALUE" )
SendMessage( lbl004 , "LM_SETTEXT", terxscale# )
ScaleEntity TERRAINNAME ,terxscale# ,teryscale# ,terzscale#
Case Tyscale
teryscale# =SendMessage(Tyscale , "SM_GETVALUE" )
SendMessage( lbl006 , "LM_SETTEXT", teryscale# )
ScaleEntity TERRAINNAME ,terxscale# ,teryscale# ,terzscale#
Case Tzscale
terzscale# =SendMessage( Tzscale , "SM_GETVALUE" )
SendMessage( lbl008 , "LM_SETTEXT", terzscale# )
ScaleEntity TERRAINNAME ,terxscale# ,teryscale# ,terzscale#
Case btn005
SendMessage( txt002, "TM_SETTEXT", 0, heightmapFilename$)
Case xpos#
Terxpos# =SendMessage( xpos# , "SM_GETVALUE")
SendMessage( xpos# , "LM_SETTEXT", Terxpos# )
PositionEntity TERRAINNAME ,Terxpos# ,Terypos# ,Terzpos#
Case ypos#
Terypos# =SendMessage( ypos# , "SM_GETVALUE")
SendMessage( ypos# , "LM_SETTEXT", Terypos# )
PositionEntity TERRAINNAME ,Terxpos# ,Terypos# ,Terzpos#
Case zpos#
Terzpos# =SendMessage( zpos# , "SM_GETVALUE")
SendMessage( zpos# , "LM_SETTEXT", Terzpos# )
PositionEntity TERRAINNAME ,Terxpos# ,Terypos# ,Terzpos#
Case Pitch
pitches# =SendMessage( pitch, "SM_GETVALUE")
TurnEntity TERRAINNAME ,pitches# ,yaws#,rolls#
Case yaw
yaws# =SendMessage( yaw, "SM_GETVALUE")
TurnEntity TERRAINNAME ,pitches# ,yaws#,rolls#
Case roll
rolls# =SendMessage( roll, "SM_GETVALUE")
TurnEntity TERRAINNAME ,pitches# ,yaws#,rolls#
Case lod
lode# =SendMessage( lod , "SM_GETVALUE")
TerrainDetail TERRAINNAME ,lode# ,True
Case ExpandTex
ScaleTexture Tex,256,256
Case Tershading
TerrainShading TERRAINNAME ,1
Case WaterHeight
Waters =SendMessage( WaterHeight , "SM_GETVALUE" )
SendMessage( value , "LM_SETTEXT", Waters )
MoveEntity bed,0,Waters ,0

End Select
End Select

SendMessage( xmove , "LM_SETTEXT", EntityX#(cam))
SendMessage( ymove , "LM_SETTEXT", EntityY#(cam))
SendMessage( zmove , "LM_SETTEXT", EntityZ#(cam))
SendMessage( lbl002 , "LM_SETTEXT", ent)
camx =EntityX#(cam)
camy =EntityY#(cam)
camz =EntityZ#(cam)

DrawMouse( )
ResetEvents( )


Until app\Quit = True Or KeyHit( 1 )
Destroy( )

Function CreateSpectrum()

Buffer = GraphicsBuffer()
colourchart=CreateImage (256,256)
SetBuffer ImageBuffer(colourchart)

For n=0 To 63
colour (n,1)=255
colour (n,2)=n*4
colour (n,3)=0
colour (n+64,1)=255-n*4
colour (n+64,2)=255
colour (n+64,3)=n*4
colour (n+128,1)=0
colour (n+128,2)=255-n*4
colour (n+128,3)=255
colour (n+192,1)=n*4
colour (n+192,2)=0
colour (n+192,3)=255-n*4
For n=0 To 127
colour (n+256,1)=colour (n,1)
colour (n+256,2)=colour (n,2)
colour (n+256,3)=colour (n,3)

For y =0 To 127
For x=0 To 255
r=colour (x,1)*(y /127)
g=Colour (x,2)*(y /127)
b=Colour (x,3)*(y /127)
Color r,g,b
Plot x,y
r=255-(colour (x+128,1)*(y /127))
g=255-(Colour (x+128,2)*(y /127))
b=255-(Colour (x+128,3)*(y /127))
If r>255 Then r=255
If g>255 Then g=255
If b>255 Then b=255
Color r,g,b
Plot x,255-y

SetBuffer Buffer
Return colourchart

End Function
Function RefreshDialog( ListBox, DirType = "Open" )

SendMessage( ListBox, "LM_RESET" )

If OpenDir = "" OpenDir = CurrentDir()
If SaveDir = "" SaveDir = CurrentDir()
If ImageDir = "" ImageDir = CurrentDir()
If CompDir = "" CompDir = CurrentDir()

If Right( OpenDir, 1 ) = "\" Or Right( OpenDir, 1 ) = "/"
If Len( OpenDir ) > 3
OpenDir = Left( OpenDir, Len( OpenDir ) - 1 )
If Right( SaveDir, 1 ) = "\" Or Right( SaveDir, 1 ) = "/"
If Len( SaveDir ) > 3
SaveDir = Left( SaveDir, Len( SaveDir ) - 1 )
If Right( ImageDir, 1 ) = "\" Or Right( ImageDir, 1 ) = "/"
If Len( ImageDir ) > 3
ImageDir = Left( ImageDir, Len( ImageDir ) - 1 )
If Right( CompDir, 1 ) = "\" Or Right( CompDir, 1 ) = "/"
If Len( CompDir ) > 3
CompDir = Left( CompDir, Len( CompDir ) - 1 )

DirType = Lower( DirType )
If DirType = "open"
CurrDir = OpenDir
ElseIf DirType = "save"
CurrDir = SaveDir
ElseIf DirType = "image"
CurrDir = ImageDir
ElseIf DirType = "compile"
CurrDir = CompDir
If FileType( CurrDir ) = 0
CurrDir = CurrentDir( )
Dir = ReadDir( CurrDir )
If Right( CurrDir, 1 ) = "\" Or Right( CurrDir, 1 ) = "/"
If Len( CurrDir ) > 3
CurrDir = Left( CurrDir, Len( CurrDir ) - 1 )


File = NextFile( Dir )
If File = "" Exit

If FileType( CurrDir + "\" + File ) = 2 And File > ".."
AddListBoxItem( ListBox, 0, File , imgOpen )


CloseDir Dir
Dir = ReadDir( CurrDir )


File = NextFile( Dir )
If File = "" Exit

If FileType( CurrDir + "\" + File ) = 1
If DirType = "open"
If Lower( Right( File , 4 ) ) = ".gui"
AddListBoxItem( ListBox, 0, File , imgNew )
ElseIf DirType = "save"
If Lower( Right( File , 4 ) ) = ".gui"
AddListBoxItem( ListBox, 0, File , imgNew )
ElseIf DirType = "image"
If Lower( Right( File , 4 ) ) = ".bmp" Or Lower( Right( File , 4 ) ) = ".jpg"
AddListBoxItem( ListBox, 0, File , imgNew )
ElseIf DirType = "compile"
If Lower( Right( File , 3 ) ) = ".bb"
AddListBoxItem( ListBox, 0, File , imgNew )


End Function
Function SaveNoe( Filename$ )
File = WriteFile( Filename$ )
WriteString File, SendMessage( TERRAINNAME, "TM_GETTEXT" )
WriteString File, SendMessage( Termap , "TM_GETTEXT" )
WriteInt File, SendMessage( Txscale , "SM_GETVALUE" );Terrain xscale
WriteInt File, SendMessage( Tyscale , "SM_GETVALUE" );Terrain yscale
WriteInt File, SendMessage( Tzscale , "SM_GETVALUE" );Terrain zscale
WriteInt File, SendMessage( xpos , "SM_GETVALUE" );Terrain x pos
WriteInt File, SendMessage( ypos , "SM_GETVALUE" );Terrain y pos
WriteInt File, SendMessage( zpos , "SM_GETVALUE" );Terrain z pos
WriteInt File, SendMessage( Lod , "SM_GETVALUE" );Terrain z pos
WriteInt File,camx ;Cam x
WriteInt File,camy ;Cam y
WriteInt File,camz ;Cam y

;WriteInt File, SendMessage( xscale, "SM_GETVALUE" )
;WriteInt File, SendMessage( xscale, "SM_GETVALUE" )

;writestring File, OpenDir
;writestring File, SaveDir
;writestring File, ImageDir
;WriteInt File, Terxpos#
;WriteInt File, Terypos#
;WriteInt File, Terzpos#
;WriteString File, heightmapFilename$$
;WriteInt File, nDepth
;WriteInt File, nMode
CurrFile = Filename$
AppTitle "Nova Editor - " + Filename$

CloseFile File

End Function
Function LoadNoe(Filename$ )
File = ReadFile( Filename$ )
Tname$ =ReadString (File)
Tmap$ =ReadString (File)
Txs =ReadInt(File)
Tys =ReadInt(File)
Tzs =ReadInt(File)
xp =ReadInt(File)
yp =ReadInt(File)
zp =ReadInt(File)
Ld =ReadInt(File)
AppTitle "Nova Editor 0.03b- " + Tname$
CloseFile file
Tname$ =LoadTerrain(Tmap$)
ScaleEntity Tname$ ,Txs,Tys,Tzs
PositionEntity Tname$ ,xp,yp,zp
TerrainDetail Tname$ ,Ld ,True
End Function


Pleas help me something is really wrong in my code

poopla(Posted 2003) [#176]
How can we simulate a GadgetPushed() command? I need this so if a gadget is simply clicked (user has clicked and is holding down) the gadget, then it returns true. Perhaps there a sendmessage procedure for the job? Thanks.

Smurfpuss(Posted 2003) [#177]
like how come the path prints correctly on the window app

AppTitle "Nova Editor 0.03b- " + Tmap$

But not here

Text 120,40,"heightmap:"+Tmap$,False,True

when i read from my file like i am going mad cant any one help me

poopla(Posted 2003) [#178]
How did you do the spinners in the GUI editor main window Fullernator? Is it a text box and a spinner with butons only? If theres a way to just use a spinner that allows you to type in the value you want, how do we do it? And if you can't do that, will we be able to in th near future? :)

[Edit] PLEASE PLEASE PLEASE say we can somehow do this with just a spinner :).

poopla(Posted 2003) [#179]
A little bug ive noticed with the editor fullernator. If you have a spinner set to float, whenever you save, if the inc. value isnt an integer it wont save it. It will always load up as 0.0. This gets VERY irritating when you have to re set that perameter ever time ya recompile/load your project. Not that im complaining whining, just letting ya know ;).

Not Available(Posted 2003) [#180]

I had a quick glance through your code - don't quote me on this, however it looks like Function SaveNoe( Filename$ )
at least refers to a bunch of variables it couldn't see, define all the variables you access in functions as global in the main app if you're not passing them explicitly through the function call (like filename$ above).

ie. in Function SaveNoe( Filename$ )

WriteInt File, SendMessage( xpos , "SM_GETVALUE" );Terrain x pos
WriteInt File, SendMessage( ypos , "SM_GETVALUE" );Terrain y pos
WriteInt File, SendMessage( zpos , "SM_GETVALUE" );Terrain z pos

xpos,ypos and zpos aren't global vars so it will save probably 0's for all of these values. Check all your functions for this type of error.

ie. change:
xpos# = Spinner( 153, 116, 60, 15, 0.0, 1.0, 1000.0, 1.0, 0, 0 )
ypos# = Spinner( 153, 96, 60, 15, 0.0, 1.0, 1000.0, 1.0, 0, 0 )
zpos# = Spinner( 153, 74, 60, 15,0.0, 1.0, 1000.0, 1.0, 0, 0 )


global xpos# = Spinner( 153, 116, 60, 15, 0.0, 1.0, 1000.0, 1.0, 0, 0 )
global ypos# = Spinner( 153, 96, 60, 15, 0.0, 1.0, 1000.0, 1.0, 0, 0 )
global zpos# = Spinner( 153, 74, 60, 15,0.0, 1.0, 1000.0, 1.0, 0, 0 )

as you've done with some of the other vars in your app.

I hope this helps,

poopla(Posted 2003) [#181]
Another request, I would love if we could specify how many items a combobox will roll out at a time, then we could scroll through the rest, so say you have 30 items in the combo box, you specify to show 3 at a time, so 3 are show, and a scrollbar is present for moving through the rest. I actually require this for something... but ive no clue how to do it my self. *shrug*

Smurfpuss(Posted 2003) [#182]
well i tryid it but still dosen't load correctly in my load function i made separately

; Open the file to Read
Global Terrain
;Global Lod,TZscale,TYscale,TXscale,Tername$,Termap$,xpos,ypos,zpos
Graphics3D 800, 600, 32, 2
camPivot = CreatePivot( )
cam = CreateCamera( camPivot )
CameraRange cam, 1.0, 5000.0
PositionEntity cam, 0.0, 0.0,-10.0
;// Light
light = CreateLight( )
If KeyDown(200) Then
MoveEntity cam,0,0,15.0

If KeyDown(208) Then
MoveEntity cam,0,0,-15.0

If KeyDown(203) Then
TurnEntity cam,0,2.0,0

If KeyDown(205) Then
TurnEntity cam,0,-2.0,0

If KeyDown(78) Then
MoveEntity cam,0,-10.0,0

If KeyDown(74) Then
MoveEntity cam,0,10.0,0


Color 255,255,255
Text 120,30,Tname$,False,True
Text 120,40,Tmap$,False,True
Text 120,50,Txs,False,True
Text 120,60,Tys,False,True
Text 120,70,Tzs,False,True
Text 120,80,xp,False,True
Text 120,90,yp,False,True
Text 120,100,zp,False,True

Until KeyHit( 1 )

Function LoadNoe(Filename$ )
File = ReadFile( Filename$ )
CloseFile (file)
AppTitle "Nova Editor 0.03b- " + Tmap$
End Function

Not Available(Posted 2003) [#183]
Yeah but you've done the same thing in this example - you haven't defined all the variables that function LoadNoe uses (outside of filename$) as globals!


Txs, Tys and Tzs are not declared global.
Neither are xp,yp and zp.
Neither is LD or Tmap$ or Tname$

Your global statement at the top that you've commented out contains Tername$ and Termap$ as globals but the function refers to them as Tname$ and Tmap$.

Attention to detail man!

This needs to go at the top:
Global Tname$, Tmap$, Txs, Tys, Tzs,xp,yp,zp,Ld

Go though your other functions, cut and paste all the vars you use in a function into a global statement - that way you can't mess it up with typos / memory probs :)

If you haven't got a real handle on whats going on this is the deal - any vars you declare in your main program (that's everything outside of functions) without the global command cannot be seen inside of a function.


function SOME_FUNCTION()
print a
end function

This will print "0" because it can't see the variable a

but if you change a=10 to Global a=10 then all functions can access / change the value of a comprende?

Did someone just say Option Explicit? :)

poopla(Posted 2003) [#184]
Another question: How can I tell what number a ComboBoX item is in the list of them for any give combo box? Are they indexed? Thanks for any help.

[edit] I can easily get arround this if it doesnt work that way, so no biggy.

Odds On(Posted 2003) [#185]
Dev, the editable spinners are textboxes with spinner that only have the buttons visible as you said. It shouldn't be a problem to make it into a single gadget for the next version :)

Combo boxes can already have a set number of items visible before a scroll bar appears:

mycombobox = ComboBox( 10, 10, 100, 20, 16, 3 )

The first 4 parameters are X, Y, W, H.. the 4th parameter is the item height, and the 5th parameter is the number of items a combo box will display before a scrollbar is added.

There's no built-in method of returning the index of a certain item unfortunately.

For a GadgetPushed() you could do something like:

tempbtn.Button = Object.Button( mybutton )
if tempbtn\State =-2
;gadget is being pushed down

Smurfpuss(Posted 2003) [#186]
well the i got one more Q? if there any rule of in with order the globals must be in and

what shall i do if this still dosen't work like in the current sample that i posted it dose load the heightmap from the file and print's it in the appstitle but it still dosen't loadit in loadterrain(tmap$)

like what is the diff bettwen appstitle "new"+tmap$
and terrain=loadterrain(tmap$)

Odds On(Posted 2003) [#187]
AppTitle isn't in a function, but LoadTerrain is.. Globals order doesn't make a difference.

Smurfpuss(Posted 2003) [#188]
Oki i will try it out when i get home from work but i don't think that it will work like it's some thing really wierd stuff going on with my prodject and if it works i can move on and add the other stuff i am currently working on to the editor

poopla(Posted 2003) [#189]
Fullernator, great :), ill be looking forward to spinner direct editing ^_^. Your doing an awesome job!

poopla(Posted 2003) [#190]
The first 4 parameters are X, Y, W, H.. the 4th parameter is the item height, and the 5th parameter is the number of items a combo box will display before a scrollbar is added.

You meant the 5th parameter controls the spacing of the items and the 6th controls the number before a scrollbar pops up, right? :) Thanks, works a treat, do you want help with docs on this? I'd be more then happy to work with you on it :).

Smurfpuss(Posted 2003) [#191]
Yes i got the loading to work at last but i have a q? how do i get the value if the checkbox is checked or not woulde like to know

Odds On(Posted 2003) [#192]
Dev, yea I did.. just.. err.. testing you :P. Thanks for the offer but it's quite a boring/tedious job so I'd rather do it myself.

Smurfpuss, Use:

checked = SendMessage( mycheckbox, "CM_GETCHECKED" )

Glad you got it to work :)

Smurfpuss(Posted 2003) [#193]
so like cm_getcheked i can use to see if the checkbox is checked or not oki

Smurfpuss(Posted 2003) [#194]
yes worked like i only know have some small glitches in my code but i am fixing it right know every thing seems working great the only problem i need to change is how do i make changes on the terrain i have saved and loaded in the editor like if i have saved and loaded a terrain how do i make so i can alter the loaded map again

any ideas is welcome

Odds On(Posted 2003) [#195]
I guess it depends on what you want to do with the terrain.. ModifyTerrain is probably what you want to use, whatever it is though I think it would be a good idea to start a new thread for this since it's unrelated to BlitzUI :)

Smurfpuss(Posted 2003) [#196]
yes but in some way i will have the values to be placed in the blitzui like the values so if the y scale is 20 in the loaded file i will have the value 20 in the yscale spinner and from there i must be able to change the loaded terrain

Smurfpuss(Posted 2003) [#197]
Oki i have solved the problem but i have a Q?
if i have saved the value of the check boc that is 1 or 0 for checked or not how do i set that value back from the file to the check box
like do i have to use a if function or what

Odds On(Posted 2003) [#198]
SendMessage( mycheckbox, "CM_SETCHECKED", [true or false value you loaded] )

Jim Teeuwen(Posted 2003) [#199]
Just DL-ed the lib and had a play. this is really excellent stuff! Ive always been mighty hesitant when it comes to using other ppl's UI code but this just looks and handles too damn good to pass up.

Keep it up!

smilertoo(Posted 2003) [#200]
im really impressed with BlitzUI, good stuff.

Smurfpuss(Posted 2003) [#201]
well i tryid it out but it seems not to work like i have the correct value 1 when true but the checkbox is not checked

like must i try having

Odds On(Posted 2003) [#202]
I can't say for sure, but as a guess I'd say the True/False value your loading from the file isn't a Global ;)

Thanks Trogdor and john, glad you like it :)

Wahoo! Over 200 posts :D

Second Chance(Posted 2003) [#203]
WOW! This is nice. Very attractive design, it has that hi-res feel I like.

Bot Builder(Posted 2003) [#204]
Awesome! I'm just starting a paint program with BlitzUI, and it has been working out pretty good as far as the GUI goes. Anyway, I have a question. How would I find out if a tree-node is selected? It would be nice if there was a TM_selectednode, but it doesn't say anything in the help(awesome help to by the way). Maybe I'm missing somthing.

Odds On(Posted 2003) [#205]
bot builder, currently all you can do is return the caption of the selected item, and the caption of the selected items parent node.

There will be better support for tree views in the next version though :)

poopla(Posted 2003) [#206]
Sounds like the next vrsion will be a corker for sure. :)

Filax(Posted 2003) [#207]
Woaouu !!! great job !!! and easy to use !!!!

Bot Builder(Posted 2003) [#208]
Ok. Caption should do it, but it'll be a little harder. Another version! Cool. Um, try to document more of the sendmessage commands to. That's been bugging me.


How do I edit the Image box's image using blitzes commands? I understand how to use a file's image, just not how to use a custom, scratch blitz image.

Odds On(Posted 2003) [#209]
When you use "IM_SETIMAGE" to set the image of an Image Box you can specify either a filename of a blitz handle as parameter 1.

SendMessage( imgbox, "IM_SETIMAGE", "cheese.bmp" )
cheese = LoadImage( "cheese.bmp" )
SendMessage( imgbox, "IM_SETIMAGE", cheese )
will both work.

smilertoo(Posted 2003) [#210]
Is there any chance you could make the .ui file text editible?
This is because the editor sometimes 'loses' elements that are no longer editable but appear in the compiled assuming this is what caused my inability to get two tab panels to work. First worked fine, the second wouldnt let me add gadgets to any tabbed page.

Other than this the system is great.

hub(Posted 2003) [#211]
Awesome gui Chris !
Is it possible to have a 'navigation system' into the tab gadget if you have a lot of tab pages ?
Like this...

Doiron(Posted 2003) [#212]
Is it possible to have a 'navigation system' into the tab gadget if you have a lot of tab pages ?
Like this...

Mmh... I would add scrollable menus to that potential request (in a app I put all the available background songs in a menubar, and it easily goes below screen's height).

Odds On(Posted 2003) [#213]
hub, it's not possible yet, but I'll add it to the next version.

Doiron, I probably won't add scrollable menus, but what you could do is maybe put the songs into categories.. even if it's just

Category One
Category Two


Doiron(Posted 2003) [#214]
Doiron, I probably won't add scrollable menus, but what you could do is maybe put the songs into categories..

Nah, it won't help since users can add their own songs to the list.
What I was thinking about is something like that:

I'll surely find a workaround though (it's not a priority, of course), but I think it could be a nice addition.