Jump to content
Fivewin Brasil

Copiar e Colar


microfly

Recommended Posts

Bom Dia a todos, queria saber se no FWH tem alguma opção para copiar e colar, tipo tenho varias opções eu queria que qdo eu clicar com o mouse na opção ex R(iscado) e eu fosse na img e clicava novamente ele colocaria na img o que selecionei alguém poderia me dar uma dica?

Link to comment
Share on other sites

Não dá usando o Design no say?

Uma vez fiz um "desenhador" de etiquetas que usava esta propriedade para clicar e arrastar. Acho que se colocar um BMP no fundo dá para fazer algo....

No caso das etiquetas eu guardo a posição em que deixei o componente num DBF e dou um nome para esta etiqueta. Depois, quando o usuário escolher o nome da etiqueta

eu recupero as posições e coloco cada componente (say) no local definido!

Segue o código!

Att.

Everton

Function Layout(NomeEtiqueta,;
					PO1TITUL, PO2TITUL, PO1DESCR, PO2DESCR, PO1CODBA, PO2CODBA, PO1CODIG, PO2CODIG,;
					PO1AVDES, PO2AVDES, PO1AVVAL, PO2AVVAL, PO1APDES, PO2APDES, PO1APVAL, PO2APVAL  )


Private oGrp1, oSay1, oSay2, oSay3, oSay4, oSay5, oSay6, oSay7, oSay8, oBut2, oBut3

/*
oSay1:Var:="Titulo"
oSay2:cVarName:="Descricao"
oSay3:cVarName:="CodBarra"
oSay4:cVarName:="DescAVista"
oSay5:cVarName:="ValAVista"
oSay6:cVarName:="DescAPrazo"
oSay7:cVarName:="ValAPrazo"
oSay8:cVarName:="Codigo"
*/

if( empty(PO1TITUL), PO1TITUL := 20, .t.)
if( empty(PO2TITUL), PO2TITUL := 8, .t.)
*
if( empty(PO1DESCR), PO1DESCR := 35, .t.)
if( empty(PO2DESCR), PO2DESCR := 8, .t.)
*
if( empty(PO1CODBA), PO1CODBA := 50, .t.)
if( empty(PO2CODBA), PO2CODBA := 8, .t.)
*
if( empty(PO1CODIG), PO1CODIG := 75, .t.)
if( empty(PO2CODIG), PO2CODIG := 8, .t.)
*
if( empty(PO1AVDES), PO1AVDES := 90, .t.)
if( empty(PO2AVDES), PO2AVDES := 8, .t.)
*
if( empty(PO1AVVAL), PO1AVVAL := 90, .t.)
if( empty(PO2AVVAL), PO2AVVAL := 121, .t.)
*
if( empty(PO1APDES), PO1APDES := 105, .t.)
if( empty(PO2APDES), PO2APDES := 8, .t.)
*
if( empty(PO1APVAL), PO1APVAL := 105, .t.)
if( empty(PO2APVAL), PO2APVAL := 121, .t.)
*
DEFINE FONT oFONT1 NAME "Courier New" SIZE   8,  16
DEFINE FONT oFONT2 NAME "Arial" SIZE   0, -13
DEFINE FONT oFONT3 NAME "Agency FB" SIZE   0, -19 BOLD
DEFINE FONT oFONT4 NAME "Gill Sans MT" SIZE   0, -16

Define DIALOG oFormLout TITLE "RFID - (49)XXXX-XXXX - Layout de Etiquetas";
       FROM 100, 233 to 535, 738 PIXEL COLOR 0, 14215660
															
ACTIVATE DIALOG oFormlOut ON INIT IniciaroFormlOut(NomeEtiqueta, PO1TITUL, PO2TITUL, PO1DESCR, PO2DESCR,;
                                                   PO1CODBA, PO2CODBA, PO1CODIG, PO2CODIG, PO1AVDES, PO2AVDES,;
																	PO1AVVAL, PO2AVVAL, PO1APDES, PO2APDES, PO1APVAL, PO2APVAL  )

//----------------------------------------------------------------------------
Function IniciaroFormlOut(NomeEtiqueta, PO1TITUL, PO2TITUL, PO1DESCR, PO2DESCR, PO1CODBA, PO2CODBA,;
                          PO1CODIG, PO2CODIG, PO1AVDES, PO2AVDES, PO1AVVAL, PO2AVVAL, PO1APDES,;
								  PO2APDES, PO1APVAL, PO2APVAL  )

   @   4,   6 GROUP oGrp1 TO 376, 500 LABEL "" PIXEL;
              OF oFormlOut COLOR 0, 16777215 FONT oFont1 

   @  PO1TITUL, PO2TITUL SAY oSay1 VAR "Titulo da Etiqueta" SIZE 104,  20 PIXEL;
            OF oGrp1 COLOR 0, 16777215 FONT oFont2 Design 


   @  PO1DESCR, PO2DESCR SAY oSay2 VAR "Descrição da Mercadoria" SIZE 148,  20 PIXEL;
            OF oGrp1 COLOR 0, 16777215 FONT oFont2 design 


   @  PO1CODBA, PO2CODBA SAY oSay3 VAR "CÓDIGO DE BARRAS" SIZE 220,  28 PIXEL;
              OF oGrp1 COLOR 0, 16777215 FONT oFont3 design 


   @ PO1AVDES, PO2AVDES SAY oSay4 VAR "Valor a Vista R$" SIZE  98,  20 PIXEL;
            OF oGrp1 COLOR 0, 16777215 FONT oFont2 design 


   @ PO1AVVAL, PO2AVVAL SAY oSay5 VAR "Av 99,99" SIZE  56,  20 PIXEL;
            OF oGrp1 COLOR 0, 16777215 FONT oFont2 design 


   @ PO1APDES, PO2APDES SAY oSay6 VAR "Valor a Prazo R$" SIZE 106,  20 PIXEL;
            OF oGrp1 COLOR 0, 16777215 FONT oFont2 design 


   @ PO1APVAL, PO2APVAL SAY oSay7 VAR "Ap 99,99" SIZE  62,  20 PIXEL;
            OF oGrp1 COLOR 0, 16777215 FONT oFont2 design 


   @ PO1CODIG, PO2CODIG SAY oSay8 VAR "Código" SIZE  60,  20 PIXEL;
              OF oGrp1 COLOR 0, 16777215 FONT oFont2 design 


   @ 383, 430 BUTTON oBut2 Prompt "Voltar" SIZE  70,  24 PIXEL;
              OF oFormlOut ACTION oFormlOut:end() FONT oFont4 


   @ 383, 342 BUTTON oBut3 Prompt "Salvar" SIZE  70,  24 PIXEL;
              OF oFormlOut ACTION SalvaLayout(NomeEtiqueta) FONT oFont4 

SET MESSAGE OF oFormLOut TO "Etiquetas RFID - V 0.95"  

Return NIL
*------------------------------------------------------------------------------------*
*
*
* Define a funcao que salva o layout das etiquetas
*
*
*------------------------------------------------------------------------------------*
static function SalvaLayout(NomeEtiqueta)

if empty( NomeEtiqueta )
	MsgInfo( "Nome da etiqueta em branco, volte e atribua um nome a esta etiqueta.", "Atenção" )
	return NIL
endif	

Select Etiqueta 
INDEX ON ETI_NOME TO ETI001
go top

if dbseek( NomeEtiqueta )
   rlock()
   replace POS_1TITUL with oSay1:nTOP(),;  
           POS_2TITUL with oSay1:nleft(),; 
           POS_1DESCR with oSay2:nTOP(),; 
           POS_2DESCR with oSay2:nleft(),;
           POS_1CODBA with oSay3:nTOP(),;  
           POS_2CODBA with oSay3:nleft(),; 
           POS_1CODIG with oSay8:nTOP(),;   
           POS_2CODIG with oSay8:nleft(),;
           POS_1AVDES with oSay4:nTOP(),;  
           POS_2AVDES with oSay4:nleft(),; 
           POS_1AVVAL with oSay5:nTOP(),;  
           POS_2AVVAL with oSay5:nleft(),; 
           POS_1APDES with oSay6:nTOP(),;  
           POS_2APDES with oSay6:nleft(),; 
           POS_1APVAL with oSay7:nTOP(),;  
           POS_2APVAL with oSay7:nleft() 

   ?? "Layout da etiqueta " + alltrim( NomeEtiqueta ) + " salvo"
   
           PO1TITUL     := POS_1TITUL 
           PO2TITUL     := POS_2TITUL 
           PO1DESCR     := POS_1DESCR 
           PO2DESCR     := POS_2DESCR 
           PO1CODBA     := POS_1CODBA 
           PO2CODBA     := POS_2CODBA 
           PO1CODIG     := POS_1CODIG 
           PO2CODIG     := POS_2CODIG 
           PO1AVDES     := POS_1AVDES 
           PO2AVDES     := POS_2AVDES 
           PO1AVVAL     := POS_1AVVAL 
           PO2AVVAL     := POS_2AVVAL 
           PO1APDES     := POS_1APDES 
           PO2APDES     := POS_2APDES 
           PO1APVAL     := POS_1APVAL 
           PO2APVAL     := POS_2APVAL    
   
else
      rlock()
      append blank 
      replace POS_1TITUL with oSay1:nTOP(),;  
              POS_2TITUL with oSay1:nleft(),; 
              POS_1DESCR with oSay2:nTOP(),; 
              POS_2DESCR with oSay2:nleft(),;
              POS_1CODBA with oSay3:nTOP(),;  
              POS_2CODBA with oSay3:nleft(),; 
              POS_1CODIG with oSay8:nTOP(),;   
              POS_2CODIG with oSay8:nleft(),;
              POS_1AVDES with oSay4:nTOP(),;  
              POS_2AVDES with oSay4:nleft(),; 
              POS_1AVVAL with oSay5:nTOP(),;  
              POS_2AVVAL with oSay5:nleft(),; 
              POS_1APDES with oSay6:nTOP(),;  
              POS_2APDES with oSay6:nleft(),; 
              POS_1APVAL with oSay7:nTOP(),;  
              POS_2APVAL with oSay7:nleft(),;
			     ETI_NOME   with NomeEtiqueta 
			  
              ?? "Layout NOVO da etiqueta " + alltrim( NomeEtiqueta ) + " salvo"
   
              PO1TITUL     := POS_1TITUL     
              PO2TITUL     := POS_2TITUL     
              PO1DESCR     := POS_1DESCR     
              PO2DESCR     := POS_2DESCR     
              PO1CODBA     := POS_1CODBA     
              PO2CODBA     := POS_2CODBA     
              PO1CODIG     := POS_1CODIG     
              PO2CODIG     := POS_2CODIG     
              PO1AVDES     := POS_1AVDES     
              PO2AVDES     := POS_2AVDES     
              PO1AVVAL     := POS_1AVVAL     
              PO2AVVAL     := POS_2AVVAL     
              PO1APDES     := POS_1APDES     
              PO2APDES     := POS_2APDES     
              PO1APVAL     := POS_1APVAL     
              PO2APVAL     := POS_2APVAL     
                              			  	
endif	

return NIL     
               
              
Link to comment
Share on other sites

código redundante?? whats is this?? kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk

Na hora de gravar os dados no DBF Kapiaba.. tenho 2 Replaces absolutamente iguais... Quando bastava verificar a existência do registro e se não existisse colocar um append blank

sem precisar repetir o processo!

Ah... agora li de novo e entendi! hahahahaha

Link to comment
Share on other sites

Uso assim para colar texto gerado no aplicativo para o Excel

// clipboard para capturar o texto e colar no excell
DEFINE CLIPBOARD oClp OF oLbx
   
dUltdia := ctod("01/"+substr(cArquivo,4,2)+"/"+substr(cArquivo,6,4))
cCabecalho := "LT"+strzero(&cAlia->lote,3)+" "+alltrim(&cAlia->usuario)+" "+dtoc(ultimodia(dUltdia))+;
              " - Doc "+iif(&cAlia->quant = 1,strzero(&cAlia->docfim,3),+;
				  strzero(&cAlia->docini,3)+" a "+strzero(&cAlia->docfim,3))                     
......

REDEFINE SAY oSay VAR cCabecalho ID 104 OF oDlg UPDATE
//oSay:bGotFocus := { || oSay:SelectAll() }   // manter selecionado
oSay:cTooltip := "Utilize o texto para colar no Lote do Excel" 
oSay:disable()

oSay:settext( cCabecalho )
oSay:refresh()
oClp:SetText( cCabecalho )  // clipboard para capturar o texto e colar no excell

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...