Page 1 of 1

Question on Listbox

PostPosted: Mon Mar 28, 2016 2:05 pm
by dpayer
Is it possible to get and or set the contents of #1, #2, #2, #3, #4 programmatically if you know the name of the Listbox Object?

Image

Re: Question on Listbox

PostPosted: Tue Mar 29, 2016 4:00 pm
by virger
Sólo 2 de 4 (50%). Otros 2, yo creo no sea posible.
Only 2 of 4 (50%). Others 2, I think is not possible.
Code: Select all
{NeoBook 5 Objects}
NeoBookVer=5.80
ObjectType=10
Name=Lsb1
X=325
Y=108
W=93
H=73
Anchor=0
Text=[[lis]]
VarName=[[vb]]
VarType=0
XPTheme=Yes
LineColor=0
LineWidth=1
LineStyle=0
FillColor=15790328
FillPattern=0
Font=Arial
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=5
ObjectType=3
Name=PushButton1
X=277
Y=75
W=90
H=27
Anchor=0
Text=Dt:[dt]
Align=1
ImageStyle=0
XPTheme=Yes
ObjAction=setvar "[vb]" "dt"¶¶setvar "[ls1]" "Alfa[#13][#10]Beta[#13][#10]Gama"¶setvar "[lis]" "ls1"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=7
ObjectType=3
Name=PushButton2
X=370
Y=75
W=90
H=27
Anchor=0
Text=Valor:[valor]
Align=1
ImageStyle=0
XPTheme=Yes
ObjAction=setvar "[vb]" "valor"¶¶setvar "[ls2]" "123[#13][#10]789[#13][#10]543"¶setvar "[lis]" "ls2"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=6

Re: Question on Listbox

PostPosted: Wed Mar 30, 2016 6:19 am
by dpayer
Thank you. I see how you set the variable. But this is if you already know the name of the variable in that location. I am rewriting a function that I hope to use for any listbox. My hope was not to have to put in the name of the variables used for list items and for the identifying variable for the selected item. I was hoping to determine this programmatically.

I am working on a solution using the [self] variable but I am having some issues with that.

Again, thanks.

Re: Question on Listbox

PostPosted: Wed Mar 30, 2016 6:19 am
by dpayer
Thank you. I see how you set the variable. But this is if you already know the name of the variable in that location. I am rewriting a function that I hope to use for any listbox. My hope was not to have to put in the name of the variables used for list items and for the identifying variable for the selected item. I was hoping to determine this programmatically.

I am working on a solution using the [self] variable but I am having some issues with that.

Again, thanks.

Re: Question on Listbox

PostPosted: Wed Mar 30, 2016 8:14 am
by virger
No entiendo, aqui no veo diferencia alguna.
He ajustado un poco su codigo, por favor ejecutelo.

I do not understand, here I do not see any difference.
I've tweaked a bit your code, please run it.

Code: Select all
{NeoBook 5 Objects}
NeoBookVer=5.80
ObjectType=5
Name=Rectangle7
X=236
Y=12
W=272
H=454
Anchor=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=13418448
FillPattern=0
TabOrder=3
ObjectType=10
Name=ListBox3
X=241
Y=49
W=130
H=268
Anchor=0
Text=[[self]contents]
VarName=[[self]selecteditems]
VarType=0
MultiSelect=Yes
XPTheme=Yes
DblClick=Alertbox "test" "[self]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
Font=MS Sans Serif
FontSize=8
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=2
ObjectType=9
Name=TextEntry4
X=244
Y=323
W=257
H=86
Anchor=0
VarName=[TextEntry3]
Align=1
EditMultiLine=Yes
EditLen=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
Font=MS Sans Serif
FontSize=8
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=4
ObjectType=8
Name=Text5
X=246
Y=17
W=259
H=24
Anchor=0
Font=MS Sans Serif
FontSize=8
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 MS Sans Serif;}}{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs28\cf0 ListBox3\plain\f0\fs16\cf0 \tab \tab \tab \tab \tab \tab \plain\f0\fs28\cf0 \tab Virger}}}
HMargin=0
VMargin=0
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16777215
FillPattern=1
TabOrder=5
ObjectType=3
Name=PushButton38
X=279
Y=418
W=193
H=32
Anchor=0
Text=Add to listbox3 & Virger
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=ListBoxAddItem "ListBox3" "0" "[TextEntry3]"¶ListBoxAddItem "Ls2" "0" "[TextEntry3]"¶SetVar "[TextEntry3]" ""
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
Font=MS Sans Serif
FontSize=8
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=6
ObjectType=10
Name=Ls2
X=373
Y=49
W=130
H=268
Anchor=0
Text=[lista]
VarName=[data]
VarType=0
MultiSelect=Yes
XPTheme=Yes
DblClick=Alertbox "test" "[self]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
Font=MS Sans Serif
FontSize=8
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=1


Le ganamos a Jamaica.
We beat Jamaica.