1 |
/* |
/* |
2 |
* Copyright (C) 2006-2011 Andreas Persson |
* Copyright (C) 2006-2014 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
30 |
#include "compat.h" |
#include "compat.h" |
31 |
|
|
32 |
// returns a human readable name of the given dimension type |
// returns a human readable name of the given dimension type |
33 |
static Glib::ustring __dimTypeAsString(gig::dimension_t d) { |
Glib::ustring dimTypeAsString(gig::dimension_t d) { |
34 |
char buf[32]; |
char buf[32]; |
35 |
switch (d) { |
switch (d) { |
36 |
case gig::dimension_none: |
case gig::dimension_none: |
218 |
); |
); |
219 |
|
|
220 |
show_all_children(); |
show_all_children(); |
221 |
|
|
222 |
|
resize(460,300); |
223 |
} |
} |
224 |
|
|
225 |
// update all GUI elements according to current gig::Region informations |
// update all GUI elements according to current gig::Region informations |
229 |
for (int i = 0; i < region->Dimensions; i++) { |
for (int i = 0; i < region->Dimensions; i++) { |
230 |
gig::dimension_def_t* dim = ®ion->pDimensionDefinitions[i]; |
gig::dimension_def_t* dim = ®ion->pDimensionDefinitions[i]; |
231 |
Gtk::TreeModel::Row row = *(refTableModel->append()); |
Gtk::TreeModel::Row row = *(refTableModel->append()); |
232 |
row[tableModel.m_dim_type] = __dimTypeAsString(dim->dimension); |
row[tableModel.m_dim_type] = dimTypeAsString(dim->dimension); |
233 |
row[tableModel.m_bits] = dim->bits; |
row[tableModel.m_bits] = dim->bits; |
234 |
row[tableModel.m_zones] = dim->zones; |
row[tableModel.m_zones] = dim->zones; |
235 |
row[tableModel.m_description] = __dimDescriptionAsString(dim->dimension); |
row[tableModel.m_description] = __dimDescriptionAsString(dim->dimension); |
258 |
Glib::RefPtr<Gtk::ListStore> refComboModel = Gtk::ListStore::create(comboModel); |
Glib::RefPtr<Gtk::ListStore> refComboModel = Gtk::ListStore::create(comboModel); |
259 |
for (int i = 0x01; i < 0xff; i++) { |
for (int i = 0x01; i < 0xff; i++) { |
260 |
Glib::ustring sType = |
Glib::ustring sType = |
261 |
__dimTypeAsString(static_cast<gig::dimension_t>(i)); |
dimTypeAsString(static_cast<gig::dimension_t>(i)); |
262 |
if (sType.find("Unknown") != 0) { |
if (sType.find("Unknown") != 0) { |
263 |
Gtk::TreeModel::Row row = *(refComboModel->append()); |
Gtk::TreeModel::Row row = *(refComboModel->append()); |
264 |
row[comboModel.m_type_id] = i; |
row[comboModel.m_type_id] = i; |
290 |
for (int i = 1; i <= 5; i++) { |
for (int i = 1; i <= 5; i++) { |
291 |
char buf[3]; |
char buf[3]; |
292 |
sprintf(buf, "%d", 1 << i); |
sprintf(buf, "%d", 1 << i); |
293 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 24) || GTKMM_MAJOR_VERSION < 2 |
294 |
comboZones.append_text(buf); |
comboZones.append_text(buf); |
295 |
#else |
#else |
296 |
comboZones.append(buf); |
comboZones.append(buf); |