FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Scrollbars missing
Posts: 105
Joined: Fri Jun 09, 2006 03:27 PM
Scrollbars missing
Posted: Thu Feb 06, 2014 07:51 PM

I have recently noticed that none of my Listboxes have scrollbars, just blank space where the scrollbar used to be. This is only after my update to FWH 13.11 and most recent Harbour downloaded from Fivetech site.

I looked at other posts on this matter from a few years ago but it seemed to be resolved. I have tried all the fixes recommended but with no results.

I need a fix for this please!

Thanks,
GG

Regards,

Greg Gammon
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Scrollbars missing
Posted: Thu Feb 06, 2014 09:54 PM

Greg

Are you using the ListBox class or xBrowse ?? I would like to look at your .rc or code if you don't mind posting it.

Rick Lipkin

Posts: 105
Joined: Fri Jun 09, 2006 03:27 PM
Re: Scrollbars missing
Posted: Thu Feb 06, 2014 10:08 PM
Im using Listbox Rick. Here is snippet of sourcecode...very simple:
Code (fw): Select all Collapse
        REDEFINE LISTBOX oLbx FIELDS bscust->custno, bscust->company, bscust->city, bscust->phone ;
        HEADER "Custno", "Company", "City", "Phone" ;
        FONT oFontList ;
        ON DBLCLICK (oDlg1:end(), mExit := .T. ) ;
        ID 1003 OF oDlg1 UPDATE


Here is the relevant code from the .rc file (I use resedit to create resources):

Code (fw): Select all Collapse
LANGUAGE 9, SUBLANG_DEFAULT
118 DIALOG 15, 45, 364, 230
STYLE DS_ABSALIGN | DS_MODALFRAME | DS_SETFONT | WS_POPUP
EXSTYLE WS_EX_OVERLAPPEDWINDOW
FONT 10, "System"
{
    LISTBOX         1003, 15, 49, 335, 145, WS_GROUP | WS_TABSTOP | NOT LBS_NOTIFY | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN
    EDITTEXT        1000, 65, 24, 140, 12, ES_AUTOHSCROLL
    PUSHBUTTON      "Find", 1001, 215, 24, 30, 12
    PUSHBUTTON      "Select", 1009, 65, 205, 40, 12
    PUSHBUTTON      "Close", 1010, 15, 205, 40, 12
    LTEXT           "Find Company", 65535, 15, 25, 48, 8, SS_LEFT
    EDITTEXT        100, 0, 0, 364, 14, ES_AUTOHSCROLL | ES_READONLY


I have tried every permutation of scrollbar setting in ResEdit for the Listbox resource and it has no apparent change.

Thanks in advance for your help!

Greg
Regards,

Greg Gammon
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Scrollbars missing
Posted: Fri Feb 07, 2014 01:12 AM

How many records have the database?

Have you tried the example:
\fwh\samples\testlbx5.prg

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Scrollbars missing
Posted: Fri Feb 07, 2014 09:47 AM
Greg,

Greg Gammon wrote:
Code (fw): Select all Collapse
LISTBOX         1003, 15, 49, 335, 145, WS_GROUP | WS_TABSTOP | NOT LBS_NOTIFY | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN




LISTBOX refers to the standard Windows listbox control, not the FWH TWBrowse. You have to use this instead:

Code (fw): Select all Collapse
CONTROL "", 1003, "TWBrowse", WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP, 15, 49, 335, 145


EMG
Posts: 105
Joined: Fri Jun 09, 2006 03:27 PM
Re: Scrollbars missing
Posted: Fri Feb 07, 2014 04:49 PM

Christobal,
I will look at that next this weekend when I am back at my development machine.
Thanks,
Greg

Enrico,
WOW...that would be a major problem for me to have to do as I am continually updating resources in ResEdit. Since the .rc file is generated from the .res file, I would have to manually go in and edit every Listbox instance? Is there any other way to deal with this?

Thanks,
Greg

Regards,

Greg Gammon
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Scrollbars missing
Posted: Fri Feb 07, 2014 06:17 PM
Greg,

Greg Gammon wrote:Enrico,
WOW...that would be a major problem for me to have to do as I am continually updating resources in ResEdit. Since the .rc file is generated from the .res file, I would have to manually go in and edit every Listbox instance? Is there any other way to deal with this?


No that I'm aware of, sorry. :-)

EMG
Posts: 105
Joined: Fri Jun 09, 2006 03:27 PM
Re: Scrollbars missing
Posted: Fri Feb 07, 2014 11:17 PM

Well thanks for the help so far. I think I am going to wait and see if there is another solution perhaps when Antonio is back.
All the scrollbars used to work in my previous FWH version (which was back in the 2.7 range I believe) so perhaps I can #include prg code from a previous version to fix this problem?

Thanks,
Greg

Regards,

Greg Gammon
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Scrollbars missing
Posted: Mon Feb 10, 2014 05:59 PM
I have tried every permutation of scrollbar setting in ResEdit for the Listbox resource and it has no apparent change.


Code (fw): Select all Collapse
LISTBOX         1003, 15, 49, 335, 145, WS_GROUP | WS_TABSTOP | NOT LBS_NOTIFY | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN


I don't see WS_VSCROLL in the style in your RC file. You need to check Vertical Scroll in the resource editor. If ResEdit doesn't have that option, then you may need to manually edit the style in ResEdit and add it. If it does have that option, then check it, and save the RC file, then load it into a text editor and confirm the WS_VSCROLL is in the style.

Perhaps you were using Borland's resource editor before and now you are using a different resource editor so maybe that is why you are now having the problem.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 105
Joined: Fri Jun 09, 2006 03:27 PM
Re: Scrollbars missing
Posted: Mon Feb 10, 2014 06:19 PM

James,
I will double check that when I get back from a trip. I have used ResEdit from the beginning, and have tried check/uncheck of every scroll bar option ( and combinations) in resources. But I will look at the .rc file and see what the options actually do. Thanks for the tip.
G

Regards,

Greg Gammon
Posts: 105
Joined: Fri Jun 09, 2006 03:27 PM
Re: Scrollbars missing
Posted: Tue Feb 18, 2014 10:27 PM
James,

Here is the Listbox line in the .rc file:
LISTBOX 1003, 15, 45, 336, 152, WS_TABSTOP | WS_VSCROLL | LBS_NOINTEGRALHEIGHT | LBS_NOTIFY

I have tried several permutations from resources with no change in behavior. Oddly enough I can't get it to show NO SCROLL either....its just consistently showing a blank area where a scrollbar should be. I could go either way on this....no scroll bar would be fine...I just don't like the blank spot on the right of the listbox. Setting no scroll in the resources has no effect either.

I have also tried hard-coding in WS_VSCROLL to the Listbox:
Code (fw): Select all Collapse
        REDEFINE LISTBOX oLbx FIELDS bscust->custno, bscust->company, bscust->city, bscust->phone ;
        HEADER "Custno", "Company", "City", "Phone" ;
        FONT oFontList ;
        ON DBLCLICK (oDlg1:end(), mExit := .T. ) ;
        ID 1003 OF oDlg1 UPDATE
        Postmessage( oLbx,  nOr( WS_CHILD, WS_VSCROLL, WS_BORDER, WS_VISIBLE, WS_TABSTOP) )


Just flumoxed why this no longer works when I upgraded FWH and Habour.

Greg
Regards,

Greg Gammon
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Scrollbars missing
Posted: Wed Feb 19, 2014 03:13 AM

Greg,

I did some testing and it does seem that the missing scrollbar is a bug. I expect that it has not been noticed because most of us are now using TXBrowse because it is so much more powerful. But, I do understand why you are looking for a quick fix.

I have been mucking around in the TWBrowse class code looking for the problem but have not found it yet. I will look some more when I have some free time.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Scrollbars missing
Posted: Wed Feb 19, 2014 04:30 AM
For anyone insterested, here is my test program, I just used FWH/samples/customers.dbf for the data file.

Code (fw): Select all Collapse
// Purpose: Simple test of LISTBOX (TWBrowse)
// Date   : 2/18/2014

#include "fivewin.ch"

Function Main()

   LOCAL oDlg, oLbx

   USE customer

   DEFINE DIALOG oDlg resource "DIALOG1"

   REDEFINE LISTBOX oLbx fields FIRST, LAST ID 10 OF oDlg

   // Things I tried without success.
   //oLbx:bLogicLen := { || If( reccount() == 0, 1, reccount() ) }
   //Postmessage( oLbx,  nOr( WS_CHILD, WS_VSCROLL, WS_BORDER, WS_VISIBLE, WS_TABSTOP) )

   //oLbx:=nil  // no effect

   //oLbx:setRange( 1, reccount() ) // getting a setrange() does not exist message

   //oLbx:=.t. // no effect

   ACTIVATE DIALOG oDlg

return nil


And here is the RC file made using Borland Workshop:
Code (fw): Select all Collapse
/****************************************************************************

test01.rc

produced by Borland Resource Workshop

*****************************************************************************/

#define DIALOG_1    1
#define IDC_LISTBOX1    10

DIALOG1 DIALOG 6, 15, 275, 111
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "DIALOG1"
FONT 8, "MS Sans Serif"
{
 LISTBOX IDC_LISTBOX1, 20, 15, 235, 75, LBS_STANDARD
}
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Scrollbars missing
Posted: Wed Feb 19, 2014 05:14 AM

I don't think this is a good solution but it is a workaround.

In Borland Workshop if you check "scroll bar always" then the scrollbar shows.

This changes the RC file to:

LISTBOX IDC_LISTBOX1, 20, 15, 235, 75, LBS_STANDARD | LBS_DISABLENOSCROLL

Note that is has just added "LBS_DISABLENOSCROLL"

Note also that I had already tried adding WS_VSCROLL to the style in the RC file (using a text editor) and it didn't help.

The reason that this is not a good fix, is that you cannot have no scrollbar when there are not enough records to fill the browse.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 105
Joined: Fri Jun 09, 2006 03:27 PM
Re: Scrollbars missing
Posted: Wed Feb 19, 2014 03:18 PM

James,
I really appreciate your work on this! I guess I just need to switch over to the xbrowse class. Just as a quick test I replaced my #include from tcbrowse to xbrowse and recompiled. I had one module error where I use an actual BROWSE and just commented it out to recompile and see what I get. No scrollbars still! But I may have to go back into resources and double check setups there again. Any tips on changing from tc to xbrowse?
Greg

Regards,

Greg Gammon