Xbrowse enhancemend for colums setup/use

Xbrowse enhancemend for colums setup/use

Postby Marc Venken » Wed Feb 17, 2021 11:10 am

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 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1426
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse enhancemend for colums setup/use

Postby nageswaragunupudi » Wed Feb 17, 2021 4:57 pm

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
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse enhancemend for colums setup/use

Postby Marc Venken » Wed Feb 17, 2021 9:46 pm

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 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1426
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse enhancemend for colums setup/use

Postby Silvio.Falconi » Thu Feb 18, 2021 11:15 pm

>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  Expand view


   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


 
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Re: Xbrowse enhancemend for colums setup/use

Postby Marc Venken » Wed Feb 24, 2021 7:52 am

FW-Team, maybe this can be inserted in the official FW ?
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1426
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse enhancemend for colums setup/use

Postby nageswaragunupudi » Wed Feb 24, 2021 10:35 am

We are looking into the suggestions.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse enhancemend for colums setup/use

Postby Silvio.Falconi » Wed Feb 24, 2021 10:54 am

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/viewtopic.php?f=3&t=31570&p=184292&hilit=SetUserCols#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  Expand view


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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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: 7048
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 93 guests