that makes sense now, thanks tanner!
Sure. I assume you mean the code to scan through your elements for data? Here is how I would do it:
MoveToNextValue: (A is pointer to current location in string, Str1 is the string you used with the renderer)
Code:
To read the current value pointed to by A (from the above routine)
Code:
You would then cycle through all of your elements to find the correct one using the first routine, and read the value using the second routine. For instance, if we had this GUI:
Code:
(Bad code, sorry)
MoveToNextValue: (A is pointer to current location in string, Str1 is the string you used with the renderer)
Code:
Instring(Str1,"<PlotScreenPlus>",A)+1
if Ans != 1
Ans->A
Code:
Instring(Str1,"<PlotScreenPlus>",A
If Ans != 0
Then
Sub(Str1,A,Ans-A
Else
"
End
Code:
Sum(9
Sum(7,1,"0000000000","Test GUI"
Sum(7,4,0,0,0,"Test Text
Sum(7,10,0,20,2,1,"Button 1
Sum(7,10,0,26,2,0,"Button 2
Sum(7,10,0,32,2,0,"Button 3
Sum(12,0,0,1
1->A
For(B,0,1)
Instring(Str1,"<PlotScreenPlus>",A)+1
if Ans != 1
Ans->A
End
Instring(Str1,"<PlotScreenPlus>",A
If Ans != 0
Then
Sub(Str1,A,Ans-A
Else
"
End
if expr(Ans
1->C
Instring(Str1,"<PlotScreenPlus>",A)+1
if Ans != 1
Ans->A
Instring(Str1,"<PlotScreenPlus>",A
If Ans != 0
Then
Sub(Str1,A,Ans-A
Else
"
End
if expr(Ans
2->C
Instring(Str1,"<PlotScreenPlus>",A)+1
if Ans != 1
Ans->A
Instring(Str1,"<PlotScreenPlus>",A
If Ans != 0
Then
Sub(Str1,A,Ans-A
Else
"
End
if expr(Ans
3->C
Disp "You picked button
Disp C
(Bad code, sorry)
That makes sense to me! That last paragraph of SirTanner's (_player's) post is what has the bit you're specifically asking about.
calcman wrote:
what does string for the renderer?
Wow, that made no sense whatsoever. Please try to complete full sentences with spelling and grammar; it makes life easier for everyone. calcman wrote:
is that where the button detection is registered to?
It's where a bunch of stuff gets stored. The text typed into boxes, the radio buttons selected, etc. However, the index of the item that was clicked is returned in Ans, not that string.
They are. The string isn't returned in Ans, it is returned in StrX, where X is the string you supply to Sum(12,0,0,X) For instance, 1 is Str1, 5 is Str5, 10 is Str0, and the rest are hacked strings that you can only get to with xLib (Which can be done because xLib is in DCS)
_player1537 wrote:
They are. The string isn't returned in Ans, it is returned in StrX, where X is the string you supply to Sum(12,0,0,X) For instance, 1 is Str1, 5 is Str5, 10 is Str0, and the rest are hacked strings that you can only get to with xLib (Which can be done because xLib is in DCS)
The list in Ans is {X,Y,clicked,trigger} (check out http://dcs.cemetech.net/index.php?title=BasicLibs:GUIMouse ). First two elements are {X,Y} where the click happened. Third item says if it was a left- or right-click. The fourth and final element says which item was clicked that caused the GUIMouse to end. The data in items like radio buttons, text input boxes, checkboxes, integer input boxes, etc. gets stored in the string named in the sum(12,...) arguments, though. - calcman
- Advanced Member (Posts: 283)
- 08 Apr 2011 10:19:31 pm
- Last edited by calcman on 08 Apr 2011 10:20:58 pm; edited 1 time in total
so...
sum(7,10,x,y,a,b,str2
sum(12,a,b,str1
then the str1 contains the registered button push?
sum(7,10,x,y,a,b,str2
sum(12,a,b,str1
then the str1 contains the registered button push?
- _player1537
- Guru-in-Training (Posts: 2983)
- 08 Apr 2011 10:20:50 pm
- Last edited by _player1537 on 08 Apr 2011 10:22:11 pm; edited 1 time in total
Nope, it has to be a number. And the Sum(7 statement is also incorrect.
That would really be: Sum(7,10,x,y,a,b,"Hello" // Could be a string variable, but I am not using that because it might be confusing.
Sum(12,c,d,1
After that, yes, Str1 has the right button values.
That would really be: Sum(7,10,x,y,a,b,"Hello" // Could be a string variable, but I am not using that because it might be confusing.
Sum(12,c,d,1
After that, yes, Str1 has the right button values.
- KermMartian
- Site Admin (Posts: 64257)
- 08 Apr 2011 10:21:56 pm
- Last edited by KermMartian on 08 Apr 2011 10:22:44 pm; edited 1 time in total
More like:
Code:
Ans(4) would have the index of the item clicked. Str1 would contain the value of each of the radio buttons, I think as 1+0+0 or thereabouts.
Code:
sum(9
sum(7,1,"0000000000","Test GUI"
sum(7,4,0,0,0,"Test Text
sum(7,10,0,20,2,1,"Button 1
sum(7,10,0,26,2,0,"Button 2
sum(7,10,0,32,2,0,"Button 3
sum(12,0,0,1->Ans
Ans(4) would have the index of the item clicked. Str1 would contain the value of each of the radio buttons, I think as 1+0+0 or thereabouts.
- calcman
- Advanced Member (Posts: 283)
- 08 Apr 2011 10:22:38 pm
- Last edited by calcman on 08 Apr 2011 10:24:02 pm; edited 1 time in total
so you omit str and have numeric value for number strN
also is the string (ans) stored as a list?
also is the string (ans) stored as a list?
- _player1537
- Guru-in-Training (Posts: 2983)
- 08 Apr 2011 10:23:30 pm
- Last edited by _player1537 on 08 Apr 2011 10:26:51 pm; edited 1 time in total
Correct. Is this making sense to you?
Edit:
I am too lazy to actually make my own post so instead I quote people and then don't say anything new
Edit 2: Ans is different from the string Sum(12 stores to. Ans has to do with what caused the GUI to end, the string has to do with what data was stored in the GUI before it ended.
Edit:
KermMartian wrote:
More like:
Code:
Ans(4) would have the index of the item clicked. Str1 would contain the value of each of the radio buttons, I think as 1+0+0 or thereabouts.
Code:
sum(9
sum(7,1,"0000000000","Test GUI"
sum(7,4,0,0,0,"Test Text
sum(7,10,0,20,2,1,"Button 1
sum(7,10,0,26,2,0,"Button 2
sum(7,10,0,32,2,0,"Button 3
sum(12,0,0,1->Ans
Ans(4) would have the index of the item clicked. Str1 would contain the value of each of the radio buttons, I think as 1+0+0 or thereabouts.
I am too lazy to actually make my own post so instead I quote people and then don't say anything new
Edit 2: Ans is different from the string Sum(12 stores to. Ans has to do with what caused the GUI to end, the string has to do with what data was stored in the GUI before it ended.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
» Go to Registration page
» Goto page Previous 1, 2, 3 ... 9, 10, 11, 12 Next
» View previous topic :: View next topic
» View previous topic :: View next topic
Page 10 of 12
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Advertisement