From b8bf22affb370f6f9ca2b5ca2218b91eb3572e59 Mon Sep 17 00:00:00 2001 From: kichik Date: Sat, 24 Feb 2007 18:57:55 +0000 Subject: [PATCH] build NSIS Menu from source (requires wxWidgets) git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4958 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/NSIS Menu/Info.txt | 11 - Contrib/NSIS Menu/SConscript | 79 +- Contrib/NSIS Menu/nsismenu/nsismenu.cpp | 103 +- Contrib/NSIS Menu/nsismenu/nsismenu.sln | 21 - Contrib/NSIS Menu/nsismenu/nsismenu.vcproj | 164 -- Contrib/NSIS Menu/nsismenu/nslinks.cpp | 109 ++ Contrib/NSIS Menu/src/html/htmlwin.cpp | 830 ---------- Contrib/NSIS Menu/src/html/m_links.cpp | 138 -- Contrib/NSIS Menu/src/msw/app.cpp | 1386 ----------------- Contrib/NSIS Menu/wx/build.txt | 4 + .../NSIS Menu/{include/wx/msw => wx}/setup.h | 954 +++++++----- Contrib/NSIS Menu/wx/wxbuild.bat | 14 + Menu/compiler.html | 2 +- Menu/docs.html | 2 +- Menu/index.html | 7 +- Menu/intro.html | 6 +- Menu/notinstalled.html | 5 +- Menu/update.html | 2 +- Menu/websites.html | 2 +- SConstruct | 13 +- 20 files changed, 792 insertions(+), 3060 deletions(-) delete mode 100644 Contrib/NSIS Menu/Info.txt delete mode 100644 Contrib/NSIS Menu/nsismenu/nsismenu.sln delete mode 100644 Contrib/NSIS Menu/nsismenu/nsismenu.vcproj create mode 100644 Contrib/NSIS Menu/nsismenu/nslinks.cpp delete mode 100644 Contrib/NSIS Menu/src/html/htmlwin.cpp delete mode 100644 Contrib/NSIS Menu/src/html/m_links.cpp delete mode 100644 Contrib/NSIS Menu/src/msw/app.cpp create mode 100644 Contrib/NSIS Menu/wx/build.txt rename Contrib/NSIS Menu/{include/wx/msw => wx}/setup.h (60%) create mode 100644 Contrib/NSIS Menu/wx/wxbuild.bat diff --git a/Contrib/NSIS Menu/Info.txt b/Contrib/NSIS Menu/Info.txt deleted file mode 100644 index 0cffde65..00000000 --- a/Contrib/NSIS Menu/Info.txt +++ /dev/null @@ -1,11 +0,0 @@ -NSIS Menu - by Joost Verburg ----------------------------- - -Based on wxWindows 2.4.2 / wxHtml - -Compile using the wxWindows framework: http://www.wxwindows.org/ - -Modified wxWindows / wxHtml sources included, copy the data from this folder to the wxWindows folder. -You have to compile wxWindows and the libraries with the Multi-threaded (/MT) option. - -The NSIS Menu binary is compressed using UPX: http://upx.sourceforge.net/ \ No newline at end of file diff --git a/Contrib/NSIS Menu/SConscript b/Contrib/NSIS Menu/SConscript index 0a208deb..ac2a5e2b 100644 --- a/Contrib/NSIS Menu/SConscript +++ b/Contrib/NSIS Menu/SConscript @@ -1,39 +1,25 @@ target = "NSIS" files = Split(""" - nsismenu.cpp + nsismenu/nsismenu.cpp + nsismenu/nslinks.cpp """) resources = Split(""" - nsisicon.ico + nsismenu/nsisicon.ico """) -rc = 'nsismenu.rc' +rc = 'nsismenu/nsismenu.rc' libs = Split(""" - user32 - gdi32 advapi32 - ole32 comctl32 - comdlg32 - uuid - rpcrt4 + gdi32 shell32 - wxbase26 - wxbase26_net - wxbase26_xml - wxexpat - wxjpeg - wxmsw26_adv - wxmsw26_core - wxmsw26_html - wxmsw26_media - wxmsw26_xrc - wxpng - wxregex - wxtiff - wxzlib + user32 + wxbase28 + wxmsw28_core + wxmsw28_html """) html = Split(""" @@ -58,21 +44,42 @@ images = Split(""" Import('BuildUtil env') import os +from os.path import join -#wxlib = [os.environ['WXWIN'] + os.sep + 'lib' + os.sep + 'vc_lib'] -#wxinc = [os.environ['WXWIN'] + os.sep + 'include', os.environ['WXWIN'] + os.sep + 'lib' + os.sep + 'vc_lib' + os.sep + 'msw'] +if os.environ.has_key('WXWIN'): + # directories -#BuildUtil(target, files, libs, libpath = wxlib, cpppath = wxinc, res = rc, resources = resources, install = '', flags = ['/MD']) + wxlib = [join(os.environ['WXWIN'], 'lib', 'vc_libnsis')] + wxinc = [ + join(os.environ['WXWIN'], 'include'), + join(os.environ['WXWIN'], 'lib', 'vc_libnsis', 'msw') + ] + + # build + + BuildUtil( + target, + files, + libs, + res = rc, + resources = resources, + flags = ['/MD', '$EXCEPTION_FLAG'], + libpath = wxlib, + incpath = wxinc, + root_util = True + ) + + # install menu files + + env.DistributeMenu(html, alias='install-utils') + env.DistributeMenu(images, path='images', alias='install-utils') -# install pre-built NSIS.exe -if env['PLATFORM'] == 'win32': - ins = env.DistributeBin('#NSIS.exe') else: - ins = env.DistributeW32Bin('#NSIS.exe') + + # no wxWidgets + def err(target, source, env): + print '*** error: WXWIN must be set to build NSIS Menu!' + return 1 -env.Alias('install-utils', ins) - -# install menu files - -env.DistributeMenu(html, alias='install-utils') -env.DistributeMenu(images, path='images', alias='install-utils') + cmd = env.Command(target, files, Action(err, '')) + env.Alias('NSIS Menu', cmd) diff --git a/Contrib/NSIS Menu/nsismenu/nsismenu.cpp b/Contrib/NSIS Menu/nsismenu/nsismenu.cpp index 5009f50f..a5553ed4 100644 --- a/Contrib/NSIS Menu/nsismenu/nsismenu.cpp +++ b/Contrib/NSIS Menu/nsismenu/nsismenu.cpp @@ -3,7 +3,7 @@ ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" +#include #ifdef __BORLANDC__ #pragma hdrstop @@ -12,12 +12,16 @@ // for all others, include the necessary headers (this file is usually all you // need because it includes almost all "standard" wxWindows headers #ifndef WX_PRECOMP - #include "wx/wx.h" + #include #endif -#include "wx/image.h" -#include "wx/html/htmlwin.h" -#include "wx/html/htmlproc.h" +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // private classes @@ -42,6 +46,9 @@ class MyFrame : public wxFrame public: // ctor(s) MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size); + // event handler(s) + void OnLink(wxHtmlLinkEvent& event); + void OnClose(wxCloseEvent& event); private: wxHtmlWindow *m_Html; @@ -58,7 +65,7 @@ private: enum { // controls start here (the numbers are, of course, arbitrary) - Minimal_Text = 1000 + HtmlControl = 1000 }; // ---------------------------------------------------------------------------- @@ -69,6 +76,7 @@ private: // handlers) which process them. It can be also done at run-time, but for the // simple menu events like this the static method is much simpler. BEGIN_EVENT_TABLE(MyFrame, wxFrame) + EVT_HTML_LINK_CLICKED(HtmlControl, OnLink) END_EVENT_TABLE() // Create a new application object: this macro will allow wxWindows to create @@ -90,19 +98,19 @@ private: { wxInitAllImageHandlers(); - // Create the main application window - MyFrame *frame = new MyFrame(_("NSIS Menu"), - wxPoint(50, 50), wxSize(612 + (GetSystemMetrics(SM_CXEDGE) * 2), 353 + GetSystemMetrics(SM_CYSIZE) + (GetSystemMetrics(SM_CXEDGE) * 2))); + // Create the main application window + MyFrame *frame = new MyFrame(_("NSIS Menu"), + wxPoint(50, 50), wxSize(600 + GetSystemMetrics(SM_CXDLGFRAME), 382 + GetSystemMetrics(SM_CYDLGFRAME))); - // Show it and tell the application that it's our main window + // Show it and tell the application that it's our main window - frame->Show(TRUE); - SetTopWindow(frame); + frame->Show(TRUE); + SetTopWindow(frame); - // success: wxApp::OnRun() will be called which will enter the main message - // loop and the application will run. If we returned FALSE here, the - // application would exit immediately. - return TRUE; + // success: wxApp::OnRun() will be called which will enter the main message + // loop and the application will run. If we returned FALSE here, the + // application would exit immediately. + return TRUE; } // ---------------------------------------------------------------------------- @@ -112,23 +120,54 @@ private: // frame constructor MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) - : wxFrame((wxFrame *)NULL, -1, title, pos, size, wxMINIMIZE_BOX | wxSYSTEM_MENU | wxCAPTION, + : wxFrame((wxFrame *)NULL, -1, title, pos, size, wxCLOSE_BOX | wxMINIMIZE_BOX | wxSYSTEM_MENU | wxCAPTION, wxT("nsis_menu")) { - m_Html = new wxHtmlWindow(this); + m_Html = new wxHtmlWindow(this, HtmlControl); m_Html->SetRelatedFrame(this, _("NSIS Menu")); - m_Html->SetBorders(0); - - // Set font size - wxWindow UnitConvert; - wxSize DialogSize(1000, 1000); - DialogSize = UnitConvert.ConvertDialogToPixels(DialogSize); - int fonts[7] = {0, 0, 20000 / (DialogSize.GetWidth()), 25000 / (DialogSize.GetWidth()), 0, 0, 0}; - m_Html->SetFonts("", "", fonts); - - m_Html->LoadPage(wxT("Menu/index.html")); - - this->Centre(wxBOTH); - this->SetIcon(wxICON(nsisicon)); + m_Html->SetBorders(0); + m_Html->EnableScrolling(false, false); + + // Set font size + wxWindow UnitConvert; + wxSize DialogSize(1000, 1000); + DialogSize = UnitConvert.ConvertDialogToPixels(DialogSize); + int fonts[7] = {0, 0, 14000 / (DialogSize.GetWidth()), 19000 / (DialogSize.GetWidth()), 0, 0, 0}; + m_Html->SetFonts("", "", fonts); + + m_Html->LoadPage(wxT("Menu/index.html")); + + this->Centre(wxBOTH); + this->SetIcon(wxICON(nsisicon)); + } - } \ No newline at end of file +// event handler + +void MyFrame::OnLink(wxHtmlLinkEvent& event) +{ + const wxMouseEvent *e = event.GetLinkInfo().GetEvent(); + if (e == NULL || e->LeftUp()) + { + const wxString href = event.GetLinkInfo().GetHref(); + if (href.Left(3).IsSameAs("EX:", false)) + { + wxString url = href.Mid(3); + if (url.Left(7).IsSameAs("http://", false) || url.Left(6).IsSameAs("irc://", false)) + { + ::wxLaunchDefaultBrowser(url); + } + else + { + wxString exePath = wxStandardPaths::Get().GetExecutablePath(); + wxString path = ::wxPathOnly(exePath); + path.Append(wxFileName::GetPathSeparators()[0]); + path.Append(url); + ::wxLaunchDefaultBrowser(path); + } + } + else + { + event.Skip(); + } + } +} \ No newline at end of file diff --git a/Contrib/NSIS Menu/nsismenu/nsismenu.sln b/Contrib/NSIS Menu/nsismenu/nsismenu.sln deleted file mode 100644 index 665337b4..00000000 --- a/Contrib/NSIS Menu/nsismenu/nsismenu.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nsismenu", "nsismenu.vcproj", "{598BB726-F3FC-43A4-9E39-A1F9AD153F05}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {598BB726-F3FC-43A4-9E39-A1F9AD153F05}.Debug.ActiveCfg = Debug|Win32 - {598BB726-F3FC-43A4-9E39-A1F9AD153F05}.Debug.Build.0 = Debug|Win32 - {598BB726-F3FC-43A4-9E39-A1F9AD153F05}.Release.ActiveCfg = Release|Win32 - {598BB726-F3FC-43A4-9E39-A1F9AD153F05}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/Contrib/NSIS Menu/nsismenu/nsismenu.vcproj b/Contrib/NSIS Menu/nsismenu/nsismenu.vcproj deleted file mode 100644 index d52b70f6..00000000 --- a/Contrib/NSIS Menu/nsismenu/nsismenu.vcproj +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Contrib/NSIS Menu/nsismenu/nslinks.cpp b/Contrib/NSIS Menu/nsismenu/nslinks.cpp new file mode 100644 index 00000000..f2fed156 --- /dev/null +++ b/Contrib/NSIS Menu/nsismenu/nslinks.cpp @@ -0,0 +1,109 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/html/m_links.cpp +// Purpose: wxHtml module for links & anchors +// Author: Vaclav Slavik +// RCS-ID: $Id: m_links.cpp,v 1.18 2006/04/18 08:11:25 ABX Exp $ +// Copyright: (c) 1999 Vaclav Slavik +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_HTML && wxUSE_STREAMS + +#ifndef WXPRECOMP +#endif + +#include "wx/html/forcelnk.h" +#include "wx/html/m_templ.h" + +#include +#include + +FORCE_LINK_ME(nslinks) + +class wxHtmlAnchorCell : public wxHtmlCell +{ +private: + wxString m_AnchorName; + +public: + wxHtmlAnchorCell(const wxString& name) : wxHtmlCell() + { m_AnchorName = name; } + void Draw(wxDC& WXUNUSED(dc), + int WXUNUSED(x), int WXUNUSED(y), + int WXUNUSED(view_y1), int WXUNUSED(view_y2), + wxHtmlRenderingInfo& WXUNUSED(info)) {} + + DECLARE_NO_COPY_CLASS(wxHtmlAnchorCell) +}; + + + +TAG_HANDLER_BEGIN(A, "A") + TAG_HANDLER_CONSTR(A) { } + + TAG_HANDLER_PROC(tag) + { + if (tag.HasParam( wxT("HREF") )) + { + wxHtmlLinkInfo oldlnk = m_WParser->GetLink(); + wxColour oldclr = m_WParser->GetActualColor(); + wxString name(tag.GetParam( wxT("HREF") )), target; + + if (tag.HasParam( wxT("TARGET") )) target = tag.GetParam( wxT("TARGET") ); + + wxColour colour = m_WParser->GetLinkColor(); + wxHtmlLinkInfo linkInfo(name, target); + + if (name.Left(3).IsSameAs("EX:", false)) + { + wxString url = name.Mid(3); + if (!url.Left(7).IsSameAs("http://", false) && !url.Left(6).IsSameAs("irc://", false)) + { + wxString exePath = wxStandardPaths::Get().GetExecutablePath(); + wxString path = ::wxPathOnly(exePath); + path.Append(wxFileName::GetPathSeparators()[0]); + path.Append(url); + + if (!::wxFileExists(path) && !::wxDirExists(path)) + { + colour = wxColour(0x80, 0x80, 0x80); + linkInfo = wxHtmlLinkInfo("notinstalled.html", target); + } + } + } + + m_WParser->SetActualColor(colour); + m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(colour)); + m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont())); + m_WParser->SetLink(linkInfo); + + ParseInner(tag); + + m_WParser->SetLink(oldlnk); + m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont())); + m_WParser->SetActualColor(oldclr); + m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(oldclr)); + + return true; + } + else return false; + } + +TAG_HANDLER_END(A) + + + +TAGS_MODULE_BEGIN(CustomLinks) + + TAGS_MODULE_ADD(A) + +TAGS_MODULE_END(CustomLinks) + + +#endif diff --git a/Contrib/NSIS Menu/src/html/htmlwin.cpp b/Contrib/NSIS Menu/src/html/htmlwin.cpp deleted file mode 100644 index 785e36df..00000000 --- a/Contrib/NSIS Menu/src/html/htmlwin.cpp +++ /dev/null @@ -1,830 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: htmlwin.cpp -// Purpose: wxHtmlWindow class for parsing & displaying HTML (implementation) -// Author: Vaclav Slavik -// RCS-ID: $Id: htmlwin.cpp,v 1.62.2.3 2003/04/09 16:02:31 VS Exp $ -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - - -#ifdef __GNUG__ -#pragma implementation "htmlwin.h" -#pragma implementation "htmlproc.h" -#endif - -#include "wx/wxprec.h" - -#include "wx/defs.h" -#if wxUSE_HTML && wxUSE_STREAMS - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WXPRECOMP - #include "wx/log.h" - #include "wx/intl.h" - #include "wx/dcclient.h" - #include "wx/frame.h" -#endif - -#include "wx/html/htmlwin.h" -#include "wx/html/htmlproc.h" -#include "wx/list.h" - -#include "wx/arrimpl.cpp" -#include "wx/listimpl.cpp" - -//----------------------------------------------------------------------------- -// wxHtmlHistoryItem -//----------------------------------------------------------------------------- - -// item of history list -class WXDLLEXPORT wxHtmlHistoryItem -{ -public: - wxHtmlHistoryItem(const wxString& p, const wxString& a) {m_Page = p, m_Anchor = a, m_Pos = 0;} - int GetPos() const {return m_Pos;} - void SetPos(int p) {m_Pos = p;} - const wxString& GetPage() const {return m_Page;} - const wxString& GetAnchor() const {return m_Anchor;} - -private: - wxString m_Page; - wxString m_Anchor; - int m_Pos; -}; - - -//----------------------------------------------------------------------------- -// our private arrays: -//----------------------------------------------------------------------------- - -WX_DECLARE_OBJARRAY(wxHtmlHistoryItem, wxHtmlHistoryArray); -WX_DEFINE_OBJARRAY(wxHtmlHistoryArray); - -WX_DECLARE_LIST(wxHtmlProcessor, wxHtmlProcessorList); -WX_DEFINE_LIST(wxHtmlProcessorList); - -//----------------------------------------------------------------------------- -// wxHtmlWindow -//----------------------------------------------------------------------------- - - -void wxHtmlWindow::Init() -{ - m_tmpMouseMoved = FALSE; - m_tmpLastLink = NULL; - m_tmpLastCell = NULL; - m_tmpCanDrawLocks = 0; - m_FS = new wxFileSystem(); - m_RelatedStatusBar = -1; - m_RelatedFrame = NULL; - m_TitleFormat = wxT("%s"); - m_OpenedPage = m_OpenedAnchor = m_OpenedPageTitle = wxEmptyString; - m_Cell = NULL; - m_Parser = new wxHtmlWinParser(this); - m_Parser->SetFS(m_FS); - m_HistoryPos = -1; - m_HistoryOn = TRUE; - m_History = new wxHtmlHistoryArray; - m_Processors = NULL; - m_Style = 0; - SetBorders(10); -} - -bool wxHtmlWindow::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, const wxSize& size, - long style, const wxString& name) -{ - if (!wxScrolledWindow::Create(parent, id, pos, size, - style | wxVSCROLL | wxHSCROLL, name)) - return FALSE; - - m_Style = style; - SetPage(wxT("")); - return TRUE; -} - - -wxHtmlWindow::~wxHtmlWindow() -{ - HistoryClear(); - - if (m_Cell) delete m_Cell; - - delete m_Parser; - delete m_FS; - delete m_History; - delete m_Processors; -} - - - -void wxHtmlWindow::SetRelatedFrame(wxFrame* frame, const wxString& format) -{ - m_RelatedFrame = frame; - m_TitleFormat = format; -} - - - -void wxHtmlWindow::SetRelatedStatusBar(int bar) -{ - m_RelatedStatusBar = bar; -} - - - -void wxHtmlWindow::SetFonts(wxString normal_face, wxString fixed_face, const int *sizes) -{ - wxString op = m_OpenedPage; - - m_Parser->SetFonts(normal_face, fixed_face, sizes); - // fonts changed => contents invalid, so reload the page: - SetPage(wxT("")); - if (!op.IsEmpty()) LoadPage(op); -} - - - -bool wxHtmlWindow::SetPage(const wxString& source) -{ - wxString newsrc(source); - - // pass HTML through registered processors: - if (m_Processors || m_GlobalProcessors) - { - wxHtmlProcessorList::Node *nodeL, *nodeG; - int prL, prG; - - nodeL = (m_Processors) ? m_Processors->GetFirst() : NULL; - nodeG = (m_GlobalProcessors) ? m_GlobalProcessors->GetFirst() : NULL; - - // VS: there are two lists, global and local, both of them sorted by - // priority. Since we have to go through _both_ lists with - // decreasing priority, we "merge-sort" the lists on-line by - // processing that one of the two heads that has higher priority - // in every iteration - while (nodeL || nodeG) - { - prL = (nodeL) ? nodeL->GetData()->GetPriority() : -1; - prG = (nodeG) ? nodeG->GetData()->GetPriority() : -1; - if (prL > prG) - { - if (nodeL->GetData()->IsEnabled()) - newsrc = nodeL->GetData()->Process(newsrc); - nodeL = nodeL->GetNext(); - } - else // prL <= prG - { - if (nodeG->GetData()->IsEnabled()) - newsrc = nodeG->GetData()->Process(newsrc); - nodeG = nodeG->GetNext(); - } - } - } - - // ...and run the parser on it: - wxClientDC *dc = new wxClientDC(this); - dc->SetMapMode(wxMM_TEXT); - SetBackgroundColour(wxColour(0xFF, 0xFF, 0xFF)); - m_OpenedPage = m_OpenedAnchor = m_OpenedPageTitle = wxEmptyString; - m_Parser->SetDC(dc); - if (m_Cell) - { - delete m_Cell; - m_Cell = NULL; - } - m_Cell = (wxHtmlContainerCell*) m_Parser->Parse(newsrc); - delete dc; - m_Cell->SetIndent(m_Borders, wxHTML_INDENT_ALL, wxHTML_UNITS_PIXELS); - m_Cell->SetAlignHor(wxHTML_ALIGN_CENTER); - CreateLayout(); - if (m_tmpCanDrawLocks == 0) - Refresh(); - return TRUE; -} - -bool wxHtmlWindow::AppendToPage(const wxString& source) -{ - return SetPage(*(GetParser()->GetSource()) + source); -} - -bool wxHtmlWindow::LoadPage(const wxString& location) -{ - wxBusyCursor busyCursor; - - wxFSFile *f; - bool rt_val; - bool needs_refresh = FALSE; - - m_tmpCanDrawLocks++; - if (m_HistoryOn && (m_HistoryPos != -1)) - { - // store scroll position into history item: - int x, y; - GetViewStart(&x, &y); - (*m_History)[m_HistoryPos].SetPos(y); - } - - if (location[0] == wxT('#')) - { - // local anchor: - wxString anch = location.Mid(1) /*1 to end*/; - m_tmpCanDrawLocks--; - rt_val = ScrollToAnchor(anch); - m_tmpCanDrawLocks++; - } - else if (location.Find(wxT('#')) != wxNOT_FOUND && location.BeforeFirst(wxT('#')) == m_OpenedPage) - { - wxString anch = location.AfterFirst(wxT('#')); - m_tmpCanDrawLocks--; - rt_val = ScrollToAnchor(anch); - m_tmpCanDrawLocks++; - } - else if (location.Find(wxT('#')) != wxNOT_FOUND && - (m_FS->GetPath() + location.BeforeFirst(wxT('#'))) == m_OpenedPage) - { - wxString anch = location.AfterFirst(wxT('#')); - m_tmpCanDrawLocks--; - rt_val = ScrollToAnchor(anch); - m_tmpCanDrawLocks++; - } - - else - { - needs_refresh = TRUE; - // load&display it: - if (m_RelatedStatusBar != -1) - { - m_RelatedFrame->SetStatusText(_("Connecting..."), m_RelatedStatusBar); - Refresh(FALSE); - } - - f = m_Parser->OpenURL(wxHTML_URL_PAGE, location); - - if (f == NULL) - { - wxLogError(_("Unable to open requested HTML document: %s"), location.c_str()); - m_tmpCanDrawLocks--; - return FALSE; - } - - else - { - wxNode *node; - wxString src = wxEmptyString; - - if (m_RelatedStatusBar != -1) - { - wxString msg = _("Loading : ") + location; - m_RelatedFrame->SetStatusText(msg, m_RelatedStatusBar); - Refresh(FALSE); - } - - node = m_Filters.GetFirst(); - while (node) - { - wxHtmlFilter *h = (wxHtmlFilter*) node->GetData(); - if (h->CanRead(*f)) - { - src = h->ReadFile(*f); - break; - } - node = node->GetNext(); - } - if (src == wxEmptyString) - { - if (m_DefaultFilter == NULL) m_DefaultFilter = GetDefaultFilter(); - src = m_DefaultFilter->ReadFile(*f); - } - - m_FS->ChangePathTo(f->GetLocation()); - rt_val = SetPage(src); - m_OpenedPage = f->GetLocation(); - if (f->GetAnchor() != wxEmptyString) - { - ScrollToAnchor(f->GetAnchor()); - } - - delete f; - - if (m_RelatedStatusBar != -1) m_RelatedFrame->SetStatusText(_("Done"), m_RelatedStatusBar); - } - } - - if (m_HistoryOn) // add this page to history there: - { - int c = m_History->GetCount() - (m_HistoryPos + 1); - - if (m_HistoryPos < 0 || - (*m_History)[m_HistoryPos].GetPage() != m_OpenedPage || - (*m_History)[m_HistoryPos].GetAnchor() != m_OpenedAnchor) - { - m_HistoryPos++; - for (int i = 0; i < c; i++) - m_History->RemoveAt(m_HistoryPos); - m_History->Add(new wxHtmlHistoryItem(m_OpenedPage, m_OpenedAnchor)); - } - } - - if (m_OpenedPageTitle == wxEmptyString) - OnSetTitle(wxFileNameFromPath(m_OpenedPage)); - - if (needs_refresh) - { - m_tmpCanDrawLocks--; - Refresh(); - } - else - m_tmpCanDrawLocks--; - - return rt_val; -} - - -bool wxHtmlWindow::LoadFile(const wxFileName& filename) -{ - wxString url = wxFileSystem::FileNameToURL(filename); - return LoadPage(url); -} - - -bool wxHtmlWindow::ScrollToAnchor(const wxString& anchor) -{ - const wxHtmlCell *c = m_Cell->Find(wxHTML_COND_ISANCHOR, &anchor); - if (!c) - { - wxLogWarning(_("HTML anchor %s does not exist."), anchor.c_str()); - return FALSE; - } - else - { - int y; - - for (y = 0; c != NULL; c = c->GetParent()) y += c->GetPosY(); - Scroll(-1, y / wxHTML_SCROLL_STEP); - m_OpenedAnchor = anchor; - return TRUE; - } -} - - -void wxHtmlWindow::OnSetTitle(const wxString& title) -{ - if (m_RelatedFrame) - { - wxString tit; - tit.Printf(m_TitleFormat, title.c_str()); - m_RelatedFrame->SetTitle(tit); - } - m_OpenedPageTitle = title; -} - - - - - -void wxHtmlWindow::CreateLayout() -{ - int ClientWidth, ClientHeight; - - if (!m_Cell) return; - - if (m_Style & wxHW_SCROLLBAR_NEVER) - { - SetScrollbars(wxHTML_SCROLL_STEP, 1, m_Cell->GetWidth() / wxHTML_SCROLL_STEP, 0); // always off - GetClientSize(&ClientWidth, &ClientHeight); - m_Cell->Layout(ClientWidth); - } - - else { - GetClientSize(&ClientWidth, &ClientHeight); - m_Cell->Layout(ClientWidth); - if (ClientHeight < m_Cell->GetHeight() + GetCharHeight()) - { - SetScrollbars( - wxHTML_SCROLL_STEP, wxHTML_SCROLL_STEP, - m_Cell->GetWidth() / wxHTML_SCROLL_STEP, - (m_Cell->GetHeight() + GetCharHeight()) / wxHTML_SCROLL_STEP - /*cheat: top-level frag is always container*/); - } - else /* we fit into window, no need for scrollbars */ - { - SetScrollbars(wxHTML_SCROLL_STEP, 1, m_Cell->GetWidth() / wxHTML_SCROLL_STEP, 0); // disable... - GetClientSize(&ClientWidth, &ClientHeight); - m_Cell->Layout(ClientWidth); // ...and relayout - } - } -} - - - -void wxHtmlWindow::ReadCustomization(wxConfigBase *cfg, wxString path) -{ - wxString oldpath; - wxString tmp; - int p_fontsizes[7]; - wxString p_fff, p_ffn; - - if (path != wxEmptyString) - { - oldpath = cfg->GetPath(); - cfg->SetPath(path); - } - - m_Borders = cfg->Read(wxT("wxHtmlWindow/Borders"), m_Borders); - p_fff = cfg->Read(wxT("wxHtmlWindow/FontFaceFixed"), m_Parser->m_FontFaceFixed); - p_ffn = cfg->Read(wxT("wxHtmlWindow/FontFaceNormal"), m_Parser->m_FontFaceNormal); - for (int i = 0; i < 7; i++) - { - tmp.Printf(wxT("wxHtmlWindow/FontsSize%i"), i); - p_fontsizes[i] = cfg->Read(tmp, m_Parser->m_FontsSizes[i]); - } - SetFonts(p_ffn, p_fff, p_fontsizes); - - if (path != wxEmptyString) - cfg->SetPath(oldpath); -} - - - -void wxHtmlWindow::WriteCustomization(wxConfigBase *cfg, wxString path) -{ - wxString oldpath; - wxString tmp; - - if (path != wxEmptyString) - { - oldpath = cfg->GetPath(); - cfg->SetPath(path); - } - - cfg->Write(wxT("wxHtmlWindow/Borders"), (long) m_Borders); - cfg->Write(wxT("wxHtmlWindow/FontFaceFixed"), m_Parser->m_FontFaceFixed); - cfg->Write(wxT("wxHtmlWindow/FontFaceNormal"), m_Parser->m_FontFaceNormal); - for (int i = 0; i < 7; i++) - { - tmp.Printf(wxT("wxHtmlWindow/FontsSize%i"), i); - cfg->Write(tmp, (long) m_Parser->m_FontsSizes[i]); - } - - if (path != wxEmptyString) - cfg->SetPath(oldpath); -} - - - -bool wxHtmlWindow::HistoryBack() -{ - wxString a, l; - - if (m_HistoryPos < 1) return FALSE; - - // store scroll position into history item: - int x, y; - GetViewStart(&x, &y); - (*m_History)[m_HistoryPos].SetPos(y); - - // go to previous position: - m_HistoryPos--; - - l = (*m_History)[m_HistoryPos].GetPage(); - a = (*m_History)[m_HistoryPos].GetAnchor(); - m_HistoryOn = FALSE; - m_tmpCanDrawLocks++; - if (a == wxEmptyString) LoadPage(l); - else LoadPage(l + wxT("#") + a); - m_HistoryOn = TRUE; - m_tmpCanDrawLocks--; - Scroll(0, (*m_History)[m_HistoryPos].GetPos()); - Refresh(); - return TRUE; -} - -bool wxHtmlWindow::HistoryCanBack() -{ - if (m_HistoryPos < 1) return FALSE; - return TRUE ; -} - - -bool wxHtmlWindow::HistoryForward() -{ - wxString a, l; - - if (m_HistoryPos == -1) return FALSE; - if (m_HistoryPos >= (int)m_History->GetCount() - 1)return FALSE; - - m_OpenedPage = wxEmptyString; // this will disable adding new entry into history in LoadPage() - - m_HistoryPos++; - l = (*m_History)[m_HistoryPos].GetPage(); - a = (*m_History)[m_HistoryPos].GetAnchor(); - m_HistoryOn = FALSE; - m_tmpCanDrawLocks++; - if (a == wxEmptyString) LoadPage(l); - else LoadPage(l + wxT("#") + a); - m_HistoryOn = TRUE; - m_tmpCanDrawLocks--; - Scroll(0, (*m_History)[m_HistoryPos].GetPos()); - Refresh(); - return TRUE; -} - -bool wxHtmlWindow::HistoryCanForward() -{ - if (m_HistoryPos == -1) return FALSE; - if (m_HistoryPos >= (int)m_History->GetCount() - 1)return FALSE; - return TRUE ; -} - - -void wxHtmlWindow::HistoryClear() -{ - m_History->Empty(); - m_HistoryPos = -1; -} - -void wxHtmlWindow::AddProcessor(wxHtmlProcessor *processor) -{ - if (!m_Processors) - { - m_Processors = new wxHtmlProcessorList; - m_Processors->DeleteContents(TRUE); - } - wxHtmlProcessorList::Node *node; - - for (node = m_Processors->GetFirst(); node; node = node->GetNext()) - { - if (processor->GetPriority() > node->GetData()->GetPriority()) - { - m_Processors->Insert(node, processor); - return; - } - } - m_Processors->Append(processor); -} - -/*static */ void wxHtmlWindow::AddGlobalProcessor(wxHtmlProcessor *processor) -{ - if (!m_GlobalProcessors) - { - m_GlobalProcessors = new wxHtmlProcessorList; - m_GlobalProcessors->DeleteContents(TRUE); - } - wxHtmlProcessorList::Node *node; - - for (node = m_GlobalProcessors->GetFirst(); node; node = node->GetNext()) - { - if (processor->GetPriority() > node->GetData()->GetPriority()) - { - m_GlobalProcessors->Insert(node, processor); - return; - } - } - m_GlobalProcessors->Append(processor); -} - - - -wxList wxHtmlWindow::m_Filters; -wxHtmlFilter *wxHtmlWindow::m_DefaultFilter = NULL; -wxCursor *wxHtmlWindow::s_cur_hand = NULL; -wxCursor *wxHtmlWindow::s_cur_arrow = NULL; -wxHtmlProcessorList *wxHtmlWindow::m_GlobalProcessors = NULL; - -void wxHtmlWindow::CleanUpStatics() -{ - wxDELETE(m_DefaultFilter); - m_Filters.DeleteContents(TRUE); - m_Filters.Clear(); - wxDELETE(m_GlobalProcessors); - wxDELETE(s_cur_hand); - wxDELETE(s_cur_arrow); -} - - - -void wxHtmlWindow::AddFilter(wxHtmlFilter *filter) -{ - m_Filters.Append(filter); -} - - - - -void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) -{ - char apppath[MAX_PATH],*temp; - GetModuleFileName(NULL,apppath,sizeof(apppath)); - temp=strrchr(apppath,'\\'); - if(temp!=NULL) *temp=0; - - char fullpath[MAX_PATH]; - - if (link.GetHref().Left(3).Cmp("EX:") == 0) - { - // External - - if ((link.GetHref().Left(10).Cmp("EX:http://") == 0) || (link.GetHref().Left(9).Cmp("EX:irc://") == 0)) - { - // Internet - ShellExecute(0, "open", link.GetHref().Mid(3), NULL, NULL, SW_SHOW); - - } - else - { - - _snprintf(fullpath,sizeof(fullpath),"%s\\%s",apppath,link.GetHref().Mid(3)); - - if (wxFileExists(fullpath) || wxDirExists(fullpath)) - { - ShellExecute(0, "open", fullpath, NULL, NULL, SW_SHOW); - } - else - { - // Feature not installed - _snprintf(fullpath,sizeof(fullpath),"%s\\Menu\\notinstalled.html",apppath,link.GetHref()); - LoadPage(fullpath); - } - - } - - } - else - { - _snprintf(fullpath,sizeof(fullpath),"%s\\Menu\\%s",apppath,link.GetHref()); - LoadPage(fullpath); - } -} - -void wxHtmlWindow::OnCellClicked(wxHtmlCell *cell, - wxCoord x, wxCoord y, - const wxMouseEvent& event) -{ - wxCHECK_RET( cell, _T("can't be called with NULL cell") ); - - cell->OnMouseClick(this, x, y, event); -} - -void wxHtmlWindow::OnCellMouseHover(wxHtmlCell * WXUNUSED(cell), - wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) -{ - // do nothing here -} - -void wxHtmlWindow::OnDraw(wxDC& dc) -{ - if (m_tmpCanDrawLocks > 0 || m_Cell == NULL) return; - - int x, y; - wxRect rect = GetUpdateRegion().GetBox(); - - dc.SetMapMode(wxMM_TEXT); - dc.SetBackgroundMode(wxTRANSPARENT); - GetViewStart(&x, &y); - - m_Cell->Draw(dc, 0, 0, - y * wxHTML_SCROLL_STEP + rect.GetTop(), - y * wxHTML_SCROLL_STEP + rect.GetBottom()); -} - - - - -void wxHtmlWindow::OnSize(wxSizeEvent& event) -{ - wxScrolledWindow::OnSize(event); - CreateLayout(); - Refresh(); -} - - -void wxHtmlWindow::OnMouseEvent(wxMouseEvent& event) -{ - m_tmpMouseMoved = TRUE; - - if (event.ButtonDown()) - { - SetFocus(); - if ( m_Cell ) - { - int sx, sy; - GetViewStart(&sx, &sy); - sx *= wxHTML_SCROLL_STEP; - sy *= wxHTML_SCROLL_STEP; - - wxPoint pos = event.GetPosition(); - pos.x += sx; - pos.y += sy; - - wxHtmlCell *cell = m_Cell->FindCellByPos(pos.x, pos.y); - - // VZ: is it possible that we don't find anything at all? - // VS: yes. FindCellByPos returns terminal cell and - // containers may have empty borders - if ( cell ) - OnCellClicked(cell, pos.x, pos.y, event); - } - } -} - - - -void wxHtmlWindow::OnIdle(wxIdleEvent& WXUNUSED(event)) -{ - if (s_cur_hand == NULL) - { - s_cur_hand = new wxCursor(wxCURSOR_HAND); - s_cur_arrow = new wxCursor(wxCURSOR_ARROW); - } - - if (m_tmpMouseMoved && (m_Cell != NULL)) - { - int sx, sy; - GetViewStart(&sx, &sy); - sx *= wxHTML_SCROLL_STEP; - sy *= wxHTML_SCROLL_STEP; - - int x, y; - wxGetMousePosition(&x, &y); - ScreenToClient(&x, &y); - x += sx; - y += sy; - - wxHtmlCell *cell = m_Cell->FindCellByPos(x, y); - if ( cell != m_tmpLastCell ) - { - wxHtmlLinkInfo *lnk = cell ? cell->GetLink(x, y) : NULL; - - if (lnk != m_tmpLastLink) - { - if (lnk == NULL) - { - SetCursor(*s_cur_arrow); - if (m_RelatedStatusBar != -1) - m_RelatedFrame->SetStatusText(wxEmptyString, m_RelatedStatusBar); - } - else - { - SetCursor(*s_cur_hand); - if (m_RelatedStatusBar != -1) - m_RelatedFrame->SetStatusText(lnk->GetHref(), m_RelatedStatusBar); - } - m_tmpLastLink = lnk; - } - - m_tmpLastCell = cell; - } - else // mouse moved but stayed in the same cell - { - if ( cell ) - OnCellMouseHover(cell, x, y); - } - - m_tmpMouseMoved = FALSE; - } -} - - -IMPLEMENT_ABSTRACT_CLASS(wxHtmlProcessor,wxObject) - -IMPLEMENT_DYNAMIC_CLASS(wxHtmlWindow,wxScrolledWindow) - -BEGIN_EVENT_TABLE(wxHtmlWindow, wxScrolledWindow) - EVT_SIZE(wxHtmlWindow::OnSize) - EVT_LEFT_DOWN(wxHtmlWindow::OnMouseEvent) - EVT_RIGHT_DOWN(wxHtmlWindow::OnMouseEvent) - EVT_MOTION(wxHtmlWindow::OnMouseEvent) - EVT_IDLE(wxHtmlWindow::OnIdle) -END_EVENT_TABLE() - - - - - -// A module to allow initialization/cleanup -// without calling these functions from app.cpp or from -// the user's application. - -class wxHtmlWinModule: public wxModule -{ -DECLARE_DYNAMIC_CLASS(wxHtmlWinModule) -public: - wxHtmlWinModule() : wxModule() {} - bool OnInit() { return TRUE; } - void OnExit() { wxHtmlWindow::CleanUpStatics(); } -}; - -IMPLEMENT_DYNAMIC_CLASS(wxHtmlWinModule, wxModule) - - -// This hack forces the linker to always link in m_* files -// (wxHTML doesn't work without handlers from these files) -#include "wx/html/forcelnk.h" -FORCE_WXHTML_MODULES() - -#endif diff --git a/Contrib/NSIS Menu/src/html/m_links.cpp b/Contrib/NSIS Menu/src/html/m_links.cpp deleted file mode 100644 index 0be48351..00000000 --- a/Contrib/NSIS Menu/src/html/m_links.cpp +++ /dev/null @@ -1,138 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: m_links.cpp -// Purpose: wxHtml module for links & anchors -// Author: Vaclav Slavik -// RCS-ID: $Id: m_links.cpp,v 1.2 2003/09/22 19:28:09 joostverburg Exp $ -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation -#endif - -#include "wx/wxprec.h" - -#include "wx/defs.h" -#if wxUSE_HTML && wxUSE_STREAMS - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WXPRECOMP -#endif - -#include "wx/html/forcelnk.h" -#include "wx/html/m_templ.h" - - -FORCE_LINK_ME(m_links) - - -class wxHtmlAnchorCell : public wxHtmlCell -{ - private: - wxString m_AnchorName; - - public: - wxHtmlAnchorCell(const wxString& name) : wxHtmlCell() {m_AnchorName = name;} - virtual const wxHtmlCell* Find(int condition, const void* param) const - { - if ((condition == wxHTML_COND_ISANCHOR) && (m_AnchorName == (*((const wxString*)param)))) - return this; - else - return wxHtmlCell::Find(condition, param); - } -}; - - - -TAG_HANDLER_BEGIN(A, "A") - - TAG_HANDLER_PROC(tag) - { - if (tag.HasParam( wxT("NAME") )) - { - m_WParser->GetContainer()->InsertCell(new wxHtmlAnchorCell(tag.GetParam( wxT("NAME") ))); - } - - if (tag.HasParam( wxT("HREF") )) - { - wxHtmlLinkInfo oldlnk = m_WParser->GetLink(); - wxColour oldclr = m_WParser->GetActualColor(); - int oldund = m_WParser->GetFontUnderlined(); - wxString name(tag.GetParam( wxT("HREF") )), target; - - wxColor LinkColor; - LinkColor.Set(0x0C, 0x6E, 0x97); - - char apppath[MAX_PATH],*temp; - GetModuleFileName(NULL,apppath,sizeof(apppath)); - temp=strrchr(apppath,'\\'); - if(temp!=NULL) *temp=0; - - char fullpath[MAX_PATH]; - - if (name.Left(3).Cmp("EX:") == 0) - { - // External - - if ((name.Left(10).Cmp("EX:http://") == 0) || (name.Left(9).Cmp("EX:irc://") == 0)) - { - - } - else - { - - _snprintf(fullpath,sizeof(fullpath),"%s\\%s",apppath,name.Mid(3)); - - if (wxFileExists(fullpath) || wxDirExists(fullpath)) - { - - } - else - { - // Feature not installed - LinkColor.Set(0x80, 0x80, 0x80); - } - - } - - } - else - { - - } - - if (tag.HasParam( wxT("TARGET") )) target = tag.GetParam( wxT("TARGET") ); - m_WParser->SetActualColor(LinkColor); - m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(LinkColor)); - m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont())); - m_WParser->SetLink(wxHtmlLinkInfo(name, target)); - - ParseInner(tag); - - m_WParser->SetLink(oldlnk); - m_WParser->SetFontUnderlined(oldund); - m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont())); - m_WParser->SetActualColor(oldclr); - m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(oldclr)); - - return TRUE; - } - else return FALSE; - } - -TAG_HANDLER_END(A) - - - -TAGS_MODULE_BEGIN(Links) - - TAGS_MODULE_ADD(A) - -TAGS_MODULE_END(Links) - - -#endif diff --git a/Contrib/NSIS Menu/src/msw/app.cpp b/Contrib/NSIS Menu/src/msw/app.cpp deleted file mode 100644 index b6e6a8dd..00000000 --- a/Contrib/NSIS Menu/src/msw/app.cpp +++ /dev/null @@ -1,1386 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: app.cpp -// Purpose: wxApp -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: app.cpp,v 1.1 2003/05/26 17:53:58 joostverburg Exp $ -// Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license -///////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "app.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/frame.h" - #include "wx/app.h" - #include "wx/utils.h" - #include "wx/gdicmn.h" - #include "wx/pen.h" - #include "wx/brush.h" - #include "wx/cursor.h" - #include "wx/icon.h" - #include "wx/palette.h" - #include "wx/dc.h" - #include "wx/dialog.h" - #include "wx/msgdlg.h" - #include "wx/intl.h" - #include "wx/dynarray.h" - #include "wx/wxchar.h" - #include "wx/icon.h" - #include "wx/log.h" -#endif - -#include "wx/cmdline.h" -#include "wx/filename.h" -#include "wx/module.h" - -#include "wx/msw/private.h" - -#if wxUSE_THREADS - #include "wx/thread.h" - - // define the array of MSG strutures - WX_DECLARE_OBJARRAY(MSG, wxMsgArray); - - #include "wx/arrimpl.cpp" - - WX_DEFINE_OBJARRAY(wxMsgArray); -#endif // wxUSE_THREADS - -#if wxUSE_WX_RESOURCES - #include "wx/resource.h" -#endif - -#if wxUSE_TOOLTIPS - #include "wx/tooltip.h" -#endif // wxUSE_TOOLTIPS - -// OLE is used for drag-and-drop, clipboard, OLE Automation..., but some -// compilers don't support it (missing headers, libs, ...) -#if defined(__GNUWIN32_OLD__) || defined(__SC__) || defined(__SALFORDC__) - #undef wxUSE_OLE - - #define wxUSE_OLE 0 -#endif // broken compilers - -#if wxUSE_OLE - #include -#endif - -#include -#include - -#if defined(__WIN95__) && !((defined(__GNUWIN32_OLD__) || defined(__TWIN32__) || defined(__WXMICROWIN__)) && !defined(__CYGWIN10__)) - #include -#endif - -#ifndef __WXMICROWIN__ -#include "wx/msw/msvcrt.h" -#endif - -// ---------------------------------------------------------------------------- -// conditional compilation -// ---------------------------------------------------------------------------- - -// The macro _WIN32_IE is defined by commctrl.h (unless it had already been -// defined before) and shows us what common control features are available -// during the compile time (it doesn't mean that they will be available during -// the run-time, use GetComCtl32Version() to test for them!). The possible -// values are: -// -// 0x0200 for comctl32.dll 4.00 shipped with Win95/NT 4.0 -// 0x0300 4.70 IE 3.x -// 0x0400 4.71 IE 4.0 -// 0x0401 4.72 IE 4.01 and Win98 -// 0x0500 5.00 IE 5.x and NT 5.0 (Win2000) - -#ifndef _WIN32_IE - // minimal set of features by default - #define _WIN32_IE 0x0200 -#endif - -#if _WIN32_IE >= 0x0300 && \ - (!defined(__MINGW32__) || wxCHECK_W32API_VERSION( 2, 0 )) && \ - !defined(__CYGWIN__) - #include -#endif - -// --------------------------------------------------------------------------- -// global variables -// --------------------------------------------------------------------------- - -extern wxChar *wxBuffer; -extern wxList WXDLLEXPORT wxPendingDelete; -#ifndef __WXMICROWIN__ -extern void wxSetKeyboardHook(bool doIt); -#endif - -MSG s_currentMsg; -wxApp *wxTheApp = NULL; - -// NB: all "NoRedraw" classes must have the same names as the "normal" classes -// with NR suffix - wxWindow::MSWCreate() supposes this -const wxChar *wxCanvasClassName = wxT("NSIS Menu"); -const wxChar *wxCanvasClassNameNR = wxT("NSIS Menu NR"); -const wxChar *wxMDIFrameClassName = wxT("NSIS Menu MDI"); -const wxChar *wxMDIFrameClassNameNoRedraw = wxT("NSIS Menu MDI NR"); -const wxChar *wxMDIChildFrameClassName = wxT("NSIS Menu Child Frame"); -const wxChar *wxMDIChildFrameClassNameNoRedraw = wxT("NSIS Menu Child Frame NR"); - -HICON wxSTD_FRAME_ICON = (HICON) NULL; -HICON wxSTD_MDICHILDFRAME_ICON = (HICON) NULL; -HICON wxSTD_MDIPARENTFRAME_ICON = (HICON) NULL; - -HICON wxDEFAULT_FRAME_ICON = (HICON) NULL; -HICON wxDEFAULT_MDICHILDFRAME_ICON = (HICON) NULL; -HICON wxDEFAULT_MDIPARENTFRAME_ICON = (HICON) NULL; - -HBRUSH wxDisableButtonBrush = (HBRUSH) 0; - -LRESULT WXDLLEXPORT APIENTRY wxWndProc(HWND, UINT, WPARAM, LPARAM); - -// FIXME wxUSE_ON_FATAL_EXCEPTION is only supported for VC++ now because it -// needs compiler support for Win32 SEH. Others (especially Borland) -// probably have it too, but I'm not sure about how it works -// JACS: get 'Cannot use __try in functions that require unwinding -// in Unicode mode, so disabling. -#if !defined(__VISUALC__) || defined(__WIN16__) || defined(UNICODE) - #undef wxUSE_ON_FATAL_EXCEPTION - #define wxUSE_ON_FATAL_EXCEPTION 0 -#endif // VC++ - -#if wxUSE_ON_FATAL_EXCEPTION - static bool gs_handleExceptions = FALSE; -#endif - -// =========================================================================== -// implementation -// =========================================================================== - -// --------------------------------------------------------------------------- -// wxApp -// --------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler) - -BEGIN_EVENT_TABLE(wxApp, wxEvtHandler) - EVT_IDLE(wxApp::OnIdle) - EVT_END_SESSION(wxApp::OnEndSession) - EVT_QUERY_END_SESSION(wxApp::OnQueryEndSession) -END_EVENT_TABLE() - -//// Initialize -bool wxApp::Initialize() -{ - // the first thing to do is to check if we're trying to run an Unicode - // program under Win9x w/o MSLU emulation layer - if so, abort right now - // as it has no chance to work -#if wxUSE_UNICODE && !wxUSE_UNICODE_MSLU - if ( wxGetOsVersion() != wxWINDOWS_NT ) - { - // note that we can use MessageBoxW() as it's implemented even under - // Win9x - OTOH, we can't use wxGetTranslation() because the file APIs - // used by wxLocale are not - ::MessageBox - ( - NULL, - _T("This program uses Unicode and requires Windows NT/2000/XP.\nProgram aborted."), - _T("wxWindows Fatal Error"), - MB_ICONERROR | MB_OK - ); - - return FALSE; - } -#endif // wxUSE_UNICODE && !wxUSE_UNICODE_MSLU - - wxBuffer = new wxChar[1500]; // FIXME - - wxClassInfo::InitializeClasses(); - -#if wxUSE_THREADS - wxPendingEventsLocker = new wxCriticalSection; -#endif - - wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING); - wxTheColourDatabase->Initialize(); - - wxInitializeStockLists(); - wxInitializeStockObjects(); - -#if wxUSE_WX_RESOURCES - wxInitializeResourceSystem(); -#endif - - wxBitmap::InitStandardHandlers(); - -#if defined(__WIN95__) && !defined(__WXMICROWIN__) - InitCommonControls(); -#endif // __WIN95__ - -#if wxUSE_OLE || wxUSE_DRAG_AND_DROP - -#ifdef __WIN16__ - // for OLE, enlarge message queue to be as large as possible - int iMsg = 96; - while (!SetMessageQueue(iMsg) && (iMsg -= 8)) - ; -#endif // Win16 - -#if wxUSE_OLE - // we need to initialize OLE library - if ( FAILED(::OleInitialize(NULL)) ) - wxLogError(_("Cannot initialize OLE")); -#endif - -#endif // wxUSE_OLE - -#if wxUSE_CTL3D - if (!Ctl3dRegister(wxhInstance)) - wxLogError(wxT("Cannot register CTL3D")); - - Ctl3dAutoSubclass(wxhInstance); -#endif // wxUSE_CTL3D - - // VZ: these icons are not in wx.rc anyhow (but should they?)! -#if 0 - wxSTD_FRAME_ICON = LoadIcon(wxhInstance, wxT("wxSTD_FRAME")); - wxSTD_MDIPARENTFRAME_ICON = LoadIcon(wxhInstance, wxT("wxSTD_MDIPARENTFRAME")); - wxSTD_MDICHILDFRAME_ICON = LoadIcon(wxhInstance, wxT("wxSTD_MDICHILDFRAME")); - - wxDEFAULT_FRAME_ICON = LoadIcon(wxhInstance, wxT("wxDEFAULT_FRAME")); - wxDEFAULT_MDIPARENTFRAME_ICON = LoadIcon(wxhInstance, wxT("wxDEFAULT_MDIPARENTFRAME")); - wxDEFAULT_MDICHILDFRAME_ICON = LoadIcon(wxhInstance, wxT("wxDEFAULT_MDICHILDFRAME")); -#endif // 0 - - RegisterWindowClasses(); - -#ifndef __WXMICROWIN__ - // Create the brush for disabling bitmap buttons - - LOGBRUSH lb; - lb.lbStyle = BS_PATTERN; - lb.lbColor = 0; - lb.lbHatch = (int)LoadBitmap( wxhInstance, wxT("wxDISABLE_BUTTON_BITMAP") ); - if ( lb.lbHatch ) - { - wxDisableButtonBrush = ::CreateBrushIndirect( & lb ); - ::DeleteObject( (HGDIOBJ)lb.lbHatch ); - } - //else: wxWindows resources are probably not linked in -#endif - -#if wxUSE_PENWINDOWS - wxRegisterPenWin(); -#endif - - wxWinHandleHash = new wxWinHashTable(wxKEY_INTEGER, 100); - - // This is to foil optimizations in Visual C++ that throw out dummy.obj. - // PLEASE DO NOT ALTER THIS. -#if defined(__VISUALC__) && defined(__WIN16__) && !defined(WXMAKINGDLL) - extern char wxDummyChar; - if (wxDummyChar) wxDummyChar++; -#endif - -#ifndef __WXMICROWIN__ - wxSetKeyboardHook(TRUE); -#endif - - wxModule::RegisterModules(); - if (!wxModule::InitializeModules()) - return FALSE; - return TRUE; -} - -// --------------------------------------------------------------------------- -// RegisterWindowClasses -// --------------------------------------------------------------------------- - -// TODO we should only register classes really used by the app. For this it -// would be enough to just delay the class registration until an attempt -// to create a window of this class is made. -bool wxApp::RegisterWindowClasses() -{ - WNDCLASS wndclass; - wxZeroMemory(wndclass); - - // for each class we register one with CS_(V|H)REDRAW style and one - // without for windows created with wxNO_FULL_REDRAW_ON_REPAINT flag - static const long styleNormal = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; - static const long styleNoRedraw = CS_DBLCLKS; - - // the fields which are common to all classes - wndclass.lpfnWndProc = (WNDPROC)wxWndProc; - wndclass.hInstance = wxhInstance; - wndclass.hCursor = ::LoadCursor((HINSTANCE)NULL, IDC_ARROW); - - // Register the frame window class. - wndclass.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); - wndclass.lpszClassName = wxCanvasClassName; - wndclass.style = styleNormal; - - if ( !RegisterClass(&wndclass) ) - { - wxLogLastError(wxT("RegisterClass(frame)")); - } - - // "no redraw" frame - wndclass.lpszClassName = wxCanvasClassNameNR; - wndclass.style = styleNoRedraw; - - if ( !RegisterClass(&wndclass) ) - { - wxLogLastError(wxT("RegisterClass(no redraw frame)")); - } - - // Register the MDI frame window class. - wndclass.hbrBackground = (HBRUSH)NULL; // paint MDI frame ourselves - wndclass.lpszClassName = wxMDIFrameClassName; - wndclass.style = styleNormal; - - if ( !RegisterClass(&wndclass) ) - { - wxLogLastError(wxT("RegisterClass(MDI parent)")); - } - - // "no redraw" MDI frame - wndclass.lpszClassName = wxMDIFrameClassNameNoRedraw; - wndclass.style = styleNoRedraw; - - if ( !RegisterClass(&wndclass) ) - { - wxLogLastError(wxT("RegisterClass(no redraw MDI parent frame)")); - } - - // Register the MDI child frame window class. - wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); - wndclass.lpszClassName = wxMDIChildFrameClassName; - wndclass.style = styleNormal; - - if ( !RegisterClass(&wndclass) ) - { - wxLogLastError(wxT("RegisterClass(MDI child)")); - } - - // "no redraw" MDI child frame - wndclass.lpszClassName = wxMDIChildFrameClassNameNoRedraw; - wndclass.style = styleNoRedraw; - - if ( !RegisterClass(&wndclass) ) - { - wxLogLastError(wxT("RegisterClass(no redraw MDI child)")); - } - - return TRUE; -} - -// --------------------------------------------------------------------------- -// UnregisterWindowClasses -// --------------------------------------------------------------------------- - -bool wxApp::UnregisterWindowClasses() -{ - bool retval = TRUE; - -#ifndef __WXMICROWIN__ - // MDI frame window class. - if ( !::UnregisterClass(wxMDIFrameClassName, wxhInstance) ) - { - wxLogLastError(wxT("UnregisterClass(MDI parent)")); - - retval = FALSE; - } - - // "no redraw" MDI frame - if ( !::UnregisterClass(wxMDIFrameClassNameNoRedraw, wxhInstance) ) - { - wxLogLastError(wxT("UnregisterClass(no redraw MDI parent frame)")); - - retval = FALSE; - } - - // MDI child frame window class. - if ( !::UnregisterClass(wxMDIChildFrameClassName, wxhInstance) ) - { - wxLogLastError(wxT("UnregisterClass(MDI child)")); - - retval = FALSE; - } - - // "no redraw" MDI child frame - if ( !::UnregisterClass(wxMDIChildFrameClassNameNoRedraw, wxhInstance) ) - { - wxLogLastError(wxT("UnregisterClass(no redraw MDI child)")); - - retval = FALSE; - } - - // canvas class name - if ( !::UnregisterClass(wxCanvasClassName, wxhInstance) ) - { - wxLogLastError(wxT("UnregisterClass(canvas)")); - - retval = FALSE; - } - - if ( !::UnregisterClass(wxCanvasClassNameNR, wxhInstance) ) - { - wxLogLastError(wxT("UnregisterClass(no redraw canvas)")); - - retval = FALSE; - } -#endif // __WXMICROWIN__ - - return retval; -} - -// --------------------------------------------------------------------------- -// Convert Windows to argc, argv style -// --------------------------------------------------------------------------- - -void wxApp::ConvertToStandardCommandArgs(const char* lpCmdLine) -{ - // break the command line in words - wxArrayString args = - wxCmdLineParser::ConvertStringToArgs(wxConvertMB2WX(lpCmdLine)); - - // +1 here for the program name - argc = args.GetCount() + 1; - - // and +1 here for the terminating NULL - argv = new wxChar *[argc + 1]; - - argv[0] = new wxChar[260]; // 260 is MAX_PATH value from windef.h - ::GetModuleFileName(wxhInstance, argv[0], 260); - - // also set the app name from argv[0] - wxString name; - wxFileName::SplitPath(argv[0], NULL, &name, NULL); - - // but don't override the name already set by the user code, if any - if ( GetAppName().empty() ) - SetAppName(name); - - // copy all the other arguments to wxApp::argv[] - for ( int i = 1; i < argc; i++ ) - { - argv[i] = copystring(args[i - 1]); - } - - // argv[] must be NULL-terminated - argv[argc] = NULL; -} - -//// Cleans up any wxWindows internal structures left lying around - -void wxApp::CleanUp() -{ - //// COMMON CLEANUP - -#if wxUSE_LOG - // flush the logged messages if any and install a 'safer' log target: the - // default one (wxLogGui) can't be used after the resources are freed just - // below and the user suppliedo ne might be even more unsafe (using any - // wxWindows GUI function is unsafe starting from now) - wxLog::DontCreateOnDemand(); - - // this will flush the old messages if any - delete wxLog::SetActiveTarget(new wxLogStderr); -#endif // wxUSE_LOG - - // One last chance for pending objects to be cleaned up - wxTheApp->DeletePendingObjects(); - - wxModule::CleanUpModules(); - -#if wxUSE_WX_RESOURCES - wxCleanUpResourceSystem(); - - // wxDefaultResourceTable->ClearTable(); -#endif - - wxDeleteStockObjects(); - - // Destroy all GDI lists, etc. - wxDeleteStockLists(); - - delete wxTheColourDatabase; - wxTheColourDatabase = NULL; - - wxBitmap::CleanUpHandlers(); - - delete[] wxBuffer; - wxBuffer = NULL; - - //// WINDOWS-SPECIFIC CLEANUP - -#ifndef __WXMICROWIN__ - wxSetKeyboardHook(FALSE); -#endif - -#if wxUSE_PENWINDOWS - wxCleanUpPenWin(); -#endif - - if (wxSTD_FRAME_ICON) - DestroyIcon(wxSTD_FRAME_ICON); - if (wxSTD_MDICHILDFRAME_ICON) - DestroyIcon(wxSTD_MDICHILDFRAME_ICON); - if (wxSTD_MDIPARENTFRAME_ICON) - DestroyIcon(wxSTD_MDIPARENTFRAME_ICON); - - if (wxDEFAULT_FRAME_ICON) - DestroyIcon(wxDEFAULT_FRAME_ICON); - if (wxDEFAULT_MDICHILDFRAME_ICON) - DestroyIcon(wxDEFAULT_MDICHILDFRAME_ICON); - if (wxDEFAULT_MDIPARENTFRAME_ICON) - DestroyIcon(wxDEFAULT_MDIPARENTFRAME_ICON); - - if ( wxDisableButtonBrush ) - ::DeleteObject( wxDisableButtonBrush ); - -#if wxUSE_OLE - ::OleUninitialize(); -#endif - -#ifdef WXMAKINGDLL - // for an EXE the classes are unregistered when it terminates but DLL may - // be loaded several times (load/unload/load) into the same process in - // which case the registration will fail after the first time if we don't - // unregister the classes now - UnregisterWindowClasses(); -#endif // WXMAKINGDLL - -#if wxUSE_CTL3D - Ctl3dUnregister(wxhInstance); -#endif - - delete wxWinHandleHash; - - // GL: I'm annoyed ... I don't know where to put this and I don't want to - // create a module for that as it's part of the core. - delete wxPendingEvents; - -#if wxUSE_THREADS - delete wxPendingEventsLocker; - // If we don't do the following, we get an apparent memory leak -#if wxUSE_VALIDATORS - ((wxEvtHandler&) wxDefaultValidator).ClearEventLocker(); -#endif // wxUSE_VALIDATORS -#endif // wxUSE_THREADS - - wxClassInfo::CleanUpClasses(); - - delete wxTheApp; - wxTheApp = NULL; - -#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT - // At this point we want to check if there are any memory - // blocks that aren't part of the wxDebugContext itself, - // as a special case. Then when dumping we need to ignore - // wxDebugContext, too. - if (wxDebugContext::CountObjectsLeft(TRUE) > 0) - { - wxLogMessage(wxT("There were memory leaks.")); - wxDebugContext::Dump(); - wxDebugContext::PrintStatistics(); - } - // wxDebugContext::SetStream(NULL, NULL); -#endif - -#if wxUSE_LOG - // do it as the very last thing because everything else can log messages - delete wxLog::SetActiveTarget(NULL); -#endif // wxUSE_LOG -} - -//---------------------------------------------------------------------- -// Entry point helpers, used by wxPython -//---------------------------------------------------------------------- - -int WXDLLEXPORT wxEntryStart( int WXUNUSED(argc), char** WXUNUSED(argv) ) -{ - return wxApp::Initialize(); -} - -int WXDLLEXPORT wxEntryInitGui() -{ - return wxTheApp->OnInitGui(); -} - -void WXDLLEXPORT wxEntryCleanup() -{ - wxApp::CleanUp(); -} - - -#if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL)) - -// temporarily disable this warning which would be generated in release builds -// because of __try -#ifdef __VISUALC__ - #pragma warning(disable: 4715) // not all control paths return a value -#endif // Visual C++ - -//---------------------------------------------------------------------- -// Main wxWindows entry point -//---------------------------------------------------------------------- -int wxEntry(WXHINSTANCE hInstance, - WXHINSTANCE WXUNUSED(hPrevInstance), - char *lpCmdLine, - int nCmdShow, - bool enterLoop) -{ - // do check for memory leaks on program exit - // (another useful flag is _CRTDBG_DELAY_FREE_MEM_DF which doesn't free - // deallocated memory which may be used to simulate low-memory condition) -#ifndef __WXMICROWIN__ - wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF); -#endif - -#ifdef __MWERKS__ -#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT - // This seems to be necessary since there are 'rogue' - // objects present at this point (perhaps global objects?) - // Setting a checkpoint will ignore them as far as the - // memory checking facility is concerned. - // Of course you may argue that memory allocated in globals should be - // checked, but this is a reasonable compromise. - wxDebugContext::SetCheckpoint(); -#endif -#endif - - // take everything into a try-except block to be able to call - // OnFatalException() if necessary -#if wxUSE_ON_FATAL_EXCEPTION - __try { -#endif - wxhInstance = (HINSTANCE) hInstance; - - if (!wxEntryStart(0,0)) - return 0; - - // create the application object or ensure that one already exists - if (!wxTheApp) - { - // The app may have declared a global application object, but we recommend - // the IMPLEMENT_APP macro is used instead, which sets an initializer - // function for delayed, dynamic app object construction. - wxCHECK_MSG( wxApp::GetInitializerFunction(), 0, - wxT("No initializer - use IMPLEMENT_APP macro.") ); - - wxTheApp = (wxApp*) (*wxApp::GetInitializerFunction()) (); - } - - wxCHECK_MSG( wxTheApp, 0, wxT("You have to define an instance of wxApp!") ); - - // save the WinMain() parameters - if (lpCmdLine) // MicroWindows passes NULL - wxTheApp->ConvertToStandardCommandArgs(lpCmdLine); - wxTheApp->m_nCmdShow = nCmdShow; - - // We really don't want timestamps by default, because it means - // we can't simply double-click on the error message and get to that - // line in the source. So VC++ at least, let's have a sensible default. -#ifdef __VISUALC__ - wxLog::SetTimestamp(NULL); -#endif - - // init the app - int retValue = wxEntryInitGui() && wxTheApp->OnInit() ? 0 : -1; - - if ( retValue == 0 ) - { - if ( enterLoop ) - { - // run the main loop - wxTheApp->OnRun(); - } - else - { - // we want to initialize, but not run or exit immediately. - return 1; - } - } - //else: app initialization failed, so we skipped OnRun() - - wxWindow *topWindow = wxTheApp->GetTopWindow(); - if ( topWindow ) - { - // Forcibly delete the window. - if ( topWindow->IsKindOf(CLASSINFO(wxFrame)) || - topWindow->IsKindOf(CLASSINFO(wxDialog)) ) - { - topWindow->Close(TRUE); - wxTheApp->DeletePendingObjects(); - } - else - { - delete topWindow; - wxTheApp->SetTopWindow(NULL); - } - } - - retValue = wxTheApp->OnExit(); - - wxEntryCleanup(); - - return retValue; - -#if wxUSE_ON_FATAL_EXCEPTION - } - __except ( gs_handleExceptions ? EXCEPTION_EXECUTE_HANDLER - : EXCEPTION_CONTINUE_SEARCH ) { - if ( wxTheApp ) - { - // give the user a chance to do something special about this - wxTheApp->OnFatalException(); - } - - ::ExitProcess(3); // the same exit code as abort() - - // NOTREACHED - } -#endif // wxUSE_ON_FATAL_EXCEPTION -} - -// restore warning state -#ifdef __VISUALC__ - #pragma warning(default: 4715) // not all control paths return a value -#endif // Visual C++ - -#else /* _WINDLL */ - -//---------------------------------------------------------------------- -// Entry point for wxWindows + the App in a DLL -//---------------------------------------------------------------------- - -int wxEntry(WXHINSTANCE hInstance) -{ - wxhInstance = (HINSTANCE) hInstance; - wxEntryStart(0, 0); - - // The app may have declared a global application object, but we recommend - // the IMPLEMENT_APP macro is used instead, which sets an initializer function - // for delayed, dynamic app object construction. - if (!wxTheApp) - { - wxCHECK_MSG( wxApp::GetInitializerFunction(), 0, - "No initializer - use IMPLEMENT_APP macro." ); - - wxTheApp = (* wxApp::GetInitializerFunction()) (); - } - - wxCHECK_MSG( wxTheApp, 0, "You have to define an instance of wxApp!" ); - - wxTheApp->argc = 0; - wxTheApp->argv = NULL; - - wxEntryInitGui(); - - wxTheApp->OnInit(); - - wxWindow *topWindow = wxTheApp->GetTopWindow(); - if ( topWindow && topWindow->GetHWND()) - { - topWindow->Show(TRUE); - } - - return 1; -} -#endif // _WINDLL - -//// Static member initialization - -wxAppInitializerFunction wxAppBase::m_appInitFn = (wxAppInitializerFunction) NULL; - -wxApp::wxApp() -{ - argc = 0; - argv = NULL; - m_printMode = wxPRINT_WINDOWS; - m_auto3D = TRUE; -} - -wxApp::~wxApp() -{ - // Delete command-line args - int i; - for (i = 0; i < argc; i++) - { - delete[] argv[i]; - } - delete[] argv; -} - -bool wxApp::Initialized() -{ -#ifndef _WINDLL - if (GetTopWindow()) - return TRUE; - else - return FALSE; -#else // Assume initialized if DLL (no way of telling) - return TRUE; -#endif -} - -/* - * Get and process a message, returning FALSE if WM_QUIT - * received (and also set the flag telling the app to exit the main loop) - * - */ -bool wxApp::DoMessage() -{ - BOOL rc = ::GetMessage(&s_currentMsg, (HWND) NULL, 0, 0); - if ( rc == 0 ) - { - // got WM_QUIT - m_keepGoing = FALSE; - - return FALSE; - } - else if ( rc == -1 ) - { - // should never happen, but let's test for it nevertheless - wxLogLastError(wxT("GetMessage")); - } - else - { -#if wxUSE_THREADS - wxASSERT_MSG( wxThread::IsMain(), - wxT("only the main thread can process Windows messages") ); - - static bool s_hadGuiLock = TRUE; - static wxMsgArray s_aSavedMessages; - - // if a secondary thread owns is doing GUI calls, save all messages for - // later processing - we can't process them right now because it will - // lead to recursive library calls (and we're not reentrant) - if ( !wxGuiOwnedByMainThread() ) - { - s_hadGuiLock = FALSE; - - // leave out WM_COMMAND messages: too dangerous, sometimes - // the message will be processed twice - if ( !wxIsWaitingForThread() || - s_currentMsg.message != WM_COMMAND ) - { - s_aSavedMessages.Add(s_currentMsg); - } - - return TRUE; - } - else - { - // have we just regained the GUI lock? if so, post all of the saved - // messages - // - // FIXME of course, it's not _exactly_ the same as processing the - // messages normally - expect some things to break... - if ( !s_hadGuiLock ) - { - s_hadGuiLock = TRUE; - - size_t count = s_aSavedMessages.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - MSG& msg = s_aSavedMessages[n]; - - DoMessage((WXMSG *)&msg); - } - - s_aSavedMessages.Empty(); - } - } -#endif // wxUSE_THREADS - - // Process the message - DoMessage((WXMSG *)&s_currentMsg); - } - - return TRUE; -} - -void wxApp::DoMessage(WXMSG *pMsg) -{ - if ( !ProcessMessage(pMsg) ) - { - ::TranslateMessage((MSG *)pMsg); - ::DispatchMessage((MSG *)pMsg); - } -} - -/* - * Keep trying to process messages until WM_QUIT - * received. - * - * If there are messages to be processed, they will all be - * processed and OnIdle will not be called. - * When there are no more messages, OnIdle is called. - * If OnIdle requests more time, - * it will be repeatedly called so long as there are no pending messages. - * A 'feature' of this is that once OnIdle has decided that no more processing - * is required, then it won't get processing time until further messages - * are processed (it'll sit in DoMessage). - */ - -int wxApp::MainLoop() -{ - m_keepGoing = TRUE; - - while ( m_keepGoing ) - { -#if wxUSE_THREADS - wxMutexGuiLeaveOrEnter(); -#endif // wxUSE_THREADS - - while ( !Pending() && ProcessIdle() ) - ; - - // a message came or no more idle processing to do - DoMessage(); - } - - return s_currentMsg.wParam; -} - -// Returns TRUE if more time is needed. -bool wxApp::ProcessIdle() -{ - wxIdleEvent event; - event.SetEventObject(this); - ProcessEvent(event); - - return event.MoreRequested(); -} - -void wxApp::ExitMainLoop() -{ - // this will set m_keepGoing to FALSE a bit later - ::PostQuitMessage(0); -} - -bool wxApp::Pending() -{ - return ::PeekMessage(&s_currentMsg, 0, 0, 0, PM_NOREMOVE) != 0; -} - -void wxApp::Dispatch() -{ - DoMessage(); -} - -/* - * Give all windows a chance to preprocess - * the message. Some may have accelerator tables, or have - * MDI complications. - */ - -bool wxApp::ProcessMessage(WXMSG *wxmsg) -{ - MSG *msg = (MSG *)wxmsg; - HWND hwnd = msg->hwnd; - wxWindow *wndThis = wxGetWindowFromHWND((WXHWND)hwnd); - - // this may happen if the event occurred in a standard modeless dialog (the - // only example of which I know of is the find/replace dialog) - then call - // IsDialogMessage() to make TAB navigation in it work - if ( !wndThis ) - { - // we need to find the dialog containing this control as - // IsDialogMessage() just eats all the messages (i.e. returns TRUE for - // them) if we call it for the control itself - while ( hwnd && ::GetWindowLong(hwnd, GWL_STYLE) & WS_CHILD ) - { - hwnd = ::GetParent(hwnd); - } - - return hwnd && ::IsDialogMessage(hwnd, msg) != 0; - } - -#if wxUSE_TOOLTIPS - // we must relay WM_MOUSEMOVE events to the tooltip ctrl if we want it to - // popup the tooltip bubbles - if ( (msg->message == WM_MOUSEMOVE) ) - { - wxToolTip *tt = wndThis->GetToolTip(); - if ( tt ) - { - tt->RelayEvent(wxmsg); - } - } -#endif // wxUSE_TOOLTIPS - - // allow the window to prevent certain messages from being - // translated/processed (this is currently used by wxTextCtrl to always - // grab Ctrl-C/V/X, even if they are also accelerators in some parent) - if ( !wndThis->MSWShouldPreProcessMessage(wxmsg) ) - { - return FALSE; - } - - // try translations first: the accelerators override everything - wxWindow *wnd; - - for ( wnd = wndThis; wnd; wnd = wnd->GetParent() ) - { - if ( wnd->MSWTranslateMessage(wxmsg)) - return TRUE; - - // stop at first top level window, i.e. don't try to process the key - // strokes originating in a dialog using the accelerators of the parent - // frame - this doesn't make much sense - if ( wnd->IsTopLevel() ) - break; - } - - // now try the other hooks (kbd navigation is handled here): we start from - // wndThis->GetParent() because wndThis->MSWProcessMessage() was already - // called above - for ( wnd = wndThis->GetParent(); wnd; wnd = wnd->GetParent() ) - { - if ( wnd->MSWProcessMessage(wxmsg) ) - return TRUE; - } - - // no special preprocessing for this message, dispatch it normally - return FALSE; -} - -// this is a temporary hack and will be replaced by using wxEventLoop in the -// future -// -// it is needed to allow other event loops (currently only one: the modal -// dialog one) to reset the OnIdle() semaphore because otherwise OnIdle() -// wouldn't do anything while a modal dialog shown from OnIdle() call is shown. -bool wxIsInOnIdleFlag = FALSE; - -void wxApp::OnIdle(wxIdleEvent& event) -{ - // Avoid recursion (via ProcessEvent default case) - if ( wxIsInOnIdleFlag ) - return; - - wxIsInOnIdleFlag = TRUE; - - // If there are pending events, we must process them: pending events - // are either events to the threads other than main or events posted - // with wxPostEvent() functions - // GRG: I have moved this here so that all pending events are processed - // before starting to delete any objects. This behaves better (in - // particular, wrt wxPostEvent) and is coherent with wxGTK's current - // behaviour. Changed Feb/2000 before 2.1.14 - ProcessPendingEvents(); - - // 'Garbage' collection of windows deleted with Close(). - DeletePendingObjects(); - -#if wxUSE_LOG - // flush the logged messages if any - wxLog::FlushActive(); -#endif // wxUSE_LOG - -#if wxUSE_DC_CACHEING - // automated DC cache management: clear the cached DCs and bitmap - // if it's likely that the app has finished with them, that is, we - // get an idle event and we're not dragging anything. - if (!::GetKeyState(MK_LBUTTON) && !::GetKeyState(MK_MBUTTON) && !::GetKeyState(MK_RBUTTON)) - wxDC::ClearCache(); -#endif // wxUSE_DC_CACHEING - - // Send OnIdle events to all windows - if ( SendIdleEvents() ) - { - // SendIdleEvents() returns TRUE if at least one window requested more - // idle events - event.RequestMore(TRUE); - } - - wxIsInOnIdleFlag = FALSE; -} - -// Send idle event to all top-level windows -bool wxApp::SendIdleEvents() -{ - bool needMore = FALSE; - - wxWindowList::Node* node = wxTopLevelWindows.GetFirst(); - while (node) - { - wxWindow* win = node->GetData(); - if (SendIdleEvents(win)) - needMore = TRUE; - node = node->GetNext(); - } - - return needMore; -} - -// Send idle event to window and all subwindows -bool wxApp::SendIdleEvents(wxWindow* win) -{ - bool needMore = FALSE; - - wxIdleEvent event; - event.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(event); - - if (event.MoreRequested()) - needMore = TRUE; - - wxNode* node = win->GetChildren().First(); - while (node) - { - wxWindow* win = (wxWindow*) node->Data(); - if (SendIdleEvents(win)) - needMore = TRUE; - - node = node->Next(); - } - return needMore; -} - -void wxApp::DeletePendingObjects() -{ - wxNode *node = wxPendingDelete.First(); - while (node) - { - wxObject *obj = (wxObject *)node->Data(); - - delete obj; - - if (wxPendingDelete.Member(obj)) - delete node; - - // Deleting one object may have deleted other pending - // objects, so start from beginning of list again. - node = wxPendingDelete.First(); - } -} - -void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event)) -{ - if (GetTopWindow()) - GetTopWindow()->Close(TRUE); -} - -// Default behaviour: close the application with prompts. The -// user can veto the close, and therefore the end session. -void wxApp::OnQueryEndSession(wxCloseEvent& event) -{ - if (GetTopWindow()) - { - if (!GetTopWindow()->Close(!event.CanVeto())) - event.Veto(TRUE); - } -} - -/* static */ -int wxApp::GetComCtl32Version() -{ -#ifdef __WXMICROWIN__ - return 0; -#else - // cache the result - static int s_verComCtl32 = -1; - - wxCRIT_SECT_DECLARE(csComCtl32); - wxCRIT_SECT_LOCKER(lock, csComCtl32); - - if ( s_verComCtl32 == -1 ) - { - // initally assume no comctl32.dll at all - s_verComCtl32 = 0; - - // do we have it? - HMODULE hModuleComCtl32 = ::GetModuleHandle(wxT("COMCTL32")); - - // if so, then we can check for the version - if ( hModuleComCtl32 ) - { - // try to use DllGetVersion() if available in _headers_ - #ifdef DLLVER_PLATFORM_WINDOWS // defined in shlwapi.h - DLLGETVERSIONPROC pfnDllGetVersion = (DLLGETVERSIONPROC) - ::GetProcAddress(hModuleComCtl32, "DllGetVersion"); - if ( pfnDllGetVersion ) - { - DLLVERSIONINFO dvi; - dvi.cbSize = sizeof(dvi); - - HRESULT hr = (*pfnDllGetVersion)(&dvi); - if ( FAILED(hr) ) - { - wxLogApiError(_T("DllGetVersion"), hr); - } - else - { - // this is incompatible with _WIN32_IE values, but - // compatible with the other values returned by - // GetComCtl32Version() - s_verComCtl32 = 100*dvi.dwMajorVersion + - dvi.dwMinorVersion; - } - } - #endif - // DllGetVersion() unavailable either during compile or - // run-time, try to guess the version otherwise - if ( !s_verComCtl32 ) - { - // InitCommonControlsEx is unique to 4.70 and later - FARPROC theProc = ::GetProcAddress - ( - hModuleComCtl32, - "InitCommonControlsEx" - ); - - if ( !theProc ) - { - // not found, must be 4.00 - s_verComCtl32 = 400; - } - else - { - // many symbols appeared in comctl32 4.71, could use - // any of them except may be DllInstall - theProc = ::GetProcAddress - ( - hModuleComCtl32, - "InitializeFlatSB" - ); - if ( !theProc ) - { - // not found, must be 4.70 - s_verComCtl32 = 470; - } - else - { - // found, must be 4.71 - s_verComCtl32 = 471; - } - } - } - } - } - - return s_verComCtl32; -#endif -} - -void wxExit() -{ - wxLogError(_("Fatal error: exiting")); - - wxApp::CleanUp(); - exit(0); -} - -// Yield to incoming messages - -bool wxApp::Yield(bool onlyIfNeeded) -{ - // MT-FIXME - static bool s_inYield = FALSE; - - // disable log flushing from here because a call to wxYield() shouldn't - // normally result in message boxes popping up &c - wxLog::Suspend(); - - if ( s_inYield ) - { - if ( !onlyIfNeeded ) - { - wxFAIL_MSG( wxT("wxYield called recursively" ) ); - } - - return FALSE; - } - - s_inYield = TRUE; - - // we don't want to process WM_QUIT from here - it should be processed in - // the main event loop in order to stop it - MSG msg; - while ( PeekMessage(&msg, (HWND)0, 0, 0, PM_NOREMOVE) && - msg.message != WM_QUIT ) - { -#if wxUSE_THREADS - wxMutexGuiLeaveOrEnter(); -#endif // wxUSE_THREADS - - if ( !wxTheApp->DoMessage() ) - break; - } - - // if there are pending events, we must process them. - ProcessPendingEvents(); - - // let the logs be flashed again - wxLog::Resume(); - - s_inYield = FALSE; - - return TRUE; -} - -bool wxHandleFatalExceptions(bool doit) -{ -#if wxUSE_ON_FATAL_EXCEPTION - // assume this can only be called from the main thread - gs_handleExceptions = doit; - - return TRUE; -#else - wxFAIL_MSG(_T("set wxUSE_ON_FATAL_EXCEPTION to 1 to use this function")); - - (void)doit; - return FALSE; -#endif -} - -//----------------------------------------------------------------------------- -// wxWakeUpIdle -//----------------------------------------------------------------------------- - -void wxWakeUpIdle() -{ - // Send the top window a dummy message so idle handler processing will - // start up again. Doing it this way ensures that the idle handler - // wakes up in the right thread (see also wxWakeUpMainThread() which does - // the same for the main app thread only) - wxWindow *topWindow = wxTheApp->GetTopWindow(); - if ( topWindow ) - { - if ( !::PostMessage(GetHwndOf(topWindow), WM_NULL, 0, 0) ) - { - // should never happen - wxLogLastError(wxT("PostMessage(WM_NULL)")); - } - } -} - -//----------------------------------------------------------------------------- - -// For some reason, with MSVC++ 1.5, WinMain isn't linked in properly -// if in a separate file. So include it here to ensure it's linked. -#if (defined(__VISUALC__) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !defined(__TWIN32__) && !defined(WXMAKINGDLL)) -#include "main.cpp" -#endif diff --git a/Contrib/NSIS Menu/wx/build.txt b/Contrib/NSIS Menu/wx/build.txt new file mode 100644 index 00000000..c77a0ef3 --- /dev/null +++ b/Contrib/NSIS Menu/wx/build.txt @@ -0,0 +1,4 @@ +1. Install wxWidgets 2.8 +2. Set WXWIN environment variable +3. Run wxbuild.bat +4. Build NSIS happily diff --git a/Contrib/NSIS Menu/include/wx/msw/setup.h b/Contrib/NSIS Menu/wx/setup.h similarity index 60% rename from Contrib/NSIS Menu/include/wx/msw/setup.h rename to Contrib/NSIS Menu/wx/setup.h index 1d0d509c..aa7f14de 100644 --- a/Contrib/NSIS Menu/include/wx/msw/setup.h +++ b/Contrib/NSIS Menu/wx/setup.h @@ -4,14 +4,15 @@ // Author: Julian Smart // Modified by: // Created: 01/02/97 -// RCS-ID: $Id: setup0.h,v 1.123.2.5 2002/12/02 11:42:23 JS Exp $ +// RCS-ID: $Id: setup0.h,v 1.246 2006/11/09 00:54:51 VZ Exp $ // Copyright: (c) Julian Smart -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SETUP_H_ #define _WX_SETUP_H_ +/* --- start common options --- */ // ---------------------------------------------------------------------------- // global settings // ---------------------------------------------------------------------------- @@ -26,59 +27,31 @@ // compatibility settings // ---------------------------------------------------------------------------- -// This setting determines the compatibility with 1.68 API: -// Level 0: no backward compatibility, all new features -// Level 1: some extra methods are defined for compatibility. +// This setting determines the compatibility with 2.4 API: set it to 1 to +// enable it but please consider updating your code instead. // -// Default is 0. -// -// Recommended setting: 0 (in fact the compatibility code is now very minimal -// so there is little advantage to setting it to 1. -#define WXWIN_COMPATIBILITY 0 - -// This setting determines the compatibility with 2.0 API: set it to 1 to -// enable it -// -// Default is 0. -// -// Recommended setting: 0 (please update your code instead!) -#define WXWIN_COMPATIBILITY_2 0 - -// This setting determines the compatibility with 2.2 API: set it to 0 to -// flag all cases of using deprecated functions. -// -// Default is 1 but please try building your code with 0. +// Default is 0 // // Recommended setting: 0 (please update your code) -#define WXWIN_COMPATIBILITY_2_2 0 +#define WXWIN_COMPATIBILITY_2_4 0 -// in wxMSW version 2.1.11 and earlier, wxIcon always derives from wxBitmap, -// but this is very dangerous because you can mistakenly pass an icon instead -// of a bitmap to a function taking "const wxBitmap&" - which will *not* work -// because an icon is not a valid bitmap +// This setting determines the compatibility with 2.6 API: set it to 0 to +// flag all cases of using deprecated functions. // -// Starting from 2.1.12, you have the choice under this backwards compatible -// behaviour (your code will still compile, but probably won't behave as -// expected!) and not deriving wxIcon class from wxBitmap, but providing a -// conversion ctor wxBitmap(const wxIcon&) instead. +// Default is 1 but please try building your code with 0 as the default will +// change to 0 in the next version and the deprecated functions will disappear +// in the version after it completely. // -// Recommended setting: 0 -#define wxICON_IS_BITMAP 0 +// Recommended setting: 0 (please update your code) +#define WXWIN_COMPATIBILITY_2_6 0 -// Define as 1 for font size to be backward compatible to 1.63 and earlier. -// 1.64 and later define point sizes to be compatible with Windows. +// MSW-only: Set to 0 for accurate dialog units, else 1 for old behaviour when +// default system font is used for wxWindow::GetCharWidth/Height() instead of +// the current font. // // Default is 0 // // Recommended setting: 0 -#define wxFONT_SIZE_COMPATIBILITY 0 - -// Set to 0 for accurate dialog units, else 1 to be as per 2.1.16 and before. -// If migrating between versions, your dialogs may seem to shrink. -// -// Default is 1 -// -// Recommended setting: 0 (the new calculations are more correct!) #define wxDIALOG_UNIT_COMPATIBILITY 0 // ---------------------------------------------------------------------------- @@ -88,7 +61,7 @@ // Generic comment about debugging settings: they are very useful if you don't // use any other memory leak detection tools such as Purify/BoundsChecker, but // are probably redundant otherwise. Also, Visual C++ CRT has the same features -// as wxWindows memory debugging subsystem built in since version 5.0 and you +// as wxWidgets memory debugging subsystem built in since version 5.0 and you // may prefer to use it instead of built in memory debugging code because it is // faster and more fool proof. // @@ -147,44 +120,45 @@ // Default is 1 // // Recommended setting: 1 if your compiler supports it. -#ifdef _MSC_VER - #define wxUSE_ON_FATAL_EXCEPTION 1 -#else - #define wxUSE_ON_FATAL_EXCEPTION 0 -#endif +#define wxUSE_ON_FATAL_EXCEPTION 0 + +// Set this to 1 to be able to generate a human-readable (unlike +// machine-readable minidump created by wxCrashReport::Generate()) stack back +// trace when your program crashes using wxStackWalker +// +// Default is 1 if supported by the compiler. +// +// Recommended setting: 1, set to 0 if your programs never crash +#define wxUSE_STACKWALKER 0 + +// Set this to 1 to compile in wxDebugReport class which allows you to create +// and optionally upload to your web site a debug report consisting of back +// trace of the crash (if wxUSE_STACKWALKER == 1) and other information. +// +// Default is 1 if supported by the compiler. +// +// Recommended setting: 1, it is compiled into a separate library so there +// is no overhead if you don't use it +#define wxUSE_DEBUGREPORT 0 // ---------------------------------------------------------------------------- // Unicode support // ---------------------------------------------------------------------------- -// Set wxUSE_UNICODE to 1 to compile wxWindows in Unicode mode: wxChar will be +// Set wxUSE_UNICODE to 1 to compile wxWidgets in Unicode mode: wxChar will be // defined as wchar_t, wxString will use Unicode internally. If you set this // to 1, you must use wxT() macro for all literal strings in the program. // -// Unicode is currently only fully supported under Windows NT/2000/XP (Windows 9x -// doesn't support it and the programs compiled in Unicode mode will not run -// under 9x). +// Unicode is currently only fully supported under Windows NT/2000/XP +// (Windows 9x doesn't support it and the programs compiled in Unicode mode +// will not run under 9x -- but see wxUSE_UNICODE_MSLU below). // // Default is 0 // // Recommended setting: 0 (unless you only plan to use Windows NT/2000/XP) -#define wxUSE_UNICODE 0 - -// Set wxUSE_UNICODE_MSLU to 1 if you want to compile wxWindows in Unicode mode -// and be able to run compiled apps under Windows 9x as well as NT/2000/XP. This -// setting enables use of unicows.dll from MSLU (MS Layer for Unicode, see -// http://www.microsoft.com/globaldev/Articles/mslu_announce.asp). Note that you -// will have to modify the makefiles to include unicows.lib import library as the first -// library (if you use MSVC, you can run the makefile with "nmake MSLU=1 UNICODE=1" -// command). -// -// If your compiler doesn't have unicows.lib, you can get a version of it at -// http://libunicows.sourceforge.net -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_UNICODE_MSLU 0 +#ifndef wxUSE_UNICODE + #define wxUSE_UNICODE 0 +#endif // Setting wxUSE_WCHAR_T to 1 gives you some degree of Unicode support without // compiling the program in Unicode mode. More precisely, it will be possible @@ -200,6 +174,38 @@ // global features // ---------------------------------------------------------------------------- +// Compile library in exception-safe mode? If set to 1, the library will try to +// behave correctly in presence of exceptions (even though it still will not +// use the exceptions itself) and notify the user code about any unhandled +// exceptions. If set to 0, propagation of the exceptions through the library +// code will lead to undefined behaviour -- but the code itself will be +// slightly smaller and faster. +// +// Note that like wxUSE_THREADS this option is automatically set to 0 if +// wxNO_EXCEPTIONS is defined. +// +// Default is 1 +// +// Recommended setting: depends on whether you intend to use C++ exceptions +// in your own code (1 if you do, 0 if you don't) +#define wxUSE_EXCEPTIONS 0 + +// Set wxUSE_EXTENDED_RTTI to 1 to use extended RTTI +// +// Default is 0 +// +// Recommended setting: 0 (this is still work in progress...) +#define wxUSE_EXTENDED_RTTI 0 + +// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from +// std::list and std::vector, with a compatibility interface, +// and for wxHashMap to be implemented with templates. +// +// Default is 0 +// +// Recommended setting: YMMV +#define wxUSE_STL 0 + // Support for message/error logging. This includes wxLogXXX() functions and // wxLog and derived classes. Don't set this to 0 unless you really know what // you are doing. @@ -207,7 +213,7 @@ // Default is 1 // // Recommended setting: 1 (always) -#define wxUSE_LOG 1 +#define wxUSE_LOG 0 // Recommended setting: 1 #define wxUSE_LOGWINDOW 0 @@ -231,19 +237,72 @@ // library without it if you have no use for it - this will result in a // somewhat smaller and faster operation. // -// This is ignored under Win16, threads are only supported under Win32. +// Notice that if wxNO_THREADS is defined, wxUSE_THREADS is automatically reset +// to 0 in wx/chkconf.h, so, for example, if you set USE_THREADS to 0 in +// build/msw/config.* file this value will have no effect. // // Default is 1 // // Recommended setting: 0 unless you do plan to develop MT applications -#define wxUSE_THREADS 1 +#define wxUSE_THREADS 0 -// If enabled (1), compiles wxWindows streams classes +// If enabled, compiles wxWidgets streams classes +// +// wx stream classes are used for image IO, process IO redirection, network +// protocols implementation and much more and so disabling this results in a +// lot of other functionality being lost. +// +// Default is 1 +// +// Recommended setting: 1 as setting it to 0 disables many other things #define wxUSE_STREAMS 1 -// Use standard C++ streams if 1. If 0, use wxWin streams implementation. +// Use standard C++ streams if 1 instead of wx streams in some places. If +// disabled (default), wx streams are used everywhere and wxWidgets doesn't +// depend on the standard streams library. +// +// Notice that enabling this does not replace wx streams with std streams +// everywhere, in a lot of places wx streams are used no matter what. +// +// Default is 0 +// +// Recommended setting: 1 if you use the standard streams anyhow and so +// dependency on the standard streams library is not a +// problem #define wxUSE_STD_IOSTREAM 0 +// Enable conversion to standard C++ string if 1. +// +// Default is 1 for most compilers. +// +// Currently the Digital Mars and Watcom compilers come without standard C++ +// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have +// them (e.g. from STLPort). +// +// VC++ 5.0 does include standard C++ library header, however they produce +// many warnings that can't be turned off when compiled at warning level 4. +#if defined(__DMC__) || defined(__WATCOMC__) \ + || (defined(_MSC_VER) && _MSC_VER < 1200) + #define wxUSE_STD_STRING 0 +#else + #define wxUSE_STD_STRING 1 +#endif + +// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf. +// Note that if the system's implementation does not support positional +// parameters, setting this to 1 forces the use of the wxWidgets implementation +// of wxVsnprintf. The standard vsnprintf() supports positional parameters on +// many Unix systems but usually doesn't under Windows. +// +// Positional parameters are very useful when translating a program since using +// them in formatting strings allow translators to correctly reorder the +// translated sentences. +// +// Default is 1 +// +// Recommended setting: 1 if you want to support multiple languages +#define wxUSE_PRINTF_POS_PARAMS 0 + // ---------------------------------------------------------------------------- // non GUI features selection // ---------------------------------------------------------------------------- @@ -269,7 +328,7 @@ // Recommended setting: 1 (wxFile is highly recommended as it is required by // i18n code, wxFileConfig and others) #define wxUSE_FILE 1 -#define wxUSE_FFILE 1 +#define wxUSE_FFILE 0 // Use wxFSVolume class providing access to the configured/active mount points // @@ -278,6 +337,14 @@ // Recommended setting: 1 (but may be safely disabled if you don't use it) #define wxUSE_FSVOLUME 0 +// Use wxStandardPaths class which allows to retrieve some standard locations +// in the file system +// +// Default is 1 +// +// Recommended setting: 1 (may be disabled to save space, but not much) +#define wxUSE_STDPATHS 1 + // use wxTextBuffer class: required by wxTextFile #define wxUSE_TEXTBUFFER 1 @@ -286,7 +353,7 @@ #define wxUSE_TEXTFILE 1 // i18n support: _() macro, wxLocale class. Requires wxTextFile. -#define wxUSE_INTL 0 +#define wxUSE_INTL 1 // Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which // allow to manipulate dates, times and time intervals. wxDateTime replaces the @@ -303,30 +370,21 @@ // Default is 1 // // Recommended setting: 1 -#define wxUSE_DATETIME 1 - -// wxUSE_TIMEDATE enables compilation of the old wxDate and wxTime classes (not -// the same as wxDateTime!). These classes are obsolete and shouldn't be used -// in new code -// -// Default is 0 -// -// Recommended setting: 0 unless you have legacy code which uses these classes -#define wxUSE_TIMEDATE 0 +#define wxUSE_DATETIME 0 // Set wxUSE_TIMER to 1 to compile wxTimer class // // Default is 1 // // Recommended setting: 1 -#define wxUSE_TIMER 1 +#define wxUSE_TIMER 0 // Use wxStopWatch clas. // // Default is 1 // // Recommended setting: 1 (needed by wxSocket) -#define wxUSE_STOPWATCH 1 +#define wxUSE_STOPWATCH 0 // Setting wxUSE_CONFIG to 1 enables the use of wxConfig and related classes // which allow the application to store its settings in the persistent @@ -349,7 +407,7 @@ // not wxFileConfig. // // Recommended setting: 1 -#define wxUSE_CONFIG_NATIVE 1 +#define wxUSE_CONFIG_NATIVE 0 // If wxUSE_DIALUP_MANAGER is 1, compile in wxDialUpManager class which allows // to connect/disconnect from the network and be notified whenever the dial-up @@ -368,10 +426,10 @@ // Default is 1. // // Recommended setting: 1 -#define wxUSE_DYNLIB_CLASS 0 +#define wxUSE_DYNLIB_CLASS 1 // experimental, don't use for now -#define wxUSE_DYNAMIC_LOADER 1 +#define wxUSE_DYNAMIC_LOADER 0 // Set to 1 to use socket classes #define wxUSE_SOCKETS 0 @@ -382,19 +440,28 @@ // Set to 1 to enable virtual ZIP filesystem (requires wxUSE_FILESYSTEM) #define wxUSE_FS_ZIP 0 +// Set to 1 to enable virtual archive filesystem (requires wxUSE_FILESYSTEM) +#define wxUSE_FS_ARCHIVE 0 + // Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM) #define wxUSE_FS_INET 0 +// wxArchive classes for accessing archives such as zip and tar +#define wxUSE_ARCHIVE_STREAMS 0 + // Set to 1 to compile wxZipInput/OutputStream classes. #define wxUSE_ZIPSTREAM 0 +// Set to 1 to compile wxTarInput/OutputStream classes. +#define wxUSE_TARSTREAM 0 + // Set to 1 to compile wxZlibInput/OutputStream classes. Also required by -// wxUSE_LIBPNG. +// wxUSE_LIBPNG #define wxUSE_ZLIB 0 // If enabled, the code written by Apple will be used to write, in a portable // way, float on the disk. See extended.c for the license which is different -// from wxWindows one. +// from wxWidgets one. // // Default is 1. // @@ -426,6 +493,25 @@ // Define this to use wxURL class. #define wxUSE_URL 0 +// Define this to use native platform url and protocol support. +// Currently valid only for MS-Windows. +// Note: if you set this to 1, you can open ftp/http/gopher sites +// and obtain a valid input stream for these sites +// even when you set wxUSE_PROTOCOL_FTP/HTTP to 0. +// Doing so reduces the code size. +// +// This code is experimental and subject to change. +#define wxUSE_URL_NATIVE 0 + +// Support for wxVariant class used in several places throughout the library, +// notably in wxDataViewCtrl API. +// +// Default is 1. +// +// Recommended setting: 1 unless you want to reduce the library size as much as +// possible in which case setting this to 0 can gain up to 100KB. +#define wxUSE_VARIANT 0 + // Support for regular expression matching via wxRegEx class: enable this to // use POSIX regular expressions in your code. You need to compile regex // library from src/regex to use it under Windows. @@ -439,8 +525,59 @@ // wxSystemOptions class #define wxUSE_SYSTEM_OPTIONS 0 -// wxWave class -#define wxUSE_WAVE 0 +// wxSound class +#define wxUSE_SOUND 0 + +// Use wxMediaCtrl +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_MEDIACTRL 0 + +// Use GStreamer for Unix (req a lot of dependancies) +// +// Default is 0 +// +// Recommended setting: 1 (wxMediaCtrl won't work by default without it) +#define wxUSE_GSTREAMER 0 + +// Use wxWidget's XRC XML-based resource system. Recommended. +// +// Default is 1 +// +// Recommended setting: 1 (requires wxUSE_XML) +#define wxUSE_XRC 0 + +// XML parsing classes. Note that their API will change in the future, so +// using wxXmlDocument and wxXmlNode in your app is not recommended. +// +// Default is the same as wxUSE_XRC, i.e. 1 by default. +// +// Recommended setting: 1 (required by XRC) +#define wxUSE_XML wxUSE_XRC + +// Use wxWidget's AUI docking system +// +// Default is 1 +// +// Recommended setting: 1 +#define wxUSE_AUI 0 + + +// Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced +// 2D drawing API. (Still somewhat experimental) +// +// Please note that on Windows you will need to link with gdiplus.lib (use +// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your +// application if you want it to be runnable on pre-XP systems. +// +// Default is 0 +// +// Recommended setting: 1 +#ifndef wxUSE_GRAPHICS_CONTEXT +#define wxUSE_GRAPHICS_CONTEXT 0 +#endif // ---------------------------------------------------------------------------- // Individual GUI controls @@ -460,7 +597,7 @@ // Default is 1 // // Recommended setting: 1 (may be set to 0 if you don't wxUSE_TIPWINDOW) -#define wxUSE_POPUPWIN 1 +#define wxUSE_POPUPWIN 0 // wxTipWindow allows to implement the custom tooltips, it is used by the // context help classes. Requires wxUSE_POPUPWIN. @@ -468,9 +605,9 @@ // Default is 1 // // Recommended setting: 1 (may be set to 0) -#define wxUSE_TIPWINDOW 1 +#define wxUSE_TIPWINDOW 0 -// Each of the settings below corresponds to one wxWindows control. They are +// Each of the settings below corresponds to one wxWidgets control. They are // all switched on by default but may be disabled if you are sure that your // program (including any standard dialogs it can show!) doesn't need them and // if you desperately want to save some space. If you use any of these you must @@ -479,29 +616,38 @@ // Default is 1 // // Recommended setting: 1 -#define wxUSE_BUTTON 1 // wxButton -#define wxUSE_BMPBUTTON 1 // wxBitmapButton -#define wxUSE_CALENDARCTRL 0 // wxCalendarCtrl -#define wxUSE_CHECKBOX 1 // wxCheckBox -#define wxUSE_CHECKLISTBOX 0 // wxCheckListBox (requires wxUSE_OWNER_DRAWN) -#define wxUSE_CHOICE 1 // wxChoice -#define wxUSE_COMBOBOX 1 // wxComboBox -#define wxUSE_GAUGE 0 // wxGauge -#define wxUSE_LISTBOX 1 // wxListBox -#define wxUSE_LISTCTRL 1 // wxListCtrl -#define wxUSE_RADIOBOX 1 // wxRadioBox -#define wxUSE_RADIOBTN 1 // wxRadioButton -#define wxUSE_SCROLLBAR 1 // wxScrollBar -#define wxUSE_SLIDER 0 // wxSlider -#define wxUSE_SPINBTN 1 // wxSpinButton -#define wxUSE_SPINCTRL 1 // wxSpinCtrl -#define wxUSE_STATBOX 1 // wxStaticBox -#define wxUSE_STATLINE 0 // wxStaticLine -#define wxUSE_STATTEXT 1 // wxStaticText -#define wxUSE_STATBMP 1 // wxStaticBitmap -#define wxUSE_TEXTCTRL 1 // wxTextCtrl -#define wxUSE_TOGGLEBTN 0 // requires wxButton -#define wxUSE_TREECTRL 1 // wxTreeCtrl +#define wxUSE_ANIMATIONCTRL 0 // wxAnimationCtrl +#define wxUSE_BUTTON 0 // wxButton +#define wxUSE_BMPBUTTON 0 // wxBitmapButton +#define wxUSE_CALENDARCTRL 0 // wxCalendarCtrl +#define wxUSE_CHECKBOX 0 // wxCheckBox +#define wxUSE_CHECKLISTBOX 0 // wxCheckListBox (requires wxUSE_OWNER_DRAWN) +#define wxUSE_CHOICE 0 // wxChoice +#define wxUSE_COLLPANE 0 // wxCollapsiblePane +#define wxUSE_COLOURPICKERCTRL 0 // wxColourPickerCtrl +#define wxUSE_COMBOBOX 0 // wxComboBox +#define wxUSE_DATAVIEWCTRL 0 // wxDataViewCtrl +#define wxUSE_DATEPICKCTRL 0 // wxDatePickerCtrl +#define wxUSE_DIRPICKERCTRL 0 // wxDirPickerCtrl +#define wxUSE_FILEPICKERCTRL 0 // wxFilePickerCtrl +#define wxUSE_FONTPICKERCTRL 0 // wxFontPickerCtrl +#define wxUSE_GAUGE 0 // wxGauge +#define wxUSE_HYPERLINKCTRL 0 // wxHyperlinkCtrl +#define wxUSE_LISTBOX 0 // wxListBox +#define wxUSE_LISTCTRL 0 // wxListCtrl +#define wxUSE_RADIOBOX 0 // wxRadioBox +#define wxUSE_RADIOBTN 1 // wxRadioButton +#define wxUSE_SCROLLBAR 0 // wxScrollBar +#define wxUSE_SLIDER 0 // wxSlider +#define wxUSE_SPINBTN 0 // wxSpinButton +#define wxUSE_SPINCTRL 0 // wxSpinCtrl +#define wxUSE_STATBOX 0 // wxStaticBox +#define wxUSE_STATLINE 0 // wxStaticLine +#define wxUSE_STATTEXT 0 // wxStaticText +#define wxUSE_STATBMP 0 // wxStaticBitmap +#define wxUSE_TEXTCTRL 0 // wxTextCtrl +#define wxUSE_TOGGLEBTN 0 // requires wxButton +#define wxUSE_TREECTRL 0 // wxTreeCtrl // Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR // below either wxStatusBar95 or a generic wxStatusBar will be used. @@ -509,36 +655,29 @@ // Default is 1 // // Recommended setting: 1 -#define wxUSE_STATUSBAR 1 +#define wxUSE_STATUSBAR 0 // Two status bar implementations are available under Win32: the generic one // or the wrapper around native control. For native look and feel the native // version should be used. // -// Default is 1. +// Default is 1 for the platforms where native status bar is supported. // // Recommended setting: 1 (there is no advantage in using the generic one) -#define wxUSE_NATIVE_STATUSBAR 1 +#define wxUSE_NATIVE_STATUSBAR 0 // wxToolBar related settings: if wxUSE_TOOLBAR is 0, don't compile any toolbar // classes at all. Otherwise, use the native toolbar class unless -// wxUSE_TOOLBAR_NATIVE is 0. Additionally, the generic toolbar class which -// supports some features which might not be supported by the native wxToolBar -// class may be compiled in if wxUSE_TOOLBAR_SIMPLE is 1. +// wxUSE_TOOLBAR_NATIVE is 0. // // Default is 1 for all settings. // -// Recommended setting: 1 for wxUSE_TOOLBAR and wxUSE_TOOLBAR_NATIVE and 0 for -// wxUSE_TOOLBAR_SIMPLE (the default is 1 mainly for backwards compatibility). +// Recommended setting: 1 for wxUSE_TOOLBAR and wxUSE_TOOLBAR_NATIVE. #define wxUSE_TOOLBAR 0 #define wxUSE_TOOLBAR_NATIVE 0 -#define wxUSE_TOOLBAR_SIMPLE 0 - -// this setting is obsolete, value is ignored -#define wxUSE_BUTTONBAR 0 // wxNotebook is a control with several "tabs" located on one of its sides. It -// may be used ot logically organise the data presented to the user instead of +// may be used to logically organise the data presented to the user instead of // putting everything in one huge dialog. It replaces wxTabControl and related // classes of wxWin 1.6x. // @@ -547,6 +686,38 @@ // Recommended setting: 1 #define wxUSE_NOTEBOOK 0 +// wxListbook control is similar to wxNotebook but uses wxListCtrl instead of +// the tabs +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_LISTBOOK 0 + +// wxChoicebook control is similar to wxNotebook but uses wxChoice instead of +// the tabs +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_CHOICEBOOK 0 + +// wxTreebook control is similar to wxNotebook but uses wxTreeCtrl instead of +// the tabs +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_TREEBOOK 0 + +// wxToolbook control is similar to wxNotebook but uses wxToolBar instead of +// tabs +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_TOOLBOOK 0 + // wxTabDialog is a generic version of wxNotebook but it is incompatible with // the new class. It shouldn't be used in new code. // @@ -555,30 +726,56 @@ // Recommended setting: 0 (use wxNotebook) #define wxUSE_TAB_DIALOG 0 -// wxGrid class comes in two flavours: the original (pre wxWin 2.2) one and -// the new, much imporved and enhanced version. The new version is backwards -// compatible with the old one and should be used whenever possible, i.e. if -// you set wxUSE_GRID to 1, set wxUSE_NEW_GRID to 1 too. +// wxGrid class // -// Default is 1 for both options. +// Default is 1, set to 0 to cut down compilation time and binaries size if you +// don't use it. // -// Recommended setting: 1 for wxUSE_NEW_GRID, 0 if you have an old code using -// wxGrid and 100% backwards compatibality (with all old wxGrid quirks) is -// essential. +// Recommended setting: 1 // -// WIN16/BC++ resets wxUSE_NEW_GRID to 0 because it exceeds the data limit. #define wxUSE_GRID 0 -#define wxUSE_NEW_GRID 0 -// wxProperty[Value/Form/List] classes, used by Dialog Editor -#define wxUSE_PROPSHEET 0 +// wxMiniFrame class: a frame with narrow title bar +// +// Default is 1. +// +// Recommended setting: 1 (it doesn't cost almost anything) +#define wxUSE_MINIFRAME 0 + +// wxComboCtrl and related classes: combobox with custom popup window and +// not necessarily a listbox. +// +// Default is 1. +// +// Recommended setting: 1 but can be safely set to 0 except for wxUniv where it +// it used by wxComboBox +#define wxUSE_COMBOCTRL 0 + +// wxOwnerDrawnComboBox is a custom combobox allowing to paint the combobox +// items. +// +// Default is 1. +// +// Recommended setting: 1 but can be safely set to 0, except where it is +// needed as a base class for generic wxBitmapComboBox. +#define wxUSE_ODCOMBOBOX 0 + +// wxBitmapComboBox is a combobox that can have images in front of text items. +// +// Default is 1. +// +// Recommended setting: 1 but can be safely set to 0 +#define wxUSE_BITMAPCOMBOBOX 0 // ---------------------------------------------------------------------------- // Miscellaneous GUI stuff // ---------------------------------------------------------------------------- // wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) -#define wxUSE_ACCEL 1 +#define wxUSE_ACCEL 0 + +// Hotkey support (currently Windows only) +#define wxUSE_HOTKEY 0 // Use wxCaret: a class implementing a "cursor" in a text control (called caret // under Windows). @@ -586,7 +783,16 @@ // Default is 1. // // Recommended setting: 1 (can be safely set to 0, not used by the library) -#define wxUSE_CARET 1 +#define wxUSE_CARET 0 + +// Use wxDisplay class: it allows enumerating all displays on a system and +// their geometries as well as finding the display on which the given point or +// window lies. +// +// Default is 1. +// +// Recommended setting: 1 if you need it, can be safely set to 0 otherwise +#define wxUSE_DISPLAY 0 // Miscellaneous geometry code: needed for Canvas library #define wxUSE_GEOMETRY 0 @@ -598,7 +804,7 @@ // // Recommended setting: 1 (set it to 0 if you don't use any of the controls // enumerated above, then this class is mostly useless too) -#define wxUSE_IMAGLIST 1 +#define wxUSE_IMAGLIST 0 // Use wxMenu, wxMenuBar, wxMenuItem. // @@ -629,24 +835,12 @@ #define wxUSE_TOOLTIPS 0 // wxValidator class and related methods -#define wxUSE_VALIDATORS 0 - -// wxDC cacheing implementation -#define wxUSE_DC_CACHEING 0 +#define wxUSE_VALIDATORS 1 // ---------------------------------------------------------------------------- // common dialogs // ---------------------------------------------------------------------------- -// Define 1 to use generic dialogs in Windows, even though they duplicate -// native common dialog (e.g. wxColourDialog). This is mainly useful for -// testing. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_GENERIC_DIALOGS_IN_MSW 0 - // On rare occasions (e.g. using DJGPP) may want to omit common dialogs (e.g. // file selector, printer dialog). Switching this off also switches off the // printing architecture and interactive wxPrinterDC. @@ -654,7 +848,7 @@ // Default is 1 // // Recommended setting: 1 (unless it really doesn't work) -#define wxUSE_COMMON_DIALOGS 1 +#define wxUSE_COMMON_DIALOGS 0 // wxBusyInfo displays window with message when app is busy. Works in same way // as wxBusyCursor @@ -665,14 +859,14 @@ // Default is 1 // // Recommended setting: 1 (used in the library itself) -#define wxUSE_CHOICEDLG 1 +#define wxUSE_CHOICEDLG 0 // Use colour picker dialog // // Default is 1 // // Recommended setting: 1 -#define wxUSE_COLOURDLG 1 +#define wxUSE_COLOURDLG 0 // wxDirDlg class for getting a directory name from user #define wxUSE_DIRDLG 0 @@ -684,7 +878,7 @@ // Default is 1 // // Recommended setting: 1 (used in many places in the library itself) -#define wxUSE_FILEDLG 1 +#define wxUSE_FILEDLG 0 // Use find/replace dialogs. // @@ -725,6 +919,14 @@ // wizards #define wxUSE_WIZARDDLG 0 +// Compile in wxAboutBox() function showing the standard "About" dialog. +// +// Default is 1 +// +// Recommended setting: 1 but can be set to 0 to save some space if you don't +// use this function +#define wxUSE_ABOUTDLG 0 + // ---------------------------------------------------------------------------- // Metafiles support // ---------------------------------------------------------------------------- @@ -750,10 +952,21 @@ // Big GUI components // ---------------------------------------------------------------------------- +// Set to 0 to disable MDI support. +// +// Requires wxUSE_NOTEBOOK under platforms other than MSW. +// +// Default is 1. +// +// Recommended setting: 1, can be safely set to 0. +#define wxUSE_MDI 0 + // Set to 0 to disable document/view architecture -#define wxUSE_DOC_VIEW_ARCHITECTURE 1 +#define wxUSE_DOC_VIEW_ARCHITECTURE 0 // Set to 0 to disable MDI document/view architecture +// +// Requires wxUSE_MDI && wxUSE_DOC_VIEW_ARCHITECTURE #define wxUSE_MDI_ARCHITECTURE 0 // Set to 0 to disable print/preview architecture code @@ -779,8 +992,13 @@ // Recommended setting: 1 if you intend to use OpenGL, 0 otherwise #define wxUSE_GLCANVAS 0 -// wxTreeLayout class -#define wxUSE_TREELAYOUT 0 +// wxRichTextCtrl allows editing of styled text. +// +// Default is 1. +// +// Recommended setting: 1, set to 0 if you want compile a +// smaller library. +#define wxUSE_RICHTEXT 0 // ---------------------------------------------------------------------------- // Data transfer @@ -810,6 +1028,14 @@ // Recommended setting: 1 #define wxUSE_DRAG_AND_DROP 0 +// Use wxAccessible for enhanced and customisable accessibility. +// Depends on wxUSE_OLE. +// +// Default is 0. +// +// Recommended setting (at present): 0 +#define wxUSE_ACCESSIBILITY 0 + // ---------------------------------------------------------------------------- // miscellaneous settings // ---------------------------------------------------------------------------- @@ -821,47 +1047,37 @@ // // Recommended setting: 1 (the class is tiny, disabling it won't save much // space) -#define wxUSE_SNGLINST_CHECKER 1 +#define wxUSE_SNGLINST_CHECKER 0 -#define wxUSE_DRAGIMAGE 1 +#define wxUSE_DRAGIMAGE 0 -#define wxUSE_IPC 1 +#define wxUSE_IPC 0 // 0 for no interprocess comms -#define wxUSE_HELP 1 +#define wxUSE_HELP 0 // 0 for no help facility + +// Should we use MS HTML help for wxHelpController? If disabled, neither +// wxCHMHelpController nor wxBestHelpController are available. +// +// Default is 1 under MSW, 0 is always used for the other platforms. +// +// Recommended setting: 1, only set to 0 if you have trouble compiling +// wxCHMHelpController (could be a problem with really ancient compilers) #define wxUSE_MS_HTML_HELP 0 - // 0 for no MS HTML Help + // Use wxHTML-based help controller? #define wxUSE_WXHTML_HELP 0 -#define wxUSE_RESOURCES 1 +#define wxUSE_RESOURCES 0 // 0 for no wxGetResource/wxWriteResource -#define wxUSE_CONSTRAINTS 1 +#define wxUSE_CONSTRAINTS 0 // 0 for no window layout constraint system -#define wxUSE_SPLINES 1 +#define wxUSE_SPLINES 0 // 0 for no splines -#define wxUSE_XPM_IN_MSW 1 - // 0 for no XPM support in wxBitmap. - // Default is 1, as XPM is now fully - // supported this makes easier the issue - // of portable icons and bitmaps. - -#define wxUSE_IMAGE_LOADING_IN_MSW 1 - // Use dynamic DIB loading/saving code in utils/dib under MSW. -#define wxUSE_RESOURCE_LOADING_IN_MSW 1 - // Use dynamic icon/cursor loading/saving code - // under MSW. - -// use wxExpr (a.k.a. PrologIO) -#define wxUSE_PROLOGIO 0 - -// Use .wxr resource mechanism (requires PrologIO library) -#define wxUSE_WX_RESOURCES 0 - -#define wxUSE_MOUSEWHEEL 1 +#define wxUSE_MOUSEWHEEL 0 // Include mouse wheel support // ---------------------------------------------------------------------------- @@ -874,10 +1090,6 @@ // Set to 1 to use font metric files in GetTextExtent #define wxUSE_AFM_FOR_POSTSCRIPT 0 -// Set to 0 to disable PostScript print/preview architecture code under Windows -// (just use Windows printing). -#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1 - // ---------------------------------------------------------------------------- // database classes // ---------------------------------------------------------------------------- @@ -892,10 +1104,10 @@ // that use the connection) should support forward only scrolling of cursors, // or both forward and backward support for backward scrolling cursors is // dependent on the data source as well as the ODBC driver being used. -#define wxODBC_FWD_ONLY_CURSORS 1 +#define wxODBC_FWD_ONLY_CURSORS 0 // Default is 0. Set to 1 to use the deprecated classes, enum types, function, -// member variables. With a setting of 1, full backward compatability with the +// member variables. With a setting of 1, full backward compatibility with the // 2.0.x release is possible. It is STRONGLY recommended that this be set to 0, // as future development will be done only on the non-deprecated // functions/classes/member variables/etc. @@ -914,7 +1126,9 @@ #define REMOVE_UNUSED_ARG 1 // VC++ 4.2 and above allows and but you can't mix -// them. Set to 1 for , 0 for +// them. Set to 1 for , 0 for . Note that VC++ 7.1 +// and later doesn't support wxUSE_IOSTREAMH == 1 and so will be +// used anyhow. // // Default is 1. // @@ -945,6 +1159,9 @@ // Set to 1 for TIFF format support (requires libtiff) #define wxUSE_LIBTIFF 0 +// Set to 1 for TGA format support (loading only) +#define wxUSE_TGA 0 + // Set to 1 for GIF format support #define wxUSE_GIF 1 @@ -961,16 +1178,52 @@ #define wxUSE_XPM 0 // Set to 1 for MS Icons and Cursors format support -#define wxUSE_ICO_CUR 1 +#define wxUSE_ICO_CUR 0 // Set to 1 to compile in wxPalette class -#define wxUSE_PALETTE 1 +#define wxUSE_PALETTE 0 + +// ---------------------------------------------------------------------------- +// wxUniversal-only options +// ---------------------------------------------------------------------------- + +// Set to 1 to enable compilation of all themes, this is the default +#define wxUSE_ALL_THEMES 0 + +// Set to 1 to enable the compilation of individual theme if wxUSE_ALL_THEMES +// is unset, if it is set these options are not used; notice that metal theme +// uses Win32 one +#define wxUSE_THEME_GTK 0 +#define wxUSE_THEME_METAL 0 +#define wxUSE_THEME_MONO 0 +#define wxUSE_THEME_WIN32 0 + + +/* --- end common options --- */ // ---------------------------------------------------------------------------- // Windows-only settings // ---------------------------------------------------------------------------- -// Set this to 1 if you want to use wxWindows and MFC in the same program. This +// Set wxUSE_UNICODE_MSLU to 1 if you're compiling wxWidgets in Unicode mode +// and want to run your programs under Windows 9x and not only NT/2000/XP. +// This setting enables use of unicows.dll from MSLU (MS Layer for Unicode, see +// http://www.microsoft.com/globaldev/handson/dev/mslu_announce.mspx). Note +// that you will have to modify the makefiles to include unicows.lib import +// library as the first library (see installation instructions in install.txt +// to learn how to do it when building the library or samples). +// +// If your compiler doesn't have unicows.lib, you can get a version of it at +// http://libunicows.sourceforge.net +// +// Default is 0 +// +// Recommended setting: 0 (1 if you want to deploy Unicode apps on 9x systems) +#ifndef wxUSE_UNICODE_MSLU + #define wxUSE_UNICODE_MSLU 0 +#endif + +// Set this to 1 if you want to use wxWidgets and MFC in the same program. This // will override some other settings (see below) // // Default is 0. @@ -985,32 +1238,42 @@ // Default is 1. // // Recommended setting: 1 -#define wxUSE_OLE 1 +#define wxUSE_OLE 0 -// Set this to 1 to use Microsoft CTL3D library for "3D-look" under Win16 or NT -// 3.x. This setting is ignored under Win9x and NT 4.0+. +// Set this to 1 to enable wxAutomationObject class. // -// Default is 0 for (most) Win32 (systems), 1 for Win16 +// Default is 1. // -// Recommended setting: same as default -#if defined(__WIN95__) -#define wxUSE_CTL3D 0 -#else -#define wxUSE_CTL3D 1 -#endif +// Recommended setting: 1 if you need to control other applications via OLE +// Automation, can be safely set to 0 otherwise +#define wxUSE_OLE_AUTOMATION 0 -// Define as 1 to use Microsoft's ItsyBitsy small title bar library, for -// wxMiniFrame. This setting is only used for Win3.1; Win9x and NT use native -// miniframes support instead. +// Set this to 1 to enable wxActiveXContainer class allowing to embed OLE +// controls in wx. // -// Default is 0 for (most) Win32 (systems), 1 for Win16 +// Default is 1. // -// Recommended setting: same as default -#if defined(__WIN95__) -#define wxUSE_ITSY_BITSY 0 -#else -#define wxUSE_ITSY_BITSY 1 -#endif +// Recommended setting: 1, required by wxMediaCtrl +#define wxUSE_ACTIVEX 0 + +// wxDC cacheing implementation +#define wxUSE_DC_CACHEING 0 + +// Set this to 1 to enable the use of DIB's for wxBitmap to support +// bitmaps > 16MB on Win95/98/Me. Set to 0 to use DDB's only. +#define wxUSE_DIB_FOR_BITMAP 0 + +// Set this to 1 to enable wxDIB class used internally for manipulating +// wxBitmao data. +// +// Default is 1, set it to 0 only if you don't use wxImage neither +// +// Recommended setting: 1 (without it conversion to/from wxImage won't work) +#define wxUSE_WXDIB 1 + +// Set to 0 to disable PostScript print/preview architecture code under Windows +// (just use Windows printing). +#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0 // Set this to 1 to use RICHEDIT controls for wxTextCtrl with style wxTE_RICH // which allows to put more than ~32Kb of text in it even under Win9x (NT @@ -1020,17 +1283,14 @@ // // Recommended setting: 1, only set it to 0 if your compiler doesn't have // or can't compile -#if defined(__WIN95__) && !defined(__TWIN32__) && !defined(__GNUWIN32_OLD__) -#define wxUSE_RICHEDIT 1 - -// TODO: This should be ifdef'ed for any compilers that don't support -// RichEdit 2.0 but do have RichEdit 1.0... -#define wxUSE_RICHEDIT2 1 - -#else #define wxUSE_RICHEDIT 0 + +// Set this to 1 to use extra features of richedit v2 and later controls +// +// Default is 1 for compilers which support it +// +// Recommended setting: 1 #define wxUSE_RICHEDIT2 0 -#endif // Set this to 1 to enable support for the owner-drawn menu and listboxes. This // is required by wxUSE_CHECKLISTBOX. @@ -1040,6 +1300,40 @@ // Recommended setting: 1, set to 0 for a small library size reduction #define wxUSE_OWNER_DRAWN 0 +// Set to 1 to compile MS Windows XP theme engine support +#define wxUSE_UXTHEME 0 + +// Set to 1 to auto-adapt to MS Windows XP themes where possible +// (notably, wxNotebook pages) +#define wxUSE_UXTHEME_AUTO 0 + +// Set to 1 to use InkEdit control (Tablet PC), if available +#define wxUSE_INKEDIT 0 + +// ---------------------------------------------------------------------------- +// Generic versions of native controls +// ---------------------------------------------------------------------------- + +// Set this to 1 to be able to use wxDatePickerCtrlGeneric in addition to the +// native wxDatePickerCtrl +// +// Default is 0. +// +// Recommended setting: 0, this is mainly used for testing +#define wxUSE_DATEPICKCTRL_GENERIC 0 + +// ---------------------------------------------------------------------------- +// Crash debugging helpers +// ---------------------------------------------------------------------------- + +// Set this to 1 to be able to use wxCrashReport::Generate() to create mini +// dumps of your program when it crashes (or at any other moment) +// +// Default is 1 if supported by the compiler (VC++ and recent BC++ only). +// +// Recommended setting: 1, set to 0 if your programs never crash +#define wxUSE_CRASHREPORT 0 + // ---------------------------------------------------------------------------- // obsolete settings // ---------------------------------------------------------------------------- @@ -1047,190 +1341,8 @@ // NB: all settings in this section are obsolete and should not be used/changed // at all, they will disappear -// Set to 1 to use PenWindows -#define wxUSE_PENWINDOWS 0 - // Define 1 to use bitmap messages. -#define wxUSE_BITMAP_MESSAGE 1 +#define wxUSE_BITMAP_MESSAGE 0 -// If 1, enables provision of run-time type information. -// NOW MANDATORY: don't change. -#define wxUSE_DYNAMIC_CLASSES 1 +#endif // _WX_SETUP_H_ -// ---------------------------------------------------------------------------- -// disable the settings which don't work for some compilers -// ---------------------------------------------------------------------------- - -#ifndef wxUSE_NORLANDER_HEADERS -#if (defined(__MINGW32__) || defined(__CYGWIN__)) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))) -# define wxUSE_NORLANDER_HEADERS 1 -#else -# define wxUSE_NORLANDER_HEADERS 0 -#endif -#endif - -// wxUSE_DEBUG_NEW_ALWAYS doesn't work with CodeWarrior -#if defined(__MWERKS__) - #undef wxUSE_DEBUG_NEW_ALWAYS - #define wxUSE_DEBUG_NEW_ALWAYS 0 -#endif - -#if defined(__GNUWIN32__) -// These don't work as expected for mingw32 and cygwin32 -#undef wxUSE_MEMORY_TRACING -#define wxUSE_MEMORY_TRACING 0 - -#undef wxUSE_GLOBAL_MEMORY_OPERATORS -#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 - -#undef wxUSE_DEBUG_NEW_ALWAYS -#define wxUSE_DEBUG_NEW_ALWAYS 0 - -// Cygwin betas don't have wcslen -#if defined(__CYGWIN__) || defined(__CYGWIN32__) -# if ! ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))) -# undef wxUSE_WCHAR_T -# define wxUSE_WCHAR_T 0 -# endif -#endif - -#endif // __GNUWIN32__ - -// MFC duplicates these operators -#if wxUSE_MFC -#undef wxUSE_GLOBAL_MEMORY_OPERATORS -#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 - -#undef wxUSE_DEBUG_NEW_ALWAYS -#define wxUSE_DEBUG_NEW_ALWAYS 0 -#endif // wxUSE_MFC - -#if (!defined(WIN32) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS) -// Can't use OLE drag and drop in Windows 3.1 because we don't know how -// to implement UUIDs -// GnuWin32 doesn't have appropriate headers for e.g. IUnknown. -#undef wxUSE_DRAG_AND_DROP -#define wxUSE_DRAG_AND_DROP 0 -#endif - -// Only WIN32 supports wxStatusBar95 -#if !defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR -#undef wxUSE_NATIVE_STATUSBAR -#define wxUSE_NATIVE_STATUSBAR 0 -#endif - -#if !wxUSE_OWNER_DRAWN -#undef wxUSE_CHECKLISTBOX -#define wxUSE_CHECKLISTBOX 0 -#endif - -// Salford C++ doesn't like some of the memory operator definitions -#ifdef __SALFORDC__ -#undef wxUSE_MEMORY_TRACING -#define wxUSE_MEMORY_TRACING 0 - -#undef wxUSE_GLOBAL_MEMORY_OPERATORS -#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 - -#undef wxUSE_DEBUG_NEW_ALWAYS -#define wxUSE_DEBUG_NEW_ALWAYS 0 - -#undef wxUSE_THREADS -#define wxUSE_THREADS 0 - -#undef wxUSE_OWNER_DRAWN -#define wxUSE_OWNER_DRAWN 0 -#endif // __SALFORDC__ - -#ifdef __TWIN32__ - -#undef wxUSE_THREADS -#define wxUSE_THREADS 0 - -#undef wxUSE_ODBC -#define wxUSE_ODBC 0 - -#endif // __TWIN32__ - -// BC++/Win16 can't cope with the amount of data in resource.cpp -#if defined(__WIN16__) && defined(__BORLANDC__) -#undef wxUSE_WX_RESOURCES -#define wxUSE_WX_RESOURCES 0 - -#undef wxUSE_ODBC -#define wxUSE_ODBC 0 - -#undef wxUSE_NEW_GRID -#define wxUSE_NEW_GRID 0 -#endif - -#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) -// BC++ 4.0 can't compile JPEG library -#undef wxUSE_LIBJPEG -#define wxUSE_LIBJPEG 0 -#endif - -// wxUSE_DEBUG_NEW_ALWAYS = 1 not compatible with BC++ in DLL mode -#if defined(__BORLANDC__) && (defined(WXMAKINGDLL) || defined(WXUSINGDLL)) -#undef wxUSE_DEBUG_NEW_ALWAYS -#define wxUSE_DEBUG_NEW_ALWAYS 0 -#endif - -#if defined(__WXMSW__) && defined(__WATCOMC__) -/* -#undef wxUSE_GLCANVAS -#define wxUSE_GLCANVAS 0 -*/ - -#undef wxUSE_WCHAR_T -#define wxUSE_WCHAR_T 0 -#endif - -#if defined(__WXMSW__) && !defined(__WIN32__) - -#undef wxUSE_SOCKETS -#define wxUSE_SOCKETS 0 - -#undef wxUSE_THREADS -#define wxUSE_THREADS 0 - -#undef wxUSE_TOOLTIPS -#define wxUSE_TOOLTIPS 0 - -#undef wxUSE_SPINCTRL -#define wxUSE_SPINCTRL 0 - -#undef wxUSE_SPINBTN -#define wxUSE_SPINBTN 0 - -#undef wxUSE_LIBPNG -#define wxUSE_LIBPNG 0 - -#undef wxUSE_LIBJPEG -#define wxUSE_LIBJPEG 0 - -#undef wxUSE_LIBTIFF -#define wxUSE_LIBTIFF 0 - -#undef wxUSE_GIF -#define wxUSE_GIF 0 - -#undef wxUSE_PNM -#define wxUSE_PNM 0 - -#undef wxUSE_PCX -#define wxUSE_PCX 0 - -#undef wxUSE_GLCANVAS -#define wxUSE_GLCANVAS 0 - -#undef wxUSE_MS_HTML_HELP -#define wxUSE_MS_HTML_HELP 0 - -#undef wxUSE_WCHAR_T -#define wxUSE_WCHAR_T 0 - -#endif // Win16 - -#endif - // _WX_SETUP_H_ diff --git a/Contrib/NSIS Menu/wx/wxbuild.bat b/Contrib/NSIS Menu/wx/wxbuild.bat new file mode 100644 index 00000000..c850d0bd --- /dev/null +++ b/Contrib/NSIS Menu/wx/wxbuild.bat @@ -0,0 +1,14 @@ +if not exist %WXWIN%\build\msw\makefile.vc goto error +set OLDCD=%CD% +cd %WXWIN% +copy /y %WXWIN%\include\wx\msw\setup.h %OLDCD%\old_setup.h +copy /y %OLDCD%\setup.h %WXWIN%\include\wx\msw\setup.h +rd /S ..\..\lib\vc_libnsis +rd /S vc_mswnsis +nmake -f makefile.vc CFG=nsis BUILD=release RUNTIME_LIBS=dynamic SHARED=0 UNICODE=0 WXUNIV=0 USE_OPENGL=0 USE_ODBC=0 USE_HTML=1 USE_XRC=0 +copy /y %OLDCD%\old_setup.h %WXWIN%\include\wx\msw\setup.h +cd %OLDCD% +goto done +:error +echo WXWIN is not properly set +:done diff --git a/Menu/compiler.html b/Menu/compiler.html index 447751ab..b0083984 100644 --- a/Menu/compiler.html +++ b/Menu/compiler.html @@ -1,5 +1,5 @@ - +
diff --git a/Menu/docs.html b/Menu/docs.html index f8f062e5..1eae1af1 100644 --- a/Menu/docs.html +++ b/Menu/docs.html @@ -1,5 +1,5 @@ - +
diff --git a/Menu/index.html b/Menu/index.html index fc9a289c..51c7f57c 100644 --- a/Menu/index.html +++ b/Menu/index.html @@ -1,11 +1,10 @@ - +
-

- Quick Launch

+

Quick Launch

Introduction

Compiler

Documentation

@@ -41,7 +40,7 @@
-

+

diff --git a/Menu/intro.html b/Menu/intro.html index a3364a8d..62dcdea7 100644 --- a/Menu/intro.html +++ b/Menu/intro.html @@ -1,6 +1,7 @@ - +
+
@@ -26,7 +27,8 @@
-

+

+

\ No newline at end of file diff --git a/Menu/notinstalled.html b/Menu/notinstalled.html index e5e52fbd..596fc3f3 100644 --- a/Menu/notinstalled.html +++ b/Menu/notinstalled.html @@ -1,5 +1,5 @@ - +
@@ -20,7 +20,8 @@
-

+

+

\ No newline at end of file diff --git a/Menu/update.html b/Menu/update.html index 35b44114..f44773e3 100644 --- a/Menu/update.html +++ b/Menu/update.html @@ -1,5 +1,5 @@ - +
diff --git a/Menu/websites.html b/Menu/websites.html index 1d1a80c5..d8cfa21f 100644 --- a/Menu/websites.html +++ b/Menu/websites.html @@ -1,5 +1,5 @@ - +
diff --git a/SConstruct b/SConstruct index 6f70f770..43d9a493 100644 --- a/SConstruct +++ b/SConstruct @@ -1,11 +1,3 @@ -## TODO -# -# * Write SConscript for NSIS Menu -# - Use inheritance instead of current wxWidgets patches -# - Compile for POSIX too? wxWidgets is cross platform after all... -# -## - EnsurePythonVersion(1,6) try: @@ -510,12 +502,15 @@ def BuildUtil(target, source, libs, entry = None, res = None, resources = None, defines = None, flags = None, nodeflib = False, file_name = '', path='', contrib = False, examples = None, docs = None, cross_platform = False, - root_util = False): + root_util = False, libpath = [], incpath = []): if not cross_platform: env = util_env.Clone() else: env = cp_util_env.Clone() + env.Append(CPPPATH = incpath) + env.Append(LIBPATH = libpath) + AddEnvStandardFlags(env, defines, flags, entry, nodeflib) AppendRES(env, source, res, resources)