您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wxGTK_CONV函数代码示例

51自学网 2021-06-03 10:09:50
  C++
这篇教程C++ wxGTK_CONV函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中wxGTK_CONV函数的典型用法代码示例。如果您正苦于以下问题:C++ wxGTK_CONV函数的具体用法?C++ wxGTK_CONV怎么用?C++ wxGTK_CONV使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了wxGTK_CONV函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: wxCHECK_MSG

int wxComboBox::DoAppend( const wxString &item ){    wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid combobox") );#ifdef __WXGTK24__    if (!gtk_check_version(2,4,0))    {        GtkComboBox* combobox = GTK_COMBO_BOX( m_widget );        gtk_combo_box_append_text( combobox,  wxGTK_CONV( item ) );    }    else#endif    {        DisableEvents();        GtkWidget *list = GTK_COMBO(m_widget)->list;        GtkWidget *list_item = gtk_list_item_new_with_label( wxGTK_CONV( item ) );        gtk_container_add( GTK_CONTAINER(list), list_item );        if (GTK_WIDGET_REALIZED(m_widget))        {            gtk_widget_realize( list_item );            gtk_widget_realize( GTK_BIN(list_item)->child );        }        // Apply current widget style to the new list_item        GtkRcStyle *style = CreateWidgetStyle();        if (style)        {            gtk_widget_modify_style( GTK_WIDGET( list_item ), style );            GtkBin *bin = GTK_BIN( list_item );            GtkWidget *label = GTK_WIDGET( bin->child );            gtk_widget_modify_style( label, style );            gtk_rc_style_unref( style );        }        gtk_widget_show( list_item );        EnableEvents();    }    const unsigned int count = GetCount();    if ( m_clientDataList.GetCount() < count )        m_clientDataList.Append( (wxObject*) NULL );    if ( m_clientObjectList.GetCount() < count )        m_clientObjectList.Append( (wxObject*) NULL );    InvalidateBestSize();    return count - 1;}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:53,


示例2: defined

void FileDialog::SetWildcard(const wxString& wildCard){#if defined(__WXGTK24__) && (!defined(__WXGPE__))   if (!gtk_check_version(2,4,0))   {      // parse filters      wxArrayString wildDescriptions, wildFilters;      if (!wxParseCommonDialogsFilter(wildCard, wildDescriptions, wildFilters))      {         wxFAIL_MSG( wxT("FileDialog::SetWildCard - bad wildcard string") );      }      else      {         // Parsing went fine. Set m_wildCard to be returned by FileDialogBase::GetWildcard         m_wildCard = wildCard;                  GtkFileChooser* chooser = GTK_FILE_CHOOSER(m_widget);                  // empty current filter list:         GSList* ifilters = gtk_file_chooser_list_filters(chooser);         GSList* filters = ifilters;                  while (ifilters)         {            gtk_file_chooser_remove_filter(chooser,GTK_FILE_FILTER(ifilters->data));            ifilters = ifilters->next;         }         g_slist_free(filters);                  // add parsed to GtkChooser         for (size_t n = 0; n < wildFilters.GetCount(); ++n)         {            GtkFileFilter* filter = gtk_file_filter_new();            gtk_file_filter_set_name(filter, wxGTK_CONV(wildDescriptions[n]));                        wxStringTokenizer exttok(wildFilters[n], wxT(";"));            while (exttok.HasMoreTokens())            {               wxString token = exttok.GetNextToken();               gtk_file_filter_add_pattern(filter, wxGTK_CONV(token));            }                        gtk_file_chooser_add_filter(chooser, filter);         }                  // Reset the filter index         SetFilterIndex(0);      }   }   else#endif      wxGenericFileDialog::SetWildcard( wildCard );}
开发者ID:Audacity-Team,项目名称:Audacity,代码行数:53,


示例3: str

bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title, int pos){    wxString str( wxReplaceUnderscore( title ) );    // This doesn't have much effect right now.    menu->SetTitle( str );    // The "m_owner" is the "menu item"    menu->m_owner = gtk_menu_item_new_with_label( wxGTK_CONV( str ) );    GtkLabel *label = GTK_LABEL( GTK_BIN(menu->m_owner)->child );    // set new text    gtk_label_set_text( label, wxGTK_CONV( str ) );    // reparse key accel    guint accel_key = gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( str ) );    if (accel_key != GDK_VoidSymbol)    {        gtk_widget_add_accelerator (menu->m_owner,                                    "activate_item",                                    m_accel, //gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menubar)),                                    accel_key,                                    GDK_MOD1_MASK,                                    GTK_ACCEL_LOCKED);    }    gtk_widget_show( menu->m_owner );    gtk_menu_item_set_submenu( GTK_MENU_ITEM(menu->m_owner), menu->m_menu );    if (pos == -1)        gtk_menu_shell_append( GTK_MENU_SHELL(m_menubar), menu->m_owner );    else        gtk_menu_shell_insert( GTK_MENU_SHELL(m_menubar), menu->m_owner, pos );    gtk_signal_connect( GTK_OBJECT(menu->m_owner), "activate",                        GTK_SIGNAL_FUNC(gtk_menu_open_callback),                        (gpointer)menu );    if (m_menuBarFrame)    {        AttachToFrame( menu, m_menuBarFrame );            // OPTIMISE ME:  we should probably cache this, or pass it            //               directly, but for now this is a minimal            //               change to validate the new dynamic sizing.            //               see (and refactor :) similar code in Remove            //               below.            m_menuBarFrame->UpdateMenuBarSize();    }    return true;}
开发者ID:beanhome,项目名称:dev,代码行数:52,


示例4: wxCHECK_RET

void wxCheckBox::SetLabel( const wxString& label ){    wxCHECK_RET( m_widgetLabel != NULL, wxT("invalid checkbox") );    wxControl::SetLabel( label );#ifdef __WXGTK20__    wxString label2 = PrepareLabelMnemonics( label );    gtk_label_set_text_with_mnemonic( GTK_LABEL(m_widgetLabel), wxGTK_CONV( label2 ) );#else    gtk_label_set( GTK_LABEL(m_widgetLabel), wxGTK_CONV( GetLabel() ) );#endif}
开发者ID:Duion,项目名称:Torsion,代码行数:13,


示例5: str

void wxMenuBar::GtkAppend(wxMenu* menu, const wxString& title, int pos){    menu->SetLayoutDirection(GetLayoutDirection());#if wxUSE_LIBHILDON || wxUSE_LIBHILDON2    // if the menu has only one item, append it directly to the top level menu    // instead of inserting a useless submenu    if ( menu->GetMenuItemCount() == 1 )    {        wxMenuItem * const item = menu->FindItemByPosition(0);        // remove both mnemonics and accelerator: neither is useful under Maemo        const wxString str(wxStripMenuCodes(item->GetItemLabel()));        if ( item->IsSubMenu() )        {            GtkAppend(item->GetSubMenu(), str, pos);            return;        }        menu->m_owner = gtk_menu_item_new_with_mnemonic( wxGTK_CONV( str ) );        g_signal_connect(menu->m_owner, "activate",                         G_CALLBACK(menuitem_activate), item);        item->SetMenuItem(menu->m_owner);    }    else#endif // wxUSE_LIBHILDON || wxUSE_LIBHILDON2 /!wxUSE_LIBHILDON && !wxUSE_LIBHILDON2    {        const wxString str(wxConvertMnemonicsToGTK(title));        // This doesn't have much effect right now.        menu->SetTitle( str );        // The "m_owner" is the "menu item"        menu->m_owner = gtk_menu_item_new_with_mnemonic( wxGTK_CONV( str ) );        gtk_menu_item_set_submenu( GTK_MENU_ITEM(menu->m_owner), menu->m_menu );    }    g_object_ref(menu->m_owner);    gtk_widget_show( menu->m_owner );    if (pos == -1)        gtk_menu_shell_append( GTK_MENU_SHELL(m_menubar), menu->m_owner );    else        gtk_menu_shell_insert( GTK_MENU_SHELL(m_menubar), menu->m_owner, pos );    if ( m_menuBarFrame )        AttachToFrame( menu, m_menuBarFrame );}
开发者ID:mael15,项目名称:wxWidgets,代码行数:51,


示例6: wxT

bool wxFontDialog::DoCreate(wxWindow *parent){    m_needParent = false;    if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||        !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE,                     wxDefaultValidator, wxT("fontdialog") ))    {        wxFAIL_MSG( wxT("wxFontDialog creation failed") );        return false;    }    wxString m_message( _("Choose font") );    m_widget = gtk_font_selection_dialog_new( wxGTK_CONV( m_message ) );    if (parent)        gtk_window_set_transient_for(GTK_WINDOW(m_widget),                                     GTK_WINDOW(parent->m_widget));    GtkFontSelectionDialog *sel = GTK_FONT_SELECTION_DIALOG(m_widget);    g_signal_connect (sel->ok_button, "clicked",                      G_CALLBACK (gtk_fontdialog_ok_callback), this);    g_signal_connect (sel->cancel_button, "clicked",                      G_CALLBACK (gtk_fontdialog_cancel_callback), this);    g_signal_connect (m_widget, "delete_event",                      G_CALLBACK (gtk_fontdialog_delete_callback), this);    wxFont font = m_fontData.GetInitialFont();    if( font.Ok() )    {        const wxNativeFontInfo *info = font.GetNativeFontInfo();        if ( info )        {            const wxString& fontname = info->ToString();            gtk_font_selection_dialog_set_font_name(sel, wxGTK_CONV(fontname));        }        else        {            // this is not supposed to happen!            wxFAIL_MSG(_T("font is ok but no native font info?"));        }    }    return true;}
开发者ID:SCP-682,项目名称:Cities3D,代码行数:50,


示例7: wxCHECK_RET

void wxChoice::SetString(unsigned int n, const wxString& str ){    wxCHECK_RET( m_widget != NULL, wxT("invalid choice") );    GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );    unsigned int count = 0;    GList *child = menu_shell->children;    while (child)    {        GtkBin *bin = GTK_BIN( child->data );        if (count == n)        {            GtkLabel *label = NULL;            if (bin->child)                label = GTK_LABEL(bin->child);            if (!label)                label = GTK_LABEL( BUTTON_CHILD(m_widget) );            wxASSERT_MSG( label != NULL , wxT("wxChoice: invalid label") );            gtk_label_set_text( label, wxGTK_CONV( str ) );            return;        }        child = child->next;        count++;    }}
开发者ID:beanhome,项目名称:dev,代码行数:28,


示例8: GetParentForModalDialog

bool wxColourDialog::Create(wxWindow *parent, wxColourData *data){    if (data)        m_data = *data;    m_parent = GetParentForModalDialog(parent, 0);    GtkWindow * const parentGTK = m_parent ? GTK_WINDOW(m_parent->m_widget)                                           : NULL;#if wxUSE_LIBHILDON    m_widget = hildon_color_selector_new(parentGTK);#elif wxUSE_LIBHILDON2 // !wxUSE_LIBHILDON    m_widget = hildon_color_chooser_dialog_new();#else // !wxUSE_LIBHILDON && !wxUSE_LIBHILDON2    wxString title(_("Choose colour"));    m_widget = gtk_color_selection_dialog_new(wxGTK_CONV(title));#endif // wxUSE_LIBHILDON/!wxUSE_LIBHILDON    g_object_ref(m_widget);    if ( parentGTK )    {        gtk_window_set_transient_for(GTK_WINDOW(m_widget), parentGTK);    }#if !wxUSE_LIBHILDON && !wxUSE_LIBHILDON2    GtkColorSelection* sel = GTK_COLOR_SELECTION(        gtk_color_selection_dialog_get_color_selection(        GTK_COLOR_SELECTION_DIALOG(m_widget)));    gtk_color_selection_set_has_palette(sel, true);#endif // !wxUSE_LIBHILDON && !wxUSE_LIBHILDON2    return true;}
开发者ID:iokto,项目名称:newton-dynamics,代码行数:34,


示例9: GTKAddButton

void wxInfoBar::ShowMessage(const wxString& msg, int flags){    if ( !UseNative() )    {        wxInfoBarGeneric::ShowMessage(msg, flags);        return;    }    // if we don't have any buttons, create a standard close one to give the    // user at least some way to close the bar    if ( m_impl->m_buttons.empty() && !m_impl->m_close )    {        m_impl->m_close = GTKAddButton(wxID_CLOSE);    }    GtkMessageType type;    if ( wxGTKImpl::ConvertMessageTypeFromWX(flags, &type) )        gtk_info_bar_set_message_type(GTK_INFO_BAR(m_widget), type);    gtk_label_set_text(GTK_LABEL(m_impl->m_label), wxGTK_CONV(msg));    if ( !IsShown() )        Show();    UpdateParent();}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:25,


示例10: wxCHECK_RET

void wxButton::SetLabel( const wxString &lbl ){    wxCHECK_RET( m_widget != NULL, wxT("invalid button") );    wxString label(lbl);    if (label.empty() && wxIsStockID(m_windowId))        label = wxGetStockLabel(m_windowId);    wxControl::SetLabel(label);    const wxString labelGTK = GTKConvertMnemonics(label);    if (wxIsStockID(m_windowId) && wxIsStockLabel(m_windowId, label))    {        const char *stock = wxGetStockGtkID(m_windowId);        if (stock)        {            gtk_button_set_label(GTK_BUTTON(m_widget), stock);            gtk_button_set_use_stock(GTK_BUTTON(m_widget), TRUE);            return;        }    }    gtk_button_set_label(GTK_BUTTON(m_widget), wxGTK_CONV(labelGTK));    gtk_button_set_use_stock(GTK_BUTTON(m_widget), FALSE);    ApplyWidgetStyle( false );}
开发者ID:EdgarTx,项目名称:wx,代码行数:29,


示例11: gtk_frame_set_label

void wxStaticBox::SetLabel( const wxString &label ){    wxControl::SetLabel( label );    gtk_frame_set_label( GTK_FRAME( m_widget ),                         m_label.empty() ? (char *)NULL : (const char*) wxGTK_CONV( m_label ) );}
开发者ID:gitrider,项目名称:wxsj2,代码行数:7,


示例12: wxFAIL_MSG

bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,                            const wxString &label, const wxPoint &pos,                            const wxSize &size, long style,                            const wxValidator& validator,                            const wxString &name){    m_needParent = true;    m_acceptsFocus = true;    m_blockEvent = false;    if (!PreCreation(parent, pos, size) ||        !CreateBase(parent, id, pos, size, style, validator, name )) {        wxFAIL_MSG(wxT("wxToggleButton creation failed"));        return false;    }    wxControl::SetLabel(label);    // Create the gtk widget.    m_widget = gtk_toggle_button_new_with_label( wxGTK_CONV( m_label ) );    gtk_signal_connect(GTK_OBJECT(m_widget), "clicked",                       GTK_SIGNAL_FUNC(gtk_togglebutton_clicked_callback),                       (gpointer *)this);    m_parent->DoAddChild(this);    PostCreation(size);    return true;}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:32,


示例13: GetParentForModalDialog

bool wxColourDialog::Create(wxWindow *parent, wxColourData *data){    if (data)        m_data = *data;    m_parent = GetParentForModalDialog(parent, 0);    GtkWindow * const parentGTK = m_parent ? GTK_WINDOW(m_parent->m_widget)                                           : NULL;    wxString title(_("Choose colour"));    m_widget = gtk_color_selection_dialog_new(wxGTK_CONV(title));    g_object_ref(m_widget);    if ( parentGTK )    {        gtk_window_set_transient_for(GTK_WINDOW(m_widget), parentGTK);    }    GtkColorSelection* sel = GTK_COLOR_SELECTION(        gtk_color_selection_dialog_get_color_selection(        GTK_COLOR_SELECTION_DIALOG(m_widget)));    gtk_color_selection_set_has_palette(sel, true);    return true;}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:26,


示例14: gtk_link_button_set_uri

void wxHyperlinkCtrl::SetURL(const wxString &uri){    if ( UseNative() )        gtk_link_button_set_uri(GTK_LINK_BUTTON(m_widget), wxGTK_CONV(uri));    else        wxGenericHyperlinkCtrl::SetURL(uri);}
开发者ID:CobaltBlues,项目名称:wxWidgets,代码行数:7,


示例15: wxCHECK_RET

void wxTextCtrl::DoSetValue( const wxString &value, int flags ){    wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") );    if ( !(flags & SetValue_SendEvent) )    {        // do not generate events        IgnoreNextTextUpdate();    }    if (m_windowStyle & wxTE_MULTILINE)    {        gint len = gtk_text_get_length( GTK_TEXT(m_text) );        gtk_editable_delete_text( GTK_EDITABLE(m_text), 0, len );        len = 0;        gtk_editable_insert_text( GTK_EDITABLE(m_text), value.mbc_str(), value.length(), &len );    }    else    {        gtk_entry_set_text( GTK_ENTRY(m_text), wxGTK_CONV( value ) );    }    // GRG, Jun/2000: Changed this after a lot of discussion in    //   the lists. wxWidgets 2.2 will have a set of flags to    //   customize this behaviour.    SetInsertionPoint(0);    m_modified = false;}
开发者ID:ruifig,项目名称:nutcracker,代码行数:29,


示例16: WXUNUSED

bool wxDirDialog::Create(wxWindow* parent,                         const wxString& title,                         const wxString& defaultPath,                         long style,                         const wxPoint& pos,                         const wxSize& WXUNUSED(sz),                         const wxString& WXUNUSED(name)){    m_message = title;    parent = GetParentForModalDialog(parent, style);    if (!PreCreation(parent, pos, wxDefaultSize) ||        !CreateBase(parent, wxID_ANY, pos, wxDefaultSize, style,                wxDefaultValidator, wxT("dirdialog")))    {        wxFAIL_MSG( wxT("wxDirDialog creation failed") );        return false;    }    GtkWindow* gtk_parent = NULL;    if (parent)        gtk_parent = GTK_WINDOW( gtk_widget_get_toplevel(parent->m_widget) );    m_widget = gtk_file_chooser_dialog_new(                   wxGTK_CONV(m_message),                   gtk_parent,                   GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,                   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,                   GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,                   NULL);    g_object_ref(m_widget);    gtk_dialog_set_default_response(GTK_DIALOG(m_widget), GTK_RESPONSE_ACCEPT);#if GTK_CHECK_VERSION(2,18,0)#ifndef __WXGTK3__    if (gtk_check_version(2,18,0) == NULL)#endif    {        gtk_file_chooser_set_create_folders(            GTK_FILE_CHOOSER(m_widget), (style & wxDD_DIR_MUST_EXIST) == 0);    }#endif    // local-only property could be set to false to allow non-local files to be loaded.    // In that case get/set_uri(s) should be used instead of get/set_filename(s) everywhere    // and the GtkFileChooserDialog should probably also be created with a backend,    // e.g. "gnome-vfs", "default", ... (gtk_file_chooser_dialog_new_with_backend).    // Currently local-only is kept as the default - true:    // gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(m_widget), true);    g_signal_connect (m_widget, "response",        G_CALLBACK (gtk_dirdialog_response_callback), this);    if ( !defaultPath.empty() )        SetPath(defaultPath);    return true;}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:59,


示例17: GTKConvertMnemonics

void wxStaticText::DoSetLabel(const wxString& str){    // this function looks like GTKSetLabelForLabel() but here we just want to modify    // the GTK control without altering any internal wxStaticText variable        const wxString labelGTK = GTKConvertMnemonics(str);    gtk_label_set_text_with_mnemonic(GTK_LABEL(m_widget), wxGTK_CONV(labelGTK));}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:8,


示例18: GTKConvertMnemonics

void wxControl::GTKSetLabelForLabel(GtkLabel *w, const wxString& label){    // save the original label    wxControlBase::SetLabel(label);    const wxString labelGTK = GTKConvertMnemonics(label);    gtk_label_set_text_with_mnemonic(w, wxGTK_CONV(labelGTK));}
开发者ID:jonntd,项目名称:dynamica,代码行数:8,


示例19: gtk_expander_set_label

void wxCollapsiblePane::SetLabel(const wxString &str){    gtk_expander_set_label(GTK_EXPANDER(m_widget), wxGTK_CONV(str));    // FIXME: we need to update our collapsed width in some way but using GetBestSize()    // we may get the size of the control with the pane size summed up if we are expanded!    //m_szCollapsed.x = GetBestSize().x;}
开发者ID:jonntd,项目名称:dynamica,代码行数:8,


示例20: wxCHECK_RET

void wxRadioBox::SetLabel( const wxString& label ){    wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );    wxControl::SetLabel( label );    gtk_frame_set_label( GTK_FRAME(m_widget), wxGTK_CONV( wxControl::GetLabel() ) );}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:8,


示例21: wxCHECK_RET

void wxToggleButton::SetLabel(const wxString& label){    wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));    wxControl::SetLabel(label);    gtk_label_set(GTK_LABEL(BUTTON_CHILD(m_widget)), wxGTK_CONV( GetLabel() ) );}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:8,


示例22: wxASSERT_MSG

void wxFontButton::UpdateFont(){    const wxNativeFontInfo *info = m_selectedFont.GetNativeFontInfo();    wxASSERT_MSG( info, wxT("The fontbutton's internal font is not valid ?") );    const wxString& fontname = info->ToString();    gtk_font_button_set_font_name(GTK_FONT_BUTTON(m_widget), wxGTK_CONV(fontname));}
开发者ID:BloodRedd,项目名称:gamekit,代码行数:8,


示例23: WXUNUSED

bool wxDirDialog::Create(wxWindow* parent,                         const wxString& title,                         const wxString& defaultPath,                         long style,                         const wxPoint& pos,                         const wxSize& WXUNUSED(sz),                         const wxString& WXUNUSED(name)){    m_message = title;    parent = GetParentForModalDialog(parent, style);    if (!PreCreation(parent, pos, wxDefaultSize) ||        !CreateBase(parent, wxID_ANY, pos, wxDefaultSize, style,                wxDefaultValidator, wxT("dirdialog")))    {        wxFAIL_MSG( wxT("wxDirDialog creation failed") );        return false;    }    GtkWindow* gtk_parent = NULL;    if (parent)        gtk_parent = GTK_WINDOW( gtk_widget_get_toplevel(parent->m_widget) );    m_widget = gtk_file_chooser_dialog_new(                   wxGTK_CONV(m_message),                   gtk_parent,                   GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,                   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,                   GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,                   NULL);    g_object_ref(m_widget);    gtk_dialog_set_default_response(GTK_DIALOG(m_widget), GTK_RESPONSE_ACCEPT);    // gtk_widget_hide_on_delete is used here to avoid that Gtk automatically destroys    // the dialog when the user press ESC on the dialog: in that case a second call to    // ShowModal() would result in a bunch of Gtk-CRITICAL errors...    g_signal_connect (m_widget,                    "delete_event",                    G_CALLBACK (gtk_widget_hide_on_delete),                    (gpointer)this);    // local-only property could be set to false to allow non-local files to be loaded.    // In that case get/set_uri(s) should be used instead of get/set_filename(s) everywhere    // and the GtkFileChooserDialog should probably also be created with a backend,    // e.g. "gnome-vfs", "default", ... (gtk_file_chooser_dialog_new_with_backend).    // Currently local-only is kept as the default - true:    // gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(m_widget), true);    g_signal_connect (m_widget, "response",        G_CALLBACK (gtk_dirdialog_response_callback), this);    if ( !defaultPath.empty() )        SetPath(defaultPath);    return true;}
开发者ID:CobaltBlues,项目名称:wxWidgets,代码行数:58,


示例24: wxFAIL_MSG

bool wxRadioButton::Create( wxWindow *parent,                            wxWindowID id,                            const wxString& label,                            const wxPoint& pos,                            const wxSize& size,                            long style,                            const wxValidator& validator,                            const wxString& name ){    m_acceptsFocus = TRUE;    m_needParent = TRUE;    m_blockEvent = FALSE;    if (!PreCreation( parent, pos, size ) ||        !CreateBase( parent, id, pos, size, style, validator, name ))    {        wxFAIL_MSG( wxT("wxRadioButton creation failed") );        return FALSE;    }    GSList* radioButtonGroup = NULL;    if (!HasFlag(wxRB_GROUP))    {        // search backward for last group start        wxRadioButton *chief = NULL;        wxWindowList::compatibility_iterator node = parent->GetChildren().GetLast();        while (node)        {            wxWindow *child = node->GetData();            if (child->IsRadioButton())            {                chief = (wxRadioButton*) child;                if (child->HasFlag(wxRB_GROUP))                    break;            }            node = node->GetPrevious();        }        if (chief)        {            // we are part of the group started by chief            radioButtonGroup = gtk_radio_button_group( GTK_RADIO_BUTTON(chief->m_widget) );        }    }    m_widget = gtk_radio_button_new_with_label( radioButtonGroup, wxGTK_CONV( label ) );    SetLabel(label);    gtk_signal_connect( GTK_OBJECT(m_widget), "clicked",      GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this );    m_parent->DoAddChild( this );    PostCreation(size);    return TRUE;}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:58,


示例25: wxCHECK_RET

void wxComboBox::SetValue( const wxString& value ){    wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );    GtkWidget *entry = GTK_COMBO(m_widget)->entry;    gtk_entry_set_text( GTK_ENTRY(entry), wxGTK_CONV( value ) );    InvalidateBestSize();}
开发者ID:beanhome,项目名称:dev,代码行数:9,


示例26: wxCHECK_MSG

bool wxNotebook::SetPageText( size_t page, const wxString &text ){    wxCHECK_MSG(page < GetPageCount(), false, "invalid notebook index");    GtkLabel* label = GTK_LABEL(GetNotebookPage(page)->m_label);    gtk_label_set_text(label, wxGTK_CONV(text));    return true;}
开发者ID:CobaltBlues,项目名称:wxWidgets,代码行数:9,


示例27: InvalidateBestSize

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;}
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:18,


示例28: GTKRemoveMnemonics

void wxControl::GTKSetLabelForLabel(GtkLabel *w, const wxString& label){    // don't call the virtual function which might call this one back again    wxControl::SetLabel(label);    const wxString labelGTK = GTKRemoveMnemonics(label);    gtk_label_set(w, wxGTK_CONV(labelGTK));}
开发者ID:esrrhs,项目名称:fuck-music-player,代码行数:9,


示例29: GetToolTip

void wxRadioBox::DoSetItemToolTip(unsigned int n, wxToolTip *tooltip){    wxCharBuffer buf;    if ( !tooltip )        tooltip = GetToolTip();    if ( tooltip )        buf = wxGTK_CONV(tooltip->GetTip());    wxToolTip::GTKApply(GTK_WIDGET(m_buttonsInfo[n]->button), buf);}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:10,



注:本文中的wxGTK_CONV函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ wxGenericValidator函数代码示例
C++ wxGBSpan函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。