Changeset 36 for trunk/src/gtk/MainView.cxx
- Timestamp:
- 04/12/06 06:33:09 (3 years ago)
- Files:
-
- 1 modified
-
trunk/src/gtk/MainView.cxx (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gtk/MainView.cxx
r35 r36 26 26 27 27 // Forward delarations. 28 static void main_window_go_to_first_page_cb (GtkWidget *, gpointer); 29 static void main_window_go_to_last_page_cb (GtkWidget *, gpointer); 30 static void main_window_go_to_next_page_cb (GtkWidget *, gpointer); 31 static void main_window_go_to_previous_page_cb (GtkWidget *, gpointer); 28 32 static void main_window_open_file_cb (GtkWidget *, gpointer); 29 33 static void main_window_quit_cb (GtkWidget *, gpointer); … … 60 64 MainView::~MainView () 61 65 { 66 g_object_unref (G_OBJECT (m_UIManager)); 62 67 } 63 68 … … 92 97 MainView::sensitiveGoToFirstPage (gboolean sensitive) 93 98 { 99 GtkAction *goToFirstPage = gtk_ui_manager_get_action (m_UIManager, 100 "/MenuBar/GoMenu/GoToFirstPage"); 101 gtk_action_set_sensitive (goToFirstPage, sensitive); 94 102 } 95 103 … … 97 105 MainView::sensitiveGoToLastPage (gboolean sensitive) 98 106 { 107 GtkAction *goToLastPage = 108 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/GoMenu/GoToLastPage"); 109 gtk_action_set_sensitive (goToLastPage, sensitive); 99 110 } 100 111 … … 102 113 MainView::sensitiveGoToNextPage (gboolean sensitive) 103 114 { 115 GtkAction *goToNextPage = 116 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/GoMenu/GoToNextPage"); 117 gtk_action_set_sensitive (goToNextPage, sensitive); 104 118 } 105 119 … … 112 126 MainView::sensitiveGoToPreviousPage (gboolean sensitive) 113 127 { 128 GtkAction *goToPreviousPage = gtk_ui_manager_get_action (m_UIManager, 129 "/MenuBar/GoMenu/GoToPreviousPage"); 130 gtk_action_set_sensitive (goToPreviousPage, sensitive); 131 } 132 133 void 134 MainView::sensitiveRotateLeft (gboolean sensitive) 135 { 136 GtkAction *rotateLeft = 137 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/ViewMenu/RotateLeft"); 138 gtk_action_set_sensitive (rotateLeft, sensitive); 139 } 140 141 void 142 MainView::sensitiveRotateRight (gboolean sensitive) 143 { 144 GtkAction *rotateRight = gtk_ui_manager_get_action (m_UIManager, 145 "/MenuBar/ViewMenu/RotateRight"); 146 gtk_action_set_sensitive (rotateRight, sensitive); 114 147 } 115 148 … … 117 150 MainView::sensitiveZoomIn (gboolean sensitive) 118 151 { 152 GtkAction *zoomIn = 153 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/ViewMenu/ZoomIn"); 154 gtk_action_set_sensitive (zoomIn, sensitive); 119 155 } 120 156 … … 122 158 MainView::sensitiveZoomOut (gboolean sensitive) 123 159 { 160 GtkAction *zoomOut = 161 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/ViewMenu/ZoomOut"); 162 gtk_action_set_sensitive (zoomOut, sensitive); 124 163 } 125 164 … … 127 166 MainView::sensitiveZoomFit (gboolean sensitive) 128 167 { 168 GtkAction *zoomFit = 169 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/ViewMenu/ZoomFit"); 170 gtk_action_set_sensitive (zoomFit, sensitive); 129 171 } 130 172 … … 132 174 MainView::sensitiveZoomWidth (gboolean sensitive) 133 175 { 176 GtkAction *zoomWidth = 177 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/ViewMenu/ZoomWidth"); 178 gtk_action_set_sensitive (zoomWidth, sensitive); 134 179 } 135 180 … … 226 271 { "RotateRight", GTK_STOCK_REDO, _("Rotate _Right"), NULL, NULL, NULL}, 227 272 { "RotateLeft", GTK_STOCK_UNDO, _("Rotate Left"), NULL, NULL, NULL}, 228 { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, _("_First Page"), "Home", NULL, NULL},229 { "GoToNextPage", GTK_STOCK_GO_FORWARD, _("_Next Page"), "Page_Down", NULL, NULL},230 { "GoToPreviousPage", GTK_STOCK_GO_BACK, _("_Previous Page"), "Page_Up", NULL, NULL},231 { "GoToLastPage", GTK_STOCK_GOTO_LAST, _("_Last Page"), "End", NULL, NULL},273 { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, _("_First Page"), "Home", NULL, G_CALLBACK (main_window_go_to_first_page_cb) }, 274 { "GoToNextPage", GTK_STOCK_GO_FORWARD, _("_Next Page"), "Page_Down", NULL, G_CALLBACK (main_window_go_to_next_page_cb) }, 275 { "GoToPreviousPage", GTK_STOCK_GO_BACK, _("_Previous Page"), "Page_Up", NULL, G_CALLBACK (main_window_go_to_previous_page_cb) }, 276 { "GoToLastPage", GTK_STOCK_GOTO_LAST, _("_Last Page"), "End", NULL, G_CALLBACK (main_window_go_to_last_page_cb) }, 232 277 { "About", GTK_STOCK_ABOUT, "_About", NULL, NULL, NULL } 233 278 }; … … 237 282 " <menubar name='MenuBar'>" 238 283 " <menu action='FileMenu'>" 239 " <menuitem action='OpenFile'/>"284 " <menuitem name='OpenFile' action='OpenFile'/>" 240 285 " <separator/>" 241 " <menuitem action='Quit'/>"286 " <menuitem name='Quit' action='Quit'/>" 242 287 " </menu>" 243 288 " <menu action='ViewMenu'>" 244 " <menuitem action='ZoomIn'/>"245 " <menuitem action='ZoomOut'/>"246 " <menuitem action='ZoomFit'/>"247 " <menuitem action='ZoomWidth'/>"289 " <menuitem name='ZoomIn' action='ZoomIn'/>" 290 " <menuitem name='ZoomOut' action='ZoomOut'/>" 291 " <menuitem name='ZoomFit' action='ZoomFit'/>" 292 " <menuitem name='ZoomWidth' action='ZoomWidth'/>" 248 293 " <separator />" 249 " <menuitem action='RotateRight'/>"250 " <menuitem action='RotateLeft'/>"294 " <menuitem name='RotateRight' action='RotateRight'/>" 295 " <menuitem name='RotateLeft' action='RotateLeft'/>" 251 296 " </menu>" 252 297 " <menu action='GoMenu'>" 253 " <menuitem action='GoToFirstPage'/>"254 " <menuitem action='GoToPreviousPage'/>"255 " <menuitem action='GoToNextPage'/>"256 " <menuitem action='GoToLastPage'/>"298 " <menuitem name='GoToFirstPage' action='GoToFirstPage'/>" 299 " <menuitem name='GoToPreviousPage' action='GoToPreviousPage'/>" 300 " <menuitem name='GoToNextPage' action='GoToNextPage'/>" 301 " <menuitem name='GoToLastPage' action='GoToLastPage'/>" 257 302 " </menu>" 258 303 " <menu action='HelpMenu'>" 259 " <menuitem action='About'/>"304 " <menuitem name='About' action='About'/>" 260 305 " </menu>" 261 306 " </menubar>" 262 307 " <toolbar name='ToolBar'>" 263 " <toolitem action='OpenFile'/>"308 " <toolitem name='OpenFile' action='OpenFile'/>" 264 309 " <separator/>" 265 " <toolitem action='GoToPreviousPage'/>"266 " <toolitem action='GoToNextPage'/>"310 " <toolitem name='GoToPreviousPage' action='GoToPreviousPage'/>" 311 " <toolitem name='GoToNextPage' action='GoToNextPage'/>" 267 312 " <separator/>" 268 313 " <separator/>" 269 " <toolitem action='ZoomIn'/>"270 " <toolitem action='ZoomOut'/>"271 " <toolitem action='ZoomFit'/>"272 " <toolitem action='ZoomWidth'/>"314 " <toolitem name='ZoomIn' action='ZoomIn'/>" 315 " <toolitem name='ZoomOut' action='ZoomOut'/>" 316 " <toolitem name='ZoomFit' action='ZoomFit'/>" 317 " <toolitem name='ZoomWidth' action='ZoomWidth'/>" 273 318 " </toolbar>" 274 319 "</ui>"; … … 305 350 //////////////////////////////////////////////////////////////// 306 351 352 void 353 main_window_go_to_first_page_cb (GtkWidget *, gpointer) 354 { 355 } 356 357 void 358 main_window_go_to_last_page_cb (GtkWidget *, gpointer) 359 { 360 } 361 362 void 363 main_window_go_to_next_page_cb (GtkWidget *, gpointer) 364 { 365 } 366 367 void 368 main_window_go_to_previous_page_cb (GtkWidget *, gpointer) 369 { 370 } 371 307 372 /// 308 373 /// @brief The user tries to open a file.
