Page 1 of 1

Panelscroll

Posted: Wed May 09, 2018 11:57 am
by Silvio.Falconi
It is possible use a panelscroll to scroll bntmp buttons ?
a small sample please thanks


I tried but it make error

oScroll:= TScrollPanel():New( 10, 10, 90, oFld:nwidth-50, oFld:aDialogs[1], .f. )



activte dialog odlg;
on init BuildServizi(oScroll)


Function BuildServizi(oScroll)
Local nRow:= 10
Local nCol:= 10
Local oBtn:=array(10)

For n=1 to 10

@ nRow,ncol BTNBMP oBtn[n] ;
FILENAME ".\bitmaps\Lettino.bmp" ;
SIZE 170, 60 PIXEL;
ACTION NIL FLAT ;
PROMPT "Lettino"+CRLF+ "5.00" LEFT;
OF oScroll ;
TOOLTIP "fai click per aggiungere un servizio" ;
COLOR CLR_RED,CLR_WHITE
ncol+=175
IF n=5
nRow+=65
nCol:=10
endif


Next

return nil


Image





when I click on vertical scroll make this error

Error

Code: Select all | Expand

Error description: Error BASE/1004  No exported method: NTOP
   Args:
     [   1] = U  

Stack Calls
===========
   Called from:  => NTOP( 0 )
   Called from: .\source\classes\SCRLPANL.PRG => TSCROLLPANEL:GODOWN( 257 )
   Called from: .\source\classes\SCRLPANL.PRG => (b)TSCROLLPANEL( 88 )
   Called from: .\source\classes\SCRLPANL.PRG => TSCROLLPANEL:MOUSEMOVE( 0 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\CONTROL.PRG => TSCROLLPANEL:HANDLEEVENT( 1731 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3356 )
   Called from:  => DIALOGBOXINDIRECT( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
   Called from: test.prg => SHOWINVOICE( 248 )
   Called from: test.prg => MAIN( 24 )

Re: Panelscroll

Posted: Thu May 10, 2018 5:47 am
by Silvio.Falconi
any solution ?

Re: Panelscroll

Posted: Thu May 10, 2018 9:49 am
by cnavarro
Try with this

Code: Select all | Expand


#include "fivewin.ch"

Function Main()

Local oPanel,oBrush,oWnd

   //DEFINE BRUSH oBrush FILENAME "..\bitmaps\backgrnd\clouds.bmp"
   DEFINE DIALOG oWnd SIZE 800, 600 PIXEL


   ACTIVATE DIALOG oWnd CENTERED ON INIT ( oPanel := CreaPnel( oWnd, oBrush ), oPanel:SetRange() )
   //RELEASE BRUSH oBrush

Return nil
 
Function CreaPnel( oWnd, oBrush )

Local oPanel
local n
Local nRow:= 10
Local nCol:= 10
Local oBtn:=array(12)

   oPanel:= TScrollPanel():New(40,2,178,570,oWnd, .t.)

For n=1 to 12

@ nRow, ncol BTNBMP oBtn[n] ;
FILENAME "..\bitmaps\newitem.bmp" ;
SIZE 170, 60 PIXEL ;
ACTION NIL FLAT ;
PROMPT "Lettino"+CRLF+ "5.00" LEFT;
OF oPanel ;
TOOLTIP "fai click per aggiungere un servizio" ;
COLOR CLR_RED,CLR_WHITE
ncol+=175
IF n=3 .or. n=6 .or. n=9
nRow+=65
nCol:=10
endif

Next

Return oPanel


 

Re: Panelscroll

Posted: Thu May 10, 2018 11:36 am
by Silvio.Falconi
Now run ok
THANKS
I can use this also for my bus application