diff options
author | Simon Howard | 2010-12-10 23:46:22 +0000 |
---|---|---|
committer | Simon Howard | 2010-12-10 23:46:22 +0000 |
commit | d1a3967194323b08227b20822acedb837e05281a (patch) | |
tree | 39e4f4da91717159f4f82e6eb37c9fb32d306892 /textscreen/txt_scrollpane.c | |
parent | 6a2d4763a9080cf88ca9f0b588b8187963eeacf5 (diff) | |
parent | e225e0c93ce58bb0e33c174847305d39800fd755 (diff) | |
download | chocolate-doom-d1a3967194323b08227b20822acedb837e05281a.tar.gz chocolate-doom-d1a3967194323b08227b20822acedb837e05281a.tar.bz2 chocolate-doom-d1a3967194323b08227b20822acedb837e05281a.zip |
Merge from trunk.
Subversion-branch: /branches/raven-branch
Subversion-revision: 2214
Diffstat (limited to 'textscreen/txt_scrollpane.c')
-rw-r--r-- | textscreen/txt_scrollpane.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/textscreen/txt_scrollpane.c b/textscreen/txt_scrollpane.c index d81cce4b..17c9bcbf 100644 --- a/textscreen/txt_scrollpane.c +++ b/textscreen/txt_scrollpane.c @@ -138,7 +138,7 @@ static void TXT_ScrollPaneSizeCalc(TXT_UNCAST_ARG(scrollpane)) } if (scrollpane->expand_h) { - scrollpane->h = FullWidth(scrollpane); + scrollpane->h = FullHeight(scrollpane); } scrollpane->widget.w = scrollpane->w; @@ -486,8 +486,26 @@ static void TXT_ScrollPaneLayout(TXT_UNCAST_ARG(scrollpane)) } } +static int TXT_ScrollPaneSelectable(TXT_UNCAST_ARG(scrollpane)) +{ + TXT_CAST_ARG(txt_scrollpane_t, scrollpane); + + // If scroll bars are displayed, the scroll pane must be selectable + // so that we can use the arrow keys to scroll around. + + if (NeedsScrollbars(scrollpane)) + { + return 1; + } + + // Otherwise, whether this is selectable depends on the child widget. + + return TXT_SelectableWidget(scrollpane->child); +} + txt_widget_class_t txt_scrollpane_class = { + TXT_ScrollPaneSelectable, TXT_ScrollPaneSizeCalc, TXT_ScrollPaneDrawer, TXT_ScrollPaneKeyPress, |