After MainForm activated. How could I change property?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

After MainForm activated. How could I change property?

Post by huangchenmin »

Following are my main function likes

#include <hmg.ch>
Function Main

Load Window Main as MainForm
mainform.Center
mainform.Activate
SetProperty("MainForm","MissList","Widths",{90,90})
Return
The widths of columns did not change.(origin is {30,30})
After MainForm activated.
How could I change property, which especifically definition only?
The reason I would like to do so is because that plentys of derivatives from one template.
Best Regards
chen min
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: After MainForm activated. How could I change property?

Post by esgici »

Hello Chen Min

Widths is a "Available at control definition only" property (Indicated with (D) in the documentation) for both Browse and Grid.

So its no way to change it at run time.

We hope eagerly that such limitations will go away at the HMG.4 :)

Happy HMG'ing :)

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: After MainForm activated. How could I change property?

Post by huangchenmin »

esgici wrote:Hello Chen Min

Widths is a "Available at control definition only" property (Indicated with (D) in the documentation) for both Browse and Grid.
So its no way to change it at run time.
We hope eagerly that such limitations will go away at the HMG.4 :)
Happy HMG'ing :)
Regards
--
Esgici
Thank you for supporting.
The futher HMG I used, The more amazing it bring to me.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

After MainForm activated. How could I change property?

Post by Pablo César »

huangchenmin wrote: SetProperty("MainForm","MissList","Widths",{90,90})
...
The widths of columns did not change.(origin is {30,30})
After MainForm activated.
How could I change property, which especifically definition only?
Hi chen min,

Now this is posible since HMG 3.1.3

Please read this at our hmgdoc (New Set Properties:) you will see:

<ParentWindowName>.<GridControlName>.ColumnWIDTH( nColIndex ) := [ nColumnWidth ]

By the way, we have to correct hmgdoc. Now is not (D) any more for ColumnWIDTH
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: After MainForm activated. How could I change property?

Post by Javier Tovar »

Hello,

Also remember that once the activated form:

Code: Select all

mainform.Center
mainform.Activate
and you can not put:

Code: Select all

SetProperty ("MainForm", "MissList", "Widths", {90,90})
It would be a procedure in ON INIT Form. or before activating the form.

What would be correct:

Code: Select all

<ParentWindowName>.<GridControlName>.ColumnWIDTH( nColIndex ) := [ nColumnWidth ]
mainform.Center
mainform.Activate
With the directions tell you the friend Pablo César.

regards
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

After MainForm activated. How could I change property?

Post by Pablo César »

Yes Javier, before was not posible to change column widths of grids even trying before activating form.

It's for this reason, I came to clarify that now is posible and also we need to fix our hmgdoc.

Actually we have C:\hmg.3.4.0\SAMPLES\Controls\Grid\GRID_40\demo.prg to see this behaviour by clicking on a third header to change column size. In this example is using: GRID_WIDTH_AUTOSIZEHEADER for column #3 and GRID_WIDTH_AUTOSIZE for column #5. But it could be changed to put a fixed columnwdith size too.

So from now, we can use:

<ParentWindowName>.<GridControlName>.ColumnWIDTH( nColIndex ) := [ nColumnWidth ]

at any time ! :D

Thanks to our good friend Dr. Claudio Soto.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: After MainForm activated. How could I change property?

Post by Javier Tovar »

+1 Pablo César!
Post Reply