window: rename Where to Scroll and make it enum class
This commit is contained in:
@@ -527,13 +527,13 @@ void MouseEvent::Run()
|
||||
|
||||
void ScrollUp::Run()
|
||||
{
|
||||
myScreen->scroll(NC::wUp);
|
||||
myScreen->scroll(NC::Scroll::Up);
|
||||
ListsChangeFinisher();
|
||||
}
|
||||
|
||||
void ScrollDown::Run()
|
||||
{
|
||||
myScreen->scroll(NC::wDown);
|
||||
myScreen->scroll(NC::Scroll::Down);
|
||||
ListsChangeFinisher();
|
||||
}
|
||||
|
||||
@@ -631,25 +631,25 @@ void ScrollDownAlbum::Run()
|
||||
|
||||
void PageUp::Run()
|
||||
{
|
||||
myScreen->scroll(NC::wPageUp);
|
||||
myScreen->scroll(NC::Scroll::PageUp);
|
||||
ListsChangeFinisher();
|
||||
}
|
||||
|
||||
void PageDown::Run()
|
||||
{
|
||||
myScreen->scroll(NC::wPageDown);
|
||||
myScreen->scroll(NC::Scroll::PageDown);
|
||||
ListsChangeFinisher();
|
||||
}
|
||||
|
||||
void MoveHome::Run()
|
||||
{
|
||||
myScreen->scroll(NC::wHome);
|
||||
myScreen->scroll(NC::Scroll::Home);
|
||||
ListsChangeFinisher();
|
||||
}
|
||||
|
||||
void MoveEnd::Run()
|
||||
{
|
||||
myScreen->scroll(NC::wEnd);
|
||||
myScreen->scroll(NC::Scroll::End);
|
||||
ListsChangeFinisher();
|
||||
}
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ void Browser::spacePressed()
|
||||
{
|
||||
i = w.choice();
|
||||
w.at(i).setSelected(!w.at(i).isSelected());
|
||||
w.scroll(NC::wDown);
|
||||
w.scroll(NC::Scroll::Down);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ void Browser::spacePressed()
|
||||
break;
|
||||
}
|
||||
}
|
||||
w.scroll(NC::wDown);
|
||||
w.scroll(NC::Scroll::Down);
|
||||
}
|
||||
|
||||
void Browser::mouseButtonPressed(MEVENT me)
|
||||
@@ -221,7 +221,7 @@ void Browser::mouseButtonPressed(MEVENT me)
|
||||
size_t pos = w.choice();
|
||||
spacePressed();
|
||||
if (pos < w.size()-1)
|
||||
w.scroll(NC::wUp);
|
||||
w.scroll(NC::Scroll::Up);
|
||||
}
|
||||
break;
|
||||
case itPlaylist:
|
||||
@@ -231,7 +231,7 @@ void Browser::mouseButtonPressed(MEVENT me)
|
||||
size_t pos = w.choice();
|
||||
spacePressed();
|
||||
if (pos < w.size()-1)
|
||||
w.scroll(NC::wUp);
|
||||
w.scroll(NC::Scroll::Up);
|
||||
}
|
||||
else
|
||||
enterPressed();
|
||||
|
||||
@@ -40,7 +40,7 @@ struct Clock: Screen<NC::Window>, Tabbable
|
||||
virtual ScreenType type() OVERRIDE { return ScreenType::Clock; }
|
||||
|
||||
virtual void update() OVERRIDE;
|
||||
virtual void scroll(NC::Where) OVERRIDE { }
|
||||
virtual void scroll(NC::Scroll) OVERRIDE { }
|
||||
|
||||
virtual void enterPressed() OVERRIDE { }
|
||||
virtual void spacePressed() OVERRIDE { }
|
||||
|
||||
@@ -167,7 +167,7 @@ void moveSelectedItemsUp(NC::Menu<MPD::Song> &m, F swap_fun)
|
||||
// if we move only one item, do not select it. however, if single item
|
||||
// was selected prior to move, it'll deselect it. oh well.
|
||||
list[0]->setSelected(false);
|
||||
m.scroll(NC::wUp);
|
||||
m.scroll(NC::Scroll::Up);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -201,7 +201,7 @@ void moveSelectedItemsDown(NC::Menu<MPD::Song> &m, F swap_fun)
|
||||
// if we move only one item, do not select it. however, if single item
|
||||
// was selected prior to move, it'll deselect it. oh well.
|
||||
list[0]->setSelected(false);
|
||||
m.scroll(NC::wDown);
|
||||
m.scroll(NC::Scroll::Down);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ void MediaLibrary::spacePressed()
|
||||
{
|
||||
size_t idx = Tags.choice();
|
||||
Tags[idx].setSelected(!Tags[idx].isSelected());
|
||||
Tags.scroll(NC::wDown);
|
||||
Tags.scroll(NC::Scroll::Down);
|
||||
Albums.clear();
|
||||
Songs.clear();
|
||||
}
|
||||
@@ -428,7 +428,7 @@ void MediaLibrary::spacePressed()
|
||||
{
|
||||
size_t idx = Albums.choice();
|
||||
Albums[idx].setSelected(!Albums[idx].isSelected());
|
||||
Albums.scroll(NC::wDown);
|
||||
Albums.scroll(NC::Scroll::Down);
|
||||
Songs.clear();
|
||||
}
|
||||
}
|
||||
@@ -436,7 +436,7 @@ void MediaLibrary::spacePressed()
|
||||
{
|
||||
size_t idx = Songs.choice();
|
||||
Songs[idx].setSelected(!Songs[idx].isSelected());
|
||||
Songs.scroll(NC::wDown);
|
||||
Songs.scroll(NC::Scroll::Down);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -479,7 +479,7 @@ void MediaLibrary::mouseButtonPressed(MEVENT me)
|
||||
size_t pos = Tags.choice();
|
||||
spacePressed();
|
||||
if (pos < Tags.size()-1)
|
||||
Tags.scroll(NC::wUp);
|
||||
Tags.scroll(NC::Scroll::Up);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -507,7 +507,7 @@ void MediaLibrary::mouseButtonPressed(MEVENT me)
|
||||
size_t pos = Albums.choice();
|
||||
spacePressed();
|
||||
if (pos < Albums.size()-1)
|
||||
Albums.scroll(NC::wUp);
|
||||
Albums.scroll(NC::Scroll::Up);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -526,7 +526,7 @@ void MediaLibrary::mouseButtonPressed(MEVENT me)
|
||||
size_t pos = Songs.choice();
|
||||
spacePressed();
|
||||
if (pos < Songs.size()-1)
|
||||
Songs.scroll(NC::wUp);
|
||||
Songs.scroll(NC::Scroll::Up);
|
||||
}
|
||||
else
|
||||
enterPressed();
|
||||
@@ -981,7 +981,7 @@ void MediaLibrary::AddToPlaylist(bool add_n_play)
|
||||
|
||||
if (!add_n_play)
|
||||
{
|
||||
w->scroll(NC::wDown);
|
||||
w->scroll(NC::Scroll::Down);
|
||||
if (isActiveWindow(Tags))
|
||||
{
|
||||
Albums.clear();
|
||||
|
||||
40
src/menu.h
40
src/menu.h
@@ -284,7 +284,7 @@ public:
|
||||
/// Scrolls by given amount of lines
|
||||
/// @param where indicated where exactly one wants to go
|
||||
/// @see Window::scroll()
|
||||
virtual void scroll(Where where) OVERRIDE;
|
||||
virtual void scroll(Scroll where) OVERRIDE;
|
||||
|
||||
/// Cleares all options, used filters etc. It doesn't reset highlighted position though.
|
||||
/// @see reset()
|
||||
@@ -609,9 +609,9 @@ template <typename T> void Menu<T>::refresh()
|
||||
|
||||
if (!isHighlightable(m_highlight))
|
||||
{
|
||||
scroll(wUp);
|
||||
scroll(Scroll::Up);
|
||||
if (!isHighlightable(m_highlight))
|
||||
scroll(wDown);
|
||||
scroll(Scroll::Down);
|
||||
}
|
||||
|
||||
size_t line = 0;
|
||||
@@ -655,7 +655,7 @@ template <typename T> void Menu<T>::refresh()
|
||||
Window::refresh();
|
||||
}
|
||||
|
||||
template <typename T> void Menu<T>::scroll(Where where)
|
||||
template <typename T> void Menu<T>::scroll(Scroll where)
|
||||
{
|
||||
if (m_options_ptr->empty())
|
||||
return;
|
||||
@@ -664,42 +664,42 @@ template <typename T> void Menu<T>::scroll(Where where)
|
||||
size_t max_visible_highlight = m_beginning+m_height-1;
|
||||
switch (where)
|
||||
{
|
||||
case wUp:
|
||||
case Scroll::Up:
|
||||
{
|
||||
if (m_highlight <= m_beginning && m_highlight > 0)
|
||||
--m_beginning;
|
||||
if (m_highlight == 0)
|
||||
{
|
||||
if (m_cyclic_scroll_enabled)
|
||||
return scroll(wEnd);
|
||||
return scroll(Scroll::End);
|
||||
break;
|
||||
}
|
||||
else
|
||||
--m_highlight;
|
||||
if (!isHighlightable(m_highlight))
|
||||
scroll(m_highlight == 0 && !m_cyclic_scroll_enabled ? wDown : wUp);
|
||||
scroll(m_highlight == 0 && !m_cyclic_scroll_enabled ? Scroll::Down : Scroll::Up);
|
||||
break;
|
||||
}
|
||||
case wDown:
|
||||
case Scroll::Down:
|
||||
{
|
||||
if (m_highlight >= max_visible_highlight && m_highlight < max_highlight)
|
||||
++m_beginning;
|
||||
if (m_highlight == max_highlight)
|
||||
{
|
||||
if (m_cyclic_scroll_enabled)
|
||||
return scroll(wHome);
|
||||
return scroll(Scroll::Home);
|
||||
break;
|
||||
}
|
||||
else
|
||||
++m_highlight;
|
||||
if (!isHighlightable(m_highlight))
|
||||
scroll(m_highlight == max_highlight && !m_cyclic_scroll_enabled ? wUp : wDown);
|
||||
scroll(m_highlight == max_highlight && !m_cyclic_scroll_enabled ? Scroll::Up : Scroll::Down);
|
||||
break;
|
||||
}
|
||||
case wPageUp:
|
||||
case Scroll::PageUp:
|
||||
{
|
||||
if (m_cyclic_scroll_enabled && m_highlight == 0)
|
||||
return scroll(wEnd);
|
||||
return scroll(Scroll::End);
|
||||
if (m_highlight < m_height)
|
||||
m_highlight = 0;
|
||||
else
|
||||
@@ -709,35 +709,35 @@ template <typename T> void Menu<T>::scroll(Where where)
|
||||
else
|
||||
m_beginning -= m_height;
|
||||
if (!isHighlightable(m_highlight))
|
||||
scroll(m_highlight == 0 && !m_cyclic_scroll_enabled ? wDown : wUp);
|
||||
scroll(m_highlight == 0 && !m_cyclic_scroll_enabled ? Scroll::Down : Scroll::Up);
|
||||
break;
|
||||
}
|
||||
case wPageDown:
|
||||
case Scroll::PageDown:
|
||||
{
|
||||
if (m_cyclic_scroll_enabled && m_highlight == max_highlight)
|
||||
return scroll(wHome);
|
||||
return scroll(Scroll::Home);
|
||||
m_highlight += m_height;
|
||||
m_beginning += m_height;
|
||||
m_beginning = std::min(m_beginning, max_beginning);
|
||||
m_highlight = std::min(m_highlight, max_highlight);
|
||||
if (!isHighlightable(m_highlight))
|
||||
scroll(m_highlight == max_highlight && !m_cyclic_scroll_enabled ? wUp : wDown);
|
||||
scroll(m_highlight == max_highlight && !m_cyclic_scroll_enabled ? Scroll::Up : Scroll::Down);
|
||||
break;
|
||||
}
|
||||
case wHome:
|
||||
case Scroll::Home:
|
||||
{
|
||||
m_highlight = 0;
|
||||
m_beginning = 0;
|
||||
if (!isHighlightable(m_highlight))
|
||||
scroll(wDown);
|
||||
scroll(Scroll::Down);
|
||||
break;
|
||||
}
|
||||
case wEnd:
|
||||
case Scroll::End:
|
||||
{
|
||||
m_highlight = max_highlight;
|
||||
m_beginning = max_beginning;
|
||||
if (!isHighlightable(m_highlight))
|
||||
scroll(wUp);
|
||||
scroll(Scroll::Up);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ void Playlist::spacePressed()
|
||||
if (!w.empty())
|
||||
{
|
||||
w.current().setSelected(!w.current().isSelected());
|
||||
w.scroll(NC::wDown);
|
||||
w.scroll(NC::Scroll::Down);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ void PlaylistEditor::AddToPlaylist(bool add_n_play)
|
||||
addSongToPlaylist(Content.current().value(), add_n_play);
|
||||
|
||||
if (!add_n_play)
|
||||
w->scroll(NC::wDown);
|
||||
w->scroll(NC::Scroll::Down);
|
||||
}
|
||||
|
||||
void PlaylistEditor::enterPressed()
|
||||
@@ -249,7 +249,7 @@ void PlaylistEditor::spacePressed()
|
||||
if (!Playlists.empty())
|
||||
{
|
||||
Playlists.current().setSelected(!Playlists.current().isSelected());
|
||||
Playlists.scroll(NC::wDown);
|
||||
Playlists.scroll(NC::Scroll::Down);
|
||||
}
|
||||
}
|
||||
else if (isActiveWindow(Content))
|
||||
@@ -257,7 +257,7 @@ void PlaylistEditor::spacePressed()
|
||||
if (!Content.empty())
|
||||
{
|
||||
Content.current().setSelected(!Content.current().isSelected());
|
||||
Content.scroll(NC::wDown);
|
||||
Content.scroll(NC::Scroll::Down);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -284,7 +284,7 @@ void PlaylistEditor::mouseButtonPressed(MEVENT me)
|
||||
size_t pos = Playlists.choice();
|
||||
spacePressed();
|
||||
if (pos < Playlists.size()-1)
|
||||
Playlists.scroll(NC::wUp);
|
||||
Playlists.scroll(NC::Scroll::Up);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -308,7 +308,7 @@ void PlaylistEditor::mouseButtonPressed(MEVENT me)
|
||||
size_t pos = Content.choice();
|
||||
spacePressed();
|
||||
if (pos < Content.size()-1)
|
||||
Content.scroll(NC::wUp);
|
||||
Content.scroll(NC::Scroll::Up);
|
||||
}
|
||||
else
|
||||
enterPressed();
|
||||
|
||||
@@ -45,18 +45,18 @@ void genericMouseButtonPressed(NC::Window &w, MEVENT me)
|
||||
if (me.bstate & BUTTON2_PRESSED)
|
||||
{
|
||||
if (Config.mouse_list_scroll_whole_page)
|
||||
w.scroll(NC::wPageDown);
|
||||
w.scroll(NC::Scroll::PageDown);
|
||||
else
|
||||
for (size_t i = 0; i < Config.lines_scrolled; ++i)
|
||||
w.scroll(NC::wDown);
|
||||
w.scroll(NC::Scroll::Down);
|
||||
}
|
||||
else if (me.bstate & BUTTON4_PRESSED)
|
||||
{
|
||||
if (Config.mouse_list_scroll_whole_page)
|
||||
w.scroll(NC::wPageUp);
|
||||
w.scroll(NC::Scroll::PageUp);
|
||||
else
|
||||
for (size_t i = 0; i < Config.lines_scrolled; ++i)
|
||||
w.scroll(NC::wUp);
|
||||
w.scroll(NC::Scroll::Up);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,12 +65,12 @@ void scrollpadMouseButtonPressed(NC::Scrollpad &w, MEVENT me)
|
||||
if (me.bstate & BUTTON2_PRESSED)
|
||||
{
|
||||
for (size_t i = 0; i < Config.lines_scrolled; ++i)
|
||||
w.scroll(NC::wDown);
|
||||
w.scroll(NC::Scroll::Down);
|
||||
}
|
||||
else if (me.bstate & BUTTON4_PRESSED)
|
||||
{
|
||||
for (size_t i = 0; i < Config.lines_scrolled; ++i)
|
||||
w.scroll(NC::wUp);
|
||||
w.scroll(NC::Scroll::Up);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ struct BaseScreen
|
||||
virtual void refreshWindow() = 0;
|
||||
|
||||
/// @see Screen::scroll()
|
||||
virtual void scroll(NC::Where where) = 0;
|
||||
virtual void scroll(NC::Scroll where) = 0;
|
||||
|
||||
/// Method used for switching to screen
|
||||
virtual void switchTo() = 0;
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
/// if fancy scrolling feature is disabled, enters the
|
||||
/// loop that holds main loop until user releases the key
|
||||
/// @param where indicates where one wants to scroll
|
||||
virtual void scroll(NC::Where where) OVERRIDE {
|
||||
virtual void scroll(NC::Scroll where) OVERRIDE {
|
||||
Accessor::apply(w).scroll(where);
|
||||
}
|
||||
|
||||
|
||||
@@ -130,25 +130,25 @@ void Scrollpad::resize(size_t new_width, size_t new_height)
|
||||
flush();
|
||||
}
|
||||
|
||||
void Scrollpad::scroll(Where where)
|
||||
void Scrollpad::scroll(Scroll where)
|
||||
{
|
||||
assert(m_real_height >= m_height);
|
||||
size_t max_beginning = m_real_height - m_height;
|
||||
switch (where)
|
||||
{
|
||||
case wUp:
|
||||
case Scroll::Up:
|
||||
{
|
||||
if (m_beginning > 0)
|
||||
--m_beginning;
|
||||
break;
|
||||
}
|
||||
case wDown:
|
||||
case Scroll::Down:
|
||||
{
|
||||
if (m_beginning < max_beginning)
|
||||
++m_beginning;
|
||||
break;
|
||||
}
|
||||
case wPageUp:
|
||||
case Scroll::PageUp:
|
||||
{
|
||||
if (m_beginning > m_height)
|
||||
m_beginning -= m_height;
|
||||
@@ -156,17 +156,17 @@ void Scrollpad::scroll(Where where)
|
||||
m_beginning = 0;
|
||||
break;
|
||||
}
|
||||
case wPageDown:
|
||||
case Scroll::PageDown:
|
||||
{
|
||||
m_beginning = std::min(m_beginning + m_height, max_beginning);
|
||||
break;
|
||||
}
|
||||
case wHome:
|
||||
case Scroll::Home:
|
||||
{
|
||||
m_beginning = 0;
|
||||
break;
|
||||
}
|
||||
case wEnd:
|
||||
case Scroll::End:
|
||||
{
|
||||
m_beginning = max_beginning;
|
||||
break;
|
||||
|
||||
@@ -83,7 +83,7 @@ struct Scrollpad: public Window
|
||||
/// @param where indicates where exactly one wants to go
|
||||
/// @see Window::scroll()
|
||||
///
|
||||
virtual void scroll(Where where) OVERRIDE;
|
||||
virtual void scroll(Scroll where) OVERRIDE;
|
||||
|
||||
/// Resizes the window
|
||||
/// @param new_width new window's width
|
||||
|
||||
@@ -189,8 +189,8 @@ void SearchEngine::enterPressed()
|
||||
if (Config.block_search_constraints_change)
|
||||
for (size_t i = 0; i < StaticOptions-4; ++i)
|
||||
w.at(i).setInactive(true);
|
||||
w.scroll(NC::wDown);
|
||||
w.scroll(NC::wDown);
|
||||
w.scroll(NC::Scroll::Down);
|
||||
w.scroll(NC::Scroll::Down);
|
||||
}
|
||||
else
|
||||
Statusbar::msg("No results found");
|
||||
@@ -214,12 +214,12 @@ void SearchEngine::spacePressed()
|
||||
if (Config.space_selects)
|
||||
{
|
||||
w.current().setSelected(!w.current().isSelected());
|
||||
w.scroll(NC::wDown);
|
||||
w.scroll(NC::Scroll::Down);
|
||||
return;
|
||||
}
|
||||
|
||||
addSongToPlaylist(w.current().value().song(), false);
|
||||
w.scroll(NC::wDown);
|
||||
w.scroll(NC::Scroll::Down);
|
||||
}
|
||||
|
||||
void SearchEngine::mouseButtonPressed(MEVENT me)
|
||||
@@ -240,7 +240,7 @@ void SearchEngine::mouseButtonPressed(MEVENT me)
|
||||
size_t pos = w.choice();
|
||||
spacePressed();
|
||||
if (pos < w.size()-1)
|
||||
w.scroll(NC::wUp);
|
||||
w.scroll(NC::Scroll::Up);
|
||||
}
|
||||
else
|
||||
enterPressed();
|
||||
|
||||
@@ -68,7 +68,7 @@ SelectedItemsAdder::SelectedItemsAdder()
|
||||
MainStartY+(MainHeight-m_position_selector_height)/2,
|
||||
m_position_selector_width,
|
||||
m_position_selector_height,
|
||||
"Where?",
|
||||
"Scroll?",
|
||||
Config.main_color,
|
||||
Config.window_border
|
||||
);
|
||||
|
||||
@@ -133,7 +133,7 @@ void SortPlaylistDialog::moveSortOrderDown()
|
||||
if ((cur+1)->item().second)
|
||||
{
|
||||
std::iter_swap(cur, cur+1);
|
||||
w.scroll(NC::wDown);
|
||||
w.scroll(NC::Scroll::Down);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ void SortPlaylistDialog::moveSortOrderUp()
|
||||
if (cur > w.beginV() && cur->item().second)
|
||||
{
|
||||
std::iter_swap(cur, cur-1);
|
||||
w.scroll(NC::wUp);
|
||||
w.scroll(NC::Scroll::Up);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ void TagEditor::enterPressed()
|
||||
Statusbar::unlock();
|
||||
if (new_tag != Tags->current().value().getTags(get, Config.tags_separator))
|
||||
Tags->current().value().setTags(set, new_tag, Config.tags_separator);
|
||||
Tags->scroll(NC::wDown);
|
||||
Tags->scroll(NC::Scroll::Down);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -532,7 +532,7 @@ void TagEditor::enterPressed()
|
||||
Statusbar::unlock();
|
||||
if (!new_name.empty() && new_name != old_name)
|
||||
s.setNewURI(new_name + extension);
|
||||
Tags->scroll(NC::wDown);
|
||||
Tags->scroll(NC::Scroll::Down);
|
||||
}
|
||||
}
|
||||
else if (id == 16) // capitalize first letters
|
||||
@@ -591,7 +591,7 @@ void TagEditor::spacePressed()
|
||||
if (w == Tags && !Tags->empty())
|
||||
{
|
||||
Tags->current().setSelected(!Tags->current().isSelected());
|
||||
w->scroll(NC::wDown);
|
||||
w->scroll(NC::Scroll::Down);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ struct Visualizer: Screen<NC::Window>, Tabbable
|
||||
virtual ScreenType type() OVERRIDE { return ScreenType::Visualizer; }
|
||||
|
||||
virtual void update() OVERRIDE;
|
||||
virtual void scroll(NC::Where) OVERRIDE { }
|
||||
virtual void scroll(NC::Scroll) OVERRIDE { }
|
||||
|
||||
virtual void enterPressed() OVERRIDE { }
|
||||
virtual void spacePressed() OVERRIDE;
|
||||
|
||||
@@ -795,22 +795,22 @@ int Window::getTimeout() const
|
||||
return m_window_timeout;
|
||||
}
|
||||
|
||||
void Window::scroll(Where where)
|
||||
void Window::scroll(Scroll where)
|
||||
{
|
||||
idlok(m_window, 1);
|
||||
scrollok(m_window, 1);
|
||||
switch (where)
|
||||
{
|
||||
case wUp:
|
||||
case Scroll::Up:
|
||||
wscrl(m_window, 1);
|
||||
break;
|
||||
case wDown:
|
||||
case Scroll::Down:
|
||||
wscrl(m_window, -1);
|
||||
break;
|
||||
case wPageUp:
|
||||
case Scroll::PageUp:
|
||||
wscrl(m_window, m_width);
|
||||
break;
|
||||
case wPageDown:
|
||||
case Scroll::PageDown:
|
||||
wscrl(m_window, -m_width);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -127,7 +127,7 @@ enum Format {
|
||||
enum Border { brNone, brBlack, brRed, brGreen, brYellow, brBlue, brMagenta, brCyan, brWhite };
|
||||
|
||||
/// This indicates how much the window has to be scrolled
|
||||
enum Where { wUp, wDown, wPageUp, wPageDown, wHome, wEnd };
|
||||
enum class Scroll { Up, Down, PageUp, PageDown, Home, End };
|
||||
|
||||
/// Helper function that is invoked each time one will want
|
||||
/// to obtain string from Window::getString() function
|
||||
@@ -334,7 +334,7 @@ struct Window
|
||||
|
||||
/// Scrolls the window by amount of lines given in its parameter
|
||||
/// @param where indicates how many lines it has to scroll
|
||||
virtual void scroll(Where where);
|
||||
virtual void scroll(Scroll where);
|
||||
|
||||
/// Applies function of compatible prototype to internal WINDOW pointer
|
||||
/// The mostly used function in this case seem to be wclrtoeol(), which
|
||||
|
||||
Reference in New Issue
Block a user