25 #ifndef __SENDTOPEERDLG_H__
26 #define __SENDTOPEERDLG_H__
30 #include <wx/wxprec.h>
37 #include <wx/button.h>
38 #include <wx/checkbox.h>
39 #include <wx/combobox.h>
40 #include <wx/dialog.h>
43 #include <wx/gdicmn.h>
44 #include <wx/stattext.h>
45 #include <wx/string.h>
47 #include <wx/window.h>
49 #include "model/route.h"
50 #include "model/route_point.h"
51 #include "model/track.h"
53 #include "observable_evtvar.h"
57 #define ID_STPDIALOG 10006
58 #define SYMBOL_STP_STYLE \
59 wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX | \
60 wxFRAME_FLOAT_ON_PARENT
61 #define SYMBOL_STP_TITLE _("Send to Peer")
62 #define SYMBOL_STP_IDNAME ID_STPDIALOG
63 #define SYMBOL_STP_SIZE wxSize(500, 500)
64 #define SYMBOL_STP_POSITION wxDefaultPosition
66 enum { ID_STP_CANCEL = 10000, ID_STP_OK, ID_STP_CHOICE_PEER, ID_STP_SCAN };
79 bool Create(wxWindow* parent, wxWindowID
id = SYMBOL_STP_IDNAME,
80 const wxString& caption = SYMBOL_STP_TITLE,
81 const wxString& hint = SYMBOL_STP_TITLE,
82 const wxPoint& pos = SYMBOL_STP_POSITION,
83 const wxSize& size = SYMBOL_STP_SIZE,
84 long style = SYMBOL_STP_STYLE);
85 void SetRoute(
Route* pRoute) { m_RouteList.push_back(pRoute); }
86 void SetWaypoint(
RoutePoint* pRoutePoint) { m_RoutePointList.push_back(pRoutePoint); }
87 void SetTrack(
Track* pTrack) { m_TrackList.push_back(pTrack); }
88 void SetMessage(wxString message);
89 void SetScanOnCreate(
bool s){ m_bScanOnCreate = s;}
90 void SetScanTime(
int t){ m_scanTime = t * 2;}
93 void CreateControls([[maybe_unused]]
const wxString& hint);
95 void OnCancelClick(wxCommandEvent& event);
96 void OnSendClick([[maybe_unused]] wxCommandEvent& event);
97 void OnScanClick(wxCommandEvent& event);
98 void OnTimerAutoscan(wxTimerEvent &event);
99 void OnTimerScanTick(wxTimerEvent &event);
101 bool EnableActivateChkbox();
103 std::vector<Route*> m_RouteList;
104 std::vector<RoutePoint*> m_RoutePointList;
105 std::vector<Track*> m_TrackList;
106 wxComboBox* m_PeerListBox;
108 wxButton* m_CancelButton;
109 wxButton* m_SendButton;
110 wxStaticText* premtext;
111 wxButton* m_RescanButton;
112 wxCheckBox* m_activate_chkbox;
115 std::string m_ownipAddr;
117 wxTimer m_autoScanTimer;
118 wxTimer m_ScanTickTimer;
121 bool m_bScanOnCreate;
Generic event handling between MVC Model and Controller based on a shared EventVar variable.
Define an action to be performed when a KeyProvider is notified.
Route "Send to Peer..." Dialog Definition.