EditorGuide.cpp

Go to the documentation of this file.
00001 
00005 /* Copyright © 2010 James Legg.
00006     This program is free software: you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation, either version 3 of the License, or
00009     (at your option) any later version.
00010 */
00011 
00012 #include "EditorGuide.h"
00013 
00014 #include <string>
00015 
00016 std::string _tips[] = {
00017     "Right click on empty space and select 'Insert vertex' to add a vertex.",
00018     "Use Best Fit on the View menu or tool bar to see the entire track. You can also zoom in and out and scroll manually.",
00019     "Drag a yellow cursor to move a vertex.",
00020     "Right click a yellow cursor to change a vertex's segment.\nThe available segments depend on theme.",
00021     "Right click a yellow cursor and press 'Delete vertex' to remove a vertex.",
00022     "You can undo your actions one at a time using Undo from the edit menu or tool bar.",
00023     "Use a green point to pick a vertex's forward direction.\nDragging it far away from the yellow cursor points it at the horizon.\nDragging it towards the yellow cursor points it above the horizon.",
00024     "Use a red point to pick a vertex's up direction.",
00025     "Drag a pink point to another to create an edge connecting two vertices.\nThe pink dots attach to specific points on the vertex's segment.\nThe order is important. Drag from where the cars enter the edge to where they leave it.\nRemember the green lines point forward.",
00026     "Right click a white line to change an edge's segment. Some segments are not suitable for use on edges.",
00027     "Right click a white line and press 'Make starting positions' to select the edge where the cars start the game. The end of the edge will become the start/finish line.\nIt is insensitive on the edge that already has the start positions.",
00028     "Drag the blue dots to change how the strong the curve is at each end of an edge.",
00029     "Right click a white line and press 'Delete edge' to remove an edge.",
00030     "Use Front and side view to change the height of vertices (drag yellow cursors up and down). It can also make setting the up direction easier (drag red dots).",
00031     "Right click a white line and press 'Add booster' to add a booster in the middle of an edge.",
00032     "You can move a booster along an edge by dragging its base.",
00033     "To delete a booster, right click the base and press 'Delete Attachment'.",
00034     "Once you have made a complete loop, use Test on the File menu or tool bar to race on your track.",
00035     };
00036 
00037 const int _RI_show_previous = 1;
00038 const int _RI_show_next = 2;
00039 
00040 EditorGuide::EditorGuide()
00041 {
00042     set_message_type(Gtk::MESSAGE_INFO);
00043     
00044     Gtk::Container* container = dynamic_cast<Gtk::Container*>(get_content_area());
00045     if (container)
00046     {
00047         container->add(m_label);
00048         m_label.set_line_wrap();
00049         m_label.show();
00050     }
00051     
00052     add_button("Previous tip", _RI_show_previous);
00053     add_button("Next tip", _RI_show_next);
00054     
00055     show_message(0);
00056 }
00057 
00058 void EditorGuide::show_message(unsigned int index)
00059 {
00060     m_message_index = index;
00061     set_response_sensitive(_RI_show_previous, m_message_index > 0);
00062     set_response_sensitive(_RI_show_next, m_message_index < sizeof(_tips) / sizeof(std::string) - 1);
00063     m_label.set_text(_tips[m_message_index]);
00064 }
00065 
00066 void EditorGuide::on_response (int response_id)
00067 {
00068     switch (response_id)
00069     {
00070         case _RI_show_previous:
00071             show_message(m_message_index - 1);
00072             break;
00073         case _RI_show_next:
00074             show_message(m_message_index + 1);
00075             break;
00076     }
00077 
00078 }

Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:13 2010 by Doxygen version 1.4.7 for Racer version svn335.