SCHNOK! 0.95 beta - Gui Editor for WinBlitz3D

Blitz3D Forums/Blitz3D Programming/SCHNOK! 0.95 beta - Gui Editor for WinBlitz3D

SCHNOK! is a gui editor for WinBlitz3D which alows you to graphically design your forms and gui's "in real time!" and export to Blitz3D code ;)

Note that this is a rushed and early 'undocumented beta' release of SCHNOK! v0.95!
It has known bugs and limitations so be sure to read the ReadMe file..

Unfortunately I have little time these days to work/improve much on it. But I think it's good enough that you guys can do some funky stuff with it.

Main features include (but are not limited to):

GRAPHIC DESIGN
- Add, remove, scale, position gadgets
- tweak gadget values and type specific properties
- All wb3d gadgets supported except the Scrollbar, Statusbar and context menu.

EXOPORT TO BLITZ CODE
- Export to blitz code (different templates and options available).
- Use the 'test program' template on the export panel, load it and hit F5!
- Optionally exports select..case structures to capture gadget & other events.
- Use the minimal template and just 'include' the exported file so you can tweak, change and work on your gui without having to adjust your own code or copy-paste nightmares.

FONT MANAGEMENT
- Create and alter fonts
- Font changes are automatically applied to all gadgets using 'em.

STYLES SUPPORT
- standard and extended styles supported.
- basic style templates available; create a button and change it to a toggle button or a flat button.

MISC
- You can specify for each gadget if it should be declared as a global variable to optimise memory usage.
- Gadget specific editors for toolbars (edit buttons, add seperator), pull down menu's and tabbers.
- Numerous hidden bugs and other quirky behaviour comes at a standard.
- The 'Content Directory' let's you specify the root of you game/application from where all external files are loaded. Like bitmaps and icon strips for example.

DOWNLOAD
here: www.xs4all.nl/~dendanny/SCHNOK/schnok.v0.95b.rar


Enjoy,

Danny

Can you do a .zip plz. .rar is like...so 10 years ago!

Great job ! no crash ! :) Do you plan modifications like
gadget moving , scale etc with mouse ? :)

Great work! nice, no crash here either...

@Chroma ... I use winrar myself, but it's true that I use it since 10 years!

very cool danny, this realy does show what winblitz3d is all about.

@Chroma, winrar dude here also :)

ok ok i just downloaded winrar are you happy!! =p

can't wait to check this out tho

I love this thing! So much better than doing it manually. I whipped this up in about 20 min:



EDIT: Very impressed now. I've already got this in my editor and working...zing!

Awesome tool - many thanks . The style editor is particularly good.
Here's a (very) wip shot :



oh wow that's awesome guys !!!!

Really cool to hear you guys like it and already making some seriously(!) funky stuff!!!! :)))

Make sure you stick to a proper naming convention for your global variables because these gui's can grow into monsters! My own editor has passed like 800 of 'em! ;)

In stead of having one MASSIVE select case structure, check if a seperate/floating window is open, and if so, run a seperate _update() routine for each window. So you can 'manage' all these gadgets/global variables. Like:
If WB3D_GadgetVisible(winProp) Then uiFree = gui_winProp_update(event,eSource,eData)
Keep those shots coming!

Danny

By the way, here's a tip how you can 'unhook' the runtime window and sticking into any other window (or gadget) so you're not stuck with the full screen 3d in the background:
;create WinBlitz3D runtime & make it an orfan by removing WS_CHILD from it's style
runtimeWindow = WB3D_InitializeGUI(SystemProperty("AppHwnd"),0,0,1280,800)
WB3D_SetGadgetStyle runtimeWindow, WS_VISIBLE Or WS_CLIPSIBLINGS

;then just parent/size it to whatever window (gadget) you want like:
WB3D_SetParent runtimeWindow, gadget
But be carefull because if you try to scale the runtimewindow to a size LARGER than the size you gave to Graphics3D width,height,0,2 then it will hang! So you'll have to prevent that. Here's an example function from my own editor that I use for different sub-editors (particles, set, ragdoll, etc.):
Function gui_set3dviewportGadget( gadget )
	
;| This function stuff the Blitz3D runtimewindow inside the given gadget, using it's dimensions

	w = WB3D_GadgetWidth(gadget)
	h = WB3D_GadgetHeight(gadget)
	
	winBlitzCurParent = gadget
	WB3D_SetParent winBlitz, gadget
	
	;check if Blitz Graphics are smaller than the gadget!
	If (GraphicsWidth()<w) Or (GraphicsHeight()<h) Then
		wNew = GraphicsWidth() : hNew=GraphicsHeight()
		x = w/2 - wNew/2
		y = h/2 - hNew/2 -1
		w = wNew
		h = hNew
		WB3D_SetGadgetShape winBlitz, x,y, w,h
	Else
		x=0
		y=0
		WB3D_SetGadgetShape winBlitz, 0,0, w,h
	EndIf
	
	WB3D_ShowGadget gadget
	WB3D_ShowGadget winBlitz
	
	If camera <> 0 Then
		Viewport 0,0, w,h
		CameraViewport camera, 0,0, w,h
		CAMERA_WIDTH = w
		CAMERA_HEIGHT = h
	EndIf
	SetBuffer BackBuffer()

End Function


Here's a sample of what I mean:


Hope this helps,

Danny

@filax,

I hate moving gadgets by keyboard myself as well, but the problem is that WB3D doesn't alow me to 'select' each gadget with a single mouse click like you can in Visual Basic for example.

Buttons and labels are no problem (you can select them by clicking on 'em in stead of using the GadgetWindow). But I'm not able to capture a single click event on for example a combo (you'll need to select something from the list) or an editbox (you'll have to type 1 character) etc....
So I'm a bit stuck there :/

d.

Danny, SCHNOK! works great! Thanks!

Danny, load Lstudio\Build_Mode.v281.snk, click the titlebar on the resulting window, and watch it march across the parent window from left to right! Huh?

@dan, the program uses a very tight loop. Maybe there could be a small delay in it, so you can test your .bb program without having to close schnok ? And as for scaling with the mouse, maybe you can make it so, that when ctrl is held down, you can alter the size of the current object with the mouse ? I noticed the "File menu" object doesn't work ? At least, in the editor it doesn't show, but when I move the mouse over it, it appears. In the final (exported) program there is no menu. However, this tool is very very handy. Schnok on dude :)

@John, I can't reproduce it and never seen it happen before. But can imagine what could produce it; probably needs a flushevents() somewhere?!... Can you reproduce this quite consistently??

@ Bram,

Re: tightloop: I know what you mean, but you can't (and I would advice 'never') 'slow down' a WB3D program by introducing a delay, because there will be a very possible chance that you will start to MISS EVENTS from your main gui loop! Which could be extremely anoying to the user ie. having to press something more than once before it responds!

But what I could do perhaps is create like a 'pause mode' sort of button! so you can test your own app in the background.

Re: the CTRL button to scale. That's another tricky thing with WB3D because you can ONLY capture keyboard events when you activate the blitz runtime window ie. when it has focus! Hence the reason you current 'MUST' click on the background (=blitz runtimewindow) before you can use the cursor keys to move/scale a gadget! Kev did start on a global key event or 'hotkey' function but I don't believe that made it to the final release...

Re: the pull down menu not functioning correctly: Yes you're right. I don't know why it doesn't repaint in the editor, I'll look into it.

The menu options not being exported isn't a bug - but more a case of 'the total absence of code' :)) Sorry, guess I never came around to that. You'll have to do that manually for now :/ But I'll try and cough up a little update over the weekend pending hangovers...

cheers,
danny

Smiff....how are you using the XP style buttons and gadgets? I switch my Appearance to XP from Classic and everything is XP but my WinBlitz3D stuff. =(

@Chroma, theres a startup screen remover that writes out a windows xp manifest, this is thanks to filax.

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

Smak! thanks!

Kev, I don't understand what the start up remover has to do with making WB3D use XP style buttons...please elaborate. Shouldn't WB3D use the selected style already in use by the computer?

Chroma:
The start window remover also places a manifest file for the program being patched.

Though, I suggest that people don't trust it too much to do both tasks; that start window remover doesn't work on programs compiled with some versions of B3d and it is not a good idea to run it twice.

Perhaps the program should be written to do them both seperately...

Anyway, the manual method is here:
http://www.blitzbasic.com/Community/posts.php?topic=48657

Ok...I just used skidracers ide.exe.manifest. If you put it in the bin file and name it blitzcc.exe.manifest it will run your apps from the IDE with the XP style too. Great for see what it looks like on the fly.

Ugh...after almost getting my UI done now anytime I try to click on a tabber panel I get an instant MAV. =( =(

Chroma - check you haven't got a misspelt gadget handle - this creates a MAV everytime !

Hmm...what exactly do you mean Smiff?

It must be something like that because I can't delete any of the tabs that are causing the MAV.

Ok...I set all the names to nothing and now the MAV goes away...but I still can't delete them...I'm getting close to solving this though.

EDIT: Never change the tabber tab name to nothing...you can see it but not delete or interact with it at all. =(

EDIT: I just started over...

Thanks for this Danny - very useful.

@Chroma, Yes I'm aware there's a problem with Schnoks tabber-editor! Once you start removing tabs or move 'em around there's a good chance things will go wrong! Sorry I didn't warn for this - I rushed the release on request.
But are you getting the MAV in Schnok or in your own program? And do you get it as well when you do a full 'Test Program' export?

Before I export the code I do about a dozen tests on gadget properties, variable names and other things that should give a warning before you export, in situations like 'illegal variable names' or 'duplicate names' for example. But i'm sure there's other things possible I haven't considered yet...

Send me your .snk or .bb file if you want me to check it out or try and fix it!

@JoeGr - you're welcome dude!

d.