当前位置: 首页>>代码示例>>C++>>正文


C++ wxGetTextFromUser函数代码示例

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


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

示例1: wxGetTextFromUser

void frmDatabaseDesigner::OnAddDiagram(wxCommandEvent &event)
{
	wxString newName = wxGetTextFromUser(_("New Diagram Name"), _("Diagram Name"), _("unnamed"), this);

	if (!newName.IsEmpty())
	{
		diagrams->AddPage(design->createDiagram(diagrams, newName, false)->getView(), newName);
		setModelChanged(true);
	}

	UpdateToolbar();
}
开发者ID:GHnubsST,项目名称:pgadmin3,代码行数:12,代码来源:frmDatabaseDesigner.cpp

示例2: wxGetTextFromUser

/*
 * buttonNewsAddClick
 */
void panelAdmin::buttonNewsAddClick(wxCommandEvent& event) {
    string Message;

    Message = (const char *) wxGetTextFromUser( wxT("Enter your news"), wxT("New News" )).mb_str(wxConvUTF8);

	if( Message.size() < 5 ) {
		wxMessageBox( wxT("Minimum of 5 characters for the news"));
        return;
	}

	_mainApp->serverGet()->moduleGet< moduleMessages >( modMESSAGES )->newsNew( Message );
}
开发者ID:segrax,项目名称:KiLLARMY,代码行数:15,代码来源:panelAdmin.cpp

示例3: _

void HTMLButcherAssortedFileGroupsDialog::do_add()
{
    wxString groupname=wxGetTextFromUser(_("Group name"), _("Add Assorted File Group"),
        wxEmptyString, this);
    if (!groupname.IsEmpty()) {
        ButcherProjectBaseAutoUpdate upd(GetProject());

        unsigned long newid=GetProject()->AssortedFileGroups().Add(groupname);
        item_add(make_description(GetProject()->AssortedFileGroups().Get(newid)), newid);
    }

}
开发者ID:RangelReale,项目名称:htmlbutcher,代码行数:12,代码来源:DialogListEdit.cpp

示例4: wxGetTextFromUser

void MyFrame::OnSetArgs(wxCommandEvent& event)
{
	wxString args = wxGetTextFromUser(_T("Please enter command line arguments"), _T("MakeSplash"),
		wxGetApp().m_cmdLine);
	if (!args.IsEmpty())
	{
		wxGetApp().SetDefaults();
		wxGetApp().m_cmdLine = args;
		wxGetApp().m_parser.SetCmdLine(wxGetApp().m_cmdLine);
		wxGetApp().ProcessCommandLine(this);
	}
}
开发者ID:stahta01,项目名称:wxCode_components,代码行数:12,代码来源:splashtext.cpp

示例5: wxGetTextFromUser

void mmCategDialog::OnEdit(wxCommandEvent& /*event*/)
{
    if (selectedItemId_ == root_ || !selectedItemId_)
        return;

    const wxString& old_name = m_treeCtrl->GetItemText(selectedItemId_);
    const wxString& msg = wxString::Format(_("Enter a new name for %s"), old_name);
    const wxString text = wxGetTextFromUser(msg
        , _("Edit Category"), m_textCtrl->GetValue());
    if (text.IsEmpty())
        return;
    m_textCtrl->SetValue(text);

    mmTreeItemCateg* iData = dynamic_cast<mmTreeItemCateg*>
        (m_treeCtrl->GetItemData(selectedItemId_));

    if (iData->getSubCategData()->SUBCATEGID == -1) // not subcateg
    {
        Model_Category::Data_Set categories = Model_Category::instance().find(Model_Category::CATEGNAME(text));
        if (!categories.empty())
        {
            wxString errMsg = _("Category with same name exists");
            wxMessageBox(errMsg, _("Organise Categories: Editing Error"), wxOK | wxICON_ERROR);
            return;
        }
        Model_Category::Data* category = iData->getCategData();
        category->CATEGNAME = text;
        Model_Category::instance().save(category);
        mmWebApp::MMEX_WebApp_UpdateCategory();
    }
    else
    {
        Model_Category::Data* category = iData->getCategData();
        const auto &subcategories = Model_Category::sub_category(category);
        for (const auto &entry : subcategories)
        {
            if (entry.SUBCATEGNAME == text)
            {
                wxString errMsg = _("Sub Category with same name exists");
                wxMessageBox(errMsg, _("Organise Categories: Editing Error"), wxOK | wxICON_ERROR);
                return;
            }
        }
        Model_Subcategory::Data* sub_category = iData->getSubCategData();
        sub_category->SUBCATEGNAME = text;
        Model_Subcategory::instance().save(sub_category);
        mmWebApp::MMEX_WebApp_UpdateCategory();
    }

    m_treeCtrl->SetItemText(selectedItemId_, text);

    refreshRequested_ = true;
}
开发者ID:bacanhtai,项目名称:moneymanagerex,代码行数:53,代码来源:categdialog.cpp

示例6: WXUNUSED

void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event))
{
    wxString str = wxGetTextFromUser
                   (
                    _("Enter your number:"),
                    _("Try to guess my number!"),
                    wxEmptyString,
                    this
                   );

    if ( str.empty() )
    {
        // cancelled
        return;
    }

    long num;
    if ( !str.ToLong(&num) || num < 0 )
    {
        str = _("You've probably entered an invalid number.");
    }
    else if ( num == 9 )
    {
        // this message is not translated (not in catalog) because we used wxT()
        // and not _() around it
        str = wxT("You've found a bug in this program!");
    }
    else if ( num == 17 )
    {
        str.clear();

        // string must be split in two -- otherwise the translation would't be
        // found
        str << _("Congratulations! you've won. Here is the magic phrase:")
            << _("cannot create fifo `%s'");
    }
    else
    {
        // this is a more implicit way to write _() but note that if you use it
        // you must ensure that the strings get extracted in the message
        // catalog as by default xgettext won't do it; it only knows of _(),
        // not of wxTRANSLATE(). As internat's readme.txt says you should thus
        // call xgettext with -kwxTRANSLATE.
        str = wxGetTranslation(wxTRANSLATE("Bad luck! try again..."));

        // note also that if we want 'str' to contain a localized string
        // we need to use wxGetTranslation explicitly as wxTRANSLATE just
        // tells xgettext to extract the string but has no effect on the
        // runtime of the program!
    }

    wxMessageBox(str, _("Result"), wxOK | wxICON_INFORMATION);
}
开发者ID:ExperimentationBox,项目名称:Edenite,代码行数:53,代码来源:internat.cpp

示例7: wxGetTextFromUser

void frmDatabaseDesigner::OnRenameDiagram(wxCommandEvent &event)
{
	hdDrawingView *view = (hdDrawingView *) diagrams->GetPage(diagrams->GetSelection());
	int diagramIndex = view->getIdx();
	wxString name = wxGetTextFromUser(_("Rename diagram ") + diagrams->GetPageText(diagramIndex) + _(" to:"), _("Rename diagram..."), diagrams->GetPageText(diagramIndex), this);
	if(!name.IsEmpty() && !name.IsSameAs(diagrams->GetPageText(diagramIndex), false))
	{
		view->getDrawing()->setName(name);
		diagrams->SetPageText(diagramIndex, name);
		setModelChanged(true);
	}
}
开发者ID:dragansah,项目名称:pgadmin3,代码行数:12,代码来源:frmDatabaseDesigner.cpp

示例8: WXUNUSED

void MainFrame::on_rename_file(wxCommandEvent& WXUNUSED(event))
{
    MetalinkFile file = editor_.get_file();
    wxString filename = wxGetTextFromUser(
        wxT("Please enter a file name:"),
        wxT("Rename file"),
        file.get_filename()
    );
    if(filename == wxT("")) return;
    file.set_filename(filename);
    editor_.set_file(file);
}
开发者ID:hampus,项目名称:metalink-editor,代码行数:12,代码来源:MainFrame.cpp

示例9: wxGetTextFromUser

bool hdSimpleTextTool::callDialog(hdDrawingView *view)
{
	wxString sNewValue = wxGetTextFromUser(dlgMessage, dlgCaption, txtFigure->getText(), view);
	if (!sNewValue.IsEmpty())
	{
		txtFigure->setText(sNewValue);
		view->notifyChanged();
		return true;
	}
	else
		return false;
}
开发者ID:kleopatra999,项目名称:pgadmin3,代码行数:12,代码来源:hdSimpleTextTool.cpp

示例10: XRCCTRL

void ProjectsFileMasksDlg::OnEdit(wxCommandEvent& /*event*/)
{
    wxListBox* pList = XRCCTRL(*this, "lstCategories", wxListBox);
    wxString oldName = pList->GetStringSelection();
    wxString groupName = wxGetTextFromUser(_("Rename the group:"),
                                            _("Edit group"), oldName);
    if (!groupName.IsEmpty() && groupName != oldName)
    {
        m_FileGroupsAndMasksCopy.RenameGroup(pList->GetSelection(), groupName);
        pList->SetString(pList->GetSelection(), groupName);
    }
}
开发者ID:stahta01,项目名称:codeblocks_r7456,代码行数:12,代码来源:projectsfilemasksdlg.cpp

示例11: wxGetTextFromUser

// Go to move... menu command
void SimpleGoFrame::GoToMove(wxCommandEvent& event)
{	panel->gnugopause = true;
	wxString input = wxGetTextFromUser(wxString::Format("Enter the move number to go to, between 0 and %d:", panel->totmove), "Go to move", "");
	if(!input.IsSameAs(""))
	{	int num = wxAtoi(input);
		if(num>=0 && num<=panel->totmove)
		{	panel->gnugopause = true;
			panel->gnugoscore = false;
			panel->curmove = num;
			panel->UpdateBoard();
		}
	}
}
开发者ID:curtisbright,项目名称:simplego,代码行数:14,代码来源:simplego-frame.cpp

示例12: wxGetTextFromUser

void ProjectsFileMasksDlg::OnAdd(wxCommandEvent& /*event*/)
{
    wxString groupName = wxGetTextFromUser(_("Enter the new group name:"),
                                            _("New group"));
    if (groupName.IsEmpty())
        return;
    m_FileGroupsAndMasksCopy.AddGroup(groupName);
    wxListBox* pList = XRCCTRL(*this, "lstCategories", wxListBox);
    pList->Append(groupName);
    pList->SetSelection(pList->GetCount() - 1);
    ListChange();
    XRCCTRL(*this, "txtFileMasks", wxTextCtrl)->SetFocus();
}
开发者ID:stahta01,项目名称:codeblocks_r7456,代码行数:13,代码来源:projectsfilemasksdlg.cpp

示例13: WXUNUSED

void MyFrame::OnHostname( wxCommandEvent& WXUNUSED(event) )
{
    if (GetHostname()->GetStringSelection() == wxT("..."))
    {
        wxString s = wxGetTextFromUser(wxT("Specify the name of the host (ignored under DDE)"),
            wxT("Host Name"), wxEmptyString, this);
        if (!s.IsEmpty() && s != IPC_HOST)
        {
            GetHostname()->Insert(s, 0);
            GetHostname()->SetSelection(0);
        }
    }
}
开发者ID:BauerBox,项目名称:wxWidgets,代码行数:13,代码来源:client.cpp

示例14: wxGetTextFromUser

void ConfigDialog::OnLibraryPathsDClick(wxCommandEvent& event)
{
	wxString def = listLibraryPaths->GetStringSelection();

	wxString path = wxGetTextFromUser("Enter path:", "Library", def, this);
	if (!path.IsEmpty())
	{
		if (listLibraryPaths->GetSelection() >= 0)
		{
			listLibraryPaths->SetString(listLibraryPaths->GetSelection(), path);
		}
	}
}
开发者ID:mihazet,项目名称:avr-ide,代码行数:13,代码来源:ConfigDialog.cpp

示例15: wxGetTextFromUser

/* TextureXPanel::newTexture
 * Creates a new, empty texture
 *******************************************************************/
void TextureXPanel::newTexture()
{
	// Prompt for new texture name
	string name = wxGetTextFromUser("Enter a texture name:", "New Texture");

	// Do nothing if no name entered
	if (name.IsEmpty())
		return;

	// Process name
	name = name.Upper().Truncate(8);

	// Create new texture
	CTexture* tex = new CTexture();
	tex->setName(name);
	tex->setState(2);

	// Default size = 64x128
	tex->setWidth(64);
	tex->setHeight(128);

	// Setup texture scale
	if (texturex.getFormat() == TXF_TEXTURES)
	{
		tex->setScale(1, 1);
		tex->setExtended(true);
	}
	else
		tex->setScale(0, 0);

	// Add it after the last selected item
	int selected = list_textures->getLastSelected();
	if (selected == -1) selected = texturex.nTextures() - 1; // Add to end of the list if nothing selected
	texturex.addTexture(tex, selected + 1);

	// Record undo level
	undo_manager->beginRecord("New Texture");
	undo_manager->recordUndoStep(new TextureCreateDeleteUS(this, tex, true));
	undo_manager->endRecord(true);

	// Update texture list
	list_textures->updateList();

	// Select the new texture
	list_textures->clearSelection();
	list_textures->selectItem(selected + 1);
	list_textures->EnsureVisible(selected + 1);

	// Update variables
	modified = true;
}
开发者ID:Blzut3,项目名称:SLADE,代码行数:54,代码来源:TextureXPanel.cpp


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