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

View File

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

View File

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

View File

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

View File

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

View File

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