Beispiel #1
0
void wxMessageDialog::DoSetCustomLabel(wxString& var, const ButtonLabel& label)
{
    int stockId = label.GetStockId();
    if ( stockId == wxID_NONE )
    {
        wxMessageDialogBase::DoSetCustomLabel(var, label);
        var = wxConvertMnemonicsToGTK(var);
    }
    else // stock label
    {
#ifdef __WXGTK4__
        var = wxConvertMnemonicsToGTK(wxGetStockLabel(stockId));
#else
        var = wxGetStockGtkID(stockId);
#endif
    }
}
Beispiel #2
0
wxString wxMessageDialog::GetDefaultHelpLabel() const
{
#ifdef __WXGTK4__
    return wxConvertMnemonicsToGTK(wxGetStockLabel(wxID_HELP));
#else
    wxGCC_WARNING_SUPPRESS(deprecated-declarations)
    return GTK_STOCK_HELP;
    wxGCC_WARNING_RESTORE()
#endif
}
Beispiel #3
0
void wxMenuItem::SetGtkLabel()
{
    const wxString text = wxConvertMnemonicsToGTK(m_text.BeforeFirst('\t'));
    GtkLabel* label = GTK_LABEL(gtk_bin_get_child(GTK_BIN(m_menuItem)));
    gtk_label_set_text_with_mnemonic(label, wxGTK_CONV_SYS(text));
#if wxUSE_ACCEL
    guint accel_key;
    GdkModifierType accel_mods;
    wxGetGtkAccel(this, &accel_key, &accel_mods);
    if (accel_key)
    {
        gtk_widget_add_accelerator(
            m_menuItem, "activate", m_parentMenu->m_accel,
            accel_key, accel_mods, GTK_ACCEL_VISIBLE);
    }
#endif // wxUSE_ACCEL
}
Beispiel #4
0
GtkWidget *wxInfoBar::GTKAddButton(wxWindowID btnid, const wxString& label)
{
    // as GTK+ lays out the buttons vertically, adding another button changes
    // our best size (at least in vertical direction)
    InvalidateBestSize();

    GtkWidget* button = gtk_info_bar_add_button(GTK_INFO_BAR(m_widget),
#ifdef __WXGTK4__
        wxGTK_CONV(label.empty() ? wxConvertMnemonicsToGTK(wxGetStockLabel(btnid)) : label),
#else
        label.empty() ? wxGetStockGtkID(btnid) : static_cast<const char*>(wxGTK_CONV(label)),
#endif
        btnid);

    wxASSERT_MSG( button, "unexpectedly failed to add button to info bar" );

    return button;
}
Beispiel #5
0
/* static */
wxString wxControl::GTKConvertMnemonics(const wxString& label)
{
    return wxConvertMnemonicsToGTK(label);
}