summaryrefslogtreecommitdiff
path: root/OPJViewer/source/OPJViewer.cpp
diff options
context:
space:
mode:
authorGiuseppe Baruffa <gbaruffa@users.noreply.github.com>2008-01-31 14:36:06 +0000
committerGiuseppe Baruffa <gbaruffa@users.noreply.github.com>2008-01-31 14:36:06 +0000
commite21d8654402fc9e35e9fe18c68da63ce5a731140 (patch)
treed7760b1eddc754ee1570d3d64f7389a014aa3aa4 /OPJViewer/source/OPJViewer.cpp
parent04966097fc1d92fbfb6650d43b115447d5370c2c (diff)
In opjviewer, unification of JPEG 2000 family handlers (*.jp2, *.mj2, *.j2k) in a single file
Diffstat (limited to 'OPJViewer/source/OPJViewer.cpp')
-rw-r--r--OPJViewer/source/OPJViewer.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/OPJViewer/source/OPJViewer.cpp b/OPJViewer/source/OPJViewer.cpp
index 082a04fb..2cd2eb52 100644
--- a/OPJViewer/source/OPJViewer.cpp
+++ b/OPJViewer/source/OPJViewer.cpp
@@ -189,14 +189,15 @@ bool OPJViewerApp::OnInit(void)
#if wxUSE_LIBJPEG
wxImage::AddHandler( new wxJPEGHandler );
#endif
+#if wxUSE_LIBOPENJPEG
+ //wxImage::AddHandler( new wxJ2KHandler );
+ //wxImage::AddHandler( new wxJP2Handler );
+ //wxImage::AddHandler( new wxMJ2Handler );
+ wxImage::AddHandler( new wxJPEG2000Handler );
+#endif
#if USE_MXF
wxImage::AddHandler( new wxMXFHandler );
#endif // USE_MXF
-#if wxUSE_LIBOPENJPEG
- wxImage::AddHandler( new wxJ2KHandler );
- wxImage::AddHandler( new wxJP2Handler );
- wxImage::AddHandler( new wxMJ2Handler );
-#endif
#if OPJ_MANYFORMATS
wxImage::AddHandler( new wxBMPHandler );
wxImage::AddHandler( new wxPNGHandler );
@@ -474,6 +475,11 @@ void OPJViewerApp::ShowCmdLine(const wxCmdLineParser& parser)
}
// OPJFrame events
+
+// Event class for sending text messages between worker and GUI threads
+DECLARE_EVENT_TYPE(wxEVT_LOGMSG_EVENT, -1)
+DEFINE_EVENT_TYPE(wxEVT_LOGMSG_EVENT)
+
BEGIN_EVENT_TABLE(OPJFrame, wxMDIParentFrame)
EVT_MENU(OPJFRAME_HELPABOUT, OPJFrame::OnAbout)
EVT_MENU(OPJFRAME_FILEOPEN, OPJFrame::OnFileOpen)
@@ -504,6 +510,7 @@ BEGIN_EVENT_TABLE(OPJFrame, wxMDIParentFrame)
EVT_MENU(OPJFRAME_SETSDECO, OPJFrame::OnSetsDeco)
EVT_SASH_DRAGGED_RANGE(OPJFRAME_BROWSEWIN, OPJFRAME_LOGWIN, OPJFrame::OnSashDrag)
EVT_NOTEBOOK_PAGE_CHANGED(LEFT_NOTEBOOK_ID, OPJFrame::OnNotebook)
+ EVT_COMMAND(wxID_ANY, wxEVT_LOGMSG_EVENT, OPJFrame::OnLogmsgEvent)
END_EVENT_TABLE()
// this is the frame constructor
@@ -1462,6 +1469,16 @@ void OPJFrame::OnSize(wxSizeEvent& WXUNUSED(event))
layout.LayoutMDIFrame(this);
}
+void OPJFrame::OnLogmsgEvent(wxCommandEvent &event)
+{
+ // receive string
+ wxString text = event.GetString();
+
+ // show it on the log
+ wxLogMessage(text);
+}
+
+
// Note that OPJFRAME_FILEOPEN and OPJFRAME_HELPABOUT commands get passed
// to the parent window for processing, so no need to
// duplicate event handlers here.