oCol:VarPut( newValie _
oBrw:lCanPaste := .t.
Then, you can copy any text any where and then press Ctrl-V in the active cell. The value is pasted and browse updated.
This applies even for pasting images in memo fields.
Aprovechado el hilo, como debería definirse si quiero hacerlo con un Xbrowse con Array?
function XbrPaste()
local aData := { { "olga ", MEMOREAD( "c:\fwh\bitmaps\olga1.jpg" ) }, ;
{ "Two ", "" }, { "Three ", "" } }
XBROWSER aData FASTEDIT SETUP ( ;
oBrw:lCanPaste := .t., ;
oBrw:nRowHeight := 100, ;
oBrw:aCols[ 2 ]:cDataType:= "P" )
return nil
Error description: Error BASE/44 Assigned value is wrong class: TXBRWCOLUMN:HEDITTYPE
Args:
[ 1] = C P
Stack Calls
===========
Called from: => TXBRWCOLUMN:_HEDITTYPE( 0 )
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:_NEDITTYPE( 15905 )
Called from: prueba.prg => MAIN( 19 )
#include "Fivewin.ch"
#include "xbrowse.ch"
*****************************************************************
** Importar Articulos
FUNCTION Main()
LOCAL oDlg1, acor:= ARRAY(4), mrta:=.F., oBot1, oBot2, oBrwTmp,;
aCols := {{0,SPACE(50),0,0,0,0,0,0,""}},;
i, cError, cSql,cSql2
DEFINE DIALOG oDlg1 TITLE "Importar" FROM 03,15 TO 35,140
@ 20, 05 XBROWSE oBrwTmp SIZE 465,180 pixel OF oDlg1 ARRAY aCols ;
HEADERS "Codigo", "Descripcion","Costo","Utilidad","Precio Venta","Stock","Depto","IVA","Foto";
COLUMNS 1, 2 ,3, 4, 5,6,7,8, 9;
SIZES 60,250,70,70,70,50,50,50,100;
CELL LINES NOBORDER FASTEDIT
WITH OBJECT oBrwTmp
:lCanPaste := .t.
:nRowHeight := 100
:aCols[ 9 ]:nEditType := "P"
:bKeyDown := { |nKey| IF (nKey == VK_DELETE,oBrwTmp:Delete(),)}
:CreateFromCode()
END
ACTIVATE DIALOG oDlg1 CENTER
RETURN nil
:aCols[ 9 ]:nEditType := "P"
:aCols[ 9 ]:cDataType := "P"
Consulta. Si el arreglo inicial esta vacio, puede ser que no me deje pegar?
oCol:cDataType := "P"
#include "Fivewin.ch"
#include "xbrowse.ch"
*****************************************************************
** Importar Articulos
FUNCTION Main()
LOCAL oDlg1, acor:= ARRAY(4), mrta:=.F., oBot1, oBot2, oBrwTmp,;
aCols := {{0,SPACE(50),0,0,0,0,0,0,""}},;
i, cError, cSql,cSql2
DEFINE DIALOG oDlg1 TITLE "Importar" FROM 03,15 TO 35,140
@ 20, 05 XBROWSE oBrwTmp SIZE 465,180 pixel OF oDlg1 ARRAY aCols ;
HEADERS "Codigo", "Descripcion","Costo","Utilidad","Precio Venta","Stock","Depto","IVA","Foto";
COLUMNS 1, 2 ,3, 4, 5,6,7,8, 9;
SIZES 60,250,70,70,70,50,50,50,100;
CELL LINES NOBORDER FASTEDIT
WITH OBJECT oBrwTmp
:lCanPaste := .t.
:nEditTypes := 1
:nRowHeight := 100
:aCols[ 9 ]:cDataType := "P"
:bKeyDown := { |nKey| IF (nKey == VK_DELETE,oBrwTmp:Delete(),)}
:CreateFromCode()
END
ACTIVATE DIALOG oDlg1 CENTER
RETURN nil
#include "Fivewin.ch"
#include "xbrowse.ch"
*****************************************************************
** Vista de articulos
FUNCTION Main()
LOCAL oDlg1, oBrwTmp,;
aCols := {;
{'VIRTUOSA CLASICA', 1900.00, 'Carne 120 grs. Cheddar, Lechuga, Tomate y Mayonesa, Mostaza y Kétchup. Incluye Papas Fritas.','https://bcnresto.com/img/000010/00010110.jpg'},;
{'VIRTUOSA CLASICA 2', 1900.00, 'Carne 120 grs. Cheddar, Lechuga, Tomate y Mayonesa, Mostaza y Kétchup. Incluye Papas Fritas.','https://bcnresto.com/img/000010/00010114.jpg'},;
{'VIRTUOSA MIX', 1900.00, 'Carne 120 grs. Cheddar, Huevo Bacon y BBQ. Incluye Papas Fritas.','https://bcnresto.com/img/000010/00000020.jpg'},;
{'VIRTUOSA CHEESE ONION', 1900.00, 'Carne 120 grs. Cheddar, Cebolla Caramelizada Bacon y BBQ. Incluye Papas Fritas.','https://bcnresto.com/img/000010/00000021.jpg'},;
{'VIRTUOSA MEGA', 1900.00, 'Carne 120grs. Cheddar, lechuga, pepinos, cebolla picada y salsa mil islas. Incluye papas fritas.','https://bcnresto.com/img/000010/00000022.jpg'},;
{'VIRTUOSA NAPO', 1900.00, 'Carne 120 grs. Jamón, Queso, Tomate y Mayonesa. Incluye Papas Fritas.','https://bcnresto.com/img/000010/00000023.jpg'},;
{'BRAHMA 1 L.', 300.00 , 'Bien fria','https://bcnresto.com/img/000010/00000054.jpg'};
}
DEFINE DIALOG oDlg1 TITLE "Visor de productos" FROM 03,15 TO 35,140
@ 20, 05 XBROWSE oBrwTmp SIZE 465,180 pixel OF oDlg1 ARRAY aCols ;
HEADERS "Producto", "Descripcion","Precio","Foto";
COLUMNS 1,2,3,4;
SIZES 250,250,100,250;
CELL LINES NOBORDER
WITH OBJECT oBrwTmp
:nRowHeight := 100
:aCols[4]:cDataType := "P"
:CreateFromCode()
END
ACTIVATE DIALOG oDlg1
RETURN nil
Error description: Error BASE/1109 Argument error: $
Args:
[ 1] = C base64
[ 2] = U
Stack Calls
===========
Called from: .\source\function\IMGTXTIO.PRG => WEBIMAGE( 2615 )
Called from: .\source\function\IMGTXTIO.PRG => FW_READIMAGE( 1359 )
Called from: .\source\classes\WINDOW.PRG => (b)TWINDOW( 602 )
Called from: .\source\classes\WINDOW.PRG => TXBROWSE:READIMAGE( 0 )
function WebPageContents( cUrl, lText )
return cContents
return IfNil( cContents, "" )
FUNCTION cmsoft()
LOCAL oDlg1, oBrwTmp,;
aCols := {;
{'VIRTUOSA CLASICA', 1900.00, 'Carne 120 grs. Cheddar, Lechuga, Tomate y Mayonesa, Mostaza y Kétchup. Incluye Papas Fritas.','https://bcnresto.com/img/000010/00010110.jpg'},;
{'VIRTUOSA CLASICA 2', 1900.00, 'Carne 120 grs. Cheddar, Lechuga, Tomate y Mayonesa, Mostaza y Kétchup. Incluye Papas Fritas.','https://bcnresto.com/img/000010/00010114.jpg'},;
{'VIRTUOSA MIX', 1900.00, 'Carne 120 grs. Cheddar, Huevo Bacon y BBQ. Incluye Papas Fritas.','https://bcnresto.com/img/000010/00000020.jpg'},;
{'VIRTUOSA CHEESE ONION', 1900.00, 'Carne 120 grs. Cheddar, Cebolla Caramelizada Bacon y BBQ. Incluye Papas Fritas.','https://bcnresto.com/img/000010/00000021.jpg'},;
{'VIRTUOSA MEGA', 1900.00, 'Carne 120grs. Cheddar, lechuga, pepinos, cebolla picada y salsa mil islas. Incluye papas fritas.','https://bcnresto.com/img/000010/00000022.jpg'},;
{'VIRTUOSA NAPO', 1900.00, 'Carne 120 grs. Jamón, Queso, Tomate y Mayonesa. Incluye Papas Fritas.','https://bcnresto.com/img/000010/00000023.jpg'},;
{'BRAHMA 1 L.', 300.00 , 'Bien fria','https://bcnresto.com/img/000010/00000054.jpg'};
}
local cDefault := MEMOREAD( "c:\fwh\bitmaps\sea.bmp" )
AEval( aCols, { |a,i| a[ 4 ] := WebPageContents( a[ 4 ] ), ;
If( Empty( a[ 4 ] ), a[ 4 ] := cDefault, nil ) } )
DEFINE DIALOG oDlg1 TITLE "Visor de productos" SIZE 700,700 PIXEL TRUEPIXEL RESIZABLE
@ 20, 20 XBROWSE oBrwTmp SIZE -20,-20 pixel OF oDlg1 ARRAY aCols ;
HEADERS "Producto", "Precio", "Descripcion","Foto";
COLUMNS 1,2,3,4;
SIZES nil, nil, 150,200;
CELL LINES NOBORDER
WITH OBJECT oBrwTmp
:nStretchCol := 3
:nRowHeight := 150
:aCols[4]:cDataType := "P"
:CreateFromCode()
END
ACTIVATE DIALOG oDlg1 CENTERED
RETURN nil
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 25 guests