Logo Search packages:      
Sourcecode: agave version File versions  Download package

bool gcs::Widgets::TextSwatch::on_button_press_event ( GdkEventButton *  e  )  [virtual]

Handles the action of pressing a mouse button on a ColorSwatch object. Will pop up a context menu if one is defined, else will do nothing

Reimplemented from gcs::Widgets::ColorSwatch.

Definition at line 203 of file gcs-textswatch.cc.

References m_pContextMenu.

        {
            //Then do our custom stuff:
            if (e->type == GDK_BUTTON_PRESS)
            {
                if (e->button == 3)
                {
                    // User pressed right mouse button
                    if (m_pContextMenu != NULL)
                    {
                        LOG("context menu registered -- popup " << (long) m_pContextMenu);
                        m_pContextMenu->popup(e->button, e->time);
                    }
                    else
                    {
                        LOG("No context menu registered");
                    }
                }
            }
            if (e->type == GDK_2BUTTON_PRESS)
            {
                if (e->button == 1)
                {
                    // User pressed left mouse button
                    m_signal_selected.emit();
                }
            }
            return true;
        }


Generated by  Doxygen 1.6.0   Back to index