API cleanup, fix some lingering InvalWindowRects

This commit is contained in:
elasota
2020-03-14 06:38:46 -04:00
parent 3d37ded31d
commit cea0bde015
18 changed files with 37 additions and 213 deletions

View File

@@ -229,7 +229,6 @@ int16_t LoadFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
return kScrollDownItem;
case PL_KEY_SPECIAL(kUpArrow):
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
thisHouseIndex -= 4;
if (thisHouseIndex < 0)
{
@@ -243,23 +242,20 @@ int16_t LoadFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
if (thisHouseIndex >= screenCount)
thisHouseIndex -= 4;
}
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
UpdateLoadDialog(dial);
return 0;
case PL_KEY_SPECIAL(kDownArrow):
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
thisHouseIndex += 4;
screenCount = housesFound - housePage;
if (screenCount > kDispFiles)
screenCount = kDispFiles;
if (thisHouseIndex >= screenCount)
thisHouseIndex %= 4;
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
UpdateLoadDialog(dial);
return 0;
case PL_KEY_SPECIAL(kLeftArrow):
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
thisHouseIndex--;
if (thisHouseIndex < 0)
{
@@ -268,19 +264,18 @@ int16_t LoadFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
screenCount = kDispFiles;
thisHouseIndex = screenCount - 1;
}
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
UpdateLoadDialog(dial);
return 0;
case PL_KEY_SPECIAL(kTab):
case PL_KEY_SPECIAL(kRightArrow):
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
thisHouseIndex++;
screenCount = housesFound - housePage;
if (screenCount > kDispFiles)
screenCount = kDispFiles;
if (thisHouseIndex >= screenCount)
thisHouseIndex = 0;
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
UpdateLoadDialog(dial);
return 0;
default:
@@ -308,10 +303,7 @@ int16_t LoadFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
thisHouseIndex = screenCount - 1;
}
if (wasIndex != thisHouseIndex)
{
InvalWindowRect(dial->GetWindow(), &loadHouseRects[wasIndex]);
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
}
UpdateLoadDialog(dial);
}
return 0;
}