summaryrefslogtreecommitdiffstats
path: root/SidebarView.cpp
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2007-12-04 22:35:01 +0100
committerneoraider <devnull@localhost>2007-12-04 22:35:01 +0100
commitd389dce3ef4f1342a2f91926a9dcd02b452c6045 (patch)
treec3a7a88afd02cb3cdc88a987e227badcc6095b0c /SidebarView.cpp
parentecf40f86dfa6aa623bf31494125f3702f9fa0298 (diff)
downloadzoomedit-d389dce3ef4f1342a2f91926a9dcd02b452c6045.tar
zoomedit-d389dce3ef4f1342a2f91926a9dcd02b452c6045.zip
zoomedit: Got SidebarToolbox working.
Diffstat (limited to 'SidebarView.cpp')
-rw-r--r--SidebarView.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/SidebarView.cpp b/SidebarView.cpp
index a0d4ae5..8e58967 100644
--- a/SidebarView.cpp
+++ b/SidebarView.cpp
@@ -8,10 +8,6 @@ void SidebarView::spinButtonHeightChanged(GtkSpinButton *spinbutton, SidebarView
view->editor->getActiveRoom()->setHeight(gtk_spin_button_get_value(spinbutton));
}
-void SidebarView::buttonClicked(GtkButton *button, SidebarView *sidebar) {
- sidebar->editor->addRoom();
-}
-
SidebarView::SidebarView(EditManager *editor) {
this->editor = editor;
@@ -25,12 +21,12 @@ SidebarView::SidebarView(EditManager *editor) {
gtk_box_pack_start(GTK_BOX(sidebar), gtk_hseparator_new(), FALSE, FALSE, 5);
- GtkWidget *labelName = gtk_label_new("Name:");
+ GtkWidget *labelName = gtk_label_new("Name: ");
gtk_misc_set_alignment(GTK_MISC(labelName), 0.0, 0.5);
gtk_box_pack_start(GTK_BOX(sidebar), labelName, FALSE, FALSE, 0);
entryName = gtk_entry_new();
- gtk_widget_set_usize(entryName, 1, -1);
+ gtk_widget_set_size_request(entryName, 0, -1);
//g_signal_connect(G_OBJECT(entryName), "focus-out-event", G_CALLBACK(sidebarNameFocusOutEvent), NULL);
//gtk_widget_add_events(entryName, GDK_FOCUS_CHANGE_MASK);
gtk_box_pack_start(GTK_BOX(sidebar), entryName, FALSE, FALSE, 0);
@@ -39,37 +35,34 @@ SidebarView::SidebarView(EditManager *editor) {
gtk_table_set_row_spacings(GTK_TABLE(tableRoomData), 5);
gtk_box_pack_start(GTK_BOX(sidebar), tableRoomData, FALSE, FALSE, 5);
- GtkWidget *labelAreaLabel = gtk_label_new("Room area:");
+ GtkWidget *labelAreaLabel = gtk_label_new("Room area: ");
gtk_misc_set_alignment(GTK_MISC(labelAreaLabel), 0.0, 0.5);
- gtk_table_attach_defaults(GTK_TABLE(tableRoomData), labelAreaLabel, 0, 1, 0, 1);
+ gtk_table_attach(GTK_TABLE(tableRoomData), labelAreaLabel, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
labelArea = gtk_label_new(NULL);
gtk_misc_set_alignment(GTK_MISC(labelArea), 1.0, 0.5);
gtk_table_attach_defaults(GTK_TABLE(tableRoomData), labelArea, 1, 2, 0, 1);
- GtkWidget *labelPerimeterLabel = gtk_label_new("Room perimeter:");
+ GtkWidget *labelPerimeterLabel = gtk_label_new("Room perimeter: ");
gtk_misc_set_alignment(GTK_MISC(labelPerimeterLabel), 0.0, 0.5);
- gtk_table_attach_defaults(GTK_TABLE(tableRoomData), labelPerimeterLabel, 0, 1, 1, 2);
+ gtk_table_attach(GTK_TABLE(tableRoomData), labelPerimeterLabel, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0);
labelPerimeter = gtk_label_new(NULL);
gtk_misc_set_alignment(GTK_MISC(labelPerimeter), 1.0, 0.5);
gtk_table_attach_defaults(GTK_TABLE(tableRoomData), labelPerimeter, 1, 2, 1, 2);
- GtkWidget *labelHeight = gtk_label_new("Height:");
+ GtkWidget *labelHeight = gtk_label_new("Height: ");
gtk_misc_set_alignment(GTK_MISC(labelHeight), 0.0, 0.5);
- gtk_table_attach_defaults(GTK_TABLE(tableRoomData), labelHeight, 0, 1, 2, 3);
+ gtk_table_attach(GTK_TABLE(tableRoomData), labelHeight, 0, 1, 2, 3, GTK_FILL, GTK_FILL, 0, 0);
spinButtonHeight = gtk_spin_button_new_with_range(0, 10000, 0.1f);
gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spinButtonHeight), 2);
gtk_entry_set_alignment(GTK_ENTRY(spinButtonHeight), 1.0);
gtk_table_attach(GTK_TABLE(tableRoomData), spinButtonHeight, 1, 2, 2, 3, (GtkAttachOptions)(GTK_EXPAND|GTK_SHRINK|GTK_FILL),
(GtkAttachOptions)(GTK_EXPAND|GTK_FILL), 0, 0);
+ gtk_widget_set_size_request(spinButtonHeight, 0, -1);
g_signal_connect(G_OBJECT(spinButtonHeight), "value-changed", G_CALLBACK(spinButtonHeightChanged), this);
- buttonAdd = gtk_button_new_with_label("Add room");
- g_signal_connect(G_OBJECT(buttonAdd), "clicked", G_CALLBACK(buttonClicked), this);
- gtk_box_pack_end(GTK_BOX(sidebar), buttonAdd, FALSE, FALSE, 0);
-
gtk_widget_show_all(sidebar);
}