SCHNOK! 0.95 beta - Gui Editor for WinBlitz3D

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

Danny(Posted 2006) [#1]
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: <link to old version removed>

[EDIT]
Vista compatible version: www.xs4all.nl/~dendanny/SCHNOK/schnok.v1.00.rar


Enjoy,

Danny


Chroma(Posted 2006) [#2]
Can you do a .zip plz. .rar is like...so 10 years ago!


Filax(Posted 2006) [#3]
Great job ! no crash ! :) Do you plan modifications like
gadget moving , scale etc with mouse ? :)


LAB[au](Posted 2006) [#4]
Great work! nice, no crash here either...

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


Kev(Posted 2006) [#5]
very cool danny, this realy does show what winblitz3d is all about.

@Chroma, winrar dude here also :)


Chroma(Posted 2006) [#6]
ok ok i just downloaded winrar are you happy!! =p

can't wait to check this out tho


Chroma(Posted 2006) [#7]
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!


Ricky Smith(Posted 2006) [#8]
Awesome tool - many thanks . The style editor is particularly good.
Here's a (very) wip shot :




Danny(Posted 2006) [#9]
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


Danny(Posted 2006) [#10]
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


Danny(Posted 2006) [#11]
@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.


b32(Posted 2006) [#12]
Danny, SCHNOK! works great! Thanks!


John Blackledge(Posted 2006) [#13]
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?


b32(Posted 2006) [#14]
@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 :)


Danny(Posted 2006) [#15]
@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


Chroma(Posted 2006) [#16]
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. =(


Kev(Posted 2006) [#17]
@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


degac(Posted 2006) [#18]
Smak! thanks!


Chroma(Posted 2006) [#19]
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?


Picklesworth(Posted 2006) [#20]
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


Chroma(Posted 2006) [#21]
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.


Chroma(Posted 2006) [#22]
Ugh...after almost getting my UI done now anytime I try to click on a tabber panel I get an instant MAV. =( =(


Ricky Smith(Posted 2006) [#23]
Chroma - check you haven't got a misspelt gadget handle - this creates a MAV everytime !


Chroma(Posted 2006) [#24]
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.


Chroma(Posted 2006) [#25]
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...


JoeGr(Posted 2006) [#26]
Thanks for this Danny - very useful.


Danny(Posted 2006) [#27]
@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.


Danny(Posted 2010) [#28]
Not sure if anyone (still) uses this...

Here's a version that's more Vista-friendly and a few minor bugs removed..

www.xs4all.nl/~dendanny/SCHNOK/schnok.v1.00.rar

Enjoy!

D.


Oiduts Studios(Posted 2010) [#29]
Looks cool but when I opened the program in Windows 7 I noticed some graphical issues. It seems that the windows will only refresh if I hit the minimize button, is this normal in the editor? What I mean is that if windows are moved about certain sections start to disappear. If I shake them sporadically, they end up going away completely until i find the minimize button.


Danny(Posted 2010) [#30]
Thanks for mentioning that Blitz Monkey, and sorry to hear it :(

I haven't got W7, but didn't have any problem like this with Vista. However, I've had other repainting problems with Vista and I believe (really hope) that Kev (WB3D creator) is currently checking them out..

The only thing I can suggest right now is to check do properties on the executable and play around with the compatibility settings to see if that helps. Let me know how you get along.

Cheers,
Danny


Oiduts Studios(Posted 2010) [#31]
Disabled Sli - No effect
Disabled Dual screen - No effect

I don't know if this is normal but I can not open anything under Editor and Help but... Set Content Directory, and About Schnok. Everything under File works.

Also, the black (i guess 3D bar-code?) only appears after I click on something in the Gadget Properties window, About Schnok, or some items under File.

So as you can see nothing is making since to me, but I guess it's because it is not my code, so good luck :D.


Danny(Posted 2010) [#32]
Sorry for the confusion BM, yes the preferences option listed in the editor menu and nearly all options in the Help menu are not active. I forgot those were there long ago and should have removed them.

The 3D bar code only appearing after a click is part of the WB3D repaint problem i mentioned before..

You have to know and understand that I wrote Schnok in parallel with WB3D's development from version 0, constantly undergoing heavy changes (hence unstable code). I hacked it together for my own use and never intended to release it. I did put it up for download eventually because it can save you a ton of time designing forms's - the few quirks that it has are the (only) price you pay for using it ;)

But otherwise, are you able to use the toolbar to create windows, select gadgets, edit them, etc?

D.


Charrua(Posted 2010) [#33]
looks impressive!
will take a look at it, seems to be a very useful tool at first.
Run under Windows Vista Home Basic, i note a little delay on FileOpen dialog but nothing more than that i test!

Juan