[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src dialogs.cpp dialogs.hpp
From: |
Guillaume Melquiond |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src dialogs.cpp dialogs.hpp |
Date: |
Tue, 02 Nov 2004 15:56:32 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Guillaume Melquiond <address@hidden> 04/11/02 20:50:56
Modified files:
src : dialogs.cpp dialogs.hpp
Log message:
Switched to draw_contents system. And fixed background refreshing of
campaign selection dialog.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/dialogs.cpp.diff?tr1=1.63&tr2=1.64&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/dialogs.hpp.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
Patches:
Index: wesnoth/src/dialogs.cpp
diff -u wesnoth/src/dialogs.cpp:1.63 wesnoth/src/dialogs.cpp:1.64
--- wesnoth/src/dialogs.cpp:1.63 Sun Oct 31 20:50:13 2004
+++ wesnoth/src/dialogs.cpp Tue Nov 2 20:50:55 2004
@@ -1,4 +1,4 @@
-/* $Id: dialogs.cpp,v 1.63 2004/10/31 20:50:13 silene Exp $ */
+/* $Id: dialogs.cpp,v 1.64 2004/11/02 20:50:55 silene Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -254,7 +254,7 @@
virtual void set_location(SDL_Rect const &rect);
using widget::set_location;
- void draw();
+ void draw_contents();
void set_selection(int index) {
index_ = index;
set_dirty();
@@ -278,20 +278,12 @@
register_rectangle(rect);
}
-void save_preview_pane::draw()
+void save_preview_pane::draw_contents()
{
- if(!dirty()) {
- return;
- }
-
- bg_restore();
-
if(index_ < 0 || index_ >= int(summaries_->size()) || info_->size() !=
summaries_->size()) {
return;
}
- set_dirty(false);
-
const config& summary = *(*summaries_)[index_];
surface const screen = disp().video().getSurface();
@@ -600,22 +592,14 @@
}
}
-void unit_preview_pane::draw()
+void unit_preview_pane::draw_contents()
{
- if(!dirty()) {
- return;
- }
-
- bg_restore();
-
if(index_ < 0 || index_ >= int(units_->size())) {
return;
}
const unit& u = (*units_)[index_];
- set_dirty(false);
-
const bool right_align = left_side();
surface const screen = disp().video().getSurface();
@@ -756,13 +740,19 @@
namespace {
- static const SDL_Rect campaign_preview_size = {-350,-400,350,400};
static const int campaign_preview_border = 10;
}
campaign_preview_pane::campaign_preview_pane(display&
disp,std::vector<std::pair<std::string,std::string> >* desc) :
gui::preview_pane(disp),descriptions_(desc),index_(0)
{
- set_location(campaign_preview_size);
+ set_width(350);
+ set_height(400);
+}
+
+void campaign_preview_pane::set_location(SDL_Rect const &rect)
+{
+ gui::preview_pane::set_location(rect);
+ register_rectangle(rect);
}
bool campaign_preview_pane::show_above() const { return false; }
@@ -777,20 +767,12 @@
}
}
-void campaign_preview_pane::draw()
+void campaign_preview_pane::draw_contents()
{
- if(!dirty()) {
- return;
- }
-
- bg_restore();
-
if(index_ < 0 || index_ >= descriptions_->size()) {
return;
}
- set_dirty(false);
-
const SDL_Rect area = {
location().x+campaign_preview_border,
location().y+campaign_preview_border*5,
Index: wesnoth/src/dialogs.hpp
diff -u wesnoth/src/dialogs.hpp:1.24 wesnoth/src/dialogs.hpp:1.25
--- wesnoth/src/dialogs.hpp:1.24 Wed Sep 22 00:05:33 2004
+++ wesnoth/src/dialogs.hpp Tue Nov 2 20:50:55 2004
@@ -1,4 +1,4 @@
-/* $Id: dialogs.hpp,v 1.24 2004/09/22 00:05:33 cedricd Exp $ */
+/* $Id: dialogs.hpp,v 1.25 2004/11/02 20:50:55 silene Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -74,7 +74,7 @@
void set_selection(int index);
private:
- void draw();
+ void draw_contents();
void process();
gui::button details_button_;
@@ -97,9 +97,11 @@
bool show_above() const;
bool left_side() const;
void set_selection(int index);
+ void set_location(SDL_Rect const &);
+ using gui::preview_pane::set_location;
private:
- void draw();
+ void draw_contents();
const std::vector<std::pair<std::string,std::string> >* descriptions_;
int index_;
- [Wesnoth-cvs-commits] wesnoth/src dialogs.cpp dialogs.hpp,
Guillaume Melquiond <=