CreditsMenu Class Reference

#include <credits_menu.h>

Inheritance diagram for CreditsMenu:

Inheritance graph
[legend]
Collaboration diagram for CreditsMenu:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CreditsMenu ()
 ~CreditsMenu ()

Private Member Functions

void PrepareAuthorsList (ListBox *lbox_authors)
void __sig_ok ()
void __sig_cancel ()
void Draw (const Point2i &mousePosition)
void OnClic (const Point2i &mousePosition, int button)

Detailed Description

Definition at line 30 of file credits_menu.h.


Constructor & Destructor Documentation

CreditsMenu::CreditsMenu (  ) 

Definition at line 77 of file credits_menu.cpp.

00077                           :
00078   Menu("menu/bg_network", vOk)
00079 {
00080   int title_height = AppWormux::GetInstance()->video.window.GetHeight() * 110 / 600;
00081   ListBox * lbox_authors = new ListBox( Rectanglei( 30, title_height,
00082                                                     AppWormux::GetInstance()->video.window.GetWidth()-60,
00083                                                     AppWormux::GetInstance()->video.window.GetHeight()-60-title_height),
00084                                         false);
00085 
00086   widgets.AddWidget(lbox_authors);
00087 
00088   PrepareAuthorsList(lbox_authors);
00089 }

Here is the call graph for this function:

CreditsMenu::~CreditsMenu (  ) 

Definition at line 91 of file credits_menu.cpp.

00092 {
00093 }


Member Function Documentation

void CreditsMenu::__sig_cancel (  )  [private, virtual]

Implements Menu.

Definition at line 99 of file credits_menu.cpp.

00100 {
00101   // Nothing to do
00102 }

void CreditsMenu::__sig_ok (  )  [private, virtual]

Implements Menu.

Definition at line 95 of file credits_menu.cpp.

00096 {
00097   // Nothing to do
00098 }

void CreditsMenu::Draw ( const Point2i mousePosition  )  [private, virtual]

Implements Menu.

Definition at line 153 of file credits_menu.cpp.

00154 {
00155 }

void CreditsMenu::OnClic ( const Point2i mousePosition,
int  button 
) [private, virtual]

Implements Menu.

Definition at line 157 of file credits_menu.cpp.

00158 {
00159   widgets.Clic(mousePosition, button);
00160 }

Here is the call graph for this function:

void CreditsMenu::PrepareAuthorsList ( ListBox lbox_authors  )  [private]

Definition at line 105 of file credits_menu.cpp.

00106 {
00107   std::string filename = Config::GetInstance()->GetDataDir() + PATH_SEPARATOR + "authors.xml";
00108   XmlReader doc;
00109   if(!doc.Load(filename))
00110   {
00111     // Error: do something ...
00112     return;
00113   }
00114 
00115   xmlpp::Node::NodeList sections = doc.GetRoot()->get_children("section");
00116   xmlpp::Node::NodeList::iterator
00117     section=sections.begin(),
00118     end_section=sections.end();
00119 
00120   for (; section != end_section; ++section)
00121   {
00122     xmlpp::Node::NodeList authors = (**section).get_children("author");
00123     xmlpp::Node::NodeList::iterator
00124       node=authors.begin(),
00125       end=authors.end();
00126     std::string title;
00127     xmlpp::Element *elem = dynamic_cast<xmlpp::Element*>(*section);
00128     if (!elem)
00129     {
00130         std::cerr << "cast error" << std::endl;
00131         continue;
00132     }
00133     if (!XmlReader::ReadStringAttr(elem, "title", title)) continue;
00134 
00135     std::cout << "=== " << title << " ===" << std::endl;
00136 
00137     lbox_authors->AddItem (false, "=== "+title+" ===", title);
00138 
00139     for (; node != end; ++node)
00140     {
00141         Author author;
00142         if (author.Feed(*node))
00143         {
00144           std::cout << author.PrettyString(false) << std::endl;
00145           lbox_authors->AddItem (false, author.PrettyString(false), author.name);
00146         }
00147     }
00148     std::cout << std::endl;
00149   }
00150 
00151 }

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Jan 1 13:43:58 2007 for Wormux by  doxygen 1.4.7