#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
// `Main program' equivalent: the program execution "starts" here
bool MyApp::OnInit()
{
+ if ( !wxApp::OnInit() )
+ return false;
+
#if wxUSE_SYSTEM_OPTIONS
wxSystemOptions::SetOption(wxT("no-maskblt"), 1);
#endif
void MyFrame::OnHtmlCellHover(wxHtmlCellEvent &event)
{
- wxLogMessage(wxT("Mouse moved over cell %d at %d;%d"),
+ wxLogMessage(wxT("Mouse moved over cell %p at %d;%d"),
event.GetCell(), event.GetPoint().x, event.GetPoint().y);
}
void MyFrame::OnHtmlCellClicked(wxHtmlCellEvent &event)
{
- wxLogMessage(wxT("Click over cell %d at %d;%d"),
+ wxLogMessage(wxT("Click over cell %p at %d;%d"),
event.GetCell(), event.GetPoint().x, event.GetPoint().y);
// if we don't skip the event, OnHtmlLinkClicked won't be called!
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;
}
}