* Use varargs in Canvas::print.

* Added min/max size to display::Window. Added flags for windows that
should be on located at the left/bottom side of a Frame.

* Reversed print order in WindowLog*.

* Added display::TextElement and subclasses for flexible printing to a
char buffer with associated attributes. Added display::Attributes and
display::Canvas::print_attributes.

* Added display::WindowText for use with display::TextElement's.

* Added ui::ElementMenu for generic menus, and started work adding
this to ui::Download.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@751 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-08-06 18:20:56 +00:00
parent 62beb9d9ed
commit 0b45062eb3
66 changed files with 1350 additions and 256 deletions
+9 -8
View File
@@ -45,7 +45,7 @@
namespace display {
WindowLog::WindowLog(core::Log* l) :
Window(new Canvas, flag_width_dynamic, 0, 0),
Window(new Canvas, 0, 0, 0, extent_full, extent_static),
m_log(l) {
m_taskUpdate.set_slot(rak::mem_fn(this, &WindowLog::receive_update)),
@@ -68,13 +68,13 @@ void
WindowLog::redraw() {
m_canvas->erase();
int pos = 0;
int pos = m_canvas->height();
for (core::Log::iterator itr = m_log->begin(), end = find_older(); itr != end && pos < m_canvas->height(); ++itr) {
for (core::Log::iterator itr = m_log->begin(), last = find_older(); itr != last && pos > 0; ++itr, --pos) {
char buffer[16];
print_hhmmss_local(buffer, buffer + 16, static_cast<time_t>(itr->first.seconds()));
m_canvas->print(0, pos++, "(%s) %s", buffer, itr->second.c_str());
m_canvas->print(0, pos - 1, "(%s) %s", buffer, itr->second.c_str());
}
}
@@ -86,10 +86,11 @@ WindowLog::receive_update() {
return;
iterator itr = find_older();
extent_type h = std::min(std::distance(m_log->begin(), itr), (std::iterator_traits<iterator>::difference_type)10);
extent_type height = std::min(std::distance(m_log->begin(), itr), (std::iterator_traits<iterator>::difference_type)10);
if (h != m_minHeight) {
m_minHeight = h;
if (height != m_maxHeight) {
m_minHeight = height != 0 ? 1 : 0;
m_maxHeight = height;
m_slotAdjust();
} else {
@@ -98,7 +99,7 @@ WindowLog::receive_update() {
priority_queue_erase(&taskScheduler, &m_taskUpdate);
if (h != 0)
if (height != 0)
priority_queue_insert(&taskScheduler, &m_taskUpdate, (cachedTime + rak::timer::from_seconds(30)).round_seconds());
}