1 /*************************************************************************** 2 loctree.h - description 3 ------------------- 4 begin : Sun Jun 23 2002 5 copyright : (C) 2002 by ARRL 6 author : Jon Bloom 7 email : jbloom@arrl.org 8 revision : $Id$ 9 ***************************************************************************/ 10 11 #ifndef __loctree_h 12 #define __loctree_h 13 14 #ifdef HAVE_CONFIG_H 15 #include "sysconfig.h" 16 #endif 17 18 #include "wx/wxprec.h" 19 20 #ifdef __BORLANDC__ 21 #pragma hdrstop 22 #endif 23 24 #ifndef WX_PRECOMP 25 #include "wx/wx.h" 26 #endif 27 28 #include "tqsllib.h" 29 30 #include "wx/treectrl.h" 31 32 class LocTreeItemData : public wxTreeItemData { 33 public: LocTreeItemData(wxString locname,wxString callsign)34 LocTreeItemData(wxString locname, wxString callsign) : _locname(locname), _callsign(callsign) {} getLocname()35 wxString getLocname() { return _locname; } getCallSign()36 wxString getCallSign() { return _callsign; } 37 38 private: 39 wxString _locname; 40 wxString _callsign; 41 }; 42 43 class LocTree : public wxTreeCtrl { 44 public: 45 LocTree(wxWindow *parent, const wxWindowID id, const wxPoint& pos, 46 const wxSize& size, long style); 47 virtual ~LocTree(); 48 int Build(int flags = TQSL_SELECT_CERT_WITHKEYS, const TQSL_PROVIDER *provider = 0); 49 void OnItemActivated(wxTreeEvent& event); 50 void OnRightDown(wxMouseEvent& event); 51 bool useContextMenu; GetItemData(wxTreeItemId id)52 LocTreeItemData *GetItemData(wxTreeItemId id) { return reinterpret_cast<LocTreeItemData *>(wxTreeCtrl::GetItemData(id)); } GetNumLocations()53 int GetNumLocations() const { return _nloc; } 54 55 private: 56 int _nloc; 57 DECLARE_EVENT_TABLE() 58 }; 59 60 #endif // __loctree_h 61