OpenCPN Partial API docs
All Classes Namespaces Functions Variables Pages
SendToPeerDlg.h
1/***************************************************************************
2 *
3 * Project: OpenCPN
4 *
5 ***************************************************************************
6 * Copyright (C) 2010 by David S. Register *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the *
20 * Free Software Foundation, Inc., *
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
22 ***************************************************************************
23 */
24
25#ifndef __SENDTOPEERDLG_H__
26#define __SENDTOPEERDLG_H__
27
28#include <wx/wxprec.h>
29#ifndef WX_PRECOMP
30#include <wx/wx.h>
31#endif // precompiled headers
32
33#include <wx/dialog.h>
34
35// Constants for SendToPeer... Dialog
36#define ID_STPDIALOG 10006
37#define SYMBOL_STP_STYLE \
38 wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX | \
39 wxFRAME_FLOAT_ON_PARENT
40#define SYMBOL_STP_TITLE _("Send to Peer")
41#define SYMBOL_STP_IDNAME ID_STPDIALOG
42#define SYMBOL_STP_SIZE wxSize(500, 500)
43#define SYMBOL_STP_POSITION wxDefaultPosition
44
45enum { ID_STP_CANCEL = 10000, ID_STP_OK, ID_STP_CHOICE_PEER, ID_STP_SCAN };
46
47class Route;
48class RoutePoint;
49class Track;
50
54class SendToPeerDlg : public wxDialog {
55 DECLARE_DYNAMIC_CLASS(SendToPeerDlg)
56 DECLARE_EVENT_TABLE()
57
58public:
60 SendToPeerDlg(wxWindow* parent, wxWindowID id, const wxString& caption,
61 const wxString& hint, const wxPoint& pos, const wxSize& size,
62 long style);
64
65 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_STP_IDNAME,
66 const wxString& caption = SYMBOL_STP_TITLE,
67 const wxString& hint = SYMBOL_STP_TITLE,
68 const wxPoint& pos = SYMBOL_STP_POSITION,
69 const wxSize& size = SYMBOL_STP_SIZE,
70 long style = SYMBOL_STP_STYLE);
71 void SetRoute(Route* pRoute) { m_RouteList.push_back(pRoute); }
72 void SetWaypoint(RoutePoint* pRoutePoint) { m_RoutePointList.push_back(pRoutePoint); }
73 void SetTrack(Track* pTrack) { m_TrackList.push_back(pTrack); }
74 wxGauge* GetProgressGauge() { return m_pgauge; }
75 void SetMessage(wxString message);
76 void SetScanOnCreate(bool s){ m_bScanOnCreate = s;}
77 void SetScanTime(int t){ m_scanTime = t;}
78
79private:
80 void CreateControls(const wxString& hint);
81
82 void OnCancelClick(wxCommandEvent& event);
83 void OnSendClick(wxCommandEvent& event);
84 void OnScanClick(wxCommandEvent& event);
85 void OnTimerAutoscan(wxTimerEvent &event);
86 void OnTimerScanTick(wxTimerEvent &event);
87 void DoScan();
88
89 std::vector<Route*> m_RouteList;
90 std::vector<RoutePoint*> m_RoutePointList;
91 std::vector<Track*> m_TrackList;
92 wxComboBox* m_PeerListBox;
93 wxGauge* m_pgauge;
94 wxButton* m_CancelButton;
95 wxButton* m_SendButton;
96 wxStaticText* premtext;
97 wxButton *m_RescanButton;
98
99 wxTimer m_autoScanTimer;
100 wxTimer m_ScanTickTimer;
101 int m_tick;
102 int m_scanTime;
103 bool m_bScanOnCreate;
104
105};
106
107#endif
Definition: route.h:70
Route "Send to Peer..." Dialog Definition.
Definition: SendToPeerDlg.h:54
Definition: track.h:79