Page 1 of 1

After MainForm activated. How could I change property?

Posted: Thu Oct 28, 2010 1:42 am
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

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

Posted: Thu Oct 28, 2010 12:15 pm
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

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

Posted: Sat Oct 30, 2010 4:06 pm
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.

After MainForm activated. How could I change property?

Posted: Sat Mar 21, 2015 1:13 am
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

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

Posted: Sat Mar 21, 2015 4:15 am
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

After MainForm activated. How could I change property?

Posted: Sat Mar 21, 2015 12:42 pm
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.

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

Posted: Sun Mar 22, 2015 1:46 am
by Javier Tovar
+1 Pablo César!