mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-24 17:52:17 +00:00
Remove virtual inheritance from the codebase, refs 6b51d71c85, e21ebb37f5 e326ebae46.
Remove workaround in 3d07327837 / D2136, the pointer from IGUIObject to
IGUITextOwner that avoided the dynamic_cast.
Have the GUIObject implementing class take responsibility of calling the
virtual methods in the base classes.
Leaves the code in a clean state that can serve as an example for new
GUI object classes, such as D1346, refs #4683.
Differential Revision: https://code.wildfiregames.com/D2325
Comments By: Vladislav on IRC 2019-07-30, 2019-08-22, 2019-09-20-23
Tested on: clang 8.0.1, Jenkins
This was SVN commit r23020.
This commit is contained in:
+15
-3
@@ -25,8 +25,8 @@
|
||||
|
||||
CButton::CButton(CGUI& pGUI)
|
||||
: IGUIObject(pGUI),
|
||||
IGUIButtonBehavior(pGUI),
|
||||
IGUITextOwner(pGUI),
|
||||
IGUIButtonBehavior(*static_cast<IGUIObject*>(this)),
|
||||
IGUITextOwner(*static_cast<IGUIObject*>(this)),
|
||||
m_BufferZone(),
|
||||
m_CellID(),
|
||||
m_Caption(),
|
||||
@@ -72,9 +72,21 @@ void CButton::SetupText()
|
||||
CalculateTextPosition(m_CachedActualSize, m_TextPos, m_GeneratedTexts[0]);
|
||||
}
|
||||
|
||||
void CButton::ResetStates()
|
||||
{
|
||||
IGUIObject::ResetStates();
|
||||
IGUIButtonBehavior::ResetStates();
|
||||
}
|
||||
|
||||
void CButton::UpdateCachedSize()
|
||||
{
|
||||
IGUIObject::UpdateCachedSize();
|
||||
IGUITextOwner::UpdateCachedSize();
|
||||
}
|
||||
|
||||
void CButton::HandleMessage(SGUIMessage& Message)
|
||||
{
|
||||
// Important
|
||||
IGUIObject::HandleMessage(Message);
|
||||
IGUIButtonBehavior::HandleMessage(Message);
|
||||
IGUITextOwner::HandleMessage(Message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user