Page 1 of 2

Problem in listbox (to Antonio)

Posted: Thu Jan 14, 2010 9:41 am
by driessen
Antonio,

Since I use FWH 9.12, I noticed a problem in the listbox.

In the scrollbar, the block which can be used to scroll, has vanished. Also, the arrows on the scrollbar can't be used. The only way to scroll, is using the arrow keys on my keyboard.

If I use FWH 9.11 again, the block in the scrollbar is back and everything is running fine.

What is the cause of this behaviour ?

Thanks a lot in advance.

Re: Problem in listbox

Posted: Thu Jan 14, 2010 10:15 am
by Antonio Linares
Michel,

Please comment this line in FWH\source\classes\scrllbar.prg:

Code: Select all

METHOD SetPage( nSize, lReDraw ) CLASS TScrollBar

   local nFlags

   DEFAULT lRedraw := .f.

   // nSize = Max( 10, nSize )
   
   if ! Empty( ::hWnd )
      ...
 

Re: Problem in listbox

Posted: Thu Jan 14, 2010 11:16 pm
by driessen
Antonio,

I'm sorry but your suggestion is not helping.

I still use FWH 9.12 but I added SCRLLBAR.PRG from FWH 9.11.
Everything is working fine now.

Thanks for your help.

Re: Problem in listbox

Posted: Thu Jan 14, 2010 11:28 pm
by Antonio Linares
Michel,

These are the only changes from FWH 9.11 to 9.12 in Class TScrollBar:
Image
Commenting the line that I told you it should solve it.

Re: Problem in listbox

Posted: Fri Jan 15, 2010 11:16 pm
by driessen
Antonio,

I'm leaving on holidays for the week to come.

I'll try it out when I'm back. If necessary I put a message here.

Thanks a lot for your efforts.

Re: Problem in listbox

Posted: Wed Jan 27, 2010 5:20 pm
by driessen
Antonio,

I took a closer look at the problem in the scrollbar of the listbox.

Even in FWH 10.1 I noticed that the problem is in SCRLLBAR.PRG. The cause has to be found in this code :

Code: Select all

METHOD SetPage( nSize, lReDraw ) CLASS TScrollBar

   local nFlags

   DEFAULT lRedraw := .f.

   // nSize = Max( 10, nSize )

   if ! Empty( ::hWnd )
      nFlags = SB_CTL
   else
      if ::lVertical
         nFlags = SB_VERT
      else
         nFlags = SB_HORZ
      endif
   endif

   ::nPgStep = nSize

   SetScrollInfo( If( ! Empty( ::hWnd ), ::hWnd, ::oWnd:hWnd ),;
                  nFlags, nSize, lReDraw )

return nil
 
No block is visible in the scrollbar.

If I change it this way (/* and */) :

Code: Select all

METHOD SetPage( nSize, lReDraw ) CLASS TScrollBar

/*
   local nFlags

   DEFAULT lRedraw := .f.

   // nSize = Max( 10, nSize )

   if ! Empty( ::hWnd )
      nFlags = SB_CTL
   else
      if ::lVertical
         nFlags = SB_VERT
      else
         nFlags = SB_HORZ
      endif
   endif

   ::nPgStep = nSize

   SetScrollInfo( If( ! Empty( ::hWnd ), ::hWnd, ::oWnd:hWnd ),;
                  nFlags, nSize, lReDraw )
*/

return nil
 
everything is working fine. The block is visible and useable in the scrollbar.

Any idea ?

Thanks a lot in advance.

Re: Problem in listbox

Posted: Thu Jan 28, 2010 5:00 pm
by driessen
Antonio,

Were you already able to look at the problem in the scrollbar ?

Thank you in advance.

Re: Problem in listbox

Posted: Sun Jan 31, 2010 9:12 pm
by driessen
Antonio,

Were you already able to read my question ?

Thanks.

Re: Problem in listbox (to Antonio)

Posted: Sun Jan 31, 2010 9:13 pm
by Enrico Maria Giordano
Can you show a reduced and self contained sample of the problem?

EMG

Re: Problem in listbox (to Antonio)

Posted: Sun Jan 31, 2010 11:22 pm
by Antonio Linares
Michel,

Yes, it seems as we are wrongly calling SetScrollInfo().

As a temporary workaround you can do as you have done: simply comment out the entire method source code.

Re: Problem in listbox (to Antonio)

Posted: Mon Feb 01, 2010 12:04 am
by driessen
To Antonio.

Antonio, I looked to some previous versions of FWH.

In FWH 9.01 till 9.11, the setpage methode is commented out completely.

In FWH 9.12, the methode is activated. At this moment, the problem has started.

I comment it out again (also in FWH 10.1) and everything is working fine again.

Thanks.


To Enrico.

In any example where a listbox is used, the problem occurs.

Re: Problem in listbox (to Antonio)

Posted: Mon Feb 01, 2010 8:31 am
by Enrico Maria Giordano
Ok. Try adding the following source to scrllbar.prg:

Code: Select all

#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

HB_FUNC( SETSCROLLRANGE )
{
   SCROLLINFO si;

   si.cbSize = sizeof( si );
   si.fMask  = SIF_PAGE | SIF_RANGE | SIF_DISABLENOSCROLL;
   si.nPage = 1;
   si.nMin  = hb_parni( 3 );
   si.nMax  = hb_parni( 4 );

   hb_retnl( SetScrollInfo( ( HWND ) hb_parnl( 1 ), hb_parni( 2 ), &si, hb_parl( 5 ) ) );
}

#pragma ENDDUMP
EMG

Re: Problem in listbox (to Antonio)

Posted: Mon Feb 01, 2010 10:12 am
by driessen
Enrico,

Thanks a lot.

Your solution saved the problem.

Antonio,

Could you correct SCRLLBAR.PRG in FWH 10.2 ?

Thanks a lot.

Re: Problem in listbox (to Antonio)

Posted: Mon Feb 01, 2010 10:51 am
by Antonio Linares
Michel,

Fix included for next FWH 10.2 :-)

Enrico, many thanks! :-)

Re: Problem in listbox (to Antonio)

Posted: Mon Feb 01, 2010 12:19 pm
by driessen
Antonio,

Thanks a lot.