FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem in listbox (to Antonio)
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Problem in listbox (to Antonio)
Posted: Thu Jan 14, 2010 09:41 AM

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.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problem in listbox
Posted: Thu Jan 14, 2010 10:15 AM
Michel,

Please comment this line in FWH\source\classes\scrllbar.prg:
Code (fw): Select all Collapse
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
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Problem in listbox
Posted: Thu Jan 14, 2010 11:16 PM

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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problem in listbox
Posted: Thu Jan 14, 2010 11:28 PM
Michel,

These are the only changes from FWH 9.11 to 9.12 in Class TScrollBar:

Commenting the line that I told you it should solve it.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Problem in listbox
Posted: Fri Jan 15, 2010 11:16 PM

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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Problem in listbox
Posted: Wed Jan 27, 2010 05:20 PM
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 (fw): Select all Collapse
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 (fw): Select all Collapse
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, ::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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Problem in listbox
Posted: Thu Jan 28, 2010 05:00 PM

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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Problem in listbox
Posted: Sun Jan 31, 2010 09:12 PM

Antonio,

Were you already able to read my question ?

Thanks.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem in listbox (to Antonio)
Posted: Sun Jan 31, 2010 09:13 PM

Can you show a reduced and self contained sample of the problem?

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problem in listbox (to Antonio)
Posted: Sun Jan 31, 2010 11:22 PM

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
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Problem in listbox (to Antonio)
Posted: Mon Feb 01, 2010 12:04 AM

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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem in listbox (to Antonio)
Posted: Mon Feb 01, 2010 08:31 AM
Ok. Try adding the following source to scrllbar.prg:

Code (fw): Select all Collapse
#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
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Problem in listbox (to Antonio)
Posted: Mon Feb 01, 2010 10:12 AM

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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problem in listbox (to Antonio)
Posted: Mon Feb 01, 2010 10:51 AM

Michel,

Fix included for next FWH 10.2 :-)

Enrico, many thanks! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Problem in listbox (to Antonio)
Posted: Mon Feb 01, 2010 12:19 PM

Antonio,

Thanks a lot.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773