diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2012-09-14 15:40:31 +0200 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2012-09-14 16:16:22 +0200 |
commit | 4d6ea660bcbf8c5f4e61ad51d6f6bb739b4cb3a7 (patch) | |
tree | 5e501aea8cb65d63e72013f29607a864ff9f9f29 /src/help.cpp | |
parent | 9e93f7baf970821c7613353326406e65086d0d9e (diff) |
make defining screens with main window type as non-pointer possible
Diffstat (limited to 'src/help.cpp')
-rw-r--r-- | src/help.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/help.cpp b/src/help.cpp index 3bb0c0cf..13fcd1aa 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -96,18 +96,18 @@ std::string keyToString(const Key &key, bool *print_backspace) } Help::Help() +: Screen(NC::Scrollpad(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone)) { - w = new NC::Scrollpad(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone); GetKeybindings(); - w->flush(); + w.flush(); } void Help::resize() { size_t x_offset, width; getWindowResizeParams(x_offset, width); - w->resize(width, MainHeight); - w->moveTo(x_offset, MainStartY); + w.resize(width, MainHeight); + w.moveTo(x_offset, MainStartY); hasToBeResized = 0; } @@ -154,25 +154,25 @@ std::string Help::DisplayKeys(const ActionType at) void Help::Section(const char *type, const char *title_) { - *w << L"\n " << NC::fmtBold << ToWString(type) << L" - "; - *w << ToWString(title_) << NC::fmtBoldEnd << L"\n\n"; + w << L"\n " << NC::fmtBold << ToWString(type) << L" - "; + w << ToWString(title_) << NC::fmtBoldEnd << L"\n\n"; } void Help::KeyDesc(const ActionType at, const char *desc) { - *w << L" " << DisplayKeys(at) << L" : " << ToWString(desc) << '\n'; + w << L" " << DisplayKeys(at) << L" : " << ToWString(desc) << '\n'; } void Help::MouseDesc(std::string action, const char *desc, bool indent) { action.resize(31 - (indent ? 2 : 0), ' '); - *w << L" " << (indent ? L" " : L"") << ToWString(action); - *w << L": " << ToWString(desc) << '\n'; + w << L" " << (indent ? L" " : L"") << ToWString(action); + w << L": " << ToWString(desc) << '\n'; } void Help::MouseColumn(const char *column) { - *w << NC::fmtBold << L" " << ToWString(column) << L" column:\n" << NC::fmtBoldEnd; + w << NC::fmtBold << L" " << ToWString(column) << L" column:\n" << NC::fmtBoldEnd; } void Help::GetKeybindings() @@ -188,7 +188,7 @@ void Help::GetKeybindings() KeyDesc(aPageDown, "Page down"); KeyDesc(aMoveHome, "Home"); KeyDesc(aMoveEnd, "End"); - *w << '\n'; + w << '\n'; if (Config.screen_switcher_previous) { KeyDesc(aNextScreen, "Switch between current and last screen"); @@ -217,7 +217,7 @@ void Help::GetKeybindings() # ifdef ENABLE_CLOCK KeyDesc(aShowClock, "Show clock"); # endif // ENABLE_CLOCK - *w << '\n'; + w << '\n'; KeyDesc(aShowServerInfo, "Show server info"); KeysSection("Global"); @@ -230,7 +230,7 @@ void Help::GetKeybindings() KeyDesc(aSeekBackward, "Seek backward in playing song"); KeyDesc(aVolumeDown, "Decrease volume by 2%"); KeyDesc(aVolumeUp, "Increase volume by 2%"); - *w << '\n'; + w << '\n'; KeyDesc(aToggleSpaceMode, "Toggle space mode (select/add)"); KeyDesc(aToggleAddMode, "Toggle add mode (add or remove/always add)"); KeyDesc(aToggleMouse, "Toggle mouse support"); @@ -239,7 +239,7 @@ void Help::GetKeybindings() KeyDesc(aSelectAlbum, "Select songs of album around the cursor"); KeyDesc(aAddSelectedItems, "Add selected items to playlist"); KeyDesc(aAddRandomItems, "Add random items to playlist"); - *w << '\n'; + w << '\n'; KeyDesc(aToggleRepeat, "Toggle repeat mode"); KeyDesc(aToggleRandom, "Toggle random mode"); KeyDesc(aToggleSingle, "Toggle single mode"); @@ -250,7 +250,7 @@ void Help::GetKeybindings() KeyDesc(aToggleCrossfade, "Toggle crossfade mode"); KeyDesc(aSetCrossfade, "Set crossfade"); KeyDesc(aUpdateDatabase, "Start music database update"); - *w << '\n'; + w << '\n'; KeyDesc(aApplyFilter, "Apply filter"); KeyDesc(aFindItemForward, "Find item forward"); KeyDesc(aFindItemBackward, "Find item backward"); @@ -276,7 +276,7 @@ void Help::GetKeybindings() KeyDesc(aToggleFetchingLyricsInBackground, "Toggle fetching lyrics for playing songs in background"); # endif // HAVE_CURL_CURL_H KeyDesc(aShowLyrics, "Show/hide song lyrics"); - *w << '\n'; + w << '\n'; KeyDesc(aQuit, "Quit"); KeysSection("Playlist"); @@ -386,7 +386,7 @@ void Help::GetKeybindings() MouseSection("Global"); MouseDesc("Left click on \"Playing/Paused\"", "Play/pause"); MouseDesc("Left click on progressbar", "Jump to pointed position in playing song"); - *w << '\n'; + w << '\n'; MouseDesc("Mouse wheel on \"Volume: xx\"", "Play/pause"); MouseDesc("Mouse wheel on main window", "Scroll"); @@ -397,7 +397,7 @@ void Help::GetKeybindings() MouseSection("Browser"); MouseDesc("Left click on directory", "Enter pointed directory"); MouseDesc("Right click on directory", "Add pointed directory to playlist"); - *w << '\n'; + w << '\n'; MouseDesc("Left click on song/playlist", "Add pointed item to playlist"); MouseDesc("Right click on song/playlist", "Add pointed item to playlist and play it"); @@ -409,7 +409,7 @@ void Help::GetKeybindings() MouseColumn("Left/middle"); MouseDesc("Left click", "Select pointed item", true); MouseDesc("Right click", "Add item to playlist", true); - *w << '\n'; + w << '\n'; MouseColumn("Right"); MouseDesc("Left Click", "Add pointed item to playlist", true); MouseDesc("Right Click", "Add pointed item to playlist and play it", true); @@ -418,7 +418,7 @@ void Help::GetKeybindings() MouseColumn("Left"); MouseDesc("Left click", "Select pointed item", true); MouseDesc("Right click", "Add item to playlist", true); - *w << '\n'; + w << '\n'; MouseColumn("Right"); MouseDesc("Left click", "Add pointed item to playlist", true); MouseDesc("Right click", "Add pointed item to playlist and play it", true); @@ -432,11 +432,11 @@ void Help::GetKeybindings() MouseColumn("Left"); MouseDesc("Left click", "Enter pointed directory/select pointed album", true); MouseDesc("Right click", "Toggle view (directories/albums)", true); - *w << '\n'; + w << '\n'; MouseColumn("Middle"); MouseDesc("Left click", "Select option", true); MouseDesc("Right click", "Set value/execute", true); - *w << '\n'; + w << '\n'; MouseColumn("Right"); MouseDesc("Left click", "Select pointed item", true); MouseDesc("Right click", "Set value", true); |