Changeset 70
- Timestamp:
- 04/15/06 11:20:14 (3 years ago)
- Location:
- trunk/src/gtk
- Files:
-
- 2 modified
-
MainView.cxx (modified) (5 diffs)
-
MainView.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gtk/MainView.cxx
r69 r70 47 47 static void main_window_quit_cb (GtkWidget *, gpointer); 48 48 static void main_window_show_sidebar_cb (GtkToggleAction *, gpointer); 49 static void main_window_show_statusbar_cb (GtkToggleAction *, gpointer); 50 static void main_window_show_toolbar_cb (GtkToggleAction *, gpointer); 49 51 static void main_window_zoom_fit_cb (GtkWidget *, gpointer); 50 52 static void main_window_zoom_in_cb (GtkWidget *, gpointer); … … 121 123 { "ShowToolBar", NULL, N_("Show _Toolbar"), NULL, 122 124 N_("Show or hidde the toolbar"), 123 NULL, TRUE },125 G_CALLBACK (main_window_show_toolbar_cb), TRUE }, 124 126 { "ShowStatusBar", NULL, N_("Show _Statusbar"), NULL, 125 127 N_("Show or hidde the statusbar"), 126 NULL, TRUE },128 G_CALLBACK (main_window_show_statusbar_cb), TRUE }, 127 129 { "ShowSideBar", NULL, N_("Show O_utline"), NULL, 128 130 N_("Show or hidde the document's outline"), … … 175 177 // The status bar don't do anything, yet. But without the application 176 178 // look weird. 177 GtkWidget *statusBar = gtk_statusbar_new ();178 gtk_box_pack_start (GTK_BOX (m_MainBox), statusBar, FALSE, FALSE, 0);179 gtk_widget_show ( statusBar);179 m_StatusBar = gtk_statusbar_new (); 180 gtk_box_pack_start (GTK_BOX (m_MainBox), m_StatusBar, FALSE, FALSE, 0); 181 gtk_widget_show (m_StatusBar); 180 182 } 181 183 … … 665 667 child = outline->getNextChild (); 666 668 } 669 } 670 } 671 672 /// 673 /// @brief Shows or hiddes the status bar. 674 /// 675 /// @param show Set to TRUE to show the status bar. FALSE otherwise. 676 /// 677 void 678 MainView::showStatusbar (gboolean show) 679 { 680 if ( show ) 681 { 682 gtk_widget_show (m_StatusBar); 683 } 684 else 685 { 686 gtk_widget_hide (m_StatusBar); 687 } 688 } 689 690 /// 691 /// @brief Shows or hiddes the tool bar. 692 /// 693 /// @param show Set to TRUE to show the tool bar. FALSE otherwise. 694 /// 695 void 696 MainView::showToolbar (gboolean show) 697 { 698 GtkWidget *toolBar = gtk_ui_manager_get_widget (m_UIManager, "/ToolBar"); 699 if ( show ) 700 { 701 gtk_widget_show (toolBar); 702 } 703 else 704 { 705 gtk_widget_hide (toolBar); 667 706 } 668 707 } … … 865 904 866 905 /// 906 /// @brief Called when the user clicks on the "Show Statusbar" action. 907 /// 908 void 909 main_window_show_statusbar_cb (GtkToggleAction *action, gpointer data) 910 { 911 g_assert ( NULL != data && "The data parameter is NULL."); 912 913 MainView *view = (MainView *)data; 914 view->showStatusbar (gtk_toggle_action_get_active (action)); 915 } 916 917 /// 918 /// @brief Called when the user clicks on the "Show Toolbar" action. 919 /// 920 void 921 main_window_show_toolbar_cb (GtkToggleAction *action, gpointer data) 922 { 923 g_assert ( NULL != data && "The data parameter is NULL."); 924 925 MainView *view = (MainView *)data; 926 view->showToolbar (gtk_toggle_action_get_active (action)); 927 } 928 929 /// 867 930 /// @brief The user tries to fit the document into the window. 868 931 /// -
trunk/src/gtk/MainView.h
r67 r70 57 57 void setOutline (DocumentOutline *outline); 58 58 59 void showToolbar (gboolean show); 60 void showStatusbar (gboolean show); 61 59 62 protected: 60 63 GtkWidget *m_CurrentPage; … … 66 69 GtkWidget *m_PageViewScroll; 67 70 GtkWidget *m_Sidebar; 71 GtkWidget *m_StatusBar; 68 72 gint m_TotalPages; 69 73 GtkUIManager *m_UIManager;
