diff options
Diffstat (limited to 'src/ui.h')
-rw-r--r-- | src/ui.h | 44 |
1 files changed, 24 insertions, 20 deletions
@@ -1,6 +1,8 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. +#ifndef BITCOIN_UI_H +#define BITCOIN_UI_H DECLARE_EVENT_TYPE(wxEVT_UITHREADCALL, -1) @@ -12,9 +14,9 @@ extern wxLocale g_locale; void HandleCtrlA(wxKeyEvent& event); void UIThreadCall(boost::function0<void>); -int ThreadSafeMessageBox(const string& message, const string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1); -bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent); -void CalledSetStatusBar(const string& strText, int nField); +int ThreadSafeMessageBox(const std::string& message, const std::string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1); +bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption, wxWindow* parent); +void CalledSetStatusBar(const std::string& strText, int nField); void MainFrameRepaint(); void CreateMainWindow(); void SetStartOnSystemStartup(bool fAutoStart); @@ -28,8 +30,8 @@ inline int MyMessageBox(const wxString& message, const wxString& caption="Messag if (!fDaemon) return wxMessageBox(message, caption, style, parent, x, y); #endif - printf("wxMessageBox %s: %s\n", string(caption).c_str(), string(message).c_str()); - fprintf(stderr, "%s: %s\n", string(caption).c_str(), string(message).c_str()); + printf("wxMessageBox %s: %s\n", std::string(caption).c_str(), std::string(message).c_str()); + fprintf(stderr, "%s: %s\n", std::string(caption).c_str(), std::string(message).c_str()); return wxOK; } #define wxMessageBox MyMessageBox @@ -93,8 +95,8 @@ public: bool fRefresh; void OnUIThreadCall(wxCommandEvent& event); - int GetSortIndex(const string& strSort); - void InsertLine(bool fNew, int nIndex, uint256 hashKey, string strSort, const wxColour& colour, const wxString& str1, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5); + int GetSortIndex(const std::string& strSort); + void InsertLine(bool fNew, int nIndex, uint256 hashKey, std::string strSort, const wxColour& colour, const wxString& str1, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5); bool DeleteLine(uint256 hashKey); bool InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex=-1); void RefreshListCtrl(); @@ -176,8 +178,8 @@ public: // Custom bool fEnabledPrev; - string strFromSave; - string strMessageSave; + std::string strFromSave; + std::string strMessageSave; }; @@ -211,8 +213,8 @@ public: void Close(); void Repaint(); bool Status(); - bool Status(const string& str); - bool Error(const string& str); + bool Status(const std::string& str); + bool Error(const std::string& str); void StartTransfer(); void OnReply2(CDataStream& vRecv); void OnReply3(CDataStream& vRecv); @@ -257,7 +259,7 @@ public: wxString GetSelectedAddress(); wxString GetSelectedSendingAddress(); wxString GetSelectedReceivingAddress(); - bool CheckIfMine(const string& strAddress, const string& strTitle); + bool CheckIfMine(const std::string& strAddress, const std::string& strTitle); }; @@ -281,11 +283,11 @@ protected: public: /** Constructor */ CGetTextFromUserDialog(wxWindow* parent, - const string& strCaption, - const string& strMessage1, - const string& strValue1="", - const string& strMessage2="", - const string& strValue2="") : CGetTextFromUserDialogBase(parent, wxID_ANY, strCaption) + const std::string& strCaption, + const std::string& strMessage1, + const std::string& strValue1="", + const std::string& strMessage2="", + const std::string& strValue2="") : CGetTextFromUserDialogBase(parent, wxID_ANY, strCaption) { int x = GetSize().GetWidth(); int y = GetSize().GetHeight(); @@ -308,9 +310,9 @@ public: } // Custom - string GetValue() { return (string)m_textCtrl1->GetValue(); } - string GetValue1() { return (string)m_textCtrl1->GetValue(); } - string GetValue2() { return (string)m_textCtrl2->GetValue(); } + std::string GetValue() { return (std::string)m_textCtrl1->GetValue(); } + std::string GetValue1() { return (std::string)m_textCtrl1->GetValue(); } + std::string GetValue2() { return (std::string)m_textCtrl2->GetValue(); } }; @@ -341,3 +343,5 @@ public: DECLARE_EVENT_TABLE() }; + +#endif |