FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH 2103: XBrowse: oSortCbx
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: FWH 2103: XBrowse: oSortCbx
Posted: Mon Jun 07, 2021 09:42 PM
Silvio.Falconi wrote:
I make a test "all together" ( csortbox, search,multisel)


Sylvio, I wanted to make some test on this sample... Is it available ?
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: FWH 2103: XBrowse: oSortCbx
Posted: Mon Jun 07, 2021 09:46 PM

Perhaps I found the solution

WITH OBJECT oBrw
WITH OBJECT oBrw:aCols[ 1]
:cSortOrder:="CLICOGNOME"

            END
            WITH OBJECT oBrw:aCols[ 2]
                 :cSortOrder:="CLINOME"

            END
             WITH OBJECT oBrw:aCols[ 6]
                 :cSortOrder:="CLIPAESE"

            END

but then I cannot click on headers

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: FWH 2103: XBrowse: oSortCbx
Posted: Mon Jun 07, 2021 10:03 PM
Marc Venken wrote:
Silvio.Falconi wrote:
I make a test "all together" ( csortbox, search,multisel)


Sylvio, I wanted to make some test on this sample... Is it available ?


I create a unique test from

csortbox, search := xbsortcb.prg
multisel := xbmulsel.prg
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH 2103: XBrowse: oSortCbx
Posted: Mon Jun 07, 2021 11:44 PM

Set cSortOrder of columns you do not want to sort as "".
Example:

oBrw:aCols[ 3 ]:cSortOrder := ""
oBrw:aCols[ 4 ]:cSortOrder := ""
.....

Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: FWH 2103: XBrowse: oSortCbx
Posted: Tue Jun 08, 2021 09:07 AM
nageswaragunupudi wrote:Set cSortOrder of columns you do not want to sort as "".
Example:

oBrw:aCols[ 3 ]:cSortOrder := ""
oBrw:aCols[ 4 ]:cSortOrder := ""
.....


Not run ok
on the combobox run ok then if I click on header 3,4 make the sort
test sample (your modified sample)
Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "constant.ch"

 REQUEST DBFCDX


function TestTDatabase()

   local oDlg, oBrw, oDbf
   local cSeek:=Space(100)
   local oGet

   local aCols    := { ;
                { "FIRST"     , "Cognome",,        120},;
                { "LAST"      , "Nome"   ,,        120 },;
                { "STREET"    , "Indirizzo",,      120 },;
                { "CITY"      , "Località",,       120 },;
                { "STATE"     , "Provincia",,       40 },;
                { "ZIP"       , "Cap", ,            60 }}




   oDbf  := TDatabase():Open( nil, "Customer", "DBFCDX", .t. )
   oDbf:SetOrder( "FIRST" )
   oDbf:GoTop()

   DEFINE DIALOG oDlg SIZE 800,400 PIXEL TRUEPIXEL RESIZABLE

   @ 10, 165 GET oGet VAR cSeek SIZE 280,24 PIXEL OF oDlg

   @ 60,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE oDbf COLUMNS aCols ;
      AUTOSORT ;
      NOBORDER CELL LINES

        oBrw:aCols[ 3 ]:cSortOrder := ""   //no street
        oBrw:aCols[ 6 ]:cSortOrder := ""  // no zip

   WITH OBJECT oBrw


      :RecSelShowRecNo()
      :bClrStd          := { || { CLR_BLACK, If( oBrw:SelectRow(), 0x88EDFB, CLR_WHITE ) } }
      :nRecSelColor     :=   nRgb( 245,244,234)
      :lIncrFilter   := .t.
      :bOnSort       := { |b,oCol| oBrw:Seek( "" ), ;
                             oBrw:cFilterFld := oCol:cExpr, ;
                             oBrw:SetFocus() }
      //
       :SetMultiSelectCol()
       :oSeek := oGet
      :CreateFromCode()
   END



   @ 10, 20 COMBOBOX oBrw:oSortCbx VAR oBrw:cSortOrder  SIZE 100,400 PIXEL OF oDlg


   ACTIVATE DIALOG oDlg CENTERED

   oDbf:Close()

   return nil
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: FWH 2103: XBrowse: oSortCbx
Posted: Wed Jun 09, 2021 10:31 AM
Marc Venken wrote:
Silvio.Falconi wrote:
I make a test "all together" ( csortbox, search,multisel)


Sylvio, I wanted to make some test on this sample... Is it available ?


can use the last sample I publish before of this message
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: FWH 2103: XBrowse: oSortCbx
Posted: Fri Jun 11, 2021 07:39 AM
Nages,
with this procedure I can see the logins of the users in the application.
As you told me to limit the index of some columns I put
cSorBox: = ""
Everything works except that when I press on the third column (time field) it doesn't index me but still displays the indexing arrow, while in the fourth column (process field) it doesn't index me but doesn't display the indexing arrow.



the test

Code (fw): Select all Collapse
Function USR200()

 local cHelp
 local oDlgMon,oBar
 local oGrid
 local oDTab,nRec
 local aCols
 local cSeek:=Space(100)
 local oGet
 local oFont,oBold

 HelpSetTopic("Monitor del Sistema")


 oDTab:=TTabAct():New()
 nRec:=oDTab:Lastrec()
 oDTab:SetOrder(1)

  aCols  := { ;
                { "USUARIO"     , "Utente",,      120},;
                { "FECHA"       , "Data"   ,,     120 },;
                { "HORA"        , "Ora",,         120 },;
                { "ACCION"      , "Processo",,    200 }}

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE FONT oBold NAME "TAHOMA" SIZE 0,-14 BOLD


   DEFINE DIALOG oDlgMon SIZE 880,600 ;
      PIXEL TRUEPIXEL RESIZABLE FONT oFont;
      TITLE "Monitor del Sistema"

   @ 10, 165 GET oGet VAR cSeek SIZE 280,24 PIXEL OF oDlgMon

         @ 40,20 XBROWSE oGrid SIZE -20,-20 PIXEL OF oDlgMon ;
      DATASOURCE oDTab COLUMNS aCols ;
      AUTOSORT ;
      NOBORDER CELL LINES

    
       WITH OBJECT oGrid
                :aCols[ 3 ]:cSortOrder := ""
                :aCols[ 4 ]:cSortOrder := ""
    
      :bClrStd          := { || { CLR_BLACK, If( oGrid:SelectRow(), 0x88EDFB, CLR_WHITE ) } }
      :nRecSelColor     :=   nRgb( 245,244,234)
      :lIncrFilter   := .t.
      :bOnSort       := { |b,oCol| oGrid:Seek( "" ), ;
                             oGrid:cFilterFld := oCol:cExpr, ;
                             oGrid:SetFocus() }
      //
      * :SetMultiSelectCol()
       :oSeek := oGet
      :CreateFromCode()
   END

     @ 10, 20 COMBOBOX oGrid:oSortCbx VAR oGrid:cSortOrder  SIZE 100,400 PIXEL OF oDlgMon


   ACTIVATE DIALOG oDlgMon CENTERED

  RETURN (NIL)



can you remove the indexing arrow in the third column?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH 2103: XBrowse: oSortCbx
Posted: Sun Jun 13, 2021 10:16 PM
Sorry, please try this:
Code (fw): Select all Collapse
       :aCols[ 3 ]:cSortOrder := nil
      :aCols[ 4 ]:cSortOrder := nil
Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: FWH 2103: XBrowse: oSortCbx
Posted: Mon Jun 14, 2021 07:00 AM
nageswaragunupudi wrote:Sorry, please try this:
Code (fw): Select all Collapse
       :aCols[ 3 ]:cSortOrder := nil
      :aCols[ 4 ]:cSortOrder := nil


run ok thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion