wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src help.cpp widgets/menu.cpp widgets/m...


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src help.cpp widgets/menu.cpp widgets/m...
Date: Thu, 02 Dec 2004 17:27:51 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    04/12/02 22:21:45

Modified files:
        src            : help.cpp 
        src/widgets    : menu.cpp menu.hpp 

Log message:
        Remove hard-coded special characters.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/help.cpp.diff?tr1=1.58&tr2=1.59&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/menu.cpp.diff?tr1=1.75&tr2=1.76&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/menu.hpp.diff?tr1=1.29&tr2=1.30&r1=text&r2=text

Patches:
Index: wesnoth/src/help.cpp
diff -u wesnoth/src/help.cpp:1.58 wesnoth/src/help.cpp:1.59
--- wesnoth/src/help.cpp:1.58   Thu Dec  2 21:57:27 2004
+++ wesnoth/src/help.cpp        Thu Dec  2 22:21:45 2004
@@ -1494,14 +1494,14 @@
        std::string pad_string;
        // Indentation is represented as three spaces per level.
        pad_string.resize(level * 3, ' ');
-       to_show << pad_string << char(gui::menu::IMG_TEXT_SEPARATOR) << "&" ;
+       to_show << pad_string << IMG_TEXT_SEPARATOR << IMAGE_PREFIX;
        if (expanded(sec)) {
                to_show << open_section_img;
        }
        else {
                to_show << closed_section_img;
        }
-       to_show << char(gui::menu::IMG_TEXT_SEPARATOR) << sec.title;
+       to_show << IMG_TEXT_SEPARATOR << sec.title;
        return to_show.str();
 }
 
@@ -1509,8 +1509,8 @@
        std::string pad_string;
        pad_string.resize(level * 3, ' ');
        std::stringstream to_show;
-       to_show << pad_string << char(gui::menu::IMG_TEXT_SEPARATOR) << "&" << 
topic_img
-               << char(gui::menu::IMG_TEXT_SEPARATOR) << topic.title;
+       to_show << pad_string << IMG_TEXT_SEPARATOR << IMAGE_PREFIX << topic_img
+               << IMG_TEXT_SEPARATOR << topic.title;
        return to_show.str();
 }
 
Index: wesnoth/src/widgets/menu.cpp
diff -u wesnoth/src/widgets/menu.cpp:1.75 wesnoth/src/widgets/menu.cpp:1.76
--- wesnoth/src/widgets/menu.cpp:1.75   Thu Dec  2 21:57:28 2004
+++ wesnoth/src/widgets/menu.cpp        Thu Dec  2 22:21:45 2004
@@ -329,7 +329,7 @@
 namespace {
        SDL_Rect item_size(const std::string& item) {
                SDL_Rect res = {0,0,0,0};
-               std::vector<std::string> img_text_items = config::split(item, 
menu::IMG_TEXT_SEPARATOR);
+               std::vector<std::string> img_text_items = config::split(item, 
IMG_TEXT_SEPARATOR);
                for (std::vector<std::string>::const_iterator it = 
img_text_items.begin();
                         it != img_text_items.end(); it++) {
                        if (res.w > 0 || res.h > 0) {
Index: wesnoth/src/widgets/menu.hpp
diff -u wesnoth/src/widgets/menu.hpp:1.29 wesnoth/src/widgets/menu.hpp:1.30
--- wesnoth/src/widgets/menu.hpp:1.29   Thu Dec  2 22:02:51 2004
+++ wesnoth/src/widgets/menu.hpp        Thu Dec  2 22:21:45 2004
@@ -12,7 +12,8 @@
 
 #include "SDL.h"
 
-char const HELP_STRING_SEPARATOR = '|', DEFAULT_ITEM = '*', COLUMN_SEPARATOR = 
',', IMAGE_PREFIX = '&';
+char const HELP_STRING_SEPARATOR = '|', DEFAULT_ITEM = '*', COLUMN_SEPARATOR = 
',',
+           IMAGE_PREFIX = '&', IMG_TEXT_SEPARATOR = 1;
 
 namespace gui {
 
@@ -52,8 +53,6 @@
 
        void scroll(int pos);
 
-       enum { IMG_TEXT_SEPARATOR = 1 }; // Re-evaluate if this should be 
something else to be settable from WML.
-
 protected:
        void handle_event(const SDL_Event& event);
        void set_inner_location(const SDL_Rect& rect);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]