GtkWidget *error_info_bar;
GtkWidget *error_label;
GtkWidget *vpane, *hpane;
+ GtkWidget *notebook;
+
int error_count;
+extern char zoomed_plot;
const char *divelist_font;
gtk_paned_set_position(GTK_PANED(hpane), 65535);
}
- /* Ooh. I don't know how to get the half-way size. So I'm just using random numbers */
static void view_three(GtkWidget *w, gpointer data)
{
- gtk_paned_set_position(GTK_PANED(hpane), 400);
- gtk_paned_set_position(GTK_PANED(vpane), 200);
+ GtkAllocation alloc;
+ GtkRequisition requisition;
+
+ gtk_widget_get_allocation(hpane, &alloc);
+ gtk_paned_set_position(GTK_PANED(hpane), alloc.width/2);
+ gtk_widget_get_allocation(vpane, &alloc);
+ gtk_widget_size_request(notebook, &requisition);
+ /* pick the requested size for the notebook plus 6 pixels for frame */
+ gtk_paned_set_position(GTK_PANED(vpane), requisition.height + 6);
}
+static void toggle_zoom(GtkWidget *w, gpointer data)
+{
+ zoomed_plot = (zoomed_plot)?0 : 1;
+ /*Update dive*/
+ repaint_dive();
+}
+
static GtkActionEntry menu_items[] = {
- { "FileMenuAction", GTK_STOCK_FILE, "File", NULL, NULL, NULL},
- { "LogMenuAction", GTK_STOCK_FILE, "Log", NULL, NULL, NULL},
- { "ViewMenuAction", GTK_STOCK_FILE, "View", NULL, NULL, NULL},
- { "FilterMenuAction", GTK_STOCK_FILE, "Filter", NULL, NULL, NULL},
- { "HelpMenuAction", GTK_STOCK_HELP, "Help", NULL, NULL, NULL},
+ { "FileMenuAction", NULL, "File", NULL, NULL, NULL},
+ { "LogMenuAction", NULL, "Log", NULL, NULL, NULL},
+ { "ViewMenuAction", NULL, "View", NULL, NULL, NULL},
+ { "FilterMenuAction", NULL, "Filter", NULL, NULL, NULL},
+ { "HelpMenuAction", NULL, "Help", NULL, NULL, NULL},
{ "OpenFile", GTK_STOCK_OPEN, NULL, CTRLCHAR "O", NULL, G_CALLBACK(file_open) },
{ "SaveFile", GTK_STOCK_SAVE, NULL, CTRLCHAR "S", NULL, G_CALLBACK(file_save) },
+ { "SaveAsFile", GTK_STOCK_SAVE_AS, NULL, SHIFTCHAR CTRLCHAR "S", NULL, G_CALLBACK(file_save_as) },
{ "Print", GTK_STOCK_PRINT, NULL, CTRLCHAR "P", NULL, G_CALLBACK(do_print) },
{ "Import", NULL, "Import", NULL, NULL, G_CALLBACK(import_dialog) },
- { "Preferences", NULL, "Preferences", PREFERENCE_ACCEL, NULL, G_CALLBACK(preferences_dialog) },
+ { "AddDive", GTK_STOCK_ADD, "Add Dive", NULL, NULL, G_CALLBACK(add_dive_cb) },
+ { "Preferences", GTK_STOCK_PREFERENCES, "Preferences", PREFERENCE_ACCEL, NULL, G_CALLBACK(preferences_dialog) },
{ "Renumber", NULL, "Renumber", NULL, NULL, G_CALLBACK(renumber_dialog) },
{ "SelectEvents", NULL, "SelectEvents", NULL, NULL, G_CALLBACK(selectevents_dialog) },
{ "Quit", GTK_STOCK_QUIT, NULL, CTRLCHAR "Q", NULL, G_CALLBACK(quit) },
</menu> \
<menu name=\"LogMenu\" action=\"LogMenuAction\"> \
<menuitem name=\"Import\" action=\"Import\" /> \
+ <menuitem name=\"Add Dive\" action=\"AddDive\" /> \
<separator name=\"Separator\"/> \
<menuitem name=\"Renumber\" action=\"Renumber\" /> \
+ <menuitem name=\"Toggle Zoom\" action=\"ToggleZoom\" /> \
<menu name=\"View\" action=\"ViewMenuAction\"> \
<menuitem name=\"List\" action=\"ViewList\" /> \
<menuitem name=\"Profile\" action=\"ViewProfile\" /> \