HMG4: start, quit, resource, localized

Moderator: Rathinagiri

User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: HMG4: start, quit, resource, localized

Post by l3whmg » Sat Jul 09, 2011 12:55 pm

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
Luigi from Italy
www.L3W.it

User avatar
concentra
Posts: 256
Joined: Fri Nov 26, 2010 11:31 am
Location: Piracicaba - Brasil

Post by concentra » Mon Jul 11, 2011 10:45 am

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.
[[]] Mauricio Ventura Faria

User avatar
concentra
Posts: 256
Joined: Fri Nov 26, 2010 11:31 am
Location: Piracicaba - Brasil

Post by concentra » Mon Jul 11, 2011 12:33 pm

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 ?
[[]] Mauricio Ventura Faria

mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Post by mrduck » Tue Jul 12, 2011 12:22 pm

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

User avatar
concentra
Posts: 256
Joined: Fri Nov 26, 2010 11:31 am
Location: Piracicaba - Brasil

Post by concentra » Tue Jul 12, 2011 3:50 pm

Hi.
I changed s_oCurrentWindow to s_oParentWindow since its used to set parenthood.
[[]] Mauricio Ventura Faria

mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Post by mrduck » Sat Jul 16, 2011 1:32 pm

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...

User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Post by l3whmg » Sat Jul 16, 2011 3:39 pm

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
Luigi from Italy
www.L3W.it

User avatar
concentra
Posts: 256
Joined: Fri Nov 26, 2010 11:31 am
Location: Piracicaba - Brasil

Post by concentra » Tue Jul 19, 2011 5:20 pm

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.
[[]] Mauricio Ventura Faria

mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Post by mrduck » Tue Jul 19, 2011 5:27 pm

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 ?

User avatar
concentra
Posts: 256
Joined: Fri Nov 26, 2010 11:31 am
Location: Piracicaba - Brasil

Post by concentra » Tue Jul 19, 2011 6:31 pm

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.
[[]] Mauricio Ventura Faria

Post Reply