Gadget Properties Questions

Just starting out? Need help? Post your questions and find answers here.
User avatar
Übermann
New User
New User
Posts: 4
Joined: Mon Dec 07, 2009 11:44 am

Gadget Properties Questions

Post by Übermann »

1.- Does exists any property from a TextBox, Label and/or EditArea Gadgets to set they to Multiline Editing? This is, when the text into such gadgets reach their max width, automatically jump to the next line. Basically like in Visual Basic.

2.- How can I set the index value of a ComboBox or a Listbox? As happens in Visua Basic, i can write:

Code: Select all

MyList.ListIndex = 1
And the second element of that list will be selected/highlighted.

I took a look at the docs, but i found nothing similar. I need something like:

Code: Select all

SetGadgedPropertie(#MyListbox, Index, 1)

Thanks in advance.
Auf Deutsch, es klingt besser.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Gadget Properties Questions

Post by srod »

Use an editor gadget if you need multiline editing. SetGadgetState() is the command you are looking for in order to set a combo's selected item.
I may look like a mule, but I'm not a complete ass.
User avatar
Übermann
New User
New User
Posts: 4
Joined: Mon Dec 07, 2009 11:44 am

Re: Gadget Properties Questions

Post by Übermann »

Damn fast answer. Thanks a lot
srod wrote:Use an editor gadget if you need multiline editing.
The problem with that is that it has a 3D Border, and i need something that can look like a Label, such a Label itself or a TextBox.
Well, if no other choice is available, i will use that.
srod wrote:SetGadgetState() is the command you are looking for in order to set a combo's selected item.
I tested, and works. Thanks.
Auf Deutsch, es klingt besser.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Gadget Properties Questions

Post by srod »

On Windows only...

Code: Select all

If OpenWindow(0, 0, 0, 322, 205, "StringGadget Flags", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  StringGadget(0, 8,  10, 306, 120, "Normal StringGadget...", #ES_MULTILINE|#ESB_DISABLE_LEFT|#ESB_DISABLE_RIGHT|#ES_AUTOVSCROLL)
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
I may look like a mule, but I'm not a complete ass.
Post Reply