[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src/widgets file_chooser.cpp file_choos...
From: |
Guillaume Melquiond |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src/widgets file_chooser.cpp file_choos... |
Date: |
Thu, 18 Nov 2004 15:20:25 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Guillaume Melquiond <address@hidden> 04/11/18 20:14:45
Modified files:
src/widgets : file_chooser.cpp file_chooser.hpp
Log message:
Don't modify widgets item during the drawing phase.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/file_chooser.cpp.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/file_chooser.hpp.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
Patches:
Index: wesnoth/src/widgets/file_chooser.cpp
diff -u wesnoth/src/widgets/file_chooser.cpp:1.15
wesnoth/src/widgets/file_chooser.cpp:1.16
--- wesnoth/src/widgets/file_chooser.cpp:1.15 Thu Nov 18 19:56:28 2004
+++ wesnoth/src/widgets/file_chooser.cpp Thu Nov 18 20:14:45 2004
@@ -91,8 +91,6 @@
}
void file_chooser::draw_contents() {
- display_current_files();
- display_chosen_file();
font::draw_text(&disp(), current_path_rect_, font::SIZE_NORMAL,
font::NORMAL_COLOUR,
current_dir_, current_path_rect_.x,
current_path_rect_.y,
disp().video().getSurface());
@@ -138,7 +136,7 @@
else {
update_file_lists();
chosen_file_ = current_dir_;
- set_dirty(true);
+ display_chosen_file();
}
}
}
@@ -195,7 +193,7 @@
choice_made_ = true;
}
}
- set_dirty(true);
+ display_chosen_file();
}
std::string file_chooser::get_current_file() const {
@@ -218,16 +216,6 @@
return get_current_file();
}
-void file_chooser::set_dirty(bool dirty) {
- widget::set_dirty(dirty);
- if (dirty) {
- // These will set themselves to false when they are done
- // drawing.
- filename_textbox_.set_dirty(true);
- delete_button_.set_dirty(true);
- }
-}
-
void file_chooser::update_location(SDL_Rect const &rect) {
const int current_path_y = rect.y;
current_path_rect_.y = current_path_y;
@@ -313,7 +301,8 @@
files_in_current_dir_.clear();
dirs_in_current_dir_.clear();
get_files_in_dir(current_dir_, &files_in_current_dir_,
- &dirs_in_current_dir_,
FILE_NAME_ONLY);
+ &dirs_in_current_dir_, FILE_NAME_ONLY);
+ display_current_files();
}
void file_chooser::handle_event(const SDL_Event& event) {
Index: wesnoth/src/widgets/file_chooser.hpp
diff -u wesnoth/src/widgets/file_chooser.hpp:1.8
wesnoth/src/widgets/file_chooser.hpp:1.9
--- wesnoth/src/widgets/file_chooser.hpp:1.8 Thu Nov 18 19:56:28 2004
+++ wesnoth/src/widgets/file_chooser.hpp Thu Nov 18 20:14:45 2004
@@ -28,10 +28,6 @@
/// the one the file is in.
file_chooser(display &disp, std::string start_file="");
- void draw_contents();
-
- void set_dirty(bool dirty=true);
-
/// Return true if the user is done making her choice.
bool choice_made() const;
@@ -41,6 +37,7 @@
virtual void update_location(SDL_Rect const &rect);
virtual void handle_event(const SDL_Event& event);
virtual void process_event();
+ virtual void draw_contents();
private:
/// If file_or_dir is a file, return the directory the file is in,