Estoy intentando personalizar la barra de botones del rpreview, el código es el siguiente:
Code: Select all
main()
.....
....
TPreview():bButtonBar := {| oPreview, oWnd | YourButtonBar (oPreview, oWnd)}
....
....
....
function YourButtonBar (oPreview, oWnd)
LOCAL oBar,oBtn,oCodigo,oNombre,oRazons
MENU oOrdTal POPUP 2015
MENUITEM oCodigo PROMPT "Código" ACTION (oCodigo:SetCheck( .T. ),oNombre:SetCheck( .F. ),oLamcla:vOrden:="t_tercer",pOrdTer())
MENUITEM oNombre PROMPT "Nombre" ACTION (oCodigo:SetCheck( .F. ),oNombre:SetCheck( .F. ),oLamcla:vOrden:="nombre",pOrdTer())
ENDMENU
MENU oPopup POPUP 2015
MENUITEM "Configurar Impresora" ACTION PrinterSetup()
SEPARATOR
MENUITEM "Generar reporte a impresora" ACTION (oLamcla:oTimpr:=1,oLamcla:autoriza(15))
MENUITEM "Generar reporte a Excel" ACTION (oLamcla:oTimpr:=2,oLamcla:autoriza(15))
ENDMENU
oCodigo:SetCheck( .T. )
oNombre:SetCheck( .F. )
DEFINE BUTTONBAR oBar OF oWnd SIZE 60,60 2015
DEFINE BUTTON OF oBar RESOURCE "#8514" PROMPT "Agregar" TOOLTIP "Agregar Registro - F3" ACTION (oLamcla:vgraba:=.t.,oLamcla:autoriza(12))
DEFINE BUTTON OF oBar RESOURCE "#8515" PROMPT "Modificar" TOOLTIP "Modificar Registro - F4" ACTION (oLamcla:vgraba:=.f.,oLamcla:autoriza(13))
DEFINE BUTTON OF oBar RESOURCE "#8516" PROMPT "Borrar" TOOLTIP "Borrar Registro - F5" ACTION oLamcla:autoriza(14)
DEFINE BUTTON OF oBar RESOURCE "#8517" PROMPT "Imprimir" TOOLTIP "Imprimir Listado" MENU oPopup ACTION (oLamcla:oTimpr:=1,oLamcla:autoriza(15))
DEFINE BUTTON OF oBar RESOURCE "#8518" PROMPT "Ordenar" TOOLTIP "Organizar Información" MENU oOrdTal ACTION (oCodigo:SetCheck( .T. ),oNombre:SetCheck( .F. ),oRazons:SetCheck( .F. ),oLamcla:vOrden:="t_tercer",pOrdTer())
DEFINE BUTTON OF oBar RESOURCE "#8513" PROMPT "Cerrar" TOOLTIP "Cerra Ventana"ACTION (oLamcla:oRsTercer:Close(),oCuadro:End())
oBar:GoTop()
Return nil
Code: Select all
Application
===========
Path and name: C:\DLYMA\dlyma.exe (32 bits)
Size: 6,536,704 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20190613)
FiveWin version: FWH 19.09
C compiler version: Borland/Embarcadero C++ 7.3 (32-bit)
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 42 secs
Error occurred at: 02/04/2020, 15:18:48
Error description: Error BASE/1004 Class: 'NIL' has no exported method: NHEIGHT
Args:
[ 1] = U
Stack Calls
===========
Called from: => NHEIGHT( 0 )
Called from: .\source\classes\RPREVIEW.PRG => TPREVIEW:PAINTMETA( 838 )
Called from: .\source\classes\RPREVIEW.PRG => (b)TPREVIEW:ACTIVATE( 172 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:RESIZE( 2366 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3559 )
Called from: => SHOWWINDOW( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1073 )
Called from: .\source\classes\RPREVIEW.PRG => TPREVIEW:ACTIVATE( 172 )
Called from: .\source\classes\RPREVIEW.PRG => RPREVIEW( 1893 )
Called from: .\source\classes\ESREPORT.PRG => FW_EREPORT:END( 539 )
Called from: c:\dlyma\prg\Afact.prg => CFACT:IMPRIMEFACT( 859 )
Called from: c:\dlyma\prg\R32_fact.prg => IMPFACTURA( 2609 )
Called from: c:\dlyma\prg\R32_fact.prg => (b)MANTEFACTURAS( 515 )
Called from: .\source\classes\BUTTON.PRG => TBUTTONBMP:CLICK( 179 )
Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT( 1755 )
Called from: .\source\classes\BUTTONB.PRG => TBUTTONBMP:HANDLEEVENT( 261 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3559 )
Called from: => SENDMESSAGE( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND( 433 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 1136 )
Called from: => DIALOGBOXW( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
Called from: c:\dlyma\prg\R32_fact.prg => MANTEFACTURAS( 785 )
Called from: c:\dlyma\prg\R32_fact.prg => (b)FFACTURAS( 126 )
Called from: .\source\classes\URLLINK.PRG => TURLLINK:LBUTTONDOWN( 180 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1788 )
Called from: .\source\classes\URLLINK.PRG => TURLLINK:HANDLEEVENT( 168 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3559 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1097 )
Called from: c:\dlyma\prg\R32_menu.prg => MAIN( 568 )