listbox: use CListHelpers

Origin commit data
------------------
Branch: ni/coolstream
Commit: 156acb1039
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2016-01-16 (Sat, 16 Jan 2016)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2016-01-16 18:30:32 +01:00
parent 0faf26485b
commit 3a8514bb77
2 changed files with 8 additions and 27 deletions

View File

@@ -186,33 +186,13 @@ int CListBox::exec(CMenuTarget* parent, const std::string & /*actionKey*/)
{
loop = false;
}
else if (msg == CRCInput::RC_up || (int) msg == g_settings.key_pageup)
else if (msg == CRCInput::RC_up || (int) msg == g_settings.key_pageup ||
msg == CRCInput::RC_down || (int) msg == g_settings.key_pagedown)
{
if(getItemCount()!=0) {
int step = (msg == (neutrino_msg_t)g_settings.key_pageup) ? listmaxshow : 1; // browse or step 1
int new_selected = selected - step;
if (new_selected < 0) {
if (selected != 0 && step != 1)
new_selected = 0;
else
new_selected = getItemCount() - 1;
}
updateSelection(new_selected);
}
}
else if (msg == CRCInput::RC_down || (int) msg == g_settings.key_pagedown)
{
if(getItemCount()!=0) {
int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1
int new_selected = selected + step;
if (new_selected > (int) getItemCount() - 1) {
if ((selected != getItemCount() - 1))
new_selected = getItemCount() - 1;
else
new_selected = 0;
}
updateSelection(new_selected);
if (getItemCount() != 0) {
int new_selected = UpDownKey((int)getItemCount(), msg, listmaxshow, selected);
if (new_selected >= 0)
updateSelection(new_selected);
}
}
else if (msg == (neutrino_msg_t) g_settings.key_list_start || msg == (neutrino_msg_t) g_settings.key_list_end) {

View File

@@ -26,12 +26,13 @@
#define __listbox__
#include "menue.h"
#include "listhelpers.h"
#include <driver/framebuffer.h>
#include <string>
class CListBox : public CMenuTarget
class CListBox : public CMenuTarget, public CListHelpers
{
protected:
CFrameBuffer* frameBuffer;