bug in xBrowse in Linux with Wine

bug in xBrowse in Linux with Wine

Postby ukservice » Thu Jun 16, 2011 9:38 pm

Hi,

When using an .exe in Ubuntu with Wine, when calling XBROWSE from a DIALOG, it produces this error:

Code: Select all  Expand view
Application
===========
   Path and name: Z:\home\ubuntu\test\xbrowse\LINUX.exe (32 bits)
   Size: 2,475,520 bytes
   Time from start: 0 hours 0 mins 3 secs
   Error occurred at: 06/16/11, 14:33:49
   Error description: Error BASE/1004  No exported method: EVAL
   Args:
     [   1] = U  

Stack Calls
===========
   Called from:  => (b)EVAL(0)
   Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE(386)
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:KEYCOUNT(0)
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:REFRESH(1144)
   Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE(411)
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:RESIZE(0)
   Called from:  => TWINDOW:HANDLEEVENT(0)
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1499)
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT(11282)
   Called from: .\source\classes\WINDOW.PRG => _FWH(3409)
   Called from:  => SETSCROLLRANGE(0)
   Called from: .\source\classes\SCRLLBAR.PRG => (b)TSCROLLBAR(93)
   Called from: .\source\classes\SCRLLBAR.PRG => TSCROLLBAR:SETRANGE(0)
   Called from: .\source\classes\SCRLLBAR.PRG => TSCROLLBAR:WINNEW(203)
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:INITIATE(805)
   Called from:  => __OBJSENDMSG(0)
   Called from: .\source\function\HARBOUR.PRG => OSEND(210)
   Called from: .\source\function\HARBOUR.PRG => ASEND(178)
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE(657)
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT(917)
   Called from:  => DIALOGBOX(0)
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
   Called from: linux.prg => MAIN(112)



The code is:

Code: Select all  Expand view


     DEFINE DIALOG oDlg RESOURCE "SELECT" TITLE "Please, Select"
     
     oBrowse := TXBrowse():New( oDlg )

     aBrowse   := { { { || FIELD->CODE       }, "Code", 50, 0 },;
                    { { || FIELD->NAME       }, "Name", 5160, 0 } }

     oBrowse:CreateFromResource(101)


     REDEFINE BUTTON ID 201 OF oDlg ACTION( lSave := .T., oDlg:End() )


     ACTIVATE DIALOG oDlg CENTERED
 


In old FWH versions worked fine.

In Windows, the code works perfect.

What is wrong?.

Thank you very much.
Last edited by ukservice on Fri Jun 17, 2011 9:37 am, edited 1 time in total.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: bug in xBrowse

Postby nageswaragunupudi » Fri Jun 17, 2011 12:03 am

This code is "unsafe".

It works when a DBF file is already open and is the default alias, because an alias is not set with oBrw:cAlias := <alias> and oBrw:SetRDD() is not used. Nothing to do with this error, but the array aBrowse is not used in this code.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: bug in xBrowse

Postby ukservice » Fri Jun 17, 2011 8:13 am

Hi,

Thank you, but I don´t understand.

The code works fine in Windows, but not in Linux.

The error does not refer to DBF.

Can be fixed?.

Thank you.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: bug in xBrowse

Postby nageswaragunupudi » Fri Jun 17, 2011 8:25 am

It is possible that the DBF you wanted to browse was getting open on windows but on on Linux.

Please make sure that the alias you are browsing is really open by checking
? SELECT( <aliasname> ) > 0
or
? USED()
before creating the xbrowse.

When no DBF file is open when the browse is activated, SetRDD() is not implemented and the codeblocks including bKeyCount are not assigned. KeyCount() method tries to evaluate bKeyCount codeblock which is NIL resulting in the error as reported.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: bug in xBrowse

Postby ukservice » Fri Jun 17, 2011 8:55 am

Mr Nao:

The dbf is opened ok.

If I put xbrowse(), it works fine.

Code: Select all  Expand view
USE CUSTOMER
xBrowse()



In my sample, I have added:

oBrowse:cAlias := "CUSTOMER"
oBrowse:SetRDD()

just before oBrowse:CreateFromResource(101)

and now works fine in Linux ;).

When must I add cAlias := "CUSTOMER" and SetRDD(), just before oBrowse := TXBrowse():New( oDlg ) or before CreateFromResource()?.

Thank you for quick support!!!.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: bug in xBrowse in Linux with Wine

Postby nageswaragunupudi » Fri Jun 17, 2011 12:59 pm

When must I add cAlias := "CUSTOMER" and SetRDD(), just before oBrowse := TXBrowse():New( oDlg ) or before CreateFromResource()?.

Immediately after oBrowse := TXBrowse()
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: bug in xBrowse in Linux with Wine

Postby nageswaragunupudi » Fri Jun 17, 2011 1:03 pm

Command syntax takes care of many issues automatically and avoids all such pitfalls.
The above code can be written as
Code: Select all  Expand view
USE CUSTOMER
DEFINE DIALOG oDlg RESOURCE "SELECT" TITLE "Please, Select"
REDEFINE XBROWSE oBrowse ID 101 OF oDlg ;
   COLUMNS "Code", "Name" SIZES 50,500 ;
   ALIAS "CUSTOMER"
REDEFINE BUTTON ID 201 OF oDlg ACTION( lSave := .T., oDlg:End() )
ACTIVATE DIALOG oDlg CENTERED
CLOSE CUSTOMER
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: bug in xBrowse in Linux with Wine

Postby ukservice » Fri Jun 17, 2011 2:04 pm

Thank you very much.

It works fine now.

But when I call a xBrowse such as:

oVMenuBrowse := TXBrowse():New( oDlg )

oVMenuBrowse:nTop:=00
oVMenuBrowse:nLeft:=72
oVMenuBrowse:nRight:= (oDlg:nWidth()-10)/2 //nWidth=150
oVMenuBrowse:nBottom:= (oDlg:nHeight()-21)/2 //nHeight=200


if I use @ 00,72 XBROWSE... how do I indicate nRight and nBottom?.

Thank you.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: bug in xBrowse in Linux with Wine

Postby nageswaragunupudi » Sat Jun 18, 2011 3:20 am

@ 0,72 XBROWSE <clauses> SIZE -10,-21 PIXEL OF oDlg <moreClauses>

Negative size instructs the xbrowse to leave 10 pixels margin to the right and 21 pixels margin at the bottom. XBrowse automatically calculates the coordinates based on the width and height of the Dialog or Window. ( We also need not worry about dividing by 2 in case of dialogs. All that is taken care of by XBrowse)

On windows, these margins are retained even when the window is re-sized. We do not have to write any code to resize the browse when window is resized.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: bug in xBrowse in Linux with Wine

Postby ukservice » Sun Jun 19, 2011 11:18 am

Thank you very much.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 46 guests