Beispiel #1
0
void GTKMusicBrowser::CreateToolbar(GtkWidget *vbox)
{
    toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL,
                                         GTK_TOOLBAR_BOTH);
    gtk_toolbar_set_button_relief(GTK_TOOLBAR(toolbar), GTK_RELIEF_NONE);
    gtk_toolbar_set_space_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_SPACE_LINE);

    gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "New Playlist",
                            "Start Editing a new Playlist",
                            "Toolbar/New", NewPixmap(new_pic),
                            GTK_SIGNAL_FUNC(new_plist_tool), this);

    gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Save Playlist",
                            "Save the Current Playlist to Disk",
                            "Toolbar/Save", NewPixmap(save_pic),
                            GTK_SIGNAL_FUNC(save_list_tool), this);

    gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));

    gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Import Items",
                            "Import a Playlist or Track into My Music",
                            "Toolbar/Import", NewPixmap(import_pic),
                            GTK_SIGNAL_FUNC(import_tool), this);

    toolRemove = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Remove Track",
                                         "Remove a Track from the Playlist",
                                         "Toolbar/Remove", NewPixmap(trash_pic),
                                         GTK_SIGNAL_FUNC(remove_tool), this);

    gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Edit",
                            "Edit a Track or Playlist",
                            "Toolbar/Edit", NewPixmap(edit_pic),
                            GTK_SIGNAL_FUNC(edit_tool), this);

    gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));

    addTrack = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Add Items",
                            "Add Music from My Music to the Playlist",
                            "Toolbar/AddItem", NewPixmap(add_track_pic),
                            GTK_SIGNAL_FUNC(add_track_tool), this);

    addFile = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Add File",
                            "Add a File to the Playlist",
                            "Toolbar/Add", NewPixmap(add_file),
                            GTK_SIGNAL_FUNC(add_tool), this);

    toolUp = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Move Up",
                            "Move The Currently Selected Track in the Playlist Up",
                            "Toolbar/Up", NewPixmap(up_pic),
                            GTK_SIGNAL_FUNC(move_up_tool), this);

    toolDown = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Move Down",
                            "Move the Currently Selected Track in the Playlist Down",
                            "Toolbar/Down", NewPixmap(down_pic),
                            GTK_SIGNAL_FUNC(move_down_tool), this);

    gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, TRUE, 0);
    SetToolbarType();
    gtk_widget_show(toolbar);
}
static void create_toolbar_menu()
{
	GtkWidget *iconw;
	GtkWidget *close_button;

	bdk_window.toolbar = gtk_toolbar_new ();
	gtk_toolbar_set_orientation (GTK_TOOLBAR (bdk_window.toolbar), GTK_ORIENTATION_HORIZONTAL);
	gtk_toolbar_set_style (GTK_TOOLBAR (bdk_window.toolbar), GTK_TOOLBAR_BOTH);

	/* our first item is <close> button */
	iconw = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_SMALL_TOOLBAR)  ; // ("gtk.xpm"); /* icon widget */
	close_button = 
	gtk_toolbar_append_item (GTK_TOOLBAR (bdk_window.toolbar), /* our toolbar */
							 "Open",               /* button label */
							 "Open a file",     /* this button's tooltip */
							 "Private",             /* tooltip private info */
							 iconw,                 /* icon widget */
							 GTK_SIGNAL_FUNC (open_event), /* a signal */
							 NULL);
	gtk_toolbar_append_space (GTK_TOOLBAR (bdk_window.toolbar)); /* space after item */
	/* our first item is <close> button */
	iconw = gtk_image_new_from_stock (GTK_STOCK_QUIT, GTK_ICON_SIZE_SMALL_TOOLBAR)  ; // ("gtk.xpm"); /* icon widget */
	close_button = 
	gtk_toolbar_append_item(	GTK_TOOLBAR (bdk_window.toolbar), /* our toolbar */
								 "Close",               /* button label */
								 "Closes this app",     /* this button's tooltip */
								 "Private",             /* tooltip private info */
								 iconw,                 /* icon widget */
								 GTK_SIGNAL_FUNC (gtk_main_quit), /* a signal */
								 NULL);
	gtk_box_pack_start (GTK_BOX (bdk_window.main_vbox), bdk_window.toolbar, FALSE, TRUE, 0);
}
Beispiel #3
0
void roadmap_main_add_tool_space (void) {

   if (RoadMapMainToolbar == NULL) {
      roadmap_log (ROADMAP_FATAL, "Invalid toolbar space: no toolbar yet");
   }

   gtk_toolbar_append_space (GTK_TOOLBAR(RoadMapMainToolbar));
}
Beispiel #4
0
void wxToolBar::SetMargins( int x, int y )
{
    wxCHECK_RET( GetToolsCount() == 0,
                 wxT("wxToolBar::SetMargins must be called before adding tools.") );

    if (x > 1)
        gtk_toolbar_append_space( m_toolbar );  // oh well

    m_xMargin = x;
    m_yMargin = y;
}
Beispiel #5
0
void
browser_create (void)
{
    GtkWidget *vbox;
    GdkPixmap *icon_pix;
    GdkBitmap *icon_mask;
    GtkAccelGroup *accel;
    GtkWidget *menu;
    GtkWidget *toolbar;
    GtkWidget *hpaned;
    GtkWidget *vpaned;
    GtkWidget *iconw;
    GtkWidget *hbox;
    GtkWidget *label;

    browser = g_new (Browser, 1);

    browser->current_path = g_string_new (conf.startup_dir);
    browser->last_path = g_string_new ("");
    browser->filelist = (FileList *) file_list_init ();

    browser->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title (GTK_WINDOW (browser->window), "PornView");
    gtk_widget_realize (browser->window);

    icon_pix =
	gdk_pixmap_create_from_xpm_d (G_WINDOW (browser->window), &icon_mask,
				      NULL, pornview_xpm);
    gdk_window_set_icon (G_WINDOW (browser->window), NULL, icon_pix,
			 icon_mask);

    gtk_signal_connect (GTK_OBJECT (browser->window), "delete_event",
			GTK_SIGNAL_FUNC (browser_destroy), NULL);

    gtk_window_set_default_size (GTK_WINDOW (browser->window),
				 conf.window_width, conf.window_height);

    vbox = gtk_vbox_new (FALSE, 0);
    gtk_widget_show (vbox);
    gtk_container_add (GTK_CONTAINER (browser->window), vbox);

    /*
     * main menu 
     */
    accel = gtk_accel_group_new ();
    browser->menu =
	gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<browser_menu>", accel);

#ifdef ENABLE_NLS
    gtk_item_factory_set_translate_func (browser->menu,
					 (GtkTranslateFunc) menu_translate,
					 NULL, NULL);
#endif

    gtk_item_factory_create_items (browser->menu, browser_menu_factory_count,
				   browser_menu_factory, NULL);
    menu = gtk_item_factory_get_widget (browser->menu, "<browser_menu>");

    gtk_box_pack_start (GTK_BOX (vbox), menu, FALSE, FALSE, 0);
    gtk_widget_show (menu);

#ifndef USE_GTK2
    gtk_accel_group_attach (accel, GTK_OBJECT (browser->window));
#endif

    /*
     * toolbar 
     */
#ifdef USE_GTK2
    toolbar = gtk_toolbar_new ();
#else
    toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
#endif

    gtk_box_pack_start (GTK_BOX (vbox), toolbar, FALSE, TRUE, 0);
    gtk_widget_show (toolbar);

    iconw = pixbuf_create_pixmap_from_xpm_data (exit_xpm);
    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), NULL, _("Exit"), NULL,
			     iconw, (GtkSignalFunc) browser_destroy, NULL);

#ifndef USE_GTK2
    gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
#endif

    gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));

    iconw = pixbuf_create_pixmap_from_xpm_data (options_xpm);
    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), NULL, _("Preference"),
			     NULL, iconw, (GtkSignalFunc) browser_prefs,
			     NULL);

    hpaned = gedo_hpaned_new ();
    gtk_container_add (GTK_CONTAINER (vbox), hpaned);
    gtk_widget_show (hpaned);

    vpaned = gedo_vpaned_new ();
    gtk_widget_show (vpaned);
    gedo_paned_add1 (GEDO_PANED (hpaned), vpaned);

    /*
     * dirtree 
     */
    dirview_create (conf.startup_dir, browser->window);

    gedo_paned_add1 (GEDO_PANED (vpaned), DIRVIEW_CONTAINER);

    commentview = comment_view_create ();

    browser->notebook = commentview->notebook;

    /*
     * videoplay 
     */
#ifdef ENABLE_MOVIE
    videoplay_create ();
    label = gtk_label_new (_(" Preview "));
    gtk_notebook_prepend_page (GTK_NOTEBOOK (browser->notebook),
			       VIDEOPLAY_CONTAINER, label);

    gtk_notebook_set_page (GTK_NOTEBOOK (browser->notebook), 0);

#endif

    /*
     * imageview
     */
    imageview_create ();
    label = gtk_label_new (_(" Preview "));
    gtk_notebook_prepend_page (GTK_NOTEBOOK (browser->notebook),
			       IMAGEVIEW_CONTAINER, label);

#ifndef ENABLE_MOVIE
    gtk_notebook_set_page (GTK_NOTEBOOK (browser->notebook), 0);
#endif

    gedo_paned_add2 (GEDO_PANED (hpaned), commentview->main_vbox);

    /*
     * thumbview 
     */
    thumbview_create (browser->window);
    gedo_paned_add2 (GEDO_PANED (vpaned), THUMBVIEW_CONTAINER);

    /*
     * statusbar 
     */
    hbox = gtk_hbox_new (FALSE, 0);
    gtk_widget_set_name (hbox, "StatusBarContainer");
    gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
    gtk_widget_show (hbox);

    browser->status_dir = gtk_statusbar_new ();
    gtk_widget_set_name (browser->status_dir, "StatusBar1");
    gtk_container_border_width (GTK_CONTAINER (browser->status_dir), 1);
    gtk_widget_set_usize (browser->status_dir, 80, 15);
    gtk_box_pack_start (GTK_BOX (hbox), browser->status_dir, FALSE, FALSE, 0);
    gtk_widget_show (browser->status_dir);

    browser->status_name = gtk_statusbar_new ();
    gtk_widget_set_name (browser->status_name, "StatusBar2");
    gtk_container_border_width (GTK_CONTAINER (browser->status_name), 1);
    gtk_widget_set_usize (browser->status_name, 150, -1);
    gtk_box_pack_start (GTK_BOX (hbox), browser->status_name, TRUE, TRUE, 0);
    gtk_widget_show (browser->status_name);

    browser->status_image = gtk_statusbar_new ();
    gtk_widget_set_name (browser->status_image, "StatusBar3");
    gtk_container_border_width (GTK_CONTAINER (browser->status_image), 1);
    gtk_widget_set_usize (browser->status_image, 150, -1);
    gtk_box_pack_start (GTK_BOX (hbox), browser->status_image, TRUE, TRUE, 0);
    gtk_widget_show (browser->status_image);

    browser->progress = gtk_progress_bar_new ();
    gtk_widget_set_name (browser->progress, "ProgressBar");
    gtk_box_pack_end (GTK_BOX (hbox), browser->progress, FALSE, FALSE, 0);
    gtk_widget_show (browser->progress);

    gtk_widget_show (browser->window);

#ifdef ENABLE_MOVIE
    gtk_widget_hide (gtk_notebook_get_nth_page
		     (GTK_NOTEBOOK (browser->notebook), 1));
    gtk_notebook_set_page (GTK_NOTEBOOK (browser->notebook), 0);
#endif

    dirview_scroll_center ();
    timer_id = gtk_timeout_add (100, cb_browser_select_dir, conf.startup_dir);
}
Beispiel #6
0
static GtkWidget *
thumbview_create_toolbar (ThumbView * tv)
{
    GtkWidget *toolbar;
    GtkWidget *iconw;

    g_return_val_if_fail (tv, NULL);

#ifdef USE_GTK2
    toolbar = gtk_toolbar_new ();
#else
    toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
    gtk_toolbar_set_button_relief (GTK_TOOLBAR (toolbar), GTK_RELIEF_NONE);
    gtk_toolbar_set_space_style (GTK_TOOLBAR (toolbar),
				 GTK_TOOLBAR_SPACE_LINE);
    gtk_toolbar_set_space_size (GTK_TOOLBAR (toolbar), 16);
#endif

    /*
     * refresh
     */
    iconw = pixbuf_create_pixmap_from_xpm_data (refresh_xpm);
    tv->toolbar_refresh_btn =
	gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), NULL,
				 _("Refresh"), NULL, iconw,
				 GTK_SIGNAL_FUNC (cb_thumbview_refresh), tv);
    /*
     * previous 
     */
    iconw = pixbuf_create_pixmap_from_xpm_data (left_xpm);
    tv->toolbar_previous_btn =
	gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), NULL,
				 _("Previous Image/Movie"), NULL, iconw,
				 GTK_SIGNAL_FUNC (cb_thumbview_previous), tv);
    /*
     * next 
     */
    iconw = pixbuf_create_pixmap_from_xpm_data (right_xpm);
    tv->toolbar_next_btn = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
						    NULL,
						    _("Next Image/Movie"),
						    NULL,
						    iconw,
						    GTK_SIGNAL_FUNC
						    (cb_thumbview_next), tv);

    /*
     * first 
     */
    iconw = pixbuf_create_pixmap_from_xpm_data (first_xpm);
    tv->toolbar_first_btn =
	gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), NULL,
				 _("First Image/Movie"), NULL, iconw,
				 GTK_SIGNAL_FUNC (cb_thumbview_first), tv);

    /*
     * last
     */
    iconw = pixbuf_create_pixmap_from_xpm_data (last_xpm);
    tv->toolbar_last_btn = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
						    NULL,
						    _("Last Image/Movie"),
						    NULL,
						    iconw,
						    GTK_SIGNAL_FUNC
						    (cb_thumbview_last), tv);


    gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));

    /*
     * info
     */
    iconw = pixbuf_create_pixmap_from_xpm_data (info_xpm);
    tv->toolbar_info_btn = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
						    NULL,
						    _("Properties"),
						    NULL,
						    iconw,
						    GTK_SIGNAL_FUNC
						    (cb_thumbview_info), tv);
    gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));


    /*
     * view thumbs
     */
    iconw = pixbuf_create_pixmap_from_xpm_data (view_thumbs_xpm);
    tv->toolbar_thumbs_btn =
	gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), NULL,
				 _("View Thumbs"), NULL, iconw,
				 GTK_SIGNAL_FUNC
				 (cb_thumbview_toggle_mode), tv);

    /*
     * view list
     */
    iconw = pixbuf_create_pixmap_from_xpm_data (view_list_xpm);
    tv->toolbar_list_btn = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
						    NULL, _("View List"),
						    NULL, iconw,
						    GTK_SIGNAL_FUNC
						    (cb_thumbview_toggle_mode),
						    tv);

    gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));

    /*
     * view fullscreen
     */
    iconw = pixbuf_create_pixmap_from_xpm_data (fullscreen_xpm);
    tv->toolbar_view_btn = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
						    NULL,
						    _("Fullscreen"),
						    NULL, iconw,
						    GTK_SIGNAL_FUNC
						    (cb_thumbview_fullscreen_view),
						    tv);

    /*
     * slideshow
     */
    iconw = pixbuf_create_pixmap_from_xpm_data (slideshow_xpm);
    tv->toolbar_slideshow_btn =
	gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), NULL,
				 _("Slideshow"), NULL, iconw,
				 GTK_SIGNAL_FUNC
				 (cb_thumbview_slideshow_view), tv);

    gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));

    /*
     * no zoom
     */
    iconw = pixbuf_create_pixmap_from_xpm_data (no_zoom_xpm);
    tv->toolbar_no_zoom_btn =
	gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), NULL,
				 _("No Zoom"), NULL, iconw,
				 GTK_SIGNAL_FUNC (cb_thumbview_no_zoom), tv);

    /*
     * auto zoom
     */
    iconw = pixbuf_create_pixmap_from_xpm_data (zoom_fit_xpm);
    tv->toolbar_zoom_auto_btn =
	gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), NULL,
				 _("Auto Zoom"), NULL, iconw,
				 GTK_SIGNAL_FUNC (cb_thumbview_zoom_auto),
				 tv);

    /*
     * zoom in
     */
    iconw = pixbuf_create_pixmap_from_xpm_data (zoom_in_xpm);
    tv->toolbar_zoom_in_btn =
	gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), NULL,
				 _("Zoom In"), NULL, iconw,
				 GTK_SIGNAL_FUNC (cb_thumbview_zoom_in), tv);

    /*
     * zoom out
     */
    iconw = pixbuf_create_pixmap_from_xpm_data (zoom_out_xpm);
    tv->toolbar_zoom_out_btn =
	gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), NULL,
				 _("Zoom Out"), NULL, iconw,
				 GTK_SIGNAL_FUNC (cb_thumbview_zoom_out), tv);

    gtk_widget_show_all (toolbar);
    gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);

    return toolbar;
}
Beispiel #7
0
/*! \todo Finish function documentation!!!
 *  \brief
 *  \par Function Description
 *
 */
void x_window_create_main(GSCHEM_TOPLEVEL *w_current)
{
  TOPLEVEL *toplevel = w_current->toplevel;

  GtkWidget *label=NULL;
  GtkWidget *main_box=NULL;
  GtkWidget *menubar=NULL;
  GtkWidget *drawbox=NULL;
  GtkWidget *bottom_box=NULL;
  GtkWidget *toolbar=NULL;
  GtkWidget *handlebox=NULL;

  /* used to signify that the window isn't mapped yet */
  w_current->window = NULL; 

  w_current->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

  gtk_widget_set_name (w_current->main_window, "gschem");
  gtk_window_set_policy (GTK_WINDOW (w_current->main_window), TRUE, TRUE, TRUE);

  /* We want the widgets to flow around the drawing area, so we don't
   * set a size of the main window.  The drawing area's size is fixed,
   * see below
   */

   /* 
    * normally we let the window manager handle locating and sizing
    * the window.  However, for some batch processing of schematics
    * (generating a pdf of all schematics for example) we want to
    * override this.  Hence "auto_place_mode".
    */
   if( auto_place_mode )
   	gtk_widget_set_uposition (w_current->main_window, 10, 10);

  /* this should work fine */
  g_signal_connect (G_OBJECT (w_current->main_window), "delete_event",
                    G_CALLBACK (i_callback_close_wm),
                    w_current);

  /* Containers first */
  main_box = gtk_vbox_new(FALSE, 1);
  gtk_container_border_width(GTK_CONTAINER(main_box), 0);
  gtk_container_add(GTK_CONTAINER(w_current->main_window), main_box);

  menubar = get_main_menu (w_current);
  if (w_current->handleboxes) {
  	handlebox = gtk_handle_box_new ();
  	gtk_box_pack_start(GTK_BOX(main_box), handlebox, FALSE, FALSE, 0);
  	gtk_container_add (GTK_CONTAINER (handlebox), menubar);
  } else {
  	gtk_box_pack_start(GTK_BOX(main_box), menubar, FALSE, FALSE, 0);
  }

  w_current->menubar = menubar;
  gtk_widget_realize (w_current->main_window);

  if (w_current->handleboxes && w_current->toolbars) {
  	handlebox = gtk_handle_box_new ();
  	gtk_box_pack_start (GTK_BOX (main_box), handlebox, FALSE, FALSE, 0);
  }
 
  if (w_current->toolbars) {
    toolbar = gtk_toolbar_new();
    gtk_toolbar_set_orientation (GTK_TOOLBAR(toolbar), 
                                 GTK_ORIENTATION_HORIZONTAL);
    gtk_toolbar_set_style (GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);

    if (w_current->handleboxes) {
      gtk_container_add (GTK_CONTAINER (handlebox), toolbar);
    } else {
      gtk_box_pack_start(GTK_BOX(main_box), toolbar, FALSE, FALSE, 0);
    }

    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), 
                             _("New"), 
                             _("New file"), 
                             "toolbar/new", 
                             x_window_stock_pixmap("new", w_current),
                             (GtkSignalFunc) i_callback_toolbar_file_new, 
                             w_current);
    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), 
                             _("Open"), 
                             _("Open file..."), 
                             "toolbar/open",
                             x_window_stock_pixmap("open", w_current),
                             (GtkSignalFunc) i_callback_toolbar_file_open, 
                             w_current);
    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), 
                             _("Save"), 
                             _("Save file"), 
                             "toolbar/save", 
                             x_window_stock_pixmap("save", w_current),
                             (GtkSignalFunc) i_callback_toolbar_file_save, 
                             w_current);
    gtk_toolbar_append_space (GTK_TOOLBAR(toolbar)); 
    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), 
                             _("Undo"), 
                             _("Undo last operation"), 
                             "toolbar/undo", 
                             x_window_stock_pixmap("undo", w_current),
                             (GtkSignalFunc) i_callback_toolbar_edit_undo, 
                             w_current);
    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), 
                             _("Redo"), 
                             _("Redo last undo"), 
                             "toolbar/redo", 
                             x_window_stock_pixmap("redo", w_current),
                             (GtkSignalFunc) i_callback_toolbar_edit_redo, 
                             w_current);
    gtk_toolbar_append_space (GTK_TOOLBAR(toolbar)); 
    /* not part of any radio button group */
    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), 
                             _("Component"), 
                             _("Add component...\nSelect library and component from list, move the mouse into main window, click to place\nRight mouse button to cancel"), 
                             "toolbar/component", 
                             x_window_stock_pixmap("comp", w_current),
                             (GtkSignalFunc) i_callback_toolbar_add_component, 
                             w_current);
    w_current->toolbar_net = 
      gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
                                 GTK_TOOLBAR_CHILD_RADIOBUTTON,
                                 NULL,
                                 _("Nets"),
                                 _("Add nets mode\nRight mouse button to cancel"),
                                 "toolbar/nets",
                                 x_window_stock_pixmap("net", w_current),
                                 (GtkSignalFunc) i_callback_toolbar_add_net,
                                 w_current);
    w_current->toolbar_bus = 
      gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
                                 GTK_TOOLBAR_CHILD_RADIOBUTTON,
                                 w_current->toolbar_net,
                                 _("Bus"),
                                 _("Add buses mode\nRight mouse button to cancel"),
                                 "toolbar/bus",
                                 x_window_stock_pixmap("bus", w_current),
                                 (GtkSignalFunc) i_callback_toolbar_add_bus,
                                 w_current);
    /* not part of any radio button group */
    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), 
                             _("Text"), 
                             _("Add Text..."), 
                             "toolbar/text", 
                             x_window_stock_pixmap("text", w_current),
                             (GtkSignalFunc) i_callback_toolbar_add_text, 
                             w_current);
    gtk_toolbar_append_space (GTK_TOOLBAR(toolbar)); 
    w_current->toolbar_select = 
      gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
                                 GTK_TOOLBAR_CHILD_RADIOBUTTON,
                                 w_current->toolbar_bus,
                                 _("Select"),
                                 _("Select mode"),
                                 "toolbar/select",
                                 x_window_stock_pixmap("select", w_current),
                                 (GtkSignalFunc) i_callback_toolbar_edit_select, 
                                 w_current);


    gtk_toolbar_append_space (GTK_TOOLBAR(toolbar)); 
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w_current->toolbar_select),
                                 TRUE);
  } 


  /*  Try to create popup menu (appears in right mouse button  */
  w_current->popup_menu = (GtkWidget *) get_main_popup(w_current);

  drawbox = gtk_hbox_new(FALSE, 0);
  gtk_container_border_width(GTK_CONTAINER(drawbox), 0);
  gtk_container_add(GTK_CONTAINER(main_box), drawbox);

  x_window_create_drawing(drawbox, w_current);
  x_window_setup_draw_events(w_current);

  if (w_current->scrollbars_flag == TRUE) {
    /* setup scroll bars */
    w_current->v_adjustment = GTK_ADJUSTMENT (
      gtk_adjustment_new (toplevel->init_bottom, 0.0, toplevel->init_bottom,
                          100.0, 100.0, 10.0));

    w_current->v_scrollbar = gtk_vscrollbar_new (w_current->v_adjustment);

    gtk_range_set_update_policy (GTK_RANGE (w_current->v_scrollbar),
                                 GTK_UPDATE_CONTINUOUS);

    gtk_box_pack_start (GTK_BOX (drawbox), w_current->v_scrollbar,
                        FALSE, FALSE, 0);

    g_signal_connect (w_current->v_adjustment,
                      "value_changed",
                      G_CALLBACK (x_event_vschanged),
                      w_current);

    w_current->h_adjustment = GTK_ADJUSTMENT (
      gtk_adjustment_new (0.0, 0.0, toplevel->init_right, 100.0, 100.0, 10.0));

    w_current->h_scrollbar = gtk_hscrollbar_new (w_current->h_adjustment);

    gtk_range_set_update_policy (GTK_RANGE (w_current->h_scrollbar),
                                 GTK_UPDATE_CONTINUOUS);

    gtk_box_pack_start (GTK_BOX (main_box), w_current->h_scrollbar,
                        FALSE, FALSE, 0);

    g_signal_connect (w_current->h_adjustment,
                      "value_changed",
                      G_CALLBACK (x_event_hschanged),
                      w_current);
  }

  /* macro box */
  w_current->macro_entry = gtk_entry_new();
  g_signal_connect(w_current->macro_entry, "activate",
		   G_CALLBACK(&x_window_invoke_macro), w_current);

  w_current->macro_box = gtk_hbox_new(FALSE, 0);
  gtk_box_pack_start(GTK_BOX(w_current->macro_box), w_current->macro_entry,
		     TRUE, TRUE, 2);
  gtk_container_border_width(GTK_CONTAINER(w_current->macro_box), 1);
  gtk_box_pack_start (GTK_BOX (main_box), w_current->macro_box,
		      FALSE, FALSE, 0);

  /* bottom box */
  bottom_box = gtk_hbox_new(FALSE, 0);
  gtk_container_border_width(GTK_CONTAINER(bottom_box), 1);
  gtk_box_pack_start (GTK_BOX (main_box), bottom_box, FALSE, FALSE, 0);

  /*	label = gtk_label_new ("Mouse buttons:");
        gtk_box_pack_start (GTK_BOX (bottom_box), label, FALSE, FALSE, 10);
  */

  label = gtk_label_new (" ");
  gtk_box_pack_start (GTK_BOX (bottom_box), label, FALSE, FALSE, 2);

  w_current->left_label = gtk_label_new (_("Pick"));
  gtk_box_pack_start (GTK_BOX (bottom_box), w_current->left_label,
                      FALSE, FALSE, 0);

  label = gtk_label_new ("|");
  gtk_box_pack_start (GTK_BOX (bottom_box), label, FALSE, FALSE, 5);

  if (w_current->middle_button == STROKE) {
#ifdef HAVE_LIBSTROKE
    w_current->middle_label = gtk_label_new (_("Stroke"));
#else
    w_current->middle_label = gtk_label_new (_("none"));
#endif
  } else if (w_current->middle_button == ACTION) {
    w_current->middle_label = gtk_label_new (_("Action"));
  } else {
    w_current->middle_label = gtk_label_new (_("Repeat/none"));
  }

  gtk_box_pack_start (GTK_BOX (bottom_box), w_current->middle_label,
                      FALSE, FALSE, 0);

  label = gtk_label_new ("|");
  gtk_box_pack_start (GTK_BOX (bottom_box), label, FALSE, FALSE, 5);

  if (default_third_button == POPUP_ENABLED) {
    w_current->right_label = gtk_label_new (_("Menu/Cancel"));
  } else {
    w_current->right_label = gtk_label_new (_("Pan/Cancel"));
  }
  gtk_box_pack_start (GTK_BOX (bottom_box), w_current->right_label,
                      FALSE, FALSE, 0);

  label = gtk_label_new (" ");
  gtk_box_pack_start (GTK_BOX (bottom_box), label, FALSE, FALSE, 5);

  w_current->grid_label = gtk_label_new (" ");
  gtk_box_pack_start (GTK_BOX (bottom_box), w_current->grid_label,
                      FALSE, FALSE, 10);

  w_current->status_label = gtk_label_new (_("Select Mode"));
  gtk_box_pack_end (GTK_BOX (bottom_box), w_current->status_label, FALSE,
                    FALSE, 10);

  gtk_widget_show_all (w_current->main_window);
  gtk_widget_hide(w_current->macro_box);

  w_current->window = w_current->drawing_area->window;

  w_current->drawable = w_current->window;

  x_window_setup_gc(w_current);
}
Beispiel #8
0
static void
init_chat_window_body(GtkWidget *vbox, HybridChatWindow *chat)
{
    GtkWidget     *scroll;
    GtkWidget     *button;
    GtkWidget     *image_icon;
    GtkWidget     *limit_label;
    GtkTextBuffer *send_buffer;
    gchar         *word_limit_string;
    gint           word_limit;
    HybridAccount *account;
    HybridModule  *module;
    HybridIMOps   *ops;

    g_return_if_fail(vbox != NULL);
    g_return_if_fail(chat != NULL);

    /* create buddy tips panel */
    create_buddy_tips_panel(vbox, chat);

    /* create textview */
    scroll = gtk_scrolled_window_new(NULL, NULL);
    gtk_box_pack_start(GTK_BOX(vbox), scroll, TRUE, TRUE, 0);
    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
            GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
    gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scroll),
            GTK_SHADOW_ETCHED_IN);

    chat->textview = text_ops->create();
    g_signal_connect(chat->textview, "focus-in-event",
                    GTK_SIGNAL_FUNC(focus_in_cb), chat);
    gtk_container_add(GTK_CONTAINER(scroll), chat->textview);

    /* create toolbar */
    chat->toolbar = gtk_toolbar_new();
    gtk_toolbar_set_style(GTK_TOOLBAR(chat->toolbar), GTK_TOOLBAR_ICONS);
    gtk_box_pack_start(GTK_BOX(vbox), chat->toolbar, FALSE, FALSE, 0);

    image_icon = gtk_image_new_from_file(PIXMAPS_DIR"menus/logs.png");
    button = gtk_toolbar_append_item(GTK_TOOLBAR(chat->toolbar),
            _("Chat logs"), _("View chat logs"), NULL, image_icon,
            NULL, NULL);

    if (IS_SYSTEM_CHAT(chat)) {
        gtk_toolbar_append_space(GTK_TOOLBAR(chat->toolbar));
        image_icon = gtk_image_new_from_file(PIXMAPS_DIR"menus/nudge.png");
        button = gtk_toolbar_append_item(GTK_TOOLBAR(chat->toolbar),
                _("Screen jitter"), _("Send a screen jitter"), NULL,
                image_icon, NULL, NULL);
        gtk_toolbar_append_space(GTK_TOOLBAR(chat->toolbar));

        account = chat->account;
        module    = account->proto;
        ops        = module->info->im_ops;

        if (ops->chat_word_limit &&
            (word_limit = ops->chat_word_limit(account)) > 0) {

            word_limit_string =
                g_strdup_printf(_("Total %d character, left "), word_limit);

            limit_label = gtk_label_new(word_limit_string);

            g_free(word_limit_string);

            word_limit_string =
                g_strdup_printf(_("[<span color='#0099ff'>%d</span>] characters"),
                        word_limit);

            chat->words_left_label = gtk_label_new(NULL);
            gtk_label_set_markup(GTK_LABEL(chat->words_left_label), word_limit_string);
            g_free(word_limit_string);

            gtk_container_add(GTK_CONTAINER(chat->toolbar), limit_label);
            gtk_container_add(GTK_CONTAINER(chat->toolbar), chat->words_left_label);
        }
    }

    gtk_widget_show_all(chat->toolbar);

    /* create textview */
    scroll = gtk_scrolled_window_new(NULL, NULL);
    gtk_box_pack_start(GTK_BOX(vbox), scroll, FALSE, FALSE, 0);
    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
            GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
    gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scroll),
            GTK_SHADOW_ETCHED_IN);

    chat->sendtext = gtk_text_view_new();
    gtk_widget_set_size_request(chat->sendtext, 0, 80);
    gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(chat->sendtext),
            GTK_WRAP_WORD_CHAR);
    gtk_container_add(GTK_CONTAINER(scroll), chat->sendtext);
    g_signal_connect(chat->sendtext, "key_press_event",
            G_CALLBACK(key_pressed_cb), chat->parent);
    g_signal_connect(chat->sendtext, "focus-in-event",
                    GTK_SIGNAL_FUNC(focus_in_cb), chat);

    send_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(chat->sendtext));

    g_signal_connect(send_buffer, "changed",
            G_CALLBACK(sendtext_buffer_changed), chat);

    gtk_window_present(GTK_WINDOW(chat->parent->window));

    /* focus the send textview */
    GTK_WIDGET_SET_FLAGS(chat->sendtext, GTK_CAN_FOCUS);
    gtk_widget_grab_focus(chat->sendtext);

    gtk_widget_show_all(scroll);
    gtk_widget_show_all(vbox);
}
Beispiel #9
0
GtkToolbar* create_filter_toolbar(){
			GtkToolbar* toolbar = GTK_TOOLBAR( gtk_toolbar_new() );
			gtk_toolbar_set_style( toolbar, GTK_TOOLBAR_ICONS );
//			gtk_toolbar_set_show_arrow( toolbar, TRUE );
			gtk_widget_show( GTK_WIDGET( toolbar ) );
			g_signal_connect( G_OBJECT( toolbar ), "enter_notify_event", G_CALLBACK( ToggleActions0 ), 0 );

			GtkToggleButton* button;

			toolbar_append_toggle_button( toolbar, "World (ALT + 1)", "f-world.png", "FilterWorldBrushes" );

			button = toolbar_append_toggle_button( toolbar, "Structural (CTRL + SHIFT + D)\nRightClick: MakeStructural", "f-structural.png", "FilterStructural" );
			g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Structural_button_press ), 0 );

			button = toolbar_append_toggle_button( toolbar, "Details (CTRL + D)\nRightClick: MakeDetail", "f-details.png", "FilterDetails" );
			g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Detail_button_press ), 0 );

			button = toolbar_append_toggle_button( toolbar, "Func_Groups\nRightClick: create func_group", "f-funcgroups.png", "FilterFuncGroups" );
			g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Func_Groups_button_press ), 0 );

			toolbar_append_toggle_button( toolbar, "Patches (CTRL + P)", "patch_wireframe.png", "FilterPatches" );
			gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );

//			if ( g_pGameDescription->mGameType == "doom3" ) {
//				button = toolbar_append_toggle_button( toolbar, "Visportals (ALT + 3)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-areaportal.png", "FilterVisportals" );
//			}
//			else{
//				button = toolbar_append_toggle_button( toolbar, "Areaportals (ALT + 3)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-areaportal.png", "FilterAreaportals" );
//			}
//			g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Translucent_button_press ), 0 );


			button = toolbar_append_toggle_button( toolbar, "Translucent (ALT + 4)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-translucent.png", "FilterTranslucent" );
			g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Translucent_button_press ), 0 );

			button = toolbar_append_toggle_button( toolbar, "Liquids (ALT + 5)\nRightClick: toggle tex\n\twaterCaulk\n\tlavaCaulk\n\tslimeCaulk", "f-liquids.png", "FilterLiquids" );
			g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Liquids_button_press ), 0 );

			button = toolbar_append_toggle_button( toolbar, "Caulk (ALT + 6)\nRightClick: tex Caulk", "f-caulk.png", "FilterCaulk" );
			g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Caulk_button_press ), 0 );

			button = toolbar_append_toggle_button( toolbar, "Clips (ALT + 7)\nRightClick: toggle tex\n\tplayerClip\n\tweapClip", "f-clip.png", "FilterClips" );
			g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Clip_button_press ), 0 );

			button = toolbar_append_toggle_button( toolbar, "HintsSkips (CTRL + H)\nRightClick: toggle tex\n\thint\n\thintLocal\n\thintSkip", "f-hint.png", "FilterHintsSkips" );
			g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Hint_button_press ), 0 );

			//toolbar_append_toggle_button( toolbar, "Paths (ALT + 8)", "texture_lock.png", "FilterPaths" );
			gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
			toolbar_append_toggle_button( toolbar, "Entities (ALT + 2)", "f-entities.png", "FilterEntities" );
			toolbar_append_toggle_button( toolbar, "Lights (ALT + 0)", "f-lights.png", "FilterLights" );
			toolbar_append_toggle_button( toolbar, "Models (SHIFT + M)", "f-models.png", "FilterModels" );

			button = toolbar_append_toggle_button( toolbar, "Triggers (CTRL + SHIFT + T)\nRightClick: tex Trigger", "f-triggers.png", "FilterTriggers" );
			g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Trigger_button_press ), 0 );

			//toolbar_append_toggle_button( toolbar, "Decals (SHIFT + D)", "f-decals.png", "FilterDecals" );
			gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
			//toolbar_append_button( toolbar, "InvertFilters", "f-invert.png", "InvertFilters" );

			toolbar_append_button( toolbar, "ResetFilters", "f-reset.png", "ResetFilters" );

			gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
			button = toolbar_append_toggle_button( toolbar, "Region Set Selection (CTRL + SHIFT + R)\nRightClick: Region Off", "f-region.png", "RegionSetSelection" );
			g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Region_button_press ), 0 );

			button = toolbar_append_toggle_button( toolbar, "Hide Selected (H)\nRightClick: Show Hidden (SHIFT + H)", "f-hide.png", "HideSelected" );
			g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Hide_button_press ), 0 );

			return toolbar;
}
Beispiel #10
0
GtkWidget*
create_app (void)
{
  GtkWidget *app;
  GtkWidget *dock1;
  GtkWidget *toolbar1;
  GtkWidget *tmp_toolbar_icon;
  GtkWidget *button_new;
  GtkWidget *button_open;
  GtkWidget *button_save;
  GtkWidget *button_save_as;
  GtkWidget *hexentry;
  GtkWidget *button_upload;
  GtkWidget *radiobutton_spline;
  GtkWidget *radiobutton_linear;
  GtkWidget *radiobutton_free;
  GtkWidget *vbox1;
  GtkWidget *hbox1;
  GtkWidget *vbox2;
  GtkWidget *table1;
  GtkWidget *label1;
  GtkWidget *label2;
  GtkWidget *label3;
  GtkWidget *label4;
  GtkWidget *label5;
  GtkWidget *label6;
  GtkObject *minx_adj;
  GtkWidget *minx;
  GtkWidget *type;
  GList *type_items = NULL;
  GtkWidget *typeentry;
  GtkObject *maxx_adj;
  GtkWidget *maxx;
  GtkObject *miny_adj;
  GtkWidget *miny;
  GtkObject *maxy_adj;
  GtkWidget *maxy;
  GtkObject *count_adj;
  GtkWidget *count;
  GtkWidget *label10;
  GtkWidget *label11;
  GtkWidget *label12;
  GtkObject *scale_adj;
  GtkWidget *scale;
  GtkObject *base_adj;
  GtkWidget *base;
  GtkWidget *label13;
  GtkWidget *scrolledwindow1;
  GtkWidget *clist;
  GtkWidget *label8;
  GtkWidget *label9;
  GtkWidget *toolbar2;
  GtkWidget *list_open;
  GtkWidget *list_save;
  GtkWidget *list_add;
  GtkWidget *list_remove;
  GtkWidget *list_use;
  GtkWidget *curve;
  GtkWidget *appbar1;

  app = gnome_app_new ("Curvegen", _("PSXDEV Curve Generator"));
  gtk_object_set_data (GTK_OBJECT (app), "app", app);

  dock1 = GNOME_APP (app)->dock;
  gtk_widget_ref (dock1);
  gtk_object_set_data_full (GTK_OBJECT (app), "dock1", dock1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dock1);

  gnome_app_create_menus (GNOME_APP (app), menubar1_uiinfo);

  gtk_widget_ref (menubar1_uiinfo[0].widget);
  gtk_object_set_data_full (GTK_OBJECT (app), "file1",
                            menubar1_uiinfo[0].widget,
                            (GtkDestroyNotify) gtk_widget_unref);

  gtk_widget_ref (file1_menu_uiinfo[0].widget);
  gtk_object_set_data_full (GTK_OBJECT (app), "exit1",
                            file1_menu_uiinfo[0].widget,
                            (GtkDestroyNotify) gtk_widget_unref);

  gtk_widget_ref (menubar1_uiinfo[1].widget);
  gtk_object_set_data_full (GTK_OBJECT (app), "help1",
                            menubar1_uiinfo[1].widget,
                            (GtkDestroyNotify) gtk_widget_unref);

  gtk_widget_ref (help1_menu_uiinfo[0].widget);
  gtk_object_set_data_full (GTK_OBJECT (app), "about1",
                            help1_menu_uiinfo[0].widget,
                            (GtkDestroyNotify) gtk_widget_unref);

  toolbar1 = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
  gtk_widget_ref (toolbar1);
  gtk_object_set_data_full (GTK_OBJECT (app), "toolbar1", toolbar1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (toolbar1);
  gnome_app_add_toolbar (GNOME_APP (app), GTK_TOOLBAR (toolbar1), "toolbar1",
                                GNOME_DOCK_ITEM_BEH_EXCLUSIVE,
                                GNOME_DOCK_TOP, 1, 0, 0);
  gtk_container_set_border_width (GTK_CONTAINER (toolbar1), 1);
  gtk_toolbar_set_space_size (GTK_TOOLBAR (toolbar1), 16);
  gtk_toolbar_set_space_style (GTK_TOOLBAR (toolbar1), GTK_TOOLBAR_SPACE_LINE);
  gtk_toolbar_set_button_relief (GTK_TOOLBAR (toolbar1), GTK_RELIEF_NONE);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_NEW);
  button_new = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("New"),
                                _("New File"), NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (button_new);
  gtk_object_set_data_full (GTK_OBJECT (app), "button_new", button_new,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button_new);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_OPEN);
  button_open = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Open"),
                                _("Open File"), NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (button_open);
  gtk_object_set_data_full (GTK_OBJECT (app), "button_open", button_open,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button_open);
  gtk_widget_set_sensitive (button_open, FALSE);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_SAVE);
  button_save = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Save"),
                                _("Save File"), NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (button_save);
  gtk_object_set_data_full (GTK_OBJECT (app), "button_save", button_save,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button_save);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_SAVE_AS);
  button_save_as = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Save As"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (button_save_as);
  gtk_object_set_data_full (GTK_OBJECT (app), "button_save_as", button_save_as,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button_save_as);

  hexentry = gtk_entry_new ();
  gtk_widget_ref (hexentry);
  gtk_object_set_data_full (GTK_OBJECT (app), "hexentry", hexentry,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hexentry);
  gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar1), hexentry, _("Address of curve in PlayStation memory..."), NULL);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_MAIL_FWD);
  button_upload = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Upload"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (button_upload);
  gtk_object_set_data_full (GTK_OBJECT (app), "button_upload", button_upload,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button_upload);

  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar1));

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_CONVERT);
  radiobutton_spline = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_RADIOBUTTON,
                                NULL,
                                _("SPLINE"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (radiobutton_spline);
  gtk_object_set_data_full (GTK_OBJECT (app), "radiobutton_spline", radiobutton_spline,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (radiobutton_spline);
  gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (radiobutton_spline), FALSE);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_CONVERT);
  radiobutton_linear = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_RADIOBUTTON,
                                radiobutton_spline,
                                _("LINEAR"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (radiobutton_linear);
  gtk_object_set_data_full (GTK_OBJECT (app), "radiobutton_linear", radiobutton_linear,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (radiobutton_linear);
  gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (radiobutton_linear), FALSE);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_CONVERT);
  radiobutton_free = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_RADIOBUTTON,
                                radiobutton_spline,
                                _("FREE"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (radiobutton_free);
  gtk_object_set_data_full (GTK_OBJECT (app), "radiobutton_free", radiobutton_free,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (radiobutton_free);
  gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (radiobutton_free), FALSE);

  vbox1 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox1);
  gtk_object_set_data_full (GTK_OBJECT (app), "vbox1", vbox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox1);
  gnome_app_set_contents (GNOME_APP (app), vbox1);

  hbox1 = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (hbox1);
  gtk_object_set_data_full (GTK_OBJECT (app), "hbox1", hbox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox1);
  gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0);

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox2);
  gtk_object_set_data_full (GTK_OBJECT (app), "vbox2", vbox2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox2);
  gtk_box_pack_start (GTK_BOX (hbox1), vbox2, FALSE, TRUE, 0);

  table1 = gtk_table_new (10, 2, FALSE);
  gtk_widget_ref (table1);
  gtk_object_set_data_full (GTK_OBJECT (app), "table1", table1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (table1);
  gtk_box_pack_start (GTK_BOX (vbox2), table1, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (table1), 4);
  gtk_table_set_row_spacings (GTK_TABLE (table1), 1);
  gtk_table_set_col_spacings (GTK_TABLE (table1), 2);

  label1 = gtk_label_new (_("Min X"));
  gtk_widget_ref (label1);
  gtk_object_set_data_full (GTK_OBJECT (app), "label1", label1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label1);
  gtk_table_attach (GTK_TABLE (table1), label1, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label1), 7.45058e-09, 0.5);

  label2 = gtk_label_new (_("Max X"));
  gtk_widget_ref (label2);
  gtk_object_set_data_full (GTK_OBJECT (app), "label2", label2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label2);
  gtk_table_attach (GTK_TABLE (table1), label2, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label2), 7.45058e-09, 0.5);

  label3 = gtk_label_new (_("Min Y"));
  gtk_widget_ref (label3);
  gtk_object_set_data_full (GTK_OBJECT (app), "label3", label3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label3);
  gtk_table_attach (GTK_TABLE (table1), label3, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label3), 7.45058e-09, 0.5);

  label4 = gtk_label_new (_("Max Y"));
  gtk_widget_ref (label4);
  gtk_object_set_data_full (GTK_OBJECT (app), "label4", label4,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label4);
  gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 4, 5,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label4), 7.45058e-09, 0.5);

  label5 = gtk_label_new (_("Count"));
  gtk_widget_ref (label5);
  gtk_object_set_data_full (GTK_OBJECT (app), "label5", label5,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label5);
  gtk_table_attach (GTK_TABLE (table1), label5, 0, 1, 8, 9,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);

  label6 = gtk_label_new (_("Type"));
  gtk_widget_ref (label6);
  gtk_object_set_data_full (GTK_OBJECT (app), "label6", label6,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label6);
  gtk_table_attach (GTK_TABLE (table1), label6, 0, 1, 9, 10,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);

  minx_adj = gtk_adjustment_new (0, -1e+13, 1e+13, 1, 10, 10);
  minx = gtk_spin_button_new (GTK_ADJUSTMENT (minx_adj), 1, 4);
  gtk_widget_ref (minx);
  gtk_object_set_data_full (GTK_OBJECT (app), "minx", minx,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (minx);
  gtk_table_attach (GTK_TABLE (table1), minx, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (minx), TRUE);

  type = gtk_combo_new ();
  gtk_widget_ref (type);
  gtk_object_set_data_full (GTK_OBJECT (app), "type", type,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (type);
  gtk_table_attach (GTK_TABLE (table1), type, 1, 2, 9, 10,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_combo_set_value_in_list (GTK_COMBO (type), TRUE, FALSE);
  gtk_combo_set_use_arrows_always (GTK_COMBO (type), TRUE);
  type_items = g_list_append (type_items, _("u_char"));
  type_items = g_list_append (type_items, _("char"));
  type_items = g_list_append (type_items, _("u_short"));
  type_items = g_list_append (type_items, _("short"));
  type_items = g_list_append (type_items, _("u_long"));
  type_items = g_list_append (type_items, _("long"));
  type_items = g_list_append (type_items, _("float"));
  type_items = g_list_append (type_items, _("double"));
  type_items = g_list_append (type_items, _("fixed (4+12)"));
  gtk_combo_set_popdown_strings (GTK_COMBO (type), type_items);
  g_list_free (type_items);

  typeentry = GTK_COMBO (type)->entry;
  gtk_widget_ref (typeentry);
  gtk_object_set_data_full (GTK_OBJECT (app), "typeentry", typeentry,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (typeentry);
  gtk_entry_set_editable (GTK_ENTRY (typeentry), FALSE);
  gtk_entry_set_text (GTK_ENTRY (typeentry), _("u_char"));

  maxx_adj = gtk_adjustment_new (1, -1e+13, 1e+13, 1, 10, 10);
  maxx = gtk_spin_button_new (GTK_ADJUSTMENT (maxx_adj), 1, 4);
  gtk_widget_ref (maxx);
  gtk_object_set_data_full (GTK_OBJECT (app), "maxx", maxx,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (maxx);
  gtk_table_attach (GTK_TABLE (table1), maxx, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (maxx), TRUE);

  miny_adj = gtk_adjustment_new (0, -1e+13, 1e+13, 1, 10, 10);
  miny = gtk_spin_button_new (GTK_ADJUSTMENT (miny_adj), 1, 4);
  gtk_widget_ref (miny);
  gtk_object_set_data_full (GTK_OBJECT (app), "miny", miny,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (miny);
  gtk_table_attach (GTK_TABLE (table1), miny, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (miny), TRUE);

  maxy_adj = gtk_adjustment_new (1, -1e+13, 1e+13, 1, 10, 10);
  maxy = gtk_spin_button_new (GTK_ADJUSTMENT (maxy_adj), 1, 4);
  gtk_widget_ref (maxy);
  gtk_object_set_data_full (GTK_OBJECT (app), "maxy", maxy,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (maxy);
  gtk_table_attach (GTK_TABLE (table1), maxy, 1, 2, 4, 5,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (maxy), TRUE);

  count_adj = gtk_adjustment_new (1, 1, 1e+22, 1, 10, 10);
  count = gtk_spin_button_new (GTK_ADJUSTMENT (count_adj), 1, 0);
  gtk_widget_ref (count);
  gtk_object_set_data_full (GTK_OBJECT (app), "count", count,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (count);
  gtk_table_attach (GTK_TABLE (table1), count, 1, 2, 8, 9,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label10 = gtk_label_new (_("Curve Interval:"));
  gtk_widget_ref (label10);
  gtk_object_set_data_full (GTK_OBJECT (app), "label10", label10,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label10);
  gtk_table_attach (GTK_TABLE (table1), label10, 0, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label10), 7.45058e-09, 0.5);

  label11 = gtk_label_new (_("Datatype:"));
  gtk_widget_ref (label11);
  gtk_object_set_data_full (GTK_OBJECT (app), "label11", label11,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label11);
  gtk_table_attach (GTK_TABLE (table1), label11, 0, 2, 5, 6,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label11), 7.45058e-09, 0.5);

  label12 = gtk_label_new (_("Scale"));
  gtk_widget_ref (label12);
  gtk_object_set_data_full (GTK_OBJECT (app), "label12", label12,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label12);
  gtk_table_attach (GTK_TABLE (table1), label12, 0, 1, 6, 7,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label12), 0, 0.5);

  scale_adj = gtk_adjustment_new (1, 1, 1e+22, 1, 10, 10);
  scale = gtk_spin_button_new (GTK_ADJUSTMENT (scale_adj), 1, 0);
  gtk_widget_ref (scale);
  gtk_object_set_data_full (GTK_OBJECT (app), "scale", scale,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (scale);
  gtk_table_attach (GTK_TABLE (table1), scale, 1, 2, 6, 7,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  base_adj = gtk_adjustment_new (0, 0, 1e+22, 1, 10, 10);
  base = gtk_spin_button_new (GTK_ADJUSTMENT (base_adj), 1, 0);
  gtk_widget_ref (base);
  gtk_object_set_data_full (GTK_OBJECT (app), "base", base,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (base);
  gtk_table_attach (GTK_TABLE (table1), base, 1, 2, 7, 8,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label13 = gtk_label_new (_("Base"));
  gtk_widget_ref (label13);
  gtk_object_set_data_full (GTK_OBJECT (app), "label13", label13,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label13);
  gtk_table_attach (GTK_TABLE (table1), label13, 0, 1, 7, 8,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label13), 0, 0.5);

  scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_ref (scrolledwindow1);
  gtk_object_set_data_full (GTK_OBJECT (app), "scrolledwindow1", scrolledwindow1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (scrolledwindow1);
  gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow1, TRUE, TRUE, 0);
  gtk_widget_set_sensitive (scrolledwindow1, FALSE);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);

  clist = gtk_clist_new (2);
  gtk_widget_ref (clist);
  gtk_object_set_data_full (GTK_OBJECT (app), "clist", clist,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (clist);
  gtk_container_add (GTK_CONTAINER (scrolledwindow1), clist);
  gtk_clist_set_column_width (GTK_CLIST (clist), 0, 28);
  gtk_clist_set_column_width (GTK_CLIST (clist), 1, 80);
  gtk_clist_column_titles_show (GTK_CLIST (clist));

  label8 = gtk_label_new (_("Type"));
  gtk_widget_ref (label8);
  gtk_object_set_data_full (GTK_OBJECT (app), "label8", label8,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label8);
  gtk_clist_set_column_widget (GTK_CLIST (clist), 0, label8);

  label9 = gtk_label_new (_("Name"));
  gtk_widget_ref (label9);
  gtk_object_set_data_full (GTK_OBJECT (app), "label9", label9,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label9);
  gtk_clist_set_column_widget (GTK_CLIST (clist), 1, label9);

  toolbar2 = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
  gtk_widget_ref (toolbar2);
  gtk_object_set_data_full (GTK_OBJECT (app), "toolbar2", toolbar2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (toolbar2);
  gtk_box_pack_start (GTK_BOX (vbox2), toolbar2, FALSE, FALSE, 0);
  gtk_widget_set_sensitive (toolbar2, FALSE);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_OPEN);
  list_open = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Open"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (list_open);
  gtk_object_set_data_full (GTK_OBJECT (app), "list_open", list_open,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (list_open);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_SAVE);
  list_save = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Save"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (list_save);
  gtk_object_set_data_full (GTK_OBJECT (app), "list_save", list_save,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (list_save);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_ADD);
  list_add = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Add"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (list_add);
  gtk_object_set_data_full (GTK_OBJECT (app), "list_add", list_add,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (list_add);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_REMOVE);
  list_remove = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Remove"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (list_remove);
  gtk_object_set_data_full (GTK_OBJECT (app), "list_remove", list_remove,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (list_remove);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_EXEC);
  list_use = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Use"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (list_use);
  gtk_object_set_data_full (GTK_OBJECT (app), "list_use", list_use,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (list_use);

  curve = gtk_curve_new ();
  gtk_widget_ref (curve);
  gtk_object_set_data_full (GTK_OBJECT (app), "curve", curve,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (curve);
  gtk_box_pack_start (GTK_BOX (hbox1), curve, TRUE, TRUE, 0);
  gtk_widget_set_usize (curve, 256, 256);
  gtk_curve_set_range (GTK_CURVE (curve), 0, 1, 0, 1);

  appbar1 = gnome_appbar_new (FALSE, TRUE, GNOME_PREFERENCES_NEVER);
  gtk_widget_ref (appbar1);
  gtk_object_set_data_full (GTK_OBJECT (app), "appbar1", appbar1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (appbar1);
  gnome_app_set_statusbar (GNOME_APP (app), appbar1);

  gtk_signal_connect (GTK_OBJECT (app), "delete_event",
                      GTK_SIGNAL_FUNC (on_app_delete_event),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button_new), "clicked",
                      GTK_SIGNAL_FUNC (on_button_new_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button_open), "clicked",
                      GTK_SIGNAL_FUNC (on_button_open_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button_save), "clicked",
                      GTK_SIGNAL_FUNC (on_button_save_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button_save_as), "clicked",
                      GTK_SIGNAL_FUNC (on_button_save_as_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button_upload), "clicked",
                      GTK_SIGNAL_FUNC (on_button_upload_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (radiobutton_spline), "clicked",
                      GTK_SIGNAL_FUNC (on_radiobutton_spline_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (radiobutton_linear), "clicked",
                      GTK_SIGNAL_FUNC (on_radiobutton_linear_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (radiobutton_free), "clicked",
                      GTK_SIGNAL_FUNC (on_radiobutton_free_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (minx), "changed",
                      GTK_SIGNAL_FUNC (on_minx_changed),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (maxx), "changed",
                      GTK_SIGNAL_FUNC (on_maxx_changed),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (miny), "changed",
                      GTK_SIGNAL_FUNC (on_miny_changed),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (maxy), "changed",
                      GTK_SIGNAL_FUNC (on_maxy_changed),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (list_open), "clicked",
                      GTK_SIGNAL_FUNC (on_list_open_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (list_save), "clicked",
                      GTK_SIGNAL_FUNC (on_list_save_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (list_add), "clicked",
                      GTK_SIGNAL_FUNC (on_list_add_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (list_remove), "clicked",
                      GTK_SIGNAL_FUNC (on_list_remove_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (list_use), "clicked",
                      GTK_SIGNAL_FUNC (on_list_use_clicked),
                      NULL);

  return app;
}
Beispiel #11
0
void GUI_CreateSpeedDialWindow(void)
{
	int nmenu_items = sizeof(menu_items) / sizeof(menu_items[0]);
	GtkItemFactory *item_factory;
	GtkAccelGroup *accel_group;
	SortColumn *sColumn;
	GtkWidget *menubar;
	GtkWidget *main_vbox;
	GtkWidget *toolbar;
	GtkWidget *clistScrolledWindow;
	register gint i;
	gchar *titles[3] = { _("Key"), _("Name"), _("Number") };


	InitMainMenu();
	GUI_SpeedDialWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_window_set_wmclass(GTK_WINDOW(GUI_SpeedDialWindow), "SpeedDialWindow", "Xgnokii");
	gtk_window_set_title(GTK_WINDOW(GUI_SpeedDialWindow), _("Speed Dial"));
	gtk_widget_set_usize(GTK_WIDGET(GUI_SpeedDialWindow), 350, 220);
	//gtk_container_set_border_width (GTK_CONTAINER (GUI_SpeedDialWindow), 10);
	gtk_signal_connect(GTK_OBJECT(GUI_SpeedDialWindow), "delete_event",
			   GTK_SIGNAL_FUNC(DeleteEvent), NULL);
	gtk_widget_realize(GUI_SpeedDialWindow);

	accel_group = gtk_accel_group_new();
	item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<main>", accel_group);

	gtk_item_factory_create_items(item_factory, nmenu_items, menu_items, NULL);

	gtk_window_add_accel_group(GTK_WINDOW(GUI_SpeedDialWindow), accel_group);

	/* Finally, return the actual menu bar created by the item factory. */
	menubar = gtk_item_factory_get_widget(item_factory, "<main>");

	main_vbox = gtk_vbox_new(FALSE, 1);
	gtk_container_border_width(GTK_CONTAINER(main_vbox), 1);
	gtk_container_add(GTK_CONTAINER(GUI_SpeedDialWindow), main_vbox);
	gtk_widget_show(main_vbox);

	gtk_box_pack_start(GTK_BOX(main_vbox), menubar, FALSE, FALSE, 0);
	gtk_widget_show(menubar);

	/* Create the toolbar */

	toolbar = gtk_toolbar_new();
	gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);
	gtk_toolbar_set_orientation(GTK_TOOLBAR(toolbar), GTK_ORIENTATION_HORIZONTAL);

	gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), NULL, _("Read from phone"), NULL,
				NewPixmap(Read_xpm, GUI_SpeedDialWindow->window,
					  &GUI_SpeedDialWindow->style->bg[GTK_STATE_NORMAL]),
				(GtkSignalFunc) ReadSpeedDial, NULL);
	gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), NULL, _("Save to phone"), NULL,
				NewPixmap(Send_xpm, GUI_SpeedDialWindow->window,
					  &GUI_SpeedDialWindow->style->bg[GTK_STATE_NORMAL]),
				(GtkSignalFunc) SaveSpeedDial, NULL);

	gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));

	gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), NULL, _("Import from file"), NULL,
				NewPixmap(Open_xpm, GUI_SpeedDialWindow->window,
					  &GUI_SpeedDialWindow->style->bg[GTK_STATE_NORMAL]),
				(GtkSignalFunc) ImportSpeedDial, NULL);
	gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), NULL, _("Export to file"), NULL,
				NewPixmap(Save_xpm, GUI_SpeedDialWindow->window,
					  &GUI_SpeedDialWindow->style->bg[GTK_STATE_NORMAL]),
				(GtkSignalFunc) ExportSpeedDial, NULL);

	gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));

	gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), NULL, _("Edit entry"), NULL,
				NewPixmap(Edit_xpm, GUI_SpeedDialWindow->window,
					  &GUI_SpeedDialWindow->style->bg[GTK_STATE_NORMAL]),
				(GtkSignalFunc) EditKey, NULL);

	gtk_box_pack_start(GTK_BOX(main_vbox), toolbar, FALSE, FALSE, 0);
	gtk_widget_show(toolbar);

	clist = gtk_clist_new_with_titles(3, titles);
	gtk_clist_set_shadow_type(GTK_CLIST(clist), GTK_SHADOW_OUT);
//  gtk_clist_set_compare_func (GTK_CLIST (clist), CListCompareFunc);
	gtk_clist_set_sort_column(GTK_CLIST(clist), 0);
	gtk_clist_set_sort_type(GTK_CLIST(clist), GTK_SORT_ASCENDING);
	gtk_clist_set_auto_sort(GTK_CLIST(clist), FALSE);
	//gtk_clist_set_selection_mode (GTK_CLIST (clist), GTK_SELECTION_EXTENDED);

	gtk_clist_set_column_width(GTK_CLIST(clist), 1, 150);
	gtk_clist_set_column_width(GTK_CLIST(clist), 2, 115);
	gtk_clist_set_column_justification(GTK_CLIST(clist), 0, GTK_JUSTIFY_CENTER);
//  gtk_clist_set_column_visibility (GTK_CLIST (clist), 3, xgnokiiConfig.callerGroupsSupported);

	for (i = 0; i < 3; i++) {
		if ((sColumn = g_malloc(sizeof(SortColumn))) == NULL) {
			g_print(_("Error: %s: line %d: Can't allocate memory!\n"), __FILE__, __LINE__);
			gtk_main_quit();
		}
		sColumn->clist = clist;
		sColumn->column = i;
		gtk_signal_connect(GTK_OBJECT(GTK_CLIST(clist)->column[i].button), "clicked",
				   GTK_SIGNAL_FUNC(SetSortColumn), (gpointer) sColumn);
	}

	gtk_signal_connect(GTK_OBJECT(clist), "select_row", GTK_SIGNAL_FUNC(ClickEntry), NULL);

	clistScrolledWindow = gtk_scrolled_window_new(NULL, NULL);
	gtk_container_add(GTK_CONTAINER(clistScrolledWindow), clist);
	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(clistScrolledWindow),
				       GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
	gtk_box_pack_start(GTK_BOX(main_vbox), clistScrolledWindow, TRUE, TRUE, 0);

	gtk_widget_show(clist);
	gtk_widget_show(clistScrolledWindow);

	questMark.pixmap = gdk_pixmap_create_from_xpm_d(GUI_SpeedDialWindow->window,
							&questMark.mask,
							&GUI_SpeedDialWindow->style->
							bg[GTK_STATE_NORMAL], quest_xpm);

	CreateErrorDialog(&errorDialog, GUI_SpeedDialWindow);
	CreateInfoDialog(&infoDialog, GUI_SpeedDialWindow);
	speedDialInitialized = FALSE;
}
Beispiel #12
0
/******************************************************************
 Opens a read window
*******************************************************************/
int read_window_open(char *folder, struct mail *mail, int window)
{
	int num;
	struct Read_Data *data;

	for (num=0; num < MAX_READ_OPEN; num++)
		if (!read_open[num]) break;

	if (num == MAX_READ_OPEN) return -1;

	if ((data = (struct Read_Data*)malloc(sizeof(struct Read_Data))))
	{
		GtkWidget *vbox;

		memset(data,0,sizeof(struct Read_Data));
		data->folder_path = mystrdup(folder);

		data->num = num;
		read_open[num] = data;

		data->wnd = gtk_window_new(GTK_WINDOW_TOPLEVEL);
		gtk_window_set_title(GTK_WINDOW(data->wnd), "SimpleMail - Read mail");
		gtk_window_set_default_size(GTK_WINDOW(data->wnd),640,400);
		gtk_window_set_position(GTK_WINDOW(data->wnd),GTK_WIN_POS_CENTER);
		gtk_signal_connect(GTK_OBJECT(data->wnd), "destroy",GTK_SIGNAL_FUNC (read_window_dispose), data);

		vbox = gtk_vbox_new(0,4);
		gtk_container_add(GTK_CONTAINER(data->wnd), vbox);

		data->toolbar = gtk_toolbar_new();
		gtk_box_pack_start(GTK_BOX(vbox), data->toolbar, FALSE, FALSE, 0 /* Padding */); /* only use minimal height */
		gtk_toolbar_append_item(GTK_TOOLBAR(data->toolbar), "Prev", "", NULL /* private TT */, create_pixmap(data->wnd,"MailPrev.xpm"), NULL /* CALLBACK */, NULL /* UDATA */);
		gtk_toolbar_append_item(GTK_TOOLBAR(data->toolbar), "Next", "", NULL /* private TT */, create_pixmap(data->wnd,"MailNext.xpm"), NULL/* CALLBACK */, NULL /* UDATA */);
		gtk_toolbar_append_space(GTK_TOOLBAR(data->toolbar));
        	gtk_toolbar_append_item(GTK_TOOLBAR(data->toolbar), "Save", "", NULL /* private TT */, create_pixmap(data->wnd,"MailSave.xpm"), NULL /* CALLBACK */, NULL /* UDATA */);
        	gtk_toolbar_append_item(GTK_TOOLBAR(data->toolbar), "Print", "", NULL /* private TT */, create_pixmap(data->wnd,"Print.xpm"), NULL /* CALLBACK */, NULL /* UDATA */);
		gtk_toolbar_append_space(GTK_TOOLBAR(data->toolbar));
        	gtk_toolbar_append_item(GTK_TOOLBAR(data->toolbar), "Delete", "", NULL /* private TT */, create_pixmap(data->wnd,"MailDelete.xpm"), NULL /* CALLBACK */, NULL /* UDATA */);
        	gtk_toolbar_append_item(GTK_TOOLBAR(data->toolbar), "Reply", "", NULL /* private TT */, create_pixmap(data->wnd,"MailReply.xpm"), NULL /* CALLBACK */, NULL /* UDATA */);
        	gtk_toolbar_append_item(GTK_TOOLBAR(data->toolbar), "Forward", "", NULL /* private TT */, create_pixmap(data->wnd,"MailForward.xpm"), NULL /* CALLBACK */, NULL /* UDATA */);

		data->text_scrolled_window = gtk_scrolled_window_new(NULL,NULL);
		gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(data->text_scrolled_window),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);

		/* create the html document */
		data->html_document = html_document_new();
		data->html_view = html_view_new();
		gtk_container_add (GTK_CONTAINER (data->text_scrolled_window), data->html_view);
		gtk_box_pack_start(GTK_BOX(vbox), data->text_scrolled_window, TRUE, TRUE, 0 /* Padding */); /* only use minimal height */
		/* FIXME: ugly ugly! sba: ??? */
		html_view_set_document (HTML_VIEW (data->html_view), data->html_document);


#if 0
		data->text_view = gtk_text_view_new();
		g_object_set(data->text_view, "editable", FALSE, NULL);
		gtk_container_add(GTK_CONTAINER(data->text_scrolled_window), data->text_view);
		gtk_box_pack_start(GTK_BOX(vbox), data->text_scrolled_window, TRUE, TRUE, 0 /* Padding */); /* only use minimal height */
#endif

		read_window_display_mail(data,mail);

		gtk_widget_show_all(data->wnd);
	}
	return num;
}
void create_vector_table_options_dialog (vector_table_options_D *dialog)
  {
  GtkWidget *tbl = NULL, *toolbar = NULL, *btn = NULL, *btnBaseRadioSource = NULL ;
  GtkAccelGroup *accel_group = NULL ;
  GtkTreeViewColumn *col = NULL ;
  GtkCellRenderer *cr = NULL ;

  accel_group = gtk_accel_group_new () ;

  dialog->dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_modal (GTK_WINDOW (dialog->dialog), TRUE);
  gtk_window_set_title (GTK_WINDOW (dialog->dialog), _("Vector Table Setup"));
  gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), TRUE) ;
  g_object_set_data (G_OBJECT (dialog->dialog), "dialog", dialog) ;

  tbl = gtk_table_new (2, 1, FALSE) ;
  gtk_widget_show (tbl) ;
  gtk_container_add (GTK_CONTAINER (dialog->dialog), tbl) ;

  toolbar = gtk_toolbar_new () ;
  gtk_widget_show (toolbar) ;
  gtk_table_attach (GTK_TABLE (tbl), toolbar, 0, 1, 0, 1,
    (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
    (GtkAttachOptions)(GTK_FILL), 0, 0) ;
  gtk_toolbar_set_orientation (GTK_TOOLBAR (toolbar), GTK_ORIENTATION_HORIZONTAL) ;
  gtk_toolbar_set_tooltips (GTK_TOOLBAR (toolbar), TRUE) ;
  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_BOTH) ;

  g_object_set_data (G_OBJECT (btn = gtk_toolbar_append_element (
    GTK_TOOLBAR (toolbar),
    GTK_TOOLBAR_CHILD_BUTTON,
    NULL,
    _("Close"),
    _("Close Window"),
    _("Close vector table editor."),
    gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_LARGE_TOOLBAR),
    (GCallback)vector_table_options_dialog_btnClose_clicked,
    NULL)),
  "dialog", dialog) ;
	gtk_widget_add_accelerator (btn, "clicked", accel_group, GDK_w, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE) ;

  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)) ;

#ifdef STDIO_FILEIO
  dialog->btnOpen =
  btn = gtk_toolbar_append_element (
    GTK_TOOLBAR (toolbar),
    GTK_TOOLBAR_CHILD_BUTTON,
    NULL,
    _("Open"),
    _("Open Vector Table"),
    _("Open and display another vector table."),
    gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_LARGE_TOOLBAR),
    (GCallback)vector_table_options_dialog_btnOpen_clicked,
    dialog) ;
	gtk_widget_add_accelerator (btn, "clicked", accel_group, GDK_o, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE) ;

  dialog->btnSave =
  btn = gtk_toolbar_append_element (
    GTK_TOOLBAR (toolbar),
    GTK_TOOLBAR_CHILD_BUTTON,
    NULL,
    _("Save"),
    _("Save Vector Table"),
    _("Save the displayed vector table."),
    gtk_image_new_from_stock (GTK_STOCK_SAVE, GTK_ICON_SIZE_LARGE_TOOLBAR),
    (GCallback)vector_table_options_dialog_btnSave_clicked,
    dialog->dialog) ;
	gtk_widget_add_accelerator (btn, "clicked", accel_group, GDK_s, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE) ;
#endif /* def STDIO_FILEIO */

  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)) ;

  g_object_set_data (G_OBJECT (
    dialog->tbtnExhaustive =
    btnBaseRadioSource = gtk_toolbar_append_element (
      GTK_TOOLBAR (toolbar),
      GTK_TOOLBAR_CHILD_RADIOBUTTON,
      NULL,
      _("Exhaustive"),
      _("Exhaustive Verification"),
      _("Attempt all possible inputs."),
      gtk_image_new_from_stock (GTK_STOCK_YES, GTK_ICON_SIZE_LARGE_TOOLBAR),
      (GCallback)vector_table_options_dialog_btnSimType_clicked,
      dialog)),
    "sim_type", (gpointer)EXHAUSTIVE_VERIFICATION) ;

  g_object_set_data (G_OBJECT (
    dialog->tbtnVT =
    gtk_toolbar_append_element (
      GTK_TOOLBAR (toolbar),
      GTK_TOOLBAR_CHILD_RADIOBUTTON,
      btnBaseRadioSource,
      _("Vector Table"),
      _("Vector Table Simulation"),
      _("Create a sequence of inputs."),
      gtk_image_new_from_stock (GTK_STOCK_NO, GTK_ICON_SIZE_LARGE_TOOLBAR),
      (GCallback)vector_table_options_dialog_btnSimType_clicked,
      dialog)),
    "sim_type", (gpointer)VECTOR_TABLE) ;

  dialog->tblVT = gtk_table_new (1, 2, FALSE) ;
  gtk_widget_show (dialog->tblVT) ;
  gtk_table_attach (GTK_TABLE (tbl), dialog->tblVT, 0, 1, 1, 2,
    (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
    (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0) ;

  toolbar = gtk_toolbar_new () ;
  gtk_widget_show (toolbar) ;
  gtk_table_attach (GTK_TABLE (dialog->tblVT), toolbar, 0, 1, 0, 1,
    (GtkAttachOptions)(GTK_FILL),
    (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0) ;
  gtk_toolbar_set_orientation (GTK_TOOLBAR (toolbar), GTK_ORIENTATION_VERTICAL) ;
  gtk_toolbar_set_tooltips (GTK_TOOLBAR (toolbar), TRUE) ;
  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS) ;

  dialog->btnAdd =
  btn = gtk_toolbar_append_element (
    GTK_TOOLBAR (toolbar),
    GTK_TOOLBAR_CHILD_BUTTON,
    NULL,
    _("Add"),
    _("Add Vector"),
    _("Apend a vector to the end of the table."),
    gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_LARGE_TOOLBAR),
    (GCallback)vector_table_options_dialog_btnAdd_clicked,
    dialog->dialog) ;

  dialog->btnInsert =
  btn = gtk_toolbar_append_element (
    GTK_TOOLBAR (toolbar),
    GTK_TOOLBAR_CHILD_BUTTON,
    NULL,
    _("Insert Before"),
    _("Insert Vector Before"),
    _("Insert vector before the selected one."),
    gtk_image_new_from_stock (QCAD_STOCK_INSERT_COL_BEFORE, GTK_ICON_SIZE_LARGE_TOOLBAR),
    (GCallback)vector_table_options_dialog_btnAdd_clicked,
    dialog->dialog) ;

  dialog->btnDelete =
  btn = gtk_toolbar_append_element (
    GTK_TOOLBAR (toolbar),
    GTK_TOOLBAR_CHILD_BUTTON,
    NULL,
    _("Delete Vector"),
    _("Delete Vector"),
    _("Insert the selected vector."),
    gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_LARGE_TOOLBAR),
    (GCallback)vector_table_options_dialog_btnDelete_clicked,
    dialog->dialog) ;

  dialog->sw = qcad_tree_view_container_new () ;
  gtk_widget_show (dialog->sw) ;
  gtk_table_attach (GTK_TABLE (dialog->tblVT), dialog->sw, 1, 2, 0, 1,
    (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
    (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 2, 2) ;
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (dialog->sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC) ;
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (dialog->sw), GTK_SHADOW_IN) ;

  dialog->tv = create_bus_layout_tree_view (TRUE, _("Inputs"), GTK_SELECTION_SINGLE) ;
  gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->tv), col = gtk_tree_view_column_new ()) ;
  gtk_tree_view_column_set_title (col, _("Active")) ;
  gtk_tree_view_column_pack_start (col, cr = dialog->crActive = gtk_cell_renderer_toggle_new (), TRUE) ;
  gtk_tree_view_column_add_attribute (col, cr, "active", VECTOR_TABLE_MODEL_COLUMN_ACTIVE) ;
  g_object_set (G_OBJECT (cr), "activatable", TRUE, NULL) ;
  gtk_cell_renderer_toggle_set_active (GTK_CELL_RENDERER_TOGGLE (cr), TRUE) ;
  gtk_widget_show (dialog->tv) ;
  gtk_container_add (GTK_CONTAINER (dialog->sw), dialog->tv) ;
  qcad_tree_view_container_freeze_columns (QCAD_TREE_VIEW_CONTAINER (dialog->sw), 2) ;

  g_signal_connect (G_OBJECT (dialog->tv),     "style-set",    (GCallback)tree_view_style_set,                          NULL) ;
  g_signal_connect (G_OBJECT (cr),             "toggled",      (GCallback)vt_model_active_toggled,                      dialog->tv) ;
  g_signal_connect (G_OBJECT (dialog->dialog), "delete-event", (GCallback)vector_table_options_dialog_btnClose_clicked, NULL) ;

  gtk_window_add_accel_group (GTK_WINDOW (dialog->dialog), accel_group) ;
  }
Beispiel #14
0
GtkWidget*
get_viewer_toolbar(GtkWidget *parent)
{
   GtkWidget *toolbar, *pixmap_wid, *button;
   GdkPixmap *pixmap;
   GdkBitmap *mask;
   GtkStyle *style;
   gboolean fit_screen;

   style = gtk_widget_get_style(parent);
   toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
   gtk_tooltips_set_colors(
      GTK_TOOLBAR(toolbar)->tooltips,
      get_viewer_tooltips_bgcolor(parent->window, gdk_window_get_colormap(parent->window)),
      &style->fg[GTK_STATE_NORMAL]);
   gtk_tooltips_set_delay(GTK_TOOLBAR(toolbar)->tooltips, 100);

   pixmap = gdk_pixmap_create_from_xpm_d(
      parent->window,
      &mask, &style->bg[GTK_STATE_NORMAL],
      (gchar **)browse_xpm);
   pixmap_wid = gtk_pixmap_new(pixmap, mask);
   gtk_widget_show(pixmap_wid);
   gtk_toolbar_append_item(
      GTK_TOOLBAR(toolbar),
      NULL, _("Browse"), NULL,
      pixmap_wid,
      GTK_SIGNAL_FUNC(viewer_toolbar_browse),
      NULL);

   pixmap = gdk_pixmap_create_from_xpm_d(
      parent->window,
      &mask, &style->bg[GTK_STATE_NORMAL],
      (gchar **)fullscreen_xpm);
   pixmap_wid = gtk_pixmap_new(pixmap, mask);
   gtk_widget_show(pixmap_wid);
   gtk_toolbar_append_item(
      GTK_TOOLBAR(toolbar),
      NULL, _("Full screen"), NULL,
      pixmap_wid,
      GTK_SIGNAL_FUNC(viewer_toolbar_full_screen),
      NULL);

   gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));

   pixmap = gdk_pixmap_create_from_xpm_d(
      parent->window,
      &mask, &style->bg[GTK_STATE_NORMAL],
      (gchar **)save_image_xpm);
   pixmap_wid = gtk_pixmap_new(pixmap, mask);
   gtk_widget_show(pixmap_wid);
   saveimage_button = gtk_toolbar_append_item(
      GTK_TOOLBAR(toolbar),
      NULL, _("Save Image"), NULL,
      pixmap_wid,
      GTK_SIGNAL_FUNC(viewer_toolbar_save_image),
      NULL);

   gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));

   pixmap = gdk_pixmap_create_from_xpm_d(
      parent->window,
      &mask, &style->bg[GTK_STATE_NORMAL],
      (gchar **)prev_image_xpm);
   pixmap_wid = gtk_pixmap_new(pixmap, mask);
   gtk_widget_show(pixmap_wid);
   prev_button = gtk_toolbar_append_item(
      GTK_TOOLBAR(toolbar),
      NULL, _("Previous Image"), NULL,
      pixmap_wid,
      GTK_SIGNAL_FUNC(viewer_toolbar_prev_image),
      NULL);

   pixmap = gdk_pixmap_create_from_xpm_d(
      parent->window,
      &mask, &style->bg[GTK_STATE_NORMAL],
      (gchar **)next_image_xpm);
   pixmap_wid = gtk_pixmap_new(pixmap, mask);
   gtk_widget_show(pixmap_wid);
   next_button = gtk_toolbar_append_item(
      GTK_TOOLBAR(toolbar),
      NULL, _("Next Image"), NULL,
      pixmap_wid,
      GTK_SIGNAL_FUNC(viewer_toolbar_next_image),
      NULL);

   pixmap = gdk_pixmap_create_from_xpm_d(
      parent->window,
      &mask, &style->bg[GTK_STATE_NORMAL],
      (gchar **)slideshow_xpm);
   pixmap_wid = gtk_pixmap_new(pixmap, mask);
   gtk_widget_show(pixmap_wid);
   slideshow_button = gtk_toolbar_append_element(
      GTK_TOOLBAR(toolbar),
      GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
      NULL,
      NULL,
      _("Stop/Resume Slideshow"), NULL,
      pixmap_wid,
      GTK_SIGNAL_FUNC(viewer_toolbar_slideshow_toggled),
      NULL);

   gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));

   pixmap = gdk_pixmap_create_from_xpm_d(
      parent->window,
      &mask, &style->bg[GTK_STATE_NORMAL],
      (gchar **)refresh_xpm);
   pixmap_wid = gtk_pixmap_new(pixmap, mask);
   gtk_widget_show(pixmap_wid);
   gtk_toolbar_append_item(
      GTK_TOOLBAR(toolbar),
      NULL, _("Refresh"), NULL,
      pixmap_wid,
      GTK_SIGNAL_FUNC(viewer_toolbar_refresh),
      NULL);

   pixmap = gdk_pixmap_create_from_xpm_d(
      parent->window,
      &mask, &style->bg[GTK_STATE_NORMAL],
      (gchar **)screen_xpm);
   pixmap_wid = gtk_pixmap_new(pixmap, mask);
   gtk_widget_show(pixmap_wid);
   button = gtk_toolbar_append_element(
      GTK_TOOLBAR(toolbar),
      GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
      NULL,
      NULL,
      _("Fit Screen"), NULL,
      pixmap_wid,
      GTK_SIGNAL_FUNC(viewer_toolbar_fitscreen_toggled),
      NULL);
   fit_screen = rc_get_boolean("fit_screen");
   gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), fit_screen);

   gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));

   pixmap = gdk_pixmap_create_from_xpm_d(
      parent->window,
      &mask, &style->bg[GTK_STATE_NORMAL],
      (gchar **)rotate_left_xpm);
   pixmap_wid = gtk_pixmap_new(pixmap, mask);
   gtk_widget_show(pixmap_wid);
   gtk_toolbar_append_item(
      GTK_TOOLBAR(toolbar),
      NULL,
      _("Rotate -90"), NULL,
      pixmap_wid,
      GTK_SIGNAL_FUNC(viewer_toolbar_rotate),
      (gint *) LEFT);

   pixmap = gdk_pixmap_create_from_xpm_d(
      parent->window,
      &mask, &style->bg[GTK_STATE_NORMAL],
      (gchar **)rotate_right_xpm);
   pixmap_wid = gtk_pixmap_new(pixmap, mask);
   gtk_widget_show(pixmap_wid);
   gtk_toolbar_append_item(
      GTK_TOOLBAR(toolbar),
      NULL,
      _("Rotate +90"), NULL,
      pixmap_wid,
      GTK_SIGNAL_FUNC(viewer_toolbar_rotate),
      (gint *) RIGHT);

   gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));

   pixmap = gdk_pixmap_create_from_xpm_d(
      parent->window,
      &mask, &style->bg[GTK_STATE_NORMAL],
      (gchar **)right_left_xpm);
   pixmap_wid = gtk_pixmap_new(pixmap, mask);
   gtk_widget_show(pixmap_wid);
   gtk_toolbar_append_item(
      GTK_TOOLBAR(toolbar),
      NULL,
      _("Reflect Right/Left"), NULL,
      pixmap_wid,
      GTK_SIGNAL_FUNC(viewer_toolbar_reflect),
      (gint *) RIGHTLEFT);

   pixmap = gdk_pixmap_create_from_xpm_d(
      parent->window,
      &mask, &style->bg[GTK_STATE_NORMAL],
      (gchar **)up_down_xpm);
   pixmap_wid = gtk_pixmap_new(pixmap, mask);
   gtk_widget_show(pixmap_wid);
   gtk_toolbar_append_item(
      GTK_TOOLBAR(toolbar),
      NULL,
      _("Reflect Up/Down"), NULL,
      pixmap_wid,
      GTK_SIGNAL_FUNC(viewer_toolbar_reflect),
      (gint *) UPDOWN);

   gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));

   pixmap = gdk_pixmap_create_from_xpm_d(
      parent->window,
      &mask, &style->bg[GTK_STATE_NORMAL],
      (gchar **)exit_xpm);
   pixmap_wid = gtk_pixmap_new(pixmap, mask);
   gtk_widget_show(pixmap_wid);
   gtk_toolbar_append_item(
      GTK_TOOLBAR(toolbar),
      NULL,
      _("Exit"), NULL,
      pixmap_wid,
      GTK_SIGNAL_FUNC(close_gtksee),
      NULL);

   return toolbar;
}
Beispiel #15
0
static VALUE
rg_append_space(VALUE self)
{
    gtk_toolbar_append_space(_SELF(self));
    return self;
}
Beispiel #16
0
/*! \todo Finish function documentation!!!
 *  \brief
 *  \par Function Description
 *
 */
void x_window_create_main(GschemToplevel *w_current)
{
  TOPLEVEL *toplevel = gschem_toplevel_get_toplevel (w_current);

  GtkPolicyType policy;
  GtkWidget *main_box=NULL;
  GtkWidget *menubar=NULL;
  GtkWidget *toolbar=NULL;
  GtkWidget *handlebox=NULL;
  GtkWidget *hscrollbar;
  GtkWidget *vscrollbar;
  GtkAdjustment *hadjustment;
  GtkAdjustment *vadjustment;
  char *right_button_text;

  /* used to signify that the window isn't mapped yet */
  w_current->window = NULL;

  w_current->main_window = GTK_WIDGET (gschem_main_window_new ());

  gtk_widget_set_name (w_current->main_window, "gschem");
  gtk_window_set_policy (GTK_WINDOW (w_current->main_window), TRUE, TRUE, TRUE);

  /* We want the widgets to flow around the drawing area, so we don't
   * set a size of the main window.  The drawing area's size is fixed,
   * see below
   */

   /*
    * normally we let the window manager handle locating and sizing
    * the window.  However, for some batch processing of schematics
    * (generating a pdf of all schematics for example) we want to
    * override this.  Hence "auto_place_mode".
    */
   if( auto_place_mode )
   	gtk_widget_set_uposition (w_current->main_window, 10, 10);

  /* this should work fine */
  g_signal_connect (G_OBJECT (w_current->main_window), "delete_event",
                    G_CALLBACK (i_callback_close_wm),
                    w_current);

  /* Containers first */
  main_box = gtk_vbox_new(FALSE, 1);
  gtk_container_border_width(GTK_CONTAINER(main_box), 0);
  gtk_container_add(GTK_CONTAINER(w_current->main_window), main_box);

  menubar = get_main_menu (w_current);
  if (w_current->handleboxes) {
  	handlebox = gtk_handle_box_new ();
  	gtk_box_pack_start(GTK_BOX(main_box), handlebox, FALSE, FALSE, 0);
  	gtk_container_add (GTK_CONTAINER (handlebox), menubar);
  } else {
  	gtk_box_pack_start(GTK_BOX(main_box), menubar, FALSE, FALSE, 0);
  }

  w_current->menubar = menubar;
  gtk_widget_realize (w_current->main_window);

  if (w_current->handleboxes && w_current->toolbars) {
  	handlebox = gtk_handle_box_new ();
  	gtk_box_pack_start (GTK_BOX (main_box), handlebox, FALSE, FALSE, 0);
  }

  if (w_current->toolbars) {
    toolbar = gtk_toolbar_new();
    gtk_toolbar_set_orientation (GTK_TOOLBAR(toolbar),
                                 GTK_ORIENTATION_HORIZONTAL);
    gtk_toolbar_set_style (GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);

    if (w_current->handleboxes) {
      gtk_container_add (GTK_CONTAINER (handlebox), toolbar);
    } else {
      gtk_box_pack_start(GTK_BOX(main_box), toolbar, FALSE, FALSE, 0);
    }

    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
                             _("New"),
                             _("New file"),
                             "toolbar/new",
                             x_window_stock_pixmap("new", w_current),
                             (GtkSignalFunc) i_callback_toolbar_file_new,
                             w_current);
    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
                             _("Open"),
                             _("Open file..."),
                             "toolbar/open",
                             x_window_stock_pixmap("open", w_current),
                             (GtkSignalFunc) i_callback_toolbar_file_open,
                             w_current);
    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
                             _("Save"),
                             _("Save file"),
                             "toolbar/save",
                             x_window_stock_pixmap("save", w_current),
                             (GtkSignalFunc) i_callback_toolbar_file_save,
                             w_current);
    gtk_toolbar_append_space (GTK_TOOLBAR(toolbar));
    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
                             _("Undo"),
                             _("Undo last operation"),
                             "toolbar/undo",
                             x_window_stock_pixmap("undo", w_current),
                             (GtkSignalFunc) i_callback_toolbar_edit_undo,
                             w_current);
    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
                             _("Redo"),
                             _("Redo last undo"),
                             "toolbar/redo",
                             x_window_stock_pixmap("redo", w_current),
                             (GtkSignalFunc) i_callback_toolbar_edit_redo,
                             w_current);
    gtk_toolbar_append_space (GTK_TOOLBAR(toolbar));
    /* not part of any radio button group */
    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
                             _("Component"),
                             _("Add component...\nSelect library and component from list, move the mouse into main window, click to place\nRight mouse button to cancel"),
                             "toolbar/component",
                             x_window_stock_pixmap("insert-symbol", w_current),
                             (GtkSignalFunc) i_callback_toolbar_add_component,
                             w_current);
    w_current->toolbar_net =
      gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
                                 GTK_TOOLBAR_CHILD_RADIOBUTTON,
                                 NULL,
                                 _("Nets"),
                                 _("Add nets mode\nRight mouse button to cancel"),
                                 "toolbar/nets",
                                 x_window_stock_pixmap("insert-net", w_current),
                                 (GtkSignalFunc) i_callback_toolbar_add_net,
                                 w_current);
    w_current->toolbar_bus =
      gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
                                 GTK_TOOLBAR_CHILD_RADIOBUTTON,
                                 w_current->toolbar_net,
                                 _("Bus"),
                                 _("Add buses mode\nRight mouse button to cancel"),
                                 "toolbar/bus",
                                 x_window_stock_pixmap("insert-bus", w_current),
                                 (GtkSignalFunc) i_callback_toolbar_add_bus,
                                 w_current);
    /* not part of any radio button group */
    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
                             _("Text"),
                             _("Add Text..."),
                             "toolbar/text",
                             x_window_stock_pixmap("insert-text", w_current),
                             (GtkSignalFunc) i_callback_toolbar_add_text,
                             w_current);
    gtk_toolbar_append_space (GTK_TOOLBAR(toolbar));
    w_current->toolbar_select =
      gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
                                 GTK_TOOLBAR_CHILD_RADIOBUTTON,
                                 w_current->toolbar_bus,
                                 _("Select"),
                                 _("Select mode"),
                                 "toolbar/select",
                                 x_window_stock_pixmap("select", w_current),
                                 (GtkSignalFunc) i_callback_toolbar_edit_select,
                                 w_current);


    gtk_toolbar_append_space (GTK_TOOLBAR(toolbar));
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w_current->toolbar_select),
                                 TRUE);
  }


  /*  Try to create popup menu (appears in right mouse button  */
  w_current->popup_menu = (GtkWidget *) get_main_popup(w_current);


  /* Setup a GtkScrolledWindow for the drawing area */
  hadjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.0,
                                                    0.0,
                                                    toplevel->init_right,
                                                    100.0,
                                                    100.0,
                                                    10.0));

  vadjustment = GTK_ADJUSTMENT (gtk_adjustment_new (toplevel->init_bottom,
                                                    0.0,
                                                    toplevel->init_bottom,
                                                    100.0,
                                                    100.0,
                                                    10.0));

  w_current->scrolled = gtk_scrolled_window_new (hadjustment, vadjustment);
  gtk_container_add(GTK_CONTAINER(main_box), w_current->scrolled);
  x_window_create_drawing(w_current->scrolled, w_current);
  x_window_setup_draw_events(w_current);

  policy = (w_current->scrollbars_flag) ? GTK_POLICY_ALWAYS : GTK_POLICY_NEVER;
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (w_current->scrolled), policy, policy);

  hscrollbar = gtk_scrolled_window_get_hscrollbar (GTK_SCROLLED_WINDOW (w_current->scrolled));
  gtk_range_set_update_policy (GTK_RANGE (hscrollbar), GTK_UPDATE_CONTINUOUS);

  vscrollbar = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (w_current->scrolled));
  gtk_range_set_update_policy (GTK_RANGE (vscrollbar), GTK_UPDATE_CONTINUOUS);

  /* macro box */
  w_current->macro_widget = GTK_WIDGET (g_object_new (GSCHEM_TYPE_MACRO_WIDGET, NULL));

  gtk_box_pack_start (GTK_BOX (main_box),
                      w_current->macro_widget,
                      FALSE,
                      FALSE,
                      0);

  g_signal_connect (w_current->macro_widget,
                    "response",
                    G_CALLBACK (&x_window_invoke_macro),
                    w_current);

  /* bottom box */
  if (default_third_button == POPUP_ENABLED) {
    right_button_text = _("Menu/Cancel");
  } else {
    right_button_text = _("Pan/Cancel");
  }

  w_current->bottom_widget = GTK_WIDGET (g_object_new (GSCHEM_TYPE_BOTTOM_WIDGET,
      "grid-mode",          gschem_options_get_grid_mode (w_current->options),
      "grid-size",          gschem_options_get_snap_size (w_current->options), /* x_grid_query_drawn_spacing (w_current), -- occurs before the page is set */
      "left-button-text",   _("Pick"),
      "middle-button-text", _("none"),
      "right-button-text",  right_button_text,
      "snap-mode",          gschem_options_get_snap_mode (w_current->options),
      "snap-size",          gschem_options_get_snap_size (w_current->options),
      "status-text",        _("Select Mode"),
      NULL));

  i_update_middle_button (w_current, NULL, NULL);

  gtk_box_pack_start (GTK_BOX (main_box), w_current->bottom_widget, FALSE, FALSE, 0);

  gtk_widget_show_all (w_current->main_window);

  w_current->window = w_current->drawing_area->window;

  w_current->drawable = w_current->window;

  x_window_setup_gc(w_current);
}
Beispiel #17
0
GtkWidget *create_main_toolbar(GtkWidget *parent, MainToolbar *toolbar) {
  GtkWidget *toolbar1;
  GtkWidget *toolbar_newf;
  GtkWidget *toolbar_open;
  GtkWidget *toolbar_save;
  GtkWidget *toolbar_zplus;
  GtkWidget *toolbar_yplus;
  GtkWidget *toolbar_yminus;
  GtkWidget *toolbar_xplus;
  GtkWidget *toolbar_xminus;
  GtkWidget *toolbar_iso;
  GtkWidget *toolbar_target;
  GtkWidget *toolbar_abox;
  GtkWidget *toolbar_apyr;
  GtkWidget *toolbar_atel;
  GtkWidget *toolbar_alnk;
  GtkWidget *toolbar_abas;
  GtkWidget *toolbar_slider;

  GtkTooltips *tooltips;
  GtkWidget *tmp_toolbar_icon;
  GtkAdjustment *sa;

  tooltips = gtk_tooltips_new();

  toolbar1 = gtk_toolbar_new();
  gtk_toolbar_set_orientation(GTK_TOOLBAR(toolbar1), GTK_ORIENTATION_HORIZONTAL);
  gtk_widget_ref(toolbar1);
  gtk_widget_show(toolbar1);

  tmp_toolbar_icon = gtk_image_new_from_stock(GTK_STOCK_NEW, GTK_ICON_SIZE_SMALL_TOOLBAR);
  toolbar_newf = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Create a new BZFlag world"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_newf);
  gtk_widget_show(toolbar_newf);

  tmp_toolbar_icon = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_SMALL_TOOLBAR);
  toolbar_open = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Open a BZFlag world"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_open);
  gtk_widget_show(toolbar_open);

  tmp_toolbar_icon = gtk_image_new_from_stock(GTK_STOCK_SAVE, GTK_ICON_SIZE_SMALL_TOOLBAR);
  toolbar_save = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Save the current world"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_save);
  gtk_widget_show(toolbar_save);

  gtk_toolbar_append_space(GTK_TOOLBAR(toolbar1));

  tmp_toolbar_icon = gnome_pixmap_new_from_xpm_d(TB::zplus_xpm);
  toolbar_zplus = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("View from above"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_zplus);
  gtk_widget_show(toolbar_zplus);

  gtk_toolbar_append_space(GTK_TOOLBAR(toolbar1));

  tmp_toolbar_icon = gnome_pixmap_new_from_xpm_d(TB::yplus_xpm);
  toolbar_yplus = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("View from +Y"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_yplus);
  gtk_widget_show(toolbar_yplus);

  tmp_toolbar_icon = gnome_pixmap_new_from_xpm_d(TB::yminus_xpm);
  toolbar_yminus = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("View from -Y"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_yminus);
  gtk_widget_show(toolbar_yminus);

  gtk_toolbar_append_space(GTK_TOOLBAR(toolbar1));

  tmp_toolbar_icon = gnome_pixmap_new_from_xpm_d(TB::xplus_xpm);
  toolbar_xplus = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("View from +X"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_xplus);
  gtk_widget_show(toolbar_xplus);

  tmp_toolbar_icon = gnome_pixmap_new_from_xpm_d(TB::xminus_xpm);
  toolbar_xminus = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("View from -X"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_xminus);
  gtk_widget_show(toolbar_xminus);

  gtk_toolbar_append_space(GTK_TOOLBAR(toolbar1));

  tmp_toolbar_icon = gnome_pixmap_new_from_xpm_d(TB::iso_xpm);
  toolbar_iso = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Isometric view"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_iso);
  gtk_widget_show(toolbar_iso);

  gtk_toolbar_append_space(GTK_TOOLBAR(toolbar1));

  tmp_toolbar_icon = gnome_pixmap_new_from_xpm_d(TB::target_xpm);
  toolbar_target = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Center view on (0, 0, 0)"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_target);
  gtk_widget_show(toolbar_target);

  gtk_toolbar_append_space(GTK_TOOLBAR(toolbar1));

  tmp_toolbar_icon = gnome_pixmap_new_from_xpm_d(TB::addbox_xpm);
  toolbar_abox = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Add a box"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_abox);
  gtk_widget_show(toolbar_abox);

  tmp_toolbar_icon = gnome_pixmap_new_from_xpm_d(TB::addpyr_xpm);
  toolbar_apyr = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Add a pyramid"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_apyr);
  gtk_widget_show(toolbar_apyr);

  tmp_toolbar_icon = gnome_pixmap_new_from_xpm_d(TB::addtele_xpm);
  toolbar_atel = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Add a teleporter"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_atel);
  gtk_widget_show(toolbar_atel);
 
  tmp_toolbar_icon = gnome_pixmap_new_from_xpm_d(TB::addlink_xpm);
  toolbar_alnk = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Add a link"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_alnk);
  gtk_widget_show(toolbar_alnk);
 
  tmp_toolbar_icon = gnome_pixmap_new_from_xpm_d(TB::addbase_xpm);
  toolbar_abas = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Add a base"), NULL, tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref(toolbar_abas);
  gtk_widget_show(toolbar_abas);

  sa = GTK_ADJUSTMENT(gtk_adjustment_new(100.0, 0.0, 100.0, 1.0, 10.0, 0.0));
  toolbar_slider = gtk_hscale_new(sa);
  gtk_widget_set_size_request(toolbar_slider, 75, -1);
  gtk_scale_set_draw_value(GTK_SCALE(toolbar_slider), FALSE);
  gtk_toolbar_append_widget(GTK_TOOLBAR(toolbar1), toolbar_slider, NULL, NULL);
  gtk_tooltips_set_tip(GTK_TOOLTIPS(tooltips), toolbar_slider, _("Transparency"), NULL);
  gtk_widget_ref(toolbar_slider);
  gtk_widget_show(toolbar_slider);

  gtk_signal_connect(GTK_OBJECT(toolbar_newf), "clicked", GTK_SIGNAL_FUNC(CB::MW::newf), NULL);
  gtk_signal_connect(GTK_OBJECT(toolbar_open), "clicked", GTK_SIGNAL_FUNC(CB::MW::open), NULL);
  gtk_signal_connect(GTK_OBJECT(toolbar_save), "clicked", GTK_SIGNAL_FUNC(CB::MW::save), NULL);
  gtk_signal_connect(GTK_OBJECT(toolbar_zplus), "clicked", GTK_SIGNAL_FUNC(CB::MW::tb_zplus), NULL);
  gtk_signal_connect(GTK_OBJECT(toolbar_yplus), "clicked", GTK_SIGNAL_FUNC(CB::MW::tb_yplus), NULL);
  gtk_signal_connect(GTK_OBJECT(toolbar_yminus), "clicked", GTK_SIGNAL_FUNC(CB::MW::tb_yminus), NULL);
  gtk_signal_connect(GTK_OBJECT(toolbar_xplus), "clicked", GTK_SIGNAL_FUNC(CB::MW::tb_xplus), NULL);
  gtk_signal_connect(GTK_OBJECT(toolbar_xminus), "clicked", GTK_SIGNAL_FUNC(CB::MW::tb_xminus), NULL);
  gtk_signal_connect(GTK_OBJECT(toolbar_iso), "clicked", GTK_SIGNAL_FUNC(CB::MW::tb_iso), NULL);
  gtk_signal_connect(GTK_OBJECT(toolbar_target), "clicked", GTK_SIGNAL_FUNC(CB::MW::tb_target), NULL);
  gtk_signal_connect(GTK_OBJECT(toolbar_abox), "clicked", GTK_SIGNAL_FUNC(CB::MW::tb_addbox), NULL);
  gtk_signal_connect(GTK_OBJECT(toolbar_apyr), "clicked", GTK_SIGNAL_FUNC(CB::MW::tb_addpyr), NULL);
  gtk_signal_connect(GTK_OBJECT(toolbar_atel), "clicked", GTK_SIGNAL_FUNC(CB::MW::tb_addtel), NULL);
  gtk_signal_connect(GTK_OBJECT(toolbar_alnk), "clicked", GTK_SIGNAL_FUNC(CB::MW::tb_addlnk), NULL);
  gtk_signal_connect(GTK_OBJECT(toolbar_abas), "clicked", GTK_SIGNAL_FUNC(CB::MW::tb_addbas), NULL);
  gtk_signal_connect(GTK_OBJECT(sa), "value_changed", GTK_SIGNAL_FUNC(CB::MW::tb_trans), NULL);
  gtk_signal_connect(GTK_OBJECT(sa), "changed", GTK_SIGNAL_FUNC(CB::MW::tb_trans), NULL);

  toolbar->toolbar = toolbar1;
  toolbar->newf = toolbar_newf;
  toolbar->open = toolbar_open;
  toolbar->save = toolbar_save;
  toolbar->zplus = toolbar_zplus;
  toolbar->yplus = toolbar_yplus;
  toolbar->yminus = toolbar_yminus;
  toolbar->xplus = toolbar_xplus;
  toolbar->xminus = toolbar_xminus;
  toolbar->iso = toolbar_iso;
  toolbar->target = toolbar_target;
  toolbar->abox = toolbar_abox;
  toolbar->apyr = toolbar_apyr;
  toolbar->atel = toolbar_atel;
  toolbar->alnk = toolbar_alnk;
  toolbar->abas = toolbar_abas;
  toolbar->slider = toolbar_slider;

  return toolbar1;
}