the scroll bar not run as you can see on this picture
When I inizialize the Panel Scroll I insert a "fake" small btnbmp (size 1,1)
because the scrollpanel class return me an error on setrange method
I hope someone can help me
I made a small test to explain what not run
- Code: Select all Expand view RUN
Static aData
Static nRow,nCol
Function Main()
Local oDlg,oFont
Local oPanelInvoice
aData:= {}
nNumber:=0
nRow := 20
nCol := 20
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-12
DEFINE DIALOG oDlg SIZE 700,400 PIXEL TRUEPIXEL FONT oFont
@ oDlg:nbottom-40,10 BUTTON "Add Element" SIZE 82,18 PIXEL of oDlg ACTION Add_Element(oPanelInvoice,oFont)
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT (oPanelInvoice:=Create_Panel_Invoice(oDlg,oFont),;
oPanelInvoice:refresh(),;
oPanelInvoice:CheckResize())
return nil
//---------------------------------------------------------------//
Function Add_Element(oPanelInvoice,oFont)
//Insert new Element
nNumber++
AaDd(adata,{nNumber} )
Insert_Element(oPanelInvoice,1,oFont,nNumber)
return nil
//----------------------------------------------------------------------------//
Function Create_Panel_Invoice(oDlg,oFont)
local oPanel
local aGrad := { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } }
oDlg:aMinMaxInfo := { nil, nil, nil, nil, 878, 570, nil, nil } //878, 570
oPanel := TScrollPanel():New( 0,010,180,550,oDlg, .t. )
oPanel:nRightMargin := 10
oPanel:nBottomMargin := 60
oPanel:WinStyle(WS_BORDER, .t.)
Insertline(oPanel) // button fake
oPanel:SetRange()
return oPanel
//----------------------------------------------------------------//
Function Insertline(oDlg)
Local oBtnLine
Local nRow:=1
Local nCol:=1
@ nRow,nCol BTNBMP oBtnLine ;
PROMPT " " ;
SIZE 1, 1 PIXEL OF oDlg FLAT
oBtnLine:end()
return nil
//------------------------------------------------------------//
I insert btnbmp controls into a scrollpanel pressin "add element" button
the scrollBar not run good
At init when I draw the Panel Scroll I insert a "fake" small btnbmp ( size 1,1) and then destroy it
because the scrollpanel give me an error of setrange() method
[img]https://i.postimg.cc/VLDfY9TM/ff.jpg[/img]
[code][/code]
function Insert_Element(oDlg,nTypeE,oFont,nNumber)
local oBtn, oBold
local n
//info element
local nPrice:= 30
Local cDesc:="record"+str(nNumber)
Local fromdate := date()
Local todate := date()
Local ggiorni:= " 1 gg"
nHeigh:= 120
nSpaceh:= 2
nLen := Len(adata)
IF nLen = 1
nRow := 20
Endif
If nLen >1
nrow += 120+ nSpaceh
endif
DEFINE FONT oBold NAME "TAHOMA" SIZE 0,-14 BOLD
@ nRow,nCol BTNBMP oBtn ;
PROMPT cDesc + CRLF+ CRLF+;
SPACE(20)+ dtoc(fromdate)+ CRLF +CRLF +;
SPACE(20)+ dtoc(todate)+ " " ;
SIZE 640, nHeigh PIXEL OF oDlg FLAT RIGHT ;
TOOLTIP "fai click per aggiungere un servizio" ;
COLOR CLR_CYAN,CLR_WHITE
oBtn:oFontBold := oBold // <-- NOTE RGB( 225, 225, 225 )
oBtn:nClrBorder := { || (IIF(oBtn:lMOver,CLR_BLUE,CLR_RED)) }
oBtn:bClrGrad := { | lInvert | If( ! lInvert,;
{ { 1, CLR_WHITE, CLR_WHITE } },;
{ { 1, RGB( 229,241,251 ), RGB( 229,241,251 ) } } ) }
RELEASE FONT oFont, oBold
return nil
//----------------------------------------------------------------------------------------------------//