• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ wxCheckBox类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: wxStaticText

void LabelTestCase::setUp()
{
    m_st = new wxStaticText(wxTheApp->GetTopWindow(), wxID_ANY, ORIGINAL_LABEL);

    m_cb = new wxCheckBox(wxTheApp->GetTopWindow(), wxID_ANY, ORIGINAL_LABEL);

    CPPUNIT_ASSERT_EQUAL( ORIGINAL_LABEL, m_st->GetLabel() );
    CPPUNIT_ASSERT_EQUAL( ORIGINAL_LABEL, m_cb->GetLabel() );
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:9,代码来源:label.cpp


示例2: BundleConfigDialog

    BundleConfigDialog(ProjectPtr project, wxWindow* parent, const wxArrayString& choices, IManager* manager)
        : wxDialog(parent,
                   wxID_ANY,
                   _("Mac Bundler Configuration"),
                   wxDefaultPosition,
                   wxDefaultSize,
                   wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
        , m_pluginManager(manager)
    {
        m_accepted = false;

        m_project_name = project->GetName();

        wxStaticText* titleLabel = new wxStaticText(this, wxID_ANY, _("Choose which target(s) to \"bundle-ize\""));
        m_choices_widget = new wxCheckListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, choices);
        m_info_plist_cb = new wxCheckBox(this, wxID_ANY, _("Generate Info.plist file"));
        m_get_info_string = new wxTextCtrl(this, wxID_ANY, m_project_name + wxT(", version 1.0, copyright myself"));
        m_version = new wxTextCtrl(this, wxID_ANY, wxT("1.0"));
        m_icon_file = new wxTextCtrl(this, wxID_ANY, m_project_name + wxT(".icns"));
        m_identifier = new wxTextCtrl(this, wxID_ANY, wxT("com.mycompany.") + m_project_name.Lower());
        m_signature = new wxTextCtrl(this, wxID_ANY, (m_project_name + wxT("????")).Left(4).Upper());
        m_icon_cb = new wxCheckBox(this, wxID_ANY, _("Copy the following icon into the project"));
        wxStaticText* warning =
            new wxStaticText(this, wxID_ANY, _("Warning : applying these changes cannot be undone automatically"));
        wxButton* okBtn = new wxButton(this, wxID_OK, _("Apply changes"));
        wxButton* cancelBtn = new wxButton(this, wxID_CANCEL, _("Cancel"));

        okBtn->SetDefault();
        m_signature->SetMaxLength(4);
        m_info_plist_cb->SetValue(true);
        m_icon_cb->SetValue(true);

        wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
        wxBoxSizer* subsizer = new wxBoxSizer(wxHORIZONTAL);
        wxFlexGridSizer* plistSizer = new wxFlexGridSizer(5, 2, 5, 5);

        plistSizer->AddGrowableCol(1, 1);
        plistSizer->Add(new wxStaticText(this, wxID_ANY, _("Get Info Version String")), 0, wxALIGN_RIGHT);
        plistSizer->Add(m_get_info_string, 1, wxEXPAND);
        plistSizer->Add(new wxStaticText(this, wxID_ANY, _("Version Number")), 0, wxALIGN_RIGHT);
        plistSizer->Add(m_version, 1, wxEXPAND);
        plistSizer->Add(new wxStaticText(this, wxID_ANY, _("Icon File")), 0, wxALIGN_RIGHT);
        plistSizer->Add(m_icon_file, 1, wxEXPAND);
        plistSizer->Add(new wxStaticText(this, wxID_ANY, _("Bundle Identifier")), 0, wxALIGN_RIGHT);
        plistSizer->Add(m_identifier, 1, wxEXPAND);
        plistSizer->Add(new wxStaticText(this, wxID_ANY, _("4-Character Signature")), 0, wxALIGN_RIGHT);
        plistSizer->Add(m_signature, 1, wxEXPAND);

        sizer->Add(titleLabel, 0, wxEXPAND | wxALL, 10);
        sizer->Add(m_choices_widget, 1, wxEXPAND | wxALL, 10);
        sizer->Add(m_info_plist_cb, 0, wxEXPAND | wxALL, 5);
        sizer->Add(plistSizer, 1, wxEXPAND | wxALL, 5);

        sizer->Add(m_icon_cb, 0, wxALL, 10);

        wxStaticBoxSizer* iconBox = new wxStaticBoxSizer(wxHORIZONTAL, this);
        m_icon_picker = new IconPicker(this);
        m_icon_picker->setImage(
            wxT("/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns"));
        iconBox->Add(m_icon_picker, 1, wxEXPAND);
        sizer->Add(iconBox, 0, wxALL, 10);

        sizer->Add(warning, 0, wxEXPAND | wxALL, 10);
        subsizer->AddStretchSpacer();
        subsizer->Add(cancelBtn, 0, wxLEFT | wxRIGHT, 5);
        subsizer->Add(okBtn, 0, wxLEFT | wxRIGHT, 5);
        sizer->Add(subsizer, 0, wxEXPAND | wxALL, 10);

        okBtn->Connect(
            okBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(BundleConfigDialog::onOk), NULL, this);
        cancelBtn->Connect(cancelBtn->GetId(),
                           wxEVT_COMMAND_BUTTON_CLICKED,
                           wxCommandEventHandler(BundleConfigDialog::onCancel),
                           NULL,
                           this);
        m_info_plist_cb->Connect(m_info_plist_cb->GetId(),
                                 wxEVT_COMMAND_CHECKBOX_CLICKED,
                                 wxCommandEventHandler(BundleConfigDialog::onPlistCheckboxPressed),
                                 NULL,
                                 this);

        this->SetSizerAndFit(sizer);
        this->Centre();

        // Load last stored size & position from the configuration tool
        SetName("BundleConfigDialog");
        WindowAttrManager::Load(this);
    }
开发者ID:capturePointer,项目名称:codelite,代码行数:88,代码来源:macbundler.cpp


示例3: ReverseClick

void ReverseClick(wxCheckBox &list,wxEvent &)
{
  ((t_File*)list.GetParent())->SetReverse();
}
开发者ID:msperl,项目名称:Period,代码行数:4,代码来源:xtdialog.cpp


示例4: wxPanel

wxPanel* SjViewSettingsPage::CreateFontPage(wxWindow* parent)
{
	// init dialog
	wxPanel* page = new wxPanel(parent, -1);
	wxSizer* sizer1 = new wxBoxSizer(wxVERTICAL);
	page->SetSizer(sizer1);

	sizer1->Add(SJ_DLG_SPACE, SJ_DLG_SPACE); // some space

	wxStaticText* staticText = new wxStaticText(page, -1,
	        _("You can set independent font and cover sizes to use in the main window. The sizes\nrefer to a zoom of 100%. If you zoom in or out (eg. by using the \"+\" or \"-\" keys), both\nsizes will grow or shrink proportionally."));
	sizer1->Add(staticText,
	            0, wxALL, SJ_DLG_SPACE);

	m_orgFace           = g_mainFrame->GetBaseFontFace();
	m_orgSize           = g_mainFrame->GetBaseFontSize();
	m_orgColumnWidth    = g_mainFrame->GetBaseColumnWidth();
	m_orgCoverHeight    = g_mainFrame->GetBaseCoverHeight();

	wxFlexGridSizer* sizer3 = new wxFlexGridSizer(2, SJ_DLG_SPACE/2, SJ_DLG_SPACE);
	sizer1->Add(sizer3, 0, wxGROW|wxALL, SJ_DLG_SPACE);

	#define SLIDER_W 240

	// font face
	sizer3->Add(new wxStaticText(page, -1, _("Font:")), 0, wxALIGN_CENTER_VERTICAL);

	m_fontFaceChoice = new wxChoice(page, IDC_FONTFACECHOICE/*, wxDefaultPosition, wxSize(FONTFACE_W, -1)*/);

	const wxArrayString& fontFaces = g_tools->GetFacenames();

	wxString currFace;
	int facesIndex, facesCount = fontFaces.GetCount();
	for( facesIndex = 0; facesIndex < facesCount; facesIndex++ )
	{
		currFace = fontFaces.Item(facesIndex);
		if( currFace[0] != '?' && currFace[0] != '#' ) // ignore funny font names as "?234" eg. on os x/wx2.6.3
		{
			m_fontFaceChoice->Append(currFace);
			if( currFace.CmpNoCase(m_orgFace)==0 )
			{
				m_fontFaceChoice->SetSelection(m_fontFaceChoice->GetCount()-1);
			}
		}
	}

	SjDialog::SetCbWidth(m_fontFaceChoice);
	sizer3->Add(m_fontFaceChoice, 0, wxALIGN_CENTER_VERTICAL);

	// font size
	sizer3->Add(new wxStaticText(page, -1, _("Font size:")), 0, wxALIGN_CENTER_VERTICAL);

	wxBoxSizer* sizer4 = new wxBoxSizer(wxHORIZONTAL);
	sizer3->Add(sizer4);

	m_fontPtSlider = new wxSlider(page, IDC_FONTPTSLIDER, m_orgSize, SJ_MIN_FONT_SIZE, SJ_MAX_FONT_SIZE, wxDefaultPosition, wxSize(SLIDER_W, -1), wxSL_HORIZONTAL);
	sizer4->Add(m_fontPtSlider, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, SJ_DLG_SPACE);

	m_fontPtText = new wxStaticText(page, -1, wxEmptyString);
	UpdateFontPtText(TRUE);
	sizer4->Add(m_fontPtText, 0, wxALIGN_CENTER_VERTICAL, 0);


	// use font in dialogs?
	sizer3->Add(SJ_DLG_SPACE, SJ_DLG_SPACE);

	m_useViewFontInDlgCheckBox = new wxCheckBox(page, -1, _("Use this font for dialogs, too"));
	m_useViewFontInDlgCheckBox->SetValue((g_accelModule->m_flags&SJ_ACCEL_USE_VIEW_FONT_IN_DLG)!=0);
	sizer3->Add(m_useViewFontInDlgCheckBox, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, SJ_DLG_SPACE);

	// column width
	sizer3->Add(new wxStaticText(page, -1, _("Column width:")), 0, wxALIGN_CENTER_VERTICAL);

	sizer4 = new wxBoxSizer(wxHORIZONTAL);
	sizer3->Add(sizer4);

	m_columnWidthSlider = new wxSlider(page, IDC_COLUMNWIDTHSLIDER, m_orgColumnWidth/COLUMNWIDTH_DIVISOR, SJ_MIN_COLUMN_WIDTH/COLUMNWIDTH_DIVISOR, SJ_MAX_COLUMN_WIDTH/COLUMNWIDTH_DIVISOR, wxDefaultPosition, wxSize(SLIDER_W, -1), wxSL_HORIZONTAL);
	sizer4->Add(m_columnWidthSlider, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, SJ_DLG_SPACE);

	m_columnWidthText = new wxStaticText(page, -1, wxEmptyString);
	UpdateColumnWidthText();
	sizer4->Add(m_columnWidthText, 0, wxALIGN_CENTER_VERTICAL);


	// cover height (= width = size)
	sizer3->Add(new wxStaticText(page, -1, _("Cover size:")), 0, wxALIGN_CENTER_VERTICAL);

	sizer4 = new wxBoxSizer(wxHORIZONTAL);
	sizer3->Add(sizer4);

	m_coverHeightSlider = new wxSlider(page, IDC_COVERHEIGHTSLIDER, m_orgCoverHeight, 1, 100, wxDefaultPosition, wxSize(SLIDER_W, -1), wxSL_HORIZONTAL);
	sizer4->Add(m_coverHeightSlider, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, SJ_DLG_SPACE);

	m_coverHeightText = new wxStaticText(page, -1, wxEmptyString);
	UpdateCoverHeightText();
	sizer4->Add(m_coverHeightText, 0, wxALIGN_CENTER_VERTICAL);

	wxButton* button = new wxButton(page, IDC_FONTDEFAULT, _("Reset to default values"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
	sizer1->Add(button, 0, wxALL, SJ_DLG_SPACE);

//.........这里部分代码省略.........
开发者ID:conradstorz,项目名称:silverjuke,代码行数:101,代码来源:viewsettings.cpp


示例5: xylib_get_version

bool App::OnInit()
{
    // to make life simpler, use the same version number as xylib
    wxString version = xylib_get_version();

    // reading numbers won't work with decimal points different than '.'
    setlocale(LC_NUMERIC, "C");

    SetAppName("xyConvert");
    wxCmdLineParser cmdLineParser(cmdLineDesc, argc, argv);
    if (cmdLineParser.Parse(false) != 0) {
        cmdLineParser.Usage();
        return false;
    }
    if (cmdLineParser.Found(wxT("V"))) {
        wxMessageOutput::Get()->Printf("xyConvert, powered by xylib "
                                       + version + "\n");
        return false;
    }

    wxFrame *frame = new wxFrame(NULL, wxID_ANY, "xyConvert");

    //frame->SetIcon(wxICON(xyconvert));
#ifdef __WXMSW__
    frame->SetIcon(wxIcon("xyconvert")); // load from a resource
#else
    wxIconBundle ib;
    ib.AddIcon(wxIcon(xyconvert48_xpm));
    ib.AddIcon(wxIcon(xyconvert16_xpm));
    frame->SetIcons(ib);
#endif

    wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
    browser = new XyFileBrowser(frame);
    sizer->Add(browser, wxSizerFlags(1).Expand());

    wxStaticBoxSizer *outsizer = new wxStaticBoxSizer(wxVERTICAL, frame,
                                                      "TSV output");
    wxBoxSizer *hsizer = new wxBoxSizer(wxHORIZONTAL);
    dir_cb = new wxCheckBox(frame, wxID_ANY, "directory:");
    hsizer->Add(dir_cb, wxSizerFlags().Centre().Border());
    dirpicker = new wxDirPickerCtrl(frame, wxID_ANY);
    hsizer->Add(dirpicker, wxSizerFlags(1));
    hsizer->AddSpacer(10);
    hsizer->Add(new wxStaticText(frame, wxID_ANY, "extension:"),
                  wxSizerFlags().Centre().Border());
    ext_tc = new wxTextCtrl(frame, wxID_ANY, "xy");
    ext_tc->SetMinSize(wxSize(50, -1));
    hsizer->Add(ext_tc, wxSizerFlags().Centre());
    hsizer->AddSpacer(10);
    overwrite = new wxCheckBox(frame, wxID_ANY, "allow overwrite");
    hsizer->Add(overwrite, wxSizerFlags().Centre());
    outsizer->Add(hsizer, wxSizerFlags().Expand());
    header = new wxCheckBox(frame, wxID_ANY, "add header");
    outsizer->Add(header, wxSizerFlags().Border());
    sizer->Add(outsizer, wxSizerFlags().Expand().Border());

    wxBoxSizer *btn_sizer = new wxBoxSizer(wxHORIZONTAL);
    wxButton *about = new wxButton(frame, wxID_ABOUT);
    wxButton *convert = new wxButton(frame, wxID_CONVERT);
    wxButton *close = new wxButton(frame, wxID_EXIT);
    btn_sizer->Add(about, wxSizerFlags().Border());
    btn_sizer->AddStretchSpacer();
    btn_sizer->Add(convert, wxSizerFlags().Border());
    btn_sizer->Add(close, wxSizerFlags().Border());
    sizer->Add(btn_sizer, wxSizerFlags().Expand().Border());

    if (cmdLineParser.GetParamCount() > 0) {
        wxFileName fn(cmdLineParser.GetParam(0));
        if (fn.FileExists()) {
            browser->filectrl->SetPath(fn.GetFullPath());
            browser->update_file_options();
        }
    }
    dirpicker->SetPath(browser->filectrl->GetDirectory());
    dirpicker->Enable(false);

    frame->SetSizerAndFit(sizer);
#ifdef __WXGTK__
    frame->SetSize(-1, 550);
#endif

#ifdef __WXMSW__
    // wxMSW bug workaround
    frame->SetBackgroundColour(browser->GetBackgroundColour());
#endif

    frame->Show();

    Connect(dir_cb->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED,
            (wxObjectEventFunction) &App::OnDirCheckBox);
    browser->Connect(browser->filectrl->GetId(), wxEVT_FILECTRL_FOLDERCHANGED,
            (wxObjectEventFunction) &App::OnFolderChanged, NULL, this);

    Connect(about->GetId(), wxEVT_COMMAND_BUTTON_CLICKED,
            (wxObjectEventFunction) &App::OnAbout);
    Connect(convert->GetId(), wxEVT_COMMAND_BUTTON_CLICKED,
            (wxObjectEventFunction) &App::OnConvert);
    Connect(close->GetId(), wxEVT_COMMAND_BUTTON_CLICKED,
            (wxObjectEventFunction) &App::OnClose);
//.........这里部分代码省略.........
开发者ID:simedcn,项目名称:fityk,代码行数:101,代码来源:xybrowser.cpp


示例6: getResults

    bool getResults(wxArrayString& out, bool* createInfoPlistFile, bool* createIcon)
    {
        if(not m_accepted) return false;

        *createInfoPlistFile = m_info_plist_cb->IsChecked();
        *createIcon = m_icon_cb->IsChecked();

        const wxArrayString& items = m_choices_widget->GetStrings();
        const int count = items.GetCount();
        for(int n = 0; n < count; n++) {
            if(m_choices_widget->IsChecked(n)) out.Add(items[n]);
        }

        return true;
    }
开发者ID:capturePointer,项目名称:codelite,代码行数:15,代码来源:macbundler.cpp


示例7: OnRun

void MyFrame::OnRun(wxCommandEvent &event) {
    ostringstream stream;

    text->Clear();

    unique_ptr<eph::nominate_abstract> nsl;

    switch (methods->GetCurrentSelection()) {
        case 0:
            nsl = make_unique<eph::nominate_pal>(stream, lines);
            break;
        case 1:
            nsl = make_unique<eph::nominate_sdv_lpe>(stream, lines);
            break;
        case 2:
            nsl = make_unique<eph::nominate_sdv_lpe>(stream, lines, eph::ENABLE_SL::YES);
            break;
    }

    auto result = nsl->nominate(finalists->GetCurrentSelection()+1, noms_per_ballot->GetCurrentSelection()+1);

    if (verbose->GetValue()) {
        text->AppendText(stream.str());
    }
    text->AppendText(result);
}
开发者ID:guy-middleton,项目名称:EPH,代码行数:26,代码来源:wxmain.cpp


示例8: OnSize

void MyStatusBar::OnSize(wxSizeEvent& event)
{
#if wxUSE_CHECKBOX
    if ( !m_checkbox )
        return;
#endif

    wxRect rect;
    if (!GetFieldRect(Field_Checkbox, rect))
    {
        event.Skip();
        return;
    }

#if wxUSE_CHECKBOX
    wxRect rectCheck = rect;
    rectCheck.Deflate(2);
    m_checkbox->SetSize(rectCheck);
#endif

    GetFieldRect(Field_Bitmap, rect);
    wxSize size = m_statbmp->GetSize();

    m_statbmp->Move(rect.x + (rect.width - size.x) / 2,
                    rect.y + (rect.height - size.y) / 2);

    event.Skip();
}
开发者ID:emutavchi,项目名称:pxCore,代码行数:28,代码来源:statbar.cpp


示例9: DoToggle

void MyStatusBar::DoToggle()
{
#if wxUSE_CHECKBOX
    if ( m_checkbox->GetValue() )
    {
#if wxUSE_TIMER
        m_timer.Start(1000);
#endif

        m_statbmp->SetIcon(wxIcon(green_xpm));

        UpdateClock();
    }
    else // don't show clock
    {
#if wxUSE_TIMER
        m_timer.Stop();
#endif

        m_statbmp->SetIcon(wxIcon(red_xpm));

        SetStatusText(wxEmptyString, Field_Clock);
    }
#endif // wxUSE_CHECKBOX
}
开发者ID:emutavchi,项目名称:pxCore,代码行数:25,代码来源:statbar.cpp


示例10: GetLabel

void LabelTestCase::GetLabel()
{
    const wxString testLabelArray[] = {
        "label without mnemonics and markup",
        "label with &mnemonic",
        "label with <span foreground='blue'>some</span> <b>markup</b>",
        "label with <span foreground='blue'>some</span> <b>markup</b> and &mnemonic",
    };

    // test calls to SetLabel() and then to GetLabel()

    for ( unsigned int s = 0; s < WXSIZEOF(testLabelArray); s++ )
    {
        SET_LABEL(testLabelArray[s]);

        // GetLabel() should always return the string passed to SetLabel()
        CPPUNIT_ASSERT_EQUAL( testLabelArray[s], m_st->GetLabel() );
        CPPUNIT_ASSERT_EQUAL( testLabelArray[s], m_cb->GetLabel() );
    }


    // test calls to SetLabelText() and then to GetLabel()

    const wxString& testLabel = "label without mnemonics and markup";
    SET_LABEL_TEXT(testLabel);
    CPPUNIT_ASSERT_EQUAL( testLabel, m_st->GetLabel() );
    CPPUNIT_ASSERT_EQUAL( testLabel, m_cb->GetLabel() );

    const wxString& testLabel2 = "label with &mnemonic";
    const wxString& testLabelText2 = "label with &&mnemonic";
    SET_LABEL_TEXT(testLabel2);
    CPPUNIT_ASSERT_EQUAL( testLabelText2, m_st->GetLabel() );
    CPPUNIT_ASSERT_EQUAL( testLabelText2, m_cb->GetLabel() );

    const wxString& testLabel3 = "label with <span foreground='blue'>some</span> <b>markup</b>";
    SET_LABEL_TEXT(testLabel3);
    CPPUNIT_ASSERT_EQUAL( testLabel3, m_st->GetLabel() );
    CPPUNIT_ASSERT_EQUAL( testLabel3, m_cb->GetLabel() );

    const wxString& testLabel4 = "label with <span foreground='blue'>some</span> <b>markup</b> and &mnemonic";
    const wxString& testLabelText4 = "label with <span foreground='blue'>some</span> <b>markup</b> and &&mnemonic";
    SET_LABEL_TEXT(testLabel4);
    CPPUNIT_ASSERT_EQUAL( testLabelText4, m_st->GetLabel() );
    CPPUNIT_ASSERT_EQUAL( testLabelText4, m_cb->GetLabel() );
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:45,代码来源:label.cpp


示例11: onPlistCheckboxPressed

    void onPlistCheckboxPressed(wxCommandEvent& evt)
    {
        const bool on = m_info_plist_cb->IsChecked();

        m_get_info_string->Enable(on);
        m_version->Enable(on);
        m_icon_file->Enable(on);
        m_identifier->Enable(on);
        m_signature->Enable(on);
    }
开发者ID:capturePointer,项目名称:codelite,代码行数:10,代码来源:macbundler.cpp


示例12: on_widget_change

void DataExportDlg::on_widget_change()
{
    wxString s = (only_a_cb->GetValue() ? wxT("if a: ") : wxT("all: "));
    for (size_t i = 0; i < list->GetCount(); ++i) {
        if (list->IsChecked(i)) {
            if (!s.EndsWith(wxT(": ")) && !cv[i].empty())
                    s += wxT(", ");
            s += cv[i];
        }
    }
    text->ChangeValue(s);
    FindWindow(wxID_OK)->Enable(true);
}
开发者ID:simedcn,项目名称:fityk,代码行数:13,代码来源:exportd.cpp


示例13: OnTextChanged

void DataExportDlg::OnTextChanged(wxCommandEvent&)
{
    //if (!text->IsModified())
    //    return;
    string s = wx2s(text->GetValue());
    size_t colon = s.find(':');
    bool parsable = (ftk->check_syntax("print " + s) && colon != string::npos);
    FindWindow(wxID_OK)->Enable(parsable);
    if (parsable) {
        only_a_cb->SetValue(s.substr(0, colon) == "if a");
        vector<string> v = split_string(s.substr(colon + 1), ',');
        vm_foreach (string, i, v)
            *i = strip_string(*i);
        for (size_t i = 0; i < list->GetCount(); ++i)
            list->Check(i, contains_element(v, wx2s(cv[i])));
    }
}
开发者ID:simedcn,项目名称:fityk,代码行数:17,代码来源:exportd.cpp


示例14: OnFontDefault

void SjViewSettingsPage::OnFontDefault(wxCommandEvent&)
{
	// use default values
	long i = m_fontFaceChoice->FindString(SJ_DEF_FONT_FACE);
	if( i == -1 ) i = 0;
	m_fontFaceChoice->SetSelection(i);

	m_fontPtSlider->SetValue(SJ_DEF_FONT_SIZE);
	UpdateFontPtText();
	m_columnWidthSlider->SetValue(SJ_DEF_COLUMN_WIDTH / COLUMNWIDTH_DIVISOR);
	UpdateColumnWidthText();
	m_coverHeightSlider->SetValue(SJ_DEF_COVER_HEIGHT);
	UpdateCoverHeightText();

	m_useViewFontInDlgCheckBox->SetValue(false);

	g_mainFrame->SetFontNCoverBase(SJ_DEF_FONT_FACE, SJ_DEF_FONT_SIZE, SJ_DEF_COLUMN_WIDTH, SJ_DEF_COVER_HEIGHT);
}
开发者ID:conradstorz,项目名称:silverjuke,代码行数:18,代码来源:viewsettings.cpp


示例15: OnPlotKind

void AuxPlotConfDlg::OnPlotKind(wxCommandEvent& event)
{
    AuxPlotKind k = static_cast<AuxPlotKind>(event.GetSelection());
    ap_->change_plot_kind(k);
    rev_cb_->Enable(k != apk_empty && k != apk_cum_chi2);
}
开发者ID:darckense,项目名称:fityk,代码行数:6,代码来源:aplot.cpp


示例16: reset_user_profile

	bool reset_user_profile() const { return cbox_reset != nullptr ? cbox_reset->GetValue() : false; }
开发者ID:repetier,项目名称:Slic3r,代码行数:1,代码来源:ConfigWizard_private.hpp


示例17: OnFolderChanged

void App::OnFolderChanged(wxFileCtrlEvent& event)
{
    if (!dir_cb->GetValue())
        dirpicker->SetPath(event.GetDirectory());
}
开发者ID:simedcn,项目名称:fityk,代码行数:5,代码来源:xybrowser.cpp


示例18: OnConvert

void App::OnConvert(wxCommandEvent&)
{
    bool with_header = header->GetValue();
    int block_nr = browser->block_ch->GetSelection();
    int idx_x = browser->x_column->GetValue();
    int idx_y = browser->y_column->GetValue();
    bool has_err = browser->std_dev_cb->GetValue();
    int idx_err = browser->s_column->GetValue();
    bool dec_comma = browser->comma_cb->GetValue();

    wxArrayString paths;
    browser->filectrl->GetPaths(paths);
    string options;
    if (dec_comma)
        options = "decimal-comma";

    for (size_t i = 0; i < paths.GetCount(); ++i) {
        wxFileName old_filename(paths[i]);
        wxString fn = old_filename.GetName() + "." + ext_tc->GetValue();
        wxString new_filename = dirpicker->GetPath() + wxFILE_SEP_PATH + fn;
        if (!overwrite->GetValue() && wxFileExists(new_filename)) {
            int answer = wxMessageBox("File " + fn + " exists.\n"
                                      "Overwrite?",
                                      "Overwrite?",
                                      wxYES|wxNO|wxCANCEL|wxICON_QUESTION);
            if (answer == wxCANCEL)
                break;
            if (answer != wxYES)
                continue;

        }
        FILE *f = fopen(new_filename.mb_str(), "w");
        try {
            wxBusyCursor wait;
            xylib::DataSet const *ds = xylib::load_file(wx2s(paths[i]),
                                            browser->get_filetype(), options);
            xylib::Block const *block = ds->get_block(block_nr);
            xylib::Column const& xcol = block->get_column(idx_x);
            xylib::Column const& ycol = block->get_column(idx_y);
            xylib::Column const* ecol = (has_err ? &block->get_column(idx_err)
                                                 : NULL);
            const int np = block->get_point_count();

            if (with_header) {
                fprintf(f, "# converted by xyConvert %s from file:\n# %s\n",
                        xylib_get_version(),
                        wx2s(new_filename).c_str());
                if (ds->get_block_count() > 1)
                    fprintf(f, "# (block %d) %s\n", block_nr,
                                                    block->get_name().c_str());
                if (block->get_column_count() > 2) {
                    string xname = (xcol.get_name().empty() ? string("x")
                                                            : xcol.get_name());
                    string yname = (ycol.get_name().empty() ? string("y")
                                                            : ycol.get_name());
                    fprintf(f, "#%s\t%s", xname.c_str(), yname.c_str());
                    if (has_err) {
                        string ename = (ecol->get_name().empty() ? string("err")
                                                            : ecol->get_name());
                        fprintf(f, "\t%s", ename.c_str());
                    }
                    fprintf(f, "\n");
                }
            }

            for (int j = 0; j < np; ++j) {
                fprintf(f, "%.9g\t%.9g", xcol.get_value(j), ycol.get_value(j));
                if (has_err)
                    fprintf(f, "\t%.9g", ecol->get_value(j));
                fprintf(f, "\n");
            }
        } catch (runtime_error const& e) {
            wxMessageBox(e.what(), "Error", wxCANCEL|wxICON_ERROR);
        }
        fclose(f);
    }
}
开发者ID:simedcn,项目名称:fityk,代码行数:77,代码来源:xybrowser.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ wxChildFocusEvent类代码示例发布时间:2022-05-31
下一篇:
C++ wxCharBuffer类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap