Page 5 of 5

Re: HMG4: start, quit, resource, localized

Posted: Sat Jul 09, 2011 12:55 pm
by l3whmg
Hi Mauricio.

I think it's not a good way add var within globalshared.prg only to bypass /w3 problem!
Could you please take a look here viewtopic.php?f=32&t=2018&p=17125#p17125 and give me your opinion. I want publish.

2011-07-09 Update
On the other hand already exist current window: s_oCurWindow why a new var s_oCurrentWindow ?
And there is a method to know current window HMGAPP():CurrHmgWin() or THISWINDOW in XBase style.

Best regards

Re: HMG4: start, quit, resource, localized

Posted: Mon Jul 11, 2011 10:45 am
by concentra
Hi Luigi.
l3whmg wrote:I think it's not a good way add var within globalshared.prg only to bypass /w3 problem!
Agree. But i think the other way worse. And between the bad and the worse I choose the first.
Could you please take a look here viewtopic.php?f=32&t=2018&p=17125#p17125 and give me your opinion.
I will, give me a day.
On the other hand already exist current window: s_oCurWindow why a new var s_oCurrentWindow ?
Sorry, I didn't see.

Re: HMG4: start, quit, resource, localized

Posted: Mon Jul 11, 2011 12:33 pm
by concentra
Hi Luigi.
l3whmg wrote:On the other hand already exist current window: s_oCurWindow why a new var s_oCurrentWindow ?
They are different things.
s_oCurWindow is used to know which window has the current focus.
s_oCurrentWindow is used to help setting the parenthood at creation time when using xBase syntax, while constructing the interface.
s_oCurWindow can be used at any time by the programmer whenever the logic needs to know which window has focus and s_oCurrentWindow shoudn´t be used at all by a programmer, it's only needed at preprocessor level.
Its a good idea change s_oCurrentWindow to another thing in order to avoid misinterpretations.
And I prefer full names in vars, can I change s_oCurWindow to s_oCurrentWindow ?

Re: HMG4: start, quit, resource, localized

Posted: Tue Jul 12, 2011 12:22 pm
by mrduck
I can't follow the discussion since I have a bad internet connection so I just propose to change var names to something more clear like oCurrentFocusWindow or something similar.

For menus I can't say yet

Re: HMG4: start, quit, resource, localized

Posted: Tue Jul 12, 2011 3:50 pm
by concentra
Hi.
I changed s_oCurrentWindow to s_oParentWindow since its used to set parenthood.

a bug report

Posted: Sat Jul 16, 2011 1:32 pm
by mrduck
I'm just back from holiday, I updated from svn and compiled a program I was working on getting a run time error.

Property lSizable has been moved from window.prg to basic.prg but the Sizable method has been deleted and not moved...

Re: HMG4: start, quit, resource, localized

Posted: Sat Jul 16, 2011 3:39 pm
by l3whmg
Mee to I come back today from holiday.
Mauricio, I understand very well because you add _oCurWindow, but as I tried to explain I think it's not a good way to use shared var to solve /w3 problems. It's a right solution, ok, but IMHO not good. Today we need something here for this problem, next days other people need something: these take memory. I think: we can write a better code.
As you write: the parenthood. Well and oDefaultParent? Can't be used because change when you start to create a new window, but how many time you have see this code in the same source and in this specific order:

Code: Select all

DEFINE WINDOW form1
....
END WINDOW
....
DEFINE WINDOW form2
....
END WINDOW
....
DEFINE MAINMENU OF form1
....
END MENU

DEFINE MAINMENU OF form2
....
END MENU

ACTIVATE form1
I don't know if a programmer write this or he write this

Code: Select all

DEFINE WINDOW form1
DEFINE MAINMENU
END MENU
END WINDOW
....
DEFINE WINDOW form2
DEFINE MAINMENU
END MENU
END WINDOW
......
ACTIVATE form1
This is my little opinion.

Cheers

Re: a bug report

Posted: Tue Jul 19, 2011 5:20 pm
by concentra
mrduck wrote:Property lSizable has been moved from window.prg to basic.prg but the Sizable method has been deleted and not moved...
Sorry, my fault.
Fixed.

Re: a bug report

Posted: Tue Jul 19, 2011 5:27 pm
by mrduck
I did a patch today to commit this evening and you were quicker...

I did move lSizable back to window.prg where it should be, did you the same ?

Re: a bug report

Posted: Tue Jul 19, 2011 6:31 pm
by concentra
mrduck wrote:I did a patch today to commit this evening and you were quicker...
:mrgreen:
I did move lSizable back to window.prg where it should be, did you the same ?
No. Since objects other than windows can be sizable, I moved to basic.