本文整理汇总了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();
}
示例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 );
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
}
示例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();
}
}
}
示例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();
}
示例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);
}
}
}
示例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);
}
}
}
示例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;
}