Problem in listbox (to Antonio)

User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Problem in listbox (to Antonio)

Post 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.
Last edited by driessen on Sun Jan 31, 2010 9:12 pm, edited 1 time in total.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Problem in listbox

Post 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 )
      ...
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Problem in listbox

Post 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.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Problem in listbox

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Problem in listbox

Post 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.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Problem in listbox

Post 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.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Problem in listbox

Post by driessen »

Antonio,

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

Thank you in advance.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Problem in listbox

Post by driessen »

Antonio,

Were you already able to read my question ?

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Problem in listbox (to Antonio)

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Problem in listbox (to Antonio)

Post 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.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Problem in listbox (to Antonio)

Post 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
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Problem in listbox (to Antonio)

Post by driessen »

Enrico,

Thanks a lot.

Your solution saved the problem.

Antonio,

Could you correct SCRLLBAR.PRG in FWH 10.2 ?

Thanks a lot.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Problem in listbox (to Antonio)

Post by Antonio Linares »

Michel,

Fix included for next FWH 10.2 :-)

Enrico, many thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Problem in listbox (to Antonio)

Post by driessen »

Antonio,

Thanks a lot.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Post Reply