nageswaragunupudi wrote:As requested by many users, it is now possible to have Gets under header of each (or selected) columns and use the values entered either for filtering or for any other purpose by the programmer.
Sample screen-shot:
Programmer can toggle display of the bar showing the Gets.
Programmer can decide which columns need to have the Gets.
Specifying is as simple as one line of code:
Example:
oCol:uBarGetVal := Space(10)
This statement creates a Get to be displayed under the header.
nageswaragunupudi wrote:As requested by many users, it is now possible to have Gets under header of each (or selected) columns and use the values entered either for filtering or for any other purpose by the programmer.
Sample screen-shot:
Programmer can toggle display of the bar showing the Gets.
Programmer can decide which columns need to have the Gets.
Specifying is as simple as one line of code:
Example:
oCol:uBarGetVal := Space(10)
This statement creates a Get to be displayed under the header.
Una duda, sera solo GETs o cualquier control de manejo de datos.? checkbox, combobox...?
algo como una pequeña button bar
nageswaragunupudi wrote:Una duda, sera solo GETs o cualquier control de manejo de datos.? checkbox, combobox...?
Only Gets in this release.
But we keep improving based on what most users require and suggest.algo como una pequeña button bar
1. In this version, we provided a drop-down menu when user clicks on RecSel Header.
2. We were actively considering a mini buttonbar within xbrowse. But we wanted to know how many users would consider it useful in addition to buttonbar in the window/dialog
nageswaragunupudi wrote:Mr joseluisysturiz
Thanks for the explanation. This is my personal view too. Let us see how many other users also consider it useful.
We shall provide a mini buttonbar also. May not be in this release 16.04 but in the next release.
#include "fivewin.ch"
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function Main()
SET DATE ITALIAN
SET CENTURY ON
SET DELETED ON
RDDSETDEFAULT( "DBFCDX" )
SetGetColorFocus()
Sample1()
return nil
//----------------------------------------------------------------------------//
static function Sample1()
local oDlg, oBrw, oFont, oBold
local n
USE CUSTOMER NEW SHARED
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-12
DEFINE FONT oBold NAME "TAHOMA" SIZE 0,-12 BOLD
DEFINE DIALOG oDlg SIZE 800,500 PIXEL TRUEPIXEL ;
FONT oFont TITLE FWVERSION + " : Bar Get"
@ 110,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE "CUSTOMER" AUTOCOLS CELL LINES NOBORDER
// Relevant Code
for n := 1 to Len( oBrw:aCols )
WITH OBJECT oBrw:aCols[ n ]
if FieldType( n ) != 'L'
:uBarGetVal := uValBlank( fieldGet( n ) )
if FieldType( n ) == 'N'
:cBarGetPic := NumPict( FieldLen( n ), FieldDec( n ) )
endif
endif
END
next
oBrw:lGetBar := .t.
// End of Relevant Code
WITH OBJECT oBrw
:nHeaderHeight := 40 // optional
:oHeaderFonts := oBold
:bClrEdits := { || { CLR_BLACK, CLR_YELLOW } }
:AutoFit()
//
:CreateFromCode()
END
@ 10,20 SAY "Gets under Headers. Entered values can be used" + ;
"for filtering or any othe purpose" + CRLF + ;
"Usage: oCol:uBarGetVal := Space( 10 ); oBrw:lGetBar := .t." ;
SIZE oDlg:nWidth - 40,40 PIXEL OF oDlg CENTER
@ 60, 20 BTNBMP PROMPT { || If( oBrw:lGetBar, "Hide GetBar", "ShowGetBar" ) } ;
SIZE 100,40 PIXEL OF oDlg FLAT ;
ACTION ( oBrw:lGetBar := ! oBrw:lGetBar, oBrw:Refresh() )
@ 60,140 BTNBMP PROMPT "Set Filter" ;
SIZE 100,40 PIXEL OF oDlg FLAT ;
ACTION ( oBrw:cAlias )->( SetFilter( oBrw ) )
@ 60,250 BTNBMP PROMPT "Clear Filter" ;
SIZE 100,40 PIXEL OF oDlg FLAT ;
ACTION ( oBrw:cAlias )->( DBCLEARFILTER(), oBrw:Refresh(), oBrw:SetFocus() )
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont, oBold
return nil
//----------------------------------------------------------------------------//
static function SetFilter( oBrw )
local cFilter := ""
local n, oCol, uVal, cType
for n := 1 to Len( oBrw:aCols )
oCol := oBrw:aCols[ n ]
if ! Empty( uVal := oCol:uBarGetVal )
if !Empty( cFilter )
cFilter += " .AND. "
endif
cType := ValType( uVal )
do case
case cType == 'C'
uVal := Upper( AllTrim( uVal ) )
cFilter += '"' + uVal + '" $ UPPER( ' + FieldName( n ) + " )"
otherwise
cFilter += FieldName( n ) + " == " + cValToChar( uVal )
endcase
endif
next
if Empty( cFilter )
if ! Empty( DBFILTER() )
DBCLEARFILTER()
oBrw:Refresh()
endif
else
if !( DBFILTER() == cFilter )
SET FILTER TO &cFilter
GO TOP
oBrw:Refresh()
endif
endif
oBrw:SetFocus()
return nil
//----------------------------------------------------------------------------//
HunterEC wrote:Rao:
G R E A T J O B ! ! !
A buttonbar on xBrowse it's a very welcome feature, it will save us from having buttons on a dialog/window to control the browse.
You're an xBrowse GURU !!!
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 98 guests