Announcement

Collapse
No announcement yet.

About Lances Scrollbar example

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • About Lances Scrollbar example

    Lance, how can u use your example scrollbar with a
    listbox ?

    Here is the problem. I have a formatted array, that
    is, items that have several 'fields' within each item.
    Now using %LBS_USETABSTOPS makes it work great and
    after more than one 'page' is sent to the listbox you
    can scroll up and down by clicking an item and using
    the arrows or page up/down.

    But, the scrollbar (%LBS_DISABLENOSCROLL) doesnt show up.
    Now i can remove the USE TABSTOPS and the scrollbar works
    but the chr$(9)'s display vertical bars and so the
    fields dont line up.

    How would i use your control and display the correct
    information in the listbox according to where the
    scrollbar is located ? Or dues this involve an sdk
    procedure (which this one is not).

    I really dont want to have to create a fixed font unless
    absolutely necessary (though things would line up a little
    better that way i suppose).



    ------------------
    Client Writeup for the CPA

    buffs.proboards2.com

    Links Page

  • #2
    Originally posted by Fred Buffington:
    Lance, how can u use your example scrollbar with a
    listbox ?
    Personally, I would use the scrollbar service provided by the LISTBOX control itself, rather than control the view position with a sibling SCROLLBAR control. It is certainly possible, but it means you have to implement a lot of the functionality of a native LISTBOX yourself.

    Have you hade a look at the LISTBOX scroll width example I recently posted, rather than the more-recent SCROLLBAR example?

    But, the scrollbar (%LBS_DISABLENOSCROLL) doesnt show up.
    Possibly you omitted something from your description here? Did you add %WS_VSCROLL to the LISTBOX style?

    Or are you talking about the horizontal scrollbar here? If so, you must specify the %WS_HSCROLL style for the LISTBOX, and then use the %LB_SETHORIZONTALEXTENT

    Now i can remove the USE TABSTOPS and the scrollbar works
    but the chr$(9)'s display vertical bars and so the
    fields dont line up.
    If you use embedded tabs, you'll have to stick with the %LB_USETABSTOPS style.

    How would i use your control and display the correct
    information in the listbox according to where the
    scrollbar is located ? Or dues this involve an sdk
    procedure (which this one is not).
    As I said, I'd use the built-in LISTBOX scrollbar, however, to use a sibling (vertical) SCROLLBAR control, you'd have to use %LB_SETTOPINDEX to set the LISTBOX position according to the relative position of the sibling SCROLLBAR control.
    For the horizontal position - possibly you'd have to send %WM_HSCROLL messages to the LISTBOX control.

    I really dont want to have to create a fixed font unless
    absolutely necessary (though things would line up a little
    better that way i suppose).
    The font itself is really irrelevent as far as the total width of the LISTBOX - as I demonstrated recently in my LISTBOX width example code. However, setting the tabstop positions is a bit more difficult with a proportional font, as you'd have to work out the widest element of each column to derive the total width and individual column width.

    Fred, after saying all of that, I'm still not clear on whether you are talking about a horz or vert scrollbar - I may have confused the issues rather than clarified it for you!

    Can you explain (in more detail) exactly what you want to achieve? Thanks!


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Thanks Lance, got it working using
      %LBS_USETABSTOPS OR %WS_VSCROLL in the listbox style

      Since that (vscroll) wasn't listed in the book at least as
      one of the options for style, i didnt think you could use it.

      Perhaps there is a notation somewhere that I just missed that
      the styles/extstyles may not be all inclusive in the discription
      of each dialog control statements.


      ------------------
      Client Writeup for the CPA

      buffs.proboards2.com

      Links Page

      Comment


      • #4
        Ideally, all of the possible valid styles should be included in the documentation, and we aim to have significantly improved the doc's for the next update.

        In general, most control styles supported by standard controls are supported by DDT. If in doubt about a currently unlisted style then try it... at worst you'll crash the app but it will more than likely work fine!

        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment

        Working...
        X