Text images n stuff - WinBlitz3d

Blitz3D Forums/Blitz3D Programming/Text images n stuff - WinBlitz3d

Yahfree(Posted 2007) [#1]
2 questions:

1) is it possible to have images on a Wb3d window? if so how? looking at blitzmax GUI, theres these things called "Canvas'" that are used for this function(i think)

2) is it possible to change the color of the font being used? for example, for text on windows i use labels, can i change the color of them?


John Blackledge(Posted 2007) [#2]
Yes to both.
http://www.winblitz3d.co.uk/


Yahfree(Posted 2007) [#3]
How do you do it? the link you gave me is just to the site, i cant find any docs that would do this... what functions are used? and is there any docs on these?


Kev(Posted 2007) [#4]
1) see WB3D_BBImageToIcon() and WB3D_DrawIcon() this will enable you to place blitz images in wb3d windows. there is no 'canvas' support.

2) not possable, i did attempt this sometime back. thats what john might be thinking about.

kev


John Blackledge(Posted 2007) [#5]
I thought you could change the colour of labels. No?


Kev(Posted 2007) [#6]
i disabled it back in beta john, there was problems with it that i never got round to fixing.

kev


Yahfree(Posted 2007) [#7]
Also, whats a icon strip, and how would i use it to say... put icons on a treeview gadget, the 2 last arguments of the WB3d_AddTreeViewNode() function

is

icon
The index of an icon from the loaded iconstrip.

selectedicon
The index of an icon from the loaded iconstrip, which will be displayed when the node is selected.


?

Thanks for clearing that colored text thing up. and solving the image thing


Kev(Posted 2007) [#8]
Hi Yahfree

icon strips are like blitz anim image strips. icons within the iconstrip are index'd so for example. the handle returned from WB3D_LoadIconStrip() is used when calling WB3D_SetGadgetIconStrip()

WB3D_SetGadgetIconStrip() will attach an icon strip to the passed gadget. then when adding items to a treeview using WB3d_AddTreeViewNode() the icon param is the image index you want.

kev


Yahfree(Posted 2007) [#9]
Anyone know the params on WB3D_DrawIcon?

seems to be 4 but i'm not sure what they are.

my guess was:

img,x,y,child

but it gives me an Invaild gadget handle error when i try it..

sorry for the necro, i havent actually tried images in windows yet, i was asking if it was possible before, but now i'm using them


Kev(Posted 2007) [#10]
Hi Yahfree

F1 is your friend, anyways the syntax is WB3D_DrawIcon(window,x,y,icon).

kev


Yahfree(Posted 2007) [#11]
What? i didnt know you can F1 DLL functions in blitz! Cool!


Yahfree(Posted 2007) [#12]
Hey, i'm trying to update text on a label, but my atempts have failed i'v tried:

WB3d_FreeGadget(label)
;Redraw

and

WB3D_SetGadgetText(label)

both don't change the visual..

freegadget gets rid of the gadget but leaves the text.. any ideas?


Yahfree(Posted 2007) [#13]
Well i assume its not possible, any other soulutions?


Kev(Posted 2007) [#14]
wont WB3D_SetGadgetText(label,"") work? it works fine here.

kev


Yahfree(Posted 2007) [#15]
somthing like this doesnt seem to work..?




Kev(Posted 2007) [#16]
Hi Yahfree, you dont see a change in the text of the label? as its does change here. or you see the change but old text longer than the new text is still visable?

here i see the change yet theres not a redraw to remove text thats longer than the new text being added. a work around for this although not ideal would be to hide the label, and then add the text then re-show the label again.

for example the code below, i also notice your not including 'WB3DStyles.bb'. maybe this was missed while a copy and paste was done :)

	Case WB3D_EVENT_GADGET
		selected = WB3D_EventSource()
		Select selected
		
			Case maketext
				WB3D_HideGadget mytext
				WB3D_SetGadgetText(mytext,"Test1")
				WB3D_ShowGadget mytext
				
			Case maketext2
				WB3D_HideGadget mytext
				WB3D_SetGadgetText(mytext,"Test2")
				WB3D_ShowGadget mytext
		End Select



kev


Yahfree(Posted 2007) [#17]
i believe its working now, i'm going to test it in the main prog, thanks for the help!

Edit: confirmed it works, the problem was i wasnt showing/hiding

Thanks yet again kev


Yahfree(Posted 2007) [#18]
a bit off topic, but i'm looking for a function that returns the text of a said gadget item in a listbox.

like consider the contents of this listbox:

firstitem
seconditem
thirditem


is there a function that would return the handle of firstitem? so i can translate that into a string?

eg.

Not Real function:

wb3d_GetGadgetTextByIndex(mylistbox,1)

would return "firstitem"


i want to be able to use a for next loop:

For i=1 to WB3D_CountGadgetItems(mylistbox)

;NOTREALNOTREALNOTREAL:
wb3d_GetGadgetTextByIndex(mylistbox,i)

Next


does such a function exist? or is there a way to get this information so i can create my own function?


Kev(Posted 2007) [#19]
Hi Yahfree.

WB3D_GadgetItemText() returns the string contained in the gadget item index.

For i=1 to WB3D_CountGadgetItems(mylistbox)
print WB3D_GadgetItemText(mylistbox,i)
Next


kev


Yahfree(Posted 2007) [#20]
Wow thanks for the quick reply, and sorry for the late one :D

i'll try that thanks!