Version: 0.6.0
addcommanddlg.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: add command in command bar dialog.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2009-2010,2013,2014 Dmitry Baryshnikov
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, see <http://www.gnu.org/licenses/>.
20  ****************************************************************************/
21 #pragma once
22 #include "wxgis/framework/framework.h"
23 #include "wxgis/framework/application.h"
24 
25 #include "wx/intl.h"
26 
27 #include "wx/gdicmn.h"
28 #include "wx/aui/auibook.h"
29 #include "wx/font.h"
30 #include "wx/colour.h"
31 #include "wx/settings.h"
32 #include "wx/string.h"
33 #include "wx/sizer.h"
34 #include "wx/button.h"
35 #include "wx/dialog.h"
36 #include "wx/splitter.h"
37 #include "wx/checklst.h"
38 #include "wx/listctrl.h"
39 #include "wx/panel.h"
40 #include "wx/listbox.h"
41 
42 class WXDLLIMPEXP_GIS_FRW wxGISAddCommandDlg : public wxDialog
43 {
44  enum
45  {
46  ID_LSTBX = wxID_HIGHEST + 2051,
47  ID_LSTCTRL,
48  ID_ONSETKEYCODE,
49  MENUID = ID_PLUGINCMD + 1200
50  };
51 public:
52  typedef std::map<wxString, wxCommandPtrArray> CATEGORYMAP;
53  wxVector<long> m_IDArray;
54 
55 private:
56  CATEGORYMAP m_CategoryMap;
57 
58 protected:
59  wxSplitterWindow* m_Splitter;
60  wxListBox* m_ListBox;
61  wxListView* m_ListCtrl;
62  wxGISApplication* m_pGxApp;
63  wxImageList m_ImageList;
64  int m_CurSelection;
65  wxStdDialogButtonSizer* m_sdbSizer;
66  wxButton* m_sdbSizerOK;
67  wxButton* m_sdbSizerCancel;
68 
69 public:
70  wxGISAddCommandDlg( wxGISApplication* pGxApp, wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Add command"),const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
71  ~wxGISAddCommandDlg(void);
72  void FillIDArray(void);
73  void SplitterOnIdle( wxIdleEvent& )
74  {
75  m_Splitter->SetSashPosition( m_nSashPos );
76  m_Splitter->Unbind(wxEVT_IDLE, &wxGISAddCommandDlg::SplitterOnIdle, this );
77  //m_Splitter->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxGISAddCommandDlg::SplitterOnIdle ), NULL, this );
78  }
79  virtual void EndModal(int retCode);
80  //events
81  void OnListboxSelect(wxCommandEvent& event);
82  void OnDoubleClickSash(wxSplitterEvent& event);
83  void OnListctrlActivated(wxListEvent& event);
84  void OnUpdateOKUI(wxUpdateUIEvent& event);
85  void OnOk(wxCommandEvent& event);
86 protected:
87  virtual void SerializeDialogPos(bool bSave = false);
88 protected:
89  int m_nSashPos;
90 private:
91  DECLARE_EVENT_TABLE()
92 };
Definition: application.h:39
Definition: addcommanddlg.h:42