Label new
- Silvio.Falconi
- Posts: 7141
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Label new
Some have a procedure to design a label ? (or can help me to create a small designer for labels )
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
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
- Antonio Linares
- Site Admin
- Posts: 42553
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 80 times
- Contact:
- Silvio.Falconi
- Posts: 7141
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Label new
of course I had already thought.
For now, my problem is to set the size of the labels and I had thought of putting in a dialog to another (for viewing the label) then I tried it with a Bitmap, and then also with a tpanel .What I could use for displaying the label in a visual way?
For now, my problem is to set the size of the labels and I had thought of putting in a dialog to another (for viewing the label) then I tried it with a Bitmap, and then also with a tpanel .What I could use for displaying the label in a visual way?
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
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
- Silvio.Falconi
- Posts: 7141
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Label new
Antonio,
I made some tests...
Please see it
why not refresh the metafile sizes ?
I tried with setsize,refresh and setfocus
I made some tests...
Please see it
why not refresh the metafile sizes ?
Code: Select all | Expand
#include "fivewin.ch"
Function main()
Local oBar
Local oWnd
Local oLabelDesign
Local oLabelHeight := 400
Local oLabelWidth := 200
Local oLabelName := "Test.lbl"
Local aGet[10]
//--------------------------------------------------------------------//
DEFINE WINDOW oWnd TITLE "Label Design" Vscroll
DEFINE BUTTONBAR oBar OF oWnd SIZE 80, 80 2015 BOTTOM
@ 20,10 SAY "Label Height :" of oWnd size 100,20 PIXEL
@ 44,10 SAY "Label Width :" of oWnd size 100,20 PIXEL
@ 20,410 SAY "Label Name :" of oWnd size 100,20 PIXEL
@ 20, 125 GET aGet[1] VAR oLabelHeight of oWnd size 60,20 SPINNER PIXEL on change Refresh_oLabel(oLabelDesign,oLabelHeight, oLabelWidth)
@ 44, 125 GET aGet[2] VAR oLabelWidth of oWnd size 60,20 SPINNER PIXEL on change Refresh_oLabel(oLabelDesign,oLabelHeight, oLabelWidth)
@ 20, 510 GET aGet[3] VAR oLabelName of oWnd size 120,20 PIXEL
oLabelDesign :=TMetaFile():New( 200, 200, oLabelHeight, oLabelWidth,,oWnd,CLR_BLACK,CLR_WHITE,)
ACTIVATE WINDOW oWnd center ;
ON INIT (CreateSay( oLabelDesign ))
return nil
//--------------------------------------------------------------------//
Function Refresh_oLabel(oBjeto,oLabelHeight, oLabelWidth)
oBjeto:nHeight:= oLabelHeight
oBjeto:nWidth:= oLabelWidth
oBjeto:setsize(oLabelHeight, oLabelWidth)
oBjeto:refresh()
return nil
//--------------------------------------------------------------------//
function CreateSay( oDlg )
local oSay
@ 1, 2 SAY oSay PROMPT "Label:" OF oDlg SIZE 70, 20 DESIGN BORDER
oSay:bGet = nil
oSay:lWantClick = .T.
BringWindowToTop( oSay:hWnd )
oSay:SetFocus()
* oSay:bRClicked = { | nRow, nCol | EditControl( nRow, nCol, oSay ) }
return nil
I tried with setsize,refresh and setfocus
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
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
Re: Label new
Prueba así
Saludos
Code: Select all | Expand
//--------------------------------------------------------------------//
Function Refresh_oLabel(oBjeto,oLabelHeight, oLabelWidth,oWnd)
oBjeto:nHeight:= oLabelHeight
oBjeto:nWidth:= oLabelWidth
oBjeto:setsize(oLabelHeight, oLabelWidth)
oBjeto:refresh()
oWnd:Refresh()
return nil
Saludos
- Silvio.Falconi
- Posts: 7141
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Label new
NOT RUN not refresh... the object oLabelDesign
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
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
- Antonio Linares
- Site Admin
- Posts: 42553
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 80 times
- Contact:
- Silvio.Falconi
- Posts: 7141
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Label new
because I wish emulate a label print
I tried with a dialog or tpanel but I not have success
if you want give a hand ( help) yo're welcome
I tried with a dialog or tpanel but I not have success
if you want give a hand ( help) yo're welcome
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
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
- Antonio Linares
- Site Admin
- Posts: 42553
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 80 times
- Contact:
- Silvio.Falconi
- Posts: 7141
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Label new
Antonio I not remember wich error tpanel gave me ..
My Idea ..... (I use a xbrowse with customer.dbf to import fields)

it can run only when I Preview the label on rpreview the label is not as the size I have on the screen ...can you help me ?

My test
My Idea ..... (I use a xbrowse with customer.dbf to import fields)

it can run only when I Preview the label on rpreview the label is not as the size I have on the screen ...can you help me ?

My test
Code: Select all | Expand
#include "fivewin.ch"
#include "Constant.ch"
#Define Label_extension ".LBL"
REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO
Static oLabelDesign,nLabelHeight,nLabelWidth ,cLabelName
Function Test()
local oDlg, oBrw, oFont
Local oBtnLabel[2]
SET DATE ITALIAN
SET CENTURY ON
FwNumFormat( 'E', .t. )
USE CUSTOMER ALIAS CUST
DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14
DEFINE DIALOG oDlg SIZE 640,440 PIXEL ;
FONT oFont TITLE 'XBrowse Windows 7 Bars' ;
COLOR CLR_BLACK,RGB(250,250,250)
@ 10,20 XBROWSE oBrw OF oDlg SIZE -10,-20 PIXEL ;
COLUMNS "First","Last","Street","City", "State", "Zip","HireDate","Age", "Salary" ;
ALIAS 'CUST' NOBORDER
oBrw:lRecordSelector := .f.
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLWIN7
WITH OBJECT oBrw:InsCol( 1 )
:cHeader := " "
:bEditValue := { || If( AScan( oBrw:aSelected, oBrw:BookMark ) > 0, .t., nil ) }
:SetCheck()
:nHeadBmpNo := { || If( Len( oBrw:aSelected ) == oBrw:nLen, 1, 2 ) }
:bLClickHeader := { |r,c,f,oCol| If( Len( oBrw:aSelected ) == oBrw:nLen, ;
oBrw:SelectNone(), oBrw:SelectAll() ) }
END
oBrw:CreateFromCode()
@ 204,2 BUTTON oBtnLabel Prompt "Label Manager" SIZE 60,10 PIXEL;
ACTION Label_Manager('CUST',oBrw,'CUST')
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
Return nil
//---------------------------------------------------------------------//
Function Label_Manager(cDbf,oGrid,cPref)
Local oBar
Local oWnd
Local lPrintFrame := .t.
Local nLblVSep := 0
Local nLblHSep := 0
Local nLblOnLine := 0
Local nLen := Len( oGrid:aCols )
Local aCampos [ nLen ]
Local aTitulos[ nLen ]
Local aTipos [ nLen ]
Local cField
Local aGet[10]
Local oHand
//---------------------------------------------------------------------//
RddSetDefault( "DBFCDX" )
SetHandleCount( 100 )
//--------------------------------------------------------------------//
FOR n = 1 TO nLen
aCampos [ n ]:= oGrid:aCols[ n ]:cExpr
aTitulos [ n ]:= oGrid:aCols[ n ]:cHeader
aTipos [ n ]:= oGrid:aCols[ n ]:cDataType
NEXT
DEFAULT nLabelHeight := 400
DEFAULT nLabelWidth := 650
cLabelName := "Test.lbl"
DEFINE CURSOR oHand HAND
DEFINE WINDOW oWnd TITLE "Label Design" Vscroll
DEFINE BUTTONBAR oBar OF oWnd SIZE 40, 40 2015
oBar:bRClicked := { || .t. }
oBar:oCursor:= oHand
DEFINE BUTTON OF oBar ;
FILENAME "PRINT.BMP" ;
ACTION Preview(lPrintFrame ) ;
TOOLTIP i18n( "Preview Label. " ) ;
MESSAGE i18n( "Preview Label." ) ;
NOBORDER
@ 60,10 SAY "Label Height :" of oWnd size 100,20 PIXEL
@ 80,10 SAY "Label Width :" of oWnd size 100,20 PIXEL
@ 60,410 SAY "Label Name :" of oWnd size 100,20 PIXEL
@ 100, 410 say "Horizontal Separator (mm):" of oWnd size 180,20 PIXEL
@ 125, 410 say "Vertical Separator (mm):" of oWnd size 180,20 PIXEL
@ 60, 125 GET aGet[1] VAR nLabelHeight of oWnd size 60,20 SPINNER PIXEL on change Refresh_oLabel(oWnd)
@ 84, 125 GET aGet[2] VAR nLabelWidth of oWnd size 60,20 SPINNER PIXEL on change Refresh_oLabel(oWnd)
@ 60, 510 GET aGet[3] VAR cLabelName of oWnd size 120,20 PIXEL
@ 100, 600 GET aGet[4] VAR nLblHSep of oWnd size 60,20 SPINNER PIXEL
@ 125, 600 GET aGet[5] VAR nLblVSep of oWnd size 60,20 SPINNER PIXEL
oLabelDesign :=TMetaFile():New( 200, 200,nLabelWidth, nLabelHeight, ,oWnd,CLR_BLACK,CLR_WHITE,)
oLabelDesign:bRClicked := {|nRow,nCol,nFlags|EditDialog( nRow, nCol, oLabelDesign )}
@ 2.17, 130 say "Select Fields:" OF oBar SIZE 120,20 PIXEL
@ 2.17,259 COMBOBOX aGet[10] VAR cField ITEMS aTitulos OF oBar SIZE 200,90 PIXEL STYLE CBS_DROPDOWN ;
on change CreateSay( cField, oLabelDesign )
ACTIVATE WINDOW oWnd center
return nil
//--------------------------------------------------------------------//
Function Refresh_oLabel(oWnd)
oLabelDesign:nHeight:= nLabelHeight
oLabelDesign:nWidth:= nLabelWidth
oLabelDesign:setsize(nLabelWidth,nLabelHeight, )
oLabelDesign:refresh()
oWnd:refresh()
return nil
//--------------------------------------------------------------------//
function CreateSay(cTesto, oDlg )
local oSay
local oFontName := TFont():New( "ARIAL", 0, -24,,,,,,,,,,,,, , )
IF !empty(cTesto)
@ 1, 2 SAY oSay PROMPT "<" +cTesto+">" OF oDlg SIZE 150, 40 DESIGN BORDER FONT oFontName
oSay:bGet = nil
oSay:lWantClick = .T.
BringWindowToTop( oSay:hWnd )
oSay:SetFocus()
oSay:bRClicked = { | nRow, nCol | EditControl( nRow, nCol, oSay ) }
Endif
return nil
//---------------------------------------------------------------------------------------//
function EditControl( nRow, nCol, oControl )
local oMenu
MENU oMenu POPUP
MENUITEM "Bring to front" ACTION BringWindowToTop( oControl:hWnd )
MENUITEM "Position"
MENU
MENUITEM "nTop" + Chr( 9 ) + LTrim( Str( oControl:nTop ) )
MENUITEM "nLeft" + Chr( 9 ) + LTrim( Str( oControl:nLeft ) )
MENUITEM "Move up" ACTION ( oControl:HideDots(), oControl:nTop--, oControl:ShowDots() )
MENUITEM "Move down" ACTION ( oControl:HideDots(), oControl:nTop++, oControl:ShowDots() )
ENDMENU
MENUITEM "Size"
MENU
MENUITEM "nWidth" + Chr( 9 ) + LTrim( Str( oControl:nWidth ) )
MENUITEM "nHeight" + Chr( 9 ) + LTrim( Str( oControl:nHeight ) )
ENDMENU
ENDMENU
ACTIVATE POPUP oMenu WINDOW oControl AT nRow, nCol
return nil
function Preview(lPrintFrame )
local oPrn, oCtrl, oBrush, oFont
local n
oWndChild:=oLabelDesign
PRINTER oPrn PREVIEW NAME cLabelName
PAGE
aDes:= oPrn:Pix2Cmtr( oWndChild:nBottom, oWndChild:nRight )
if lPrintFrame
oPrn:Box( 10, 10, oWndChild:nBottom, oWndChild:nRight, )
Endif
if ! Empty( oWndChild:aControls )
for n = 1 to Len( oWndChild:aControls )
oCtrl = oWndChild:aControls[ n ]
do case
case oCtrl:ClassName() == "TSAY"
SetBkColor( oPrn:hDcOut, oCtrl:nClrPane )
DEFINE BRUSH oBrush COLOR oCtrl:nClrPane
FillRect( oPrn:hDcOut, { oCtrl:nTop, oCtrl:nLeft,;
oCtrl:nTop + oCtrl:nHeight - 1,;
oCtrl:nLeft + oCtrl:nWidth - 1 }, oBrush:hBrush )
oBrush:End()
oCtrl:GetFont()
DEFINE FONT oFont NAME oCtrl:oFont:cFaceName ;
SIZE oCtrl:oFont:nWidth, oCtrl:oFont:nHeight ;
OF oPrn
oFont:Activate( oPrn:hDCOut )
TextOut( oPrn:hDcOut,;
oCtrl:nTop,;
oCtrl:nLeft,;
oCtrl:GetText() )
oFont:DeActivate( oPrn:hDCOut )
oFont:End()
case oCtrl:ClassName() == "TBITMAP"
oPrn:SayBitmap( oCtrl:nTop,;
oCtrl:nLeft,;
oCtrl:cFileName, 80, 80 )
endcase
next
endif
ENDPAGE
ENDPRINTER
return nil
//-----------------------------------------------------------------------------------------//
static function EditDialog( nRow, nCol, oControl )
local oMenu
MENU oMenu POPUP
MENUITEM "Title..." ACTION NIL //EditTitle( oDlg )
SEPARATOR
MENUITEM "Add field" ACTION NIL
SEPARATOR
ENDMENU
endmenu
ACTIVATE POPUP oMenu WINDOW oControl AT nRow, nCol // SAVE
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
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
- Antonio Linares
- Site Admin
- Posts: 42553
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 80 times
- Contact:
- Silvio.Falconi
- Posts: 7141
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Label new
ok now it is ok
but the label on the preview have not the same dimension of that the screen
but the label on the preview have not the same dimension of that the screen
Code: Select all | Expand
#include "fivewin.ch"
#include "Constant.ch"
#Define Label_extension ".LBL"
REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO
Static oLabelDesign,nLabelHeight,nLabelWidth ,cLabelName
Function Test()
local oDlg, oBrw, oFont
Local oBtnLabel[2]
SET DATE ITALIAN
SET CENTURY ON
FwNumFormat( 'E', .t. )
USE CUSTOMER ALIAS CUST
DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14
DEFINE DIALOG oDlg SIZE 640,440 PIXEL ;
FONT oFont TITLE 'XBrowse Windows 7 Bars' ;
COLOR CLR_BLACK,RGB(250,250,250)
@ 10,20 XBROWSE oBrw OF oDlg SIZE -10,-20 PIXEL ;
COLUMNS "First","Last","Street","City", "State", "Zip","HireDate","Age", "Salary" ;
ALIAS 'CUST' NOBORDER
oBrw:lRecordSelector := .f.
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLWIN7
WITH OBJECT oBrw:InsCol( 1 )
:cHeader := " "
:bEditValue := { || If( AScan( oBrw:aSelected, oBrw:BookMark ) > 0, .t., nil ) }
:SetCheck()
:nHeadBmpNo := { || If( Len( oBrw:aSelected ) == oBrw:nLen, 1, 2 ) }
:bLClickHeader := { |r,c,f,oCol| If( Len( oBrw:aSelected ) == oBrw:nLen, ;
oBrw:SelectNone(), oBrw:SelectAll() ) }
END
oBrw:CreateFromCode()
@ 204,2 BUTTON oBtnLabel Prompt "Label Manager" SIZE 60,10 PIXEL;
ACTION Label_Manager('CUST',oBrw,'CUST')
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
Return nil
//---------------------------------------------------------------------//
Function Label_Manager(cDbf,oGrid,cPref)
Local oBar
Local oWnd
Local lPrintFrame := .t.
Local nLblVSep := 0
Local nLblHSep := 0
Local nLblOnLine := 0
Local nLen := Len( oGrid:aCols )
Local aCampos [ nLen ]
Local aTitulos[ nLen ]
Local aTipos [ nLen ]
Local cField
Local aGet[10]
Local oHand
//---------------------------------------------------------------------//
RddSetDefault( "DBFCDX" )
SetHandleCount( 100 )
//--------------------------------------------------------------------//
FOR n = 1 TO nLen
aCampos [ n ]:= oGrid:aCols[ n ]:cExpr
aTitulos [ n ]:= oGrid:aCols[ n ]:cHeader
aTipos [ n ]:= oGrid:aCols[ n ]:cDataType
NEXT
DEFAULT nLabelHeight := 400
DEFAULT nLabelWidth := 650
cLabelName := "Test.lbl"
DEFINE CURSOR oHand HAND
DEFINE WINDOW oWnd TITLE "Label Design" Vscroll
DEFINE BUTTONBAR oBar OF oWnd SIZE 40, 40 2015
oBar:bRClicked := { || .t. }
oBar:oCursor:= oHand
DEFINE BUTTON OF oBar ;
FILENAME "PRINT.BMP" ;
ACTION Preview(lPrintFrame ) ;
TOOLTIP i18n( "Preview Label. " ) ;
MESSAGE i18n( "Preview Label." ) ;
NOBORDER
@ 60,10 SAY "Label Height :" of oWnd size 100,20 PIXEL
@ 80,10 SAY "Label Width :" of oWnd size 100,20 PIXEL
@ 60,410 SAY "Label Name :" of oWnd size 100,20 PIXEL
@ 100, 410 say "Horizontal Separator (mm):" of oWnd size 180,20 PIXEL
@ 125, 410 say "Vertical Separator (mm):" of oWnd size 180,20 PIXEL
@ 60, 125 GET aGet[1] VAR nLabelHeight of oWnd size 60,20 SPINNER PIXEL on change Refresh_oLabel(oWnd)
@ 84, 125 GET aGet[2] VAR nLabelWidth of oWnd size 60,20 SPINNER PIXEL on change Refresh_oLabel(oWnd)
@ 60, 510 GET aGet[3] VAR cLabelName of oWnd size 120,20 PIXEL
@ 100, 600 GET aGet[4] VAR nLblHSep of oWnd size 60,20 SPINNER PIXEL
@ 125, 600 GET aGet[5] VAR nLblVSep of oWnd size 60,20 SPINNER PIXEL
oLabelDesign :=TMetaFile():New( 200, 200,nLabelWidth, nLabelHeight, ,oWnd,CLR_BLACK,CLR_WHITE,)
oLabelDesign:bRClicked := {|nRow,nCol,nFlags|EditDialog( nRow, nCol, oLabelDesign )}
@ 2.17, 130 say "Select Fields:" OF oBar SIZE 120,20 PIXEL
@ 2.17,259 COMBOBOX aGet[10] VAR cField ITEMS aTitulos OF oBar SIZE 200,90 PIXEL STYLE CBS_DROPDOWN ;
on change CreateSay( cField, oLabelDesign )
ACTIVATE WINDOW oWnd center
return nil
//--------------------------------------------------------------------//
Function Refresh_oLabel(oWnd)
oLabelDesign:nHeight:= nLabelHeight
oLabelDesign:nWidth:= nLabelWidth
oLabelDesign:setsize(nLabelWidth,nLabelHeight, )
oLabelDesign:refresh()
oWnd:refresh()
return nil
//--------------------------------------------------------------------//
function CreateSay(cTesto, oDlg )
local oSay
local oFontName := TFont():New( "ARIAL", 0, -24,,,,,,,,,,,,, , )
IF !empty(cTesto)
@ 1, 2 SAY oSay PROMPT "<" +cTesto+">" OF oDlg SIZE 150, 40 DESIGN BORDER FONT oFontName
oSay:bGet = nil
oSay:lWantClick = .T.
BringWindowToTop( oSay:hWnd )
oSay:SetFocus()
oSay:bRClicked = { | nRow, nCol | EditControl( nRow, nCol, oSay ) }
Endif
return nil
//---------------------------------------------------------------------------------------//
function EditControl( nRow, nCol, oControl )
local oMenu
MENU oMenu POPUP
MENUITEM "Bring to front" ACTION BringWindowToTop( oControl:hWnd )
MENUITEM "Position"
MENU
MENUITEM "nTop" + Chr( 9 ) + LTrim( Str( oControl:nTop ) )
MENUITEM "nLeft" + Chr( 9 ) + LTrim( Str( oControl:nLeft ) )
MENUITEM "Move up" ACTION ( oControl:HideDots(), oControl:nTop--, oControl:ShowDots() )
MENUITEM "Move down" ACTION ( oControl:HideDots(), oControl:nTop++, oControl:ShowDots() )
ENDMENU
MENUITEM "Size"
MENU
MENUITEM "nWidth" + Chr( 9 ) + LTrim( Str( oControl:nWidth ) )
MENUITEM "nHeight" + Chr( 9 ) + LTrim( Str( oControl:nHeight ) )
ENDMENU
ENDMENU
ACTIVATE POPUP oMenu WINDOW oControl AT nRow, nCol
return nil
function Preview(lPrintFrame )
local oPrn, oCtrl, oBrush, oFont
local n
oWndChild:=oLabelDesign
PRINTER oPrn PREVIEW NAME cLabelName
PAGE
aDes:= oPrn:Pix2Cmtr( oWndChild:nBottom, oWndChild:nRight )
if lPrintFrame
oPrn:Box( 10, 10, oWndChild:nBottom, oWndChild:nRight, )
Endif
if ! Empty( oWndChild:aControls )
for n = 1 to Len( oWndChild:aControls )
oCtrl = oWndChild:aControls[ n ]
do case
case oCtrl:ClassName() == "TSAY"
SetBkColor( oPrn:hDcOut, oCtrl:nClrPane )
DEFINE BRUSH oBrush COLOR oCtrl:nClrPane
FillRect( oPrn:hDcOut, { oCtrl:nTop, oCtrl:nLeft,;
oCtrl:nTop + oCtrl:nHeight - 1,;
oCtrl:nLeft + oCtrl:nWidth - 1 }, oBrush:hBrush )
oBrush:End()
oCtrl:GetFont()
DEFINE FONT oFont NAME oCtrl:oFont:cFaceName ;
SIZE oCtrl:oFont:nWidth, oCtrl:oFont:nHeight ;
OF oPrn
oFont:Activate( oPrn:hDCOut )
ExtTextOut( oPrn:hDcOut,;
oCtrl:nTop,;
oCtrl:nLeft,;
oCtrl:GetText() )
oFont:DeActivate( oPrn:hDCOut )
oFont:End()
case oCtrl:ClassName() == "TBITMAP"
oPrn:SayBitmap( oCtrl:nTop,;
oCtrl:nLeft,;
oCtrl:cFileName, 80, 80 )
endcase
next
endif
ENDPAGE
ENDPRINTER
return nil
//-----------------------------------------------------------------------------------------//
static function EditDialog( nRow, nCol, oControl )
local oMenu
MENU oMenu POPUP
MENUITEM "Title..." ACTION NIL //EditTitle( oDlg )
SEPARATOR
MENUITEM "Add field" ACTION NIL
SEPARATOR
ENDMENU
endmenu
ACTIVATE POPUP oMenu WINDOW oControl AT nRow, nCol // SAVE
return nil
Last edited by Silvio.Falconi on Thu Feb 02, 2017 8:18 am, edited 1 time in total.
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
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
- Silvio.Falconi
- Posts: 7141
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Label new
Someone can help me to create the design pls ?
I wish save the label on a file INI to load from a small class I made
I wish save the label on a file INI to load from a small class I made
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
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
- Antonio Linares
- Site Admin
- Posts: 42553
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 80 times
- Contact:
Re: Label new
Silvio,
You may multiply the width and height by some amount until they look as expected.
To create a INI file is very easy. You have examples in fivedit.prg, fivedbu.prg, etc
You may multiply the width and height by some amount until they look as expected.
To create a INI file is very easy. You have examples in fivedit.prg, fivedbu.prg, etc
- Silvio.Falconi
- Posts: 7141
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Label new
Antonio Linares wrote:Silvio,
You may multiply the width and height by some amount until they look as expected.
To create a INI file is very easy. You have examples in fivedit.prg, fivedbu.prg, etc
Antonio,
I wish help to create this designer
To create Ini I not problems
I have problem to show the label into rpreview
I'm thinking to create a function using the procedure of label.prg and read the info from a file (ini) sample : test.lbl
When I create a control it open a property dialog and set the id of the control on file ini ocontrol:getid()
for the filed control must have some properties : font,align,positio xy and with, nheight , if normal or barcode
then I wish insert th epossibility to insert special characters , images and on future graphics control as line and box
do you think about ?
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
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