Page 3 of 3

Re: Scrollbars missing

Posted: Thu Feb 20, 2014 5:02 pm
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

Re: Scrollbars missing

Posted: Thu Feb 20, 2014 5:03 pm
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

Re: Scrollbars missing

Posted: Thu Feb 20, 2014 6:13 pm
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

Re: Scrollbars missing

Posted: Thu Feb 20, 2014 10:49 pm
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

Re: Scrollbars missing

Posted: Thu Feb 20, 2014 11:19 pm
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

Re: Scrollbars missing

Posted: Fri Feb 21, 2014 10:12 am
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.

Re: Scrollbars missing

Posted: Fri Feb 21, 2014 2:48 pm
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

Re: Scrollbars missing

Posted: Sun Feb 23, 2014 8:52 pm
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