It is possibile Hide some columns of xbrowse at init ?
for a sample I made:
oApp():oGrid := TXBrowse():New( oApp():oDlg )
.. columns...
oApp():SetRDD()
oApp():CreateFromCode()
oApp():aCols[9]:=.t.
and it run at init
then if I use the popup menu at columns

and I wish show the nineth column it show the column "Annotazione esercizio"
but when I press DEFAULT COLUMNS I wish return to state init ( with the oApp():aCols[9]:=.t.)
or if the user select the oApp():aCols[9] on menupopup it must be showed
the setcolumns method of xbrowse
the command
Menuitem "Default Columns" ACTION ( ;
ASort( ::aCols, nil, nil, { |x,y| x:nCreationOrder < y:nCreationorder } ), ;
AEval( ::aCols, { |o| o:lHide := .f. } ), ;
::GetDisplayCols(), ;
::Refresh() )
show all columns and not that columns I set at init
for a sample I made:
oApp():oGrid := TXBrowse():New( oApp():oDlg )
.. columns...
oApp():SetRDD()
oApp():CreateFromCode()
oApp():aCols[9]:=.t.
and it run at init
then if I use the popup menu at columns

and I wish show the nineth column it show the column "Annotazione esercizio"
but when I press DEFAULT COLUMNS I wish return to state init ( with the oApp():aCols[9]:=.t.)
or if the user select the oApp():aCols[9] on menupopup it must be showed
the setcolumns method of xbrowse
METHOD SetColumns( nRow, nCol, nFlags ) CLASS TXBrowse
local oMenu, oCol
local nFor, nLen
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
Menuitem "Default Columns" ACTION ( ;
ASort( ::aCols, nil, nil, { |x,y| x:nCreationOrder < y:nCreationorder } ), ;
AEval( ::aCols, { |o| o:lHide := .f. } ), ;
::GetDisplayCols(), ;
::Refresh() )
separator
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 nilthe command
Menuitem "Default Columns" ACTION ( ;
ASort( ::aCols, nil, nil, { |x,y| x:nCreationOrder < y:nCreationorder } ), ;
AEval( ::aCols, { |o| o:lHide := .f. } ), ;
::GetDisplayCols(), ;
::Refresh() )
show all columns and not that columns I set at init
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
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