]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxGetInstallPrefix() instead of wxINSTALL_PREFIX (makes relocatable packages...
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 26 Sep 2001 22:17:05 +0000 (22:17 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 26 Sep 2001 22:17:05 +0000 (22:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11701 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/utils.h
src/common/utilscmn.cpp
src/generic/dcpsg.cpp

index 02358570769f076e30cf8a81f67c4d8a177eaab5..a737731cace3befbc23e959df69cb6e466dca3dd 100644 (file)
@@ -86,6 +86,10 @@ WXDLLEXPORT int wxGetOsVersion(int *majorVsn = (int *) NULL,
 // Return a string with the current date/time
 WXDLLEXPORT wxString wxNow();
 
+// Return path where wxWindows is installed (mostly useful in Unices)
+WXDLLEXPORT const wxChar *wxGetInstallPrefix();
+
+
 #if wxUSE_GUI
 // Don't synthesize KeyUp events holding down a key and producing
 // KeyDown events with autorepeat. On by default and always on
index f9f3116ca3e0ab958acea3b01aea9fdd09e105d5..a294d53d5d93220762cfef3c11b234876d671fc3 100644 (file)
@@ -1072,6 +1072,21 @@ bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) )
 
 #endif // wxUSE_GUI
 
+const wxChar *wxGetInstallPrefix()
+{
+    wxString prefix;
+    
+    if ( wxGetEnv(wxT("WX_PREFIX"), &prefix) )
+        return prefix.c_str();
+    
+#ifdef wxINSTALL_PREFIX
+    return wxT(wxINSTALL_PREFIX);
+#else 
+    return wxT("");
+#endif
+}
+
+
 // ----------------------------------------------------------------------------
 // network and user id functions
 // ----------------------------------------------------------------------------
index 73ee7231f032540927894482e562fe69d4b6f2b7..701c26e46f863c380c168e4a1bdebfd23621433f 100644 (file)
@@ -2034,7 +2034,7 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
            - afmFile = fopen() may fail and in that case the next if branch
            MUST be executed - and it would not if there was "else" */
         {
-           afmName = wxINSTALL_PREFIX;
+           afmName = wxGetInstallPrefix();
            afmName <<  wxFILE_SEP_PATH
                    << wxT("share") << wxFILE_SEP_PATH
                    << wxT("wx") << wxFILE_SEP_PATH