HMG Program Error on MultiChild Form
Moderator: Rathinagiri
HMG Program Error on MultiChild Form
Last edited by bootwan on Sat Jun 26, 2010 3:58 pm, edited 1 time in total.
- 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
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.
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.
South or North HMG is worth.
...the possibilities are endless.
- 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
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
Re: HMG Program Error on MultiChild Form
.
Last edited by bootwan on Sat Jun 26, 2010 3:57 pm, edited 1 time in total.
- Roberto Lopez
- HMG Founder
- Posts: 4023
- Joined: Wed Jul 30, 2008 6:43 pm
Re: HMG Program Error on MultiChild Form
Your sample is incorrect.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.
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
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- 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
In my demo I've activated the windows in a different style:Roberto Lopez wrote: Your sample is incorrect.
You must activate the three windows:There is various samples where multiple window activation is used.Code: Select all
Activate Window Main , form_child , form_child2
Code: Select all
Main.Activate
form_child.Activate
form_child2.ActivateThe easy way is here:
Code: Select all
Load Window Main
Load Window form_child
Load Window form_child2
Main.Center
Activate Window All
- Roberto Lopez
- HMG Founder
- Posts: 4023
- Joined: Wed Jul 30, 2008 6:43 pm
Re: HMG Program Error on MultiChild Form
I've been injured in a hand and is very difficult to me to write using only one, so I'm writing only short messagesCzarny_Pijar wrote:In my demo I've activated the windows in a different style:Roberto Lopez wrote: Your sample is incorrect.
You must activate the three windows:There is various samples where multiple window activation is used.Code: Select all
Activate Window Main , form_child , form_child2Neither of these is perfect from the point of view of the common clipper programmer (i.e. myCode: Select all
Main.Activate form_child.Activate form_child2.Activate). The first opens 3 windows at the start of the program, and Alt-F4 quirks are only delayed.
The easy way is here:All works as expected.Code: Select all
Load Window Main Load Window form_child Load Window form_child2 Main.Center Activate Window All
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)
Roberto
(Veritas Filia Temporis)
Re: HMG Program Error on MultiChild Form
.
Last edited by bootwan on Sat Jun 26, 2010 3:57 pm, edited 1 time in total.
- Roberto Lopez
- HMG Founder
- Posts: 4023
- Joined: Wed Jul 30, 2008 6:43 pm
Re: HMG Program Error on MultiChild Form
I'm still writing with only one handRoberto 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
A little more on wait states: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).
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)
Roberto
(Veritas Filia Temporis)
Re: HMG Program Error on MultiChild Form
Last edited by bootwan on Sat Jun 26, 2010 4:02 pm, edited 1 time in total.