1 
2 ///////////////////////////////////////////////////////////
3 //                                                       //
4 //                         SAGA                          //
5 //                                                       //
6 //      System for Automated Geoscientific Analyses      //
7 //                                                       //
8 //                    User Interface                     //
9 //                                                       //
10 //                    Program: SAGA                      //
11 //                                                       //
12 //-------------------------------------------------------//
13 //                                                       //
14 //                 ACTIVE_Description.cpp                //
15 //                                                       //
16 //          Copyright (C) 2005 by Olaf Conrad            //
17 //                                                       //
18 //-------------------------------------------------------//
19 //                                                       //
20 // This file is part of 'SAGA - System for Automated     //
21 // Geoscientific Analyses'. SAGA is free software; you   //
22 // can redistribute it and/or modify it under the terms  //
23 // of the GNU General Public License as published by the //
24 // Free Software Foundation, either version 2 of the     //
25 // License, or (at your option) any later version.       //
26 //                                                       //
27 // SAGA is distributed in the hope that it will be       //
28 // useful, but WITHOUT ANY WARRANTY; without even the    //
29 // implied warranty of MERCHANTABILITY or FITNESS FOR A  //
30 // PARTICULAR PURPOSE. See the GNU General Public        //
31 // License for more details.                             //
32 //                                                       //
33 // You should have received a copy of the GNU General    //
34 // Public License along with this program; if not, see   //
35 // <http://www.gnu.org/licenses/>.                       //
36 //                                                       //
37 //-------------------------------------------------------//
38 //                                                       //
39 //    contact:    Olaf Conrad                            //
40 //                Institute of Geography                 //
41 //                University of Goettingen               //
42 //                Goldschmidtstr. 5                      //
43 //                37077 Goettingen                       //
44 //                Germany                                //
45 //                                                       //
46 //    e-mail:     oconrad@saga-gis.org                   //
47 //                                                       //
48 ///////////////////////////////////////////////////////////
49 
50 //---------------------------------------------------------
51 #include <wx/clipbrd.h>
52 #include <wx/dataobj.h>
53 
54 #include "res_controls.h"
55 
56 #include "helper.h"
57 
58 #include "active_description.h"
59 
60 
61 ///////////////////////////////////////////////////////////
62 //														 //
63 //														 //
64 //														 //
65 ///////////////////////////////////////////////////////////
66 
67 //---------------------------------------------------------
IMPLEMENT_CLASS(CActive_Description,wxHtmlWindow)68 IMPLEMENT_CLASS(CActive_Description, wxHtmlWindow)
69 
70 //---------------------------------------------------------
71 BEGIN_EVENT_TABLE(CActive_Description, wxHtmlWindow)
72 	EVT_KEY_DOWN		(CActive_Description::On_Key_Down)
73 END_EVENT_TABLE()
74 
75 
76 ///////////////////////////////////////////////////////////
77 //														 //
78 ///////////////////////////////////////////////////////////
79 
80 //---------------------------------------------------------
81 CActive_Description::CActive_Description(wxWindow *pParent)
82 	: wxHtmlWindow(pParent, ID_WND_ACTIVE_DESCRIPTION , wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER)
83 {
84 }
85 
86 //---------------------------------------------------------
~CActive_Description(void)87 CActive_Description::~CActive_Description(void)
88 {
89 }
90 
91 
92 ///////////////////////////////////////////////////////////
93 //														 //
94 ///////////////////////////////////////////////////////////
95 
96 //---------------------------------------------------------
On_Key_Down(wxKeyEvent & event)97 void CActive_Description::On_Key_Down(wxKeyEvent &event)
98 {
99 	if( event.ControlDown() )
100 	{
101 		switch( event.GetKeyCode() )
102 		{
103 		default:
104 			event.Skip();
105 			break;
106 
107 		case 'C':
108 		case 'c':
109 			if( wxTheClipboard->Open() )
110 			{
111 				wxTheClipboard->SetData(new wxTextDataObject(SelectionToText()));
112 				wxTheClipboard->Close();
113 			}
114 			break;
115 		}
116 
117 	}
118 }
119 
120 //---------------------------------------------------------
OnLinkClicked(const wxHtmlLinkInfo & Link)121 void CActive_Description::OnLinkClicked(const wxHtmlLinkInfo &Link)
122 {
123 	Open_WebBrowser(Link.GetHref());
124 }
125 
126 
127 ///////////////////////////////////////////////////////////
128 //														 //
129 //														 //
130 //														 //
131 ///////////////////////////////////////////////////////////
132 
133 //---------------------------------------------------------
134