FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBROWSE AUTOSORT Problem
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
XBROWSE AUTOSORT Problem
Posted: Wed Sep 01, 2010 03:11 PM

When i use
REDEFINE COLUMN XBROWSE ..... ARRAY .... AUTOSORT
no sort is functioning, when i click on headers!
Any changes to earlier versions of FWH?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: XBROWSE AUTOSORT Problem
Posted: Wed Sep 01, 2010 03:40 PM

Gunther

Are you refering to 10.8 ?

Richard

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBROWSE AUTOSORT Problem
Posted: Wed Sep 01, 2010 09:35 PM
It should work.
Please try this one-line code:
Code (fw): Select all Collapse
#include "fivewin.ch"
#include "xbrowse.ch"

function main()

   XBROWSER Directory() AUTOSORT

return nil

If autosort works here there is no reason it does not work in other situations.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: XBROWSE AUTOSORT Problem
Posted: Thu Sep 02, 2010 10:54 AM
I have tested:
Code (fw): Select all Collapse
REDEFINE COLUMN XBROWSE oList OF oWnd ID 100 ARRAY directory() AUTOSORT


No reaction of any headerclick!
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBROWSE AUTOSORT Problem
Posted: Thu Sep 02, 2010 12:01 PM
If the sample I posted works and your sample does not work, obviously the resource specification is not in conformity with the specifications.

Please try this sample program with the rc file given:

prg file
Code (fw): Select all Collapse
#include 'fivewin.ch'
#include 'xbrowse.ch'

function main()

   local oDlg, oBrw

   DEFINE DIALOG oDlg RESOURCE 'TEST' TITLE 'Array Autosort'

   REDEFINE XBROWSE oBrw ID 101 OF oDlg ;
      AUTOCOLS AUTOSORT ;
      ARRAY Directory() ;
      LINES CELL

   ACTIVATE DIALOG oDlg CENTERED ON INIT ( oBrw:SetFocus(), .f. )

return nil


rc file
Code (fw): Select all Collapse
TEST DIALOG 6, 15, 306, 227
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "TXBrowse demo"
FONT 8, "MS Sans Serif"
{
 DEFPUSHBUTTON "OK", IDOK, 252, 211, 50, 14
 CONTROL "", 101, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP, 4, 5, 297, 202
}


screen-shot


Autosort works
Incremental seek also works.

Please check for this 'CONTROL "", 101, "TXBrowse"' in your rc file.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: XBROWSE AUTOSORT Problem
Posted: Thu Sep 02, 2010 12:47 PM

Now I found the reason for this problem:
if i use oBrw:lAllowSwapping := .F. the autosort is not functioning!

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBROWSE AUTOSORT Problem
Posted: Thu Sep 02, 2010 02:01 PM
Yes. When lAllowColSwapping is .F., clicking on header does not work. This is a known issue for long but unfortunately not solved yet.

Here is the solution.
In xbrowse.prg, please find
Code (fw): Select all Collapse
METHOD HeaderLButtonDown( nMRow, nMCol, nFlags ) CLASS TXBrwColumn

   if ::oBrw:nCaptured == 0 .and. ::oBrw:lAllowColSwapping

Please change the line if ::nCaptured .... as:
Code (fw): Select all Collapse
   if ::oBrw:nCaptured == 0 .and. ;
      ( ::oBrw:lAllowColSwapping .or. ! Empty( ::cSortOrder ) .or. ;
        ::bLClickHeader != nil )

Now the autosort works.

This correction can be applied for all previous versions also.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: XBROWSE AUTOSORT Problem
Posted: Thu Sep 02, 2010 02:29 PM

THANKS!!

Regards,
Günther
---------------------------------
office@byte-one.com

Continue the discussion