Renamed RibbonGridWidget to DynamicRibbonWidget since it better reflects what it has become

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3945 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2009-08-29 15:18:48 +00:00
parent 11bb21770f
commit e0acfe1ef6
13 changed files with 83 additions and 82 deletions

View File

@@ -93,6 +93,8 @@ supertuxkart_SOURCES = \
guiengine/widgets/button_widget.hpp \
guiengine/widgets/check_box_widget.cpp \
guiengine/widgets/check_box_widget.hpp \
guiengine/widgets/dynamic_ribbon_widget.cpp \
guiengine/widgets/dynamic_ribbon_widget.hpp \
guiengine/widgets/icon_button_widget.cpp \
guiengine/widgets/icon_button_widget.hpp \
guiengine/widgets/label_widget.cpp \
@@ -101,8 +103,6 @@ supertuxkart_SOURCES = \
guiengine/widgets/list_widget.hpp \
guiengine/widgets/model_view_widget.cpp \
guiengine/widgets/model_view_widget.hpp \
guiengine/widgets/ribbon_grid_widget.cpp \
guiengine/widgets/ribbon_grid_widget.hpp \
guiengine/widgets/ribbon_widget.cpp \
guiengine/widgets/ribbon_widget.hpp \
guiengine/widgets/spinner_widget.cpp \

View File

@@ -70,18 +70,18 @@ A container. Does not do much on itself, but is useful to lay out children autom
Supports property PROP_LAYOUT. Of spawn type (<div>...</div>, place children within)
"box" is a variant that acts exactly the same but is visible on-screen
WTYPE_RIBBON_GRID "ribbon_grid", "scrollable_ribbon", "scrollable_toolbar"
Shows a scrollable grid of icons. NOT of spawn type (<ribbon_grid .../>), contents must be programmatically set at runtime.
Property PROP_SQUARE can be set to tell the engine if the ribbon's contents are rectangular or not (this will
affect the type of highlighting used). Supports an optional label at the bottom if PROP_TEXT is set.
PROP_CHILD_WIDTH and PROP_CHILD_HEIGHT are mandatory (so at least aspect ratio of elements that will later be added isk nown)
WTYPE_DYNAMIC_RIBBON "ribbon_grid", "scrollable_ribbon", "scrollable_toolbar"
Builds uponc the basic Ribbon to be more dynamic (dynamics contents, possibly with scrolling, possibly multi-line)
NOT of spawn type (<ribbon_grid .../>), contents must be programmatically set at runtime.
Property PROP_SQUARE can be set to tell the engine if the ribbon's contents are rectangular or icons (this will
affect the type of highlighting used).
PROP_CHILD_WIDTH and PROP_CHILD_HEIGHT are mandatory (so at least aspect ratio of elements that will later be added is nown)
An interesting aspect of PROP_CHILD_WIDTH and PROP_CHILD_HEIGHT is that you can use them to show textures to any aspect ratio
you want (so you can e.g. save textures to a power-of-two size like 256x256, but then show it in 4:3 ratio).
Gives a special meaning to the text parameter. A value of "bottom" means to display the name of the selected icon at the bottom.
A value of "all" means that each icon shall have its name under it.
The "scrollable_ribbon" and "scrollable_toolbar" subtypes are single-line scrollable ribbons; they use the ribbon-grid
implementation since it already supports scrolling so no need to duplicate code... The difference between both is that
'scrollable_ribbon always has a value selected (like in a combo box, or radio buttons), while 'scrollable_toolbar' is a
Supports an optional label at the bottom if PROP_TEXT is set. Gives a special meaning to the text parameter. A value of "bottom"
means to display the name of the selected icon at the bottom. A value of "all" means that each icon shall have its name under it.
The "scrollable_ribbon" and "scrollable_toolbar" subtypes are single-line scrollable ribbons. The difference between both is that
'scrollable_ribbon' always has a value selected (like in a combo box, or radio buttons), while 'scrollable_toolbar' is a
scrollable list of buttons that can be pressed to trigger actions.
WTYPE_MODEL_VIEW "model"

View File

@@ -119,15 +119,15 @@ void parseScreenFileDiv(irr::io::IrrXMLReader* xml, ptr_vector<Widget>& append_t
}
else if (!strcmp("ribbon_grid", xml->getNodeName()))
{
append_to.push_back(new RibbonGridWidget());
append_to.push_back(new DynamicRibbonWidget());
}
else if (!strcmp("scrollable_ribbon", xml->getNodeName()))
{
append_to.push_back(new RibbonGridWidget(true, 1));
append_to.push_back(new DynamicRibbonWidget(true, 1));
}
else if (!strcmp("scrollable_toolbar", xml->getNodeName()))
{
append_to.push_back(new RibbonGridWidget(false, 1));
append_to.push_back(new DynamicRibbonWidget(false, 1));
}
else if (!strcmp("model", xml->getNodeName()))
{

View File

@@ -33,7 +33,7 @@ using namespace gui;
namespace GUIEngine
{
class RibbonGridWidget;
class DynamicRibbonWidget;
enum WidgetType
{
@@ -46,7 +46,7 @@ namespace GUIEngine
WTYPE_LABEL,
WTYPE_SPACER,
WTYPE_DIV,
WTYPE_RIBBON_GRID,
WTYPE_DYNAMIC_RIBBON,
WTYPE_MODEL_VIEW,
WTYPE_LIST,
WTYPE_TEXTBOX
@@ -98,7 +98,7 @@ namespace GUIEngine
friend class Screen;
friend class SpinnerWidget;
friend class Skin;
friend class RibbonGridWidget;
friend class DynamicRibbonWidget;
/**
* These methods provide new unique IDs each time you call them.

View File

@@ -4,7 +4,7 @@
#include "guiengine/widgets/button_widget.hpp"
#include "guiengine/widgets/icon_button_widget.hpp"
#include "guiengine/widgets/list_widget.hpp"
#include "guiengine/widgets/ribbon_grid_widget.hpp"
#include "guiengine/widgets/dynamic_ribbon_widget.hpp"
#include "guiengine/widgets/spinner_widget.hpp"
#include "guiengine/widgets/ribbon_widget.hpp"
#include "guiengine/widgets/model_view_widget.hpp"

View File

@@ -16,7 +16,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "guiengine/engine.hpp"
#include "guiengine/widgets/ribbon_grid_widget.hpp"
#include "guiengine/widgets/dynamic_ribbon_widget.hpp"
#include "io/file_manager.hpp"
#include <sstream>
@@ -27,7 +27,7 @@ using namespace GUIEngine;
# define round(x) (floor(x+0.5f))
#endif
RibbonGridWidget::RibbonGridWidget(const bool combo, const int max_rows)
DynamicRibbonWidget::DynamicRibbonWidget(const bool combo, const int max_rows)
{
m_scroll_offset = 0;
m_needed_cols = 0;
@@ -40,7 +40,7 @@ RibbonGridWidget::RibbonGridWidget(const bool combo, const int max_rows)
m_left_widget = NULL;
m_right_widget = NULL;
m_type = WTYPE_RIBBON_GRID;
m_type = WTYPE_DYNAMIC_RIBBON;
for (int n=0; n<MAX_PLAYER_COUNT; n++)
{
@@ -49,7 +49,7 @@ RibbonGridWidget::RibbonGridWidget(const bool combo, const int max_rows)
m_selected_item[0] = 0; // only player 0 has a selection by default
}
// -----------------------------------------------------------------------------
void RibbonGridWidget::add()
void DynamicRibbonWidget::add()
{
m_has_label = (m_properties[PROP_TEXT] == "bottom");
m_label_height = m_has_label ? 25 : 0; // FIXME : get height from font, don't hardcode
@@ -136,7 +136,7 @@ void RibbonGridWidget::add()
setSubElements();
}
// -----------------------------------------------------------------------------
void RibbonGridWidget::setSubElements()
void DynamicRibbonWidget::setSubElements()
{
// ---- Clean-up what was previously there
for (int i=0; i<m_children.size(); i++)
@@ -227,7 +227,7 @@ void RibbonGridWidget::setSubElements()
}
// -----------------------------------------------------------------------------
void RibbonGridWidget::addItem( std::string user_name, std::string code_name, std::string image_file )
void DynamicRibbonWidget::addItem( std::string user_name, std::string code_name, std::string image_file )
{
ItemDescription desc;
desc.m_user_name = user_name;
@@ -237,7 +237,7 @@ void RibbonGridWidget::addItem( std::string user_name, std::string code_name, st
m_items.push_back(desc);
}
// -----------------------------------------------------------------------------
void RibbonGridWidget::clearItems()
void DynamicRibbonWidget::clearItems()
{
m_items.clear();
}
@@ -247,7 +247,7 @@ void RibbonGridWidget::clearItems()
#pragma mark Getters
#endif
const std::string& RibbonGridWidget::getSelectionIDString(const int playerID)
const std::string& DynamicRibbonWidget::getSelectionIDString(const int playerID)
{
RibbonWidget* row = (RibbonWidget*)(m_rows.size() == 1 ? m_rows.get(0) : getSelectedRibbon(playerID));
@@ -257,7 +257,7 @@ const std::string& RibbonGridWidget::getSelectionIDString(const int playerID)
return nothing;
}
// -----------------------------------------------------------------------------
const std::string& RibbonGridWidget::getSelectionText(const int playerID)
const std::string& DynamicRibbonWidget::getSelectionText(const int playerID)
{
RibbonWidget* row = (RibbonWidget*)(m_rows.size() == 1 ? m_rows.get(0) : getSelectedRibbon(playerID));
@@ -267,7 +267,7 @@ const std::string& RibbonGridWidget::getSelectionText(const int playerID)
return nothing;
}
// -----------------------------------------------------------------------------
RibbonWidget* RibbonGridWidget::getRowContaining(Widget* w) const
RibbonWidget* DynamicRibbonWidget::getRowContaining(Widget* w) const
{
const int row_amount = m_rows.size();
for(int n=0; n<row_amount; n++)
@@ -282,7 +282,7 @@ RibbonWidget* RibbonGridWidget::getRowContaining(Widget* w) const
return NULL;
}
// -----------------------------------------------------------------------------
RibbonWidget* RibbonGridWidget::getSelectedRibbon(const int playerID) const
RibbonWidget* DynamicRibbonWidget::getSelectedRibbon(const int playerID) const
{
if (playerID == 0)
{
@@ -319,12 +319,12 @@ RibbonWidget* RibbonGridWidget::getSelectedRibbon(const int playerID) const
#pragma mark Event Handling
#endif
void RibbonGridWidget::registerHoverListener(RibbonGridHoverListener* listener)
void DynamicRibbonWidget::registerHoverListener(DynamicRibbonHoverListener* listener)
{
m_hover_listeners.push_back(listener);
}
// -----------------------------------------------------------------------------
bool RibbonGridWidget::rightPressed(const int playerID)
bool DynamicRibbonWidget::rightPressed(const int playerID)
{
RibbonWidget* w = getSelectedRibbon(playerID);
if (w != NULL)
@@ -345,7 +345,7 @@ bool RibbonGridWidget::rightPressed(const int playerID)
return true;
}
// -----------------------------------------------------------------------------
bool RibbonGridWidget::leftPressed(const int playerID)
bool DynamicRibbonWidget::leftPressed(const int playerID)
{
RibbonWidget* w = getSelectedRibbon(playerID);
if (w != NULL)
@@ -366,7 +366,7 @@ bool RibbonGridWidget::leftPressed(const int playerID)
return true;
}
// -----------------------------------------------------------------------------
bool RibbonGridWidget::transmitEvent(Widget* w, std::string& originator, const int playerID)
bool DynamicRibbonWidget::transmitEvent(Widget* w, std::string& originator, const int playerID)
{
if (originator=="left")
{
@@ -393,7 +393,7 @@ bool RibbonGridWidget::transmitEvent(Widget* w, std::string& originator, const i
return true;
}
// -----------------------------------------------------------------------------
bool RibbonGridWidget::mouseHovered(Widget* child)
bool DynamicRibbonWidget::mouseHovered(Widget* child)
{
updateLabel();
propagateSelection();
@@ -413,7 +413,7 @@ bool RibbonGridWidget::mouseHovered(Widget* child)
return false;
}
// -----------------------------------------------------------------------------
void RibbonGridWidget::focused(const int playerID)
void DynamicRibbonWidget::focused(const int playerID)
{
Widget::focused(playerID);
updateLabel();
@@ -425,7 +425,7 @@ void RibbonGridWidget::focused(const int playerID)
}
}
// -----------------------------------------------------------------------------
void RibbonGridWidget::onRowChange(RibbonWidget* row, const int playerID)
void DynamicRibbonWidget::onRowChange(RibbonWidget* row, const int playerID)
{
updateLabel(row);
@@ -441,7 +441,7 @@ void RibbonGridWidget::onRowChange(RibbonWidget* row, const int playerID)
#pragma mark Setters / Actions
#endif
void RibbonGridWidget::scroll(const int x_delta)
void DynamicRibbonWidget::scroll(const int x_delta)
{
// Refuse to scroll when everything is visible
if ((int)m_items.size() <= m_row_amount*m_col_amount) return;
@@ -468,11 +468,11 @@ void RibbonGridWidget::scroll(const int x_delta)
}
}
// -----------------------------------------------------------------------------
/** RibbonGridWidget is made of several ribbons; each of them thus has
/** DynamicRibbonWidget is made of several ribbons; each of them thus has
its own selection independently of each other. To keep a grid feeling
(i.e. you remain in the same column when pressing up/down), this method is
used to ensure that all children ribbons always select the same column */
void RibbonGridWidget::propagateSelection()
void DynamicRibbonWidget::propagateSelection()
{
for (int p=0; p<MAX_PLAYER_COUNT; p++)
{
@@ -503,7 +503,7 @@ void RibbonGridWidget::propagateSelection()
}
}
// -----------------------------------------------------------------------------
void RibbonGridWidget::updateLabel(RibbonWidget* from_this_ribbon)
void DynamicRibbonWidget::updateLabel(RibbonWidget* from_this_ribbon)
{
if (!m_has_label) return;
@@ -528,7 +528,7 @@ void RibbonGridWidget::updateLabel(RibbonWidget* from_this_ribbon)
m_label->setText( L"Random" );
}
// -----------------------------------------------------------------------------
void RibbonGridWidget::updateItemDisplay()
void DynamicRibbonWidget::updateItemDisplay()
{
// Check if we need to update the number of icons in the ribbon
if ((int)m_items.size() != m_previous_item_count)
@@ -583,11 +583,11 @@ void RibbonGridWidget::updateItemDisplay()
} // next row
}
// -----------------------------------------------------------------------------
void RibbonGridWidget::setSelection(int item_id)
void DynamicRibbonWidget::setSelection(int item_id)
{
if (m_rows.size() > 1)
{
std::cout << "\n/!\\ Warning, RibbonGridWidget::setSelection only makes sense on 1-row ribbons " <<
std::cout << "\n/!\\ Warning, DynamicRibbonWidget::setSelection only makes sense on 1-row ribbons " <<
"(since there can't logically be a permanent with more than one row)\n\n";
return;
}
@@ -610,7 +610,7 @@ void RibbonGridWidget::setSelection(int item_id)
}
// -----------------------------------------------------------------------------
void RibbonGridWidget::setSelection(int item_id, const int playerID)
void DynamicRibbonWidget::setSelection(int item_id, const int playerID)
{
m_selected_item[playerID] = item_id;
@@ -632,7 +632,7 @@ void RibbonGridWidget::setSelection(int item_id, const int playerID)
if (row == -1)
{
std::cerr << "RibbonGridWidget::setSelection cannot find item " << item_id << " (" << name.c_str() << ")\n";
std::cerr << "DynamicRibbonWidget::setSelection cannot find item " << item_id << " (" << name.c_str() << ")\n";
return;
}

View File

@@ -35,11 +35,11 @@ namespace GUIEngine
* Even if you have a ribbon that only acts on click/enter, you may wish to know which
* item is currently highlighted. In this case, create a listener and pass it to the ribbon.
*/
class RibbonGridHoverListener
class DynamicRibbonHoverListener
{
public:
virtual ~RibbonGridHoverListener() {}
virtual void onSelectionChanged(RibbonGridWidget* theWidget, const std::string& selectionID, const int playerID) = 0;
virtual ~DynamicRibbonHoverListener() {}
virtual void onSelectionChanged(DynamicRibbonWidget* theWidget, const std::string& selectionID, const int playerID) = 0;
};
struct ItemDescription
@@ -51,13 +51,13 @@ namespace GUIEngine
/** A dynamic ribbon (builds upon RibbonWidget, adding dynamic contents creation and sizing, scrolling, multiple-row
layouts). See guiengine/engine.hpp for a detailed overview */
class RibbonGridWidget : public Widget
class DynamicRibbonWidget : public Widget
{
friend class RibbonWidget;
ptr_vector<RibbonGridHoverListener> m_hover_listeners;
ptr_vector<DynamicRibbonHoverListener> m_hover_listeners;
virtual ~RibbonGridWidget() {}
virtual ~DynamicRibbonWidget() {}
/** Used for ribbon grids that have a label at the bottom */
bool m_has_label;
@@ -140,7 +140,7 @@ namespace GUIEngine
bool mouseHovered(Widget* child);
public:
RibbonGridWidget(const bool combo=false, const int max_rows=4);
DynamicRibbonWidget(const bool combo=false, const int max_rows=4);
/** Reference pointers only, the actual instances are owned by m_children. Used to create mtultiple-row
ribbons (what appears to be a grid of icons is actually a vector of stacked basic ribbons) */
@@ -153,7 +153,7 @@ namespace GUIEngine
void clearItems();
/** Register a listener to be notified of selection changes within the ribbon */
void registerHoverListener(RibbonGridHoverListener* listener);
void registerHoverListener(DynamicRibbonHoverListener* listener);
/** Called when right key is pressed */
bool rightPressed(const int playerID);

View File

@@ -224,7 +224,7 @@ bool RibbonWidget::rightPressed(const int playerID)
{
if (m_event_handler != NULL)
{
((RibbonGridWidget*)m_event_handler)->scroll(1); // FIXME? - find cleaner way to propagate event to parent
((DynamicRibbonWidget*)m_event_handler)->scroll(1); // FIXME? - find cleaner way to propagate event to parent
m_selection[playerID] = m_children.size()-1;
}
else m_selection[playerID] = 0;
@@ -242,7 +242,7 @@ bool RibbonWidget::leftPressed(const int playerID)
{
if (m_event_handler != NULL)
{
((RibbonGridWidget*)m_event_handler)->scroll(-1); // FIXME? - find cleaner way to propagate event to parent
((DynamicRibbonWidget*)m_event_handler)->scroll(-1); // FIXME? - find cleaner way to propagate event to parent
m_selection[playerID] = 0;
}
else m_selection[playerID] = m_children.size()-1;
@@ -267,7 +267,7 @@ void RibbonWidget::focused(const int playerID)
if (playerID == 0) GUIEngine::getGUIEnv()->setFocus(m_focus->m_element);
// FIXME : unclean, children ribbons shouldn't need to know about their parent
((RibbonGridWidget*)m_event_handler)->onRowChange( this, playerID );
((DynamicRibbonWidget*)m_event_handler)->onRowChange( this, playerID );
}
}
// -----------------------------------------------------------------------------

View File

@@ -42,7 +42,7 @@ namespace GUIEngine
See guiengine/engine.hpp for a detailed overview */
class RibbonWidget : public Widget
{
friend class RibbonGridWidget;
friend class DynamicRibbonWidget;
friend class EventHandler;
int m_selection[MAX_PLAYER_COUNT];

View File

@@ -22,6 +22,7 @@
9507E9D20FC1CDCE00BD2B92 /* OpenAL.framework in Copy frameworks */ = {isa = PBXBuildFile; fileRef = 9551C7FA0FC1B63C00DB481B /* OpenAL.framework */; };
9507E9DB0FC1CDD500BD2B92 /* Vorbis.framework in Copy frameworks */ = {isa = PBXBuildFile; fileRef = 9551C7FB0FC1B63C00DB481B /* Vorbis.framework */; };
951BC65E0FFAF290006B5FF1 /* ipo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 951BC65C0FFAF290006B5FF1 /* ipo.cpp */; };
9524739610497C75000C197E /* dynamic_ribbon_widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9524739510497C75000C197E /* dynamic_ribbon_widget.cpp */; };
95263DEC0FD7471900CF5F92 /* grand_prix_data.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95263DE00FD7471900CF5F92 /* grand_prix_data.cpp */; };
95263DED0FD7471900CF5F92 /* grand_prix_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95263DE20FD7471900CF5F92 /* grand_prix_manager.cpp */; };
95263DEE0FD7471900CF5F92 /* highscore_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95263DE40FD7471900CF5F92 /* highscore_manager.cpp */; };
@@ -263,7 +264,6 @@
95ECA10310124C5000D47C5F /* label_widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95ECA0F210124C5000D47C5F /* label_widget.cpp */; };
95ECA10410124C5000D47C5F /* list_widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95ECA0F410124C5000D47C5F /* list_widget.cpp */; };
95ECA10510124C5000D47C5F /* model_view_widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95ECA0F610124C5000D47C5F /* model_view_widget.cpp */; };
95ECA10610124C5000D47C5F /* ribbon_grid_widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95ECA0F810124C5000D47C5F /* ribbon_grid_widget.cpp */; };
95ECA10710124C5000D47C5F /* ribbon_widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95ECA0FA10124C5000D47C5F /* ribbon_widget.cpp */; };
95ECA10810124C5000D47C5F /* spinner_widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95ECA0FC10124C5000D47C5F /* spinner_widget.cpp */; };
95ECA10910124C5000D47C5F /* text_box_widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95ECA0FE10124C5000D47C5F /* text_box_widget.cpp */; };
@@ -321,6 +321,8 @@
951C357E0FC05BF400A48379 /* quad_set.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = quad_set.cpp; path = ../../tracks/quad_set.cpp; sourceTree = SOURCE_ROOT; };
951C357F0FC05BF400A48379 /* quad_graph.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = quad_graph.hpp; path = ../../tracks/quad_graph.hpp; sourceTree = SOURCE_ROOT; };
951C35800FC05BF400A48379 /* quad_graph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = quad_graph.cpp; path = ../../tracks/quad_graph.cpp; sourceTree = SOURCE_ROOT; };
9524739410497C75000C197E /* dynamic_ribbon_widget.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = dynamic_ribbon_widget.hpp; path = ../../guiengine/widgets/dynamic_ribbon_widget.hpp; sourceTree = SOURCE_ROOT; };
9524739510497C75000C197E /* dynamic_ribbon_widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dynamic_ribbon_widget.cpp; path = ../../guiengine/widgets/dynamic_ribbon_widget.cpp; sourceTree = SOURCE_ROOT; };
95263DE00FD7471900CF5F92 /* grand_prix_data.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = grand_prix_data.cpp; path = ../../race/grand_prix_data.cpp; sourceTree = SOURCE_ROOT; };
95263DE10FD7471900CF5F92 /* grand_prix_data.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = grand_prix_data.hpp; path = ../../race/grand_prix_data.hpp; sourceTree = SOURCE_ROOT; };
95263DE20FD7471900CF5F92 /* grand_prix_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = grand_prix_manager.cpp; path = ../../race/grand_prix_manager.cpp; sourceTree = SOURCE_ROOT; };
@@ -1007,8 +1009,6 @@
95ECA0F510124C5000D47C5F /* list_widget.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = list_widget.hpp; path = ../../guiengine/widgets/list_widget.hpp; sourceTree = SOURCE_ROOT; };
95ECA0F610124C5000D47C5F /* model_view_widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = model_view_widget.cpp; path = ../../guiengine/widgets/model_view_widget.cpp; sourceTree = SOURCE_ROOT; };
95ECA0F710124C5000D47C5F /* model_view_widget.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = model_view_widget.hpp; path = ../../guiengine/widgets/model_view_widget.hpp; sourceTree = SOURCE_ROOT; };
95ECA0F810124C5000D47C5F /* ribbon_grid_widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ribbon_grid_widget.cpp; path = ../../guiengine/widgets/ribbon_grid_widget.cpp; sourceTree = SOURCE_ROOT; };
95ECA0F910124C5000D47C5F /* ribbon_grid_widget.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ribbon_grid_widget.hpp; path = ../../guiengine/widgets/ribbon_grid_widget.hpp; sourceTree = SOURCE_ROOT; };
95ECA0FA10124C5000D47C5F /* ribbon_widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ribbon_widget.cpp; path = ../../guiengine/widgets/ribbon_widget.cpp; sourceTree = SOURCE_ROOT; };
95ECA0FB10124C5000D47C5F /* ribbon_widget.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ribbon_widget.hpp; path = ../../guiengine/widgets/ribbon_widget.hpp; sourceTree = SOURCE_ROOT; };
95ECA0FC10124C5000D47C5F /* spinner_widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = spinner_widget.cpp; path = ../../guiengine/widgets/spinner_widget.cpp; sourceTree = SOURCE_ROOT; };
@@ -2138,6 +2138,8 @@
95ECA0ED10124C5000D47C5F /* button_widget.hpp */,
95ECA0EE10124C5000D47C5F /* check_box_widget.cpp */,
95ECA0EF10124C5000D47C5F /* check_box_widget.hpp */,
9524739510497C75000C197E /* dynamic_ribbon_widget.cpp */,
9524739410497C75000C197E /* dynamic_ribbon_widget.hpp */,
95ECA0F010124C5000D47C5F /* icon_button_widget.cpp */,
95ECA0F110124C5000D47C5F /* icon_button_widget.hpp */,
95ECA0F210124C5000D47C5F /* label_widget.cpp */,
@@ -2146,8 +2148,6 @@
95ECA0F510124C5000D47C5F /* list_widget.hpp */,
95ECA0F610124C5000D47C5F /* model_view_widget.cpp */,
95ECA0F710124C5000D47C5F /* model_view_widget.hpp */,
95ECA0F810124C5000D47C5F /* ribbon_grid_widget.cpp */,
95ECA0F910124C5000D47C5F /* ribbon_grid_widget.hpp */,
95ECA0FA10124C5000D47C5F /* ribbon_widget.cpp */,
95ECA0FB10124C5000D47C5F /* ribbon_widget.hpp */,
95ECA0FC10124C5000D47C5F /* spinner_widget.cpp */,
@@ -2456,7 +2456,6 @@
95ECA10310124C5000D47C5F /* label_widget.cpp in Sources */,
95ECA10410124C5000D47C5F /* list_widget.cpp in Sources */,
95ECA10510124C5000D47C5F /* model_view_widget.cpp in Sources */,
95ECA10610124C5000D47C5F /* ribbon_grid_widget.cpp in Sources */,
95ECA10710124C5000D47C5F /* ribbon_widget.cpp in Sources */,
95ECA10810124C5000D47C5F /* spinner_widget.cpp in Sources */,
95ECA10910124C5000D47C5F /* text_box_widget.cpp in Sources */,
@@ -2474,6 +2473,7 @@
952A154F103F66D600B1895D /* smoke.cpp in Sources */,
952A1550103F66D600B1895D /* water_splash.cpp in Sources */,
952A1554103F68D000B1895D /* profile_world.cpp in Sources */,
9524739610497C75000C197E /* dynamic_ribbon_widget.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@@ -399,10 +399,10 @@ namespace KartSelectionScreen
#pragma mark KartHoverListener
#endif
class KartHoverListener : public RibbonGridHoverListener
class KartHoverListener : public DynamicRibbonHoverListener
{
public:
void onSelectionChanged(RibbonGridWidget* theWidget, const std::string& selectionID, const int playerID)
void onSelectionChanged(DynamicRibbonWidget* theWidget, const std::string& selectionID, const int playerID)
{
ModelViewWidget* w3 = g_player_karts[playerID].modelView;
assert( w3 != NULL );
@@ -436,7 +436,7 @@ bool playerJoin(InputDevice* device, bool firstPlayer)
{
std::cout << "playerJoin() ==========\n";
RibbonGridWidget* w = getCurrentScreen()->getWidget<RibbonGridWidget>("karts");
DynamicRibbonWidget* w = getCurrentScreen()->getWidget<DynamicRibbonWidget>("karts");
if (w == NULL)
{
std::cerr << "playerJoin(): Called outside of kart selection screen.\n";
@@ -495,7 +495,7 @@ bool playerQuit(ActivePlayer* player)
{
int playerID = -1;
RibbonGridWidget* w = getCurrentScreen()->getWidget<RibbonGridWidget>("karts");
DynamicRibbonWidget* w = getCurrentScreen()->getWidget<DynamicRibbonWidget>("karts");
if (w == NULL )
{
std::cout << "playerQuit() called outside of kart selection screen.\n";
@@ -526,6 +526,7 @@ bool playerQuit(ActivePlayer* player)
assert( g_player_karts.size() == StateManager::get()->activePlayerCount() );
// unset selection of this player
// FIXME: will only work if the player that quits is the last of the list
if (GUIEngine::g_focus_for_player[playerID] != NULL)
{
GUIEngine::g_focus_for_player[playerID]->unsetFocusForPlayer(playerID);
@@ -582,7 +583,7 @@ void menuEventKarts(Widget* widget, const std::string& name)
StateManager::get()->resetActivePlayers();
input_manager->getDeviceList()->setAssignMode(DETECT_NEW);
RibbonGridWidget* w = getCurrentScreen()->getWidget<RibbonGridWidget>("karts");
DynamicRibbonWidget* w = getCurrentScreen()->getWidget<DynamicRibbonWidget>("karts");
assert( w != NULL );
if(karthoverListener == NULL)
@@ -669,7 +670,7 @@ void menuEventKarts(Widget* widget, const std::string& name)
std::string selection = tabs->getSelectionIDString(GUI_PLAYER_ID);
RibbonGridWidget* w = getCurrentScreen()->getWidget<RibbonGridWidget>("karts");
DynamicRibbonWidget* w = getCurrentScreen()->getWidget<DynamicRibbonWidget>("karts");
w->clearItems();
// TODO : preserve selection of karts for all players
@@ -707,7 +708,7 @@ void menuEventKarts(Widget* widget, const std::string& name)
}
else if (name == "karts")
{
RibbonGridWidget* w = getCurrentScreen()->getWidget<RibbonGridWidget>("karts");
DynamicRibbonWidget* w = getCurrentScreen()->getWidget<DynamicRibbonWidget>("karts");
assert( w != NULL );
ptr_vector< ActivePlayer, HOLD >& players = StateManager::get()->getActivePlayers();
@@ -739,7 +740,7 @@ void menuEventKarts(Widget* widget, const std::string& name)
void renumberKarts()
{
RibbonGridWidget* w = getCurrentScreen()->getWidget<RibbonGridWidget>("karts");
DynamicRibbonWidget* w = getCurrentScreen()->getWidget<DynamicRibbonWidget>("karts");
assert( w != NULL );
Widget* fullarea = getCurrentScreen()->getWidget("playerskarts");
const int splitWidth = fullarea->w / g_player_karts.size();

View File

@@ -71,7 +71,7 @@ namespace OptionsScreen
// ---- video modes
{
RibbonGridWidget* res = getCurrentScreen()->getWidget<RibbonGridWidget>("resolutions");
DynamicRibbonWidget* res = getCurrentScreen()->getWidget<DynamicRibbonWidget>("resolutions");
assert( res != NULL );
@@ -199,7 +199,7 @@ namespace OptionsScreen
UserConfigParams::m_prev_width = UserConfigParams::m_width;
UserConfigParams::m_prev_height = UserConfigParams::m_height;
RibbonGridWidget* w1 = getCurrentScreen()->getWidget<RibbonGridWidget>("resolutions");
DynamicRibbonWidget* w1 = getCurrentScreen()->getWidget<DynamicRibbonWidget>("resolutions");
assert(w1 != NULL);
const std::string& res = w1->getSelectionIDString(GUI_PLAYER_ID);
@@ -275,7 +275,7 @@ namespace OptionsScreen
// -----------------------------------------------------------------------------
void initInput(Widget* widget, const std::string& name)
{
RibbonGridWidget* devices = getCurrentScreen()->getWidget<RibbonGridWidget>("devices");
DynamicRibbonWidget* devices = getCurrentScreen()->getWidget<DynamicRibbonWidget>("devices");
assert( devices != NULL );
if(!getCurrentScreen()->m_inited)
@@ -354,7 +354,7 @@ namespace OptionsScreen
{
if(name == "devices")
{
RibbonGridWidget* devices = getCurrentScreen()->getWidget<RibbonGridWidget>("devices");
DynamicRibbonWidget* devices = getCurrentScreen()->getWidget<DynamicRibbonWidget>("devices");
assert(devices != NULL);
const std::string& selection = devices->getSelectionIDString(GUI_PLAYER_ID);
@@ -426,7 +426,7 @@ namespace OptionsScreen
return;
}
RibbonGridWidget* devices = getCurrentScreen()->getWidget<RibbonGridWidget>("devices");
DynamicRibbonWidget* devices = getCurrentScreen()->getWidget<DynamicRibbonWidget>("devices");
assert( devices != NULL );
std::cout << "\n% Entering sensing mode for " << devices->getSelectionIDString(GUI_PLAYER_ID).c_str() << std::endl;
@@ -454,7 +454,7 @@ namespace OptionsScreen
// -----------------------------------------------------------------------------
void gotSensedInput(Input* sensedInput)
{
RibbonGridWidget* devices = getCurrentScreen()->getWidget<RibbonGridWidget>("devices");
DynamicRibbonWidget* devices = getCurrentScreen()->getWidget<DynamicRibbonWidget>("devices");
assert( devices != NULL );
std::string deviceID = devices->getSelectionIDString(GUI_PLAYER_ID);

View File

@@ -173,7 +173,7 @@ void StateManager::menuEventRaceSetup(Widget* widget, const std::string& name)
SpinnerWidget* kartamount = getCurrentScreen()->getWidget<SpinnerWidget>("aikartamount");
kartamount->setValue( race_manager->getNumKarts() - race_manager->getNumPlayers() );
RibbonGridWidget* w2 = getCurrentScreen()->getWidget<RibbonGridWidget>("gamemode");
DynamicRibbonWidget* w2 = getCurrentScreen()->getWidget<DynamicRibbonWidget>("gamemode");
assert( w2 != NULL );
if(!getCurrentScreen()->m_inited)
@@ -219,7 +219,7 @@ void StateManager::menuEventRaceSetup(Widget* widget, const std::string& name)
}
else if(name == "gamemode")
{
RibbonGridWidget* w = dynamic_cast<RibbonGridWidget*>(widget);
DynamicRibbonWidget* w = dynamic_cast<DynamicRibbonWidget*>(widget);
const std::string selectedMode = w->getSelectionIDString(GUI_PLAYER_ID);
if (selectedMode == "normal")
@@ -304,7 +304,7 @@ void StateManager::menuEventTracks(Widget* widget, const std::string& name)
{
if(name == "init")
{
RibbonGridWidget* w = getCurrentScreen()->getWidget<RibbonGridWidget>("tracks");
DynamicRibbonWidget* w = getCurrentScreen()->getWidget<DynamicRibbonWidget>("tracks");
assert( w != NULL );
if(!getCurrentScreen()->m_inited)
@@ -345,7 +345,7 @@ void StateManager::menuEventTracks(Widget* widget, const std::string& name)
// -- track seelction screen
if(name == "tracks")
{
RibbonGridWidget* w2 = dynamic_cast<RibbonGridWidget*>(widget);
DynamicRibbonWidget* w2 = dynamic_cast<DynamicRibbonWidget*>(widget);
if(w2 != NULL)
{
std::cout << "Clicked on track " << w2->getSelectionIDString(GUI_PLAYER_ID).c_str() << std::endl;