After the return of fincs ...
... I made a note to review this at some point. So now I'm doing that.
I could go either way, so I have created a poll. I expect that anyone voting should have had plenty of time by now to use GuiCreate() and Gui.Add() and form their own opinion on the syntax.
I have collected some relevant points:
lexikos wrote: ↑23 Mar 2017, 21:38Gui.AddCtrl(Text, Options) vs Gui Add, Ctrl, Options, Text is bound to cause confusion with users familiar with the old order. Since even fincs expressed doubt about it, I'd guess it should be swapped back. Perhaps Options would be omitted more often than Text, but usually there's at least one option. Another point is aesthetics (which can affect readability); with several controls on a Gui, the options parameters often line up (i.e. when they aren't preceded by text of varying length).
Similarly, GuiCreate(Title, Options) is opposite to Gui New, Options, Title. However, I think GuiCreate requires a different way of thinking than Gui New. Gui New is less familiar (since it's optional and relatively new) and called much less frequently than Gui Add, so less likely to be a problem. On the other hand, I'm not certain which parameter would be used on its own more often, though my instinct is to put Title first.
fincs wrote: ↑24 Mar 2017, 06:35The main reason this was changed was that the syntax for specifying just the text and not the option (e.g. btn := gui.AddButton("", "Text") or gui.AddLabel,, Text) contained that extra empty parameter that looked ugly. I had always thought that the Text parameter was more used than the Options and thus it should be promoted to be the first parameter. However, it is indeed true that existing users would be confused by the change, so ultimately perhaps it should be changed back in gui.AddCtrl. But again, if GuiCreate keeps Title first, it would be inconsistent with it. I agree that gui.Show should lose its Text parameter since it's redundant.
just me wrote: ↑29 Apr 2017, 10:44When I started to test the first test built I immediately got the impression that Text, Options would be the 'natural' order. But that might have had two main reasons:The change of the order was surprising me, so I jumped in to question the reasons. After this discussion I cannot decide which order would be the 'better' or 'more natural'. But I can live with both of them.
- I started testing with simple Gui examples.
- I decided to not use vName and gEventhandler options in general.
just me wrote: ↑25 Apr 2017, 09:46IMO, the previous order is looks and feels better. Very most of the controls will get a value when created. So (previous [order]) GuiAdd("Control", ,"Options") will be the exception. For the sake of consistency the previous order should be kept for GuiCreate(), too.