HMG Program Error on MultiChild Form

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

bootwan
Posts: 52
Joined: Thu May 27, 2010 2:33 am

HMG Program Error on MultiChild Form

Post by bootwan »

:cry:
Last edited by bootwan on Sat Jun 26, 2010 3:58 pm, edited 1 time in total.
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HMG Program Error on MultiChild Form

Post by Rathinagiri »

As the error message clearly states, a new window can't be activated inside gotfocus event of another window.

However, if we click on the title bar of the window and then click the menu item to invoke the new child window creation, it works perfectly.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Czarny_Pijar
Posts: 172
Joined: Thu Mar 18, 2010 11:31 pm
Location: 19.2341 E 50.2267 N

Re: HMG Program Error on MultiChild Form

Post by Czarny_Pijar »

The various unexpected things happened when you have to issue Alt-F4 command while Child Window is opened... The example is attached.
Attachments
child_wind_AltF4.zip
(2.88 KiB) Downloaded 287 times
bootwan
Posts: 52
Joined: Thu May 27, 2010 2:33 am

Re: HMG Program Error on MultiChild Form

Post by bootwan »

.
Last edited by bootwan on Sat Jun 26, 2010 3:57 pm, edited 1 time in total.
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG Program Error on MultiChild Form

Post by Roberto Lopez »

Czarny_Pijar wrote:The various unexpected things happened when you have to issue Alt-F4 command while Child Window is opened... The example is attached.
Your sample is incorrect.

You must activate the three windows:

Code: Select all

        Load Window Main
        Load Window form_child
        Load Window form_child2
        Main.Center

        Activate Window Main , form_child , form_child2
There is various samples where multiple window activation is used.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Czarny_Pijar
Posts: 172
Joined: Thu Mar 18, 2010 11:31 pm
Location: 19.2341 E 50.2267 N

Re: HMG Program Error on MultiChild Form

Post by Czarny_Pijar »

Roberto Lopez wrote: Your sample is incorrect.

You must activate the three windows:

Code: Select all

        Activate Window Main , form_child , form_child2
There is various samples where multiple window activation is used.
In my demo I've activated the windows in a different style:

Code: Select all

        Main.Activate
        form_child.Activate
        form_child2.Activate
Neither of these is perfect from the point of view of the common clipper programmer (i.e. my ;) ). The first opens 3 windows at the start of the program, and Alt-F4 quirks are only delayed.


The easy way is here:

Code: Select all

        Load Window Main
        Load Window form_child
        Load Window form_child2
        Main.Center
        Activate Window All
All works as expected. :)
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG Program Error on MultiChild Form

Post by Roberto Lopez »

Czarny_Pijar wrote:
Roberto Lopez wrote: Your sample is incorrect.

You must activate the three windows:

Code: Select all

        Activate Window Main , form_child , form_child2
There is various samples where multiple window activation is used.
In my demo I've activated the windows in a different style:

Code: Select all

        Main.Activate
        form_child.Activate
        form_child2.Activate
Neither of these is perfect from the point of view of the common clipper programmer (i.e. my ;) ). The first opens 3 windows at the start of the program, and Alt-F4 quirks are only delayed.


The easy way is here:

Code: Select all

        Load Window Main
        Load Window form_child
        Load Window form_child2
        Main.Center
        Activate Window All
All works as expected. :)
I've been injured in a hand and is very difficult to me to write using only one, so I'm writing only short messages :)

I've already know and verified the alt+f4 problem with child windows and I'll try to fix it ASAP.

Moreover, your original sample is incorrect.

An activate window command creates a wait state (slightly similar to a Clipper's READ) and make visible all windows listed in the command.

The wait state finish when all listed windows be closed.

When I've started minigui, I've not cloned other product, so i've made design decisions, created rules and coding outside that rules could have unexpected results.

Usually, runtime errors 'trap' unwanted/unsupported coding (the same as any other development tool).

HMG help is very basic and there is no explanations for all unsupported operations. Runtime error messages are intended to clarify the programmers about this.

The best source for learning to code are the samples.

I hope that this helps.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
bootwan
Posts: 52
Joined: Thu May 27, 2010 2:33 am

Re: HMG Program Error on MultiChild Form

Post by bootwan »

.
Last edited by bootwan on Sat Jun 26, 2010 3:57 pm, edited 1 time in total.
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG Program Error on MultiChild Form

Post by Roberto Lopez »

Roberto Lopez wrote:
I've been injured in a hand and is very difficult to me to write using only one, so I'm writing only short messages :)
I'm still writing with only one hand :)
Roberto Lopez wrote: An activate window command creates a wait state (slightly similar to a Clipper's READ) and make visible all windows listed in the command.

The wait state finish when all listed windows be closed.

When I've started minigui, I've not cloned other product, so i've made design decisions, created rules and coding outside that rules could have unexpected results.

Usually, runtime errors 'trap' unwanted/unsupported coding (the same as any other development tool).
A little more on wait states:

In most GUI development tools, the 'normal' operation is just to have only one message loop (activate window equivalent).

When I've started minigui library I've decided that could be better to let the programmer to use multiple message loops (activates) because it could facilitate migration from an xBase 'classic' scheme.

So, DEFINE WINDOW... ACTIVATE WINDOW could be the equivalent to @...SAY GET.... READ construct.

Soon, I've noticed that some users attempted to create some weird constructs around this, adding multiple activate commands in various windows events.

Supporting this kind of programming was never mi intention because this drives to create messy code.

So, in the same way that unconditional control transfer statements were eliminated from most high level languages to avoid spaghetti code, I've tried to avoid this kind of programming from HMG to avoid poorly written/messy code and because supporting it could require a huge (non-sense) work.

From time to time, I need to add new error checking since new constructs (out of the scope of the HMG design) appears.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
bootwan
Posts: 52
Joined: Thu May 27, 2010 2:33 am

Re: HMG Program Error on MultiChild Form

Post by bootwan »

:cry:
Last edited by bootwan on Sat Jun 26, 2010 4:02 pm, edited 1 time in total.
Post Reply