Rob writes: “If we just output them in the order you provided you would have to write if statements for every native.showDialog() to reorder the buttons in the way the native OS wants them.”
It seems to me that you meant “we would”, not “you would” (since having the user write code to workaround the problem was an obvious (and already suggested?) solution.
So, using that interpretation (that you’re suggesting, and dismissing, the idea that Corona Labs fix the problem) …
Well, yes…that’s what you (CoronaLabs) should do, then: write the needed code.
When you have a problem that affects just about every caller of a function, the correct place to fix it is in the CoronaLabs code, not every user’s code.
There are at least two ways to avoid causing any backwards compatibility issues:
1. add a new function: native.showAlertNew ( …)
(documented as displaying buttons in left-right (or top-down if appropriate) order.
or, my recommended:
2. add a new optional final parameter: options
Example options: native.showAlert ( … (existing stuff) … , {left_right = true, vertical = true}
would request left-to right ordering, and that the options be listed vertically instead of whatever the default would be.
If options is missing, or {} or nil, then the actions are as they are now (even if somewhat unpredictable).
Morals:
1. work / changes should be done where you get the most bang for the buck …
sometimes that’s the Corona Labs. (And, almost always when it affects
every potential user of a function.)
2. adding an ‘options’ parameter can often extend / fix functionality in a completely
backwards compatible manner. And, it’s future-proof, as you can add more
option tags in the future. (E.g., format_bold = {1, 3}, format_italic = {1, 2}
could result in text for button 1 being bold italic, 2 italic, 3 bold … or
getting the default if the native OS doesn’t support that concept
(I’m not suggesting adding format_*, just pointing out that an options table
allows not-yet-thought-of tags to be added later!)
Final note: no matter what, this odd ordering should be clearly documented in the manual / documentation, as documentation saves *EVERYONE* time and money … the users and CoronaLabs!
thanks,
Stan