本文整理汇总了C++中wxThreadEvent::GetString方法的典型用法代码示例。如果您正苦于以下问题:C++ wxThreadEvent::GetString方法的具体用法?C++ wxThreadEvent::GetString怎么用?C++ wxThreadEvent::GetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxThreadEvent
的用法示例。
在下文中一共展示了wxThreadEvent::GetString方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onJumpToCalculateComplete
/* TextEditor::onJumpToCalculateComplete
* Called when the 'Jump To' calculation thread completes
*******************************************************************/
void TextEditor::onJumpToCalculateComplete(wxThreadEvent& e)
{
if (!choice_jump_to)
{
jump_to_calculator = nullptr;
return;
}
choice_jump_to->Clear();
jump_to_lines.clear();
string jump_points = e.GetString();
wxArrayString split = wxSplit(jump_points, ',');
wxArrayString items;
for (unsigned a = 0; a < split.size(); a += 2)
{
if (a == split.size() - 1)
break;
long line;
if (!split[a].ToLong(&line))
line = 0;
string name = split[a + 1];
items.push_back(name);
jump_to_lines.push_back(line);
}
choice_jump_to->Append(items);
choice_jump_to->Enable(true);
jump_to_calculator = nullptr;
}
示例2: OnRBFComplete
void MainFrame::OnRBFComplete(wxThreadEvent& evt)
{
//stopTimer("RBF Stop");
m_RBF = NULL;
m_bRBFrunning = false;
showMessage(evt.GetString());
}
示例3: OnThread
// update gui
void NetPlayDialog::OnThread(wxThreadEvent& event)
{
if (m_is_hosting && m_host_label && g_TraversalClient)
{
UpdateHostLabel();
}
// player list
m_playerids.clear();
std::string tmps;
netplay_client->GetPlayerList(tmps, m_playerids);
wxString selection;
if (m_player_lbox->GetSelection() != wxNOT_FOUND)
selection = m_player_lbox->GetString(m_player_lbox->GetSelection());
m_player_lbox->Clear();
std::istringstream ss(tmps);
while (std::getline(ss, tmps))
m_player_lbox->Append(StrToWxStr(tmps));
// remove ping from selection string, in case it has changed
selection.erase(selection.rfind('|') + 1);
if (!selection.empty())
{
for (unsigned int i = 0; i < m_player_lbox->GetCount(); ++i)
{
if (selection == m_player_lbox->GetString(i).substr(0, selection.length()))
{
m_player_lbox->SetSelection(i);
break;
}
}
}
// flash window in taskbar when someone joins if window isn't active
static u8 numPlayers = 1;
if (netplay_server != nullptr && numPlayers < m_playerids.size() && !HasFocus())
{
RequestUserAttention();
}
numPlayers = m_playerids.size();
switch (event.GetId())
{
case NP_GUI_EVT_CHANGE_GAME:
// update selected game :/
{
m_selected_game = WxStrToStr(event.GetString());
wxString button_label = event.GetString();
m_game_btn->SetLabel(button_label.Prepend(_(" Game : ")));
}
break;
case NP_GUI_EVT_START_GAME:
// client start game :/
{
netplay_client->StartGame(FindGame());
}
break;
case NP_GUI_EVT_STOP_GAME:
// client stop game
{
netplay_client->StopGame();
}
break;
}
// chat messages
while (chat_msgs.Size())
{
std::string s;
chat_msgs.Pop(s);
// PanicAlert("message: %s", s.c_str());
m_chat_text->AppendText(StrToWxStr(s).Append('\n'));
}
}
示例4: OnRBFUpdate
void MainFrame::OnRBFUpdate(wxThreadEvent& evt)
{
showMessage(evt.GetString());
}
示例5: OnThread
// update gui
void NetPlayDialog::OnThread(wxThreadEvent& event)
{
if (m_is_hosting && m_host_label && g_TraversalClient)
{
UpdateHostLabel();
}
// player list
m_playerids.clear();
std::string tmps;
netplay_client->GetPlayerList(tmps, m_playerids);
wxString selection;
if (m_player_lbox->GetSelection() != wxNOT_FOUND)
selection = m_player_lbox->GetString(m_player_lbox->GetSelection());
m_player_lbox->Clear();
std::istringstream ss(tmps);
while (std::getline(ss, tmps))
m_player_lbox->Append(StrToWxStr(tmps));
// remove ping from selection string, in case it has changed
selection.erase(selection.rfind('|') + 1);
if (!selection.empty())
{
for (unsigned int i = 0; i < m_player_lbox->GetCount(); ++i)
{
if (selection == m_player_lbox->GetString(i).substr(0, selection.length()))
{
m_player_lbox->SetSelection(i);
break;
}
}
}
// flash window in taskbar when someone joins if window isn't active
static u8 numPlayers = 1;
if (netplay_server != nullptr && numPlayers < m_playerids.size() && !HasFocus())
{
RequestUserAttention();
}
numPlayers = m_playerids.size();
switch (event.GetId())
{
case NP_GUI_EVT_CHANGE_GAME:
// update selected game :/
{
m_selected_game = WxStrToStr(event.GetString());
wxString button_label = event.GetString();
m_game_btn->SetLabel(button_label.Prepend(_(" Game : ")));
}
break;
case NP_GUI_EVT_START_GAME:
// client start game :/
{
netplay_client->StartGame(FindCurrentGame());
std::string msg = "Starting game";
AddChatMessage(ChatMessageType::Info, msg);
}
break;
case NP_GUI_EVT_STOP_GAME:
// client stop game
{
std::string msg = "Stopping game";
AddChatMessage(ChatMessageType::Info, msg);
}
break;
case NP_GUI_EVT_DISPLAY_MD5_DIALOG:
{
m_MD5_dialog = new MD5Dialog(this, netplay_server, netplay_client->GetPlayers(),
event.GetString().ToStdString());
m_MD5_dialog->Show();
}
break;
case NP_GUI_EVT_MD5_PROGRESS:
{
if (m_MD5_dialog == nullptr || m_MD5_dialog->IsBeingDeleted())
break;
std::pair<int, int> payload = event.GetPayload<std::pair<int, int>>();
m_MD5_dialog->SetProgress(payload.first, payload.second);
}
break;
case NP_GUI_EVT_MD5_RESULT:
{
if (m_MD5_dialog == nullptr || m_MD5_dialog->IsBeingDeleted())
break;
std::pair<int, std::string> payload = event.GetPayload<std::pair<int, std::string>>();
m_MD5_dialog->SetResult(payload.first, payload.second);
}
break;
case NP_GUI_EVT_PAD_BUFFER_CHANGE:
{
std::string msg = StringFromFormat("Buffer size: %d", m_pad_buffer);
//.........这里部分代码省略.........
示例6: OnShowWindow
void MyDllApp::OnShowWindow(wxThreadEvent& event)
{
wxFrame *f = new MyDllFrame(NULL, event.GetString());
f->Show(true);
}
示例7: onVersionCheckCompleted
/* MainApp::onVersionCheckCompleted
* Called when the VersionCheck thread completes
*******************************************************************/
void MainApp::onVersionCheckCompleted(wxThreadEvent& e)
{
// Check failed
if (e.GetString() == "connect_failed")
{
LOG_MESSAGE(1, "Version check failed, unable to connect");
if (update_check_message_box)
wxMessageBox("Update check failed: unable to connect to internet. Check your connection and try again.", "Check for Updates");
return;
}
wxArrayString info = wxSplit(e.GetString(), '\n');
// Check for correct info
if (info.size() != 5)
{
LOG_MESSAGE(1, "Version check failed, received invalid version info");
if (update_check_message_box)
wxMessageBox("Update check failed: received invalid version info.", "Check for Updates");
return;
}
// Get version numbers
long version_stable, version_beta, beta_num;
info[0].ToLong(&version_stable);
info[2].ToLong(&version_beta);
info[3].ToLong(&beta_num);
LOG_MESSAGE(1, "Latest stable release: v%ld \"%s\"", version_stable, info[1].Trim());
LOG_MESSAGE(1, "Latest beta release: v%ld_b%ld \"%s\"", version_beta, beta_num, info[4].Trim());
// Check if new stable version
bool new_stable = false;
if (Global::version_num < version_stable || // New stable version
(Global::version_num == version_stable && Global::beta_num > 0)) // Stable version of current beta
new_stable = true;
// Check if new beta version
bool new_beta = false;
if (version_stable < version_beta)
{
// Stable -> Beta
if (Global::version_num < version_beta && Global::beta_num == 0)
new_beta = true;
// Beta -> Beta
else if (Global::version_num < version_beta || // New version beta
(Global::beta_num < beta_num && Global::version_num == version_beta && Global::beta_num > 0)) // Same version, newer beta
new_beta = true;
}
// Ask for new beta
if (update_check_beta && new_beta)
{
if (wxMessageBox(S_FMT("A new beta version of SLADE is available (%s), click OK to visit the SLADE homepage and download the update.", info[4].Trim()), "New Beta Version Available", wxOK|wxCANCEL) == wxOK)
wxLaunchDefaultBrowser("http://slade.mancubus.net/index.php?page=downloads");
return;
}
// Ask for new stable
if (new_stable)
{
if (wxMessageBox(S_FMT("A new version of SLADE is available (%s), click OK to visit the SLADE homepage and download the update.", info[1].Trim()), "New Version Available", wxOK|wxCANCEL) == wxOK)
wxLaunchDefaultBrowser("http://slade.mancubus.net/index.php?page=downloads");
return;
}
LOG_MESSAGE(1, "Already up-to-date");
if (update_check_message_box)
wxMessageBox("SLADE is already up to date", "Check for Updates");
}
示例8: OnHTMLLoadPage
void ZLauncherFrame::OnHTMLLoadPage(wxThreadEvent& evt)
{
m_htmlWin->LoadURL(evt.GetString());
}
示例9: OnHTMLSetContent
void ZLauncherFrame::OnHTMLSetContent(wxThreadEvent& evt)
{
m_htmlWin->SetPage(evt.GetString(), "");
}
示例10: OnProgressTextUpdate
void ZLauncherFrame::OnProgressTextUpdate(wxThreadEvent& evt)
{
m_txtProgress->SetValue(evt.GetString());
}
示例11: OnFileProcessedTextUpdate
void CreatePatchFrame::OnFileProcessedTextUpdate(wxThreadEvent& evt)
{
m_txtProcessingFile->SetValue(evt.GetString());
}
示例12: OnComparisonTextUpdate
void CreatePatchFrame::OnComparisonTextUpdate(wxThreadEvent& evt)
{
m_txtComparison->SetValue(evt.GetString());
}