Scrollbars missing

User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Scrollbars missing

Post by James Bott »

Enrico,

Code: Select all

oXbrw := TXBrowse():new():CreateFromResource( 11 )
All my xbrowses are made with code so I have no experience with creating one from a resource. I note that the above line creates a browse with all fields in the database.

I am wondering how one would just add specified fields? Can you provide an example? Do you have to delete all the default fields first, then add only the ones you want?

James
User avatar
Greg Gammon
Posts: 105
Joined: Fri Jun 09, 2006 3:27 pm
Location: Bryan, Texas

Re: Scrollbars missing

Post by Greg Gammon »

I'll experiment with that and see what I can get to work. I'll probably just wait and edit the .rc file when I have finished updating dialogs and then go from there.
G
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Scrollbars missing

Post by Enrico Maria Giordano »

James,
James Bott wrote:Enrico,

Code: Select all

oXbrw := TXBrowse():new():CreateFromResource( 11 )
All my xbrowses are made with code so I have no experience with creating one from a resource. I note that the above line creates a browse with all fields in the database.

I am wondering how one would just add specified fields? Can you provide an example? Do you have to delete all the default fields first, then add only the ones you want?

James
Sorry, I'm not familiar with TXBrowse. However, you can find many samples in your FWH samples directory.

EMG
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Scrollbars missing

Post by James Bott »

Greg,

Here is another option--use xbrowse instead of wbrowse. It looks like it is syntax compatible so there would only be one change to your source code.

Code: Select all

        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
You would just have to change LISTBOX to XBROWSE. Of course, you still have to convert the resource to a custom control.

Adding these lines gets you a much nicer looking browse:

Code: Select all

        oBrw:nMarqueeStyle    := MARQSTYLE_HIGHLROW
        oBrw:lRecordSelector  := .f.
        oBrw:nStretchCol      := STRETCHCOL_LAST
        oBrw:nRowDividerStyle := LINESTYLE_LIGHTGRAY
James
User avatar
Greg Gammon
Posts: 105
Joined: Fri Jun 09, 2006 3:27 pm
Location: Bryan, Texas

Re: Scrollbars missing

Post by Greg Gammon »

James...thanks again! I will have time this weekend to try these suggestions and will let you know how it works out.
G
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: Scrollbars missing

Post by StefanHaupt »

Greg,
I guess I need to switch to a different resource editor that will use native .rc file.
I suggest to use the resource editor of PellesC, it´s free and very good.
kind regards
Stefan
User avatar
Greg Gammon
Posts: 105
Joined: Fri Jun 09, 2006 3:27 pm
Location: Bryan, Texas

Re: Scrollbars missing

Post by Greg Gammon »

Thanks Stefan. I actually looked at that a while back but the download I did had malware attached. Do you have a good download link?
G
User avatar
Greg Gammon
Posts: 105
Joined: Fri Jun 09, 2006 3:27 pm
Location: Bryan, Texas

Re: Scrollbars missing

Post by Greg Gammon »

Problem is solved thanks to everyone's help!

I downloaded Pelles C that allows me to use just the .rc file for GUI design (ResEdit uses a binary file and then saves as RC after finishing).

The only thing I had to do was a search and replace in the .rc file replacing "listbox" with "twbrowse". I will begin to experiment with xbrowse soon.

Again, thanks for all the help!

Greg
Post Reply