derez Expert Licensed User Longtime User Nov 17, 2010 #1 I can't get a response from a spinner and I don't understand why. I have a spinner defined, initialized, allocated it content and I get the list displayed when pressing on the arrow. Code: tgtspin.Initialize(tgtspin) Activity.AddView(tgtspin,140dip,0,40dip,38dip) .... For i = 1 To route.Size tgtspin.Add("Target # " & i) Next tgtspin.Enabled = True The event sub is not entered at item click: Code: Sub tgtspin_ItemClick (Position As Int, Value As Object) tgtno = tgtspin.SelectedIndex + 1 tgtlabel.Text = tgtspin.SelectedIndex + 1 'tgtno = position + 1 'tgtlabel.Text = position + 1 End Sub (I tried two options until I found that it does not enter).:sign0085:
I can't get a response from a spinner and I don't understand why. I have a spinner defined, initialized, allocated it content and I get the list displayed when pressing on the arrow. Code: tgtspin.Initialize(tgtspin) Activity.AddView(tgtspin,140dip,0,40dip,38dip) .... For i = 1 To route.Size tgtspin.Add("Target # " & i) Next tgtspin.Enabled = True The event sub is not entered at item click: Code: Sub tgtspin_ItemClick (Position As Int, Value As Object) tgtno = tgtspin.SelectedIndex + 1 tgtlabel.Text = tgtspin.SelectedIndex + 1 'tgtno = position + 1 'tgtlabel.Text = position + 1 End Sub (I tried two options until I found that it does not enter).:sign0085:
C Cor Active Member Licensed User Longtime User Nov 17, 2010 #2 Here's my spinner example grCor Attachments spinnerExample.zip spinnerExample.zip 5.7 KB · Views: 1,250 Upvote 0
derez Expert Licensed User Longtime User Nov 18, 2010 #3 Thank you. I did everything right except this - tgtspin.Initialize(tgtspin), it should be tgtspin.Initialize("tgtspin") Upvote 0
Thank you. I did everything right except this - tgtspin.Initialize(tgtspin), it should be tgtspin.Initialize("tgtspin")
derez Expert Licensed User Longtime User Nov 18, 2010 #4 Erel some views (like the spinner) will not function fully unless they are added to the activity by code. If I design them by the visual designer and add them by code I get an error and have to delete them from the designer. this means that the designer is only good for puting the view in place. Upvote 0
Erel some views (like the spinner) will not function fully unless they are added to the activity by code. If I design them by the visual designer and add them by code I get an error and have to delete them from the designer. this means that the designer is only good for puting the view in place.
agraham Expert Licensed User Longtime User Nov 18, 2010 #5 In what way does a spinner not function? You should be able to add one in the designer and use Tools -> Generate Members to put a Dim line in Sub Globals and an event Sub if needed. The event name can be entered in the designer properties panel before generating the required members. Upvote 0
In what way does a spinner not function? You should be able to add one in the designer and use Tools -> Generate Members to put a Dim line in Sub Globals and an event Sub if needed. The event name can be entered in the designer properties panel before generating the required members.
derez Expert Licensed User Longtime User Nov 18, 2010 #6 Agraham, all this works fine but unless you addview in code for the same spinner, when you press it you'll see only one empty line, inspite loading it with a list before. See this for more problems http://www.b4x.com/forum/beta/6626-panel-spinner.html#post38685 Upvote 0
Agraham, all this works fine but unless you addview in code for the same spinner, when you press it you'll see only one empty line, inspite loading it with a list before. See this for more problems http://www.b4x.com/forum/beta/6626-panel-spinner.html#post38685
sterlingy Active Member Licensed User Longtime User May 10, 2012 #8 derez said: Erel some views (like the spinner) will not function fully unless they are added to the activity by code. If I design them by the visual designer and add them by code I get an error and have to delete them from the designer. this means that the designer is only good for puting the view in place. Click to expand... Derez, This was helpful to me. I was having problems until I added the Spinner in code instead of the Designer. Thanks!!!! :sign0098: Sterling Upvote 0
derez said: Erel some views (like the spinner) will not function fully unless they are added to the activity by code. If I design them by the visual designer and add them by code I get an error and have to delete them from the designer. this means that the designer is only good for puting the view in place. Click to expand... Derez, This was helpful to me. I was having problems until I added the Spinner in code instead of the Designer. Thanks!!!! :sign0098: Sterling
NJDude Expert Licensed User Longtime User May 10, 2012 #9 You are confusing things, one thing is to CREATE the view and another POPULATING it. Upvote 0