throw away Menu::GetPosition() as Menu::Choice() does the same

oh cool, I forgot that such function already exists under different name ~~
This commit is contained in:
Andrzej Rybczak
2009-05-26 22:11:49 +02:00
parent 5519e5c9bc
commit 10a9427270
6 changed files with 9 additions and 11 deletions

View File

@@ -276,7 +276,7 @@ void Browser::MouseButtonPressed(MEVENT me)
}
else
{
size_t pos = w->GetPosition();
size_t pos = w->Choice();
SpacePressed();
if (pos < w->Size()-1)
w->Scroll(wUp);
@@ -286,7 +286,7 @@ void Browser::MouseButtonPressed(MEVENT me)
case itSong:
if (me.bstate & BUTTON1_PRESSED)
{
size_t pos = w->GetPosition();
size_t pos = w->Choice();
SpacePressed();
if (pos < w->Size()-1)
w->Scroll(wUp);

View File

@@ -373,7 +373,7 @@ void MediaLibrary::MouseButtonPressed(MEVENT me)
Songs->Goto(me.y);
if (me.bstate & BUTTON1_PRESSED)
{
size_t pos = Songs->GetPosition();
size_t pos = Songs->Choice();
SpacePressed();
if (pos < Songs->Size()-1)
Songs->Scroll(wUp);

View File

@@ -120,8 +120,6 @@ namespace NCurses
void Move(size_t from, size_t to);
bool Goto(size_t y);
size_t GetPosition() const { return itsHighlight; }
bool isBold(int id = -1);
void BoldOption(int index, bool bold);

View File

@@ -69,14 +69,14 @@ void Outputs::EnterPressed()
{
if (w->Current().second)
{
if (Mpd->DisableOutput(w->GetPosition()))
if (Mpd->DisableOutput(w->Choice()))
ShowMessage("Output \"%s\" disabled", w->Current().first.c_str());
w->Current().second = 0;
w->BoldOption(w->Choice(), 0);
}
else
{
if (Mpd->EnableOutput(w->GetPosition()))
if (Mpd->EnableOutput(w->Choice()))
ShowMessage("Output \"%s\" enabled", w->Current().first.c_str());
w->Current().second = 1;
w->BoldOption(w->Choice(), 1);

View File

@@ -306,7 +306,7 @@ void PlaylistEditor::MouseButtonPressed(MEVENT me)
Content->Goto(me.y);
if (me.bstate & BUTTON1_PRESSED)
{
size_t pos = Content->GetPosition();
size_t pos = Content->Choice();
SpacePressed();
if (pos < Content->Size()-1)
Content->Scroll(wUp);

View File

@@ -304,13 +304,13 @@ void SearchEngine::MouseButtonPressed(MEVENT me)
if (!w->Goto(me.y))
return;
w->Refresh();
if ((me.bstate & BUTTON3_PRESSED || w->GetPosition() > 10) && w->GetPosition() < StaticOptions)
if ((me.bstate & BUTTON3_PRESSED || w->Choice() > 10) && w->Choice() < StaticOptions)
EnterPressed();
else if (w->GetPosition() >= StaticOptions)
else if (w->Choice() >= StaticOptions)
{
if (me.bstate & BUTTON1_PRESSED)
{
size_t pos = w->GetPosition();
size_t pos = w->Choice();
SpacePressed();
if (pos < w->Size()-1)
w->Scroll(wUp);