Some Newb B+ Questions

BlitzPlus Forums/BlitzPlus Programming/Some Newb B+ Questions

AndyBoy_UK(Posted 2004) [#1]
Hi everyone, sorry to be a pain today but Im just getting started out with Blitz+ (still teh demo for now till I can sort my email problem out - 26 runs left)

I would like to do a couple of things and I want to make sure I am going about them in teh right way.

Ok here goes.

1. I would like to make a splash screen as a seperate window that pops up while I am loading all sorts of rubbish in and then when it is all sorted I want to either hide this window (in case I need to bring it back for something) or destroy it. How could I go about this? (I tried HideGadget with the window handle but it didnt work, does Minimising just put to the taskbar)?

2. I gather I need a Canvas to put images on my windows, or is there some sort of Gadget that allows a static image?

3. I would like to create other windows in the background but not have them displayed (like tool boxes) and when a user toggles their appearance from the main window they appear. Is there a way I can do this?

4. Do all my gadgets have to be global? The CreateMenu suggests that menus do not need to be global but the gadget creation does.

I may have a couple more silly questions but I wont start a load of topics on them all, I will just post into this one.

Thanks everyone, sorry to be a pain.


CS_TBL(Posted 2004) [#2]
1 "FreeGadget MyWindow" wipes your flashscreen window

2 You could put an image on a panel, but rather stick to canvases..

3 do you mean 'create a window, but don't display it yet'? create it outside your screen, use hidegadget, use setgadgetshape to put it back where you want it, and use showgadget/hidegadget to show and hide it.

4 nope.. not perse.. some of my own functions are small apps, like this one: http://www.blitzbasic.co.nz/Community/posts.php?topic=29266

As you see, all stuff is local.


AndyBoy_UK(Posted 2004) [#3]
I will give those suggestions a try but Im pretty sure that I tried HideGadget on the window and it did nothing.

Is putting it off the screen really the only way to hide a window.

Also does FreeGadget clear anything that is created on the window (like buttons, etc)

Thanks for your help CS_TBL


CS_TBL(Posted 2004) [#4]
use the [x] button to close the window :) I was too lazy to do it better :) alt f4 directly wipes the flashlogo since I used keywait()

bla=CreateWindow("MyApp",0,0,1024,768)

flash=CreateWindow("",0,-200,512,190,0,bla)
flashCanvas=CreateCanvas(0,0,512,190,flash)
HideGadget flash
SetGadgetShape flash,64,64,GadgetWidth(flash),GadgetHeight(flash)

SetBuffer CanvasBuffer(flashCanvas)
	For t=0 To 189
		Color t,60+t,t
		Line 0,t,512,t
	Next
	Color 255,255,255:Text 256,85,"BLAHBLAHBLAH Flashwindow",True,True
	Color 0,0,0
	Rect 0,0,512,190,False
FlipCanvas flashCanvas


quit=False

Repeat

	WaitEvent()
	
	If EventID()=$803
		quit=True
	EndIf
	
	

Until quit

ShowGadget flash

KeyWait()

FreeGadget flash
FreeGadget bla

End



AndyBoy_UK(Posted 2004) [#5]
Ok I have another question for people if you wouldnt mind helping me out again :)

Thanks in advance

1. I have a canvas gadget that takes up the whole of a window (bar a menubar at the top of the window) every loop I draw a tilemap on this canvas (at the end of the loop)

system\running% = 1
While system\running% = 1
	guiEvent = WaitEvent()
		
	Select guiEvent
		Case window_close

		Case mouse_move
		
		Case key_down
		
		Case menu_event

		Default
			inputCheckKeys()		
	End Select

	mapdraw()
	FlipCanvas editorGui\editorCanvas
	Cls
Wend


However, when I click on the menubars and scroll around, or drag another window (same app) over the top, the map flickers all over the place, until i settle the window move down or click away from the menu bar. It actually disappears totally sometimes when on the menu bar. Is there a way I can keep the map on the screen regardless of dragging a window over the top or clicking onto the menu bars?

Cheers, A