Hugin trunk 0.1
Loading...
Searching...
No Matches
HtmlWindow.cpp
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
2
11/* This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
15 *
16 * This software is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public
22 * License along with this software. If not, see
23 * <http://www.gnu.org/licenses/>.
24 *
25 */
26
27#ifdef _WIN32
28#include "wx/msw/wrapwin.h"
29 // Mingw define still DIFFERENCE, which conflicts with vigra, so disable it
30#undef DIFFERENCE
31#endif
32#include "hugin/HtmlWindow.h"
33
35
37{
38 if (link.GetHref().StartsWith(_T("http://")))
40 else
41 wxHtmlWindow::OnLinkClicked(link);
42}
43
44IMPLEMENT_DYNAMIC_CLASS(HtmlWindowXmlHandler, wxHtmlWindowXmlHandler)
45
46wxObject *HtmlWindowXmlHandler::DoCreateResource()
47{
49
50 control->Create(m_parentAsWindow,
51 GetID(),
52 GetPosition(), GetSize(),
54 GetName());
55
56 if (HasParam("borders"))
57 {
58 control->SetBorders(GetDimension("borders"));
59 }
60
61 if (HasParam("url"))
62 {
63 wxString url = GetParamValue("url");
65
66 wxFSFile *f = fsys.OpenFile(url);
67 if (f)
68 {
69 control->LoadPage(f->GetLocation());
70 delete f;
71 }
72 else
73 control->LoadPage(url);
74 }
75
76 else if (HasParam("htmlcode"))
77 {
78 control->SetPage(GetText("htmlcode"));
79 }
80
81 SetupWindow(control);
82
83 return control;
84}
85
86
88{
89 return IsOfClass(node, "HtmlWindow");
90}
Definition of HTMLWindow class which supports opening external links in default web browser.
xrc handler for HTMLWindow
Definition HtmlWindow.h:54
virtual bool CanHandle(wxXmlNode *node)
Internal use to identify right xml handler.
Modified wxHtmlWindow for open external links.
Definition HtmlWindow.h:44
IMPLEMENT_DYNAMIC_CLASS(wxTreeListHeaderWindow, wxWindow)
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41