partially fixed bug #1672315: NSIS Menu not portable to Linux wxGTK

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4983 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
pabs3 2007-03-08 01:47:14 +00:00
parent 140845e1bb
commit 4580795d2f
3 changed files with 25 additions and 19 deletions

View file

@ -46,17 +46,13 @@ Import('BuildUtil env')
import os import os
from os.path import join from os.path import join
if os.environ.has_key('WXWIN'): if env['PLATFORM'] != 'win32' or os.environ.has_key('WXWIN'):
# directories
wxlib = [join(os.environ['WXWIN'], 'lib', 'vc_libnsis')]
wxinc = [
join(os.environ['WXWIN'], 'include'),
join(os.environ['WXWIN'], 'lib', 'vc_libnsis', 'msw')
]
# build # build
if env['PLATFORM'] != 'win32':
rc = libs = []
nsis_menu = BuildUtil( nsis_menu = BuildUtil(
target, target,
files, files,
@ -64,13 +60,22 @@ if os.environ.has_key('WXWIN'):
res = rc, res = rc,
resources = resources, resources = resources,
flags = ['$MSVCRT_FLAG', '$EXCEPTION_FLAG'], flags = ['$MSVCRT_FLAG', '$EXCEPTION_FLAG'],
root_util = True root_util = True,
cross_platform = True
) )
# set directories # set directories
if nsis_menu[0].env['PLATFORM'] == 'win32':
wxlib = [join(os.environ['WXWIN'], 'lib', 'vc_libnsis')]
wxinc = [
join(os.environ['WXWIN'], 'include'),
join(os.environ['WXWIN'], 'lib', 'vc_libnsis', 'msw')
]
nsis_menu[0].env.Append(LIBPATH = wxlib) nsis_menu[0].env.Append(LIBPATH = wxlib)
nsis_menu[0].env.Append(CPPPATH = wxinc) nsis_menu[0].env.Append(CPPPATH = wxinc)
else:
nsis_menu[0].env.ParseConfig('wx-config --cxxflags --libs')
# install menu files # install menu files

View file

@ -100,7 +100,7 @@ private:
// Create the main application window // Create the main application window
MyFrame *frame = new MyFrame(_("NSIS Menu"), MyFrame *frame = new MyFrame(_("NSIS Menu"),
wxPoint(50, 50), wxSize(600 + GetSystemMetrics(SM_CXDLGFRAME), 382 + GetSystemMetrics(SM_CYDLGFRAME))); wxPoint(50, 50), wxSize(600 + wxSystemSettings::GetMetric(wxSYS_FRAMESIZE_X), 382 + wxSystemSettings::GetMetric(wxSYS_FRAMESIZE_X)));
// Show it and tell the application that it's our main window // Show it and tell the application that it's our main window
@ -133,7 +133,7 @@ private:
wxSize DialogSize(1000, 1000); wxSize DialogSize(1000, 1000);
DialogSize = UnitConvert.ConvertDialogToPixels(DialogSize); DialogSize = UnitConvert.ConvertDialogToPixels(DialogSize);
int fonts[7] = {0, 0, 14000 / (DialogSize.GetWidth()), 19000 / (DialogSize.GetWidth()), 0, 0, 0}; int fonts[7] = {0, 0, 14000 / (DialogSize.GetWidth()), 19000 / (DialogSize.GetWidth()), 0, 0, 0};
m_Html->SetFonts("", "", fonts); m_Html->SetFonts(wxString(), wxString(), fonts);
m_Html->LoadPage(wxT("Menu/index.html")); m_Html->LoadPage(wxT("Menu/index.html"));
@ -149,10 +149,10 @@ void MyFrame::OnLink(wxHtmlLinkEvent& event)
if (e == NULL || e->LeftUp()) if (e == NULL || e->LeftUp())
{ {
const wxString href = event.GetLinkInfo().GetHref(); const wxString href = event.GetLinkInfo().GetHref();
if (href.Left(3).IsSameAs("EX:", false)) if (href.Left(3).IsSameAs((const wxChar*)"EX:", false))
{ {
wxString url = href.Mid(3); wxString url = href.Mid(3);
if (url.Left(7).IsSameAs("http://", false) || url.Left(6).IsSameAs("irc://", false)) if (url.Left(7).IsSameAs((const wxChar*)"http://", false) || url.Left(6).IsSameAs((const wxChar*)"irc://", false))
{ {
::wxLaunchDefaultBrowser(url); ::wxLaunchDefaultBrowser(url);
} }
@ -171,3 +171,4 @@ void MyFrame::OnLink(wxHtmlLinkEvent& event)
} }
} }
} }

View file

@ -2,7 +2,7 @@
// Name: src/html/m_links.cpp // Name: src/html/m_links.cpp
// Purpose: wxHtml module for links & anchors // Purpose: wxHtml module for links & anchors
// Author: Vaclav Slavik // Author: Vaclav Slavik
// RCS-ID: $Id: m_links.cpp,v 1.18 2006/04/18 08:11:25 ABX Exp $ // RCS-ID: $Id: nslinks.cpp,v 1.1 2007/02/24 18:57:09 kichik Exp $
// Copyright: (c) 1999 Vaclav Slavik // Copyright: (c) 1999 Vaclav Slavik
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@ -60,10 +60,10 @@ TAG_HANDLER_BEGIN(A, "A")
wxColour colour = m_WParser->GetLinkColor(); wxColour colour = m_WParser->GetLinkColor();
wxHtmlLinkInfo linkInfo(name, target); wxHtmlLinkInfo linkInfo(name, target);
if (name.Left(3).IsSameAs("EX:", false)) if (name.Left(3).IsSameAs((const wxChar*)"EX:", false))
{ {
wxString url = name.Mid(3); wxString url = name.Mid(3);
if (!url.Left(7).IsSameAs("http://", false) && !url.Left(6).IsSameAs("irc://", false)) if (!url.Left(7).IsSameAs((const wxChar*)"http://", false) && !url.Left(6).IsSameAs((const wxChar*)"irc://", false))
{ {
wxString exePath = wxStandardPaths::Get().GetExecutablePath(); wxString exePath = wxStandardPaths::Get().GetExecutablePath();
wxString path = ::wxPathOnly(exePath); wxString path = ::wxPathOnly(exePath);