ListBox with no scroll bar - OS2

This is a discussion on ListBox with no scroll bar - OS2 ; Is it posible to create a ListBox without the vertical scroll bar?. I mean that it doesnīt show. Today I get a disable scroll bar, I just don īt want it until I get more elements that I can show. ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: ListBox with no scroll bar

  1. ListBox with no scroll bar

    Is it posible to create a ListBox without the vertical scroll bar?. I
    mean that it doesnīt show. Today I get a disable scroll bar, I just don
    īt want it until I get more elements that I can show.

    Thanks in advance

    Leonardo Pino


  2. Re: ListBox with no scroll bar

    As far as I know there is no way to create a listbox window without a
    vertical scroll bar. It is possible to destroy the vertical scroll bar using
    WinDestroyWindow, but this does not give you a "clean window" just a white
    area where the scroll bar was with a grey line to the left.
    Even then you can add more elements than will be shown on the screen. Using
    the keyboard interface it is still possible to scroll etc.
    Why not use a MLE as here you can disable both vertical and horizontal
    scrolling

    Keith



    "lpino" wrote in message
    news:1176473443.723229.230110@n76g2000hsh.googlegr oups.com...
    Is it posible to create a ListBox without the vertical scroll bar?. I
    mean that it doesnīt show. Today I get a disable scroll bar, I just don
    īt want it until I get more elements that I can show.

    Thanks in advance

    Leonardo Pino



  3. Re: ListBox with no scroll bar

    On 17 abr, 05:18, "Keith" wrote:
    > As far as I know there is no way to create a listbox window without a
    > vertical scroll bar. It is possible to destroy the vertical scroll bar using
    > WinDestroyWindow, but this does not give you a "clean window" just a white
    > area where the scroll bar was with a grey line to the left.
    > Even then you can add more elements than will be shown on the screen. Using
    > the keyboard interface it is still possible to scroll etc.
    > Why not use a MLE as here you can disable both vertical and horizontal
    > scrolling
    >
    > Keith
    >


    It's not really a funtional requirement. I'm working on the port of
    SWT and the behaviour of the List class contemplates having a listbox
    without vertical scroll bar as a default style. For me it's not a big
    deal, maybe we will have to ignore that fact and accept it as part of
    the OS/2 port. For now it's much more important to complete all the
    widgets ASAP.

    Thanks anyway.


  4. Re: ListBox with no scroll bar

    lpino wrote:
    > On 17 abr, 05:18, "Keith" wrote:
    >
    >>As far as I know there is no way to create a listbox window without a
    >>vertical scroll bar. It is possible to destroy the vertical scroll bar using
    >>WinDestroyWindow, but this does not give you a "clean window" just a white
    >>area where the scroll bar was with a grey line to the left.
    >>Even then you can add more elements than will be shown on the screen. Using
    >>the keyboard interface it is still possible to scroll etc.
    >>Why not use a MLE as here you can disable both vertical and horizontal
    >>scrolling
    >>
    >>Keith

    >
    > It's not really a funtional requirement. I'm working on the port of
    > SWT and the behaviour of the List class contemplates having a listbox
    > without vertical scroll bar as a default style. For me it's not a big
    > deal, maybe we will have to ignore that fact and accept it as part of
    > the OS/2 port. For now it's much more important to complete all the
    > widgets ASAP.
    >
    > Thanks anyway.


    I wouldn't recommend destroying the scrollbar. The built-in window
    procedure might get bent out of shape about that. But you can hide it.

    Try something like this:

    HWND hwndChild, listBoxHWND;
    HENUM hEnum;
    unsigned char className[8] = { 0 };

    hEnum = WinBeginEnumWindows( listBoxHWND );

    while ( hwndChild = WinGetNextWindow( hEnum ) )
    {
    // Yeah... I know... bad practice

    if ( WinQueryClassName( hwndChild, 8, className ) )
    {
    className[7] = 0;
    if ( strcmp( "#8", className ) == 0 )
    {
    // WC_SCROLLBAR!
    WinShowWindow( hwndChild, FALSE );
    }
    }
    }

    WinEndEnumWindows( hEnum );

    --
    [Reverse the parts of the e-mail address to reply.]

  5. Re: ListBox with no scroll bar

    Hi Leanardo,

    I know this was some time ago but I just spotted this info when I was
    looking for something else. If you want to specify no vertical scroll bar
    you just need to add

    LS_NOVERTSCROLL

    to the style of the list box

    Keith Merrington


    "lpino" wrote in message
    news:1176473443.723229.230110@n76g2000hsh.googlegr oups.com...
    Is it posible to create a ListBox without the vertical scroll bar?. I
    mean that it doesnīt show. Today I get a disable scroll bar, I just don
    īt want it until I get more elements that I can show.

    Thanks in advance

    Leonardo Pino



  6. Re: ListBox with no scroll bar

    On Fri, 13 Jul 2007 09:29:01 UTC, "Keith Merrington"
    wrote:

    > LS_NOVERTSCROLL


    I cannot find that in any of my toolkit headers.
    What's the numeric value ?


    --
    Ruediger "Rudi" Ihle [S&T Systemtechnik GmbH, Germany]
    http://www.s-t.de
    Please remove all characters left of the "R" in my email address


  7. Re: ListBox with no scroll bar

    Keith Merrington schrieb:
    > Hi Leanardo,
    >
    > I know this was some time ago but I just spotted this info when I was
    > looking for something else. If you want to specify no vertical scroll bar
    > you just need to add
    >
    > LS_NOVERTSCROLL
    >
    > to the style of the list box
    >
    > Keith Merrington


    I don't see such a constant. But, the listbox contains the two
    scrollbars as children of the listbox with:
    a.) ID = 0xC001 for vertical scrollbar
    b.) ID = 0xC002 for horizontal scrollbar

    it should be possible to reduce the width (cx) of the vertical scrollbar
    to 0 via WinSetWindowPos. I just tried it (use PMTREE.EXE), it works but
    it looks ugly and it keeps the space occupied ...

    Lars

  8. Re: ListBox with no scroll bar

    OOps,

    I hadn't read the full text contained in my book os/2 Presentation Manager
    Programming Hints & Tips by Bryan Goodyer
    LS_NOVERTSCROLL

    Was documented in the Presentation Manager Programming Reference Manual
    (volume 2, version 1.2, page 16-1).

    However, it was NEVER implemented in the product and so is not available for
    use.

    The documented approach is to enumerate the listbox's windows for the scroll
    bars, and then destroy them:

    hwndListbox = WinWindowFromlD(hwndDlg, ID_LISTBOX);

    hEnum = WinBeginEnumWindows (hwndListbox);

    while (hwndChild = WinGetNextWindow(hEnum))

    {

    if

    (WinQuerywindowULong(hwfldChild, QWL_STYLE) & SBS_VERT)

    hwndVbar = hwndChild; /* SBS_VERT = 1, SBS_HORZ = 0 *7
    else

    hwndHbar hwndChild;

    }

    WinEndEnumWindows (hEnum);

    WinDestroyWindow (hwndVbar)

    WinDestroyWindow (hwndHbar)



    Keith Merrington



+ Reply to Thread