Maybe someone can tell me why this happens occasionally.
I have a base label (cLabel) in class library A. I have a container (cNavButton) containing cLabel in class library B. I have another container (cNavGroup) that will contain cNavButton also in class library B. There is a form (frm1 (based on cForm in class library A)) that has the cNavGroup and 5 cNavButtons in it. cLabel has a height set to 19. cNavButton.cLabel is default The cNavGroup.cNavButton.cLabel.Height in frm1 all show they are still default (19). Yet I have placed code in the Init event of cLabel to display the Height onto the screen and I get 17.
VFP can be so random sometimes.
My hack to get around this behavior: in cNavButton, I have placed code in cLabel.Init to see if the height is < 19 and reset the height to default.
Autosize? IntegralHeight?
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Tracy Pearson Sent: Wednesday, July 7, 2021 2:07 PM To: profoxtech@leafe.com Subject: VFP Label Height changes
Maybe someone can tell me why this happens occasionally.
I have a base label (cLabel) in class library A. I have a container (cNavButton) containing cLabel in class library B. I have another container (cNavGroup) that will contain cNavButton also in class library B. There is a form (frm1 (based on cForm in class library A)) that has the cNavGroup and 5 cNavButtons in it. cLabel has a height set to 19. cNavButton.cLabel is default The cNavGroup.cNavButton.cLabel.Height in frm1 all show they are still default (19). Yet I have placed code in the Init event of cLabel to display the Height onto the screen and I get 17.
VFP can be so random sometimes.
My hack to get around this behavior: in cNavButton, I have placed code in cLabel.Init to see if the height is < 19 and reset the height to default.
[excessive quoting removed by server]
Autosize = .F. Alignment is centered The Label class doesn't have IntegralHeight.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye Sent: Wednesday, July 07, 2021 3:17 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize? IntegralHeight?
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Tracy Pearson Sent: Wednesday, July 7, 2021 2:07 PM To: profoxtech@leafe.com Subject: VFP Label Height changes
Maybe someone can tell me why this happens occasionally.
I have a base label (cLabel) in class library A. I have a container (cNavButton) containing cLabel in class library B. I have another container (cNavGroup) that will contain cNavButton also in class library B. There is a form (frm1 (based on cForm in class library A)) that has the cNavGroup and 5 cNavButtons in it. cLabel has a height set to 19. cNavButton.cLabel is default The cNavGroup.cNavButton.cLabel.Height in frm1 all show they are still default (19). Yet I have placed code in the Init event of cLabel to display the Height onto the screen and I get 17.
VFP can be so random sometimes.
My hack to get around this behavior: in cNavButton, I have placed code in cLabel.Init to see if the height is < 19 and reset the height to default.
[excessive quoting removed by server]
What is the default height for the font name and size used?
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Tracy Pearson Sent: Wednesday, July 7, 2021 3:37 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize = .F. Alignment is centered The Label class doesn't have IntegralHeight.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye Sent: Wednesday, July 07, 2021 3:17 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize? IntegralHeight?
--
rk
DODEFAULT in Init?
Dne 7.7.2021 v 22:40 Richard Kaye napsal(a):
What is the default height for the font name and size used?
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Tracy Pearson Sent: Wednesday, July 7, 2021 3:37 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize = .F. Alignment is centered The Label class doesn't have IntegralHeight.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye Sent: Wednesday, July 07, 2021 3:17 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize? IntegralHeight?
--
rk
[excessive quoting removed by server]
There was no code in the Init of the subclass or form instances. I put that hack in the subclass, I followed it with a DODEFAULT().
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Jan Bucek Sent: Wednesday, July 07, 2021 4:44 PM To: profoxtech@leafe.com Subject: Re: VFP Label Height changes
DODEFAULT in Init?
Dne 7.7.2021 v 22:40 Richard Kaye napsal(a):
What is the default height for the font name and size used?
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Tracy Pearson Sent: Wednesday, July 7, 2021 3:37 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize = .F. Alignment is centered The Label class doesn't have IntegralHeight.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of
Richard Kaye
Sent: Wednesday, July 07, 2021 3:17 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize? IntegralHeight?
--
rk
[excessive quoting removed by server]
On cLabel and default everywhere used in this scenario. FontName: Segoe UI FontSize: 10
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye Sent: Wednesday, July 07, 2021 4:40 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
What is the default height for the font name and size used?
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Tracy Pearson Sent: Wednesday, July 7, 2021 3:37 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize = .F. Alignment is centered The Label class doesn't have IntegralHeight.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye Sent: Wednesday, July 07, 2021 3:17 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize? IntegralHeight?
--
rk
[excessive quoting removed by server]
Tracy,
you able to recreate this with base VFP controls and then maybe add in your controls one by one to see where it's happening?
Maybe there's some resizing code running or bindevents that does something "special"?
Frank.
Frank Cazabon
On 07/07/2021 4:46 pm, Tracy Pearson wrote:
On cLabel and default everywhere used in this scenario. FontName: Segoe UI FontSize: 10
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye Sent: Wednesday, July 07, 2021 4:40 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
What is the default height for the font name and size used?
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Tracy Pearson Sent: Wednesday, July 7, 2021 3:37 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize = .F. Alignment is centered The Label class doesn't have IntegralHeight.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye Sent: Wednesday, July 07, 2021 3:17 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize? IntegralHeight?
--
rk
[excessive quoting removed by server]
Frank,
I originally went down that path. Then I put some code in the INIT of the control on the form. ?PROGRAM(PROGRAM(-1)),"Height:",THIS.Height DODEFAULT()
That was when I decided I needed to figure out a hack to get around the problem. If it is telling me the height of the control at the INIT was 17 instead of 19 that was a problem.
When I changed the Height to be overwritten to 19 in the cNavButton class, the above code correctly showed 19. When I reset Height to default, it again showed 17.
I spent a few hours attempting to reproduce it in a new project. I am not seeing the behavior currently. I'll may get some more time this weekend to continue my efforts.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Frank Cazabon Sent: Thursday, July 08, 2021 10:48 AM To: profoxtech@leafe.com Subject: Re: VFP Label Height changes
Tracy,
you able to recreate this with base VFP controls and then maybe add in your controls one by one to see where it's happening?
Maybe there's some resizing code running or bindevents that does something "special"?
Frank.
Frank Cazabon
On 07/07/2021 4:46 pm, Tracy Pearson wrote:
On cLabel and default everywhere used in this scenario. FontName: Segoe UI FontSize: 10
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of
Richard
Kaye Sent: Wednesday, July 07, 2021 4:40 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
What is the default height for the font name and size used?
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Tracy Pearson Sent: Wednesday, July 7, 2021 3:37 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize = .F. Alignment is centered The Label class doesn't have IntegralHeight.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of
Richard
Kaye Sent: Wednesday, July 07, 2021 3:17 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize? IntegralHeight?
--
rk
[excessive quoting removed by server]
Crazy!
I tracked down what was happening. There is a caption_assign method on the base label class. This is triggered before the init event. The code in the caption_assign did not change the height of the label. It did adjust the width of a label. When the width was adjusted the height would change, but there is not a way to capture that change and where it comes from. I stepped through the code and never saw anything when I put an height_assign method in there.
So to correct this, I have to change the width of the label after the form has initialized.
BINDEVENT(THISFORM, "INIT", THIS, "AFTER_FORM_INIT", 1)
Awesome, it's working.
Well, now I'm trying to launch a form that takes a parameter.
Local nId nId = 2547 DO FORM TestForm with nId
That errors with something that makes no sense. (Function argument value, type, or count is invalid.)
DO FORM TestForm with 2547
That works without an error.
Should I attempt to bind to the forms Show event? Should I trigger something in the forms visible_assign code?
I went with the visible_assign code today and the error isn't happening anymore.
So, if you need to resize something that needs to reference the parent of an object, don't do it in the child init method. Some properties don't stay as you suspect them to.
Have Fun! Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Tracy Pearson Sent: Friday, July 09, 2021 9:44 AM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Frank,
I originally went down that path. Then I put some code in the INIT of the control on the form. ?PROGRAM(PROGRAM(-1)),"Height:",THIS.Height DODEFAULT()
That was when I decided I needed to figure out a hack to get around the problem. If it is telling me the height of the control at the INIT was 17 instead of 19 that was a problem.
When I changed the Height to be overwritten to 19 in the cNavButton class, the above code correctly showed 19. When I reset Height to default, it again showed 17.
I spent a few hours attempting to reproduce it in a new project. I am not seeing the behavior currently. I'll may get some more time this weekend to continue my efforts.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Frank Cazabon Sent: Thursday, July 08, 2021 10:48 AM To: profoxtech@leafe.com Subject: Re: VFP Label Height changes
Tracy,
you able to recreate this with base VFP controls and then maybe add in your controls one by one to see where it's happening?
Maybe there's some resizing code running or bindevents that does something "special"?
Frank.
Frank Cazabon
On 07/07/2021 4:46 pm, Tracy Pearson wrote:
On cLabel and default everywhere used in this scenario. FontName: Segoe UI FontSize: 10
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of
Richard
Kaye Sent: Wednesday, July 07, 2021 4:40 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
What is the default height for the font name and size used?
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Tracy Pearson Sent: Wednesday, July 7, 2021 3:37 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize = .F. Alignment is centered The Label class doesn't have IntegralHeight.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of
Richard
Kaye Sent: Wednesday, July 07, 2021 3:17 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize? IntegralHeight?
--
rk
[excessive quoting removed by server]
Good sleuthing Tracy!
On 14 July 2021 16:14:32 GMT-04:00, Tracy Pearson tracy@powerchurch.com wrote:
Crazy!
I tracked down what was happening. There is a caption_assign method on the base label class. This is triggered before the init event. The code in the caption_assign did not change the height of the label. It did adjust the width of a label. When the width was adjusted the height would change, but there is not a way to capture that change and where it comes from. I stepped through the code and never saw anything when I put an height_assign method in there.
So to correct this, I have to change the width of the label after the form has initialized.
BINDEVENT(THISFORM, "INIT", THIS, "AFTER_FORM_INIT", 1)
Awesome, it's working.
Well, now I'm trying to launch a form that takes a parameter.
Local nId nId = 2547 DO FORM TestForm with nId
That errors with something that makes no sense. (Function argument value, type, or count is invalid.)
DO FORM TestForm with 2547
That works without an error.
Should I attempt to bind to the forms Show event? Should I trigger something in the forms visible_assign code?
I went with the visible_assign code today and the error isn't happening anymore.
So, if you need to resize something that needs to reference the parent of an object, don't do it in the child init method. Some properties don't stay as you suspect them to.
Have Fun! Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Tracy Pearson Sent: Friday, July 09, 2021 9:44 AM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Frank,
I originally went down that path. Then I put some code in the INIT of the control on the form. ?PROGRAM(PROGRAM(-1)),"Height:",THIS.Height DODEFAULT()
That was when I decided I needed to figure out a hack to get around the problem. If it is telling me the height of the control at the INIT was 17 instead of 19 that was a problem.
When I changed the Height to be overwritten to 19 in the cNavButton class, the above code correctly showed 19. When I reset Height to default, it again showed 17.
I spent a few hours attempting to reproduce it in a new project. I am not seeing the behavior currently. I'll may get some more time this weekend to continue my efforts.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Frank Cazabon Sent: Thursday, July 08, 2021 10:48 AM To: profoxtech@leafe.com Subject: Re: VFP Label Height changes
Tracy,
you able to recreate this with base VFP controls and then maybe add in your controls one by one to see where it's happening?
Maybe there's some resizing code running or bindevents that does something "special"?
Frank.
Frank Cazabon
On 07/07/2021 4:46 pm, Tracy Pearson wrote:
On cLabel and default everywhere used in this scenario. FontName: Segoe UI FontSize: 10
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of
Richard
Kaye Sent: Wednesday, July 07, 2021 4:40 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
What is the default height for the font name and size used?
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Tracy
Pearson
Sent: Wednesday, July 7, 2021 3:37 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize = .F. Alignment is centered The Label class doesn't have IntegralHeight.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of
Richard
Kaye Sent: Wednesday, July 07, 2021 3:17 PM To: profoxtech@leafe.com Subject: RE: VFP Label Height changes
Autosize? IntegralHeight?
--
rk
[excessive quoting removed by server]