An HMG "Hidden" feature...

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

Post Reply
User avatar
Roberto Lopez
HMG Founder
Posts: 3880
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 107 times

An HMG "Hidden" feature...

Post by Roberto Lopez » Sun Aug 31, 2008 12:55 am

Hi All,

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
All HMG users (including me) refers to button in this way:

Code: Select all

Win_1.Button_1.Caption := 'New Caption'
This is possible because 'backwards compatibility' with first MiniGUI versions, but... is wrong (or 'almost' wrong :) ).

The 'right' way is:

Code: Select all

Win_1.Tab_1(1).Button_1.Caption := 'New Caption'
Since, Tab is a container.

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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
esgici
Posts: 4282
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 166 times
Been thanked: 61 times
Contact:

Post by esgici » Sun Aug 31, 2008 1:25 am

Roberto Lopez wrote: This is possible because 'backwards compatibility' with first MiniGUI versions, but... is wrong (or 'almost' wrong :) ).
Interesting :o
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.
This is good news :)
Stay tuned... More 'hidden' features will be come... :)
We will wait with curiosity and patience. I hope that you will announce changes on samples :)

Best regards

--

esgici
Viva INTERNATIONAL HMG :D

User avatar
Roberto Lopez
HMG Founder
Posts: 3880
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 107 times

Post by Roberto Lopez » Sun Aug 31, 2008 1:39 am

We will wait with curiosity and patience. I hope that you will announce changes on samples :)
Well... there is 150+ samples. I have no plans to rewrite all of them right now...

I'll put my efforts in new samples :)

Regards,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
esgici
Posts: 4282
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 166 times
Been thanked: 61 times
Contact:

Post by esgici » Sun Aug 31, 2008 1:50 am

Roberto Lopez wrote: I have no plans to rewrite all of them right now...
Of course ... :)

TAB sample has been changed ( added Optional Syntax (Reffer button as tab child ) ) in Vers. 2.6.0 and I don't have noticed :(

Best Regards.

--

esgici
Viva INTERNATIONAL HMG :D

User avatar
Rathinagiri
Posts: 5096
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 93 times
Been thanked: 107 times
Contact:

Post by Rathinagiri » Sun Aug 31, 2008 3:17 am

Stay tuned... More 'hidden' features will be come...

:)

So, it is proved that HMG is a treasure. Please do a hunt.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Roberto Lopez
HMG Founder
Posts: 3880
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 107 times

Post by Roberto Lopez » Sun Aug 31, 2008 4:59 pm

Roberto Lopez wrote: The 'right' way is:

Code: Select all

Win_1.Tab_1(1).Button_1.Caption := 'New Caption'
By the moment, you must be careful and use this syntax for experimentation only, since I've found some incompatibilities that I've fixed, but I want to do more tests before release it.

Regards,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
luisvasquezcl
Posts: 996
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Has thanked: 5 times
Been thanked: 10 times
Contact:

Post by luisvasquezcl » Tue Oct 07, 2008 1:39 am

Estimado Roberto,
siempre pensé en que cada ventana contenedora debería tener su propio array de controles.
Esto llevaria a una mejora en el rendimiento de la libreria ya que acota la busqueda sólo al array contenido por la ventana señalada.
Me tomé la libertad de hacerte este comentario, es solo una idea que siempre tuve y no la expresé, bueno, ahora si 8),
Saludos cordiales,
Luis Vásquez.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest