#include "wx/utils.h"
#include "wx/clipbrd.h"
#include "wx/dataobj.h"
+#include "wx/stopwatch.h"
#include "../../sample.xpm"
#if wxUSE_CLIPBOARD
DECLARE_EVENT_TABLE()
#endif // wxUSE_CLIPBOARD
- DECLARE_NO_COPY_CLASS(MyHtmlWindow)
+ wxDECLARE_NO_COPY_CLASS(MyHtmlWindow);
};
// Define a new frame type: this is going to be our main frame
wxMenu *menuFile = new wxMenu;
wxMenu *menuNav = new wxMenu;
- menuFile->Append(ID_PageOpen, _("&Open HTML page..."));
+ menuFile->Append(ID_PageOpen, _("&Open HTML page...\tCtrl-O"));
menuFile->Append(ID_DefaultLocalBrowser, _("&Open current page with default browser"));
menuFile->Append(ID_DefaultWebBrowser, _("Open a &web page with default browser"));
menuFile->AppendSeparator();
m_Html = new MyHtmlWindow(this);
m_Html->SetRelatedFrame(this, _("HTML : %s"));
#if wxUSE_STATUSBAR
- m_Html->SetRelatedStatusBar(0);
+ m_Html->SetRelatedStatusBar(1);
#endif // wxUSE_STATUSBAR
m_Html->ReadCustomization(wxConfig::Get());
m_Html->LoadFile(wxFileName(wxT("test.htm")));
wxEmptyString, wxEmptyString, wxT("HTML files|*.htm;*.html"));
if (!p.empty())
+ {
+#if wxUSE_STOPWATCH
+ wxStopWatch sw;
+#endif
m_Html->LoadFile(wxFileName(p));
+#if wxUSE_STOPWATCH
+ wxLogStatus("Loaded \"%s\" in %lums", p, sw.Time());
+#endif
+ }
#endif // wxUSE_FILEDLG
}
if ( CopySelection() )
{
wxTextDataObject data;
- if ( wxTheClipboard && wxTheClipboard->GetData(data) )
+ if ( wxTheClipboard && wxTheClipboard->Open() && wxTheClipboard->GetData(data) )
{
const wxString text = data.GetText();
const size_t maxTextLength = 100;
wxString(text, maxTextLength).c_str(),
(text.length() > maxTextLength) ? _T("...")
: _T("")));
+ wxTheClipboard->Close();
+
return;
}
}