ToolMap
Loading...
Searching...
No Matches
tmwmsframe.h
1//
2// Created by lsc on 26.05.25.
3//
4
5#ifndef TMWMSFRAME_H
6#define TMWMSFRAME_H
7
8#include <wx/wxprec.h>
9
10#ifndef WX_PRECOMP
11#include <wx/wx.h>
12#endif
13
14#include <wx/button.h>
15#include <wx/combobox.h>
16#include <wx/listctrl.h>
17#include <wx/srchctrl.h>
18#include <wx/filename.h>
19#include <wx/html/htmlwin.h>
20
21
25class tmWMSBrowserFrame : public wxDialog {
26private:
27protected:
28 wxStaticText *m_staticText1 = nullptr;
29 wxComboBox *m_ctrl_wms_url = nullptr;
30 wxStaticText *m_staticText3 = nullptr;
31 wxComboBox *m_ctrl_wms_lang = nullptr;
32 wxButton *m_ctrl_btn_wms_load_layers = nullptr;
33 wxListCtrl *m_ctrl_layer_list = nullptr;
34 wxButton *m_btn_export = nullptr;
35 wxStaticText *m_staticText2 = nullptr;
36 wxSearchCtrl *m_ctrl_search = nullptr;
37 wxStaticText *m_info_text_ctrl = nullptr;
38 wxCheckBox *m_ctrl_append_to_project = nullptr;
39 wxChoice *m_ctrl_projection = nullptr;
40 wxStaticText *m_staticText5 = nullptr;
41
42
43 wxArrayString m_layers_names, m_layers_titles, m_layers_abstracts, m_layers_crs;
44 wxArrayInt m_checked_layers;
45 bool m_is_project_open;;
46 wxArrayString m_exported_layers;
47 wxString m_project_projection;
48
49 // Virtual event handlers, override them in your derived class
50 virtual void OnBtnLoadLayers(wxCommandEvent &event);
51
52 virtual void OnBtnExport(wxCommandEvent &event);
53
54 virtual void OnDoubleClickItems(wxListEvent &event);
55
56 virtual void OnSearchList(wxCommandEvent &event);
57
58 virtual void OnSearchBtnCancel(wxCommandEvent &event);
59
60 virtual void UpdateInfoText(wxUpdateUIEvent &event);
61
62 void _get_checked_layers();
63
64 void _create_controls();
65
66 // list functions
67 void add_layer_to_list(const wxString &layer_name, const wxString &layer_title, const wxString &layer_abstract,
68 int layer_index);
69
70public:
71 tmWMSBrowserFrame(wxWindow *parent, bool is_project_open, const wxString &project_projection,
72 wxWindowID id = wxID_ANY, const wxString &title = _("WMS Browser"),
73 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
74 long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
75
76 wxArrayString GetExportedLayers() const {
77 return m_exported_layers;
78 }
79
80 bool DoAppendLayersToProject() const {
81 return m_ctrl_append_to_project->GetValue();
82 }
83};
84
85
89class tmWMSFrameDetails : public wxDialog {
90protected:
91 wxHtmlWindow *m_ctrl_html;
92 wxString m_name_wms;
93 wxString m_abstract_wms;
94 wxString m_title_wms;
95
96 void _create_controls();
97
98 bool TransferDataToWindow() override;
99
100public:
101 tmWMSFrameDetails(wxWindow *parent, const wxString &name_wms, const wxString &abstract_wms,
102 const wxString &title_wms,
103 wxWindowID id = wxID_ANY, const wxString &title = _("Details"),
104 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
105 long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
106};
107
108#endif // TMWMSFRAME_H
Class tmWMSBrowserFrame.
Definition tmwmsframe.h:25
void add_layer_to_list(const wxString &layer_name, const wxString &layer_title, const wxString &layer_abstract, int layer_index)
Adds a layer to the list control.
Definition tmwmsframe.cpp:214
Class tmWMSFrameDetails.
Definition tmwmsframe.h:89