Full WinBlitz3D FREE

Blitz3D Forums/Blitz3D Programming/Full WinBlitz3D FREE

Kev(Posted 2006) [#1]
Hi Guys

Ive now made available for free the full unrestricted version of winblitz3d.

If you find winblitz3d useful then all donations welcome :)

click the winblitz3d link below to download.

*EDIT: new version now available, same download link.

WHATS NEW?
some bug fixes.

kev


Stevie G(Posted 2006) [#2]
Nice one cheers. That tank game looks familiar :)


Picklesworth(Posted 2006) [#3]
That tank game looks familiar :)
Yes, it's had quite an adventure lately :)
Hmm... I should have kept the News page out of that screenshot. I guess a more Internet-ish thing there would look odd, though, since that web browser window is not actually done by WB3d. (Which is, in my opinion, a very cool thing; using a native GUI API, a DLL can create any gadget it wants and just throw it onto your program).


Nice work, Kev!

I like the web site. It's simple but effective.
Maybe the border at the top could be widened a bit, though, because the images at the bottom are wider than it.

I'll be watching to see where this goes.
WB3d is a very well made system, so I'm sure it will go far.


Tom(Posted 2006) [#4]
Very generous, thanks Kev!


kevin8084(Posted 2006) [#5]
Thank you very much...earlier today I downloaded the lite version LOL


markcw(Posted 2006) [#6]
i didn't know where i could get winblitz3d until now.

does anyone know what blitz3d programs are using winblitz3d?

how does it work?


Picklesworth(Posted 2006) [#7]
does anyone know what blitz3d programs are using winblitz3d?
The ones at the bottom on that page, the best simulator ever made, and a few others :)


markcw(Posted 2006) [#8]
hmm, thanks.

i know of the "grasshopper web plugin system" (because it's in your sig)
but what is "life-studio 2006"?
and "3d photo gallery"? i think that's what it says.

why no links to these programs? it's a little odd isn't it?


Picklesworth(Posted 2006) [#9]
They are both projects being worked on by folks who beta tested the system.

There is also a GUI editor written using Wb3d, I believe...


markcw(Posted 2006) [#10]
oh i forgot. thanks Kev! very generous! :)


Danny(Posted 2006) [#11]
Well done Kev!

I will try and finish the WB3D GUI Editor ( SCHNOK! ) over the weekend. There's a small bug I got to kill and write some basic docs.
(The Life Editor was made using this editor)

Here's a screenshot showing some of it's functions like gadget properties, style editing, font manager, etc.
It exports the gui straight to BB code in different ways and formats depending your need/style:

www.xs4all.nl/~dendanny/SCHNOK/schnok.v0.90.jpg

Danny


LAB[au](Posted 2006) [#12]
Great! Just in time for my project! I sent you a small donation, keep it alive, it's great library!


Kev(Posted 2006) [#13]
thanks guys, for people that made a donation its much appreciated.

thank you

kev


jfk EO-11110(Posted 2006) [#14]
Gives me a 404 when I click "download". Any chance to get it? If I'll win in Lottery, I'l make a donation, promised! (Until then I can only offer you a beer or two).

I have made Texture Wobbler (sig) with an older version of Winblitz3D. Great work, thanks.


jfk EO-11110(Posted 2006) [#15]
ok, this seems to be the problem: your page links to:
http://www.winblitz3d.co.uk/www.winblitz3d.co.uk/wb3d_1.zip

where it should be
http://www.winblitz3d.co.uk/wb3d_1.zip

Or maybe my browser has bugs :/

EDIT: Wah! now both give me a 404! What's going on here?


markcw(Posted 2006) [#16]
odd, try this
http://www.winblitz3d.co.uk/winblitz3d.zip


Ricky Smith(Posted 2006) [#17]
This is a tremendous add on for Blitz3d - Very well done Kevin and all the Beta testers - superb job and very generous. Donation on its way - I hope all that use it will contribute as well so you can keep working on this excellent lib.


jfk EO-11110(Posted 2006) [#18]
Thanks muk!


(tu) sinu(Posted 2006) [#19]
Thanks alot kev, very generous of you. Im gonna switch to this now in my editor :P

EDIT: sorry, was thanking muk instead kev for some reason :)


Ricky Smith(Posted 2006) [#20]
I just noticed that when I try and set style for a gadget other than default the gadget gets created in its own little window instead of on the parent - if you try to set the style after creation using
WB3D_SetGadgetStyle%(gadget%,style%)
The gadget dissapears altogether ?!?
What am I doing wrong ?


Picklesworth(Posted 2006) [#21]
:o

Hmm... us this a totally custom style?

If so, try adding WS_CHILD to that.
That style tells the window to put itself within its parent window, because otherwise it won't for some reason.


Kev(Posted 2006) [#22]
@Smiff what Mr. Picklesworth said is correct for gadgets to be children there style must include WS_CHILD.

For the gadgets to be drawn correct i would recommend using WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles also.

kev


John Blackledge(Posted 2006) [#23]
Danny, what you've done really hammers home what WinBlitz3D is all about - the only possible solution for an editor-type app.

Kev - brilliant work, mate.


Ricky Smith(Posted 2006) [#24]

try adding WS_CHILD to that



That worked fine - thanks !
I must say this is very easy to integrate.

Any examples of how to create a Tabber and TabberPanels ?
Which is which ? Is the Tabber the parent and the TabberPanels the "pages" or vice-versa ?


Kev(Posted 2006) [#25]
Hi Smiff

Yes your correct in fact TabberPanels are like pages use wb3d_hidegadget and wb3d_showgadget to display the selected page.

below is a test example used while beta testing, this contains lots of gadget creation, including tabber gadgets



kev


Ricky Smith(Posted 2006) [#26]
Thanks Kev That's very useful !


bytecode77(Posted 2006) [#27]
this rocks!

it is using the windows API, isn't it?


Smokey(Posted 2006) [#28]
it don't work for me , It can't find the user lib , to be sure
I put the file WB3DStyles.bb in the same dir and change the path of the include in the sample ... same thing
I put the file Blitz3D_GUI_DLL.decls in userllibs dir

I use blitz v1.98
,


kevin8084(Posted 2006) [#29]
either put the blitz3d_gui_dll.dll file in the same directory as your .bb file, or copy it to your windows/system32 directory.


Kev(Posted 2006) [#30]
Hi Smokey

Please ensure blitz3d_gui_dll.dll is in the same folder as the example your testing.

can you let me know if that helps.

kev


Filax(Posted 2006) [#31]
Hi Kev :) nice job your GUI !

It is possible to define a no resizable window ?


Kev(Posted 2006) [#32]
hi filax

window = WB3D_CreateWindow("New Window",450,100,520,550,0,WS_VISIBLE Or WS_SYSMENU Or WS_MINIMIZEBOX Or WS_CAPTION)


kev


Filax(Posted 2006) [#33]
Many thanks ! Great lib !

Here is a manifest file to give winblitz3D xp look :)

Example : WB3D_Notify.exe.manifest


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="MyCompany.MyLabel.MyAppName"
type="win32"
/>
<description>Filax powaa</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>


Filax(Posted 2006) [#34]
Here is a little software to hack blitz exe's to remove
black window at start :)




JoeGr(Posted 2006) [#35]
Excellent. I've been waiting for this. Thanks Kev!


Kev(Posted 2006) [#36]
@filax, the manifest should be wrapped into startup scr patcher and included with winblitz3d.

kev


kevin8084(Posted 2006) [#37]
interesting program above...killed my blitz3d.exe file. Now it pops up a black box (dos box) and closes after about 1 second. Need to reinstall, I think.
***EDIT***
After reinstall I checked a hex dump of blitz3d.exe and stepped through the above program. Very nice...it writes a 0 into position 0 in the file. An easy way to fix that problem is to open your "dead" blitz32.exe file in a hex editor such as hiew and replace the 0 with a 4D.


xmlspy(Posted 2006) [#38]
Filax, great post man... Froze my pc and gave me pure hell, thank you!


Barliesque(Posted 2006) [#39]
@kevin8084:
Filax's explanation above is a little confusing. That program is not meant to be run on the bltz3d.exe! The idea is to compile your Blitz project as an exe, and then use his program on that exe. The result is that your program will run without creating a window---that way you can use WinBlitz3D to create whatever interface you want for your program, without the default Blitz window appearing.

@Kev
Many thanks for this excellent library. If I ever get round to writing a commercial app with it, I'll be sure to send a donation.

Incidentally, I find that all of the included examples run much more smoothly with the addition of "delay 10" just after the "flip" statement--just to allow other Windows processes a chance to do their thing as well. Otherwise the Blitz application sits there doing nothing, but using 100% of the processor's power.


kevin8084(Posted 2006) [#40]
Ahhh...I understand. I misread the "blitz exe" as "blitz.exe" and thought that he meant "blitz32.exe"
Thanks for clarifying.


Filax(Posted 2006) [#41]
Tssss .... i have specify blitz exe files not your blitz3D.exe !!


kevin8084(Posted 2006) [#42]
Tssss....already admitted that I misread and misunderstood. My apologies.


Filax(Posted 2006) [#43]
No problemo :)

Kev : "should be wrapped into startup scr patcher and included with winblitz3d."

What ?? Don't understand


Kev(Posted 2006) [#44]
@filax, one example that does both manifest and startup scr patcher using winblitz3d.

this will patch the .exe and write out the manifest



Filax(Posted 2006) [#45]
Many thanks Kev :)


YellBellzDotCom(Posted 2006) [#46]
OK, please be gentle..., but Im assuming WinBlitz3d is for making windowed only programs so it cant be used to make a GUI for a fullscreened program?

<ducks behind the desk...>


Picklesworth(Posted 2006) [#47]
I wouldn't recommend making a fullscreen program that isn't a game or a screensaver, and I wouldn't recommend using the Windows GUI for a game :)


Baystep Productions(Posted 2006) [#48]
Server down? Can't load the website.


Kev(Posted 2006) [#49]
@Xyle, yes winblitz3d is designed for window'ed mode GUI only, athough it should be possable to fake full screen.

@PCD GUY, server up now.

kev


LAB[au](Posted 2006) [#50]
@Danny

Any news about SCHNOK!, even an "undocumented beta" would make my day :)


Naughty Alien(Posted 2006) [#51]
I'm waiting for it too..:))


Chroma(Posted 2006) [#52]
Thanks Kev!


Danny(Posted 2006) [#53]
@Lab/Alien,

I'll try and post an 'undocumented beta' later tonight..


LAB[au](Posted 2006) [#54]
Sir Danny, You are a gentleman!


Kev(Posted 2006) [#55]
Danny i look forward to the next beta, whats new/updated with this new beta?

kev


Danny(Posted 2006) [#56]
Ok, SCHNOK! 0.95 undocumented sloppy beta released! (It's a gui editor for WinBlitz3D)

check the post on: http://www.blitzbasic.com/Community/posts.php?topic=62516

@Kev, the last version was 6 months ago ;) Mostly they're stability and bug fixes. I know there's quite some issues here and there but haven't had much time to tackle all of 'em...


Chroma(Posted 2006) [#57]
Kev, I definitely have a graphical glitch here with the:

temp = WB3D_CreateGroupBox "Camera",5,200,180,50,panel1,0)

WB3D_Usefont temp,uni_font



uni_font is just the ms sans serif font..it's nothing special...but I get a piece of the original word left over and it shows behind the new font. Probably an easy fix...lemme know if you can correct this plz.


Kev(Posted 2006) [#58]
@Danny
what its been that long since the last beta.

@Chroma
Im aware of this problem and still not got round to fixing it, I will though.

kev


Chroma(Posted 2006) [#59]
Kev, is there a RefreshAll type command? If I hide the tab then show it the font artifacts go away!! If there's something that will refresh all the gadgets I'd gladly use that instead of you chasing that bug down.


Danny(Posted 2006) [#60]
Kev/Chroma,

These minor graphic glitches are still a bit of a mystery. And (as you pointed out Chroma) ony happen when you set (alter) the font of a gadget other than the original one.

Also note that sometimes you will see minor glitches like this whilst editing in the Schnok Editor but NOT when you actually export and run the gui from your app! (except for the groupbox, that one's always been like that)..

Danny


b32(Posted 2006) [#61]
Very nice! Thanks Kev!


Kev(Posted 2006) [#62]
@Chroma/Danny, the problem with the graphical glitch when using groupbox's has been fixed. it was an over sight on my side i was not correctly redrawing after font changes.

@Danny, did you not encounter a simular problem with the top of the window.

i hope to have an updated version soon, this includes some little fixes

kev


Danny(Posted 2006) [#63]
@kev, err.. yes... Ah! This was when you created a window and set the styles for it to be a ToolWindow. But I just checked it in schnok and seems ok!

I don't know what it is, but there's always been something different with the gadgets you're building in schnok (talking about (re)painting) as opposed to exported code.
For example, I just heard that when you create a windowmenu that it isn't painted untill you move the mouse over it! And if you move another window over it, it won't repaint the windowmenu (gets dirty). But Schnok's own pull down menu looks fine!

I don't (cant?) set styles on a windowmenu so that's all default. But perhaps the window it's parented to needs a certain style to make it paint it's menu properly? I use these default styles to reproduce yours:

WS_CHILD, WS_VISIBLE, WS_CLIPCHILDREN, WS_CLIPSIBLINGS, WS_POPUP, WS_CAPTION, WS_MINIMIZEBOX, WS_MAXIMIZEBOX, WS_SYSMENU, WS_THICKFRAME.

D.


Chroma(Posted 2006) [#64]
Kev, I just redownloaded WB3D and I'm still getting the graphical error with the group box.


Kev(Posted 2006) [#65]
Chroma, Ive not uploaded the updated version just yet im still finalizing a couple of extra fixes, it will be soon though.

kev


Ricky Smith(Posted 2006) [#66]
Kev - can you also check the spinners - I don't seem to be able to capture any events from them - thanks.


JoeGr(Posted 2006) [#67]
I've been playing about with this for a few days now and its really good, particularly the 3D/GUI integration which was possible with previous versions but quite fiddly. So thanks again for all your hard work Kev - a donation is on its way.

Now I've got you in a good mood, can I just ask if there's a way to lose those little highlight things (dotted black rectangles) which appear over the most recently-used gadget? They don't look too bad most of the time but I'd still prefer to be rid of them.

EDIT - I've just noticed that they disappear if I use a manifest file. But I'm still curious to know if there's another way.


Kev(Posted 2006) [#68]
Hi guys,

Ive uploaded a new version that fixes a couple of the problems you guys encounterd.

you will notice the addition of some extra commands, ie gadget creation these dont work yet and are templates for some new features im currently adding.

ive also added a new command WB3D_GetOSVersion() this will return the os your .exe is running under.

finaly WB3D_Force_BlitzKeys() has been added, this enables control when using blitz internal input. flag it with true/false to stop key repeats.

@Smiff,
missed that one ;) anyway re-download the latest version for spinner events.

@JoeGr
many thanks for your donation, when a gadget has keyboard focus windows auto draws the selection box within the gadgets frame. im unsure if its possable to by-pass, i will look into it though.

kev


kevin8084(Posted 2006) [#69]
The focus rectangle can be accessed with the function DrawFocusRect:

BOOL DrawFocusRect(
HDC hDC, // handle to device context
CONST RECT* lprc // logical coordinates
);

Kevin


kevin8084(Posted 2006) [#70]
@Kev: could you possibly put in a window-centering routine? Possible code:
Function CreateWindowCentered(caption$,width,height,parent,style)
x=api_GetSystemMetrics(0) ; width of screen in pixels
x=(x/2)-(width/2)
y=api_GetSystemMetrics(1) ; height of screen in pixels
y=(y/2)-(height/2)
Return (WB3D_CreateWindow(caption$,x,y,width,height,parent,style))
End Function



JoeGr(Posted 2006) [#71]
Thanks Kevs.

kevin8084, why don't you just use the function you posted above?


kevin8084(Posted 2006) [#72]
@JoeGr - I do use it, but I've seen others asking how to center their windows. Seems that it would just be more convenient for people if they can call the function from within WinBlitz.


b32(Posted 2006) [#73]
He, you can make a blitzcc.exe.manifest in the \bin directory!


kevin8084(Posted 2006) [#74]
Perhaps I'm missing something or being obtuse, but I can't seem to use the spinner control. Would somebody explain to me how to set the control up in code?


Kev(Posted 2006) [#75]
hi kevin8084, then creating spinners the gadget created before the spinner becomes it buddy.

heres an example.
; WB3D styles
Include "WB3DStyles.bb"

Graphics3D 800,480,16,2
SetBuffer BackBuffer()

Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,800,500)
WB3D_SetQuitMessage "WB3D 3D/GUI quit","Sure To Quit Test.bb" 

window = WB3D_CreateWindow("test",100,100,500,300,0,0)


spinner_value = WB3D_CreateEditField("",40,5,100,20,window,0,0)
spinner = WB3D_CreateSpinner(141,5,40,20,window,1,0)
WB3D_SetSpinnerRange spinner,0,100

While Not KeyDown(1)
	
		
	Select WB3D_WaitEvent()
		
		Case $401
			Select WB3D_EventSource()
				Case spinner
					If WB3D_GetSpinnerPos(spinner) = 50 Then
						WB3D_Notify "spinner gadget","spinner position at 50",0
					EndIf
					
			End Select
		
	End Select
	
Wend

WB3D_EndGUI()
End


kev


kevin8084(Posted 2006) [#76]
Thank you for the explanation, Kevin. Much appreciated.


LAB[au](Posted 2006) [#77]
Spinner range seems limited ... kev, did you used a 16 or 32 bit value for theses? Also when not linking to a buddy I got strange results from getspinnerpos... I still don't get really how buddy/spinner/range interacts but it seems to be all dependent of this 16 or 32 bit value and of a "base" which is either decimal or hex.


EPS(Posted 2006) [#78]
Hi Kev, pretty cool work. Thanks a lot for sharing.

One whish i had. A command to setup the default font for all gadgets would be pretty cool. So that i can setup a font at startup and all created gadgets (after that) would use this font.

Otherwise i have to change the font for all created gadgets piece by piece and this is ... well ... not so nice.

Btw. the "width" option in the OpenFont command is a little bit confusing to find the correct font. This option as an optional parameter makes more sense in my eyes, but, it's ok if not.

EDIT: Is it possible to use "multiselection" with the ListBox Gadget? And if yes how can i recieve the choosed Itemlist? A example would be great. If not, can you add this feature PLEASE, PLEASE, PLEASE :-))

that's my whishlist and ... sorry for my english


Kev(Posted 2006) [#79]
@LAB[au], realy i do need to change the way spinners are handled. values are int when passed to winblitz3d, there then combined as a long using 2 shorts. ie 'MAKELONG((short) max, (short) min)'. spinners as far as im aware and the way i have always used them have had a buddy.

@East-Power-Soft

One whish i had. A command to setup the default font for all gadgets would be pretty cool. So that i can setup a font at startup and all created gadgets (after that) would use this font.


sounds like a good idea, i will have a look at adding this.


EDIT: Is it possible to use "multiselection" with the ListBox Gadget? And if yes how can i recieve the choosed Itemlist? A example would be great. If not, can you add this feature PLEASE, PLEASE, PLEASE :-))


this will be added but when i dont now, when ive some time free.


Danny(Posted 2006) [#80]
@Easy Power Soft,

At default the listbox has the LVS_SINGLESEL style included; so you can only select 1 item at a time. So when you create a listbox, in stead of the default '0' style use the following to get a multi selection listbox:

WB3D_CreateLisBox (x,y,width,height,parent, WS_CHILD or WS_CLIPSIBLINGS or WS_CLIPCHILDREN or WS_VISIBLE or LVS_NOCOLUMNHEADER or LVS_NOLABELWRAP or LVS_REPORT)

If you('re new to wb3d and) don't know what the above means and/or scares the hell out of you ;) then use the style editor in Schnok! (a free WB3D gui editor) to do it for you, get it here: http://www.blitzbasic.com/Community/posts.php?topic=62613

Danny


Kev(Posted 2006) [#81]
@Easy Power Soft

its possable like danny's post, although you would need to do some extra coding to handle the selected items.

setup LV_ITEM item structure using a bank and send the meesgae LVM_GETITEM you would need to check the structs LV_ITEM.state to see if the items selected. it would take a little bit of work but it could be done.

kev


Ricky Smith(Posted 2006) [#82]
Re the spinners - any way to use floats rather than just ints ?


EPS(Posted 2006) [#83]
Thanks a lot for this Info.


Chroma(Posted 2006) [#84]
Kev, when the button style is XP and you make a button a child of a groupbox, the button has rounded corners but you can still see the square button behind it. I can supply a pic if you don't already know about this one.


ShadowTurtle(Posted 2006) [#85]
Smiff: Sample ...
CommaPos = Int(2)
MySpinValue = Int(100) * (10 * CommaPos)

If CommaPos = 2 so the value from 100 (MySpinValue) is later 1.00
See code for calculation:
MyValue# = Float(MySpinValue / (10 * CommaPos))

You must set Int(YourMaxValue) * (10 * CommaPos) as maximally value on spinner gadget for powerful calculation.

This works good, but this have a little problem: In this sample MySpinValue works with "10000" as value instead of "100". Problem: Integers can have max. 4294967295 unsigned and signed max. 2147483647.

bye


sry for my bad english


Ricky Smith(Posted 2006) [#86]
Thanks for that useful routine - I use a similar conversion like this for trackbars which also only have int values.
The problem with spinners is one of display.
A label or textbox placed next to a spinner automatically becomes a "buddy" and I was seeing if I could avoid having to manually update the value shown in it or having to have a "dummy" buddy and then showing my "decimal" value in yet another label - seems like a lot of additional overhead.


Kev(Posted 2006) [#87]
@Chroma. I will look into this thanks.

@Smiff. im currently looking into using float, however there seems to be problems.

soon as ive some more info i will let you guys now.

kev


Ricky Smith(Posted 2006) [#88]
The spinners also cannot return negative values.
Its possible to set the range to a negative number but WB3D_GetSpinnerPos() cannot return it - unsigned ints ?


kevin8084(Posted 2006) [#89]
what I do is get the buddy's text and check for sign such as:
If picked_object <> 0 And picked_object <> terrain Then
     xs#=Float#(WB3D_GetGadgetText$(txtXScale))
     ss=Sgn(xs)
     If xs# <> 0 Then
          If ss>0 Then ScaleEntity picked_object,xs,xs,xs
     Else
      xs#=Float#(Abs(1/xs))
     ScaleEntity picked_object,xs#,xs#,xs#
      End If
End If



Kev(Posted 2006) [#90]
small update uploaded, this fixes spinners so they return negative values.

@Chroma, yes just seen this when creating groupboxs its best to first create the gadgets that are displayed within the groupbox then overlay the groupbox on the gadgets. the gadgets created show through the groupbox.

kev


Ricky Smith(Posted 2006) [#91]
Oops -with the last update the spinners now are disabled as soon as you set a value and always return zero !


Kev(Posted 2006) [#92]
@Smiff, did you copy the .decls to userlib as there updated.

if you have can you test this.


; WB3D styles
Include "WB3DStyles.bb"

Graphics3D 800,480,16,2
SetBuffer BackBuffer()

Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,800,500)
WB3D_SetQuitMessage "WB3D 3D/GUI quit","Sure To Quit Test.bb" 

window = WB3D_CreateWindow("test",100,100,500,300,0,0)

spinner_value = WB3D_CreateEditField("",40,5,100,20,window,0,2)
spinner = WB3D_CreateSpinner(141,5,40,20,window,1,0)
WB3D_SetSpinnerRange spinner,-100,100

While Not KeyDown(1)
	
		
	Select WB3D_WaitEvent()
		
		Case WB3D_EVENT_GADGET
			Select WB3D_EventSource()
			
			
			End Select
		
	End Select
		
Wend

WB3D_EndGUI()
End



kev


Ricky Smith(Posted 2006) [#93]
Yep - the decls fixed the disabling but negative values are still being returned as the value + 65536 . Easy enough work around I suppose.
Try this and move the spinner to a negative value :
; WB3D styles
Include "WB3DStyles.bb"

Graphics3D 800,480,16,2
SetBuffer BackBuffer()

Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,800,500)
WB3D_SetQuitMessage "WB3D 3D/GUI quit","Sure To Quit Test.bb" 

window = WB3D_CreateWindow("test",100,100,500,300,0,0)

spinner_value = WB3D_CreateEditField("",40,5,100,20,window,0,2)
spinner = WB3D_CreateSpinner(141,5,40,20,window,1,0)
WB3D_SetSpinnerRange spinner,-100,100
label=WB3D_CreateLabel("",141,40,60,20,window,0)

While Not KeyDown(1)
	
		
	Select WB3D_WaitEvent()
		
		Case WB3D_EVENT_GADGET
			Select WB3D_EventSource()
			Case spinner
			WB3D_SetGadgetText (label,WB3D_GetSpinnerPos(spinner))
			
			End Select
		
	End Select
		
Wend

WB3D_EndGUI()
End




Ricky Smith(Posted 2006) [#94]
Well, Ive spent some time now with WinBlitz3d but have now ground to a halt due to some major problems.
It is very promising but it still needs a lot of work in some areas.

The biggest problem is that quite often and for no apparent reason the Gui stops responding to events.

This also happens when you are manually updating the position of a trackbar or spinner. It seems that the sytem get flooded by events.

The spinners still do not return correct negative values - the buddy displays the correct value but the value obtained with GetSpinnerPos() is the value + 65536. If you use the buddy value this seems to be a lot slower for some reason.

My GUI is extremely demanding and I use most of the gadgets to their limit.
For simple interfaces this should be fine but for anything more complex where there is interaction between gadgets it currently is not working for me.
I shall keep an eye on this and hope that its updated/fixed in the future.


Kev(Posted 2006) [#95]
Hi Smiff


This also happens when you are manually updating the position of a trackbar or spinner. It seems that the sytem get flooded by events.


try removing the events using WB3D_FlushEvents().

for example
 ; window / gadget creation

select wb3d_eventsource()
       case trackbar
           trackbarpos = WB3D_GetTrackBarPos(trackbar)
           WB3D_FlushEvents()
end select



The spinners still do not return correct negative values - the buddy displays the correct value but the value obtained with GetSpinnerPos() is the value + 65536. If you use the buddy value this seems to be a lot slower for some reason.



im gettin there but i am busy right now, with the next version WB3D_EventData() will return the correct value. this does seem strange as WB3D_GetSpinnerPos(spinner) Or $ffff0000 does return the correct negative. although the possitve numbers become negative ;)

any way dont worry i will try and get to the bottom of this a.s.p

kev


Ricky Smith(Posted 2006) [#96]
Thanks Kev - I tried the WB3D_FlushEvents(), but it seems that spinner and trackbar events are generated when modifying their positon via code ?? If they do is there any way to filter them out ?
I really apreciate all your work on this by the way - WB3d is so close to being the perfect gui for Blitz3d. My interface now looks so much better and has so much more scope for expansion that I don't want to use anything else !


Danny(Posted 2006) [#97]
Hi Smiff,
WB3D and the Windows API in general take some time and effort to get your head around, it's a rather complex beast, especially when you start playing with styles.
But I can guarantee you that's it's totally capable of effeciently handling very complex gui's. But I had to adjust my programming style a bit to match the way it operates.

For every big gui element or floating window I typically have 3 functions:
gui_myWindow_show() - which sets up, positions and prepares the window, fills gadgets with static values (eg. combo boxes with a certain selection of values).
gui_myWindow_update() - to capture events specific to this window and act upon it. This is called from you main loop.
gui_myWindow_refresh() - which refreshes the gadget's values when something has changed (either internally or externally).

So yes, to prevent a recursive loop/event re-entry, you have to do a flushevents at the end of the function where you fill gadgets and don't want to trigger an event (in my example the _show and _refresh functions).

With spinners and trackbars/sliders I find it easier to always set them to a 0 to 100 range at design time - and use a function at runtime to get or set whatever range I want to use for a specific value (for example -2.5 to +2.5 or 0 to 255). Here's two example functions I use for a trackbar together with an edit box to display the value in text/numbers; If the slider is touched I call the first, if the edit box is edited, I use the second function. Both complement each other and return me the exact value within the given range:


Hope this helps,
Danny


Ricky Smith(Posted 2006) [#98]
Many Thanks Danny - that's extremely helpful !


Ked(Posted 2007) [#99]
I have a problem with this. It is great, don't get me wrong! When I compile it everything goes fine. I end the compile, thats when everything goes whacky. On task manager under the Processes tab says that blitzcc.exe (the compiler) is still running. But every time I compile there is a new one there along with the old one. So after a while I get 43 blitzcc.exe processes. Thats when I get an error message telling me that my virtual memory is violently low. Can anyone help me with this??


Kev(Posted 2007) [#100]
Ked, sounds like a very old bug there. does this happen with the included examples? are you using the debuggers end(exploding bomb) to quit your compiled run?


kev


Ked(Posted 2007) [#101]
Hey. I got it working. I had Waitkey() in there so when I exit the window its still compiled and running because the runtime window is in there hidden. But its all good.

Hey is there going to be an HTMLView sometime? Just wondering. Right now I'm trying to get a TCP/IP thing going in WinBlitz3D. A chat.

Sorry for the fuss.


Pinete(Posted 2007) [#102]
is SCHNOK completely functional?, say, could I make GUIs and used it with Winblitz3d is a normal way without expecting so many bugs?

This is my first contact with this post and with Winblitz and Schnok..

Sorry if someone has wrote before about that..


Thanks in advance,


Kev(Posted 2007) [#103]
@Ked, good its working. you can always use wb3d's WB3D_EVENT_KEYPRESS to get keyhit events, Ive looked into HTMLView gadgets but not sure if/when they will be added.

@Pinete, SCHNOK completely functional all it lacks the the mouse size&move gadget features most GUI designers have. although it does make up for it in other areas.

kev


Ked(Posted 2007) [#104]
Hey.

I'm not sure of how to make a menu. I can't figure it out. (That shows you how smart I am) But I try to make a File menu and it won't show up.


Kev(Posted 2007) [#105]
Hi Ked

quickly put togther menu example

Include "WB3DStyles.bb"

; setup gfx mode.
Graphics3D 640,480,16,2
Global switch=0

; install winblitz3d.
Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,300,200)
WB3D_SetQuitMessage "WinBlitz3D 3D/GUI","Sure To Quit" 
;WB3D_HideGadget RuntimeWindow_hWnd

; create winapi window, setting its title, and position on screen. use default style creation.
example_window = WB3D_CreateWindow("WB3D_CreateWindow Example",200,100,450,275,0,0)

; menus
menus = WB3D_WindowMenu(example_window)
file = WB3D_CreateMenu("File",0,menus,0)
	NewItem = WB3D_CreateMenu("New",1,file,0) : WB3D_AddMenuIcon(file,1,"menuBMPS/MENUNEW.BMP")
	OpenItem = WB3D_CreateMenu("Open",2,file,1) : WB3D_AddMenuIcon(file,2,"menuBMPS/MENULOAD.BMP")
	
		OpenItem_1 = WB3D_CreateMenu("Open Sub Item 1",43,OpenItem,0) 
		OpenItem_2 = WB3D_CreateMenu("Open Sub Item 2",20,OpenItem,0) 
		
			SUBOpenItem_1 = WB3D_CreateMenu("Sub Item 1",44,OpenItem_2,0) : WB3D_AddMenuIcon(file,44,"menuBMPS/MENULOAD.BMP") 
			SUBOpenItem_2 = WB3D_CreateMenu("Sub Item 2",45,OpenItem_2,1) 
				SUBOpenItem_5 = WB3D_CreateMenu("Sub Item 2",46,SUBOpenItem_2,0)
			
	WB3D_CreateMenu("",0,file,0)
	SaveItem = WB3D_CreateMenu("Save",3,file,0)  : WB3D_AddMenuIcon(file,3,"menuBMPS/MENUSAVE.BMP")
	WB3D_CreateMenu("",0,file,0)
	QuitItem = WB3D_CreateMenu("Quit",4,file,0) : WB3D_AddMenuIcon(file,4,"menuBMPS/MENUQUIT.BMP")

editmenu_window_1 = WB3D_CreateMenu("Edit",0,menus,0)
	CutItem = WB3D_CreateMenu("Cut",5,editmenu_window_1,0) ;: WB3D_AddMenuIcon(editmenu_window_1,5,"menuBMPS/MENUCUT.BMP")
	CopyItem = WB3D_CreateMenu("Copy",6,editmenu_window_1,0) ;: WB3D_AddMenuIcon(editmenu_window_1,6,"menuBMPS/MENUCOPY.BMP")
	PasteItem = WB3D_CreateMenu("Paste",7,editmenu_window_1,0) ;: WB3D_AddMenuIcon(editmenu_window_1,7,"menuBMPS/menupaste.BMP")
 
	WB3D_RadiocheckMenu editmenu_window_1,5,7,6
		
WB3D_UpdateWindowMenu(example_window)

; cleanup any old creation events, its better to do this before we enter the main
; event loop, when some gadgets are created they generate events.
WB3D_FlushEvents 

; setup out quit flag, and loop until the flag is set.
QUIT = 0
While Not QUIT = 1
	
	; generate an internal blitz event
	Flip
	Cls
	
	; get an event of the event queue.
	event = WB3D_WaitEvent()
	
	Select event
		
		Case WB3D_EVENT_KEYPRESS
		
			; wb_eventdata holds the key code that was pressed.
			keypressed = WB3D_EventData()
			Select keypressed
				
				Case WB3D_KEY_ESCAPE	
					
					; set the flag to leave the loop.
					QUIT = 1
					
			End Select
				
		Case WB3D_EVENT_WINDOW_CLOSE
		
			; wb3d_eventsource hold the handle to the window that close button was selected
			window = WB3D_EventSource()
			Select window
			
				Case example_window
					
					; set the flag to leave the loop.
					QUIT = 1
					
			End Select
	End Select
	

Wend

; use notify using external winapi constants. 
WB3D_Notify "WB3D GUI Window Example","Bye, Thats It I Quit",MB_OK Or MB_ICONASTERISK
WB3D_EndGUI()
EndGraphics
End



FiNegirO(Posted 2007) [#106]
Thanks Kev, it's a great work!

btw: is there a way to paint 3dview (camera viewport) over a GUI?


Ked(Posted 2007) [#107]
OK, great. Thanks, Kev!


Kev(Posted 2007) [#108]
FiNegirO, see here.

http://www.winblitz3d.co.uk/forum/viewtopic.php?t=77

kev


Ked(Posted 2007) [#109]
@Kev:
Hey, how did you make all of this? How did you know how to do it??


Kev(Posted 2007) [#110]
Ked, I spent years learning basic,c++ and assembly language.

the winapi stuff was learned over the last 3 to 4 years, basicly through other peoples examples like one does :)

kev


Ked(Posted 2007) [#111]
Is there a way to create a window like the "About Blitz3D!" window? Where there is no X button or minimize button or maximize button??


Kev(Posted 2007) [#112]
Ked

window = WB3D_CreateWindow("Test About Style",100,100,100,100,0,WS_VISIBLE Or WS_ACTIVECAPTION)


you need to define styles when creating your window.

kev


Ked(Posted 2007) [#113]
you need to define styles when creating your window.


I know, but I don't know what styles do what.


Ked(Posted 2007) [#114]
Hey! I have a function that that helps put text into textareas. It's not much just something I put together to help me out. Maybe it will help out others?

Function AddTextAreaText(textarea,txt$)
SetTextAreaText textarea,txt$+Chr$(13)
End Function


Is there anyway to add scrollbars onto textareas?
Thanks!
Ked


Danny(Posted 2007) [#115]
To add scrollbars, use the ES_AUTOHSCROLL and ES_AUTOVSCROLL styles.

Kev, is there a way yet to 'clear' a textarea's text?

d.


OJay(Posted 2007) [#116]
hi there,

im thinking on trying out winblitz3d for a small tool, but i would need something like a propertiesgrid:


do you think this (or something similar) is possible with winblitz3d? would make a donation for it, of course :)

thanks a lot!

cheers


Kev(Posted 2007) [#117]
@Danny, did i not add that before winblitz3d left beta? i will look into it.

@OJay, yes you would need to use listviews, and donations always welcome.

kev


OJay(Posted 2007) [#118]
yes you would need to use listviews


hm, ok...but how would i hook in the appropriate gadget to the current selected item to edit it? see: there can be a few different types of items within the grid; such as: text (normal editfield), list (listbox), slider, spinner, color (opens a color requester), font (font requester), file (file requester) etc...

how would i calculate the exact position of the gadget where it has to be placed?


Kev(Posted 2007) [#119]
i now understand OJay, you can have standard 'propertiesgrids' using listviews although its not possable to add gadgets to its items container.

kev


OJay(Posted 2007) [#120]
i see.

ok, i'll stay with blitzui than i think, because there i can write a propertygrid-gadget on my own; although with a considerably amount of work...but at least its possible in theory...

sorry


OJay(Posted 2007) [#121]
have you seen this one: http://blitzbasic.com/Community/posts.php?topic=61612#688672 ?

sure, its blitzmax, but it uses the winapi, too...so maybe it can be applied to winblitz3d as well? or do you see any functions/features missing?

worth a try, i would guess :)


Ked(Posted 2007) [#122]
To add scrollbars, use the ES_AUTOHSCROLL and ES_AUTOVSCROLL styles.

Yes, but when you use those it just scrolls without the scrollbars. Maybe I'm not doing it right?


Danny(Posted 2007) [#123]
yes you're right sorry... use WS_VSCROLL instead. Then the vertical scroll bar will be visible as soon as it's needed.

In case you haven't got it (or aren't using it), maybe you can use Schnok (a free wb3d gui editor) to help you out. You can tweak styles as much as you want and instantly see the result, tweak and play around with it - and export straight to blitz3d code that you can include in your project.

Get it here: http://www.blitzbasic.com/Community/posts.php?topic=62516#698450

Hope that helps


Ked(Posted 2007) [#124]
Hey guys, I have something else that should help out! Instead of having to always install WinBlitz3D yourself you could just make a function like below to do it for you.

Function Start(quitmessage$,hide$,bodytext$,titletext$)
If quitmessage$="no" And hide$="hide" Then
appwnd=WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,500,500)
WB3D_HideGadget appwnd
ElseIf quitmessage$="no" And hide$="show" Then
appwnd=WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,500,500)
Elseif quitmessage$="yes" And hide$="hide" Then
appwnd=WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,500,500)
WB3D_SetQuitMessage(bodytext$,titletext$)
WB3D_HideGadget(appwnd)
Elseif quitmessage$="yes" And hide$="show" Then
appwnd=WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,500,500)
WB3D_SetQuitMessage(bodytext$,titletext$)
EndIf
End Function

Hope this helps also!


Danny(Posted 2007) [#125]
...


Ked(Posted 2007) [#126]
...

What?