Xbrowse Error

Post Reply
User avatar
mauri.menabue
Posts: 161
Joined: Thu Apr 17, 2008 2:38 pm

Xbrowse Error

Post by mauri.menabue »

hi all
Pressing the CTRL key and rotating the mouse wheel displays this error :

Application
===========
Path and name: D:\Biella\Soci.exe (32 bits)
Size: 6,222,848 bytes
Compiler version: Harbour 3.2.0dev (r2103311837)
FiveWin version: FWH 21.11
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.2, Build 9200

Time from start: 0 hours 0 mins 11 secs
Error occurred at: 30-03-2022, 18:06:35
Error description: Error BASE/1082 Parametro errato: -
Args:
[ 1] = U
[ 2] = N 4.00000

Stack Calls
===========
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:CHECKSIZE( 1388 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT( 2228 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY( 2168 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1821 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 12005 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3560 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
Called from: .\source\function\ERRSYSW.PRG => ERRORDIALOG( 448 )
Called from: .\source\function\ERRSYSW.PRG => (b)ERRORSYS( 24 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:CHECKSIZE( 1388 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:ADJUST( 1495 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:RECALCWH( 9595 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:FONTSIZE( 9573 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:MOUSEWHEEL( 5488 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1855 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 12005 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3560 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1097 )
Called from: prog\Main.prg => MAIN( 660 )

System
======
CPU type: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz 2592 Mhz
Hardware memory: 16221 megs

Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %

Windows total applications running: 5 ...



Code: Select all | Expand


METHOD CheckSize()  CLASS TXBrowse

   local aRect
   local nGap

   if ( ::nRightMargin != nil .or. ::nBottomMargin != nil ) .and. !( ::oWnd:oClient == Self )
      aRect    := GetClientRect( ::oWnd:hWnd )
      if ::nRightMargin != nil
         ::nWidth       := aRect[ 4 ] - ::nRightMargin - ::nLeft
      endif
      if ::nBottomMargin != nil
         ::nHeight      := aRect[ 3 ] - ::nBottomMargin - ::nTop
      endif

   endif

   if ::nHeaderPad > 0
      IF .not. ::nHeaderHeight == NIL    <------------------------ New Line of code to work around the error
         ::nHeaderHeight   -= ::nHeaderPad
      ENDIF
   endif
   
   if ::nFooterPad > 0
      IF .not. ::nFooterHeight == NIL  <------------------------  New Line of code to work around the error
         ::nFooterHeight   -= ::nFooterPad
      ENDIF
   endif
   
   ::nHeaderPad := ::nFooterPad := 0

   if ::lAdjusted .and. ::lFitGridHeight .and. ;
      ( ( ::lHeader .and. ::nHeaderHeight > 1 ) .or. ::lFooter )

      if ( nGap  := ::DataRect:nHeight % ::nRowHeight ) > 0

         if ::lHeader .and. ::nHeaderHeight > 1
            if ::lFooter
               ::nFooterPad   := Int( nGap * ::nFooterHeight / ( ::nHeaderHeight + ::nFooterHeight ) )
               ::nHeaderPad   := nGap - ::nFooterPad

//               ::nFooterHeight   += ::nHeaderPad // bug fixed 2018-07-10
//               ::nHeaderHeight   += ::nFooterPad

               ::nFooterHeight   += ::nFooterPad   // bug fixed 2018-07-10
               ::nHeaderHeight   += ::nHeaderPad

            else
               ::nHeaderHeight   += ( ::nHeaderPad := nGap )
            endif
         else
            ::nFooterHeight   += ( ::nFooterPad := nGap )
         endif
      endif

   endif


return Self
 
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Xbrowse Error

Post by nageswaragunupudi »

Scrolling mouse wheel while pressing Ctrl-Key is used to Zoom and Unzoom xbrowse.
We are looking into the problem reported by you.
For this purpose, we are trying to recreate the problem at our end but unable to recreate this error here.
This is the test program:

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local oDlg, oFont, oBrw

   USE CUSTOMER

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-15
   DEFINE DIALOG oDlg SIZE 700,400 PIXEL TRUEPIXEL FONT oFont ;
      TITLE "Ctrl + MouseWheel Scroll to ZOOM/UNZOOM"

   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE ALIAS() AUTOCOLS ;
      CELL LINES NOBORDER

   WITH OBJECT oBrw
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
 

When we scroll mouse wheel pressing Ctrl key, we are getting zoom/unzoom effect as expected but no errors.

Image

Can you please modify the above program to produce the error to enable us to fix it please?
Regards

G. N. Rao.
Hyderabad, India
User avatar
mauri.menabue
Posts: 161
Joined: Thu Apr 17, 2008 2:38 pm

Re: Xbrowse Error

Post by mauri.menabue »

Hi, Nages
Try this

Code: Select all | Expand


function Main()

   local oDlg, oFont, oBrw

   USE CUSTOMER

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-15
   DEFINE DIALOG oDlg SIZE 700,400 PIXEL TRUEPIXEL FONT oFont ;
      TITLE "Ctrl + MouseWheel Scroll to ZOOM/UNZOOM"

   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE ALIAS() AUTOCOLS ;
      CELL LINES NOBORDER

   WITH OBJECT oBrw
       :lFitGridHeight := .T.  // <===================== ADD THIS LINE
       :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
 
 


TIA
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Xbrowse Error

Post by nageswaragunupudi »

Thanks for the clue.
We will work on it.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Xbrowse Error

Post by nageswaragunupudi »

Please replace the existing METHOD CheckSize() with this new method and try:

Code: Select all | Expand

METHOD CheckSize()  CLASS TXBrowse

   local aRect
   local nGap

   if ( ::nRightMargin != nil .or. ::nBottomMargin != nil ) .and. !( ::oWnd:oClient == Self )
      aRect    := GetClientRect( ::oWnd:hWnd )
      if ::nRightMargin != nil
         ::nWidth       := aRect[ 4 ] - ::nRightMargin - ::nLeft
      endif
      if ::nBottomMargin != nil
         ::nHeight      := aRect[ 3 ] - ::nBottomMargin - ::nTop
      endif

   endif

   if ::lAdjusted
      if ::nHeaderPad > 0
         ::nHeaderHeight   -= ::nHeaderPad
      endif
      if ::nFooterPad > 0
         ::nFooterHeight   -= ::nFooterPad
      endif
      ::nHeaderPad := ::nFooterPad := 0

      if ::lFitGridHeight .and. ;
         ( ( ::lHeader .and. ::nHeaderHeight > 1 ) .or. ::lFooter )

         if ( nGap  := ::DataRect:nHeight % ::nRowHeight ) > 0

            if ::lHeader .and. ::nHeaderHeight > 1
               if ::lFooter
                  ::nFooterPad   := Int( nGap * ::nFooterHeight / ( ::nHeaderHeight + ::nFooterHeight ) )
                  ::nHeaderPad   := nGap - ::nFooterPad

//                ::nFooterHeight   += ::nHeaderPad // bug fixed 2018-07-10
//                ::nHeaderHeight   += ::nFooterPad

                  ::nFooterHeight   += ::nFooterPad   // bug fixed 2018-07-10
                  ::nHeaderHeight   += ::nHeaderPad

               else
                  ::nHeaderHeight   += ( ::nHeaderPad := nGap )
               endif
            else
               ::nFooterHeight   += ( ::nFooterPad := nGap )
            endif
         endif
      endif
   endif

return Self
 

Please try and let us know if the problem is completely solved.
Thanks for helping us to fix this bug
Regards

G. N. Rao.
Hyderabad, India
User avatar
mauri.menabue
Posts: 161
Joined: Thu Apr 17, 2008 2:38 pm

Re: Xbrowse Error

Post by mauri.menabue »

hi, Nages

It's almost fine, but the height of the headboard in the
various zoom positions does not remain constant 1 or 2 or 3 row

The next piece of code must always be executed, not only :
if ::lAdjusted is .T.

if ::nHeaderPad > 0
::nHeaderHeight -= ::nHeaderPad
endif
if ::nFooterPad > 0
::nFooterHeight -= ::nFooterPad
endif
::nHeaderPad := ::nFooterPad := 0

For me is better

if ::nHeaderPad > 0
if .not. :: ::nHeaderHeight == NIL
::nHeaderHeight -= ::nHeaderPad
endif
endif
if ::nFooterPad > 0
if .not. ::nFooterHeight == NIL
::nFooterHeight -= ::nFooterPad
endif
endif
::nHeaderPad := ::nFooterPad := 0

TIA
Maurizio Menabue
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Xbrowse Error

Post by nageswaragunupudi »

Both headerheight and footer height keep changing because of change in font size and also trying to keep the browselines snugly fit to the height also effects header and footer heights. that is ok
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Xbrowse Error

Post by nageswaragunupudi »

The next piece of code must always be executed, not only :
if ::lAdjusted is .T.

No please.
Please retain my code as it is.
Regards

G. N. Rao.
Hyderabad, India
User avatar
mauri.menabue
Posts: 161
Joined: Thu Apr 17, 2008 2:38 pm

Re: Xbrowse Error

Post by mauri.menabue »

Hi, Nages

I don't want to be boring but that's what I meant to say about resizing column headers.

Image

I would never allow myself to teach you, you are the teacher!

TIA
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Xbrowse Error

Post by nageswaragunupudi »

I don't want to be boring


No, you are not boring at all.
Actually, you are spending your precious time by making all efforts to point out mistakes and that is a great help to us. Thank you.
I was expecting this kind of posting from you when you were asking in the other thread about how to post screen-shots.

I would never allow myself to teach you, you are the teacher!


Please never say that.
In fact, all these years, I have learnt a lot from friends like you here and I am still learning.

Coming back to the topic, do you mean to say that this code :

Code: Select all | Expand

if ::nHeaderPad > 0
if .not. :: ::nHeaderHeight == NIL
::nHeaderHeight -= ::nHeaderPad
endif
endif
if ::nFooterPad > 0
if .not. ::nFooterHeight == NIL
::nFooterHeight -= ::nFooterPad
endif
endif
::nHeaderPad := ::nFooterPad := 0
 


will solve this issue?
Regards

G. N. Rao.
Hyderabad, India
User avatar
mauri.menabue
Posts: 161
Joined: Thu Apr 17, 2008 2:38 pm

Re: Xbrowse Error

Post by mauri.menabue »

Hi, Nages
Yes it is
TIA
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: Xbrowse Error

Post by Silvio.Falconi »

Nages,
with big archive not run ok
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Xbrowse Error

Post by nageswaragunupudi »

Silvio.Falconi wrote:Nages,
with big archive not run ok


100,000 records DBF

Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: Xbrowse Error

Post by Silvio.Falconi »

nageswaragunupudi wrote:
Silvio.Falconi wrote:Nages,
with big archive not run ok


100,000 records DBF

Image


try with the dbfs I sent you this morning
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Post Reply