diff --git a/Laptop/DropDown.cpp b/Laptop/DropDown.cpp index 1673b6fa..fb628db5 100644 --- a/Laptop/DropDown.cpp +++ b/Laptop/DropDown.cpp @@ -53,7 +53,7 @@ void Display2Line2ShadowVertical( UINT16 usStartX, UINT16 usStartY, UINT16 EndY, DisplaySmallLine(usStartX+3, usStartY, usStartX+3, EndY, usColor2); } -DropDown::DropDown() +DropDownBase::DropDownBase() { // default settings musWidth = 100; // width of text field @@ -61,6 +61,8 @@ DropDown::DropDown() mEntryVector.clear(); + swprintf( mHelpText, L"" ); + mSelectedEntry = 0; mFirstShownEntry = 0; @@ -71,7 +73,7 @@ DropDown::DropDown() } void -DropDown::Init(UINT16 sX, UINT16 sY) +DropDownBase::Init(UINT16 sX, UINT16 sY) { mfMouseRegionsCreated = FALSE; @@ -99,7 +101,7 @@ DropDown::Init(UINT16 sX, UINT16 sY) } void -DropDown::Init_Drop() +DropDownBase::Init_Drop() { mfMouseRegionsCreated_Drop = FALSE; @@ -115,7 +117,7 @@ DropDown::Init_Drop() void * gDropObj; void -DropDown::Create(UINT16 sX, UINT16 sY) +DropDownBase::Create(UINT16 sX, UINT16 sY) { if( mfMouseRegionsCreated ) { @@ -135,21 +137,24 @@ DropDown::Create(UINT16 sX, UINT16 sY) gDropObj = (void*) this; MSYS_DefineRegion( &mSelectedOpenDropDownRegion, musStartX + musWidth, musStartY, musStartX + musWidth + musArrowWidth, musStartY + DEF_SCROLL_ARROW_HEIGHT, MSYS_PRIORITY_HIGH, - CURSOR_WWW, MSYS_NO_CALLBACK, CallBackWrapper((void*) this, DROPDOWN_OPEN, &DropDown::Dummyfunc) ); - + CURSOR_WWW, MSYS_NO_CALLBACK, CallBackWrapper((void*) this, DROPDOWN_OPEN, &DropDownBase::Dummyfunc) ); MSYS_AddRegion(&mSelectedOpenDropDownRegion); //click anywhere on the screen to close the window( only when the drop down window is active) MSYS_DefineRegion( &mSelectedCloseDropDownRegion, LAPTOP_SCREEN_UL_X, LAPTOP_SCREEN_WEB_UL_Y , LAPTOP_SCREEN_LR_X, LAPTOP_SCREEN_WEB_LR_Y, MSYS_PRIORITY_HIGH-1, - CURSOR_LAPTOP_SCREEN, MSYS_NO_CALLBACK, CallBackWrapper((void*) this, DROPDOWN_CLOSE, &DropDown::Dummyfunc) ); + CURSOR_LAPTOP_SCREEN, MSYS_NO_CALLBACK, CallBackWrapper((void*) this, DROPDOWN_CLOSE, &DropDownBase::Dummyfunc) ); MSYS_AddRegion(&mSelectedCloseDropDownRegion); MSYS_DisableRegion(&mSelectedCloseDropDownRegion); + MSYS_DefineRegion( &mBubbleHelpRegion, musStartX, musStartY, musStartX + musWidth, musStartY + DEF_SCROLL_ARROW_HEIGHT, MSYS_PRIORITY_HIGH, + CURSOR_WWW, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK ); + MSYS_AddRegion(&mBubbleHelpRegion); + mfMouseRegionsCreated = TRUE; } void -DropDown::Create_Drop() +DropDownBase::Create_Drop() { if( mfMouseRegionsCreated_Drop ) { @@ -166,7 +171,7 @@ DropDown::Create_Drop() for( i=0; i< DROPDOWN_REGIONS; ++i) { MSYS_DefineRegion( &mDropDownRegion[i], usPosX, (UINT16)(usPosY+4), (UINT16)(usPosX+musWidth-6), (UINT16)(usPosY+musFontHeight+7), MSYS_PRIORITY_HIGH, - CURSOR_WWW, CallBackWrapper((void*) this, DROPDOWN_MOVEMENT, &DropDown::Dummyfunc), CallBackWrapper((void*) this, DROPDOWN_REGION, &DropDown::Dummyfunc)); + CURSOR_WWW, CallBackWrapper((void*) this, DROPDOWN_MOVEMENT, &DropDownBase::Dummyfunc), CallBackWrapper((void*) this, DROPDOWN_REGION, &DropDownBase::Dummyfunc)); MSYS_AddRegion(&mDropDownRegion[i]); MSYS_SetRegionUserData( &mDropDownRegion[ i ], 0, i); @@ -181,7 +186,7 @@ DropDown::Create_Drop() for(i=0; i<2; ++i) { MSYS_DefineRegion( &mgSelectedUpDownArrowOnScrollAreaRegion[i], usPosX, usPosY, (UINT16)(usPosX+musWidth), (UINT16)(usPosY+DEF_SCROLL_ARROW_HEIGHT), MSYS_PRIORITY_HIGH, - CURSOR_WWW, MSYS_NO_CALLBACK, CallBackWrapper((void*) this, DROPDOWN_ARROW, &DropDown::Dummyfunc)); + CURSOR_WWW, MSYS_NO_CALLBACK, CallBackWrapper((void*) this, DROPDOWN_ARROW, &DropDownBase::Dummyfunc)); MSYS_AddRegion(&mgSelectedUpDownArrowOnScrollAreaRegion[i]); MSYS_SetRegionUserData( &mgSelectedUpDownArrowOnScrollAreaRegion[ i ], 0, i); usPosX = musDownArrowX; @@ -196,14 +201,14 @@ DropDown::Create_Drop() for(i=0; i 0 ) + { + SetRegionFastHelpText( &mBubbleHelpRegion, mHelpText ); + SetRegionHelpEndCallback( &mBubbleHelpRegion, MSYS_NO_CALLBACK ); + } InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y); @@ -297,7 +310,7 @@ DropDown::Display() void -DropDown::Display_Drop() +DropDownBase::Display_Drop() { if( !mfMouseRegionsCreated_Drop ) return; @@ -339,7 +352,7 @@ DropDown::Display_Drop() } void -DropDown::DrawTopEntry() +DropDownBase::DrawTopEntry() { if ( mSelectedEntry >= mEntryVector.size() ) return; @@ -355,7 +368,7 @@ DropDown::DrawTopEntry() } void -DropDown::DrawSelectedCity() +DropDownBase::DrawSelectedCity() { UINT16 usPosY = musStartY_Drop; UINT16 usMaxY = 0; @@ -386,7 +399,7 @@ DropDown::DrawSelectedCity() } void -DropDown::DrawGoldRectangle() +DropDownBase::DrawGoldRectangle() { UINT32 uiDestPitchBYTES; UINT8 *pDestBuf; @@ -431,7 +444,7 @@ DropDown::DrawGoldRectangle() } void -DropDown::SelectDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 reason ) +DropDownBase::SelectDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 reason ) { if( reason & MSYS_CALLBACK_REASON_LOST_MOUSE ) { @@ -453,7 +466,7 @@ DropDown::SelectDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 reason ) } void -DropDown::SelectDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) +DropDownBase::SelectDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) { if (iReason & MSYS_CALLBACK_REASON_INIT) { @@ -468,7 +481,7 @@ DropDown::SelectDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) } void -DropDown::SelectUpDownArrowOnScrollAreaRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) +DropDownBase::SelectUpDownArrowOnScrollAreaRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) { if (iReason & MSYS_CALLBACK_REASON_INIT) { @@ -505,7 +518,7 @@ DropDown::SelectUpDownArrowOnScrollAreaRegionCallBack(MOUSE_REGION * pRegion, IN } void -DropDown::SelectScrollAreaDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 reason ) +DropDownBase::SelectScrollAreaDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 reason ) { if( reason & MSYS_CALLBACK_REASON_LOST_MOUSE ) { @@ -545,7 +558,7 @@ DropDown::SelectScrollAreaDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 } void -DropDown::SelectScrollAreaDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) +DropDownBase::SelectScrollAreaDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) { if (iReason & MSYS_CALLBACK_REASON_INIT) { @@ -599,7 +612,7 @@ DropDown::SelectScrollAreaDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 i } void -DropDown::OpenDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) +DropDownBase::OpenDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) { if (iReason & MSYS_CALLBACK_REASON_INIT) { @@ -612,7 +625,7 @@ DropDown::OpenDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) } void -DropDown::CloseDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) +DropDownBase::CloseDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) { if (iReason & MSYS_CALLBACK_REASON_INIT) { @@ -622,3 +635,4 @@ DropDown::CloseDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) Destroy_Drop(); } } + diff --git a/Laptop/DropDown.h b/Laptop/DropDown.h index 6522d974..6d964f24 100644 --- a/Laptop/DropDown.h +++ b/Laptop/DropDown.h @@ -19,98 +19,32 @@ void Display2Line2ShadowHorizontal( UINT16 usStartX, UINT16 usStartY, UINT16 End #define DROPDOWN_REGIONS 8 /* - * As we cannot directly add our callbacks (we need a static callback due to the way MSYS_DefineRegion(...) works, which utterly fails if we have multiple instance of a class) we - * use a very odd looking workaround. - * For every DropDown you need, you have to inherit from this class and fill CallBackWrapper(...). You then need a static pointer to an instance of your class, and a wrapper for each callback - * that will then call the correct callback. The derived class will also have to be a singleton, otherwise callbacks for multiple instances will always refer to the last created one. - * This seems a lot of work and pretty absurd, but I've found no better workaround without changing MSYS_DefineRegion(), as it expects a MOUSE_CALLBACK and not voi* pointers to objects. - * On the plus side, you can simply copy this code: - - Definition: - class DropDown_Example : public DropDown - { - public: - static DropDown_Example& getInstance() - { - static DropDown_Example instance; // Guaranteed to be destroyed. - // Instantiated on first use. - return instance; - } - - virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ); - - //somehow refresh display, otherwise DropDownA will write over itself and other stuff - // this function has to be implemented! - virtual void SetRefresh() - { - // do stuff here... - } - - private: - DropDown_Example() {}; // private constructor, so we cannot create more instances - - // declare but don't define - DropDown_Example(DropDown_Example const&); - void operator=(DropDown_Example const&); - }; - - Declaration: - void * gPtrDropDown_Example; - void OpenDropDown_Example(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Example)->OpenDropDownRegionCallBack(pRegion, iReason); } - void CloseDropDown_Example(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Example)->CloseDropDownRegionCallBack(pRegion, iReason); } - void SelectRegionDropDown_Example(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Example)->SelectDropDownRegionCallBack(pRegion, iReason); } - void SelectMovementDropDown_Example(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Example)->SelectDropDownMovementCallBack(pRegion, iReason); } - void SelectArrowDropDown_Example(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Example)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); } - void SelectScrollRegionDropDown_Example(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Example)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); } - void SelectScrollMovementDropDown_Example(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Example)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); } - - MOUSE_CALLBACK - DropDown_Example::CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) - { - gPtrDropDown_Example = pt2Object; - - switch ( arg ) - { - case DROPDOWN_OPEN: - return &OpenDropDown_Example; - break; - case DROPDOWN_CLOSE: - return &CloseDropDown_Example; - break; - case DROPDOWN_REGION: - return &SelectRegionDropDown_Example; - break; - case DROPDOWN_MOVEMENT: - return &SelectMovementDropDown_Example; - break; - case DROPDOWN_ARROW: - return &SelectArrowDropDown_Example; - break; - case DROPDOWN_SCROLL_REGION: - return &SelectScrollRegionDropDown_Example; - break; - case DROPDOWN_SCROLL_MOVEMENT: - return &SelectScrollMovementDropDown_Example; - break; - } - - return *pt2Function; - } - + * As we cannot directly add our callbacks (we need a static callback due to the way MSYS_DefineRegion(...) works, which utterly fails if we have multiple instance of a class), + * we use a very odd looking workaround. + * We do not directly use DropDownBase. Instead we use DropDownTemplate, which is a template taking an int N. This template is a singleton. This means that for each N, there can only be one + * instance of the class. This is necessary as we internally need a unique static self-pointer. + * If you try to have two instances on the same screen, only one will show, which will be confusing. So simply use a separate N fore each instance. See IMP Prejudice.cpp to get an idea of how that is done. + * + * Apart from that, you will only have to implement void SetRefresh(). This function is necessary to refresh the screen after the popup-section is closed, otherwise it will still be shown. + * + * As this class refreshes itself once you have properly implemented SetRefresh(), you can even move the box aroun onscreen, it will properly refresh, so moving it with a mouse will be possible + * + * You can get an instance by calling DropDownTemplate.Create(UINT16 usX, UINT16 usY);, the constructor itself is private (singleton). + Usage: std::vector > entryvecDropDown_Appearance; for(UINT8 i = 0; i < NUM_APPEARANCES; ++i) entryvecDropDown_Appearance.push_back( std::make_pair(i, szAppearanceText[i]) ); - DropDown_Appearance::getInstance().SetEntries(entryvecDropDown_Appearance); - DropDown_Appearance::getInstance().Create(usX, usY); + DropDownTemplate.SetEntries(entryvecDropDown_Appearance); + DropDownTemplate.Create(usX, usY); ... */ -class DropDown +class DropDownBase { public: - DropDown(); + DropDownBase(); /* * Create a Dropdown with upper left coordinates @@ -123,7 +57,7 @@ public: void Destroy(); /* - * Display DropDown. Use this when refreshing + * Display DropDownBase. Use this when refreshing */ void Display(); @@ -147,23 +81,7 @@ public: DROPDOWN_SCROLL_REGION, DROPDOWN_SCROLL_MOVEMENT, }; - - // call to open/close the drop down - void OpenDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ); - void CloseDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ); - - void SelectDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ); - void SelectDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 iReason ); - void SelectUpDownArrowOnScrollAreaRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ); - - void SelectScrollAreaDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ); - void SelectScrollAreaDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 iReason ); - - /* - * This function has to be implemented, see documetnation as to why and how! - */ - virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) = 0; - + /* * Set the content of a dropdown. Each entry consists of an INT16 key, by which you can later identify which entry was selected, and a STR16 that will be displayed. * There can be multiple instances of the same key or name. @@ -190,13 +108,18 @@ public: */ void SetColorHighLight( UINT16 aCol ) { mColorHighLight = aCol; } + /* + * Set help text decribing what can be selected + */ + void SetHelpText( STR16 aText ) { wcscat( mHelpText, aText ); } + /* * Get key of selected entry */ INT16 GetSelectedEntryKey() { return mEntryVector[mSelectedEntry].first; } /* - * Get width of entire DropDown + * Get width of entire DropDownBase */ UINT16 GetTotalWidth() { return musWidth + musArrowWidth; } @@ -205,10 +128,26 @@ public: */ UINT16 GetLastX() { return musStartX + GetTotalWidth(); } + // call to open/close the drop down + void OpenDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ); + void CloseDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ); + + void SelectDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ); + void SelectDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 iReason ); + void SelectUpDownArrowOnScrollAreaRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ); + + void SelectScrollAreaDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ); + void SelectScrollAreaDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 iReason ); + + /* + * This function is implemented again in DropDownTemplate + */ + virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) { return Dummyfunc; } + private: // declare but don't define - DropDown(DropDown const&); - void operator=(DropDown const&); + DropDownBase(DropDownBase const&); + void operator=(DropDownBase const&); /* * Initialise variables. Called after each creationm which allows moving a dropdown @@ -261,6 +200,7 @@ private: MOUSE_REGION mSelectedOpenDropDownRegion; MOUSE_REGION mSelectedCloseDropDownRegion; + MOUSE_REGION mBubbleHelpRegion; // for a help text describing what a selection is good for, can be seen when hovering the mouse over the box when it is closed MOUSE_REGION mDropDownRegion[DROPDOWN_REGIONS]; MOUSE_REGION mgSelectedUpDownArrowOnScrollAreaRegion[2]; @@ -270,9 +210,83 @@ private: std::vector > mEntryVector; + CHAR16 mHelpText[200]; + UINT8 mSelectedEntry; // keeps track of the currently selected city UINT8 mFirstShownEntry; // top entry of the dropped region UINT8 mNumDisplayedEntries; // number of entries displayed. Calculated internally, no need to change by user }; +template +class DropDownTemplate : public DropDownBase +{ +public: + static DropDownTemplate& getInstance() + { + static DropDownTemplate instance; // Guaranteed to be destroyed. + // Instantiated on first use. + return instance; + } + + // this function has to be implemented! + virtual void SetRefresh(); + + static void OpenDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(mpSelf)->OpenDropDownRegionCallBack(pRegion, iReason); } + static void CloseDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(mpSelf)->CloseDropDownRegionCallBack(pRegion, iReason); } + static void SelectRegionDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(mpSelf)->SelectDropDownRegionCallBack(pRegion, iReason); } + static void SelectMovementDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(mpSelf)->SelectDropDownMovementCallBack(pRegion, iReason); } + static void SelectArrowDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(mpSelf)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); } + static void SelectScrollRegionDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(mpSelf)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); } + static void SelectScrollMovementDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(mpSelf)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); } + + MOUSE_CALLBACK + CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) + { + mpSelf = pt2Object; + + switch ( arg ) + { + case DROPDOWN_OPEN: + return &OpenDropDown_DropDown_Appearance; + break; + case DROPDOWN_CLOSE: + return &CloseDropDown_DropDown_Appearance; + break; + case DROPDOWN_REGION: + return &SelectRegionDropDown_DropDown_Appearance; + break; + case DROPDOWN_MOVEMENT: + return &SelectMovementDropDown_DropDown_Appearance; + break; + case DROPDOWN_ARROW: + return &SelectArrowDropDown_DropDown_Appearance; + break; + case DROPDOWN_SCROLL_REGION: + return &SelectScrollRegionDropDown_DropDown_Appearance; + break; + case DROPDOWN_SCROLL_MOVEMENT: + return &SelectScrollMovementDropDown_DropDown_Appearance; + break; + } + + return *pt2Function; + } + +private: + static void* mpSelf; + +private: + DropDownTemplate() {}; // private constructor, so we cannot create more instances + + // declare but don't define + DropDownTemplate(DropDownTemplate const&); + void operator=(DropDownTemplate const&); +}; + +template +void DropDownTemplate::SetRefresh(); + +template +void* DropDownTemplate::mpSelf = NULL; + #endif diff --git a/Laptop/IMP Prejudice.cpp b/Laptop/IMP Prejudice.cpp index 7374983a..1a1e661f 100644 --- a/Laptop/IMP Prejudice.cpp +++ b/Laptop/IMP Prejudice.cpp @@ -1,3 +1,8 @@ +/** + * @file + * @author Flugente (bears-pit.com) + */ + #ifdef PRECOMPILEDHEADERS #include "Laptop All.h" #include "IMP Skill Trait.h" @@ -75,666 +80,32 @@ BOOLEAN CameBackToPrejudicePageButNotFinished(); //******************************************************************* #define DROPDOWN_MARKUP_Y 50 -//******************************************************************* -// -// DropDown declarations -// -//******************************************************************* -class DropDown_Appearance : public DropDown +enum definedDropDowns { -public: - static DropDown_Appearance& getInstance() - { - static DropDown_Appearance instance; // Guaranteed to be destroyed. - // Instantiated on first use. - return instance; - } - - virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ); - - // this function has to be implemented! - virtual void SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } - -private: - DropDown_Appearance() {}; // private cosntructor, so we cannot create more instances - - // declare but don't define - DropDown_Appearance(DropDown_Appearance const&); - void operator=(DropDown_Appearance const&); + DROPDOWNNR_APPEARANCE = 0, + DROPDOWNNR_APPEARANCECARE, + DROPDOWNNR_REFINEMENT, + DROPDOWNNR_REFINEMENTCARE, + DROPDOWNNR_NATIONALITY, + DROPDOWNNR_HATEDNATIONALITY, + DROPDOWNNR_HATEDNATIONALITYCARE, + DROPDOWNNR_RACIST, + DROPDOWNNR_RACE, + DROPDOWNNR_SEXIST, + DROPDOWNNR_RACISTFEATURE, }; -class DropDown_AppearanceCare : public DropDown -{ -public: - static DropDown_AppearanceCare& getInstance() - { - static DropDown_AppearanceCare instance; // Guaranteed to be destroyed. - // Instantiated on first use. - return instance; - } - - virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ); - - // this function has to be implemented! - virtual void SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } - -private: - DropDown_AppearanceCare() {}; // private cosntructor, so we cannot create more instances - - // declare but don't define - DropDown_AppearanceCare(DropDown_AppearanceCare const&); - void operator=(DropDown_AppearanceCare const&); -}; - -class DropDown_Refinement : public DropDown -{ -public: - static DropDown_Refinement& getInstance() - { - static DropDown_Refinement instance; // Guaranteed to be destroyed. - // Instantiated on first use. - return instance; - } - - virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ); - - // this function has to be implemented! - virtual void SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } - -private: - DropDown_Refinement() {}; // private cosntructor, so we cannot create more instances - - // declare but don't define - DropDown_Refinement(DropDown_Refinement const&); - void operator=(DropDown_Refinement const&); -}; - -class DropDown_RefinementCare : public DropDown -{ -public: - static DropDown_RefinementCare& getInstance() - { - static DropDown_RefinementCare instance; // Guaranteed to be destroyed. - // Instantiated on first use. - return instance; - } - - virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ); - - // this function has to be implemented! - virtual void SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } - -private: - DropDown_RefinementCare() {}; // private cosntructor, so we cannot create more instances - - // declare but don't define - DropDown_RefinementCare(DropDown_RefinementCare const&); - void operator=(DropDown_RefinementCare const&); -}; - -class DropDown_Nationality : public DropDown -{ -public: - static DropDown_Nationality& getInstance() - { - static DropDown_Nationality instance; // Guaranteed to be destroyed. - // Instantiated on first use. - return instance; - } - - virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ); - - // this function has to be implemented! - virtual void SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } - -private: - DropDown_Nationality() {}; // private cosntructor, so we cannot create more instances - - // declare but don't define - DropDown_Nationality(DropDown_Nationality const&); - void operator=(DropDown_Nationality const&); -}; - -class DropDown_HatedNationality : public DropDown -{ -public: - static DropDown_HatedNationality& getInstance() - { - static DropDown_HatedNationality instance; // Guaranteed to be destroyed. - // Instantiated on first use. - return instance; - } - - virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ); - - // this function has to be implemented! - virtual void SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } - -private: - DropDown_HatedNationality() {}; // private cosntructor, so we cannot create more instances - - // declare but don't define - DropDown_HatedNationality(DropDown_HatedNationality const&); - void operator=(DropDown_HatedNationality const&); -}; - -class DropDown_HatedNationalityCare : public DropDown -{ -public: - static DropDown_HatedNationalityCare& getInstance() - { - static DropDown_HatedNationalityCare instance; // Guaranteed to be destroyed. - // Instantiated on first use. - return instance; - } - - virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ); - - // this function has to be implemented! - virtual void SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } - -private: - DropDown_HatedNationalityCare() {}; // private cosntructor, so we cannot create more instances - - // declare but don't define - DropDown_HatedNationalityCare(DropDown_HatedNationalityCare const&); - void operator=(DropDown_HatedNationalityCare const&); -}; - -class DropDown_Racist : public DropDown -{ -public: - static DropDown_Racist& getInstance() - { - static DropDown_Racist instance; // Guaranteed to be destroyed. - // Instantiated on first use. - return instance; - } - - virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ); - - // this function has to be implemented! - virtual void SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } - -private: - DropDown_Racist() {}; // private cosntructor, so we cannot create more instances - - // declare but don't define - DropDown_Racist(DropDown_Racist const&); - void operator=(DropDown_Racist const&); -}; - -class DropDown_RacistTarget : public DropDown -{ -public: - static DropDown_RacistTarget& getInstance() - { - static DropDown_RacistTarget instance; // Guaranteed to be destroyed. - // Instantiated on first use. - return instance; - } - - virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ); - - // this function has to be implemented! - virtual void SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } - -private: - DropDown_RacistTarget() {}; // private cosntructor, so we cannot create more instances - - // declare but don't define - DropDown_RacistTarget(DropDown_RacistTarget const&); - void operator=(DropDown_RacistTarget const&); -}; - -class DropDown_Sexist : public DropDown -{ -public: - static DropDown_Sexist& getInstance() - { - static DropDown_Sexist instance; // Guaranteed to be destroyed. - // Instantiated on first use. - return instance; - } - - virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ); - - // this function has to be implemented! - virtual void SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } - -private: - DropDown_Sexist() {}; // private cosntructor, so we cannot create more instances - - // declare but don't define - DropDown_Sexist(DropDown_Sexist const&); - void operator=(DropDown_Sexist const&); -}; - -//******************************************************************* -// -// DropDown definitions -// -//******************************************************************* -void* gPtrDropDown_Appearance; -void OpenDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Appearance)->OpenDropDownRegionCallBack(pRegion, iReason); } -void CloseDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Appearance)->CloseDropDownRegionCallBack(pRegion, iReason); } -void SelectRegionDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Appearance)->SelectDropDownRegionCallBack(pRegion, iReason); } -void SelectMovementDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Appearance)->SelectDropDownMovementCallBack(pRegion, iReason); } -void SelectArrowDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Appearance)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); } -void SelectScrollRegionDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Appearance)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); } -void SelectScrollMovementDropDown_DropDown_Appearance(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Appearance)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); } - -MOUSE_CALLBACK -DropDown_Appearance::CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) -{ - gPtrDropDown_Appearance = pt2Object; - - switch ( arg ) - { - case DROPDOWN_OPEN: - return &OpenDropDown_DropDown_Appearance; - break; - case DROPDOWN_CLOSE: - return &CloseDropDown_DropDown_Appearance; - break; - case DROPDOWN_REGION: - return &SelectRegionDropDown_DropDown_Appearance; - break; - case DROPDOWN_MOVEMENT: - return &SelectMovementDropDown_DropDown_Appearance; - break; - case DROPDOWN_ARROW: - return &SelectArrowDropDown_DropDown_Appearance; - break; - case DROPDOWN_SCROLL_REGION: - return &SelectScrollRegionDropDown_DropDown_Appearance; - break; - case DROPDOWN_SCROLL_MOVEMENT: - return &SelectScrollMovementDropDown_DropDown_Appearance; - break; - } - - return *pt2Function; -} - -void* gPtrDropDown_AppearanceCare; -void OpenDropDown_DropDown_AppearanceCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_AppearanceCare)->OpenDropDownRegionCallBack(pRegion, iReason); } -void CloseDropDown_DropDown_AppearanceCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_AppearanceCare)->CloseDropDownRegionCallBack(pRegion, iReason); } -void SelectRegionDropDown_DropDown_AppearanceCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_AppearanceCare)->SelectDropDownRegionCallBack(pRegion, iReason); } -void SelectMovementDropDown_DropDown_AppearanceCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_AppearanceCare)->SelectDropDownMovementCallBack(pRegion, iReason); } -void SelectArrowDropDown_DropDown_AppearanceCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_AppearanceCare)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); } -void SelectScrollRegionDropDown_DropDown_AppearanceCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_AppearanceCare)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); } -void SelectScrollMovementDropDown_DropDown_AppearanceCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_AppearanceCare)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); } - -MOUSE_CALLBACK -DropDown_AppearanceCare::CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) -{ - gPtrDropDown_AppearanceCare = pt2Object; - - switch ( arg ) - { - case DROPDOWN_OPEN: - return &OpenDropDown_DropDown_AppearanceCare; - break; - case DROPDOWN_CLOSE: - return &CloseDropDown_DropDown_AppearanceCare; - break; - case DROPDOWN_REGION: - return &SelectRegionDropDown_DropDown_AppearanceCare; - break; - case DROPDOWN_MOVEMENT: - return &SelectMovementDropDown_DropDown_AppearanceCare; - break; - case DROPDOWN_ARROW: - return &SelectArrowDropDown_DropDown_AppearanceCare; - break; - case DROPDOWN_SCROLL_REGION: - return &SelectScrollRegionDropDown_DropDown_AppearanceCare; - break; - case DROPDOWN_SCROLL_MOVEMENT: - return &SelectScrollMovementDropDown_DropDown_AppearanceCare; - break; - } - - return *pt2Function; -} - -void* gPtrDropDown_Refinement; -void OpenDropDown_DropDown_Refinement(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Refinement)->OpenDropDownRegionCallBack(pRegion, iReason); } -void CloseDropDown_DropDown_Refinement(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Refinement)->CloseDropDownRegionCallBack(pRegion, iReason); } -void SelectRegionDropDown_DropDown_Refinement(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Refinement)->SelectDropDownRegionCallBack(pRegion, iReason); } -void SelectMovementDropDown_DropDown_Refinement(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Refinement)->SelectDropDownMovementCallBack(pRegion, iReason); } -void SelectArrowDropDown_DropDown_Refinement(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Refinement)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); } -void SelectScrollRegionDropDown_DropDown_Refinement(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Refinement)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); } -void SelectScrollMovementDropDown_DropDown_Refinement(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Refinement)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); } - -MOUSE_CALLBACK -DropDown_Refinement::CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) -{ - gPtrDropDown_Refinement = pt2Object; - - switch ( arg ) - { - case DROPDOWN_OPEN: - return &OpenDropDown_DropDown_Refinement; - break; - case DROPDOWN_CLOSE: - return &CloseDropDown_DropDown_Refinement; - break; - case DROPDOWN_REGION: - return &SelectRegionDropDown_DropDown_Refinement; - break; - case DROPDOWN_MOVEMENT: - return &SelectMovementDropDown_DropDown_Refinement; - break; - case DROPDOWN_ARROW: - return &SelectArrowDropDown_DropDown_Refinement; - break; - case DROPDOWN_SCROLL_REGION: - return &SelectScrollRegionDropDown_DropDown_Refinement; - break; - case DROPDOWN_SCROLL_MOVEMENT: - return &SelectScrollMovementDropDown_DropDown_Refinement; - break; - } - - return *pt2Function; -} - -void* gPtrDropDown_RefinementCare; -void OpenDropDown_DropDown_RefinementCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_RefinementCare)->OpenDropDownRegionCallBack(pRegion, iReason); } -void CloseDropDown_DropDown_RefinementCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_RefinementCare)->CloseDropDownRegionCallBack(pRegion, iReason); } -void SelectRegionDropDown_DropDown_RefinementCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_RefinementCare)->SelectDropDownRegionCallBack(pRegion, iReason); } -void SelectMovementDropDown_DropDown_RefinementCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_RefinementCare)->SelectDropDownMovementCallBack(pRegion, iReason); } -void SelectArrowDropDown_DropDown_RefinementCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_RefinementCare)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); } -void SelectScrollRegionDropDown_DropDown_RefinementCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_RefinementCare)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); } -void SelectScrollMovementDropDown_DropDown_RefinementCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_RefinementCare)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); } - -MOUSE_CALLBACK -DropDown_RefinementCare::CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) -{ - gPtrDropDown_RefinementCare = pt2Object; - - switch ( arg ) - { - case DROPDOWN_OPEN: - return &OpenDropDown_DropDown_RefinementCare; - break; - case DROPDOWN_CLOSE: - return &CloseDropDown_DropDown_RefinementCare; - break; - case DROPDOWN_REGION: - return &SelectRegionDropDown_DropDown_RefinementCare; - break; - case DROPDOWN_MOVEMENT: - return &SelectMovementDropDown_DropDown_RefinementCare; - break; - case DROPDOWN_ARROW: - return &SelectArrowDropDown_DropDown_RefinementCare; - break; - case DROPDOWN_SCROLL_REGION: - return &SelectScrollRegionDropDown_DropDown_RefinementCare; - break; - case DROPDOWN_SCROLL_MOVEMENT: - return &SelectScrollMovementDropDown_DropDown_RefinementCare; - break; - } - - return *pt2Function; -} - -void* gPtrDropDown_Nationality; -void OpenDropDown_DropDown_Nationality(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Nationality)->OpenDropDownRegionCallBack(pRegion, iReason); } -void CloseDropDown_DropDown_Nationality(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Nationality)->CloseDropDownRegionCallBack(pRegion, iReason); } -void SelectRegionDropDown_DropDown_Nationality(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Nationality)->SelectDropDownRegionCallBack(pRegion, iReason); } -void SelectMovementDropDown_DropDown_Nationality(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Nationality)->SelectDropDownMovementCallBack(pRegion, iReason); } -void SelectArrowDropDown_DropDown_Nationality(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Nationality)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); } -void SelectScrollRegionDropDown_DropDown_Nationality(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Nationality)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); } -void SelectScrollMovementDropDown_DropDown_Nationality(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Nationality)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); } - -MOUSE_CALLBACK -DropDown_Nationality::CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) -{ - gPtrDropDown_Nationality = pt2Object; - - switch ( arg ) - { - case DROPDOWN_OPEN: - return &OpenDropDown_DropDown_Nationality; - break; - case DROPDOWN_CLOSE: - return &CloseDropDown_DropDown_Nationality; - break; - case DROPDOWN_REGION: - return &SelectRegionDropDown_DropDown_Nationality; - break; - case DROPDOWN_MOVEMENT: - return &SelectMovementDropDown_DropDown_Nationality; - break; - case DROPDOWN_ARROW: - return &SelectArrowDropDown_DropDown_Nationality; - break; - case DROPDOWN_SCROLL_REGION: - return &SelectScrollRegionDropDown_DropDown_Nationality; - break; - case DROPDOWN_SCROLL_MOVEMENT: - return &SelectScrollMovementDropDown_DropDown_Nationality; - break; - } - - return *pt2Function; -} - -void* gPtrDropDown_HatedNationality; -void OpenDropDown_DropDown_HatedNationality(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_HatedNationality)->OpenDropDownRegionCallBack(pRegion, iReason); } -void CloseDropDown_DropDown_HatedNationality(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_HatedNationality)->CloseDropDownRegionCallBack(pRegion, iReason); } -void SelectRegionDropDown_DropDown_HatedNationality(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_HatedNationality)->SelectDropDownRegionCallBack(pRegion, iReason); } -void SelectMovementDropDown_DropDown_HatedNationality(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_HatedNationality)->SelectDropDownMovementCallBack(pRegion, iReason); } -void SelectArrowDropDown_DropDown_HatedNationality(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_HatedNationality)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); } -void SelectScrollRegionDropDown_DropDown_HatedNationality(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_HatedNationality)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); } -void SelectScrollMovementDropDown_DropDown_HatedNationality(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_HatedNationality)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); } - -MOUSE_CALLBACK -DropDown_HatedNationality::CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) -{ - gPtrDropDown_HatedNationality = pt2Object; - - switch ( arg ) - { - case DROPDOWN_OPEN: - return &OpenDropDown_DropDown_HatedNationality; - break; - case DROPDOWN_CLOSE: - return &CloseDropDown_DropDown_HatedNationality; - break; - case DROPDOWN_REGION: - return &SelectRegionDropDown_DropDown_HatedNationality; - break; - case DROPDOWN_MOVEMENT: - return &SelectMovementDropDown_DropDown_HatedNationality; - break; - case DROPDOWN_ARROW: - return &SelectArrowDropDown_DropDown_HatedNationality; - break; - case DROPDOWN_SCROLL_REGION: - return &SelectScrollRegionDropDown_DropDown_HatedNationality; - break; - case DROPDOWN_SCROLL_MOVEMENT: - return &SelectScrollMovementDropDown_DropDown_HatedNationality; - break; - } - - return *pt2Function; -} - -void* gPtrDropDown_HatedNationalityCare; -void OpenDropDown_DropDown_HatedNationalityCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_HatedNationalityCare)->OpenDropDownRegionCallBack(pRegion, iReason); } -void CloseDropDown_DropDown_HatedNationalityCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_HatedNationalityCare)->CloseDropDownRegionCallBack(pRegion, iReason); } -void SelectRegionDropDown_DropDown_HatedNationalityCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_HatedNationalityCare)->SelectDropDownRegionCallBack(pRegion, iReason); } -void SelectMovementDropDown_DropDown_HatedNationalityCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_HatedNationalityCare)->SelectDropDownMovementCallBack(pRegion, iReason); } -void SelectArrowDropDown_DropDown_HatedNationalityCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_HatedNationalityCare)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); } -void SelectScrollRegionDropDown_DropDown_HatedNationalityCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_HatedNationalityCare)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); } -void SelectScrollMovementDropDown_DropDown_HatedNationalityCare(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_HatedNationalityCare)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); } - -MOUSE_CALLBACK -DropDown_HatedNationalityCare::CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) -{ - gPtrDropDown_HatedNationalityCare = pt2Object; - - switch ( arg ) - { - case DROPDOWN_OPEN: - return &OpenDropDown_DropDown_HatedNationalityCare; - break; - case DROPDOWN_CLOSE: - return &CloseDropDown_DropDown_HatedNationalityCare; - break; - case DROPDOWN_REGION: - return &SelectRegionDropDown_DropDown_HatedNationalityCare; - break; - case DROPDOWN_MOVEMENT: - return &SelectMovementDropDown_DropDown_HatedNationalityCare; - break; - case DROPDOWN_ARROW: - return &SelectArrowDropDown_DropDown_HatedNationalityCare; - break; - case DROPDOWN_SCROLL_REGION: - return &SelectScrollRegionDropDown_DropDown_HatedNationalityCare; - break; - case DROPDOWN_SCROLL_MOVEMENT: - return &SelectScrollMovementDropDown_DropDown_HatedNationalityCare; - break; - } - - return *pt2Function; -} - -void* gPtrDropDown_Racist; -void OpenDropDown_DropDown_Racist(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Racist)->OpenDropDownRegionCallBack(pRegion, iReason); } -void CloseDropDown_DropDown_Racist(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Racist)->CloseDropDownRegionCallBack(pRegion, iReason); } -void SelectRegionDropDown_DropDown_Racist(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Racist)->SelectDropDownRegionCallBack(pRegion, iReason); } -void SelectMovementDropDown_DropDown_Racist(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Racist)->SelectDropDownMovementCallBack(pRegion, iReason); } -void SelectArrowDropDown_DropDown_Racist(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Racist)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); } -void SelectScrollRegionDropDown_DropDown_Racist(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Racist)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); } -void SelectScrollMovementDropDown_DropDown_Racist(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Racist)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); } - -MOUSE_CALLBACK -DropDown_Racist::CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) -{ - gPtrDropDown_Racist = pt2Object; - - switch ( arg ) - { - case DROPDOWN_OPEN: - return &OpenDropDown_DropDown_Racist; - break; - case DROPDOWN_CLOSE: - return &CloseDropDown_DropDown_Racist; - break; - case DROPDOWN_REGION: - return &SelectRegionDropDown_DropDown_Racist; - break; - case DROPDOWN_MOVEMENT: - return &SelectMovementDropDown_DropDown_Racist; - break; - case DROPDOWN_ARROW: - return &SelectArrowDropDown_DropDown_Racist; - break; - case DROPDOWN_SCROLL_REGION: - return &SelectScrollRegionDropDown_DropDown_Racist; - break; - case DROPDOWN_SCROLL_MOVEMENT: - return &SelectScrollMovementDropDown_DropDown_Racist; - break; - } - - return *pt2Function; -} - -void* gPtrDropDown_RacistTarget; -void OpenDropDown_DropDown_RacistTarget(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_RacistTarget)->OpenDropDownRegionCallBack(pRegion, iReason); } -void CloseDropDown_DropDown_RacistTarget(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_RacistTarget)->CloseDropDownRegionCallBack(pRegion, iReason); } -void SelectRegionDropDown_DropDown_RacistTarget(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_RacistTarget)->SelectDropDownRegionCallBack(pRegion, iReason); } -void SelectMovementDropDown_DropDown_RacistTarget(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_RacistTarget)->SelectDropDownMovementCallBack(pRegion, iReason); } -void SelectArrowDropDown_DropDown_RacistTarget(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_RacistTarget)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); } -void SelectScrollRegionDropDown_DropDown_RacistTarget(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_RacistTarget)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); } -void SelectScrollMovementDropDown_DropDown_RacistTarget(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_RacistTarget)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); } - -MOUSE_CALLBACK -DropDown_RacistTarget::CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) -{ - gPtrDropDown_RacistTarget = pt2Object; - - switch ( arg ) - { - case DROPDOWN_OPEN: - return &OpenDropDown_DropDown_RacistTarget; - break; - case DROPDOWN_CLOSE: - return &CloseDropDown_DropDown_RacistTarget; - break; - case DROPDOWN_REGION: - return &SelectRegionDropDown_DropDown_RacistTarget; - break; - case DROPDOWN_MOVEMENT: - return &SelectMovementDropDown_DropDown_RacistTarget; - break; - case DROPDOWN_ARROW: - return &SelectArrowDropDown_DropDown_RacistTarget; - break; - case DROPDOWN_SCROLL_REGION: - return &SelectScrollRegionDropDown_DropDown_RacistTarget; - break; - case DROPDOWN_SCROLL_MOVEMENT: - return &SelectScrollMovementDropDown_DropDown_RacistTarget; - break; - } - - return *pt2Function; -} - -void* gPtrDropDown_Sexist; -void OpenDropDown_DropDown_Sexist(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Sexist)->OpenDropDownRegionCallBack(pRegion, iReason); } -void CloseDropDown_DropDown_Sexist(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Sexist)->CloseDropDownRegionCallBack(pRegion, iReason); } -void SelectRegionDropDown_DropDown_Sexist(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Sexist)->SelectDropDownRegionCallBack(pRegion, iReason); } -void SelectMovementDropDown_DropDown_Sexist(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Sexist)->SelectDropDownMovementCallBack(pRegion, iReason); } -void SelectArrowDropDown_DropDown_Sexist(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Sexist)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); } -void SelectScrollRegionDropDown_DropDown_Sexist(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Sexist)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); } -void SelectScrollMovementDropDown_DropDown_Sexist(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast(gPtrDropDown_Sexist)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); } - -MOUSE_CALLBACK -DropDown_Sexist::CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) -{ - gPtrDropDown_Sexist = pt2Object; - - switch ( arg ) - { - case DROPDOWN_OPEN: - return &OpenDropDown_DropDown_Sexist; - break; - case DROPDOWN_CLOSE: - return &CloseDropDown_DropDown_Sexist; - break; - case DROPDOWN_REGION: - return &SelectRegionDropDown_DropDown_Sexist; - break; - case DROPDOWN_MOVEMENT: - return &SelectMovementDropDown_DropDown_Sexist; - break; - case DROPDOWN_ARROW: - return &SelectArrowDropDown_DropDown_Sexist; - break; - case DROPDOWN_SCROLL_REGION: - return &SelectScrollRegionDropDown_DropDown_Sexist; - break; - case DROPDOWN_SCROLL_MOVEMENT: - return &SelectScrollMovementDropDown_DropDown_Sexist; - break; - } - - return *pt2Function; -} - +template<> void DropDownTemplate::SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } +template<> void DropDownTemplate::SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } +template<> void DropDownTemplate::SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } +template<> void DropDownTemplate::SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } +template<> void DropDownTemplate::SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } +template<> void DropDownTemplate::SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } +template<> void DropDownTemplate::SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } +template<> void DropDownTemplate::SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } +template<> void DropDownTemplate::SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } +template<> void DropDownTemplate::SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } +template<> void DropDownTemplate::SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } void EnterIMPPrejudice( void ) { @@ -756,20 +127,22 @@ void EnterIMPPrejudice( void ) std::vector > entryvecDropDown_Appearance; for(UINT8 i = 0; i < NUM_APPEARANCES; ++i) entryvecDropDown_Appearance.push_back( std::make_pair(i, szAppearanceText[i]) ); - - DropDown_Appearance::getInstance().SetEntries(entryvecDropDown_Appearance); - DropDown_Appearance::getInstance().Create(usX, usY); + + DropDownTemplate::getInstance().SetEntries(entryvecDropDown_Appearance); + DropDownTemplate::getInstance().SetHelpText( szPersonalityHelpText[DROPDOWNNR_APPEARANCE] ); + DropDownTemplate::getInstance().Create(usX, usY); ////////////////// DropDown_Appearance ////////////////////////// - usX = DropDown_Appearance::getInstance().GetLastX() + StringPixLength ( szPersonalityDisplayText[PERSONALITYTEXT_ANDAPPEARANCEIS], FONT12ARIAL ) + 20; + usX = DropDownTemplate::getInstance().GetLastX() + StringPixLength ( szPersonalityDisplayText[PERSONALITYTEXT_ANDAPPEARANCEIS], FONT12ARIAL ) + 20; ////////////////// DropDown_AppearanceCare ////////////////////////// std::vector > entryvecDropDown_AppearanceCare; for(UINT8 i = 0; i < NUM_CARELEVELS; ++i) entryvecDropDown_AppearanceCare.push_back( std::make_pair(i, szCareLevelText[i]) ); - - DropDown_AppearanceCare::getInstance().SetEntries(entryvecDropDown_AppearanceCare); - DropDown_AppearanceCare::getInstance().SetColorLine( Get16BPPColor( FROMRGB( 38, 191, 60 ) ) ); - DropDown_AppearanceCare::getInstance().Create(usX, usY); + + DropDownTemplate::getInstance().SetEntries(entryvecDropDown_AppearanceCare); + DropDownTemplate::getInstance().SetHelpText( szPersonalityHelpText[DROPDOWNNR_APPEARANCECARE] ); + DropDownTemplate::getInstance().SetColorLine( Get16BPPColor( FROMRGB( 38, 191, 60 ) ) ); + DropDownTemplate::getInstance().Create(usX, usY); ////////////////// DropDown_AppearanceCare ////////////////////////// usX = LAPTOP_SCREEN_UL_X + 5 + StringPixLength ( szPersonalityDisplayText[PERSONALITYTEXT_YOUHAVE], FONT12ARIAL ) + 10; @@ -779,34 +152,37 @@ void EnterIMPPrejudice( void ) for(UINT8 i = 0; i < NUM_REFINEMENT; ++i) entryvecDropDown_Refinement.push_back( std::make_pair(i, szRefinementText[i]) ); - DropDown_Refinement::getInstance().SetEntries(entryvecDropDown_Refinement); - DropDown_Refinement::getInstance().Create(usX, usY); + DropDownTemplate::getInstance().SetEntries(entryvecDropDown_Refinement); + DropDownTemplate::getInstance().SetHelpText( szPersonalityHelpText[DROPDOWNNR_REFINEMENT] ); + DropDownTemplate::getInstance().Create(usX, usY); ////////////////// DropDown_Refinement ////////////////////////// - usX = DropDown_Refinement::getInstance().GetLastX() + StringPixLength ( szPersonalityDisplayText[PERSONALITYTEXT_ANDCARE], FONT12ARIAL ) + 20; - ////////////////// DropDown_RefinementCare ////////////////////////// + usX = DropDownTemplate::getInstance().GetLastX() + StringPixLength ( szPersonalityDisplayText[PERSONALITYTEXT_ANDCARE], FONT12ARIAL ) + 20; + ////////////////// DropDownTemplate ////////////////////////// std::vector > entryvecDropDown_RefinementCare; for(UINT8 i = 0; i < NUM_CARELEVELS; ++i) entryvecDropDown_RefinementCare.push_back( std::make_pair(i, szCareLevelText[i]) ); - DropDown_RefinementCare::getInstance().SetEntries(entryvecDropDown_RefinementCare); - DropDown_RefinementCare::getInstance().SetColorLine( Get16BPPColor( FROMRGB( 38, 191, 60 ) ) ); - DropDown_RefinementCare::getInstance().Create(usX, usY); - ////////////////// DropDown_RefinementCare ////////////////////////// + DropDownTemplate::getInstance().SetEntries(entryvecDropDown_RefinementCare); + DropDownTemplate::getInstance().SetHelpText( szPersonalityHelpText[DROPDOWNNR_REFINEMENTCARE] ); + DropDownTemplate::getInstance().SetColorLine( Get16BPPColor( FROMRGB( 38, 191, 60 ) ) ); + DropDownTemplate::getInstance().Create(usX, usY); + ////////////////// DropDownTemplate ////////////////////////// usX = LAPTOP_SCREEN_UL_X + 5 + StringPixLength ( szPersonalityDisplayText[PERSONALITYTEXT_YOUARE], FONT12ARIAL ) + 10; usY += DROPDOWN_MARKUP_Y; - ////////////////// DropDown_Nationality ////////////////////////// + ////////////////// DropDownTemplate ////////////////////////// std::vector > entryvecDropDown_Nationality; for(UINT8 i = 0; i < NUM_NATIONALITIES; ++i) entryvecDropDown_Nationality.push_back( std::make_pair(i, szNationalityText[i]) ); - DropDown_Nationality::getInstance().SetEntries(entryvecDropDown_Nationality); - DropDown_Nationality::getInstance().Create(usX, usY); - ////////////////// DropDown_Nationality ////////////////////////// + DropDownTemplate::getInstance().SetEntries(entryvecDropDown_Nationality); + DropDownTemplate::getInstance().SetHelpText( szPersonalityHelpText[DROPDOWNNR_NATIONALITY] ); + DropDownTemplate::getInstance().Create(usX, usY); + ////////////////// DropDownTemplate ////////////////////////// - usX = DropDown_Nationality::getInstance().GetLastX() + StringPixLength ( szPersonalityDisplayText[PERSONALITYTEXT_ADHATEEVERYONE], FONT12ARIAL ) + 20; - ////////////////// DropDown_HatedNationality ////////////////////////// + usX = DropDownTemplate::getInstance().GetLastX() + StringPixLength ( szPersonalityDisplayText[PERSONALITYTEXT_ADHATEEVERYONE], FONT12ARIAL ) + 20; + ////////////////// DropDownTemplate ////////////////////////// std::vector > entryvecDropDown_HatedNationality; // we can also hate no nation at all... entryvecDropDown_HatedNationality.push_back( std::make_pair(-1, szNationalityText_Special[1]) ); @@ -814,54 +190,59 @@ void EnterIMPPrejudice( void ) for(UINT8 i = 0; i < NUM_NATIONALITIES; ++i) entryvecDropDown_HatedNationality.push_back( std::make_pair(i, szNationalityText[i]) ); - DropDown_HatedNationality::getInstance().SetEntries(entryvecDropDown_HatedNationality); - DropDown_HatedNationality::getInstance().Create(usX, usY); - ////////////////// DropDown_HatedNationality ////////////////////////// + DropDownTemplate::getInstance().SetEntries(entryvecDropDown_HatedNationality); + DropDownTemplate::getInstance().SetHelpText( szPersonalityHelpText[DROPDOWNNR_HATEDNATIONALITY] ); + DropDownTemplate::getInstance().Create(usX, usY); + ////////////////// DropDownTemplate ////////////////////////// - usX = DropDown_HatedNationality::getInstance().GetLastX() + 5; - ////////////////// DropDown_HatedNationalityCare ////////////////////////// + usX = DropDownTemplate::getInstance().GetLastX() + 5; + ////////////////// DropDownTemplate ////////////////////////// std::vector > entryvecDropDown_HatedNationalityCare; for(UINT8 i = 0; i < NUM_CARELEVELS; ++i) entryvecDropDown_HatedNationalityCare.push_back( std::make_pair(i, szCareLevelText[i]) ); - DropDown_HatedNationalityCare::getInstance().SetEntries(entryvecDropDown_HatedNationalityCare); - DropDown_HatedNationalityCare::getInstance().SetColorLine( Get16BPPColor( FROMRGB( 38, 191, 60 ) ) ); - DropDown_HatedNationalityCare::getInstance().Create(usX, usY); - ////////////////// DropDown_HatedNationalityCare ////////////////////////// + DropDownTemplate::getInstance().SetEntries(entryvecDropDown_HatedNationalityCare); + DropDownTemplate::getInstance().SetHelpText( szPersonalityHelpText[DROPDOWNNR_HATEDNATIONALITYCARE] ); + DropDownTemplate::getInstance().SetColorLine( Get16BPPColor( FROMRGB( 38, 191, 60 ) ) ); + DropDownTemplate::getInstance().Create(usX, usY); + ////////////////// DropDownTemplate ////////////////////////// usX = LAPTOP_SCREEN_UL_X + 5 + StringPixLength ( szPersonalityDisplayText[PERSONALITYTEXT_YOUARE], FONT12ARIAL ) + 10; usY += DROPDOWN_MARKUP_Y; - ////////////////// DropDown_Racist ////////////////////////// + ////////////////// DropDownTemplate ////////////////////////// std::vector > entryvecDropDown_Racist; for(UINT8 i = 0; i < NUM_RACIST; ++i) entryvecDropDown_Racist.push_back( std::make_pair(i, szRacistText[i]) ); - DropDown_Racist::getInstance().SetEntries(entryvecDropDown_Racist); - DropDown_Racist::getInstance().SetColorLine( Get16BPPColor( FROMRGB( 38, 191, 60 ) ) ); - DropDown_Racist::getInstance().Create(usX, usY); - ////////////////// DropDown_Racist ////////////////////////// + DropDownTemplate::getInstance().SetEntries(entryvecDropDown_Racist); + DropDownTemplate::getInstance().SetHelpText( szPersonalityHelpText[DROPDOWNNR_RACIST] ); + DropDownTemplate::getInstance().SetColorLine( Get16BPPColor( FROMRGB( 38, 191, 60 ) ) ); + DropDownTemplate::getInstance().Create(usX, usY); + ////////////////// DropDownTemplate ////////////////////////// - usX = DropDown_Racist::getInstance().GetLastX() + StringPixLength ( szPersonalityDisplayText[PERSONALITYTEXT_RACISTAGAINSTNON], FONT12ARIAL ) + 10; - ////////////////// DropDown_RacistTarget ////////////////////////// - std::vector > entryvecDropDown_RacistTarget; + usX = DropDownTemplate::getInstance().GetLastX() + StringPixLength ( szPersonalityDisplayText[PERSONALITYTEXT_RACISTAGAINSTNON], FONT12ARIAL ) + 10; + ////////////////// DropDownTemplate ////////////////////////// + std::vector > entryvecDropDown_Race; for(UINT8 i = 0; i < NUM_RACES; ++i) - entryvecDropDown_RacistTarget.push_back( std::make_pair(i, szRaceText[i]) ); + entryvecDropDown_Race.push_back( std::make_pair(i, szRaceText[i]) ); - DropDown_RacistTarget::getInstance().SetEntries(entryvecDropDown_RacistTarget); - DropDown_RacistTarget::getInstance().Create(usX, usY); - ////////////////// DropDown_RacistTarget ////////////////////////// + DropDownTemplate::getInstance().SetEntries(entryvecDropDown_Race); + DropDownTemplate::getInstance().SetHelpText( szPersonalityHelpText[DROPDOWNNR_RACE] ); + DropDownTemplate::getInstance().Create(usX, usY); + ////////////////// DropDownTemplate ////////////////////////// usX = LAPTOP_SCREEN_UL_X + 5 + StringPixLength ( szPersonalityDisplayText[PERSONALITYTEXT_YOUARE], FONT12ARIAL ) + 10; usY += DROPDOWN_MARKUP_Y; - ////////////////// DropDown_Sexist ////////////////////////// + ////////////////// DropDownTemplate ////////////////////////// std::vector > entryvecDropDown_Sexist; for(UINT8 i = 0; i < NUM_SEXIST; ++i) entryvecDropDown_Sexist.push_back( std::make_pair(i, szSexistText[i]) ); - DropDown_Sexist::getInstance().SetEntries(entryvecDropDown_Sexist); - DropDown_Sexist::getInstance().SetColorLine( Get16BPPColor( FROMRGB( 38, 191, 60 ) ) ); - DropDown_Sexist::getInstance().Create(usX, usY); - ////////////////// DropDown_Sexist ////////////////////////// + DropDownTemplate::getInstance().SetEntries(entryvecDropDown_Sexist); + DropDownTemplate::getInstance().SetHelpText( szPersonalityHelpText[DROPDOWNNR_SEXIST] ); + DropDownTemplate::getInstance().SetColorLine( Get16BPPColor( FROMRGB( 38, 191, 60 ) ) ); + DropDownTemplate::getInstance().Create(usX, usY); + ////////////////// DropDownTemplate ////////////////////////// } @@ -872,31 +253,31 @@ void RenderIMPPrejudice( void ) IMPPrejudiceDisplay(); - DropDown_Appearance::getInstance().Display(); - DropDown_AppearanceCare::getInstance().Display(); - DropDown_Refinement::getInstance().Display(); - DropDown_RefinementCare::getInstance().Display(); - DropDown_Nationality::getInstance().Display(); - DropDown_HatedNationality::getInstance().Display(); - DropDown_HatedNationalityCare::getInstance().Display(); - DropDown_Racist::getInstance().Display(); - DropDown_RacistTarget::getInstance().Display(); - DropDown_Sexist::getInstance().Display(); + DropDownTemplate::getInstance().Display(); + DropDownTemplate::getInstance().Display(); + DropDownTemplate::getInstance().Display(); + DropDownTemplate::getInstance().Display(); + DropDownTemplate::getInstance().Display(); + DropDownTemplate::getInstance().Display(); + DropDownTemplate::getInstance().Display(); + DropDownTemplate::getInstance().Display(); + DropDownTemplate::getInstance().Display(); + DropDownTemplate::getInstance().Display(); } void ExitIMPPrejudice( void ) { - DropDown_Appearance::getInstance().Destroy(); - DropDown_AppearanceCare::getInstance().Destroy(); - DropDown_Refinement::getInstance().Destroy(); - DropDown_RefinementCare::getInstance().Destroy(); - DropDown_Nationality::getInstance().Destroy(); - DropDown_HatedNationality::getInstance().Destroy(); - DropDown_HatedNationalityCare::getInstance().Destroy(); - DropDown_Racist::getInstance().Destroy(); - DropDown_RacistTarget::getInstance().Destroy(); - DropDown_Sexist::getInstance().Destroy(); + DropDownTemplate::getInstance().Destroy(); + DropDownTemplate::getInstance().Destroy(); + DropDownTemplate::getInstance().Destroy(); + DropDownTemplate::getInstance().Destroy(); + DropDownTemplate::getInstance().Destroy(); + DropDownTemplate::getInstance().Destroy(); + DropDownTemplate::getInstance().Destroy(); + DropDownTemplate::getInstance().Destroy(); + DropDownTemplate::getInstance().Destroy(); + DropDownTemplate::getInstance().Destroy(); RemoveButton( giIMPPrejudiceFinishButton ); UnloadButtonImage( giIMPPrejudiceFinishButtonImage ); @@ -916,7 +297,6 @@ void HandleIMPPrejudice( void ) void IMPPrejudiceDisplay() { - UINT32 uiCnt; UINT16 usPosX, usPosY; //Display the title @@ -930,10 +310,10 @@ void IMPPrejudiceDisplay() // Appearance DrawTextToScreen( szPersonalityDisplayText[PERSONALITYTEXT_YOULOOK], usPosX, usPosY, 0, IMP_PREJUDICE__FONT, IMP_PREJUDICE__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); - usPosX = 10 + DropDown_Appearance::getInstance().GetLastX(); + usPosX = 10 + DropDownTemplate::getInstance().GetLastX(); DrawTextToScreen( szPersonalityDisplayText[PERSONALITYTEXT_ANDAPPEARANCEIS], usPosX, usPosY, 0, IMP_PREJUDICE__FONT, IMP_PREJUDICE__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); - usPosX = 10 + DropDown_AppearanceCare::getInstance().GetLastX(); + usPosX = 10 + DropDownTemplate::getInstance().GetLastX(); DrawTextToScreen( szPersonalityDisplayText[PERSONALITYTEXT_IMPORTANTTOYOU], usPosX, usPosY, 0, IMP_PREJUDICE__FONT, IMP_PREJUDICE__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); // Refinement @@ -941,10 +321,10 @@ void IMPPrejudiceDisplay() usPosY += DROPDOWN_MARKUP_Y; DrawTextToScreen( szPersonalityDisplayText[PERSONALITYTEXT_YOUHAVE], usPosX, usPosY, 0, IMP_PREJUDICE__FONT, IMP_PREJUDICE__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); - usPosX = 10 + DropDown_Refinement::getInstance().GetLastX(); + usPosX = 10 + DropDownTemplate::getInstance().GetLastX(); DrawTextToScreen( szPersonalityDisplayText[PERSONALITYTEXT_ANDCARE], usPosX, usPosY, 0, IMP_PREJUDICE__FONT, IMP_PREJUDICE__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); - usPosX = 10 + DropDown_RefinementCare::getInstance().GetLastX(); + usPosX = 10 + DropDownTemplate::getInstance().GetLastX(); DrawTextToScreen( szPersonalityDisplayText[PERSONALITYTEXT_ABOUTTHAT], usPosX, usPosY, 0, IMP_PREJUDICE__FONT, IMP_PREJUDICE__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); // Hated Nations @@ -952,7 +332,7 @@ void IMPPrejudiceDisplay() usPosY += DROPDOWN_MARKUP_Y; DrawTextToScreen( szPersonalityDisplayText[PERSONALITYTEXT_YOUARE], usPosX, usPosY, 0, IMP_PREJUDICE__FONT, IMP_PREJUDICE__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); - usPosX = 10 + DropDown_Nationality::getInstance().GetLastX(); + usPosX = 10 + DropDownTemplate::getInstance().GetLastX(); DrawTextToScreen( szPersonalityDisplayText[PERSONALITYTEXT_ADHATEEVERYONE], usPosX, usPosY, 0, IMP_PREJUDICE__FONT, IMP_PREJUDICE__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); // Racism @@ -960,10 +340,10 @@ void IMPPrejudiceDisplay() usPosY += DROPDOWN_MARKUP_Y; DrawTextToScreen( szPersonalityDisplayText[PERSONALITYTEXT_YOUARE], usPosX, usPosY, 0, IMP_PREJUDICE__FONT, IMP_PREJUDICE__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); - usPosX = 10 + DropDown_Racist::getInstance().GetLastX(); + usPosX = 10 + DropDownTemplate::getInstance().GetLastX(); DrawTextToScreen( szPersonalityDisplayText[PERSONALITYTEXT_RACISTAGAINSTNON], usPosX, usPosY, 0, IMP_PREJUDICE__FONT, IMP_PREJUDICE__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); - usPosX = 10 + DropDown_RacistTarget::getInstance().GetLastX(); + usPosX = 10 + DropDownTemplate::getInstance().GetLastX(); DrawTextToScreen( szPersonalityDisplayText[PERSONALITYTEXT_PEOPLE], usPosX, usPosY, 0, IMP_PREJUDICE__FONT, IMP_PREJUDICE__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); // Sexism @@ -971,7 +351,7 @@ void IMPPrejudiceDisplay() usPosY += DROPDOWN_MARKUP_Y; DrawTextToScreen( szPersonalityDisplayText[PERSONALITYTEXT_YOUARE], usPosX, usPosY, 0, IMP_PREJUDICE__FONT, IMP_PREJUDICE__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); - usPosX = 10 + DropDown_Sexist::getInstance().GetLastX(); + usPosX = 10 + DropDownTemplate::getInstance().GetLastX(); DrawTextToScreen( szPersonalityDisplayText[PERSONALITYTEXT_DOT], usPosX, usPosY, 0, IMP_PREJUDICE__FONT, IMP_PREJUDICE__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); } @@ -996,16 +376,16 @@ void BtnIMPPrejudiceFinishCallback(GUI_BUTTON *btn,INT32 reason) else { // we finished this -> write down our choices - bRace = ( INT8)DropDown_RacistTarget::getInstance().GetSelectedEntryKey(); - bNationality = ( INT8)DropDown_Nationality::getInstance().GetSelectedEntryKey(); - bAppearance = ( INT8)DropDown_Appearance::getInstance().GetSelectedEntryKey(); - bAppearanceCareLevel = ( INT8)DropDown_AppearanceCare::getInstance().GetSelectedEntryKey(); - bRefinement = ( INT8)DropDown_Refinement::getInstance().GetSelectedEntryKey(); - bRefinementCareLevel = ( INT8)DropDown_RefinementCare::getInstance().GetSelectedEntryKey(); - bHatedNationality = ( INT8)DropDown_HatedNationality::getInstance().GetSelectedEntryKey(); - bHatedNationalityCareLevel = ( INT8)DropDown_HatedNationalityCare::getInstance().GetSelectedEntryKey(); - bRacist = ( INT8)DropDown_Racist::getInstance().GetSelectedEntryKey(); - bSexist = (UINT8)DropDown_Sexist::getInstance().GetSelectedEntryKey(); + bRace = ( INT8)DropDownTemplate::getInstance().GetSelectedEntryKey(); + bNationality = ( INT8)DropDownTemplate::getInstance().GetSelectedEntryKey(); + bAppearance = ( INT8)DropDownTemplate::getInstance().GetSelectedEntryKey(); + bAppearanceCareLevel = ( INT8)DropDownTemplate::getInstance().GetSelectedEntryKey(); + bRefinement = ( INT8)DropDownTemplate::getInstance().GetSelectedEntryKey(); + bRefinementCareLevel = ( INT8)DropDownTemplate::getInstance().GetSelectedEntryKey(); + bHatedNationality = ( INT8)DropDownTemplate::getInstance().GetSelectedEntryKey(); + bHatedNationalityCareLevel = ( INT8)DropDownTemplate::getInstance().GetSelectedEntryKey(); + bRacist = ( INT8)DropDownTemplate::getInstance().GetSelectedEntryKey(); + bSexist = (UINT8)DropDownTemplate::getInstance().GetSelectedEntryKey(); if ( gGameOptions.fBackGround ) { diff --git a/Laptop/IMP Prejudice.h b/Laptop/IMP Prejudice.h index de126aff..572f24bc 100644 --- a/Laptop/IMP Prejudice.h +++ b/Laptop/IMP Prejudice.h @@ -1,8 +1,12 @@ #ifndef __IMP_PREJUDICE__H_ #define __IMP_PREJUDICE__H_ +/** + * @file + * @author Flugente (bears-pit.com) + */ + #include "Types.h" -#include "mousesystem.h" void EnterIMPPrejudice( void ); void RenderIMPPrejudice( void ); diff --git a/Utils/Text.h b/Utils/Text.h index 98e043b6..baeecbb6 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -2405,6 +2405,7 @@ enum PERSONALITYTEXT_MAX, }; extern STR16 szPersonalityDisplayText[]; +extern STR16 szPersonalityHelpText[]; extern STR16 szRaceText[]; extern STR16 szAppearanceText[]; extern STR16 szRefinementText[]; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index 2b258bae..dfb151ea 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -7716,6 +7716,20 @@ STR16 szPersonalityDisplayText[]= // TODO.Translate L"people.", }; +// texts showing up when hovering over the box, used to explain what a selection does. Do not use more than 200 characters! +STR16 szPersonalityHelpText[]= +{ + L"How do you look?", + L"How important are the looks of others to you?", + L"What are your manners?", + L"How important are the manners of other people to you?", + L"What is your nationality?", + L"What nation o you dislike?", + L"How much do you dislike that nation?", + L"How racist are you?", + L"What is your race? You will be\nracist against all other races.", + L"How sexist are you against the other gender?", +}; STR16 szRaceText[]= { diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index cd3b0ea0..e1c1bbe7 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -7733,6 +7733,20 @@ STR16 szPersonalityDisplayText[]= // TODO.Translate L"people.", }; +// texts showing up when hovering over the box, used to explain what a selection does. Do not use more than 200 characters! +STR16 szPersonalityHelpText[]= +{ + L"How do you look?", + L"How important are the looks of others to you?", + L"What are your manners?", + L"How important are the manners of other people to you?", + L"What is your nationality?", + L"What nation o you dislike?", + L"How much do you dislike that nation?", + L"How racist are you?", + L"What is your race? You will be\nracist against all other races.", + L"How sexist are you against the other gender?", +}; STR16 szRaceText[]= { diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 0f046df2..e1591163 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -7716,6 +7716,21 @@ STR16 szPersonalityDisplayText[]= L"people.", }; +// texts showing up when hovering over the box, used to explain what a selection does. Do not use more than 200 characters! +STR16 szPersonalityHelpText[]= +{ + L"How do you look?", + L"How important are the looks of others to you?", + L"What are your manners?", + L"How important are the manners of other people to you?", + L"What is your nationality?", + L"What nation o you dislike?", + L"How much do you dislike that nation?", + L"How racist are you?", + L"What is your race? You will be\nracist against all other races.", + L"How sexist are you against the other gender?", +}; + STR16 szRaceText[]= { diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index c9c4361c..2d887430 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -7718,6 +7718,20 @@ STR16 szPersonalityDisplayText[]= // TODO.Translate L"people.", }; +// texts showing up when hovering over the box, used to explain what a selection does. Do not use more than 200 characters! +STR16 szPersonalityHelpText[]= +{ + L"How do you look?", + L"How important are the looks of others to you?", + L"What are your manners?", + L"How important are the manners of other people to you?", + L"What is your nationality?", + L"What nation o you dislike?", + L"How much do you dislike that nation?", + L"How racist are you?", + L"What is your race? You will be\nracist against all other races.", + L"How sexist are you against the other gender?", +}; STR16 szRaceText[]= { diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index 7b8efaa5..039b1460 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -7542,6 +7542,20 @@ STR16 szPersonalityDisplayText[]= // TODO.Translate L"people.", }; +// texts showing up when hovering over the box, used to explain what a selection does. Do not use more than 200 characters! +STR16 szPersonalityHelpText[]= +{ + L"How do you look?", + L"How important are the looks of others to you?", + L"What are your manners?", + L"How important are the manners of other people to you?", + L"What is your nationality?", + L"What nation o you dislike?", + L"How much do you dislike that nation?", + L"How racist are you?", + L"What is your race? You will be\nracist against all other races.", + L"How sexist are you against the other gender?", +}; STR16 szRaceText[]= { diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 96da8bed..09f65658 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -7720,6 +7720,20 @@ STR16 szPersonalityDisplayText[]= // TODO.Translate L"people.", }; +// texts showing up when hovering over the box, used to explain what a selection does. Do not use more than 200 characters! +STR16 szPersonalityHelpText[]= +{ + L"How do you look?", + L"How important are the looks of others to you?", + L"What are your manners?", + L"How important are the manners of other people to you?", + L"What is your nationality?", + L"What nation o you dislike?", + L"How much do you dislike that nation?", + L"How racist are you?", + L"What is your race? You will be\nracist against all other races.", + L"How sexist are you against the other gender?", +}; STR16 szRaceText[]= { diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 22982a98..60a3cf5b 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -7744,6 +7744,20 @@ STR16 szPersonalityDisplayText[]= // TODO.Translate L"people.", }; +// texts showing up when hovering over the box, used to explain what a selection does. Do not use more than 200 characters! +STR16 szPersonalityHelpText[]= +{ + L"How do you look?", + L"How important are the looks of others to you?", + L"What are your manners?", + L"How important are the manners of other people to you?", + L"What is your nationality?", + L"What nation o you dislike?", + L"How much do you dislike that nation?", + L"How racist are you?", + L"What is your race? You will be\nracist against all other races.", + L"How sexist are you against the other gender?", +}; STR16 szRaceText[]= { diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 8da4f4a7..75135d3f 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -7718,6 +7718,20 @@ STR16 szPersonalityDisplayText[]= // TODO.Translate L"people.", }; +// texts showing up when hovering over the box, used to explain what a selection does. Do not use more than 200 characters! +STR16 szPersonalityHelpText[]= +{ + L"How do you look?", + L"How important are the looks of others to you?", + L"What are your manners?", + L"How important are the manners of other people to you?", + L"What is your nationality?", + L"What nation o you dislike?", + L"How much do you dislike that nation?", + L"How racist are you?", + L"What is your race? You will be\nracist against all other races.", + L"How sexist are you against the other gender?", +}; STR16 szRaceText[]= { diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index b95fe893..a18de86f 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -7735,6 +7735,20 @@ STR16 szPersonalityDisplayText[]= // TODO.Translate L"people.", }; +// texts showing up when hovering over the box, used to explain what a selection does. Do not use more than 200 characters! +STR16 szPersonalityHelpText[]= +{ + L"How do you look?", + L"How important are the looks of others to you?", + L"What are your manners?", + L"How important are the manners of other people to you?", + L"What is your nationality?", + L"What nation o you dislike?", + L"How much do you dislike that nation?", + L"How racist are you?", + L"What is your race? You will be\nracist against all other races.", + L"How sexist are you against the other gender?", +}; STR16 szRaceText[]= {