26 #ifndef __TRACKPROPDLG_H__
27 #define __TRACKPROPDLG_H__
29 #include <wx/clipbrd.h>
30 #include <wx/artprov.h>
31 #include <wx/xrc/xmlres.h>
33 #include <wx/string.h>
34 #include <wx/stattext.h>
35 #include <wx/gdicmn.h>
37 #include <wx/colour.h>
38 #include <wx/settings.h>
39 #include <wx/textctrl.h>
41 #include <wx/checkbox.h>
42 #include <wx/choice.h>
43 #include <wx/clipbrd.h>
44 #include <wx/colour.h>
47 #include <wx/gdicmn.h>
48 #include <wx/hyperlink.h>
52 #include <wx/listctrl.h>
54 #include <wx/radiobut.h>
55 #include <wx/scrolwin.h>
56 #include <wx/button.h>
57 #include <wx/tglbtn.h>
58 #include <wx/notebook.h>
60 #if wxCHECK_VERSION(2, 9, 0)
61 #include <wx/dialog.h>
63 #include "scrollingdialog.h"
66 #include "LinkPropDlg.h"
69 #define DIALOG_PARENT wxFrame
71 #define DIALOG_PARENT wxDialog
74 #define ID_RCLK_MENU_COPY_TEXT 7013
76 #define ID_TRK_MENU_ADD 7014
77 #define ID_TRK_MENU_EDIT 7015
78 #define ID_TRK_MENU_DELETE 7016
95 static bool instanceFlag;
97 TrackPropDlg(wxWindow* parent, wxWindowID
id,
const wxString& title,
98 const wxPoint& pos,
const wxSize& size,
long style);
101 Track* m_pExtendTrack;
110 bool IsThisTrackExtendable();
111 bool SaveChanges(
void);
113 HyperlinkList* m_pMyLinkList;
114 void OnHyperLinkClick(wxHyperlinkEvent& event);
115 wxHyperlinkCtrl* m_pEditedLink;
116 void PopupMenuHandler(wxCommandEvent& event);
117 void OnActivate(wxActivateEvent& event);
120 wxNotebook* m_notebook1;
121 wxScrolledWindow* m_panelBasic;
122 wxStaticText* m_stName;
124 wxStaticText* m_stFrom;
126 wxStaticText* m_stTo;
128 wxCheckBox* m_cbShow;
129 wxStaticText* m_stColor;
131 wxStaticText* m_stStyle;
133 wxStaticText* m_stWidth;
135 wxStaticText* m_stTotDistance;
136 wxTextCtrl* m_tTotDistance;
137 wxStaticText* m_stAvgSpeed;
138 wxTextCtrl* m_tAvgSpeed;
139 wxStaticText* m_stTimeEnroute;
140 wxTextCtrl* m_tTimeEnroute;
141 wxStaticText* m_stShowTime;
142 wxRadioButton* m_rbShowTimeUTC;
143 wxRadioButton* m_rbShowTimePC;
144 wxRadioButton* m_rbShowTimeLocal;
146 wxScrolledWindow* m_panelAdvanced;
147 wxStaticText* m_stDescription;
148 wxTextCtrl* m_tDescription;
149 wxScrolledWindow* m_scrolledWindowLinks;
150 wxHyperlinkCtrl* m_hyperlink1;
152 wxButton* m_buttonAddLink;
153 wxToggleButton* m_toggleBtnEdit;
154 wxStaticText* m_staticTextEditEnabled;
155 wxStdDialogButtonSizer* m_sdbBtmBtnsSizer;
156 wxButton* m_sdbBtmBtnsSizerOK;
157 wxButton* m_sdbBtmBtnsSizerCancel;
158 wxStaticBoxSizer* sbSizerLinks;
159 wxBoxSizer* bSizerLinks;
161 wxButton* m_sdbBtmBtnsSizerPrint;
162 wxButton* m_sdbBtmBtnsSizerSplit;
163 wxButton* m_sdbBtmBtnsSizerExtend;
164 wxButton* m_sdbBtmBtnsSizerToRoute;
165 wxButton* m_sdbBtmBtnsSizerExport;
167 wxMenuItem* m_menuItemEdit;
168 wxMenuItem* m_menuItemAdd;
169 wxMenuItem* m_menuItemDelete;
171 wxScrolledWindow* itemDialog1;
175 void OnCancelBtnClick(wxCommandEvent& event);
176 void OnOKBtnClick(wxCommandEvent& event);
177 void OnPrintBtnClick(wxCommandEvent& event);
178 void OnSplitBtnClick(wxCommandEvent& event);
179 void OnExtendBtnClick(wxCommandEvent& event);
180 void OnToRouteBtnClick(wxCommandEvent& event);
181 void OnExportBtnClick(wxCommandEvent& event);
182 void OnTrackPropCopyTxtClick(wxCommandEvent& event);
183 void OnTrackPropListClick(wxListEvent& event);
184 void OnTrackPropRightClick(wxListEvent& event);
185 void OnTrackPropMenuSelected(wxCommandEvent& event);
187 void OnEditLink(wxCommandEvent& event);
188 void OnAddLink(wxCommandEvent& event);
189 void OnEditLinkToggle(wxCommandEvent& event);
190 void OnShowTimeTZ(wxCommandEvent& event);
191 void CreateControls(
void);
192 void CreateControlsCompact(
void);
196 wxWindow* parent, wxWindowID
id = wxID_ANY,
197 const wxString& title = _(
"Track properties"),
198 const wxPoint& pos = wxDefaultPosition,
199 const wxSize& size = wxSize(680, 440),
200 long style = FRAME_WITH_LINKS_STYLE);
201 static bool getInstanceFlag() {
return instanceFlag; }
204 void m_hyperlink1OnContextMenu(wxMouseEvent& event) {
205 m_hyperlink1->PopupMenu(m_menuLink, event.GetPosition());
208 void SetTrackAndUpdate(
Track* pt);
210 void InitializeList();
211 Track* GetTrack() {
return m_pTrack; }
213 void RecalculateSize(
void);
217 void m_hyperlinkContextMenu(wxMouseEvent& event);
223 const wxSize& size,
long style);
226 wxString OnGetItemText(
long item,
long column)
const;
227 int OnGetItemColumnImage(
long item,
long column)
const;
void OnDeleteLink(wxCommandEvent &event)