by pedroluis » Tue May 29, 2018 12:46 pm
Perdon, ahí va el código:
* ETIQUETAS.PRG - Generador de etiquetas. Compilar con BUILDX.BAT de FWH1709
* UV 15/05/2018
*
* Generador de etiquetas.
*
#include "vta0000.ch"
#include "winapi.ch"
#include "report.ch"
#include "xbrowse.ch"
#define VK_ENTER 13
EXTERNAL ORDKEYCOUNT, ORDKEYNO
REQUEST DBFCDX
EXTERN DBFCDX
*--------------------------------------
FUNCTION Main()
*--------------------------------------
local oDlg
local oBrwa
local oBrwr
local oxmed
local oxtip
local oxade
local oxaha
local oxrub1
local oxrub2
local oxrub3
local oxrub4
local oxrub5
local oxrub6
local oxrub7
local oxrub8
local oxrub9
local oxrub10
local lSave:=.f.
public xmed:=1
public xtip:="A"
public xade:=0
public xaha:=0
public xrub1:=0
public xrub2:=0
public xrub3:=0
public xrub4:=0
public xrub5:=0
public xrub6:=0
public xrub7:=0
public xrub8:=0
public xrub9:=0
public xrub10:=0
public xpath,wpath
public xporcen:=1.05
public oxaaa
public xaaa:=spac(30)
public oxrrr
public xrrr:=spac(30)
clos data
RDDSETDEFAULT("DBFCDX")
SET DATE FRENCH
SET CENTURY ON
SET EPOCH TO 1970
SET EXCLUSIVE OFF
SET DECIMALS TO 2
SET CONFI ON
SET DELE ON
SET _3DLOOK ON
SetHandleCount(80)
REQUEST HB_Lang_ES
REQUEST HB_CODEPAGE_ESWIN
HB_LangSelect("ES")
xporcen:=1.05
sele 2
use .\RUBNOM index .\RUBNOM EXCLUSIVE
set order to 2
sele 4
use &wpath.maeart index &wpath.maeart
set order to 2
DEFINE DIALOG oDlg RESOURCE "LABSELEC"
REDEFINE GET oxmed VAR xmed ID 107 OF oDlg picture "9" VALID xmed>0.and.xmed<4
REDEFINE GET oxtip VAR xtip ID 108 OF oDlg picture "!" VALID xtip="A".or.xtip="R"
REDEFINE GET oxade VAR xade ID 100 OF oDlg picture "999999" WHEN xtip="A"
REDEFINE GET oxaha VAR xaha ID 101 OF oDlg picture "999999" WHEN xtip="A"
REDEFINE GET oxrub1 VAR xrub1 ID 109 OF oDlg picture "999" WHEN xtip="R"
REDEFINE GET oxrub2 VAR xrub2 ID 102 OF oDlg picture "999" WHEN xtip="R"
REDEFINE GET oxrub3 VAR xrub3 ID 103 OF oDlg picture "999" WHEN xtip="R"
REDEFINE GET oxrub4 VAR xrub4 ID 104 OF oDlg picture "999" WHEN xtip="R"
REDEFINE GET oxrub5 VAR xrub5 ID 105 OF oDlg picture "999" WHEN xtip="R"
REDEFINE GET oxrub6 VAR xrub6 ID 106 OF oDlg picture "999" WHEN xtip="R"
REDEFINE GET oxrub7 VAR xrub7 ID 110 OF oDlg picture "999" WHEN xtip="R"
REDEFINE GET oxrub8 VAR xrub8 ID 111 OF oDlg picture "999" WHEN xtip="R"
REDEFINE GET oxrub9 VAR xrub9 ID 112 OF oDlg picture "999" WHEN xtip="R"
REDEFINE GET oxrub10 VAR xrub10 ID 113 OF oDlg picture "999" WHEN xtip="R"
REDEFINE BUTTON ID 115 OF oDlg ; // SI
ACTION (lSave:=.t.,sysrefresh(),oDlg:End())
REDEFINE BUTTON ID 114 OF oDlg ; // NO
ACTION (lSave:=.f.,sysrefresh(),CierraDbfs(),oDlg:End())
REDEFINE XBROWSE oBrwa FIELDS ;
str(4->articulo),;
4->Nombre ;
HEADERS;
"Art.",;
"Nombre" ;
ID 181 OF oDlg //UPDATE
oBrwa:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrwa:nColDividerStyle := LINESTYLE_BLACK
oBrwa:nRowDividerStyle := LINESTYLE_BLACK
oBrwa:lColDividerComplete := .t.
oBrwa:nHeaderLines := 1
oBrwa:nDataLines := 1
oBrwa:lRecordSelector := .t.
oBrwa:bClrStd := {|| { nRGB( 0, 0, 0), nRGB(210,255,233) } }
oBrwa:bClrSel := {|| { nRGB( 0, 0, 0), nRGB(210,255,233) } }
oBrwa:bClrSelFocus := {|| { nRGB( 0, 0, 0), nRGB(026,255,140) } }
oBrwa:SetFocus()
oBrwa:lVScroll := .t.
oBrwa:lHScroll := .t.
REDEFINE GET oxaaa VAR xaaa ID 4012 OF oDlg picture "@!" ;
ON CHANGE (::assign(),dbsetorder(2),;
if(BUSCOA(upper(subs(xaaa,1,::nPos-1))+upper(chr(nkey)),oBrwa),.t.,.f.) )
REDEFINE XBROWSE oBrwr FIELDS ;
str(2->rubro),;
2->Nombre ;
HEADERS;
"Rub.",;
"Nombre" ;
ID 182 OF oDlg
oBrwr:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrwr:nColDividerStyle := LINESTYLE_BLACK
oBrwr:nRowDividerStyle := LINESTYLE_BLACK
oBrwr:lColDividerComplete := .t.
oBrwr:nHeaderLines := 1
oBrwr:nDataLines := 1
oBrwr:lRecordSelector := .t.
oBrwr:bClrStd := {|| { nRGB( 0, 0, 0), nRGB(255,248,220) } }
oBrwr:bClrSelFocus := {|| { nRGB( 0, 0, 0), nRGB(248,195, 34) } }
oBrwr:lVScroll := .t.
oBrwr:lHScroll := .t.
ACTIVATE DIALOG oDlg CENTERED
Pedro L. Lavallen
San Luis (Capital), Argentina