FWH 2103: XBrowse: oSortCbx

User avatar
Marc Venken
Posts: 1485
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: FWH 2103: XBrowse: oSortCbx

Post by Marc Venken »

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
User avatar
Silvio.Falconi
Posts: 7170
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 5 times

Re: FWH 2103: XBrowse: oSortCbx

Post by Silvio.Falconi »

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
User avatar
Silvio.Falconi
Posts: 7170
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 5 times

Re: FWH 2103: XBrowse: oSortCbx

Post by Silvio.Falconi »

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
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: FWH 2103: XBrowse: oSortCbx

Post by nageswaragunupudi »

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
User avatar
Silvio.Falconi
Posts: 7170
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 5 times

Re: FWH 2103: XBrowse: oSortCbx

Post by Silvio.Falconi »

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: Select all | Expand


#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
User avatar
Silvio.Falconi
Posts: 7170
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 5 times

Re: FWH 2103: XBrowse: oSortCbx

Post by Silvio.Falconi »

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
User avatar
Silvio.Falconi
Posts: 7170
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 5 times

Re: FWH 2103: XBrowse: oSortCbx

Post by Silvio.Falconi »

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.

Image

the test

Code: Select all | Expand



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
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: FWH 2103: XBrowse: oSortCbx

Post by nageswaragunupudi »

Sorry, please try this:

Code: Select all | Expand

      :aCols[ 3 ]:cSortOrder := nil
      :aCols[ 4 ]:cSortOrder := nil
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 7170
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 5 times

Re: FWH 2103: XBrowse: oSortCbx

Post by Silvio.Falconi »

nageswaragunupudi wrote:Sorry, please try this:

Code: Select all | Expand

      :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
Post Reply