80 |
Glib::RefPtr<Pango::Layout> layout = Pango::Layout::create(context); |
Glib::RefPtr<Pango::Layout> layout = Pango::Layout::create(context); |
81 |
|
|
82 |
window->clear(); |
window->clear(); |
83 |
|
|
84 |
|
// draw labels on the left (reflecting the dimension type) |
85 |
int y = 0; |
int y = 0; |
86 |
double maxwidth = 0; |
double maxwidth = 0; |
87 |
for (int i = 0 ; i < region->Dimensions ; i++) { |
for (int i = 0 ; i < region->Dimensions ; i++) { |
|
|
|
88 |
int nbZones = region->pDimensionDefinitions[i].zones; |
int nbZones = region->pDimensionDefinitions[i].zones; |
89 |
if (nbZones) { |
if (nbZones) { |
90 |
char* dstr; |
char* dstr; |
142 |
} |
} |
143 |
y += h; |
y += h; |
144 |
} |
} |
145 |
|
|
146 |
|
// draw dimensions' zones areas |
147 |
y = 0; |
y = 0; |
148 |
int bitpos = 0; |
int bitpos = 0; |
149 |
label_width = int(maxwidth + 10); |
label_width = int(maxwidth + 10); |
150 |
for (int i = 0 ; i < region->Dimensions ; i++) { |
for (int i = 0 ; i < region->Dimensions ; i++) { |
151 |
int nbZones = region->pDimensionDefinitions[i].zones; |
int nbZones = region->pDimensionDefinitions[i].zones; |
152 |
if (nbZones) { |
if (nbZones) { |
153 |
|
// draw focus rectangle around dimension's label and zones |
154 |
if (has_focus() && focus_line == i) { |
if (has_focus() && focus_line == i) { |
155 |
Gdk::Rectangle farea(0, y, 150, 20); |
Gdk::Rectangle farea(0, y, 150, 20); |
156 |
get_style()->paint_focus(window, get_state(), farea, *this, "", |
get_style()->paint_focus(window, get_state(), farea, *this, "", |
158 |
} |
} |
159 |
|
|
160 |
Glib::RefPtr<const Gdk::GC> black = get_style()->get_black_gc(); |
Glib::RefPtr<const Gdk::GC> black = get_style()->get_black_gc(); |
161 |
|
// draw top and bottom lines of dimension's zones |
162 |
window->draw_line(black, label_width, y, w - 1, y); |
window->draw_line(black, label_width, y, w - 1, y); |
163 |
window->draw_line(black, w - 1, y + h - 1, label_width, y + h - 1); |
window->draw_line(black, w - 1, y + h - 1, label_width, y + h - 1); |
164 |
|
// erase whole dimension's zones area |
165 |
window->draw_rectangle(get_style()->get_white_gc(), true, |
window->draw_rectangle(get_style()->get_white_gc(), true, |
166 |
label_width + 1, y + 1, (w - label_width - 2), h - 2); |
label_width + 1, y + 1, (w - label_width - 2), h - 2); |
167 |
|
|
176 |
(region->pDimensionDefinitions[i].dimension == gig::dimension_velocity && |
(region->pDimensionDefinitions[i].dimension == gig::dimension_velocity && |
177 |
region->pDimensionRegions[c]->VelocityUpperLimit)); |
region->pDimensionRegions[c]->VelocityUpperLimit)); |
178 |
|
|
179 |
|
// draw dimension's zone borders |
180 |
if (customsplits) { |
if (customsplits) { |
181 |
window->draw_line(black, label_width, y + 1, label_width, y + h - 2); |
window->draw_line(black, label_width, y + 1, label_width, y + h - 2); |
182 |
for (int j = 0 ; j < nbZones ; j++) { |
for (int j = 0 ; j < nbZones ; j++) { |
194 |
} |
} |
195 |
} |
} |
196 |
|
|
197 |
|
// draw fill for currently selected zone |
198 |
if (dimregno >= 0) { |
if (dimregno >= 0) { |
199 |
gc->set_foreground(red); |
gc->set_foreground(red); |
200 |
int dr = (dimregno >> bitpos) & ((1 << region->pDimensionDefinitions[i].bits) - 1); |
int dr = (dimregno >> bitpos) & ((1 << region->pDimensionDefinitions[i].bits) - 1); |