Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TScrollBar's fly away, when an other TWindow becomes the focus.#128

Answeredbymagiblot
paule32 asked this question inQ&A
Discussion options

this is the normal view (when the blue window have the focus):
grafik

this is the view, when the green window have the focus.
you can see, that the TScrollBar's are missing ?
grafik

And this is the view on focus the blue window.
See the TScrollBar at right side of the TListBox - it will be change when I resize the window:
grafik

The TMyListBox, which I suib class (inherited from TListBox) will be stay on the place (it moves with resize of the blue window) but it does not change the size itself. So, when the blue window becomes a minimum, the TMyListBox will be override the bottom Frame. But it is okay - it work fine.

Thanks for reading, and watching
paule32

You must be logged in to vote

Hi Jens,

The disappearing scrollbars are a design feature of Turbo Vision. In your case, the logic that is being applied is inTEditor::setState andTListViewer::setState. These methods hide or show the scrollbars on purpose.

In order to change this behaviour, you should override these methods in your own subclass. I believe the simplest solution may be to always call theshow() method on the scrollbars, like this:

voidTMyEditor::setState(ushort aState,bool enable){TEditor::setState(aState, enable);if (hScrollBar)        hScrollBar->show();if (vScrollBar)        vScrollBar->show();}voidTMyListBox::setState(ushort aState,bool enable){TListBox::setState(aState…

Replies: 1 comment 2 replies

Comment options

Hi Jens,

The disappearing scrollbars are a design feature of Turbo Vision. In your case, the logic that is being applied is inTEditor::setState andTListViewer::setState. These methods hide or show the scrollbars on purpose.

In order to change this behaviour, you should override these methods in your own subclass. I believe the simplest solution may be to always call theshow() method on the scrollbars, like this:

voidTMyEditor::setState(ushort aState,bool enable){TEditor::setState(aState, enable);if (hScrollBar)        hScrollBar->show();if (vScrollBar)        vScrollBar->show();}voidTMyListBox::setState(ushort aState,bool enable){TListBox::setState(aState, enable);if (hScrollBar)        hScrollBar->show();if (vScrollBar)        vScrollBar->show();}

When it comes to the size of the list box, the issue is again the propertygrowMode. In this case you should set it togfGrowHiX | gfGrowHiY.

You must be logged in to vote
2 replies
@paule32
Comment options

This is my ListBox code:

class TMyListBox : public TListBox {public:    TMyListBox(        const TRect& listBounds,        int   cols ,        TScrollBar * listScrollBar):        TListBox( listBounds,  cols, listScrollBar) {        growMode = gfGrowHiX | gfGrowHiY;    }};

when I use this, the Listbox will overwrite the rest of the window:
grafik

@paule32
Comment options

okay, I have done it with this Code:

class TMyListBox : public TListBox {public:    TMyListBox(        const TRect& listBounds,        int   cols ,        TScrollBar * listScrollBar):        TListBox( listBounds,  cols, listScrollBar) {        growMode = gfGrowHiX | gfGrowHiY | gfGrowLoX;    }};
Answer selected bypaule32
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@paule32@magiblot

[8]ページ先頭

©2009-2025 Movatter.jp