Small WinBlitz3D Test

Blitz3D Forums/Blitz3D Programming/Small WinBlitz3D Test

Kev(Posted 2005) [#1]
Hi

Ive Uploaded a little test to see how it functions on other peoples pc. this example is in .dll form for now, it enables gadgets directly onto blitz3d's runtime window. theres not much functionality.

Please read the readme in the .zip

download here.
http://myweb.tiscali.co.uk/blitzbasic/WinBlitz3DTest.zip


Grisu(Posted 2005) [#2]
Works fine for me.


John Blackledge(Posted 2005) [#3]
No problem here.


Yeshu777(Posted 2005) [#4]
All good here too...


LineOf7s(Posted 2005) [#5]
Thumbs up here. And your test is directly responsible.


Alienforce(Posted 2005) [#6]
Works here.

/Alienforce


Difference(Posted 2005) [#7]
Nice, but since some of us did this 2 years ago, show us some controls that are the diffucult ones: Keystrokes to Text boxes and menus.

There's a problem getting that stable. Problem was originally solve by somebody, by installing a keyboard hook, and running translate message and such from there.

Before that we had:
http://home.tiscali.dk/scheutz/blitz/bbwincon/bbwincon.zip

which was ok but not good enough really.

This might be fun too: http://home.tiscali.dk/scheutz/blitz/kidnap/kidnap.zip


Kev(Posted 2005) [#8]
thanks guys,

Peter the examples are like that of early WinBlitz3D before i stopped using .dll and coded it fully in blitz3d. using the asm custom winproc. the example will if everything works will also be ported using the same method.

i will look into the menus's and edit boxes, well ive allready been looking into edit boxes keydown messages. and like you say this is going to be a problem. but maybe using SetWindowsHook on the WH_KEYBOARD message might be possable.

in the above example's is the runtime window made a child to a main window?

kev


Difference(Posted 2005) [#9]
below is PoweBasic code, for a dll, That I *think* made Blitz proces the keystrokes, so that they came throug, and it was possible to catch them in a subclass procedure.




Clarks(Posted 2005) [#10]
damn kev, you the man, it works great


Kev(Posted 2005) [#11]
using winblitz3d's includes menus ive put a little demo showing menus/buttons in the runtime window.



Include "WinBlitz3D_Include.bb"

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

camera = CreateCamera()
light = CreateLight()

cube = CreateCube()
PositionEntity cube,0,0,5

;
blitz_runtime_window = WinBlitzGUI(SystemProperty("AppHWND"))

; create window menus
window_menu = WindowMenu(blitz_runtime_window)
menu_file = CreateMenu("File",0,window_menu)
	CreateMenu("Open",1,menu_file) : AddMenuIcon(window_menu,1,"menuBMPS/menuload.bmp",16,16)
	CreateMenu("Save",2,menu_file) : AddMenuIcon(window_menu,2,"menuBMPS/menusave.bmp",16,16)
	CreateMenu("",0,menu_file)
	
	submenu_file = CreateMenu("Recent Files ",0,menu_file) 
		CreateMenu("D:\WinBlitz3D\Example_1.bb",3,submenu_file) : AddMenuIcon(window_menu,3,"menuBMPS/menurecent.bmp",16,16)
		CreateMenu("D:\WinBlitz3D\Example_2.bb",4,submenu_file) : AddMenuIcon(window_menu,4,"menuBMPS/menurecent.bmp",16,16)
		
	CreateMenu("",0,menu_file)
	CreateMenu("Quit",5,menu_file) : AddMenuIcon(window_menu,5,"menuBMPS/menuquit.bmp",16,16)

menu_edit = CreateMenu("Edit",0,window_menu)
	CreateMenu("Cut",6,menu_edit)  : AddMenuIcon(window_menu,6,"menuBMPS/menucut.bmp",16,16)
	CreateMenu("Copy",7,menu_edit) : AddMenuIcon(window_menu,7,"menuBMPS/menucopy.bmp",16,16)
	CreateMenu("Paste",8,menu_edit) : AddMenuIcon(window_menu,8,"menuBMPS/menupaste.bmp",16,16)

menu_disable = CreateMenu("Disable Items",0,window_menu)
	CreateMenu("ITEM",9,menu_disable)
	CreateMenu("Disable Item",10,menu_disable) : AddMenuIcon(window_menu,10,"menuBMPS/menudisable.bmp",16,16)
	CreateMenu("Enable Item",11,menu_disable) : AddMenuIcon(window_menu,11,"menuBMPS/menuenable.bmp",16,16)
	DisableMenuItem(window_menu,9)

menu_check = CreateMenu("Check Items",0,window_menu)
	CreateMenu("ITEM",12,menu_check):CheckMenuItem(window_menu,12)
	CreateMenu("Check Item",13,menu_check) : AddMenuIcon(window_menu,13,"menuBMPS/menudisable.bmp",16,16)
	CreateMenu("Uncheck Item",14,menu_check) : AddMenuIcon(window_menu,14,"menuBMPS/menuenable.bmp",16,16)
			
UpdateWindowMenu(blitz_runtime_window,window_menu)

button = CreateButton("move cube",100,100,100,20,blitz_runtime_window,0)
button_quit = CreateButton("quit",100,140,100,20,blitz_runtime_window,0)


While Not KeyDown(1)

	TurnEntity cube,1,1,1
	
	UpdateWorld
	RenderWorld
	
	msg = WaitGUIEvents()
	
	If msg <> 0 Then DebugLog "Event "+Hex(msg)

	Select msg
		
		Case WM_KEYDOWN
			Text 100,50,"WM_KEYDOWN"
			
		Case WM_MOVE
			Text 100,50,"WM_MOVE"
			
		Case WM_COMMAND
		
			If lParamGUIEvents() = 0 Then ; menu selected
				menuid = LOWORD(wParamGUIEvents())
				
				Select menuid 
					
					Case 5
						EndGUI 
						End

				End Select
			EndIf
			
			Select HIWORD(wParamGUIEvents()) ; wNotifyCode
	
				Case BN_CLICKED
					gadget_selected = lParamGUIEvents()
					Select gadget_selected
						Case button
							TranslateEntity cube,0,0,1

						Case button_quit
							EndGUI 
							End
					End Select
			Default
			
					
			End Select
	Default
		Text 100,10,"NO EVENTS"
	End Select
	
	Text 200,10,"Menu Selected "+menuid
	
	FlushGUIEvents
	
	Flip
	
Wend

FreeGadget button
EndGraphics
EndGUI 
Print "bye, press any mouse button"
MouseWait
End


this functions ok here on my pc, anyone wont to give it a try.

kev


John Blackledge(Posted 2005) [#12]
"WinBlitzGUI nor found" - and that's after downloading the latest via your link above. ???


Kev(Posted 2005) [#13]
WinBlitz3D_Include.bb needs to be in the same folder as the example. you need the WinBlitz3DTest.zip and WinBlitz3D.zip available in my sig


John Blackledge(Posted 2005) [#14]
"available in my sig"?

When I click on your name all I see is an email address.


Kev(Posted 2005) [#15]
john, winblitz3d.zip the include files can be downloaded here http://myweb.tiscali.co.uk/blitzbasic/WinBlitz3D.zip

and you would need the .dll test available here.
http://myweb.tiscali.co.uk/blitzbasic/WinBlitz3DTest.zip

hope this helps.