Easy way to create windows menus & buttons?

Blitz3D Forums/Blitz3D Userlibs/Easy way to create windows menus & buttons?

Ekix(Posted 2008) [#1]
Is there any good tool or whatsoever (possibly with design option) to create menus & buttons ito a Blitz3D application.
The tools in the toolbox seems not to be so good, or they are just demos and I think there should be a free tool for this available (like in PureBasic) or dead links like WinBlitz3D by Kev.

What are you guys using for this?

Ekix


Naughty Alien(Posted 2008) [#2]
AlphaGui..fully featured editor and stuff..


John Blackledge(Posted 2008) [#3]
The Toolbox link is wrong.
Try this:
http://www.whitegatesoftware.com/winblitz3d.zip


Ekix(Posted 2008) [#4]
Jee, thanks,


But all the examples end up to an error like "Function WB3D_InitializeGUI not found" or something else not found:
Maybe I did miss something or what went wrong, have you got errors like this with WinBlitz3D?

I also tried to find this AlphaGui, not could not find it, just a web page with losts of Google Ads...

Ekix


stayne(Posted 2008) [#5]
For WinBlitz3D make sure you put blitz3d_gui_dll.dll in your Blitz3D userlibs folder. By the way your signature is a bit odd for this forum in my opinion.


Ekix(Posted 2008) [#6]
I did put the DLL (blitz3d_gui_dll.dll) as you told into C:\Program Files\Blitz3D\userlibs folder, but for some reason it just does not work.

Any idea why?

Ekix


Kev(Posted 2008) [#7]
what verion of blitz3d are you using, update to the latest version should work.

kev


Ekix(Posted 2008) [#8]
It,s the latest one 1.98. I also installled the latest 1.99 update but the About popup says its 1.98 for some funny reason?

Ekix


Kev(Posted 2008) [#9]
and you have copyed Blitz3D_GUI_DLL.decls to your blitz3d userlibs folder?


Ekix(Posted 2008) [#10]
Yep, as I told you...

I did put the DLL (blitz3d_gui_dll.dll) as you told into C:\Program Files\Blitz3D\userlibs folder, but for some reason it just does not work.



Weird
Ekix


Kev(Posted 2008) [#11]
ok can you provide some extra info system spec and os system your using, winblitz3d has been available for over 2 years without any problems.

i notice you refer to 'blitz3d_gui_dll.dll' have you copyed the .decls as well you should have 2 files within the blitz3d userlibs folder. blitz3d_gui_dll.dll and blitz3d_gui_dll.decls

sorry if you mean this its no so clear you have copyed both dll and decls to userlibs

kev


Ekix(Posted 2008) [#12]
Thanks Kev


blitz3d_gui_dll.decls I missed to put into same directory as the dll file, now it's working and look's cool.

Is there somewhere an example of using menus also, at least I could not find one?
And is there some place (like forum or whatsoever) to ask in case I don't understand everything?

I think someone should also correct the download link in toolbox...

Thanks a lot for your help so far :=)
Ekix


John Blackledge(Posted 2008) [#13]
Yeah, it helps to put the decls in the userlibs folder.

As an alternative to putting the dll in there as well (-you will want to issue it one day) I always create a folder next to my engine e.g. TLA\sys\ and drop the dll in there, then in the decls rename the .lib line to .lib "TLA\sys\WB3D.DLL".


Kev(Posted 2008) [#14]
Ekix, I have no forum but posting here with any problems normal results in help from myself or someone else that uses winblitz3d.

see examples folder

kev


Ekix(Posted 2008) [#15]
I did go troug all the examples, but for some reason could not find a windows menu example, is it possible to create menus with WinBlitz3D?


Kev(Posted 2008) [#16]
quick example i just grabbed from my un-released examples

Include "WB3DStyles.bb"

; setup gfx mode.
Graphics3D 640,480,16,3


Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,800,600)

; hot key events
WB3D_HotKeyEvent MOD_ALT,78,1	; alt+n
WB3D_HotKeyEvent MOD_CONTROL,76,25	; ctrl+l


; menus
menus = WB3D_WindowMenu(RuntimeWindow_hWnd)
file = WB3D_CreateMenu("&File",0,menus,0)
	NewItem = WB3D_CreateMenu("&New... "+WB3D_MENUHOTKEY_SPACER+"Alt+N",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"+WB3D_MENUHOTKEY_SPACER+"Ctrl+C",5,editmenu_window_1,0) ;: WB3D_AddMenuIcon(editmenu_window_1,5,"menuBMPS/MENUCUT.BMP")
	CopyItem = WB3D_CreateMenu("Copy"+WB3D_MENUHOTKEY_SPACER+"Alt+C",6,editmenu_window_1,0) ;: WB3D_AddMenuIcon(editmenu_window_1,6,"menuBMPS/MENUCOPY.BMP")
	PasteItem = WB3D_CreateMenu("Paste"+WB3D_MENUHOTKEY_SPACER+"Ctrl+P",7,editmenu_window_1,0) ;: WB3D_AddMenuIcon(editmenu_window_1,7,"menuBMPS/menupaste.BMP")

	WB3D_RadiocheckMenu editmenu_window_1,5,7,6
		
WB3D_UpdateWindowMenu(RuntimeWindow_hWnd)


statusbar = WB3D_CreateStatusBar(RuntimeWindow_hWnd,"")
WB3D_SetStatusParts statusbar,4
;
WB3D_StatusPartWidth(statusbar,0,150)
WB3D_StatusPartWidth(statusbar,1,50)
WB3D_StatusPartWidth(statusbar,2,50)
WB3D_StatusPartWidth(statusbar,3,200)
WB3D_StatusPartWidth(statusbar,4,-1)
;
WB3D_SetStatusText statusbar,0,"part 0"
WB3D_SetStatusText statusbar,1,"part 1"
WB3D_SetStatusText statusbar,2,"part 2"
WB3D_SetStatusText statusbar,3,"part 3"
WB3D_SetStatusText statusbar,4,"part 4"
;
WB3D_UpdateStatusbar statusbar

; 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
 	
	Cls
		
	
	; get an event of the event queue.
	event = WB3D_WaitEvent()
	
	Select event
		
		Case WB3D_EVENT_GADGET
			Select WB3D_EventSource()	

			End Select			

		Case WB3D_EVENT_MENU
			WB3D_Notify "menu item","Menu selected: "+WB3D_EventData(),0
			WB3D_FlushEvents()
			
		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_ShowGadget RuntimeWindow_hWnd

			Select WB3D_EventSource()
				Case RuntimeWindow_hWnd
					QUIT = 1
										
					;state = WB3D_Notify("Quit","Save changes",MB_YESNOCANCEL)
					;Select state
					;
					;	Case IDCANCEL
					;	
					;	Case IDYES	
					;	
					;	Case IDNO
					;		QUIT = 1
					;			
					;End Select
					
				
			End Select
			
	End Select
	
	; generate an internal blitz event
	Flip

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


i do plan on adding these examples to the download its finding the time.

kev


Ekix(Posted 2008) [#17]
Thanks Kevin

It tolds me that "Not enough parameters" even that I did put it to the same folder as the include file....?

Did I miss something once again?


Kev(Posted 2008) [#18]
download beta v1.1, the example possable needs beta v1.1

http://www.whitegatesoftware.com/WB3D_v1.1.zip

what wb3d function call gives "Not enough parameters"?

rember to ovewrite the .decls and .dll with the new beta version.

kev


Ekix(Posted 2008) [#19]
Thanks Kevin

All the other examples wors now exept that WebBrowser.bb, which gives an error as below. Looks like its because of one line in the include file in
"status_text$ = status_text$ + Chr(PeekByte"(bank,loop)) line.

---------------------------
Runtime Error
---------------------------
Offset out of range
---------------------------
OK
---------------------------


Kev(Posted 2008) [#20]
Function WB3D_GetBrowserStatusText$()
	bank = CreateBank(2001)
	WB3D_GetStatusTextB(bank,0)
	For loop = 0 To 2000
		status_text$ = status_text$ + Chr(PeekByte(bank,loop))
	Next
	FreeBank bank
	Return status_text$
End Function


does this function correct?

kev


Ekix(Posted 2008) [#21]
Yep, works :=)

Thanks Kev


Ekix(Posted 2008) [#22]
By the way, in case you have time, could you create a simple example like just only menus:

File Help
Exit About

Exit ends the program and About opens a small popup window which could be used for copyright etc.... purposes.

There could be a small 3d cube rotating, so it would be easier to see where to put your own staff... or something like this.

Thanks for your help anyway :=)


Guy Fawkes(Posted 2008) [#23]
Can you add tabs, spinners, a position window function, and / or tree views?


Guy Fawkes(Posted 2008) [#24]
Sorry. misread. Didnt see the function "CreateTabbers" :P


Kryzon(Posted 2008) [#25]
Is there a GUI Editor for WinBlitz3D so you can visually create the windows? kinda like the one you see on BlitzUI (being the BlitzUI Editor).

Shouldn't be hard to make one... :rolleyes:


John Blackledge(Posted 2008) [#26]
Kryzon, search this forum.
I think someone _did_ make one, but I don't think it was completely finished.


Danny(Posted 2008) [#27]
Yeah I made one called "Schnok!" - It's not the best or the most rubust, but saves you tons of manual work at least..
I don't know if Kev still has it online somewhere - if not, I'll post it tomorrow (I'm at work at the moment)..

Danny