scroll Horizontal button

scroll Horizontal button

Postby Silvio.Falconi » Thu Feb 15, 2018 6:06 pm

How scroll buttons on Horizontal ?
I think to scroll buttons from a dbf to use it on tablet
sample : I have many products and I wish scroll all images on horizontal and click on each
any test?
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: 6716
Joined: Thu Oct 18, 2012 7:17 pm

Re: scroll Horizontal button

Postby Antonio Linares » Thu Feb 15, 2018 7:23 pm

Please post a screenshot :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41205
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: scroll Horizontal button

Postby Silvio.Falconi » Fri Feb 16, 2018 9:27 am

I do not have an image to show you,
I need to create on tablet app buttons from an archive dbf with an animation that slide to the left and the new ones scroll from the right ...
the user can select one scrooling all archive them with your finger and click one on it (action)

I found now a image
Image
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: 6716
Joined: Thu Oct 18, 2012 7:17 pm

Re: scroll Horizontal button

Postby Silvio.Falconi » Fri Feb 16, 2018 6:07 pm

i made a test but I not Know How move the buttons Imagine to use a finger and move the buttons on right and left

Image



Code: Select all  Expand view

#INCLUDE "Fivewin.ch"
#INCLUDE "Ribbon.ch"
#include "constant.ch"

Function test()

   Local oDlg,oFld
   Local oFontTablet

 // variabili per la dialog
    Local  nBottom   := 13
    Local  nRight    := 78
    Local  nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
    Local  nHeight := nBottom * DLG_CHARPIX_H
    LOCAL nRow:= 10
    Local nCol:= 10
    Local n:= 1
    local nTipo:=0
    local abtn
    USE TIPO ALIAS TIPO
    TIPO->(DbGoTop())
    abtn:= array(tipo->(OrdKeyCount()))

    DEFINE FONT oFontTablet NAME "TAHOMA" SIZE 0,-25

DEFINE DIALOG oDlg  SIZE nWidth, nHeight;
            TITLE "Selezione prodotti";
            STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_CAPTION,  4 )

DO WHILE .not. TIPO->(EOF())

   @  nRow,nCol RBBTN abtn[n]   BITMAP ".\bitmaps\normale.png";
              SIZE 60,60  OF  oDlg   PIXEL PROMPT Right(tipo->desc,1);
            ACTION   ( abtn[n]:lSelected:=.t. ,nTipo:= n)  FONT oFontTablet


       TIPO->(DBSKIP())
   n++
    nCol+=65
   ENDDO
ACTIVATE DIALOG oDlg
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: 6716
Joined: Thu Oct 18, 2012 7:17 pm

Re: scroll Horizontal button

Postby Silvio.Falconi » Fri Feb 16, 2018 6:20 pm

Perhaps using TScrollPanel ?


Code: Select all  Expand view

#INCLUDE "Fivewin.ch"
#INCLUDE "Ribbon.ch"
#include "constant.ch"

Function test()

   Local oDlg,oFld
   Local oFontTablet

 // variabili per la dialog
    Local  nBottom   := 13
    Local  nRight    := 78
    Local  nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
    Local  nHeight := nBottom * DLG_CHARPIX_H

    Local oScrPanel



    DEFINE FONT oFontTablet NAME "TAHOMA" SIZE 0,-25

DEFINE DIALOG oDlg  SIZE nWidth, nHeight;
            TITLE "Selezione prodotti";
            STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_CAPTION,  4 )

   oScrPanel := TScrollPanel():New( 1, 1, 50, oDlg:nRight-100, oDlg )


 ACTIVATE DIALOG oDlg ;
          ON INIT Show_Record(oScrPanel,oFontTablet)

return nil
//--------------------------------------------------------------------

Function Show_Record(oScrPanel,oFontTablet)
    LOCAL nRow:= 10
    Local nCol:= 10
    Local n:= 1
    local nTipo:=0
    local abtn

   USE TIPO ALIAS TIPO
    TIPO->(DbGoTop())
    abtn:= array(tipo->(OrdKeyCount()))

    DO WHILE .not. TIPO->(EOF())

   @  nRow,nCol RBBTN abtn[n]   BITMAP ".\bitmaps\normale.png";
              SIZE 100,120  OF  oScrPanel   PIXEL PROMPT Right(tipo->desc,1);
            ACTION   ( abtn[n]:lSelected:=.t. ,nTipo:= n)  FONT oFontTablet


       TIPO->(DBSKIP())
   n++
    nCol+=120
 ENDDO

 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: 6716
Joined: Thu Oct 18, 2012 7:17 pm

Re: scroll Horizontal button

Postby Silvio.Falconi » Sat Feb 17, 2018 11:15 am

Antonio,

this is my last test
I use tscrollpanel
but I can only scroll on vertical
How scroll on Horizontal ?

it create the archive

Code: Select all  Expand view

#INCLUDE "Fivewin.ch"
#INCLUDE "Ribbon.ch"
#include "constant.ch"


REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO
#define CLR_DIALOGS RGB( 123, 140, 223 )

/*
  METHOD finger(x) CLASS TScrollPanel
    ::GoToPos( x )
return nil

*/




Function test()

   Local oDlg,oFld
   Local oFontTablet

 // variabili per la dialog
    Local  nBottom   := 13
    Local  nRight    := 78
    Local  nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
    Local  nHeight := nBottom * DLG_CHARPIX_H
    Local lSlider := .t.

    Local oScrPanel
    RddSetDefault( "DBFCDX" )

    Create_Test()


    DEFINE FONT oFontTablet NAME "TAHOMA" SIZE 0,-25

DEFINE DIALOG oDlg  SIZE nWidth, nHeight;
            TITLE "Selec Ticket";
            STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_CAPTION,  4 )

oScrPanel := TScrollPanel():New( 0, 0, 90, oDlg:nRight-100, oDlg,.t. )
oScrPanel:SetColor( CLR_WHITE, CLR_DIALOGS )

oScrPanel:bLClicked    := { || oScrPanel:SetFocus(),lSlider := .t. }
oScrPanel:bLButtonUp     := { |r,c,f,lDrag | lSlider := .f. }
oScrPanel:bMMoved  := { |r,c,f,lDrag| if( lSlider = .t. ,oScrPanel:finger(r), ) }

 ACTIVATE DIALOG oDlg ;
          ON INIT Show_Record(oScrPanel,oFontTablet)

return nil
//--------------------------------------------------------------------

Function Show_Record(oScrPanel,oFontTablet)
    LOCAL nRow:= 10
    Local nCol:= 10
    Local n:= 1
    local nTipo:=0
    local abtn

    USE TIPO ALIAS TIPO   NEW

    TIPO->(DbGoTop())
    abtn:= array(tipo->(OrdKeyCount()))

    DO WHILE .not. TIPO->(EOF())

   @  nRow,nCol RBBTN abtn[n]   BITMAP ".\bitmaps\normale.png";
              SIZE 100,120  OF  oScrPanel   PIXEL PROMPT lEFT(tipo->desc,8);
            ACTION   ( abtn[n]:lSelected:=.t. ,nTipo:= n)  FONT oFontTablet


       TIPO->(DBSKIP())
   n++
    nCol+=120
 ENDDO
   oScrPanel:SetRange()
 RETURN NIL
//----------------------------------------------------------------------------//
Function Create_Test()

     DbCreate('TI', {{ "CODICE"    , "C",     4,    0 },;
                     { "DESC"  , "C",     30,    0 } } , 'DBFCDX')


      close all
      use &('TI') new
      select TI
      if FILE('TIPO.DBF')
         delete file &('TIPO.cdx')
         append from &('TIPO')
         dbcommitall()
         close all
         delete file &('TIPO.dbf')
      endif
      close all
      rename &('TI.dbf') to &('TIPO.dbf')

   if File('tipo.CDX')
      delete file &('tipo.cdx')
   endif


    USE TIPO ALIAS TIPO   NEW

    IF TIPO->(EOF())
       For n=1 to 20
          TIPO->(DbAppend())
          Replace Tipo->Codice with strzero(tipo->(recno()),4)
          Replace Tipo->Desc with "BTN"+strzero(tipo->(recno()),4)
          TIPO->(DbCommit())
       Next n
    Endif

      INDEX ON (codice) TAG tipo01     FOR ! deleted()


      DbCloseAll()


   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: 6716
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Eroni and 12 guests