Move all log macros for the widget library to log.hpp.
This commit is contained in:
parent
36fe11aa88
commit
f9a15e6f0e
41 changed files with 89 additions and 677 deletions
|
@ -22,11 +22,6 @@
|
|||
#include "log.hpp"
|
||||
#include "wml_exception.hpp"
|
||||
|
||||
#define DBG_GUI LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_GUI LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_GUI LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_GUI LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -20,12 +20,6 @@
|
|||
#include "gui/widgets/window.hpp"
|
||||
#include "log.hpp"
|
||||
|
||||
|
||||
#define DBG_GUI LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_GUI LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_GUI LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_GUI LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
tdialog::~tdialog()
|
||||
|
|
|
@ -26,10 +26,7 @@
|
|||
#include "log.hpp"
|
||||
#include "mapgen.hpp"
|
||||
#include "wml_exception.hpp"
|
||||
#define DBG_GUI LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_GUI LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_GUI LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_GUI LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define ERR_ED LOG_STREAM_INDENT(err, editor)
|
||||
|
||||
namespace gui2 {
|
||||
|
|
|
@ -29,11 +29,6 @@
|
|||
#include "video.hpp"
|
||||
#include "wml_exception.hpp"
|
||||
|
||||
#define DBG_GUI LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_GUI LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_GUI LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_GUI LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
teditor_new_map::teditor_new_map() :
|
||||
|
|
|
@ -32,11 +32,6 @@
|
|||
#include "video.hpp"
|
||||
#include "wml_exception.hpp"
|
||||
|
||||
#define DBG_GUI LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_GUI LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_GUI LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_GUI LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
teditor_resize_map::teditor_resize_map() :
|
||||
|
|
|
@ -30,10 +30,7 @@
|
|||
#include "image.hpp"
|
||||
#include "log.hpp"
|
||||
#include "wml_exception.hpp"
|
||||
#define DBG_GUI LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_GUI LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_GUI LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_GUI LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define ERR_ED LOG_STREAM_INDENT(err, editor)
|
||||
|
||||
namespace gui2 {
|
||||
|
|
|
@ -25,11 +25,6 @@
|
|||
#include "video.hpp"
|
||||
#include "wml_exception.hpp"
|
||||
|
||||
#define DBG_GUI LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_GUI LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_GUI LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_GUI LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -23,11 +23,6 @@
|
|||
#include "gui/widgets/scroll_label.hpp"
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_GUI LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_GUI LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_GUI LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_GUI LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
twindow tmessage::build_window(CVideo& video)
|
||||
|
|
|
@ -30,11 +30,6 @@
|
|||
#include "video.hpp"
|
||||
#include "wml_exception.hpp"
|
||||
|
||||
#define DBG_GUI LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_GUI LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_GUI LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_GUI LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
namespace {
|
||||
|
|
|
@ -34,11 +34,6 @@
|
|||
#include "video.hpp"
|
||||
#include "wml_exception.hpp"
|
||||
|
||||
#define DBG_GUI LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_GUI LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_GUI LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_GUI LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
tmp_create_game::tmp_create_game(const config& cfg) :
|
||||
|
|
|
@ -27,11 +27,6 @@
|
|||
#include "video.hpp"
|
||||
#include "wml_exception.hpp"
|
||||
|
||||
#define DBG_GUI LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_GUI LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_GUI LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_GUI LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -26,11 +26,6 @@
|
|||
#include "log.hpp"
|
||||
#include "wml_exception.hpp"
|
||||
|
||||
#define DBG_GUI LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_GUI LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_GUI LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_GUI LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define ERR_CONFIG LOG_STREAM(err, config)
|
||||
|
||||
namespace gui2 {
|
||||
|
|
|
@ -17,26 +17,6 @@
|
|||
#include "gui/widgets/window.hpp"
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
void tbutton::mouse_enter(tevent_handler&)
|
||||
|
|
|
@ -33,26 +33,6 @@
|
|||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
namespace {
|
||||
|
|
|
@ -16,27 +16,6 @@
|
|||
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
tpoint tcontainer_::get_minimum_size() const
|
||||
|
@ -102,7 +81,7 @@ tpoint tcontainer_::get_best_size(const tpoint& maximum_size) const
|
|||
size.y += border_size.y;
|
||||
}
|
||||
|
||||
DBG_G << "Container : maximum size "
|
||||
DBG_GUI << "Container : maximum size "
|
||||
<< maximum_size << " returning " << size << ".\n";
|
||||
|
||||
return size;
|
||||
|
|
|
@ -18,26 +18,6 @@
|
|||
#include "gui/widgets/window.hpp"
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
tcontrol::tcontrol(const unsigned canvas_count) :
|
||||
|
|
|
@ -30,11 +30,6 @@
|
|||
#include "tstring.hpp"
|
||||
#include "variable.hpp"
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
namespace gui2{
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,27 +20,6 @@
|
|||
#include <cassert>
|
||||
#include <numeric>
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
tgrid::tgrid(const unsigned rows, const unsigned cols) :
|
||||
|
@ -92,7 +71,7 @@ void tgrid::set_child(twidget* widget, const unsigned row,
|
|||
// clear old child if any
|
||||
if(cell.widget()) {
|
||||
// free a child when overwriting it
|
||||
WRN_G << "Grid: child '" << cell.id()
|
||||
WRN_GUI << "Grid: child '" << cell.id()
|
||||
<< "' at cell '" << row << ',' << col << "' will be replaced.\n";
|
||||
delete cell.widget();
|
||||
}
|
||||
|
@ -234,7 +213,7 @@ tpoint tgrid::get_best_size(const tpoint& maximum_size) const
|
|||
|
||||
// If we honoured the size or can't resize return the result.
|
||||
if(size.y <= maximum_size.y || !has_vertical_scrollbar()) {
|
||||
DBG_G << "Grid : maximum size "
|
||||
DBG_GUI << "Grid : maximum size "
|
||||
<< maximum_size << " returning " << size << ".\n";
|
||||
return size;
|
||||
}
|
||||
|
@ -253,7 +232,7 @@ tpoint tgrid::get_best_size(const tpoint& maximum_size) const
|
|||
const unsigned height = get_best_row_height(y, wanted_height);
|
||||
|
||||
if(height < best_row_height_[y]) {
|
||||
DBG_G << "Grid : reduced " << best_row_height_[y] - height
|
||||
DBG_GUI << "Grid : reduced " << best_row_height_[y] - height
|
||||
<< " pixels for row " << y << ".\n";
|
||||
|
||||
reduced += best_row_height_[y] - height;
|
||||
|
@ -269,17 +248,17 @@ tpoint tgrid::get_best_size(const tpoint& maximum_size) const
|
|||
|
||||
size.y -= reduced;
|
||||
if(reduced >= too_high) {
|
||||
DBG_G << "Grid : maximum size " << maximum_size
|
||||
DBG_GUI << "Grid : maximum size " << maximum_size
|
||||
<< " need to reduce " << too_high
|
||||
<< " reduced " << reduced
|
||||
<< " resizing succeeded returning " << size.y << ".\n";
|
||||
} else if(reduced == 0) {
|
||||
DBG_G << "Grid : maximum size " << maximum_size
|
||||
DBG_GUI << "Grid : maximum size " << maximum_size
|
||||
<< " need to reduce " << too_high
|
||||
<< " reduced " << reduced
|
||||
<< " resizing completely failed returning " << size.y << ".\n";
|
||||
} else {
|
||||
DBG_G << "Grid : maximum size " << maximum_size
|
||||
DBG_GUI << "Grid : maximum size " << maximum_size
|
||||
<< " need to reduce " << too_high
|
||||
<< " reduced " << reduced
|
||||
<< " resizing partly failed returning " << size.y << ".\n";
|
||||
|
@ -449,7 +428,7 @@ void tgrid::set_size(const SDL_Rect& rect)
|
|||
assert(col_width_.size() == cols_);
|
||||
assert(row_grow_factor_.size() == rows_);
|
||||
assert(col_grow_factor_.size() == cols_);
|
||||
DBG_G << "Grid: best size " << best_size << " available size " << size << ".\n";
|
||||
DBG_GUI << "Grid: best size " << best_size << " available size " << size << ".\n";
|
||||
|
||||
/***** BEST_SIZE *****/
|
||||
|
||||
|
@ -472,7 +451,7 @@ void tgrid::set_size(const SDL_Rect& rect)
|
|||
const unsigned w = size.x - best_size.x;
|
||||
unsigned w_size =
|
||||
std::accumulate(col_grow_factor_.begin(), col_grow_factor_.end(), 0);
|
||||
DBG_G << "Grid: extra width " << w << " will be divided amount "
|
||||
DBG_GUI << "Grid: extra width " << w << " will be divided amount "
|
||||
<< w_size << " units in " << cols_ << " columns.\n";
|
||||
|
||||
if(w_size == 0) {
|
||||
|
@ -487,7 +466,7 @@ void tgrid::set_size(const SDL_Rect& rect)
|
|||
const unsigned w_normal = w / w_size;
|
||||
for(unsigned i = 0; i < cols_; ++i) {
|
||||
col_width_[i] += w_normal * col_grow_factor_[i];
|
||||
DBG_G << "Grid: column " << i << " with grow factor "
|
||||
DBG_GUI << "Grid: column " << i << " with grow factor "
|
||||
<< col_grow_factor_[i] << " set width to " << col_width_[i] << ".\n";
|
||||
}
|
||||
|
||||
|
@ -497,7 +476,7 @@ void tgrid::set_size(const SDL_Rect& rect)
|
|||
const unsigned h = size.y - best_size.y;
|
||||
unsigned h_size =
|
||||
std::accumulate(row_grow_factor_.begin(), row_grow_factor_.end(), 0);
|
||||
DBG_G << "Grid: extra height " << h << " will be divided amount "
|
||||
DBG_GUI << "Grid: extra height " << h << " will be divided amount "
|
||||
<< h_size << " units in " << rows_ << " rows.\n";
|
||||
|
||||
if(h_size == 0) {
|
||||
|
@ -512,7 +491,7 @@ void tgrid::set_size(const SDL_Rect& rect)
|
|||
const unsigned h_normal = h / h_size;
|
||||
for(unsigned i = 0; i < rows_; ++i) {
|
||||
row_height_[i] += h_normal * row_grow_factor_[i];
|
||||
DBG_G << "Grid: row " << i << " with grow factor "
|
||||
DBG_GUI << "Grid: row " << i << " with grow factor "
|
||||
<< row_grow_factor_[i] << " set height to " << row_height_[i] << ".\n";
|
||||
}
|
||||
}
|
||||
|
@ -572,7 +551,7 @@ void tgrid::set_rows_cols(const unsigned rows, const unsigned cols)
|
|||
}
|
||||
|
||||
if(!children_.empty()) {
|
||||
WRN_G << "Grid: resizing a non-empty grid may give unexpected problems.\n";
|
||||
WRN_GUI << "Grid: resizing a non-empty grid may give unexpected problems.\n";
|
||||
}
|
||||
|
||||
rows_ = rows;
|
||||
|
@ -617,14 +596,14 @@ tpoint tgrid::tchild::get_best_size(const tpoint& maximum) const
|
|||
log_scope2(gui, "Grid child: Get best size");
|
||||
|
||||
if(!widget_) {
|
||||
DBG_G << "Grid child : maximum size "
|
||||
DBG_GUI << "Grid child : maximum size "
|
||||
<< maximum << " returning " << border_space() << ".\n";
|
||||
return border_space();
|
||||
}
|
||||
|
||||
best_size_ = widget_->get_best_size(maximum - border_space()) + border_space();
|
||||
|
||||
DBG_G << "Grid child : maximum size "
|
||||
DBG_GUI << "Grid child : maximum size "
|
||||
<< maximum << " returning " << best_size_ << ".\n";
|
||||
return best_size_;
|
||||
}
|
||||
|
@ -693,7 +672,7 @@ void tgrid::layout(const tpoint& origin)
|
|||
for(unsigned col = 0; col < cols_; ++col) {
|
||||
|
||||
const tpoint size(col_width_[col], row_height_[row]);
|
||||
DBG_G << "Grid: set widget at " << row << ',' << col
|
||||
DBG_GUI << "Grid: set widget at " << row << ',' << col
|
||||
<< " at origin " << orig << " with size " << size << ".\n";
|
||||
|
||||
if(child(row, col).widget()) {
|
||||
|
@ -732,7 +711,7 @@ void tgrid::tchild::set_size(tpoint orig, tpoint size)
|
|||
// No need to check > min size since this is what we got.
|
||||
const tpoint best_size = widget()->get_best_size();
|
||||
if(size <= best_size) {
|
||||
DBG_G << "Grid cell: in best size range setting widget to "
|
||||
DBG_GUI << "Grid cell: in best size range setting widget to "
|
||||
<< orig << " x " << size << ".\n";
|
||||
|
||||
widget()->set_size(create_rect(orig, size));
|
||||
|
@ -745,7 +724,7 @@ void tgrid::tchild::set_size(tpoint orig, tpoint size)
|
|||
|
||||
if(maximum_size == tpoint(0,0) || size <= maximum_size) {
|
||||
|
||||
DBG_G << "Grid cell: in maximum size range setting widget to "
|
||||
DBG_GUI << "Grid cell: in maximum size range setting widget to "
|
||||
<< orig << " x " << size << ".\n";
|
||||
|
||||
widget()->set_size(create_rect(orig, size));
|
||||
|
@ -767,26 +746,26 @@ void tgrid::tchild::set_size(tpoint orig, tpoint size)
|
|||
} else {
|
||||
widget_size.y = size.y;
|
||||
}
|
||||
DBG_G << "Grid cell: vertical growing from "
|
||||
DBG_GUI << "Grid cell: vertical growing from "
|
||||
<< best_size.y << " to " << widget_size.y << ".\n";
|
||||
|
||||
} else if(v_flag == VERTICAL_ALIGN_TOP) {
|
||||
// Do nothing.
|
||||
|
||||
DBG_G << "Grid cell: vertically aligned at the top.\n";
|
||||
DBG_GUI << "Grid cell: vertically aligned at the top.\n";
|
||||
|
||||
} else if(v_flag == VERTICAL_ALIGN_CENTER) {
|
||||
|
||||
widget_orig.y += (size.y - widget_size.y) / 2;
|
||||
DBG_G << "Grid cell: vertically centred.\n";
|
||||
DBG_GUI << "Grid cell: vertically centred.\n";
|
||||
|
||||
} else if(v_flag == VERTICAL_ALIGN_BOTTOM) {
|
||||
|
||||
widget_orig.y += (size.y - widget_size.y);
|
||||
DBG_G << "Grid cell: vertically aligned at the bottom.\n";
|
||||
DBG_GUI << "Grid cell: vertically aligned at the bottom.\n";
|
||||
|
||||
} else {
|
||||
ERR_G << "Grid cell: Invalid vertical alignment '"
|
||||
ERR_GUI << "Grid cell: Invalid vertical alignment '"
|
||||
<< v_flag << "' specified.\n";
|
||||
assert(false);
|
||||
}
|
||||
|
@ -799,30 +778,30 @@ void tgrid::tchild::set_size(tpoint orig, tpoint size)
|
|||
} else {
|
||||
widget_size.x = size.x;
|
||||
}
|
||||
DBG_G << "Grid cell: horizontal growing from "
|
||||
DBG_GUI << "Grid cell: horizontal growing from "
|
||||
<< best_size.x << " to " << widget_size.x << ".\n";
|
||||
|
||||
} else if(h_flag == HORIZONTAL_ALIGN_LEFT) {
|
||||
// Do nothing.
|
||||
DBG_G << "Grid cell: horizontally aligned at the left.\n";
|
||||
DBG_GUI << "Grid cell: horizontally aligned at the left.\n";
|
||||
|
||||
} else if(h_flag == HORIZONTAL_ALIGN_CENTER) {
|
||||
|
||||
widget_orig.x += (size.x - widget_size.x) / 2;
|
||||
DBG_G << "Grid cell: horizontally centred.\n";
|
||||
DBG_GUI << "Grid cell: horizontally centred.\n";
|
||||
|
||||
} else if(h_flag == HORIZONTAL_ALIGN_RIGHT) {
|
||||
|
||||
widget_orig.x += (size.x - widget_size.x);
|
||||
DBG_G << "Grid cell: horizontally aligned at the right.\n";
|
||||
DBG_GUI << "Grid cell: horizontally aligned at the right.\n";
|
||||
|
||||
} else {
|
||||
ERR_G << "Grid cell: No horizontal alignment '"
|
||||
ERR_GUI << "Grid cell: No horizontal alignment '"
|
||||
<< h_flag << "' specified.\n";
|
||||
assert(false);
|
||||
}
|
||||
|
||||
DBG_G << "Grid cell: resize widget to "
|
||||
DBG_GUI << "Grid cell: resize widget to "
|
||||
<< widget_orig << " x " << widget_size << ".\n";
|
||||
|
||||
|
||||
|
@ -837,7 +816,7 @@ tpoint tgrid::get_size(const std::string& id, std::vector<unsigned>& width,
|
|||
{
|
||||
if(height.empty() || width.empty() || maximum_size != tpoint(0, 0)) {
|
||||
|
||||
DBG_G << "Grid: calculate " << id << " size.\n";
|
||||
DBG_GUI << "Grid: calculate " << id << " size.\n";
|
||||
|
||||
height.resize(rows_, 0);
|
||||
width.resize(cols_, 0);
|
||||
|
@ -863,16 +842,16 @@ tpoint tgrid::get_size(const std::string& id, std::vector<unsigned>& width,
|
|||
}
|
||||
}
|
||||
} else {
|
||||
DBG_G << "Grid: used cached " << id << " size.\n";
|
||||
DBG_GUI << "Grid: used cached " << id << " size.\n";
|
||||
}
|
||||
|
||||
for(unsigned row = 0; row < rows_; ++row) {
|
||||
DBG_G << "Grid: the " << id << " height for row " << row
|
||||
DBG_GUI << "Grid: the " << id << " height for row " << row
|
||||
<< " will be " << height[row] << ".\n";
|
||||
}
|
||||
|
||||
for(unsigned col = 0; col < cols_; ++col) {
|
||||
DBG_G << "Grid: the " << id << " width for col " << col
|
||||
DBG_GUI << "Grid: the " << id << " width for col " << col
|
||||
<< " will be " << width[col] << ".\n";
|
||||
}
|
||||
|
||||
|
@ -896,7 +875,7 @@ unsigned tgrid::get_best_row_height(const unsigned row, const unsigned maximum_h
|
|||
}
|
||||
}
|
||||
|
||||
DBG_G << "Grid : maximum row height " << maximum_height << " returning "
|
||||
DBG_GUI << "Grid : maximum row height " << maximum_height << " returning "
|
||||
<< required_height << ".\n";
|
||||
|
||||
return required_height;
|
||||
|
|
|
@ -23,26 +23,6 @@
|
|||
|
||||
#include "SDL_ttf.h"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
namespace {
|
||||
|
@ -98,7 +78,7 @@ unsigned decode_font_style(const std::string& style)
|
|||
return TTF_STYLE_NORMAL;
|
||||
}
|
||||
|
||||
ERR_G << "Unknown style '" << style << "' using 'normal' instead.\n";
|
||||
ERR_GUI << "Unknown style '" << style << "' using 'normal' instead.\n";
|
||||
|
||||
return TTF_STYLE_NORMAL;
|
||||
}
|
||||
|
|
|
@ -17,27 +17,6 @@
|
|||
#include "../../image.hpp"
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
tpoint timage::get_best_size() const
|
||||
|
|
|
@ -16,27 +16,6 @@
|
|||
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
void tlabel::set_state(const tstate state)
|
||||
|
|
|
@ -24,26 +24,6 @@
|
|||
#include "gui/widgets/window.hpp"
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
static void callback_select_list_item(twidget* caller)
|
||||
|
@ -461,7 +441,7 @@ tpoint tlistbox::get_content_best_size(const tpoint& maximum_size) const
|
|||
best_size.y = max.y;
|
||||
}
|
||||
|
||||
DBG_G << "Grid : maximum size "
|
||||
DBG_GUI << "Grid : maximum size "
|
||||
<< maximum_size << " returning " << best_size << ".\n";
|
||||
|
||||
return best_size;
|
||||
|
@ -515,7 +495,7 @@ void tlistbox::set_content_size(const SDL_Rect& rect)
|
|||
const unsigned rows = rect.h / row_height;
|
||||
find_scrollbar()->set_visible_items(rows);
|
||||
} else {
|
||||
WRN_G << "Listbox row 0 has no height, making all rows visible.\n";
|
||||
WRN_GUI << "Listbox row 0 has no height, making all rows visible.\n";
|
||||
find_scrollbar()->set_visible_items(rows_.size());
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -19,26 +19,6 @@
|
|||
#include "gui/widgets/toggle_panel.hpp"
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
static void callback_select_item(twidget* caller)
|
||||
|
|
|
@ -18,27 +18,6 @@
|
|||
#include "log.hpp"
|
||||
#include "../../minimap.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
|
||||
#define ERR_C LOG_STREAM_INDENT(err, config)
|
||||
|
||||
namespace gui2 {
|
||||
|
|
|
@ -16,26 +16,6 @@
|
|||
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
SDL_Rect tpanel::get_client_rect() const
|
||||
|
|
|
@ -20,26 +20,6 @@
|
|||
#include "gui/widgets/spacer.hpp"
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
tscroll_label::tscroll_label()
|
||||
|
|
|
@ -20,27 +20,6 @@
|
|||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
void tscrollbar_::scroll(const tscroll scroll)
|
||||
|
|
|
@ -32,26 +32,6 @@
|
|||
|
||||
#include <cassert>
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
bool new_widgets = false;
|
||||
|
@ -112,7 +92,7 @@ const std::string& get_id(const twindow_type window_type)
|
|||
|
||||
void load_settings()
|
||||
{
|
||||
LOG_G << "Setting: init gui.\n";
|
||||
LOG_GUI << "Setting: init gui.\n";
|
||||
|
||||
// Init.
|
||||
fill_window_types();
|
||||
|
@ -1172,7 +1152,7 @@ tresolution_definition_ptr get_control(
|
|||
control = control_definition->second.find(definition);
|
||||
|
||||
if(control == control_definition->second.end()) {
|
||||
LOG_G << "Control: type '" << control_type << "' definition '"
|
||||
LOG_GUI << "Control: type '" << control_type << "' definition '"
|
||||
<< definition << "' not found, falling back to 'default'.\n";
|
||||
control = control_definition->second.find("default");
|
||||
assert(control != control_definition->second.end());
|
||||
|
|
|
@ -20,28 +20,6 @@
|
|||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
static int distance(const int a, const int b)
|
||||
|
|
|
@ -16,26 +16,6 @@
|
|||
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
|
||||
|
|
|
@ -19,26 +19,6 @@
|
|||
#include "log.hpp"
|
||||
#include "serialization/string_utils.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
void ttext_::mouse_move(tevent_handler&)
|
||||
|
|
|
@ -23,27 +23,6 @@
|
|||
|
||||
#include <numeric>
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
ttext_history ttext_history::get_history(const std::string& id, const bool enabled)
|
||||
|
|
|
@ -20,26 +20,6 @@
|
|||
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
|
||||
|
|
|
@ -18,26 +18,6 @@
|
|||
#include "gui/widgets/window.hpp"
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
void ttoggle_panel::set_child_members(const std::map<std::string /* widget id */, std::map<
|
||||
|
|
|
@ -16,26 +16,6 @@
|
|||
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
} // namespace gui2
|
||||
|
|
|
@ -18,28 +18,6 @@
|
|||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
unsigned tvertical_scrollbar::minimum_positioner_length() const
|
||||
|
|
|
@ -21,27 +21,6 @@
|
|||
#include "gui/widgets/window.hpp"
|
||||
#include "log.hpp"
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
void callback_scrollbar_button(twidget* caller)
|
||||
|
|
|
@ -22,26 +22,6 @@
|
|||
|
||||
#include <cassert>
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
twindow* twidget::get_window()
|
||||
|
|
|
@ -29,27 +29,6 @@
|
|||
|
||||
#include <cassert>
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
|
||||
namespace gui2{
|
||||
|
||||
namespace {
|
||||
|
@ -386,7 +365,7 @@ void twindow::layout()
|
|||
log_scope2(gui, "Window: Recalculate size");
|
||||
|
||||
tpoint size = get_best_size();
|
||||
DBG_G << "Window best size : " << size << " screen size "
|
||||
DBG_GUI << "Window best size : " << size << " screen size "
|
||||
<< settings::screen_width << ',' << settings::screen_height << ".\n";
|
||||
|
||||
// If too big try it gracefully.
|
||||
|
@ -395,7 +374,7 @@ void twindow::layout()
|
|||
|
||||
size = get_best_size(
|
||||
tpoint(settings::screen_width, settings::screen_height));
|
||||
DBG_G << "Window best size : After resize request : " << size << ".\n";
|
||||
DBG_GUI << "Window best size : After resize request : " << size << ".\n";
|
||||
}
|
||||
// If still to big, just resize.
|
||||
size.x = size.x < static_cast<int>(settings::screen_width)
|
||||
|
@ -404,7 +383,7 @@ void twindow::layout()
|
|||
size.y = size.y < static_cast<int>(settings::screen_height)
|
||||
? size.y : static_cast<int>(settings::screen_height);
|
||||
|
||||
DBG_G << "Window final size " << size << ".\n";
|
||||
DBG_GUI << "Window final size " << size << ".\n";
|
||||
|
||||
tpoint position(0, 0);
|
||||
switch(horizontal_placement_) {
|
||||
|
@ -449,7 +428,7 @@ void twindow::layout()
|
|||
|
||||
void twindow::do_show_tooltip(const tpoint& location, const t_string& tooltip)
|
||||
{
|
||||
DBG_G << "Showing tooltip message: '" << tooltip << "'.\n";
|
||||
DBG_GUI << "Showing tooltip message: '" << tooltip << "'.\n";
|
||||
|
||||
assert(!tooltip.empty());
|
||||
|
||||
|
@ -488,7 +467,7 @@ void twindow::do_show_tooltip(const tpoint& location, const t_string& tooltip)
|
|||
void twindow::do_show_help_popup(const tpoint& location, const t_string& help_popup)
|
||||
{
|
||||
// Note copy past of twindow::do_show_tooltip except that the help may be empty.
|
||||
DBG_G << "Showing help message: '" << help_popup << "'.\n";
|
||||
DBG_GUI << "Showing help message: '" << help_popup << "'.\n";
|
||||
|
||||
if(help_popup.empty()) {
|
||||
return;
|
||||
|
|
|
@ -36,26 +36,6 @@
|
|||
|
||||
#include <cassert>
|
||||
|
||||
#define DBG_G LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_G LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_G LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_G LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
namespace {
|
||||
|
@ -619,7 +599,7 @@ twidget* tbuilder_button::build() const
|
|||
button->set_retval(twindow::get_retval_by_id(id));
|
||||
}
|
||||
|
||||
DBG_G << "Window builder: placed button '" << id << "' with defintion '"
|
||||
DBG_GUI << "Window builder: placed button '" << id << "' with defintion '"
|
||||
<< definition << "'.\n";
|
||||
|
||||
return button;
|
||||
|
@ -631,7 +611,7 @@ twidget* tbuilder_image::build() const
|
|||
|
||||
init_control(widget);
|
||||
|
||||
DBG_G << "Window builder: placed image '" << id << "' with defintion '"
|
||||
DBG_GUI << "Window builder: placed image '" << id << "' with defintion '"
|
||||
<< definition << "'.\n";
|
||||
|
||||
return widget;
|
||||
|
@ -651,7 +631,7 @@ twidget* tbuilder_label::build() const
|
|||
|
||||
init_control(tmp_label);
|
||||
|
||||
DBG_G << "Window builder: placed label '" << id << "' with defintion '"
|
||||
DBG_GUI << "Window builder: placed label '" << id << "' with defintion '"
|
||||
<< definition << "'.\n";
|
||||
|
||||
return tmp_label;
|
||||
|
@ -751,7 +731,7 @@ twidget* tbuilder_listbox::build() const
|
|||
listbox->set_assume_fixed_row_size(assume_fixed_row_size);
|
||||
listbox->set_scrollbar_mode(scrollbar_mode);
|
||||
|
||||
DBG_G << "Window builder: placed listbox '" << id << "' with defintion '"
|
||||
DBG_GUI << "Window builder: placed listbox '" << id << "' with defintion '"
|
||||
<< definition << "'.\n";
|
||||
|
||||
boost::intrusive_ptr<const tlistbox_definition::tresolution> conf =
|
||||
|
@ -885,7 +865,7 @@ twidget* tbuilder_menubar::build() const
|
|||
init_control(menubar);
|
||||
|
||||
|
||||
DBG_G << "Window builder: placed menubar '" << id << "' with defintion '"
|
||||
DBG_GUI << "Window builder: placed menubar '" << id << "' with defintion '"
|
||||
<< definition << "'.\n";
|
||||
|
||||
if(direction_ == tmenubar::HORIZONTAL) {
|
||||
|
@ -918,7 +898,7 @@ twidget* tbuilder_minimap::build() const
|
|||
|
||||
init_control(minimap);
|
||||
|
||||
DBG_G << "Window builder: placed minimap '" << id << "' with defintion '"
|
||||
DBG_GUI << "Window builder: placed minimap '" << id << "' with defintion '"
|
||||
<< definition << "'.\n";
|
||||
|
||||
return minimap;
|
||||
|
@ -955,7 +935,7 @@ twidget* tbuilder_panel::build() const
|
|||
|
||||
init_control(panel);
|
||||
|
||||
DBG_G << "Window builder: placed panel '" << id << "' with defintion '"
|
||||
DBG_GUI << "Window builder: placed panel '" << id << "' with defintion '"
|
||||
<< definition << "'.\n";
|
||||
|
||||
|
||||
|
@ -1003,7 +983,7 @@ twidget* tbuilder_scroll_label::build() const
|
|||
|
||||
widget->finalize_setup();
|
||||
|
||||
DBG_G << "Window builder: placed scroll label '" << id << "' with defintion '"
|
||||
DBG_GUI << "Window builder: placed scroll label '" << id << "' with defintion '"
|
||||
<< definition << "'.\n";
|
||||
|
||||
return widget;
|
||||
|
@ -1091,7 +1071,7 @@ twidget* tbuilder_slider::build() const
|
|||
slider->set_maximum_value_label(maximum_value_label_);
|
||||
}
|
||||
|
||||
DBG_G << "Window builder: placed slider '" << id << "' with defintion '"
|
||||
DBG_GUI << "Window builder: placed slider '" << id << "' with defintion '"
|
||||
<< definition << "'.\n";
|
||||
|
||||
return slider;
|
||||
|
@ -1107,7 +1087,7 @@ twidget* tbuilder_spacer::build() const
|
|||
spacer->set_best_size(tpoint(width_, height_));
|
||||
}
|
||||
|
||||
DBG_G << "Window builder: placed spacer '" << id << "' with defintion '"
|
||||
DBG_GUI << "Window builder: placed spacer '" << id << "' with defintion '"
|
||||
<< definition << "'.\n";
|
||||
|
||||
return spacer;
|
||||
|
@ -1122,7 +1102,7 @@ twidget* tbuilder_toggle_button::build() const
|
|||
toggle_button->set_icon_name(icon_name_);
|
||||
toggle_button->set_retval(retval_);
|
||||
|
||||
DBG_G << "Window builder: placed toggle button '" << id << "' with defintion '"
|
||||
DBG_GUI << "Window builder: placed toggle button '" << id << "' with defintion '"
|
||||
<< definition << "'.\n";
|
||||
|
||||
return toggle_button;
|
||||
|
@ -1164,7 +1144,7 @@ twidget* tbuilder_toggle_panel::build() const
|
|||
|
||||
toggle_panel->set_retval(retval_);
|
||||
|
||||
DBG_G << "Window builder: placed toggle panel '" << id << "' with defintion '"
|
||||
DBG_GUI << "Window builder: placed toggle panel '" << id << "' with defintion '"
|
||||
<< definition << "'.\n";
|
||||
|
||||
|
||||
|
@ -1204,7 +1184,7 @@ twidget* tbuilder_text_box::build() const
|
|||
text_box->set_history(history_);
|
||||
}
|
||||
|
||||
DBG_G << "Window builder: placed text box '" << id << "' with defintion '"
|
||||
DBG_GUI << "Window builder: placed text box '" << id << "' with defintion '"
|
||||
<< definition << "'.\n";
|
||||
|
||||
return text_box;
|
||||
|
@ -1216,7 +1196,7 @@ twidget* tbuilder_vertical_scrollbar::build() const
|
|||
|
||||
init_control(vertical_scrollbar);
|
||||
|
||||
DBG_G << "Window builder: placed text box '" << id << "' with defintion '"
|
||||
DBG_GUI << "Window builder: placed text box '" << id << "' with defintion '"
|
||||
<< definition << "'.\n";
|
||||
|
||||
return vertical_scrollbar;
|
||||
|
@ -1231,7 +1211,7 @@ twidget* tbuilder_grid::build() const
|
|||
|
||||
log_scope2(gui, "Window builder: building grid");
|
||||
|
||||
DBG_G << "Window builder: grid has " << rows << " rows and "
|
||||
DBG_GUI << "Window builder: grid has " << rows << " rows and "
|
||||
<< cols << " columns.\n";
|
||||
|
||||
for(unsigned x = 0; x < rows; ++x) {
|
||||
|
@ -1242,7 +1222,7 @@ twidget* tbuilder_grid::build() const
|
|||
grid->set_col_grow_factor(y, col_grow_factor[y]);
|
||||
}
|
||||
|
||||
DBG_G << "Window builder: adding child at " << x << ',' << y << ".\n";
|
||||
DBG_GUI << "Window builder: adding child at " << x << ',' << y << ".\n";
|
||||
|
||||
twidget* widget = widgets[x * cols + y]->build();
|
||||
grid->set_child(widget, x, y, flags[x * cols + y], border_size[x * cols + y]);
|
||||
|
|
27
src/log.hpp
27
src/log.hpp
|
@ -122,4 +122,31 @@ extern std::stringstream wml_error;
|
|||
// When using log_scope/log_scope2 it is nice to have all output indented.
|
||||
#define LOG_STREAM_INDENT(a,b) if (lg::a.dont_log(lg::b)) ; else lg::a(lg::b, true, true)
|
||||
|
||||
|
||||
// Define a list of standard loggers.
|
||||
#define DBG_GUI LOG_STREAM_INDENT(debug, gui)
|
||||
#define LOG_GUI LOG_STREAM_INDENT(info, gui)
|
||||
#define WRN_GUI LOG_STREAM_INDENT(warn, gui)
|
||||
#define ERR_GUI LOG_STREAM_INDENT(err, gui)
|
||||
|
||||
#define DBG_G_P LOG_STREAM_INDENT(debug, gui_parse)
|
||||
#define LOG_G_P LOG_STREAM_INDENT(info, gui_parse)
|
||||
#define WRN_G_P LOG_STREAM_INDENT(warn, gui_parse)
|
||||
#define ERR_G_P LOG_STREAM_INDENT(err, gui_parse)
|
||||
|
||||
#define DBG_G_L LOG_STREAM_INDENT(debug, gui_layout)
|
||||
#define LOG_G_L LOG_STREAM_INDENT(info, gui_layout)
|
||||
#define WRN_G_L LOG_STREAM_INDENT(warn, gui_layout)
|
||||
#define ERR_G_L LOG_STREAM_INDENT(err, gui_layout)
|
||||
|
||||
#define DBG_G_D LOG_STREAM_INDENT(debug, gui_draw)
|
||||
#define LOG_G_D LOG_STREAM_INDENT(info, gui_draw)
|
||||
#define WRN_G_D LOG_STREAM_INDENT(warn, gui_draw)
|
||||
#define ERR_G_D LOG_STREAM_INDENT(err, gui_draw)
|
||||
|
||||
#define DBG_G_E LOG_STREAM_INDENT(debug, gui_event)
|
||||
#define LOG_G_E LOG_STREAM_INDENT(info, gui_event)
|
||||
#define WRN_G_E LOG_STREAM_INDENT(warn, gui_event)
|
||||
#define ERR_G_E LOG_STREAM_INDENT(err, gui_event)
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue