Losing Buttons

BlitzPlus Forums/BlitzPlus Beginners Area/Losing Buttons

PaulJG(Posted 2005) [#1]
Hi, I'm playing around with the Blitzplus demo to see if it will do the job I need it for.. so I'm alittle in the dark with the docs.

Anyway, I wrote this lil proggie - but for some reason the buttons dont work ? (apart from the first one).. and I keep losing them on the screen (refresh ?)
Global wwidth=400
Global hheight=400

winhandle=CreateWindow( "Report Form",(ClientWidth(Desktop())/2)-(wwidth/2),(ClientHeight(Desktop())/2)-(hheight/2),wwidth,hheight )

studentname=CreateComboBox( 10,10,128,24,winhandle )
classname=CreateComboBox( 10,60,100,24,winhandle)

For k=0 To 9
AddGadgetItem studentname,"Pupil "+k
Next

OptionButton1=CreateButton("C",100,100,300,40,WinHandle,2)
OptionButton2=CreateButton("O",130,100,300,40,winhandle,2)
OptionButton3=CreateButton("K",160,100,300,40,WinHandle,2)
OptionButton4=CreateButton("V",190,100,300,40,WinHandle,2)
OptionButton5=CreateButton("W",220,100,300,40,WinHandle,2)
OptionButton6=CreateButton("H",250,100,300,40,WinHandle,2)
OptionButton7=CreateButton("P",280,100,300,40,WinHandle,2)


While WaitEvent()<>$803
	If EventID()=$401
		If EventSource()=studentname
					Notify "Item selected:"+SelectedGadgetItem(studentname)
		EndIf
	EndIf
Wend

End


Most of the code was taken from the demos, so I'm not sure what does what.. alittle help please kind Sirs !.

As a quick afterthought.. how do you put text in the window ? (so I can label things). I'd like some descriptive text above my drop down box.


PaulJG(Posted 2005) [#2]
Never mind - thanks.. I've sorted it myself.

(apart from the text in the window problem)


CoderX(Posted 2005) [#3]
You probably figured it out, but you can use the Text Area Gadget to add text.


PaulJG(Posted 2005) [#4]
Cheers - yeap sorted.

One thing still puzzles me though..

If your using a textarea to input text, and have something you want to paste into it - how would you go about it ?

I cant see a command that will get at the text in the textbox ??. (something that lets you get at the buffer space thats used in a textbox)


WolRon(Posted 2005) [#5]
I'm not sure which command you are asking for but I bet it's either

TextAreaText
or
SetGadgetText


Rook Zimbabwe(Posted 2005) [#6]
OK so you sorted it out... what did you find out? Un sort it for the rest of us...


PaulJG(Posted 2005) [#7]
Sure.. just not too clear on which bit you want me to explain, so I'll go through the changes I made:

The source (with the button problem) doesnt work because of the width parimeter.

OptionButton1=CreateButton("C",100,100,300,40,WinHandle,2)

I've got it set to "300", you only set this to the length of the button text - in this case "C".. 30 pixels across is more than enough !.

So the program was actually working, but because I had defined the width so wide they where overlapping on each other.

It was the Label command I wanted for the text.

WolRon was right about the textareatext command.

One thing I have found out that is puzzling me though - I've been using bits from the Blitzpad proggie to give me Cut and Paste ability. But.. if you use a textarea gadget cut and paste works without the extra code anyway !.

And a quick tip:

Setup some sort of "windows control array", makes things so much more easier when you've got alot of windows onscreen at the same time. (I use a TYPE and multiple arrays)


Snarty(Posted 2005) [#8]
Hi,

One thing I have found out that is puzzling me though - I've been using bits from the Blitzpad proggie to give me Cut and Paste ability. But.. if you use a textarea gadget cut and paste works without the extra code anyway!.

The additional Cut'n'Paste coding in BlitzPad is to allow you to replicate the functionality of the TextArea gadget. So, this allows you to cut'n'paste as and when needed (such as via the menu in the case of BlitzPad).