-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathutils.h
37 lines (29 loc) · 1.1 KB
/
utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/////////////////////////////////////////////////////////////////////////////
// Name: utils.h
// Purpose: Utils and tools file
// Author: Imie Nazwisko <[email protected]>
// Created: 2018-01-01
// Copyright: (c) 2018 by Imie Nazwisko
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _UTILS_H_
#define _UTILS_H_
#include <wx/stdpaths.h>
// Ustawienia
#define _INSTALATOR_ 0 // Kompilacja pod instalator lub pakiet instalacyjny
//---------------------------------------------------------------------------
// Funkcja zwraca ścieżkę do pliku programu w zależności od platformy
// i scenariusza kompilacji
//---------------------------------------------------------------------------
wxString wxGetAppFile(wxString file)
{
wxString path = wxPathOnly(wxStandardPaths::Get().GetExecutablePath());
#if _INSTALATOR_ && defined (__WXGTK__)
path = wxStandardPaths::Get().GetDataDir();
#endif
path = path + wxT("/") + file;
path.Replace("\\","/",true);
path.Replace("//","/",true);
return path;
}
#endif