XBROWSE ARRAY AUTOSORT

Post Reply
Demont Brecht
Posts: 55
Joined: Fri Jul 08, 2011 6:43 am

XBROWSE ARRAY AUTOSORT

Post by Demont Brecht »

Hello ,

When an array is build as :

XBROWSE oBrw ARRAY Columns 2,1,..... AUTOSORT

The array is at startup wrongly sorted on the first column from the array ( second column from the browse)

It should be the first column from the browse (second from the array)

Frank
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: XBROWSE ARRAY AUTOSORT

Post by nageswaragunupudi »

I remember this was an issue in older versions. I think this is working correctly in the recent versions .
May I know the FWH version you are using?
Regards

G. N. Rao.
Hyderabad, India
Demont Brecht
Posts: 55
Joined: Fri Jul 08, 2011 6:43 am

Re: XBROWSE ARRAY AUTOSORT

Post by Demont Brecht »

nageswaragunupudi wrote:I remember this was an issue in older versions. I think this is working correctly in the recent versions .
May I know the FWH version you are using?
It was tested with FWH12.01

Frank
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: XBROWSE ARRAY AUTOSORT

Post by nageswaragunupudi »

Mr Frank

Kindly check once again.
It is working correctly here.

Sample:

Code: Select all

#include "fivewin.ch"
#include "xbrowse.ch"

function Main()

   local aData := { { 1000, 'C-cccc' }, { 2000, 'B-bbbb' }, { 3000, 'A-aaaa' } }

   XBROWSER aData COLUMNS { 2, 1 } AUTOSORT ;
      SETUP oBrw:cHeaders := { "Second", "First" }

return nil
 
Screenshot:
Image
Regards

G. N. Rao.
Hyderabad, India
Demont Brecht
Posts: 55
Joined: Fri Jul 08, 2011 6:43 am

Re: XBROWSE ARRAY AUTOSORT

Post by Demont Brecht »

Nages

compiling with FWH12.02 it is ok. I didn't test it with 12.01

Frank
Demont Brecht
Posts: 55
Joined: Fri Jul 08, 2011 6:43 am

Re: XBROWSE ARRAY AUTOSORT

Post by Demont Brecht »

Hello,

Now i am working with FWH12.03 , but it seems that there is a problem with ordering the first time in next situation :

@ 0,0 XBROWSE oBrw ARRAY Arr PIXEL OF oDlg FONT oFont;
COLUMNS aCol;
HEADERS aHead;
COLSIZES aWidth;
SORT aSort;

I checked
aCol : 1,2,3,4
aSort: 4,2,3,4

If i understand well , cSortorder from column 1 should be 4

This line invokes ocol:SortArrayData()

Placing DBG self , i can see that is ordered from column 1 , but csortorder is not be set to 4 (is 1)

After clicking the column header it is ok.

IT seems that at the moment sortarraydata is executed , csortorder was not be set.

Frank
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: XBROWSE ARRAY AUTOSORT

Post by nageswaragunupudi »

IT seems that at the moment sortarraydata is executed , csortorder was not be set.
Your observation is correct and thanks for pointing out.

Till this is fixed, you may please use the workaround of calling oBrw:aCols[ 1 ]:SetOrder() again manually.
Regards

G. N. Rao.
Hyderabad, India
Post Reply