FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Antonio o Daniel Error Con xBrowse
Posts: 132
Joined: Thu Mar 08, 2007 06:12 PM
Antonio o Daniel Error Con xBrowse
Posted: Sat Oct 10, 2009 02:36 PM
Primero que nada, Saludos !

Tengo el siguiente problema usando xbrowse este es el codigo

Code (fw): Select all Collapse
#include "fivewin.ch"
#include "xbrowse.ch"
*--
#define COLOR_WINDOW        5
#define COLOR_WINDOWTEXT    8
*--
REQUEST DBFCDX
*--
Static oWndMain
*--
Function Main()
*--
Local oMenu, oBar
*--
RDDSETDEFAULT("DBFCDX" )
*--
Menu oMenu 2007
  MenuItem "&Archivos"
    Menu
       MenuItem "&Archivo" Action Prueba1()
       MenuItem "Salir"    Action oWndMain:End()
    EndMenu
  MenuItem "&Varios"
EndMenu
*--
Define Window oWndMain ;
       Title FWDESCRIPTION ;
       Color GETSYSCOLOR( COLOR_WINDOWTEXT ), GETSYSCOLOR( COLOR_WINDOW );
       Menu oMenu ;
       MenuInfo 2 ;
       MDI
*--
Define Buttonbar oBar Size 30,30 3D Top oF oWndMain 2007
*--
Activate Window oWndMain Maximized ;
         VALID MsgYesNo( "Cerrar Aplicación", FWVERSION )
Return( Nil )
*--
*
*--
Procedure Prueba1()
*-
Local oWndChild
Local oFold, oBrow
Local cAlias
Local aStruc := { {"Primero","C",5,0}, {"Segundo","C",50,0}, {"Tercero","C",15,0 } }

IF ! File( "Foldbrow.dbf" )
   DBCreate( "FoldBrow.dbf",aStruc )
Endif

Use FoldBrow New 
cAlias := cGetNewAlias( "Fold" )

Define Window oWndChild ;
       Title FWVERSION ;
       MDICHILD OF owndMain 

@ 01,01 Folder oFold of oWndChild Prompt "&Datos"

@ 0,0 XBROWSE oBrow OF oFold:aDialogs[1] ALIAS cAlias ;
      AUTOCOLS FOOTERS FASTEDIT

oBrow:CreateFromCode()

oFold:aDialogs[1]:oClient := oBrow

Activate Window oWndChild ;
         oN Resize( FoldResize( oWndChild, oFold ) )
Return

*--
Procedure FoldResize( oWnd, oFld )
*--
LOCAL oRect := oWnd:GetCliRect()
oFld:Move( 60,50, oRect:nRight - oRect:nLeft - 100, oRect:nBottom - oRect:nTop - 100, .T. )
Return

*

Se presenta un error cuando el browse tiene el foco y si pulsamos la tecla Alt con una letra que no este en el menu o en folder presenta el siguiente error



Application
===========
Path and name: c:\Sistemas\foldbrow.exe (32 bits)
Size: 1,852,416 bytes
Time from start: 0 hours 0 mins 8 secs
Error occurred at: 10/10/09, 10:05:49
Error description: Error BASE/1004 Message not found: TMDICHILD:GETHOTPOS
Args:
[ 1] = O TMDICHILD

Stack Calls
===========
Called from: => __ERRRT_SBASE(0)
Called from: ../../../tobject.prg => TMDICHILD:ERROR(0)
Called from: ../../../tobject.prg => (b)HBOBJECT(0)
Called from: ../../../tobject.prg => TMDICHILD:MSGNOTFOUND(0)
Called from: ../../../tobject.prg => TMDICHILD:GETHOTPOS(0)
Called from: .\source\classes\CONTROL.PRG => TXBROWSE:SYSCOMMAND(1027)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1451)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT(9914)
Called from: .\source\classes\WINDOW.PRG => _FWH(3347)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(966)
Called from: foldbrow.prg => MAIN(36)
Harbour / Bcc / MinGW / Fwh 13.9
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Antonio o Daniel Error Con xBrowse
Posted: Sat Oct 10, 2009 03:01 PM
Hola Compubrion


Realmente no he probado mucho esta solucion pero prueba y nos comentas...

Cambia estas 2 lineas en Control.prg ( 1027 y 1028 )

Code (fw): Select all Collapse
                 elseif ( hCtrl := ::oWnd:oWnd:GetHotPos( nLoWord, ::hWnd ) ) != 0
                    nButton := AScan( ::oWnd:oWnd:aControls, { | o | o:hWnd == hCtrl } )


une la clase a tu proyecto y genera el exe
Posts: 132
Joined: Thu Mar 08, 2007 06:12 PM
Re: Antonio o Daniel Error Con xBrowse
Posted: Sat Oct 10, 2009 05:17 PM

Daniel con esa modificacion , Problema Resuelto

Muchas Gracias
Cruz Oses

Harbour / Bcc / MinGW / Fwh 13.9

Continue the discussion