Fixed dropdown menu glitches

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6774 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-01-19 14:06:50 +00:00
parent 27db170b39
commit e1b1712205
3 changed files with 29 additions and 28 deletions
+2 -2
View File
@@ -348,8 +348,8 @@ DropDownBase::Display_Drop()
void void
DropDownBase::DrawTopEntry() DropDownBase::DrawTopEntry()
{ {
if ( mSelectedEntry >= mEntryVector.size() ) // make sure we don't get bogus values
return; mSelectedEntry = min(mSelectedEntry, mEntryVector.size() - 1);
//display the name in the list //display the name in the list
ColorFillVideoSurfaceArea( FRAME_BUFFER, musStartX+4, musStartY+4, musStartX+musWidth-4, musStartY+musFontHeight+8, mColorMarked ); ColorFillVideoSurfaceArea( FRAME_BUFFER, musStartX+4, musStartY+4, musStartX+musWidth-4, musStartY+musFontHeight+8, mColorMarked );
+14 -14
View File
@@ -236,13 +236,13 @@ public:
// this function has to be implemented! // this function has to be implemented!
virtual void SetRefresh(); virtual void SetRefresh();
static void OpenDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDownBase*>(mpSelf)->OpenDropDownRegionCallBack(pRegion, iReason); } static void OpenDropDown_DropDown(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDownBase*>(mpSelf)->OpenDropDownRegionCallBack(pRegion, iReason); }
static void CloseDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDownBase*>(mpSelf)->CloseDropDownRegionCallBack(pRegion, iReason); } static void CloseDropDown_DropDown(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDownBase*>(mpSelf)->CloseDropDownRegionCallBack(pRegion, iReason); }
static void SelectRegionDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDownBase*>(mpSelf)->SelectDropDownRegionCallBack(pRegion, iReason); } static void SelectRegionDropDown_DropDown(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDownBase*>(mpSelf)->SelectDropDownRegionCallBack(pRegion, iReason); }
static void SelectMovementDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDownBase*>(mpSelf)->SelectDropDownMovementCallBack(pRegion, iReason); } static void SelectMovementDropDown_DropDown(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDownBase*>(mpSelf)->SelectDropDownMovementCallBack(pRegion, iReason); }
static void SelectArrowDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDownBase*>(mpSelf)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); } static void SelectArrowDropDown_DropDown(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDownBase*>(mpSelf)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); }
static void SelectScrollRegionDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDownBase*>(mpSelf)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); } static void SelectScrollRegionDropDown_DropDown(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDownBase*>(mpSelf)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); }
static void SelectScrollMovementDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDownBase*>(mpSelf)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); } static void SelectScrollMovementDropDown_DropDown(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDownBase*>(mpSelf)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); }
MOUSE_CALLBACK MOUSE_CALLBACK
CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) )
@@ -252,25 +252,25 @@ public:
switch ( arg ) switch ( arg )
{ {
case DROPDOWN_OPEN: case DROPDOWN_OPEN:
return &OpenDropDown_DropDown_Appearance; return &OpenDropDown_DropDown;
break; break;
case DROPDOWN_CLOSE: case DROPDOWN_CLOSE:
return &CloseDropDown_DropDown_Appearance; return &CloseDropDown_DropDown;
break; break;
case DROPDOWN_REGION: case DROPDOWN_REGION:
return &SelectRegionDropDown_DropDown_Appearance; return &SelectRegionDropDown_DropDown;
break; break;
case DROPDOWN_MOVEMENT: case DROPDOWN_MOVEMENT:
return &SelectMovementDropDown_DropDown_Appearance; return &SelectMovementDropDown_DropDown;
break; break;
case DROPDOWN_ARROW: case DROPDOWN_ARROW:
return &SelectArrowDropDown_DropDown_Appearance; return &SelectArrowDropDown_DropDown;
break; break;
case DROPDOWN_SCROLL_REGION: case DROPDOWN_SCROLL_REGION:
return &SelectScrollRegionDropDown_DropDown_Appearance; return &SelectScrollRegionDropDown_DropDown;
break; break;
case DROPDOWN_SCROLL_MOVEMENT: case DROPDOWN_SCROLL_MOVEMENT:
return &SelectScrollMovementDropDown_DropDown_Appearance; return &SelectScrollMovementDropDown_DropDown;
break; break;
} }
+10 -9
View File
@@ -251,16 +251,17 @@ void RenderIMPPrejudice( void )
IMPPrejudiceDisplay(); IMPPrejudiceDisplay();
DropDownTemplate<DROPDOWNNR_APPEARANCE>::getInstance().Display(); // reversed order - lower boxes first. It is otherwise possible that open boxes are overlayed by closed boxes
DropDownTemplate<DROPDOWNNR_APPEARANCECARE>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_REFINEMENT>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_REFINEMENTCARE>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_NATIONALITY>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_HATEDNATIONALITY>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_HATEDNATIONALITYCARE>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_RACIST>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_RACE>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_SEXIST>::getInstance().Display(); DropDownTemplate<DROPDOWNNR_SEXIST>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_RACE>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_RACIST>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_HATEDNATIONALITYCARE>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_HATEDNATIONALITY>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_NATIONALITY>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_REFINEMENTCARE>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_REFINEMENT>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_APPEARANCECARE>::getInstance().Display();
DropDownTemplate<DROPDOWNNR_APPEARANCE>::getInstance().Display();
} }