diff --git a/headers.h b/headers.h index c7f3cd85..6cd2da07 100644 --- a/headers.h +++ b/headers.h @@ -53,6 +53,8 @@ #include #include #include +#include +#include #ifdef __WXMSW__ #include diff --git a/main.cpp b/main.cpp index cc22bad6..e4f1deb8 100644 --- a/main.cpp +++ b/main.cpp @@ -1381,7 +1381,7 @@ bool CheckDiskSpace(int64 nAdditionalBytes) if (nFreeBytesAvailable < (int64)15000000 + nAdditionalBytes) { fShutdown = true; - wxMessageBox("Warning: Your disk space is low ", "Bitcoin", wxICON_EXCLAMATION); + ThreadSafeMessageBox("Warning: Your disk space is low ", "Bitcoin", wxOK | wxICON_EXCLAMATION); _beginthread(Shutdown, 0, NULL); return false; } diff --git a/ui.cpp b/ui.cpp index 92e1d59c..d3302313 100644 --- a/ui.cpp +++ b/ui.cpp @@ -14,13 +14,10 @@ void SetStartOnSystemStartup(bool fAutoStart); -DEFINE_EVENT_TYPE(wxEVT_CROSSTHREADCALL) +DEFINE_EVENT_TYPE(wxEVT_UITHREADCALL) DEFINE_EVENT_TYPE(wxEVT_REPLY1) DEFINE_EVENT_TYPE(wxEVT_REPLY2) DEFINE_EVENT_TYPE(wxEVT_REPLY3) -DEFINE_EVENT_TYPE(wxEVT_TABLEADDED) -DEFINE_EVENT_TYPE(wxEVT_TABLEUPDATED) -DEFINE_EVENT_TYPE(wxEVT_TABLEDELETED) CMainFrame* pframeMain = NULL; CMyTaskBarIcon* ptaskbaricon = NULL; @@ -184,6 +181,24 @@ void AddToMyProducts(CProduct product) ""); } +void StringMessageBox(const string& message, const string& caption, int style, wxWindow* parent, int x, int y) +{ + wxMessageBox(message, caption, style, parent, x, y); +} + +int ThreadSafeMessageBox(const string& message, const string& caption, int style, wxWindow* parent, int x, int y) +{ +#ifdef __WXMSW__ + wxMessageBox(message, caption, style, parent, x, y); +#else + UIThreadCall(bind(StringMessageBox, message, caption, style, parent, x, y)); +#endif +} + + + + + @@ -193,6 +208,7 @@ void AddToMyProducts(CProduct product) // // Custom events // +// If this code gets used again, it should be replaced with something like UIThreadCall set setCallbackAvailable; CCriticalSection cs_setCallbackAvailable; @@ -279,7 +295,7 @@ CDataStream GetStreamFromEvent(const wxCommandEvent& event) CMainFrame::CMainFrame(wxWindow* parent) : CMainFrameBase(parent) { - Connect(wxEVT_CROSSTHREADCALL, wxCommandEventHandler(CMainFrame::OnCrossThreadCall), NULL, this); + Connect(wxEVT_UITHREADCALL, wxCommandEventHandler(CMainFrame::OnUIThreadCall), NULL, this); // Init fRefreshListCtrl = false; @@ -982,36 +998,27 @@ void CMainFrame::OnPaintListCtrl(wxPaintEvent& event) } -void CrossThreadCall(wxCommandEvent& event) +void UIThreadCall(boost::function fn) { + // Call this with a function object created with bind. + // bind needs all parameters to match the function's expected types + // and all default parameters specified. Some examples: + // UIThreadCall(bind(wxBell)); + // UIThreadCall(bind(wxMessageBox, wxT("Message"), wxT("Title"), wxOK, (wxWindow*)NULL, -1, -1)); + // UIThreadCall(bind(&CMainFrame::OnMenuHelpAbout, pframeMain, event)); if (pframeMain) + { + wxCommandEvent event(wxEVT_UITHREADCALL); + event.SetClientData((void*)new boost::function(fn)); pframeMain->GetEventHandler()->AddPendingEvent(event); + } } -void CrossThreadCall(int nID, void* pdata) -{ - wxCommandEvent event; - event.SetInt(nID); - event.SetClientData(pdata); - if (pframeMain) - pframeMain->GetEventHandler()->AddPendingEvent(event); -} - -void CMainFrame::OnCrossThreadCall(wxCommandEvent& event) +void CMainFrame::OnUIThreadCall(wxCommandEvent& event) { - void* pdata = event.GetClientData(); - switch (event.GetInt()) - { - case UICALL_ADDORDER: - { - break; - } - - case UICALL_UPDATEORDER: - { - break; - } - } + boost::function* pfn = (boost::function*)event.GetClientData(); + (*pfn)(); + delete pfn; } void CMainFrame::OnMenuFileExit(wxCommandEvent& event) @@ -3305,9 +3312,6 @@ wxMenu* CMyTaskBarIcon::CreatePopupMenu() - - - ////////////////////////////////////////////////////////////////////////////// // // CMyApp diff --git a/ui.h b/ui.h index 1d0491f1..1db40997 100644 --- a/ui.h +++ b/ui.h @@ -5,19 +5,10 @@ -DECLARE_EVENT_TYPE(wxEVT_CROSSTHREADCALL, -1) +DECLARE_EVENT_TYPE(wxEVT_UITHREADCALL, -1) DECLARE_EVENT_TYPE(wxEVT_REPLY1, -1) DECLARE_EVENT_TYPE(wxEVT_REPLY2, -1) DECLARE_EVENT_TYPE(wxEVT_REPLY3, -1) -DECLARE_EVENT_TYPE(wxEVT_TABLEADDED, -1) -DECLARE_EVENT_TYPE(wxEVT_TABLEUPDATED, -1) -DECLARE_EVENT_TYPE(wxEVT_TABLEDELETED, -1) - -enum -{ - UICALL_ADDORDER = 1, - UICALL_UPDATEORDER, -}; @@ -33,9 +24,10 @@ extern int fMinimizeOnClose; extern void HandleCtrlA(wxKeyEvent& event); extern string FormatTxStatus(const CWalletTx& wtx); -extern void CrossThreadCall(int nID, void* pdata); +extern void UIThreadCall(boost::function); extern void MainFrameRepaint(); extern void Shutdown(void* parg); +extern int ThreadSafeMessageBox(const string& message, const string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1); @@ -85,7 +77,7 @@ public: unsigned int nListViewUpdated; bool fRefresh; - void OnCrossThreadCall(wxCommandEvent& event); + void OnUIThreadCall(wxCommandEvent& event); int GetSortIndex(const string& strSort); void InsertLine(bool fNew, int nIndex, uint256 hashKey, string strSort, const wxString& str1, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5); bool DeleteLine(uint256 hashKey); @@ -473,9 +465,3 @@ public: DECLARE_EVENT_TABLE() }; - - - - - - diff --git a/uibase.cpp b/uibase.cpp index 9a619995..6a280cda 100644 --- a/uibase.cpp +++ b/uibase.cpp @@ -1702,166 +1702,6 @@ CEditReviewDialogBase::~CEditReviewDialogBase() m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CEditReviewDialogBase::OnButtonCancel ), NULL, this ); } -CPokerLobbyDialogBase::CPokerLobbyDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer156; - bSizer156 = new wxBoxSizer( wxHORIZONTAL ); - - m_treeCtrl = new wxTreeCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_HIDE_ROOT|wxTR_LINES_AT_ROOT ); - m_treeCtrl->SetMinSize( wxSize( 130,-1 ) ); - - bSizer156->Add( m_treeCtrl, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); - - wxBoxSizer* bSizer172; - bSizer172 = new wxBoxSizer( wxVERTICAL ); - - m_listCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT ); - bSizer172->Add( m_listCtrl, 1, wxEXPAND|wxALL, 5 ); - - m_buttonNewTable = new wxButton( this, wxID_OPENNEWTABLE, wxT("&Open New Table"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer172->Add( m_buttonNewTable, 0, wxALL, 5 ); - - bSizer156->Add( bSizer172, 1, wxEXPAND, 5 ); - - this->SetSizer( bSizer156 ); - this->Layout(); - - // Connect Events - m_treeCtrl->Connect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( CPokerLobbyDialogBase::OnTreeSelChanged ), NULL, this ); - m_listCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( CPokerLobbyDialogBase::OnListItemActivated ), NULL, this ); - m_listCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( CPokerLobbyDialogBase::OnListItemSelected ), NULL, this ); - m_buttonNewTable->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CPokerLobbyDialogBase::OnButtonNewTable ), NULL, this ); -} - -CPokerLobbyDialogBase::~CPokerLobbyDialogBase() -{ - // Disconnect Events - m_treeCtrl->Disconnect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( CPokerLobbyDialogBase::OnTreeSelChanged ), NULL, this ); - m_listCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( CPokerLobbyDialogBase::OnListItemActivated ), NULL, this ); - m_listCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( CPokerLobbyDialogBase::OnListItemSelected ), NULL, this ); - m_buttonNewTable->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CPokerLobbyDialogBase::OnButtonNewTable ), NULL, this ); -} - -CPokerDialogBase::CPokerDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bSizer174; - bSizer174 = new wxBoxSizer( wxVERTICAL ); - - m_checkSitOut = new wxCheckBox( this, wxID_ANY, wxT("Deal Me Out"), wxDefaultPosition, wxDefaultSize, 0 ); - - bSizer174->Add( m_checkSitOut, 0, wxALL, 5 ); - - m_buttonDealHand = new wxButton( this, wxID_DEALHAND, wxT("&Deal Hand"), wxDefaultPosition, wxSize( 150,25 ), 0 ); - bSizer174->Add( m_buttonDealHand, 0, wxALL, 5 ); - - m_buttonFold = new wxButton( this, wxID_FOLD, wxT("&Fold"), wxDefaultPosition, wxSize( 80,25 ), 0 ); - bSizer174->Add( m_buttonFold, 0, wxALL, 5 ); - - m_buttonCall = new wxButton( this, wxID_CALL, wxT("&Call"), wxDefaultPosition, wxSize( 80,25 ), 0 ); - bSizer174->Add( m_buttonCall, 0, wxALL, 5 ); - - m_buttonRaise = new wxButton( this, wxID_RAISE, wxT("&Raise"), wxDefaultPosition, wxSize( 80,25 ), 0 ); - bSizer174->Add( m_buttonRaise, 0, wxALL, 5 ); - - m_buttonLeaveTable = new wxButton( this, wxID_LEAVETABLE, wxT("&Leave Table"), wxDefaultPosition, wxSize( 90,25 ), 0 ); - bSizer174->Add( m_buttonLeaveTable, 0, wxALL, 5 ); - - m_textDitchPlayer = new wxTextCtrl( this, wxID_DITCHPLAYER, wxEmptyString, wxDefaultPosition, wxSize( 45,-1 ), wxTE_PROCESS_ENTER ); - bSizer174->Add( m_textDitchPlayer, 0, wxALL, 5 ); - - m_checkPreFold = new wxCheckBox( this, wxID_ANY, wxT("FOLD"), wxDefaultPosition, wxSize( 100,-1 ), 0 ); - - bSizer174->Add( m_checkPreFold, 0, wxALL, 5 ); - - m_checkPreCall = new wxCheckBox( this, wxID_ANY, wxT("CALL"), wxDefaultPosition, wxSize( 100,-1 ), 0 ); - - bSizer174->Add( m_checkPreCall, 0, wxALL, 5 ); - - m_checkPreCallAny = new wxCheckBox( this, wxID_ANY, wxT("CALL ANY"), wxDefaultPosition, wxSize( 100,-1 ), 0 ); - - bSizer174->Add( m_checkPreCallAny, 0, wxALL, 5 ); - - m_checkPreRaise = new wxCheckBox( this, wxID_ANY, wxT("RAISE"), wxDefaultPosition, wxSize( 100,-1 ), 0 ); - - bSizer174->Add( m_checkPreRaise, 0, wxALL, 5 ); - - m_checkPreRaiseAny = new wxCheckBox( this, wxID_ANY, wxT("RAISE ANY"), wxDefaultPosition, wxSize( 100,-1 ), 0 ); - - bSizer174->Add( m_checkPreRaiseAny, 0, wxALL, 5 ); - - this->SetSizer( bSizer174 ); - this->Layout(); - m_statusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( CPokerDialogBase::OnClose ) ); - this->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Connect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Connect( wxEVT_MIDDLE_UP, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Connect( wxEVT_RIGHT_UP, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Connect( wxEVT_MOTION, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Connect( wxEVT_MIDDLE_DCLICK, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Connect( wxEVT_RIGHT_DCLICK, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Connect( wxEVT_LEAVE_WINDOW, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Connect( wxEVT_PAINT, wxPaintEventHandler( CPokerDialogBase::OnPaint ) ); - this->Connect( wxEVT_SIZE, wxSizeEventHandler( CPokerDialogBase::OnSize ) ); - m_checkSitOut->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnCheckSitOut ), NULL, this ); - m_buttonDealHand->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnButtonDealHand ), NULL, this ); - m_buttonFold->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnButtonFold ), NULL, this ); - m_buttonCall->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnButtonCall ), NULL, this ); - m_buttonRaise->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnButtonRaise ), NULL, this ); - m_buttonLeaveTable->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnButtonLeaveTable ), NULL, this ); - m_textDitchPlayer->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( CPokerDialogBase::OnDitchPlayer ), NULL, this ); - m_checkPreFold->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnCheckPreFold ), NULL, this ); - m_checkPreCall->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnCheckPreCall ), NULL, this ); - m_checkPreCallAny->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnCheckPreCallAny ), NULL, this ); - m_checkPreRaise->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnCheckPreRaise ), NULL, this ); - m_checkPreRaiseAny->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnCheckPreRaiseAny ), NULL, this ); -} - -CPokerDialogBase::~CPokerDialogBase() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( CPokerDialogBase::OnClose ) ); - this->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Disconnect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Disconnect( wxEVT_MIDDLE_UP, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Disconnect( wxEVT_MOTION, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Disconnect( wxEVT_MIDDLE_DCLICK, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Disconnect( wxEVT_RIGHT_DCLICK, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Disconnect( wxEVT_LEAVE_WINDOW, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Disconnect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( CPokerDialogBase::OnMouseEvents ) ); - this->Disconnect( wxEVT_PAINT, wxPaintEventHandler( CPokerDialogBase::OnPaint ) ); - this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( CPokerDialogBase::OnSize ) ); - m_checkSitOut->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnCheckSitOut ), NULL, this ); - m_buttonDealHand->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnButtonDealHand ), NULL, this ); - m_buttonFold->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnButtonFold ), NULL, this ); - m_buttonCall->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnButtonCall ), NULL, this ); - m_buttonRaise->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnButtonRaise ), NULL, this ); - m_buttonLeaveTable->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnButtonLeaveTable ), NULL, this ); - m_textDitchPlayer->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( CPokerDialogBase::OnDitchPlayer ), NULL, this ); - m_checkPreFold->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnCheckPreFold ), NULL, this ); - m_checkPreCall->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnCheckPreCall ), NULL, this ); - m_checkPreCallAny->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnCheckPreCallAny ), NULL, this ); - m_checkPreRaise->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnCheckPreRaise ), NULL, this ); - m_checkPreRaiseAny->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CPokerDialogBase::OnCheckPreRaiseAny ), NULL, this ); -} - CGetTextFromUserDialogBase::CGetTextFromUserDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); diff --git a/uibase.h b/uibase.h index d52158f1..6332b931 100644 --- a/uibase.h +++ b/uibase.h @@ -37,7 +37,6 @@ #include #include #include -#include /////////////////////////////////////////////////////////////////////////// @@ -88,14 +87,7 @@ #define wxID_BUTTONBACK 1044 #define wxID_BUTTONNEXT 1045 #define wxID_SUBMIT 1046 -#define wxID_OPENNEWTABLE 1047 -#define wxID_DEALHAND 1048 -#define wxID_FOLD 1049 -#define wxID_CALL 1050 -#define wxID_RAISE 1051 -#define wxID_LEAVETABLE 1052 -#define wxID_DITCHPLAYER 1053 -#define wxID_TEXTCTRL 1054 +#define wxID_TEXTCTRL 1047 /////////////////////////////////////////////////////////////////////////////// /// Class CMainFrameBase @@ -652,78 +644,6 @@ class CEditReviewDialogBase : public wxFrame }; -/////////////////////////////////////////////////////////////////////////////// -/// Class CPokerLobbyDialogBase -/////////////////////////////////////////////////////////////////////////////// -class CPokerLobbyDialogBase : public wxFrame -{ - private: - - protected: - wxTreeCtrl* m_treeCtrl; - wxListCtrl* m_listCtrl; - wxButton* m_buttonNewTable; - - // Virtual event handlers, overide them in your derived class - virtual void OnTreeSelChanged( wxTreeEvent& event ){ event.Skip(); } - virtual void OnListItemActivated( wxListEvent& event ){ event.Skip(); } - virtual void OnListItemSelected( wxListEvent& event ){ event.Skip(); } - virtual void OnButtonNewTable( wxCommandEvent& event ){ event.Skip(); } - - - public: - CPokerLobbyDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Poker Lobby"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 586,457 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); - ~CPokerLobbyDialogBase(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class CPokerDialogBase -/////////////////////////////////////////////////////////////////////////////// -class CPokerDialogBase : public wxFrame -{ - private: - - protected: - wxButton* m_buttonDealHand; - wxButton* m_buttonFold; - wxButton* m_buttonCall; - wxButton* m_buttonRaise; - wxButton* m_buttonLeaveTable; - wxTextCtrl* m_textDitchPlayer; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } - virtual void OnMouseEvents( wxMouseEvent& event ){ event.Skip(); } - virtual void OnPaint( wxPaintEvent& event ){ event.Skip(); } - virtual void OnSize( wxSizeEvent& event ){ event.Skip(); } - virtual void OnCheckSitOut( wxCommandEvent& event ){ event.Skip(); } - virtual void OnButtonDealHand( wxCommandEvent& event ){ event.Skip(); } - virtual void OnButtonFold( wxCommandEvent& event ){ event.Skip(); } - virtual void OnButtonCall( wxCommandEvent& event ){ event.Skip(); } - virtual void OnButtonRaise( wxCommandEvent& event ){ event.Skip(); } - virtual void OnButtonLeaveTable( wxCommandEvent& event ){ event.Skip(); } - virtual void OnDitchPlayer( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCheckPreFold( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCheckPreCall( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCheckPreCallAny( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCheckPreRaise( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCheckPreRaiseAny( wxCommandEvent& event ){ event.Skip(); } - - - public: - wxCheckBox* m_checkSitOut; - wxCheckBox* m_checkPreFold; - wxCheckBox* m_checkPreCall; - wxCheckBox* m_checkPreCallAny; - wxCheckBox* m_checkPreRaise; - wxCheckBox* m_checkPreRaiseAny; - wxStatusBar* m_statusBar; - CPokerDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Poker"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 806,550 ), long style = wxDEFAULT_FRAME_STYLE|wxFRAME_NO_TASKBAR|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL ); - ~CPokerDialogBase(); - -}; - /////////////////////////////////////////////////////////////////////////////// /// Class CGetTextFromUserDialogBase /////////////////////////////////////////////////////////////////////////////// diff --git a/uiproject.fbp b/uiproject.fbp index 17656b56..7c5bb24f 100644 --- a/uiproject.fbp +++ b/uiproject.fbp @@ -11581,998 +11581,6 @@ - - wxSYS_COLOUR_BTNFACE - - - 1 - - - - 0 - wxID_ANY - - - CPokerLobbyDialogBase - - 586,457 - wxDEFAULT_FRAME_STYLE - - Poker Lobby - - - - wxTAB_TRAVERSAL - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bSizer156 - wxHORIZONTAL - none - - 5 - wxEXPAND|wxTOP|wxBOTTOM|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - - 130,-1 - m_treeCtrl - protected - - - wxTR_HAS_BUTTONS|wxTR_HIDE_ROOT|wxTR_LINES_AT_ROOT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnTreeSelChanged - - - - - - - - 5 - wxEXPAND - 1 - - - bSizer172 - wxVERTICAL - none - - 5 - wxEXPAND|wxALL - 1 - - - - 1 - - - 0 - wxID_ANY - - - m_listCtrl - protected - - - wxLC_NO_SORT_HEADER|wxLC_REPORT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnListItemActivated - - - - - OnListItemSelected - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - - 0 - 1 - - - 0 - wxID_OPENNEWTABLE - &Open New Table - - - m_buttonNewTable - protected - - - - - - - - - OnButtonNewTable - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - 0 - wxID_ANY - - - CPokerDialogBase - - 806,550 - wxDEFAULT_FRAME_STYLE|wxFRAME_NO_TASKBAR - - Poker - - - - wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL - 1 - - - - OnClose - - - - - - - - - - - - - - - - - OnMouseEvents - - OnPaint - - - - - OnSize - - - - bSizer174 - wxVERTICAL - none - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Deal Me Out - - - m_checkSitOut - public - - - - - - - - - - OnCheckSitOut - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - - 0 - 1 - - - 0 - wxID_DEALHAND - &Deal Hand - - - m_buttonDealHand - protected - - 150,25 - - - - - - - OnButtonDealHand - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - - 0 - 1 - - - 0 - wxID_FOLD - &Fold - - - m_buttonFold - protected - - 80,25 - - - - - - - OnButtonFold - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - - 0 - 1 - - - 0 - wxID_CALL - &Call - - - m_buttonCall - protected - - 80,25 - - - - - - - OnButtonCall - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - - 0 - 1 - - - 0 - wxID_RAISE - &Raise - - - m_buttonRaise - protected - - 80,25 - - - - - - - OnButtonRaise - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - - 0 - 1 - - - 0 - wxID_LEAVETABLE - &Leave Table - - - m_buttonLeaveTable - protected - - 90,25 - - - - - - - OnButtonLeaveTable - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - - 1 - - - 0 - wxID_DITCHPLAYER - - 0 - - m_textDitchPlayer - protected - - 45,-1 - wxTE_PROCESS_ENTER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnDitchPlayer - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - FOLD - - - m_checkPreFold - public - - 100,-1 - - - - - - - - OnCheckPreFold - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - CALL - - - m_checkPreCall - public - - 100,-1 - - - - - - - - OnCheckPreCall - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - CALL ANY - - - m_checkPreCallAny - public - - 100,-1 - - - - - - - - OnCheckPreCallAny - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - RAISE - - - m_checkPreRaise - public - - 100,-1 - - - - - - - - OnCheckPreRaise - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - RAISE ANY - - - m_checkPreRaiseAny - public - - 100,-1 - - - - - - - - OnCheckPreRaiseAny - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - 1 - - 0 - wxID_ANY - - - m_statusBar - public - - - wxST_SIZEGRIP - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -