Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ColorMapDlg.h
1 //
2 // Name: ColorMapDlg.h
3 //
4 // Copyright (c) 2004-2011 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef __ColorMapDlg_H__
9 #define __ColorMapDlg_H__
10 
11 #ifndef WX_PRECOMP
12  #include "wx/wx.h"
13 #endif
14 
15 #include "wx/imaglist.h"
16 #include "wx/colourdata.h"
17 
18 #include "vtui_UI.h"
19 #include "AutoDialog.h"
20 #include "vtdata/HeightField.h"
21 
22 // WDR: class declarations
23 
24 //----------------------------------------------------------------------------
25 // ColorMapDlg
26 //----------------------------------------------------------------------------
27 
29 {
30 public:
31  // constructors and destructors
32  ColorMapDlg( wxWindow *parent, wxWindowID id,
33  const wxString& title,
34  const wxPoint& pos = wxDefaultPosition,
35  const wxSize& size = wxDefaultSize,
36  long style = wxDEFAULT_DIALOG_STYLE );
37 
38  // WDR: method declarations for ColorMapDlg
39  wxButton* GetSave() { return (wxButton*) FindWindow( ID_SAVE_CMAP ); }
40  wxTextCtrl* GetHeightToAdd() { return (wxTextCtrl*) FindWindow( ID_HEIGHT_TO_ADD ); }
41  wxButton* GetDeleteColor() { return (wxButton*) FindWindow( ID_DELETE_ELEVATION ); }
42  wxButton* GetChangeColor() { return (wxButton*) FindWindow( ID_CHANGE_COLOR ); }
43  wxListCtrl* GetList() { return (wxListCtrl*) FindWindow( ID_COLORLIST ); }
44  wxTextCtrl* GetCmapFile() { return (wxTextCtrl*) FindWindow( ID_CMAP_FILE ); }
45 
46  void SetFile(const char *fname);
47  void UpdateItems();
48 
49 private:
50  // WDR: member variable declarations for ColorMapDlg
51  ColorMap m_cmap;
52  wxString m_strFile;
53  float m_fHeight;
54  bool m_bRelative, m_bBlend;
55  long m_iItem;
56  wxColourData m_ColorData;
57  wxColour m_Color;
58  wxImageList m_imlist;
59 
60 private:
61  // WDR: handler declarations for ColorMapDlg
62  void OnLoad( wxCommandEvent &event );
63  void OnSave( wxCommandEvent &event );
64  void OnSaveAs( wxCommandEvent &event );
65  void OnAdd( wxCommandEvent &event );
66  void OnDeleteColor( wxCommandEvent &event );
67  void OnChangeColor( wxCommandEvent &event );
68  void OnItemSelected( wxListEvent &event );
69  void OnInitDialog(wxInitDialogEvent& event);
70 
71  void UpdateEnabling();
72  bool AskColor(RGBi &rgb);
73 
74 private:
75  DECLARE_EVENT_TABLE()
76 };
77 
78 #endif // __ColorMapDlg_H__
79