scrollpanel not refresh the bar

scrollpanel not refresh the bar

Postby Silvio.Falconi » Fri Dec 21, 2018 9:16 am

I insert on a Scroll panel btnbmp control as records
the scroll bar not run as you can see on this picture


Image


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


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
//----------------------------------------------------------------------------------------------------//
 
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6897
Joined: Thu Oct 18, 2012 7:17 pm

Re: scrollpanel not refresh the bar

Postby Silvio.Falconi » Fri Dec 21, 2018 5:39 pm

if I add setrange then lose the btnbmp I added. not run ok
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6897
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 27 guests