Kako
Contributors  
Posts: 105
|
Post by Kako on Jul 27, 2016 6:13:13 GMT
How can we access lists when using string argument functions line addEditText(String argument, String defaultValue)? Providing the list variable as a string to the function doesn't work addEditNumber("ar[" .. i .. "]", 0). Is there another way of doing this, or is this just not implemented yet?
|
|
|
Post by AnkuLua on Jul 27, 2016 7:30:20 GMT
How can we access lists when using string argument functions line addEditText(String argument, String defaultValue)? Providing the list variable as a string to the function doesn't work addEditNumber("ar[" .. i .. "]", 0). Is there another way of doing this, or is this just not implemented yet?
If ar is a table of string, just use it addEditNumber(ar , 0)
To access the vaiable, use _G[ar]
|
|
Kako
Contributors  
Posts: 105
|
Post by Kako on Jul 27, 2016 8:32:28 GMT
How can we access lists when using string argument functions line addEditText(String argument, String defaultValue)? Providing the list variable as a string to the function doesn't work addEditNumber("ar[" .. i .. "]", 0). Is there another way of doing this, or is this just not implemented yet?
If ar is a table of string, just use it addEditNumber(ar , 0)
To access the vaiable, use _G[ar]
Could you show us an example of how to use this within a loop?
|
|
|
Post by AnkuLua on Jul 27, 2016 8:50:47 GMT
If ar is a table of string, just use it addEditNumber(ar , 0)
To access the vaiable, use _G[ar]
Could you show us an example of how to use this within a loop? There is some typo in previous reply. Here is one example ar= {"one", "two", "three"}
dialogInit() for i, l in ipairs(ar) do addTextView(ar[i]) addEditNumber(ar[i], i) end
dialogShow("AR test")
for i, l in ipairs(ar) do print (ar[i] .. "=".._G[ar[i]]) end
Is this what you want?
|
|
Kako
Contributors  
Posts: 105
|
Post by Kako on Aug 13, 2016 13:43:03 GMT
Could you show us an example of how to use this within a loop? There is some typo in previous reply. Here is one example ar= {"one", "two", "three"}
dialogInit() for i, l in ipairs(ar) do addTextView(ar[i]) addEditNumber(ar[i], i) end
dialogShow("AR test")
for i, l in ipairs(ar) do print (ar[i] .. "=".._G[ar[i]]) end
Is this what you want? Not really What you show here is something I figured out already, and although it sure is a way to use lists, it still isn't what I meant. What I'm looking for is to have addTextView set the value of the listitem itself, instead of a global value. Here's an example of what I'm thinking about: ar = {}
dialogInit() for i, l0 do addEditNumber(ar[i], i) end
dialogShow("AR test")
for i, l in ipairs(ar) do print ("=" .. ar[i]) end I hope this is better understandable
|
|
Kako
Contributors  
Posts: 105
|
Post by Kako on Aug 15, 2016 7:43:02 GMT
Would it be possible to make the input fields more generic? I would like to add & remove input fields based on radiobuttons, checkboxes and inline buttons  . All while the dialog is already displayed Will study it... But seems a lot of effort Normally you could do that by creating new dialog based on previous dialog results. Check the script of the seven knights. Here's another, easier to implement way: An "inline" submit button (like the OK button) that can be added to the dialog just like the other elements, contains a custom texts and when pressed sets the variables from the dialog like normally, plus its own. Code example: sbValue = nil dialogInit() addTextView("TextViewMessage") addEditText("etValue", "Input EditText value:") addSubmitButton("sbValue", "Okay!", "defaultToThis") newRow() addTextView("Text End") dialogShow("Dialog Test")
print ("etValue: " .. etValue) print ("sbValue: " .. sbValue)
|
|
xrazx
New Member
Posts: 11
|
Post by xrazx on Aug 24, 2016 4:29:45 GMT
Hi, Just getting into these Ankulua myself and I'm have a few graphical "bugs" I would like to point out.
User Interface items are all aligned to the left side of the box without proper margins. Adding spaces solves the problem for some functions like textView but not for others like radioButtons.
ScriptExit has an extra linebreak.
These aren't critical bugs but they shouldn't be too hard to fix. (You can tell me if I'm wrong.)
I'm feel bad to critique on small problems when the app functions perfectly! Keep up the great work! I hope to expand my script further.
If there are any workarounds I would love to know!
-xRaZx
|
|
|
Post by AnkuLua on Aug 24, 2016 5:00:47 GMT
Thanks. It's intended for extra linebreak for scriptExit. Just don't want to message mixed with other messages. Don't see the issue of radioButtons. Would you share the screenshots?
|
|
xrazx
New Member
Posts: 11
|
Post by xrazx on Aug 24, 2016 5:22:46 GMT
Oh so if I don't want to have the extra linebreak I should use print and exit normally? Here is a SC of my box.  -xRaZx
|
|
|
Post by AnkuLua on Aug 24, 2016 7:16:15 GMT
Yes you can print something then scriptExit()
print("error!bra!bra!bra!") scriptExit() You can also add textview in front of radioGroup to get the margin.
addTextView(" ") addRadioGroup("rgIndex", 10) addRadioButton("Button 10", 10) addRadioButton("Button 11", 11)
|
|
|
Post by oraerk1 on Nov 22, 2016 11:49:49 GMT
Hello! I'm trying to make 2 radio groups in one row. According to documentation it seems possible. I use the following code: dialogInit() addTextView("rg1") addRadioGroup("rg1Index", 1) addRadioButton("rg1button1", 11) addRadioButton("rg1button2", 12) addRadioButton("rg1button3", 13)
addTextView("rg2") addRadioGroup("rg2Index", 1) addRadioButton("rg2button1", 21) addRadioButton("rg2button2", 22) addRadioButton("rg2button3", 23)
dialogShow("Dialog Test")
print ("rgindex = "..rg1Index) print ("rg2index = "..rg2Index)
print("Launcher done") Expected result (mokup):  What i've got:  Is it a bug or does it work as designed and documentation is wrong?
|
|
|
Post by AnkuLua on Nov 22, 2016 12:33:53 GMT
It works that way.
|
|
|
Post by paladiex on Dec 13, 2016 16:45:18 GMT
Is it possible to change the position of the box? I'm running into an issue on my tablet where this
if (runNum) then dialogInit() addEditText("runLmt") newRow() dialogShow("How many runs?") end
Is creating a dialog box with a text edit line that is behind my keyboard and not completely visible while typing.
|
|
|
Post by AnkuLua on Dec 14, 2016 1:14:49 GMT
No. You can not assign the dialog position. You can use addEditNumber() to number input, only number keyboard will show up.
|
|
duce
New Member
Posts: 1
|
Post by duce on Jul 12, 2017 1:08:16 GMT
I see there is a way to set button position but is that a way to get button position?
I could see me using the position it's in to do different stuff on start up like rather or not to open up config dialogs or even do different stuff while running
|
|