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?
#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
#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
#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
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 101 guests