本文整理汇总了C++中CInputDialog类的典型用法代码示例。如果您正苦于以下问题:C++ CInputDialog类的具体用法?C++ CInputDialog怎么用?C++ CInputDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CInputDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMenuMkdir
void CLocalListView::OnMenuMkdir(wxCommandEvent& event)
{
CInputDialog dlg;
if (!dlg.Create(this, _("Create directory"), _("Please enter the name of the directory which should be created:")))
return;
if (dlg.ShowModal() != wxID_OK)
return;
if (dlg.GetValue() == _T(""))
{
wxBell();
return;
}
wxFileName fn(dlg.GetValue(), _T(""));
fn.Normalize(wxPATH_NORM_ALL, m_dir);
bool res;
{
wxLogNull log;
res = fn.Mkdir(fn.GetPath(), 0777, wxPATH_MKDIR_FULL);
}
if (!res)
wxBell();
DisplayDir(m_dir);
}
示例2: new
CInputDialog* CInputDialog::NewLC(MInputObserver& aObserver,CMainEngine& aMainEngine,TInt aCommandType)
{
CInputDialog* self = new (ELeave)CInputDialog(aObserver,aMainEngine,aCommandType);
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
示例3: OnSaveAs
void CFilterDialog::OnSaveAs(wxCommandEvent& event)
{
CInputDialog dlg;
dlg.Create(this, _("Enter name for filterset"), _("Please enter a unique name for this filter set"));
if (dlg.ShowModal() != wxID_OK)
return;
wxString name = dlg.GetValue();
if (name == _T(""))
{
wxMessageBox(_("No name for the filterset given."), _("Cannot save filterset"), wxICON_INFORMATION);
return;
}
wxChoice* pChoice = XRCCTRL(*this, "ID_SETS", wxChoice);
int pos = pChoice->FindString(name);
if (pos != wxNOT_FOUND)
{
if (wxMessageBox(_("Given filterset name already exists, overwrite filter set?"), _("Filter set already exists"), wxICON_QUESTION | wxYES_NO) != wxYES)
return;
}
if (pos == wxNOT_FOUND)
{
pos = m_filterSets.size();
m_filterSets.push_back(m_filterSets[0]);
pChoice->Append(name);
}
else
m_filterSets[pos] = m_filterSets[0];
m_filterSets[pos].name = name;
pChoice->SetSelection(pos);
m_currentFilterSet = pos;
}
示例4:
void CGh0stView::OnRenameRemark()
{
// TODO: Add your command handler code here
CString strTitle;
if (m_pListCtrl->GetSelectedCount() == 1)
strTitle.Format("更改主机(%s)的备注", m_pListCtrl->GetItemText(m_pListCtrl->GetSelectionMark(), 3));
else
strTitle = "批量更改主机备注";
CInputDialog dlg;
dlg.Init(strTitle, _T("请输入新的备注:"), this);
if (dlg.DoModal() != IDOK || dlg.m_str.GetLength()== 0)
return;
int nPacketLength = dlg.m_str.GetLength() + 2;
LPBYTE lpPacket = new BYTE[nPacketLength];
lpPacket[0] = COMMAND_RENAME_REMARK;
memcpy(lpPacket + 1, dlg.m_str.GetBuffer(0), nPacketLength - 1);
SendSelectCommand(lpPacket, nPacketLength);
POSITION pos = m_pListCtrl->GetFirstSelectedItemPosition();
while(pos)
{
int nItem = m_pListCtrl->GetNextSelectedItem(pos);
m_pListCtrl->SetItemText(nItem, 3, dlg.m_str);
}
delete[] lpPacket;
}
示例5: MenuMkdir
// Helper-Function to create a new Directory
// Returns the name of the new directory
wxString CLocalListView::MenuMkdir()
{
CInputDialog dlg;
if (!dlg.Create(this, _("Create directory"), _("Please enter the name of the directory which should be created:")))
return _T("");
if (dlg.ShowModal() != wxID_OK)
return _T("");
if (dlg.GetValue() == _T(""))
{
wxBell();
return _T("");
}
wxFileName fn(dlg.GetValue(), _T(""));
fn.Normalize(wxPATH_NORM_ALL, m_dir);
bool res;
{
wxLogNull log;
res = fn.Mkdir(fn.GetPath(), 0777, wxPATH_MKDIR_FULL);
}
if (!res) {
wxBell();
return _T("");
}
// Return name of the New Directory
// return dlg.GetValue();
// return fn.GetDirs().Last();
return fn.GetPath();
}
示例6: XRCCTRL
void CFilterDialog::OnRename(wxCommandEvent& event)
{
wxChoice* pChoice = XRCCTRL(*this, "ID_SETS", wxChoice);
int old_pos = pChoice->GetSelection();
if (old_pos == -1)
return;
if (!old_pos) {
wxMessageBoxEx(_("This filter set cannot be renamed."));
return;
}
CInputDialog dlg;
wxString msg = wxString::Format(_("Please enter a new name for the filter set \"%s\""), pChoice->GetStringSelection());
dlg.Create(this, _("Enter new name for filterset"), msg);
if (dlg.ShowModal() != wxID_OK)
return;
wxString name = dlg.GetValue();
if (name == pChoice->GetStringSelection()) {
// Nothing changed
return;
}
if (name.empty()) {
wxMessageBoxEx(_("No name for the filterset given."), _("Cannot save filterset"), wxICON_INFORMATION);
return;
}
int pos = pChoice->FindString(name);
if (pos != wxNOT_FOUND) {
if (wxMessageBoxEx(_("Given filterset name already exists, overwrite filter set?"), _("Filter set already exists"), wxICON_QUESTION | wxYES_NO) != wxYES)
return;
}
// Remove old entry
pChoice->Delete(old_pos);
CFilterSet set = m_filterSets[old_pos];
m_filterSets.erase(m_filterSets.begin() + old_pos);
pos = pChoice->FindString(name);
if (pos == wxNOT_FOUND) {
pos = m_filterSets.size();
m_filterSets.push_back(set);
pChoice->Append(name);
}
else
m_filterSets[pos] = set;
m_filterSets[pos].name = name;
pChoice->SetSelection(pos);
m_currentFilterSet = pos;
GetSizer()->Fit(this);
}
示例7: RequestRenameFile
void CFileEngine::RequestRenameFile(const TDesC& aFileName)
{
//ASSERT(NULL == iRenameFile);
CInputDialog* inputDialog = iControlFactory.CreateInputTextDialog(*this,iMainEngine.GetDesById(ETurkeyTextRes_ReName),KNullDesC,ECmdRenameFile);
TParse parse;
parse.Set(aFileName,NULL,NULL);
inputDialog->SetEdwinText(parse.NameAndExt());
delete iRenameFile;
iRenameFile = NULL;
iRenameFile = aFileName.AllocL();
// iInputEvent = ECmdRenameFile;
}
示例8: OnNewFolder
/**
* OnNewFolder
*
*/
void CMainFrame::OnNewFolder()
{
CFileListView * v = (CFileListView *)m_mainSplitter.GetPane(0,1);
CInputDialog dialog;
//dialog.SetWindowTextW(_T("bla")) ; // = TEXT("Folder name:");
if (dialog.DoModal() == IDOK){
// Do something
CString input(dialog.m_inputText);
v->CreateFolder(input);
TRACE1("a %s \n", input);
}
}
示例9: CInputDialog
/** A static function to get some using CInputDialog. */
const QString CInputDialog::getText
( const QString& caption, const QString& description, const QString& text, bool* ok, QWidget* parent, Qt::WindowFlags wflags) {
CInputDialog* dlg = new CInputDialog(caption, description, text, parent, wflags);
QString ret = QString::null;
*ok = (dlg->exec() == QDialog::Accepted) ? true : false;
if (*ok) {
//qDebug() << "dialog was accepted, return text: " << dlg->text();
ret = dlg->text();
}
delete dlg;
return ret;
}
示例10: OnNewLayer
void CLayerSelect::OnNewLayer()
{
CInputDialog dlg;
dlg.csString="Слой1";
dlg.csTitle="Идентификатор слоя:";
if(dlg.DoModal()==IDOK)
{
CLayerItem data;
data.csName=dlg.csString;
data.bVisible=1;
nCurrentEdit=aList.Add(data);
ReLoadGrid();
}
}
示例11: CInputDialog
/** A static function to get some using CInputDialog. */
const QString CInputDialog::getText( const QString& caption, const QString& description, const QString& text, bool* ok, QWidget* parent, bool modal) {
CInputDialog* dlg = new CInputDialog(caption, description, text, parent, "", modal);
QString ret = QString::null;
const bool isOk = (dlg->exec() == CInputDialog::Accepted);
if (isOk) {
ret = dlg->text();
}
if (ok) { //change the ok param to return the value
*ok = isOk;
}
delete dlg;
return ret;
}
示例12: OnEditLayer
void CLayerSelect::OnEditLayer()
{
CCellID curCell=m_Grid.GetFocusCell();
int nLine=curCell.row;
if(nLine<0 || nLine>=aList.GetSize())
return;
CLayerItem data=aList[nLine];
CInputDialog dlg;
dlg.csString=data.csName;
dlg.csTitle="Идентификатор слоя:";
if(dlg.DoModal()==IDOK)
{
data.csName=dlg.csString;
aList[nLine]=data;
ReLoadGrid();
}
}
示例13: GetPathFromItem
void CRemoteTreeView::OnMkdir(wxCommandEvent& event)
{
if (!m_pState->IsRemoteIdle())
return;
if (!m_contextMenuItem)
return;
const CServerPath& path = GetPathFromItem(m_contextMenuItem);
if (path.IsEmpty())
return;
CInputDialog dlg;
if (!dlg.Create(this, _("Create directory"), _("Please enter the name of the directory which should be created:")))
return;
CServerPath newPath = path;
// Append a long segment which does (most likely) not exist in the path and
// replace it with "New directory" later. This way we get the exact position of
// "New directory" and can preselect it in the dialog.
wxString tmpName = _T("25CF809E56B343b5A12D1F0466E3B37A49A9087FDCF8412AA9AF8D1E849D01CF");
if (newPath.AddSegment(tmpName))
{
wxString pathName = newPath.GetPath();
int pos = pathName.Find(tmpName);
wxASSERT(pos != -1);
wxString newName = _("New directory");
pathName.Replace(tmpName, newName);
dlg.SetValue(pathName);
dlg.SelectText(pos, pos + newName.Length());
}
if (dlg.ShowModal() != wxID_OK)
return;
newPath = path;
if (!newPath.ChangePath(dlg.GetValue()))
{
wxBell();
return;
}
m_pState->m_pCommandQueue->ProcessCommand(new CMkdirCommand(newPath));
CServerPath listed;
if (newPath.HasParent())
{
listed = newPath.GetParent();
m_pState->ChangeRemoteDir(listed);
}
CServerPath currentPath;
const wxTreeItemId selected = GetSelection();
if (selected)
currentPath = GetPathFromItem(selected);
if (!currentPath.IsEmpty() && currentPath != listed)
m_pState->ChangeRemoteDir(currentPath);
}
示例14: GetDirFromItem
void CLocalTreeView::OnMenuMkdir(wxCommandEvent& event)
{
if (!m_contextMenuItem.IsOk())
return;
wxString path = GetDirFromItem(m_contextMenuItem);
if (path.Last() != wxFileName::GetPathSeparator())
path += wxFileName::GetPathSeparator();
if (!CLocalPath(path).IsWriteable())
{
wxBell();
return;
}
CInputDialog dlg;
if (!dlg.Create(this, _("Create directory"), _("Please enter the name of the directory which should be created:")))
return;
wxString newName = _("New directory");
dlg.SetValue(path + newName);
dlg.SelectText(path.Len(), path.Len() + newName.Len());
if (dlg.ShowModal() != wxID_OK)
return;
wxFileName fn(dlg.GetValue(), _T(""));
if (!fn.Normalize(wxPATH_NORM_ALL, path))
{
wxBell();
return;
}
bool res;
{
wxLogNull log;
res = fn.Mkdir(fn.GetPath(), 0777, wxPATH_MKDIR_FULL);
}
if (!res)
wxBell();
Refresh();
m_pState->RefreshLocal();
}
示例15: OnEditInputs
void CSoundSpaceDoc::OnEditInputs()
{
CInputDialog dlg;
if (dlg.DoModal() == IDOK) SetModifiedFlag();
UpdateAllViews(NULL, INITIALIZE);
}