WinBlitz3D full GUI intergration to blitz3d

Blitz3D Forums/Blitz3D Programming/WinBlitz3D full GUI intergration to blitz3d

Kev(Posted 2005) [#1]
Hello All

WinBlitz3D has undergone a total rewrite and now offers full GUI intergration to blitz3d, standard winapi gui support to that of a level close to blitzplus as been added.

for a demo of mixed gui and standard gui intergration can be downloaded from the link below.
Download WinBlitz3D Demo

your feedback is welcome.

thanks
kev


Jeroen(Posted 2005) [#2]
well I only can say it looks awesome! great work!

My mouse cursor (slower system) is now stuttering, that is something I noticed.


Chevron(Posted 2005) [#3]
looking good, how long till this is released?


Kev(Posted 2005) [#4]
@Jeroen, thanks for the comments. what system spec's are you testing on?

@Chevron, soon. ive still to finish the docs. if the public demo reports no problems then the final version will be ready once there done.

thanks
kev


Jeroen(Posted 2005) [#5]
its nice that you have also added column lists, which Blitzmax even doesnt have ;-)

I am testing this on a different computer than my own, which is a Celeron 1.7 ghz, 768 mb memory, Windows XP and a Geforce 2 MX. (Yuck!)


DH(Posted 2005) [#6]
Get an unhandled exception when I exit the demo (mixed). One of those send, dont send errors.


Kev(Posted 2005) [#7]
@Jeroen, events are queued so it would be possable to disable the mouse move events. these are generated when the mouse is moved over any gadget. this will not affect blitz3d own mouse movement. or maybe a flushevents() would keep the queue from building up.

@Dark Half, does that happen each time you quit?

some more information

when gadgtes are created you pass a null for there default style. but if req you can pass standard api const's and build the gadget any way you require. also its possable to create all windows and gadgets hidden before showing them.


kev


TheMan(Posted 2005) [#8]
And thats what I'm really waiting for ... nice demos ..


Kev(Posted 2005) [#9]
thanks HyderMan.

having doing some debugging ive looked over the crash Dark Half reported. and ive now fixed this. it was a problem when a popup window was opend ie. 'splash window' not beein destroyed when the demo's ended.

ive uploaded a fixed version.

kev


Boiled Sweets(Posted 2005) [#10]
This is pretty cool. How much will it cost?


Kev(Posted 2005) [#11]
thanks Boiled Sweets, ive no price just yet.

heres the start of a form editor being wrote by one of winblitz3d's beta testers 'Danny van der Ark'

Download SCHNOK!

press F1 for help

thanks
kev


EPS(Posted 2005) [#12]
That's pretty cool. It's working fine and i wait for release. The other site: i can kill my own gui project :(

...but hey...now i have more time for other projects.


Kev(Posted 2005) [#13]
thanks for the feedback East-Power-Soft, nice gui you have there.

kev


fredborg(Posted 2005) [#14]
It seems keyboard input isn't working here, apart from that it looks great!


AdrianT(Posted 2005) [#15]
Very nice, a real Load and Save dialogue window :) That could be very handy in one of my projects.


Damien Sturdy(Posted 2005) [#16]
Yeah, We've been waiting for this for a long while.

I'm going to assume it doesnt work fullscreen though, am i right? I hope it does work, thatd be great :D


Kev(Posted 2005) [#17]
@fredborg, blitz3d's own keyboard/mouse commands working fine. gadget mouse working, there keyboard events allmost done.

@Cygnus, sorry no full screen.

thanks
kev


ryan scott(Posted 2005) [#18]
looks nice

by the way, the Enter key doesn't seem to do anything in any boxes. I mean, it should trigger the OK button's shouldn't it? Can that be defined in the code?

Also question - can you change the colors it uses? If you don't want it to look just like the Windows desktop, I mean.


ryan scott(Posted 2005) [#19]
also, haven't tried it but just noticing from other guis... file selectors rarely remember the previously selected folder. they tend to open at the root, or the current folder. root is useless and annoying. current folder, less than useful too. even in major applications they sometimes open in their root, which is not where i would store files. i move to another folder, open my file, then go to save it, it sticks me back in the root. it's a waste of user time. even max 8 does annoying crap like that. you'd think they'd have figured it out by now.

when will we be able to use this? (some docs, gui editor being usable, able to incorporate it into our proggies)

it looks like a winner so far.


Kev(Posted 2005) [#20]
hi ryan


by the way, the Enter key doesn't seem to do anything in any boxes. I mean, it should trigger the OK button's shouldn't it? Can that be defined in the code?



the keyboard hook is still being coded in, WaitEvent() returns $101 for the keypress. EventData() still needs more work for the keycode that was pressed.


Also question - can you change the colors it uses? If you don't want it to look just like the Windows desktop, I mean.



yes its possable to change some but not all gadgets colors.

more info.

ive just finished adding system tray icon support, with context menu support. with a little extra coding this now enables gadgets to have there own context menus also. drag and drop coming also.

ummm i must stop coding and start finishing the docs. for the final version. docs are one of my most hated part of coding this gui lib.

thanks
kev


Rook Zimbabwe(Posted 2005) [#21]
On my Athlon 64 3000+ system it is smooth as a glass baby's rear end... on my wifes DURON (duran duran) system it does stutter some but she only has 256mb mem and an ATI RAD 7000


TeraBit(Posted 2006) [#22]
Demos look good. This would be great stuff to add to Decorator!


Kev(Posted 2006) [#23]
hi all

just a update the above examples now have been updated. newly added is system tray icon support. any gadget context menus and multi-file drag and drop.(added to the runtimewindow) although any window or gadget can use drag and drop.

ive also added a flushevents() to the mousemove events, for the people what has stutter movments. can you retest and see if its now not stuttering.

thanks
kev


TeraBit(Posted 2006) [#24]
Going good.

(on the WinBlitz3DGUIDemo.exe)
The listbox doesn't seem to select items and the Radio buttons will not select.

Intersted to see how it pans out. :)


Kev(Posted 2006) [#25]
thanks lee


The listbox doesn't seem to select items


they should on a double click? does even double click not generate a messagebox.


the Radio buttons will not select.


theres some problems with auto radio updating, they can be used but you have to update there status yourself using SetButtonState()

thanks
kev


TeraBit(Posted 2006) [#26]
Hi Kev,

they should on a double click? does even double click not generate a messagebox.


Double clicking does select one, the first time.

Single clicking makes it act like a text box with a cursor line. After that, the list will not scroll or accept any other input. Either way, no messagebox is shown.

theres some problems with auto radio updating, they can be used but you have to update there status yourself using SetButtonState()


Fair enough :)


Kev(Posted 2006) [#27]
thanks lee

is there any order in the way to generate this problem, ie clicking gadgets in any order? and it does not happen when testing Winblitz3DMixedGUIDemo.exe?

as it does not happen here. other than that i might have to revert back to no icons in the listbox gadgets.

kev


TeraBit(Posted 2006) [#28]
Just launch the demo (WinBlitz3DGUIDemo.exe)

Go to the left hand window (the black one)

Then (single) click an item in the list box in the left hand window (The cursor line appears).

Use the up/down arrow keys on the keyboard to try to move down the list.

This appears to trigger the list be become unresponsive.

[edit]

It looks like any keyboard input to any of the listboxes disables them.


Kev(Posted 2006) [#29]
thank lee

i still cant recreate it? anyone else able to? the only diffance im using winxp sp1. i will update to sp2 and see if the problem happens.


thanks
kev


TeraBit(Posted 2006) [#30]
Not sure if it helps, but once this happens, the repaint events are disabled as well, so when another window occludes the list box, it will go white and no longer repaint or respond to events.

Sounds like the event queue for the gadget is getting clogged somehow.


Kev(Posted 2006) [#31]
hi lee

ok im not sure but did you try the last version? before the update. if so did it function correct? its possable that flushing the mousemove events might have messed the listbox events.

ive put a example below without flushing the mouse events, can you try this please. just copy to the same folder as the download you was testing.

Download Test

thanks
kev


TeraBit(Posted 2006) [#32]
Hi Kev,

Same problem. No difference between the versions. The one I was testing was the most recent one with the tray.


Kev(Posted 2006) [#33]
ok thanks lee, check your email.

kev


KimoTech(Posted 2006) [#34]
I've found the bug in the old WinBlitz3D where it doesnt response when i close the window. It works now!!!
It seems that the bug was in WaitEvent(), because i played a little around with it and now it works. Code here, and i've added a useful command PeekEvent():

Function WaitEvent(events=1)
	

	apiSetWindowLong runtimewindow,GWL_WNDPROC,GRAB_BankAddr(WinProcBank)	
	ret_event=0
	.again
	PokeInt WinProcReturn,$04,0
	apiGetMessage(WinProcReturn,0,0,0)
	apiTranslateMessage(WinProcReturn) 
	apiDispatchMessage(WinProcReturn) 
			
	eventsource_RAW = 0
	eventdata_RAW = 0
	eventX_RAW = 0
	eventY_RAW = 0

	this_event = PeekInt(WinProcReturn,$04)
	
	
	Select this_event

		Case WM_RBUTTONUP
			ret_event = $202
			;
			If apiIsWindow(PeekInt(WinProcReturn,0)) <> 0 Then
			
				Gadget_BankDATA = apiGetWindowLong(PeekInt(WinProcReturn,0),GWL_USERDATA)
				If Gadget_BankDATA > 0 Then 
					If PeekInt(Gadget_BankDATA,$00) = PeekInt(WinProcReturn,0)
						;PopUpGadgetMenu(PeekInt(Gadget_BankDATA,$00))
					EndIf
				EndIf
				
			EndIf
			
		Case WM_KILLFOCUS

			apiGetMessage(WinProcReturn,0,0,0)
			apiTranslateMessage(WinProcReturn) 
			apiDispatchMessage(WinProcReturn) 
		
			ret_event = $401
			eventsource_RAW = apiGetFocus()
						
		Case WM_HSCROLL
			ret_event = $401
			eventsource_RAW = PeekInt(WinProcReturn,$0C)
			eventdata_RAW = LOWORD(PeekInt(WinProcReturn,$08))
			
			;WM_HSCROLL_pos = 1 + apiGetScrollPos(eventsource_RAW,SB_CTL) 
			;eventdata_RAW = apiSetScrollPos(eventsource_RAW,SB_CTL,WM_HSCROLL_pos,True)
			
							
		Case WM_VSCROLL
			ret_event = $401
			eventsource_RAW = PeekInt(WinProcReturn,$0C)
			eventdata_RAW = LOWORD(PeekInt(WinProcReturn,$08))

			;WM_VSCROLL_pos = 1 + apiGetScrollPos(eventsource_RAW,SB_CTL) 
			;eventdata_RAW = apiSetScrollPos(eventsource_RAW,SB_CTL,WM_VSCROLL_pos,True)
	
			
		Case WM_ACTIVATE
		
			If LOWORD(PeekInt(WinProcReturn,$08)) = WA_CLICKACTIVE Then
				ret_event = $804
				eventsource_RAW = PeekInt(WinProcReturn,$00)
			EndIf
			
		Case WM_ACTIVATEAPP
			eventName$ = "WM_ACTIVATEAPP"
						
		Case WM_NOTIFY
			
			
			
			If a = 1 Then
			;	PokeByte b,0,$CC
			EndIf
			a = a + 1	
			
			nmhdr_addr = PeekInt(WinProcReturn,$0C)
			apiCallWindowProcF b,0,0,GRAB_BankAddr(NMHDR),nmhdr_addr
			;Notify PeekInt(NMHDR,$04)		
				
			Select PeekInt(NMHDR,$08)
			
				Case NM_CLICK,TCN_SELCHANGE ; tabber
					ret_event = $401
					eventsource_RAW = PeekInt(NMHDR,$00)
					eventdata_RAW = apiSendMessage(eventsource_RAW,TCM_GETCURSEL,0,0)
																					
			Default
			;	ret_event = $401
			;	eventsource_RAW = PeekInt(NMHDR,$00)
			End Select
											
			;Notify "here "+PeekInt(NMHDR,$00)+" "+toolbar
			
																
		Case WM_COMMAND
								
			; check menu selected or gadget event
			eventsource_RAW = PeekInt(WinProcReturn,$0C)
			If eventsource_RAW = 0 Then
				If HIWORD(PeekInt(WinProcReturn,$08)) = 0 Then
					eventdata_RAW = LOWORD(PeekInt(WinProcReturn,$08))
					If eventdata_RAW > 0 Then
						ret_event = $1001
					EndIf	
				EndIf
			Else
				ret_event = $401
			EndIf	
			
			;Notify HIWORD(PeekInt(WinProcReturn,$08))
			
		Case WM_SIZE
			ret_event = $802
			eventsource_RAW = PeekInt(WinProcReturn,$00)
			EventX_RAW = LOWORD(PeekInt(WinProcReturn,$0C))
			EventY_RAW = HIWORD(PeekInt(WinProcReturn,$0C))
						
			; reposition status bars.
			If apiIsWindow(eventsource_RAW) <> 0 Then
				GAD_ID = apiGetWindowLong(eventsource_RAW,GWL_USERDATA)
				If GAD_ID > 0 Then
					statusbar = PeekInt(GAD_ID,4)
					If statusbar > 0 Then
						;SetGadgetShape statusbar,0,0,GadgetWidth(eventsource_RAW),GadgetHeight(statusbar)
						;apiInvalidateRect statusbar,0,True
						;apiSendMessage statusbar,WM_SIZE,0,0
					EndIf
				EndIf
			EndIf
						
		Case WM_MOVE
			
			ret_event = $801
			eventsource_RAW = PeekInt(WinProcReturn,$00)
			EventX_RAW = LOWORD(PeekInt(WinProcReturn,$0C))
			EventY_RAW = HIWORD(PeekInt(WinProcReturn,$0C))
		
		Case WM_CLOSE
		DebugLog "WM_CLOSE"
				
		Case WM_DESTROY
		DebugLog "WM_DESTROY"
			ret_event = $803
			eventsource_RAW = PeekInt(WinProcReturn,$00)
											
	End Select

	; cleanup events
	PokeInt(WinProcReturn,$00,0)
	PokeInt(WinProcReturn,$04,0)
	PokeInt(WinProcReturn,$08,0)
	PokeInt(WinProcReturn,$0C,0)
	If ret_event=0 Then Goto again
	
	apiSetWindowLong runtimewindow,GWL_WNDPROC,WinProcBlitz3D
	
	Return ret_event
	
End Function

Function PeekEvent(events=1)
	

	apiSetWindowLong runtimewindow,GWL_WNDPROC,GRAB_BankAddr(WinProcBank)	
	
	ret_event=0
		
	apiPeekMessage(WinProcReturn,0,0,0,0)
	apiTranslateMessage(WinProcReturn) 
	apiDispatchMessage(WinProcReturn) 
			
	eventsource_RAW = 0
	eventdata_RAW = 0
	eventX_RAW = 0
	eventY_RAW = 0

	this_event = PeekInt(WinProcReturn,$04)
	
	
	Select this_event

		Case WM_RBUTTONUP
			ret_event = $202
			;
			If apiIsWindow(PeekInt(WinProcReturn,0)) <> 0 Then
			
				Gadget_BankDATA = apiGetWindowLong(PeekInt(WinProcReturn,0),GWL_USERDATA)
				If Gadget_BankDATA > 0 Then 
					If PeekInt(Gadget_BankDATA,$00) = PeekInt(WinProcReturn,0)
						;PopUpGadgetMenu(PeekInt(Gadget_BankDATA,$00))
					EndIf
				EndIf
				
			EndIf
			
		Case WM_KILLFOCUS

			apiGetMessage(WinProcReturn,0,0,0)
			apiTranslateMessage(WinProcReturn) 
			apiDispatchMessage(WinProcReturn) 
		
			ret_event = $401
			eventsource_RAW = apiGetFocus()
						
		Case WM_HSCROLL
			ret_event = $401
			eventsource_RAW = PeekInt(WinProcReturn,$0C)
			eventdata_RAW = LOWORD(PeekInt(WinProcReturn,$08))
			
			;WM_HSCROLL_pos = 1 + apiGetScrollPos(eventsource_RAW,SB_CTL) 
			;eventdata_RAW = apiSetScrollPos(eventsource_RAW,SB_CTL,WM_HSCROLL_pos,True)
			
							
		Case WM_VSCROLL
			ret_event = $401
			eventsource_RAW = PeekInt(WinProcReturn,$0C)
			eventdata_RAW = LOWORD(PeekInt(WinProcReturn,$08))

			;WM_VSCROLL_pos = 1 + apiGetScrollPos(eventsource_RAW,SB_CTL) 
			;eventdata_RAW = apiSetScrollPos(eventsource_RAW,SB_CTL,WM_VSCROLL_pos,True)
	
			
		Case WM_ACTIVATE
		
			If LOWORD(PeekInt(WinProcReturn,$08)) = WA_CLICKACTIVE Then
				ret_event = $804
				eventsource_RAW = PeekInt(WinProcReturn,$00)
			EndIf
			
		Case WM_ACTIVATEAPP
			eventName$ = "WM_ACTIVATEAPP"
						
		Case WM_NOTIFY
			
			
			
			If a = 1 Then
			;	PokeByte b,0,$CC
			EndIf
			a = a + 1	
			
			nmhdr_addr = PeekInt(WinProcReturn,$0C)
			apiCallWindowProcF b,0,0,GRAB_BankAddr(NMHDR),nmhdr_addr
			;Notify PeekInt(NMHDR,$04)		
				
			Select PeekInt(NMHDR,$08)
			
				Case NM_CLICK,TCN_SELCHANGE ; tabber
					ret_event = $401
					eventsource_RAW = PeekInt(NMHDR,$00)
					eventdata_RAW = apiSendMessage(eventsource_RAW,TCM_GETCURSEL,0,0)
																					
			Default
			;	ret_event = $401
			;	eventsource_RAW = PeekInt(NMHDR,$00)
			End Select
											
			;Notify "here "+PeekInt(NMHDR,$00)+" "+toolbar
			
																
		Case WM_COMMAND
								
			; check menu selected or gadget event
			eventsource_RAW = PeekInt(WinProcReturn,$0C)
			If eventsource_RAW = 0 Then
				If HIWORD(PeekInt(WinProcReturn,$08)) = 0 Then
					eventdata_RAW = LOWORD(PeekInt(WinProcReturn,$08))
					If eventdata_RAW > 0 Then
						ret_event = $1001
					EndIf	
				EndIf
			Else
				ret_event = $401
			EndIf	
			
			;Notify HIWORD(PeekInt(WinProcReturn,$08))
			
		Case WM_SIZE
			ret_event = $802
			eventsource_RAW = PeekInt(WinProcReturn,$00)
			EventX_RAW = LOWORD(PeekInt(WinProcReturn,$0C))
			EventY_RAW = HIWORD(PeekInt(WinProcReturn,$0C))
						
			; reposition status bars.
			If apiIsWindow(eventsource_RAW) <> 0 Then
				GAD_ID = apiGetWindowLong(eventsource_RAW,GWL_USERDATA)
				If GAD_ID > 0 Then
					statusbar = PeekInt(GAD_ID,4)
					If statusbar > 0 Then
						;SetGadgetShape statusbar,0,0,GadgetWidth(eventsource_RAW),GadgetHeight(statusbar)
						;apiInvalidateRect statusbar,0,True
						;apiSendMessage statusbar,WM_SIZE,0,0
					EndIf
				EndIf
			EndIf
						
		Case WM_MOVE
			
			ret_event = $801
			eventsource_RAW = PeekInt(WinProcReturn,$00)
			EventX_RAW = LOWORD(PeekInt(WinProcReturn,$0C))
			EventY_RAW = HIWORD(PeekInt(WinProcReturn,$0C))
		
		Case WM_CLOSE
		DebugLog "WM_CLOSE"
				
		Case WM_DESTROY
		DebugLog "WM_DESTROY"
			ret_event = $803
			eventsource_RAW = PeekInt(WinProcReturn,$00)
											
	End Select

	; cleanup events
	PokeInt(WinProcReturn,$00,0)
	PokeInt(WinProcReturn,$04,0)
	PokeInt(WinProcReturn,$08,0)
	PokeInt(WinProcReturn,$0C,0)
	;If ret_event=0 Then Goto again  -- THIS IS PEEKEVENT SO JUST CONTINUE WITHOUT ANY EVENT!
	
	apiSetWindowLong runtimewindow,GWL_WNDPROC,WinProcBlitz3D
	
	Return ret_event
	
End Function




KimoTech(Posted 2006) [#35]
But are there anyone who knows how i can make the windows dont disapear when i press their close buttons, so i can ex. make a "Save before quit?" box?


RGR(Posted 2006) [#36]
Not always, but sometimes the Blitz-Helpfiles help:
2D Category --> System --> AppTitle

Or for a more advanced way look under "User Input" for "Blitz Close" in the Code Archives
http://www.blitzbasic.com/codearcs/codearcs.php?code=832


Boiled Sweets(Posted 2006) [#37]
price?


KimoTech(Posted 2006) [#38]
i mean the windows i create with WinBlitz3D. Not the runtime window. The windows i create myself. Like in B+. Then when you press close, they dont disappear. I want the WinBlitz3D-windows to do the same.


Kev(Posted 2006) [#39]
@Qimmer,

see http://www.winblitz3d.co.uk/forum/ might be an idea to post your working version. when WM_CLOSE is processed in the windows api winproc it auto calls defwindowproc(). to enable winblitz3d's include version to disable this would need to re-write the custom asm bytecode.

the .dll version that will be available soon does this along with losts more, to much to be listed here.


@Boiled Sweets
15 UK Pounds this includes full access to bug-fixes, updates. winblitz3d's .dll is currently very stable :) the user has full access to winapi gadgets on the runtimewindow or there own window. full control over all windows\gadgets winapi styles using standard constants.

when will it be available to buy? well im still waiting on the docs to be returned from one of winblitz3d's beta testers 'Mr P' and ive still to finish more example. although they are coming along.

kev