#include 'fivewin.ch'
#include 'xbrowse.ch'
#include 'constant.ch'
#define DLG_nColorDlg RGB(245,245,235)
#define DLG_nColortitle1 RGB(219,230,244)
#define DLG_nColortitle2 RGB(207,221,239)
#define DLG_nColorBar1 RGB(250,250,245)
#define DLG_nColorBar2 RGB(245,245,235)
#define DLG_nColorBtn1 RGB(245,245,235)
#define DLG_nColorBtn2 RGB(250,250,245)
#define DLG_nColorBtnB RGB(195,195,185)
REQUEST DBFCDX
Function test()
local oDlg, oBrw, oFont,oBold, oList,oBrush
local nBottom:= 32.4
local nRight := 95
local nHt := nBottom * DLG_CHARPIX_H
local nWd := Max( nRight * DLG_CHARPIX_W, 180 )
local aCols := { ;
{ "FIRST", "First" ,, 80, },;
{ "LAST", "Last",, 80, },;
{ "STREET", "Address" ,, 100, },;
{ "CITY", "City" ,, 90, } }
local oSayfiltro
local oCbx1,lmarried:=.f.
local oCbx2,lAge:=.f.
local nMarried,oCbx3
local nRow:= 400,nCol:= 10
local nInterlinea := 20
oList:=TCustomer():New()
oList:setorder(1)
oList:Gotop()
oFont := TFont():New( "TAHOMA", 0, 14,, )
oBold := TFont():New( "TAHOMA", 0, 14,,.t. )
DEFINE BRUSH oBrush STYLE BDIAGONAL COLOR Rgb(195,195,185)
DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL TRUEPIXEL;
FONT oFont COLOR CLR_BLACK, RGB(245,245,235) ;
STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
WS_MINIMIZEBOX)
@ 40,10 XBROWSE oBrw SIZE -10,-100 PIXEL OF oDlg ;
DATASOURCE oList COLUMNS aCols ;
AUTOSORT FONT oFont;
NOBORDER CELL LINES
MyStyleBrowse(oBrw,oBrush)
WITH OBJECT oBrw
:nMarqueeStyle = MARQSTYLE_HIGHLWIN7
:CreateFromCode()
END
@ nRow,5 Say oSayfiltro Prompt "Filter by " size 100,20 PIXEL of odlg TRANSPARENT
@ nRow, 125 CHECKBOX oCbx1 VAR lmarried ;
PROMPT "Married" OF oDlg SIZE 80,15 PIXEL ;
ON CHANGE changeBrw(oBrw,lmarried)
@ nRow, 250 CHECKBOX oCbx2 VAR lAge ;
PROMPT "Age" OF oDlg SIZE 100,15 PIXEL
nRow-=30
@ nRow,5 Say oSayfiltro Prompt "Married : " size 80,20 PIXEL of odlg TRANSPARENT
@ nRow, 120 RADIO oCbx3 VAR nMarried ITEMS "Married" _3D SIZE 55, 25 PIXEL OF oDlg WHEN lmarried
@ nRow, 300 RADIOITEM "Not Married" RADIOMENU oCbx3 OF oDlg SIZE 110, 14 PIXEL WHEN lmarried
nRow-=30
@ nRow,5 Say oSayfiltro Prompt "Age : " size 80,20 PIXEL of odlg TRANSPARENT
@ nRow, 120 RADIO oCbx3 VAR nMarried ITEMS "20" _3D SIZE 55, 25 PIXEL OF oDlg WHEN lAge
@ nRow, 300 RADIOITEM "over 50" RADIOMENU oCbx3 OF oDlg SIZE 110, 14 PIXEL WHEN lAge
*/
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
//----------------------------------------------------------------//
Static function changeBrw(oBrw,lmarried)
IF lmarried
oBrw:nHeight -= 40
else
oBrw:nHeight += 40
endif
oBrw:refresh()
return nil
//----------------------------------------------------------------//
Function Formato_Cod_conto(oList)
local cString:=""
If !empty(oList:codconto1)
cString+=alltrim(oList:codconto1)
Endif
If !empty(oList:codconto2)
cString+="."+alltrim(oList:codconto2)
Endif
If !empty(oList:codconto3)
cString+="."+alltrim(oList:codconto3)
Endif
If !empty(oList:codconto4)
cString+="."+alltrim(oList:codconto4)
Endif
If !empty(oList:codconto5)
cString+="."+alltrim(oList:codconto5)
Endif
return ltrim(cString)
Function MyStyleBrowse(oBrw,oBrush)
local nColorHeader := DLG_nColorDlg
local nColorFooter := DLG_nColorDlg
local nColorPigiama := RGB(243,243,238)
WITH OBJECT oBrw
:nRowHeight := 25
:l2007 := .F.
:l2015 := .T.
:lRecordSelector := .F.
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:nRowDividerStyle := LINESTYLE_LIGHTGRAY
:nStretchCol := STRETCHCOL_WIDEST
:nMarqueeStyle := MARQSTYLE_HIGHLROW
:lDisplayZeros := .f.
:lAllowRowSizing := .F.
:lAllowColSwapping := .F.
* :lAllowColHiding := .F.
:lAllowSizings := .F.
:lDrawBorder := .t.
:nClrBorder := CLR_BROWN // Rgb(195,195,185)
:lDrawBorderIn := .F.
:bRecSelHeader := ""
* :bClrSelFocus := { || {,rgb(255,255,224)}}
:bClrRowFocus := { || {, rgb(255,255,224)}}
* :nRecSelColor := nRgb( 245,244,234)
:bClrHeader := {|| { ,nColorHeader } }
:bClrFooter := {|| { ,nColorFooter } }
:bClrStd := { || { CLR_BLACK, If( oBrw:KeyNo % 2 == 0, CLR_WHITE,nColorPigiama ) } }
:oBrushs := { |o| If( o != nil .and. Empty( o:Value ) .and. ;
Empty( XEval( o:bBmpData, o:Value, .t., o ) ) .and. ;
Empty( XEval( o:bStrImage, o, o:oBrw ) ), oBrush, nil ) }
END
return nil
//---------------------------------------------------------------------//
CLASS TXData from TDatabase
DATA cDbfPath init ".\"
ENDCLASS
CLASS TCustomer from TXData
METHOD New()
ENDCLASS
METHOD New( lShared ) CLASS TCustomer
Default lShared := .t.
::super:New(,::cDbfPath + "Customer" ,"DBFCDX", lShared)
if ::use()
::setOrder(1)
::gotop()
endif
RETURN Self