updated XCode project file
[openjpeg.git] / OPJViewer / source / OPJAbout.cpp
1 /*\r
2  * Copyright (c) 2007, Digital Signal Processing Laboratory, Universita'� degli studi di Perugia (UPG), Italy\r
3  * All rights reserved.\r
4  *\r
5  * Redistribution and use in source and binary forms, with or without\r
6  * modification, are permitted provided that the following conditions\r
7  * are met:\r
8  * 1. Redistributions of source code must retain the above copyright\r
9  *    notice, this list of conditions and the following disclaimer.\r
10  * 2. Redistributions in binary form must reproduce the above copyright\r
11  *    notice, this list of conditions and the following disclaimer in the\r
12  *    documentation and/or other materials provided with the distribution.\r
13  *\r
14  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\r
15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\r
18  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
19  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
20  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
21  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
22  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
23  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
24  * POSSIBILITY OF SUCH DAMAGE.\r
25  */\r
26 #ifdef USE_MXF\r
27 #include "mxflib/mxflib.h"\r
28 #endif // USE_MXF\r
29 \r
30 #include "OPJViewer.h"\r
31 \r
32 // about window for the frame\r
33 void OPJFrame::OnAbout(wxCommandEvent& WXUNUSED(event))\r
34 {\r
35 #ifdef OPJ_HTMLABOUT\r
36 #include "about_htm.h"\r
37 #include "opj_logo.xpm"\r
38 \r
39     wxBoxSizer *topsizer;\r
40     wxHtmlWindow *html;\r
41     wxDialog dlg(this, wxID_ANY, wxString(_("About")));\r
42 \r
43     wxMemoryFSHandler::AddFile(wxT("opj_logo.xpm"), wxBitmap(opj_logo), wxBITMAP_TYPE_XPM);\r
44 \r
45     topsizer = new wxBoxSizer(wxVERTICAL);\r
46 \r
47     html = new wxHtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(320, 250), wxHW_SCROLLBAR_NEVER);\r
48     html->SetBorders(0);\r
49     //html->LoadPage(wxT("about/about.htm"));\r
50         //html->SetPage("<html><body>Hello, world!</body></html>");\r
51         html->SetPage(htmlaboutpage);\r
52     html->SetSize(html->GetInternalRepresentation()->GetWidth(),\r
53                     html->GetInternalRepresentation()->GetHeight());\r
54 \r
55     topsizer->Add(html, 1, wxALL, 10);\r
56 \r
57     topsizer->Add(new wxStaticLine(&dlg, wxID_ANY), 0, wxEXPAND | wxLEFT | wxRIGHT, 10);\r
58 \r
59     wxButton *bu1 = new wxButton(&dlg, wxID_OK, wxT("OK"));\r
60     bu1->SetDefault();\r
61 \r
62     topsizer->Add(bu1, 0, wxALL | wxALIGN_RIGHT, 15);\r
63 \r
64     dlg.SetSizer(topsizer);\r
65     topsizer->Fit(&dlg);\r
66 \r
67     dlg.ShowModal();\r
68 \r
69 #else\r
70 \r
71         wxMessageBox(wxString::Format(OPJ_APPLICATION_TITLEBAR\r
72                                                                   wxT("\n\n")\r
73                                                                   wxT("Built with %s and OpenJPEG ")\r
74                                                                   wxT(OPENJPEG_VERSION)\r
75                                                                   wxT("\non ") wxT(__DATE__) wxT(", ") wxT(__TIME__)\r
76                                                                   wxT("\nRunning under %s\n\n")\r
77                                                                   OPJ_APPLICATION_COPYRIGHT,\r
78                                                                   wxVERSION_STRING,\r
79                                                                   wxGetOsDescription().c_str()),\r
80                                  wxT("About ") OPJ_APPLICATION_NAME,\r
81                                  wxOK | wxICON_INFORMATION,\r
82                                  this\r
83                                  );\r
84 \r
85 #endif\r
86 \r
87 }\r