Show
Ignore:
Timestamp:
06/26/07 07:07:49 (18 months ago)
Author:
jordi
Message:

Igor Vagulin sent a patch to change the Scroll and Text Selection ToggleAction? to RadioActions?.

Moved the implementation of PagePter?'s setMode() to its implementation file.

Fixed the selection of an empty rectangle.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/gtk/MainView.cxx

    r277 r279  
    7777static void main_window_zoom_out_cb (GtkWidget *, gpointer); 
    7878static void main_window_zoom_width_cb (GtkToggleAction *, gpointer); 
    79 static void main_window_page_mode_scroll_cb (GtkToggleAction *, gpointer); 
    80 static void main_window_page_mode_text_cb (GtkToggleAction *, gpointer); 
     79static void main_window_set_page_mode (GtkRadioAction *, GtkRadioAction *, gpointer); 
    8180 
    8281#if defined (HAVE_CUPS) 
     
    189188      N_("Make the current document fill the window width"), 
    190189      G_CALLBACK (main_window_zoom_width_cb), FALSE }, 
    191  
     190}; 
     191 
     192static GtkRadioActionEntry g_PageScrollEntries[] = 
     193{    
    192194    { "PageModeScroll", GTK_STOCK_FULLSCREEN, N_("Scroll"), NULL, 
    193       N_("Mouse scroll page"), 
    194       G_CALLBACK (main_window_page_mode_scroll_cb), FALSE }, 
     195      N_("Mouse scroll page"), (int)PagePterModeScroll }, 
    195196 
    196197    { "PageModeText", GTK_STOCK_SELECT_ALL, N_("Select Text"), NULL, 
    197       N_(" Mouse select text"), 
    198       G_CALLBACK (main_window_page_mode_text_cb), FALSE }, 
    199  
     198      N_(" Mouse select text"), (int)PagePterModeSelectText }, 
    200199}; 
     200 
    201201 
    202202//////////////////////////////////////////////////////////////// 
     
    963963                                         G_N_ELEMENTS (g_ToggleEntries), 
    964964                                         m_Pter); 
     965    gtk_action_group_add_radio_actions (actionGroup, g_PageScrollEntries, 
     966                                        G_N_ELEMENTS (g_PageScrollEntries), 0, 
     967                                        G_CALLBACK(main_window_set_page_mode), m_Pter); 
    965968    m_UIManager = gtk_ui_manager_new (); 
    966969    gtk_ui_manager_insert_action_group (m_UIManager, actionGroup, 0); 
     
    14531456 
    14541457void 
    1455 main_window_page_mode_scroll_cb (GtkToggleAction *action, gpointer data) 
    1456 { 
    1457     g_assert ( NULL != data && "The data parameter is NULL."); 
    1458  
    1459     MainPter *pter = (MainPter *)data; 
    1460     pter->pageModeScrollActivated (gtk_toggle_action_get_active (action)); 
    1461 } 
    1462  
    1463 void 
    1464 main_window_page_mode_text_cb (GtkToggleAction *action, gpointer data) 
    1465 { 
    1466     g_assert ( NULL != data && "The data parameter is NULL."); 
    1467  
    1468     MainPter *pter = (MainPter *)data; 
    1469     pter->pageModeTextActivated (gtk_toggle_action_get_active (action)); 
    1470 } 
     1458main_window_set_page_mode (GtkRadioAction *action, GtkRadioAction *current, gpointer data) 
     1459{ 
     1460    g_assert ( NULL != data && "The data parameter is NULL."); 
     1461 
     1462    MainPter *pter = (MainPter *)data; 
     1463    PagePterMode mode = (PagePterMode)gtk_radio_action_get_current_value(action); 
     1464    pter->setPageMode (mode); 
     1465}