at first I don't see the buttonbar
when I scroll through the records I see a flickering effect that is, the display is not linear and clean when I scroll through all the records
is there a solution to improve the visualization?
Thank you
Test (work in progress)
- Code: Select all Expand view
#include "fivewin.ch"
#include "ttitle.ch"
request dbfcdx
request dbffpt
Function test()
Local oTabella,oFolder,oBrw
Local oFont,oBold
local oBtnClose,oBtnNew
Local nSplit:= 250
Local oTitle
Local oBar,oBut[5]
USE CUSTOMER NEW SHARED VIA "DBFCDX"
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE FONT oBold NAME "TAHOMA" SIZE 0,-14 BOLD
DEFINE DIALOG oTabella SIZE 880,600 ;
PIXEL TRUEPIXEL RESIZABLE FONT oFont;
TITLE "Test customer "
@ 0000,0000 TITLE oTitle OF oTabella SIZE 1025,0059 NOBORDER //PIXEL
oTitle:aGrdBack := {{1,nRgb(89,167,229),nRgb(89,167,229)}}
oTitle:nShadow := 0
@ 0010,0020 TITLEIMG OF oTitle BITMAP "contatti.bmp" SIZE 0052,0052
@ 0015,0120 TITLETEXT OF oTitle TEXT "Agenda Telefonica" COLOR nRGB(255,255,255)
@ 0040,0120 TITLETEXT OF oTitle TEXT "CONTATTI" COLOR nRGB(000,000,000)
DEFINE BUTTONBAR oBar OF oTabella 2015 SIZE 92,44 BOTTOM
@ 20,10 XBROWSE oBrw SIZE -nSplit,oBar:ntop PIXEL OF oTabella ;
DATASOURCE "CUSTOMER" AUTOCOLS CELL LINES NOBORDER
oBrw:lColDividerComplete := .f.
oBrw:lRecordSelector := .f.
oBrw:nColDividerStyle := LINESTYLE_LIGHTGRAY
oBrw:nHeaderHeight := 24
oBrw:nRowHeight := 20
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLWIN7 // MARQSTYLE_SOLIDCELL
oBrw:nRowDividerStyle := LINESTYLE_NOLINES
WITH OBJECT oBrw
:nEditTypes := EDIT_GET
:SetChecks()
:bChange := { || (Record_Show(oFolder)) }
//
:CreateFromCode()
END
oBrw:SetStyle( 2015 )
XbrSetupBar( oBrw )
@ 20, 0 FOLDER oFolder OF oTabella SIZE 100,100 PIXEL ;
PROMPT "General","Details"
/* @ oTabella:nBottom - 40,oTabella:nWidth-120 BUTTONBMP oBtnClose;
RESOURCE "bitmaps\exit.png" ;
PROMPT " Chiudi" SIZE 90,30 PIXEL OF oTabella;
TEXTRIGHT FONT oBold ;
ACTION ( oTabella:end( IDOK ) )
*/
// this buttons are created from left to right
DEFINE BUTTON oBut[1] OF oBar PROMPT "Stampa" LEFT FILENAME ".\BITMAPS\STAMPA.BMP"
DEFINE BUTTON oBut[2] OF oBar PROMPT "Etichette" LEFT FILENAME ".\BITMAPS\ETI.BMP"
DEFINE BUTTON oBut[3] OF oBar PROMPT "Allegati" LEFT FILENAME ".\BITMAPS\ALLEGA.BMP"
DEFINE BUTTON oBut[4] OF oBar PROMPT "Rit.Acconto" LEFT FILENAME ".\BITMAPS\RIT.BMP"
DEFINE BUTTON oBut[5] OF oBar PROMPT "Includi doc. " LEFT FILENAME ".\BITMAPS\GENERA.BMP" GROUP
* oBrw:nHeight:= oRect:nBottom - 80 - oBar:nHeight
oTabella:bResized := <||
local oRect := oTabella:GetCliRect()
oBrw:nTop:= oTitle:nBottom+5
oBrw:nBottom:= oBar:nTop
oBrw:refresh()
oFolder:nTop:= oTitle:nBottom+5
oFolder:nLeft := oRect:nRight - nSplit +2
oFolder:nwidth := oRect:nRight-60
oFolder:nHeight := oRect:nBottom - 80 - oBar:nHeight
oFolder:refresh()
Record_Show(oFolder)
oBar:refresh()
RETURN nil
>
ACTIVATE DIALOG oTabella CENTERED ;
on INIT eval(oTabella:bResized)
RELEASE FONT oFont,oBold
return nil
//--------------------------------------------//
Function Record_Show(oPanelLeft)
Local oFont2,oBold2
Local nRow:= 12
DEFINE FONT oFont2 NAME "TAHOMA" SIZE 0,-12
DEFINE FONT oBold2 NAME "TAHOMA" SIZE 0,-12 BOLD
nRow+=10
@ nRow,10 say "Firstname " size 80,18 PIXEL of oPanelLeft:adialogs[1] font oBold2
nRow+=20
@ nRow,10 GET CUSTOMER->FIRST size 200,20 PIXEL of oPanelLeft:adialogs[1] FONT oFont2
nRow+=30
@ nRow,10 say "Lastname" size 80,18 PIXEL of oPanelLeft:adialogs[1] font oBold2
nRow+=20
@ nRow,10 GET CUSTOMER->LAST size 200,20 PIXEL of oPanelLeft:adialogs[1] FONT oFont2
nRow+=30
@ nRow,10 say "Street " size 80,18 PIXEL of oPanelLeft:adialogs[1] font oBold2
nRow+=20
@ nRow,10 GET CUSTOMER->STREET size 200,20 PIXEL of oPanelLeft:adialogs[1] FONT oFont2
nRow+=30
@ nRow,10 say "City " size 80,18 PIXEL of oPanelLeft:adialogs[1] font oBold2
nRow+=20
@ nRow,10 GET CUSTOMER->CITY size 200,20 PIXEL of oPanelLeft:adialogs[1] FONT oFont2
nRow+=30
@ nRow,10 say "State " size 80,18 PIXEL of oPanelLeft:adialogs[1] font oBold2
nRow+=20
@ nRow,10 GET CUSTOMER->STATE size 20,20 PIXEL of oPanelLeft:adialogs[1] FONT oFont2
nRow+=30
@ nRow,10 say "Zip " size 80,18 PIXEL of oPanelLeft:adialogs[1] font oBold2
nRow+=20
@ nRow,10 GET CUSTOMER->ZIP size 60,20 PIXEL of oPanelLeft:adialogs[1] FONT oFont2
nRow+=30
@ nRow,10 say "Notes " size 80,18 PIXEL of oPanelLeft:adialogs[1] font oBold2
nRow+=20
@ nRow,10 GET CUSTOMER->NOTES size 200,120 PIXEL of oPanelLeft:adialogs[1] FONT oFont2
return nil
function XbrSetupBar( oBrw )
oBrw:nTopBarHeight := 30
oBrw:bOnAdjust := <||
local oBtn
@ 05,05 BTNBMP oBtn FILE "c:\work\fwh\bitmaps\16X16\new.bmp" SIZE 30,20 PIXEL OF oBrw NOBORDER ;
ACTION oBrw:EditSource( .t. ) TOOLTIP "Add New Record"
@ 05,45 BTNBMP oBtn FILE "c:\work\fwh\bitmaps\edit.bmp" SIZE 30,20 PIXEL OF oBrw NOBORDER ;
ACTION oBrw:EditSource() TOOLTIP "Edit this record"
@ 05,85 BTNBMP oBtn FILE "c:\work\fwh\bitmaps\16x16\delete.bmp" SIZE 30,20 PIXEL OF oBrw NOBORDER ;
ACTION If( MsgNoYes( "Delete this row?" ),,oBrw:Delete() ) TOOLTIP "Delete This Record"
return nil
>
return nil
FUNCTION Ut_BrwRowConfig7( oBrw )
oBrw:nRowSel := 1
oBrw:nColSel := 1
oBrw:nColOffset := 1
oBrw:nFreeze := 0
oBrw:nCaptured := 0
oBrw:nLastEditCol := 0
oBrw:l2007 := .f.
oBrw:lMultiselect := .f.
oBrw:lTransparent := .f.
oBrw:nStyle -= WS_BORDER
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLWIN7
oBrw:nStretchCol := -1 // STRETCHCOL_LAST
oBrw:bClrStd := {|| { CLR_BLACK, CLR_WHITE } }
oBrw:lColDividerComplete := .t.
oBrw:lRecordSelector := .t.
oBrw:nColDividerStyle := LINESTYLE_LIGHTGRAY
oBrw:nHeaderHeight := 24
oBrw:nRowHeight := 20
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLWIN7 // MARQSTYLE_SOLIDCELL
oBrw:nRowDividerStyle := LINESTYLE_NOLINES
oBrw:lExcelCellWise := .f.
RETURN nil