///////////////////////////////////////////////////////////////////////////// // Name: tables.h // tag: header to handle the tables in a room of aBridge tables. // Author: David Roundy // Modified by: // Copyright: (c) 2002 David Roundy // Licence: GPL //--------------------------------------------------------------------------- // Last modified: Feb 2002 /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ///////////////////////////////////////////////////////////////////////////// #ifndef _BRIDGETABLES_H_ #define _BRIDGETABLES_H_ // For compilers that support precompilation, includes "wx/wx.h". #include #ifndef WX_PRECOMP #include #include #include #endif #include "irc.h" #include "tablepic.h" BEGIN_DECLARE_EVENT_TYPES() DECLARE_EVENT_TYPE(wxEVT_COMMAND_BRIDGETABLES, 13) END_DECLARE_EVENT_TYPES() class TablesEvent : public wxCommandEvent { DECLARE_DYNAMIC_CLASS( TablesEvent ) public: TablesEvent( wxWindow* win = (wxWindow*) NULL, const wxString& type = "TEST", const wxString& message = "TEST"); #if wxCHECK_VERSION(2, 4, 0) wxEvent *Clone() const { return new TablesEvent(*this); }; #else void CopyObject( wxObject& obj ) const; #endif const wxString GetType() { return m_type; }; const wxString GetMyMessage() { return m_message; }; private: wxString m_type, m_message; }; typedef void (wxEvtHandler::*TablesEventFunction)(TablesEvent&); #define EVT_BRIDGETABLES(fn) DECLARE_EVENT_TABLE_ENTRY( \ wxEVT_COMMAND_BRIDGETABLES, \ -1, \ -1, \ (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) \ (TablesEventFunction) &fn, \ (wxObject *)NULL ), class aBridgeTables: public wxScrolledWindow { public: aBridgeTables(wxWindow* parent, int x, int y, int w, int h); virtual ~aBridgeTables(); virtual void OnDraw(wxDC& dc); void SetTalkFocus(wxFocusEvent& evt); void ProcessTablesEvent(TablesEvent &evt); TablePic *AddTable(const wxString &table_name); void RemoveTable(const wxString &table_name); DECLARE_EVENT_TABLE() private: void HandleSit(const wxString &table_name, const wxString &seat, const wxString &player); void HandleStand(const wxString &table_name, const wxString &seat); void HandleLeaveTable(const wxString &table_name); void HandleJoinedTable(const wxString &table_name); wxGridSizer *m_sizer; TablePicList *m_tablepics; void SendEvent(const wxString &type, const wxString &msg); void SetTableTopic(const wxString &table, const wxString &topic); wxFont* m_font; wxCursor* m_arrowCursor; // Tables info }; #endif