本文整理汇总了C++中cbMessageBox函数的典型用法代码示例。如果您正苦于以下问题:C++ cbMessageBox函数的具体用法?C++ cbMessageBox怎么用?C++ cbMessageBox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cbMessageBox函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cbMessageBox
bool CodeBlocksApp::InitXRCStuff()
{
if ( !Manager::LoadResource(_T("resources.zip")) )
{
wxString msg;
msg.Printf(_T("Cannot find resources...\n"
"%s was configured to be installed in '%s'.\n"
"Please use the command-line switch '--prefix' or "
"set the CODEBLOCKS_DATA_DIR environment variable "
"to point where %s is installed,\n"
"or try re-installing the application..."),
appglobals::AppName.wx_str(),
ConfigManager::ReadDataPath().wx_str(),
appglobals::AppName.wx_str());
cbMessageBox(msg);
return false;
}
return true;
}
示例2: OnScriptModuleMenu
////////////////////////////////////////////////////////////////////////////////
// callback for script plugins context menu entries
////////////////////////////////////////////////////////////////////////////////
void OnScriptModuleMenu(int id)
{
ModuleMenuCallbacks::iterator it;
it = s_MenuCallbacks.find(id);
if (it != s_MenuCallbacks.end())
{
MenuCallback& callback = it->second;
SqPlus::SquirrelFunction<void> f(callback.object, "OnModuleMenuClicked");
if (!f.func.IsNull())
{
try
{
f(callback.menuIndex);
}
catch (SquirrelError e)
{
cbMessageBox(cbC2U(e.desc), _("Script error"), wxICON_ERROR);
}
}
}
}
示例3: wxCHECK_VERSION
void cbWorkspace::Load()
{
wxString fname = m_Filename.GetFullPath();
#if wxCHECK_VERSION(2, 9, 0)
Manager::Get()->GetLogManager()->DebugLog(F(_T("Loading workspace \"%s\""), fname.wx_str()));
#else
Manager::Get()->GetLogManager()->DebugLog(F(_T("Loading workspace \"%s\""), fname.c_str()));
#endif
if (!m_Filename.FileExists())
{
Manager::Get()->GetLogManager()->DebugLog(_T("File does not exist."));
if (!m_IsDefault)
{
wxString msg;
msg.Printf(_("Workspace '%s' does not exist..."), fname.c_str());
cbMessageBox(msg, _("Error"), wxOK | wxCENTRE | wxICON_ERROR);
// workspace wasn't loaded succesfully
m_IsOK = false;
return;
}
}
if (FileTypeOf(fname) == ftCodeBlocksWorkspace)
{
IBaseWorkspaceLoader* pWsp = new WorkspaceLoader;
wxString Title;
m_IsOK = pWsp && (pWsp->Open(fname, Title) || m_IsDefault);
if(!Title.IsEmpty())
{
m_Title = Title;
}
delete pWsp;
}
m_Filename.SetExt(FileFilters::WORKSPACE_EXT);
SetModified(false);
}
示例4: OnDelClick
void wxsToolBarEditor::OnDelClick(wxCommandEvent& event)
{
int Selection = m_Content->GetSelection();
if ( Selection == wxNOT_FOUND ) return;
if ( cbMessageBox(_("Are you sure to delete this item?"),
_("Deleting wxToolBar item"),
wxYES_NO) == wxID_YES )
{
m_Content->Delete(Selection);
if ( (int)m_Content->GetCount() == Selection ) Selection--;
if ( Selection > 0 )
{
m_Content->SetSelection(Selection);
SelectItem((ToolBarItem*)m_Content->GetClientObject(Selection));
}
else
{
m_Content->SetSelection(wxNOT_FOUND);
SelectItem(0);
}
}
}
示例5: GetFilename
bool EditorBase::QueryClose()
{
if ( GetModified() )
{
wxString msg;
msg.Printf(_("File %s is modified...\nDo you want to save the changes?"), GetFilename().c_str());
switch (cbMessageBox(msg, _("Save file"), wxICON_QUESTION | wxYES_NO | wxCANCEL))
{
case wxID_YES:
if (!Save())
return false;
break;
case wxID_NO:
break;
case wxID_CANCEL:
default:
return false;
}
SetModified(false);
}
return true;
}
示例6: cbMessageBox
void BacktraceDlg::OnSwitchFrame(cb_unused wxCommandEvent& event)
{
if (!IsSwitchFrameEnabled())
return;
if (m_list->GetSelectedItemCount() == 0)
return;
// find selected item index
int index = m_list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
// read the frame number from the first column
long realFrameNr;
if (m_list->GetItemText(index).ToLong(&realFrameNr))
{
// switch to this frame
cbDebuggerPlugin *plugin = Manager::Get()->GetDebuggerManager()->GetActiveDebugger();
if (plugin)
plugin->SwitchToFrame(realFrameNr);
}
else
cbMessageBox(_("Couldn't find out the frame number!"), _("Error"), wxICON_ERROR);
}
示例7: ev
void WorkspaceBrowserF::JumpToToken(TokenF* pToken)
{
if (pToken)
{
LineAddress jumpStart;
LineAddress jumpFinish;
if(cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor())
{
cbStyledTextCtrl* control = ed->GetControl();
int curLine = control->LineFromPosition(control->GetCurrentPos());
jumpStart.Init(ed->GetFilename(), curLine, false);
}
EditorManager* edMan = Manager::Get()->GetEditorManager();
if (cbEditor* ed = edMan->Open(pToken->m_Filename))
{
ed->GotoLine(pToken->m_LineStart - 1);
wxFocusEvent ev(wxEVT_SET_FOCUS);
ev.SetWindow(this);
#if wxCHECK_VERSION(2, 9, 0)
ed->GetControl()->GetEventHandler()->AddPendingEvent(ev);
#else
ed->GetControl()->AddPendingEvent(ev);
#endif
// Track jump history
cbStyledTextCtrl* control = ed->GetControl();
int curLine = control->LineFromPosition(control->GetCurrentPos());
jumpFinish.Init(ed->GetFilename(), curLine, true);
m_NativeParser->GetJumpTracker()->TakeJump(jumpStart, jumpFinish);
m_NativeParser->GetFortranProject()->CheckEnableToolbar();
}
else
{
cbMessageBox(wxString::Format(_("Declaration not found: %s"), pToken->m_DisplayName.c_str()), _("Warning"), wxICON_WARNING);
}
}
}
示例8: ExecutePlugin
////////////////////////////////////////////////////////////////////////////////
// execute a script plugin (script-bound function)
////////////////////////////////////////////////////////////////////////////////
int ExecutePlugin(const wxString& name)
{
// look for script plugin
ScriptPlugins::iterator it = s_ScriptPlugins.find(name);
if (it != s_ScriptPlugins.end())
{
// found; execute it
SquirrelObject& o = it->second;
SqPlus::SquirrelFunction<int> f(o, "Execute");
if (!f.func.IsNull())
{
try
{
f();
}
catch (SquirrelError e)
{
cbMessageBox(cbC2U(e.desc), _("Script error"), wxICON_ERROR);
}
}
}
return -1;
}
示例9: SaveCCDebugInfo
void SaveCCDebugInfo(const wxString& fileDesc, const wxString& content)
{
wxString fname;
wxFileDialog dlg (Manager::Get()->GetAppWindow(),
fileDesc,
_T(""),
_T(""),
_T("Text files (*.txt)|*.txt|Any file (*)|*"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
PlaceWindow(&dlg);
if (dlg.ShowModal() != wxID_OK)
return;
// Opening the file migth have failed, verify:
wxFile f(dlg.GetPath(), wxFile::write);
if (f.IsOpened())
{
f.Write(content); // write buffer to file
f.Close(); // release file handle
}
else
cbMessageBox(_("Cannot create file ") + fname, _("CC Debug Info"));
}
示例10: err
/*!
\brief Process the output from OpenOCD.
This is a virtual function and can be overidden by a plugin, so each
plugin can have it's own output processing.
\param output wxString containing output data from stdout and stderr streams.
*/
void OpenOCDDriver::ParseOutput(const wxString& output)
{
// Display first dialog box error
wxString trimLeft;
trimLeft = output.Left(6);
wxString err(_T("Error:"));
if (trimLeft == err) {
if (m_FirstErr == false) {
// Only dialog box first error because they may be more than 1
m_FirstErr = true;
cbMessageBox(output, _("OpenOCD Error"), wxICON_STOP);
}
}
if (m_rs == Programming) {
trimLeft = output.Left(5);
if (trimLeft == _T("wrote")) {
Stop();
}
}
}
示例11: GetVisibleListCtrl
void NewFromTemplateDlg::OnDiscardScript(cb_unused wxCommandEvent& event)
{
wxListCtrl* list = GetVisibleListCtrl();
if (!list)
return;
long index = list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (index == -1)
return;
ListItemData* data = (ListItemData*)list->GetItemData(index);
if (!data)
return;
wxString script = ConfigManager::GetFolder(sdDataUser) + _T("/templates/wizard/") + data->plugin->GetScriptFilename(data->wizPluginIndex);
if (wxFileExists(script))
{
if (cbMessageBox(_("Are you sure you want to discard all local modifications to this script?"),
_("Confirmation"), wxICON_QUESTION | wxYES_NO, this) == wxID_YES)
{
if (wxRemoveFile(script))
list->SetItemTextColour(index, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
}
}
}
示例12: UpdateSearchButtons
void ThreadSearchView::OnBtnSearchClick(wxCommandEvent &/*event*/)
{
// User clicked on Search/Cancel
// m_ThreadSearchEventsArray is shared by two threads, we
// use m_MutexSearchEventsArray to have a safe access.
// As button action depends on m_ThreadSearchEventsArray,
// we lock the mutex to process it correctly.
if ( m_MutexSearchEventsArray.Lock() == wxMUTEX_NO_ERROR )
{
int nbEvents = m_ThreadSearchEventsArray.GetCount();
m_MutexSearchEventsArray.Unlock();
if ( m_pFindThread != NULL )
{
// A threaded search is running...
UpdateSearchButtons(false);
StopThread();
}
else if ( nbEvents > 0 )
{
// A threaded search has run but the events array is
// not completely processed...
UpdateSearchButtons(false);
if ( ClearThreadSearchEventsArray() == false )
{
cbMessageBox(_("Failed to clear events array."), _("Error"), wxICON_ERROR);
}
}
else
{
// We start the thread search
ThreadSearchFindData findData = m_ThreadSearchPlugin.GetFindData();
findData.SetFindText(m_pCboSearchExpr->GetValue());
ThreadedSearch(findData);
}
}
}
示例13: _
void CodeBlocksApp::OnBatchBuildDone(CodeBlocksEvent& event)
{
event.Skip();
// the event comes more than once. deal with it...
static bool one_time_only = false;
if (!m_Batch || one_time_only)
return;
one_time_only = true;
cbCompilerPlugin* compiler = static_cast<cbCompilerPlugin*>(event.GetPlugin());
m_BatchExitCode = compiler->GetExitCode();
if (m_BatchNotify)
{
wxString msg;
if (m_BatchExitCode == 0)
msg << _("Batch build ended.\n");
else
msg << _("Batch build stopped with errors.\n");
msg << wxString::Format(_("Process exited with status code %d."), m_BatchExitCode);
cbMessageBox(msg, appglobals::AppName, m_BatchExitCode == 0 ? wxICON_INFORMATION : wxICON_WARNING, m_pBatchBuildDialog);
}
else
wxBell();
if (m_pBatchBuildDialog && m_BatchWindowAutoClose)
{
if (m_pBatchBuildDialog->IsModal())
m_pBatchBuildDialog->EndModal(wxID_OK);
else
{
m_pBatchBuildDialog->Destroy();
m_pBatchBuildDialog = nullptr;
}
}
}
示例14: cbMessageBox
void ToolsPlus::OnSettings(wxCommandEvent& event)
{
cbMessageBox(_("Settings..."));
}
示例15: XRCCTRL
void EditPathDlg::OnBrowse(wxCommandEvent& /*event*/)
{
wxFileName path;
wxArrayString multi;
wxString val = XRCCTRL(*this, "txtPath", wxTextCtrl)->GetValue();
int idx = val.Find(DEFAULT_ARRAY_SEP);
if (idx != -1)
val.Remove(idx);
wxFileName fname(val);
if (m_WantDir)
{
// try to "decode" custom var
wxString bkp = val;
Manager::Get()->GetMacrosManager()->ReplaceEnvVars(val);
fname = val;
fname.MakeAbsolute(m_Basepath);
m_Path = fname.GetFullPath();
path = ChooseDirectory(this, m_Message, (m_Path.IsEmpty() ? s_LastPath : m_Path),
m_Basepath, false, m_ShowCreateDirButton);
if (path.GetFullPath().IsEmpty())
return;
// if it was a custom var, see if we can re-insert it
if (bkp != val)
{
wxString tmp = path.GetFullPath();
if (tmp.Replace(val, bkp) != 0)
{
// done here
XRCCTRL(*this, "txtPath", wxTextCtrl)->SetValue(tmp);
return;
}
}
}
else
{
wxFileDialog dlg(this, m_Message, (fname.GetPath().IsEmpty() ? s_LastPath : fname.GetPath()),
fname.GetFullName(), m_Filter, wxFD_CHANGE_DIR | (m_AllowMultiSel ? wxFD_MULTIPLE : 0) );
PlaceWindow(&dlg);
if (dlg.ShowModal() == wxID_OK)
{
if (m_AllowMultiSel)
dlg.GetPaths(multi);
else
path = dlg.GetPath();
}
else
return;
}
if (m_AllowMultiSel && multi.GetCount() != 0 && !multi[0].IsEmpty())
s_LastPath = multi[0];
else if (!path.GetFullPath().IsEmpty())
s_LastPath = path.GetFullPath();
wxString result;
if (m_AskMakeRelative && !m_Basepath.IsEmpty())
{
// ask the user if he wants it to be kept as relative
if (cbMessageBox(_("Keep this as a relative path?"),
_("Question"),
wxICON_QUESTION | wxYES_NO, this) == wxID_YES)
{
if (m_AllowMultiSel)
{
for (unsigned int i = 0; i < multi.GetCount(); ++i)
{
path = multi[i];
path.MakeRelativeTo(m_Basepath);
multi[i] = path.GetFullPath();
}
result = GetStringFromArray(multi);
}
else
{
path.MakeRelativeTo(m_Basepath);
result = path.GetFullPath();
}
}
else
{
if (m_AllowMultiSel)
result = GetStringFromArray(multi);
else
result = path.GetFullPath();
}
}
else // always absolute path
{
if (m_AllowMultiSel)
result = GetStringFromArray(multi);
else
result = path.GetFullPath();
}
//.........这里部分代码省略.........