2011-03-22 12:56:49 +00:00
|
|
|
Geometry pWidget::minimumGeometry() {
|
2011-03-23 08:04:37 +00:00
|
|
|
return { 0, 0, 0, 0 };
|
2011-03-22 12:56:49 +00:00
|
|
|
}
|
|
|
|
|
2011-02-24 09:27:21 +00:00
|
|
|
bool pWidget::enabled() {
|
|
|
|
return gtk_widget_get_sensitive(gtkWidget);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pWidget::setEnabled(bool enabled) {
|
2011-09-05 03:48:23 +00:00
|
|
|
if(widget.state.abstract) enabled = false;
|
|
|
|
if(sizable.state.layout && sizable.state.layout->enabled() == false) enabled = false;
|
2011-02-24 09:27:21 +00:00
|
|
|
gtk_widget_set_sensitive(gtkWidget, enabled);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pWidget::setFocused() {
|
|
|
|
gtk_widget_grab_focus(gtkWidget);
|
|
|
|
}
|
|
|
|
|
2011-09-05 03:48:23 +00:00
|
|
|
void pWidget::setFont(const string &font) {
|
|
|
|
pFont::setFont(gtkWidget, font);
|
2011-02-24 09:27:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void pWidget::setGeometry(const Geometry &geometry) {
|
2011-10-24 11:35:34 +00:00
|
|
|
if(sizable.window() && sizable.window()->visible()) gtk_fixed_move(GTK_FIXED(sizable.window()->p.formContainer), gtkWidget, geometry.x, geometry.y);
|
2011-02-24 09:27:21 +00:00
|
|
|
unsigned width = (signed)geometry.width <= 0 ? 1U : geometry.width;
|
|
|
|
unsigned height = (signed)geometry.height <= 0 ? 1U : geometry.height;
|
|
|
|
gtk_widget_set_size_request(gtkWidget, width, height);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pWidget::setVisible(bool visible) {
|
|
|
|
if(widget.state.abstract) visible = false;
|
2011-09-05 03:48:23 +00:00
|
|
|
if(sizable.state.layout && sizable.state.layout->visible() == false) visible = false;
|
2011-02-24 09:27:21 +00:00
|
|
|
gtk_widget_set_visible(gtkWidget, visible);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pWidget::constructor() {
|
|
|
|
if(widget.state.abstract) gtkWidget = gtk_label_new("");
|
|
|
|
}
|
2011-09-05 03:48:23 +00:00
|
|
|
|
|
|
|
void pWidget::destructor() {
|
|
|
|
if(widget.state.abstract) gtk_widget_destroy(gtkWidget);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pWidget::orphan() {
|
|
|
|
destructor();
|
|
|
|
constructor();
|
|
|
|
}
|