GetProperties: ColumnCOUNT, ColumnWIDTH and ColumnHEADER

Moderator: Rathinagiri

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

GetProperties: ColumnCOUNT, ColumnWIDTH and ColumnHEADER

Post by Pablo César »

Hi Claudio,

This is to inform to you that seems to be a bug around:
  1. ColumnCOUNT

    I've make a simple test as follow (based on C:\hmg.3.4.0\SAMPLES\Controls\Grid\GRID_04\demo.prg):

    Code: Select all

    /*
    * HMG Virtual Grid Demo
    * (c) 2003 Roberto lopez
    */
    
    #include "hmg.ch"
    
    Function Main
    
    	DEFINE WINDOW Form_1 ;
    		AT 0,0 ;
    		WIDTH 450 ;
    		HEIGHT 400 ;
    		TITLE 'Hello World!' ;
    		MAIN 
    
    		DEFINE MAIN MENU
    			DEFINE POPUP 'File'
    				MENUITEM 'Change ItemCount' ACTION Form_1.Grid_1.ItemCount := Val(InputBox('New Value','Change ItemCount'))
    			END POPUP
    		END MENU
    
    		@ 10,10 GRID Grid_1 ;
    		WIDTH 400 ;
    		HEIGHT 330 ;
    		HEADERS {'Column 1','Column 2','Column 3'} ;
    		WIDTHS {140,140,140};
    		VIRTUAL ;
    		ITEMCOUNT 100000000 ;
    		ON QUERYDATA QueryTest() MULTISELECT 
    
    	END WINDOW
    
    	CENTER WINDOW Form_1
    msgdebug(GetProperty("Form_1","Grid_1","ColumnCOUNT"))
    	ACTIVATE WINDOW Form_1
    
    Return
    
    Procedure QueryTest()
    
    	This.QueryData := 'ர' + Str ( This.QueryRowIndex ) + ',' + Str ( This.QueryColIndex )
    
    Return
    This return of msgdebug(GetProperty("Form_1","Grid_1","ColumnCOUNT")) is NIL :o

    But if in place you test with msgdebug(Len(_HMG_SYSDATA [ 7 ] [GetControlIndex("Grid_1","Form_1")])) then returns 3 (ok, regarding number of headers/columns).
     
  2. ColumnWIDTH not working too... :( but with LISTVIEW_GETCOLUMNWIDTH, yes it's working... :?
     
  3. ColumnHEADER not working too... :( and trhru _HMG_SYSDATA [ 7 ] [GetControlIndex("Grid_1","Form_1")] [nColIndex], yes it's working... :?


Should it be no reason of this wrong behaviour, not for being MultiGrid or Virtual Grid, doesn't it ?

Please confirm.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

GetProperties: ColumnCOUNT, ColumnWIDTH and ColumnHEADER

Post by Pablo César »

Hi Claudio,

GetProperty(cForm,cGrid,"CellEx",nGridRow,nPos) also is not working for MultiGrid or Virtual Grid (I'm not sure why).

But if I make it thru _GridEx_GetCellValue for a unique register to be edited, then it's working.

Keeping you informed,

B.Rgds
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GetProperties: ColumnCOUNT, ColumnWIDTH and ColumnHEADER

Post by srvet_claudio »

Thank for report, I'll check the code.

The problem is GetProperty(), because
_GridEx_ColumnCount ("Grid_1" , "Form_1")
work fine.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GetProperties: ColumnCOUNT, ColumnWIDTH and ColumnHEADER

Post by srvet_claudio »

I fixed it.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

GetProperties: ColumnCOUNT, ColumnWIDTH and ColumnHEADER

Post by Pablo César »

Thank you Claudio ! :D
ColumnCOUNT -> Len(_HMG_SYSDATA [ 7 ] [GetControlIndex("Grid_1","Form_1")])

ColumnWIDTH -> ListView_GetColumnWidth(GetControlHandle("Grid_1","Form-1"), (nColIndex-1))

ColumnHEADER -> _HMG_SYSDATA [ 7 ] [GetControlIndex("Grid_1","Form_1")] [nColIndex]
Do you think that we can use in InputWindow like above was indicated without any problem prior your next patch or new version released ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GetProperties: ColumnCOUNT, ColumnWIDTH and ColumnHEADER

Post by srvet_claudio »

Pablo César wrote:Thank you Claudio ! :D
ColumnCOUNT -> Len(_HMG_SYSDATA [ 7 ] [GetControlIndex("Grid_1","Form_1")])

ColumnWIDTH -> ListView_GetColumnWidth(GetControlHandle("Grid_1","Form-1"), (nColIndex-1))

ColumnHEADER -> _HMG_SYSDATA [ 7 ] [GetControlIndex("Grid_1","Form_1")] [nColIndex]
Do you think that we can use in InputWindow like above was indicated without any problem prior your next patch or new version released ?
In the a new patch, I'm working in others improvements in the source code.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Post Reply