I had not a 'master plan when started HMG.
In fact, during the first year of development, MiniGUI library 'mutated' various times (those that had 'traveled' with me from the beginnig had 'suffered' that ).
The semi-oop syntax appeared about one year after the first version of MiniGUI library was released.
At that time I've made various big changes about general design, one of those, was that the Tab control shoud be a 'container' for other controls.
Is well known for all HMG users that coordinates for tab-child controls are referred to Tab and not to the parent window as other controls.
That's right, but look at this:
Code: Select all
DEFINE TAB Tab_1;
OF Win_1 ;
AT 10,10 ;
WIDTH 600 ;
HEIGHT 400
PAGE 'Page 1'
@ 100,100 BUTTON Button_1 ;
CAPTION "Test" ;
WIDTH 50 ;
HEIGHT 50 ;
ACTION MsgInfo('Test!')
END PAGE
END TAB
Code: Select all
Win_1.Button_1.Caption := 'New Caption'
The 'right' way is:
Code: Select all
Win_1.Tab_1(1).Button_1.Caption := 'New Caption'
Some days ago, I've discovered that this alternate ('correct') way to refer to tab-child controls was broken (from a long long time ago) and nobody noticed about that...
This is absolutely my fault, since the users learns HMG mainly via the bundled samples and those samples do not show the right way.
Most users (and me) had made a choice. The choice was alternate syntax for control definition and semi-oop for accessing at runtime. This is 'logical', since that is the easiest way to write and maintain the code.
I'll try to encourage users via the new samples and documentation to code this way, tagging other (alternate) methods as 'not recommended' and available for backwards compatibility only.
Stay tuned... More 'hidden' features will be come...
Regards,
Roberto.