Xbrowse enhancemend for colums setup/use

Post Reply
User avatar
Marc Venken
Posts: 727
Joined: Tue Jun 14, 2016 7:51 am

Xbrowse enhancemend for colums setup/use

Post by Marc Venken »

Using Xbrowse every day and changing colums (mostly view setting) I think that xbrowse would benifid with folowing enhancements

I know and have implemented these options sometimes myselt, but Xbrowse class enhanced would be more efficient i think

In xbrowse we use the RowNo (upper left) to show the rows etc that can be clicked to see all colums.

For hiding/see a colums now we have to click for every change the browse and repeat this...

My suggestion is that we can mark/unmark ALL at once and then change the browwse.

Also a save/open button can be implemented in the popup in order to recall settings of xbrowse.
Marc Venken
Using: FWH 20.08 with Harbour
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Xbrowse enhancemend for colums setup/use

Post by nageswaragunupudi »

In xbrowse we use the RowNo (upper left) to show the rows etc that can be clicked to see all colums.
Will you please explain more clearly?
Regards

G. N. Rao.
Hyderabad, India
User avatar
Marc Venken
Posts: 727
Joined: Tue Jun 14, 2016 7:51 am

Re: Xbrowse enhancemend for colums setup/use

Post by Marc Venken »

nageswaragunupudi wrote:
In xbrowse we use the RowNo (upper left) to show the rows etc that can be clicked to see all colums.
Will you please explain more clearly?
On the left we see standart xbrowse popup of the columns when we rightclick the RowNo in the left upper corner of Xbrowse
If we want to hide a column we click on it and the browse is update and the popup is gone. For the next column to hide we right click again etc...

It would be nice if we could click (select) all columns that we want to hide in one action. The right browse has a function (from you) that is doing just that.

The extra save/restore button would also be a great thing....

To explane way : I use Xbrowse and xbrowser a lot in order to create final browsers and even as a quick DBU. I ofthen delete colums in order to see more others or have a better view. Therefore the save/restore state would be nice in the popup.

Mr. Rao : it is just a idea that speeds up develloping browser screens on the fly... There are functions already in the forum from you, but how easy would it be if they are in the source of xbrowse AND xbrowser...


Image
Marc Venken
Using: FWH 20.08 with Harbour
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Xbrowse enhancemend for colums setup/use

Post by Silvio.Falconi »

>The extra save/restore button would also be a great thing....
I made it many years ago (2014) but it no one seems to like it


release for a oldest xbrowse
sample

:aCols2Hide := {1,2,3,4,5,6,13,14,15,16}
:aDefaultCols := {1,2,3,4,5,6,13,14,15,16}
oGrid:aDefaultCols :=oGrid:GetDisplayCols()
oGrid:SetUserCols()

Code: Select all


   DATA aCols2Hide AS ARRAY INIT Array(0)
   DATA aDefaultCols  INIT ARRAY( 0 )
   DATA aPreviousCols INIT ARRAY( 0 )

METHOD SetUserCols(lDefCols)

METHOD SetColumns( nRow, nCol, nFlags ) CLASS TXBrowse

   local oMenu, oCol
   local nFor, nLen

   local aCols, lDefCols
   local bPrevCols := {|| ::aPreviousCols := ::GetDisplayCols() }
   local bUserCols := {|| aCols := if(lDefCols, ::aDefaultCols, ::aPreviousCols ) ,;
                          if( Len( aCols ) != 0, AEval( ::aCols, { |o| If( AScan( aCols, o:nCreationOrder ) > 0, o:Show(),o:Hide() ) } ) ,)}

   nLen := Len( ::aCols )

   MENU oMenu POPUP
      if ::l2007
         if WndMain() != nil .and. WndMain():oMenu != nil .and. WndMain():oMenu:l2010
            oMenu:l2010    := .t.
         else
            oMenu:l2007    := .t.
         endif
      endif


      if Len( ::aDefaultCols ) != 0
         Menuitem "Settings Default"   ACTION ( Eval( bPrevCols ), lDefCols:=.t., Eval( bUserCols ), ::Refresh() )
         Menuitem "All columns"       ACTION ( Eval( bPrevCols ), AEval( ::aCols, { |o| o:lHide := .f. } ) , ::Refresh() )
         Menuitem "Previous Columns"  ACTION ( lDefCols:=.f., Eval( bUserCols ), ::Refresh() )
         SEPARATOR
      endif


      for nFor := 1 to nLen
         oCol := ::aCols[ nFor ]
         MenuAddItem( oCol:cHeader, , !oCol:lHide, ;
            ( Len(::aDisplay) != 1 .or. oCol:nPos != 1 ), ;
            GenMenuBlock( ::aCols, nFor ) )
      next
   ENDMENU

   ACTIVATE POPUP oMenu AT nRow, nCol OF Self

return nil


METHOD SetUserCols(lDefCols)  CLASS TXBrowse               
local aCols
DEFAULT lDefCols := .t.
aCols := if(lDefCols, ::aDefaultCols, ::aPreviousCols )
if Len( aCols ) != 0
   AEval( ::aCols, { |o| If( AScan( aCols, o:nCreationOrder ) > 0, o:Show(),o:Hide() ) } )
endif
Return nil


 
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Marc Venken
Posts: 727
Joined: Tue Jun 14, 2016 7:51 am

Re: Xbrowse enhancemend for colums setup/use

Post by Marc Venken »

FW-Team, maybe this can be inserted in the official FW ?
Marc Venken
Using: FWH 20.08 with Harbour
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Xbrowse enhancemend for colums setup/use

Post by nageswaragunupudi »

We are looking into the suggestions.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Xbrowse enhancemend for colums setup/use

Post by Silvio.Falconi »

Marc Venken wrote:FW-Team, maybe this can be inserted in the official FW ?
nageswaragunupudi wrote:We are looking into the suggestions.

I want to clarify that the idea was mine the first implementation of the code was mine as you can see
on this topic http://forums.fivetechsupport.com/viewt ... ls#p184070

and that the final implementation of the code was created by FranciscoA

Francisco J. Alegría P.
Chinandega, Nicaragua.

on this topic there is also a suggestion of Nages

this is the final test ( with Implementation on the xbrowse )

Code: Select all


REQUEST DBFCDX
//----------------------//  con xbrowse modificado method setcolumns()
FUNCTION ColsHideShow()
local oDlg, oBrw, oFont
local cIniFile:=".\customer.ini"
local cState := GetPvProfString("Browse", "CUSTstate","", cIniFile)

  USE customer NEW SHARED ALIAS "CUST" VIA "DBFCDX"

  DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-12
  DEFINE DIALOG oDlg SIZE 800,400 PIXEL TITLE "Hide-Show Columns in xBrowse" FONT oFont

  XbrNumFormat( 'A', .t. )

  @ 10,10 XBROWSE oBrw ;
          COLUMNS "First", "Age", "Salary", "Street", "City", "State" ;
          SIZE -10,-10 PIXEL ;
          OF oDlg ;
          ALIAS "CUST" ;
          CELL LINES AUTOSORT NOBORDER FOOTERS

  WITH OBJECT oBrw
      :RestoreState( cState )
      :aDefaultCols := oBrw:GetDisplayCols()
      :CreateFromCode()
  END

  ACTIVATE DIALOG oDlg CENTERED
   
     WritePProString("Browse","CUSTstate",oBrw:SaveState(),cIniFile)
     CUST->(dbCloseArea())
     RELEASE FONT oFont
RETURN NIL
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply