Added wxFileName.
Small fix for log error messages on startup. Added missing accessor to wxSizer. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9013 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -135,6 +135,7 @@ ffile.cpp C B
|
|||||||
file.cpp C B
|
file.cpp C B
|
||||||
fileconf.cpp C B
|
fileconf.cpp C B
|
||||||
filefn.cpp C B
|
filefn.cpp C B
|
||||||
|
filename.cpp C B
|
||||||
filesys.cpp C B
|
filesys.cpp C B
|
||||||
fontcmn.cpp C
|
fontcmn.cpp C
|
||||||
fontmap.cpp C B
|
fontmap.cpp C B
|
||||||
@@ -603,6 +604,7 @@ file.h W B
|
|||||||
fileconf.h W B
|
fileconf.h W B
|
||||||
filedlg.h W
|
filedlg.h W
|
||||||
filefn.h W B
|
filefn.h W B
|
||||||
|
filename.h W B
|
||||||
filesys.h W B
|
filesys.h W B
|
||||||
font.h W
|
font.h W
|
||||||
fontdlg.h W
|
fontdlg.h W
|
||||||
|
110
include/wx/filename.h
Normal file
110
include/wx/filename.h
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: filename.h
|
||||||
|
// Purpose: wxFileName - encapsulates ice cream
|
||||||
|
// Author: Robert Roebling
|
||||||
|
// Modified by:
|
||||||
|
// Created: 28.12.00
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 2000 Robert Roebling
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_FILENAME_H_
|
||||||
|
#define _WX_FILENAME_H_
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma interface "filename.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/string.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ridiculously enough, this will replace DirExists with wxDirExists etc
|
||||||
|
#include "filefn.h"
|
||||||
|
|
||||||
|
enum wxPathFormat
|
||||||
|
{
|
||||||
|
wxPATH_NATIVE = 0,
|
||||||
|
wxPATH_UNIX,
|
||||||
|
wxPATH_MAC,
|
||||||
|
wxPATH_DOS,
|
||||||
|
|
||||||
|
wxPATH_BEOS = wxPATH_UNIX,
|
||||||
|
wxPATH_WIN = wxPATH_DOS,
|
||||||
|
wxPATH_OS2 = wxPATH_DOS
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxFileName
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// constructors and assignment
|
||||||
|
wxFileName()
|
||||||
|
{ }
|
||||||
|
wxFileName( const wxFileName &filename );
|
||||||
|
wxFileName( const wxString &path, bool dir_only = FALSE, wxPathFormat format = wxPATH_NATIVE )
|
||||||
|
{ Assign( path, dir_only, format ); }
|
||||||
|
void Assign( const wxString &path, bool dir_only = FALSE, wxPathFormat format = wxPATH_NATIVE );
|
||||||
|
|
||||||
|
// Only native form
|
||||||
|
bool FileExists();
|
||||||
|
bool DirExists();
|
||||||
|
|
||||||
|
void AssignCwd();
|
||||||
|
void SetCwd();
|
||||||
|
|
||||||
|
void AssignTempFileName( const wxString &prefix );
|
||||||
|
|
||||||
|
void Mkdir( int perm = 0777 );
|
||||||
|
void Rmdir();
|
||||||
|
|
||||||
|
// Remove . and .. (under Unix ~ as well)
|
||||||
|
void MakeAbsolute();
|
||||||
|
|
||||||
|
// Comparison
|
||||||
|
bool SameAs( const wxFileName &filename, bool upper_on_dos = TRUE );
|
||||||
|
|
||||||
|
// Tests
|
||||||
|
bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE );
|
||||||
|
bool IsRelative( wxPathFormat format = wxPATH_NATIVE );
|
||||||
|
bool IsAbsolute( wxPathFormat format = wxPATH_NATIVE );
|
||||||
|
bool IsWild( wxPathFormat format = wxPATH_NATIVE );
|
||||||
|
|
||||||
|
// Dir accessors
|
||||||
|
void AppendDir( const wxString &dir );
|
||||||
|
void PrependDir( const wxString &dir );
|
||||||
|
void InsertDir( int before, const wxString &dir );
|
||||||
|
void RemoveDir( int pos );
|
||||||
|
size_t GetDirCount() { return m_dirs.GetCount(); }
|
||||||
|
|
||||||
|
// Other accessors
|
||||||
|
void SetExt( const wxString &ext ) { m_ext = ext; }
|
||||||
|
wxString GetExt() const { return m_ext; }
|
||||||
|
bool HasExt() const { return !m_ext.IsEmpty(); }
|
||||||
|
|
||||||
|
void SetName( const wxString &name ) { m_name = name; }
|
||||||
|
wxString GetName() const { return m_name; }
|
||||||
|
bool HasName() const { return !m_name.IsEmpty(); }
|
||||||
|
|
||||||
|
const wxArrayString &GetDirs() const { return m_dirs; }
|
||||||
|
|
||||||
|
// Construct path only
|
||||||
|
wxString GetPath( wxPathFormat format = wxPATH_NATIVE ) const;
|
||||||
|
|
||||||
|
// Construct full path with name and ext
|
||||||
|
wxString GetFullPath( wxPathFormat format = wxPATH_NATIVE ) const;
|
||||||
|
|
||||||
|
|
||||||
|
static wxPathFormat GetFormat( wxPathFormat format = wxPATH_NATIVE );
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxArrayString m_dirs;
|
||||||
|
wxString m_name;
|
||||||
|
wxString m_ext;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif // _WX_FFILENAME_H_
|
||||||
|
|
@@ -40,78 +40,85 @@ class wxStaticBoxSizer;
|
|||||||
|
|
||||||
class WXDLLEXPORT wxSizerItem: public wxObject
|
class WXDLLEXPORT wxSizerItem: public wxObject
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(wxSizerItem);
|
|
||||||
public:
|
public:
|
||||||
// spacer
|
// spacer
|
||||||
wxSizerItem( int width, int height, int option, int flag, int border, wxObject* userData);
|
wxSizerItem( int width, int height, int option, int flag, int border, wxObject* userData);
|
||||||
|
|
||||||
// window
|
// window
|
||||||
wxSizerItem( wxWindow *window, int option, int flag, int border, wxObject* userData );
|
wxSizerItem( wxWindow *window, int option, int flag, int border, wxObject* userData );
|
||||||
|
|
||||||
// subsizer
|
// subsizer
|
||||||
wxSizerItem( wxSizer *sizer, int option, int flag, int border, wxObject* userData );
|
wxSizerItem( wxSizer *sizer, int option, int flag, int border, wxObject* userData );
|
||||||
|
|
||||||
~wxSizerItem();
|
~wxSizerItem();
|
||||||
|
|
||||||
virtual wxSize GetSize();
|
virtual wxSize GetSize();
|
||||||
virtual wxSize CalcMin();
|
virtual wxSize CalcMin();
|
||||||
virtual void SetDimension( wxPoint pos, wxSize size );
|
virtual void SetDimension( wxPoint pos, wxSize size );
|
||||||
|
|
||||||
void SetRatio( int width, int height )
|
wxSize GetMinSize()
|
||||||
// if either of dimensions is zero, ratio is assumed to be 1
|
{ return m_minSize; }
|
||||||
// to avoid "divide by zero" errors
|
|
||||||
{ m_ratio = (width && height) ? ((float) width / (float) height) : 1; }
|
|
||||||
void SetRatio( wxSize size )
|
|
||||||
{ m_ratio = (size.x && size.y) ? ((float) size.x / (float) size.y) : 1; }
|
|
||||||
void SetRatio( float ratio ) { m_ratio = ratio; }
|
|
||||||
float GetRatio() const { return m_ratio; }
|
|
||||||
|
|
||||||
bool IsWindow();
|
void SetRatio( int width, int height )
|
||||||
bool IsSizer();
|
// if either of dimensions is zero, ratio is assumed to be 1
|
||||||
bool IsSpacer();
|
// to avoid "divide by zero" errors
|
||||||
|
{ m_ratio = (width && height) ? ((float) width / (float) height) : 1; }
|
||||||
|
void SetRatio( wxSize size )
|
||||||
|
{ m_ratio = (size.x && size.y) ? ((float) size.x / (float) size.y) : 1; }
|
||||||
|
void SetRatio( float ratio )
|
||||||
|
{ m_ratio = ratio; }
|
||||||
|
float GetRatio() const
|
||||||
|
{ return m_ratio; }
|
||||||
|
|
||||||
|
bool IsWindow();
|
||||||
|
bool IsSizer();
|
||||||
|
bool IsSpacer();
|
||||||
|
|
||||||
void SetInitSize( int x, int y )
|
void SetInitSize( int x, int y )
|
||||||
{ m_minSize.x = x; m_minSize.y = y; }
|
{ m_minSize.x = x; m_minSize.y = y; }
|
||||||
void SetOption( int option )
|
void SetOption( int option )
|
||||||
{ m_option = option; }
|
{ m_option = option; }
|
||||||
void SetFlag( int flag )
|
void SetFlag( int flag )
|
||||||
{ m_flag = flag; }
|
{ m_flag = flag; }
|
||||||
void SetBorder( int border )
|
void SetBorder( int border )
|
||||||
{ m_border = border; }
|
{ m_border = border; }
|
||||||
|
|
||||||
wxWindow *GetWindow() const
|
wxWindow *GetWindow() const
|
||||||
{ return m_window; }
|
{ return m_window; }
|
||||||
void SetWindow( wxWindow *window )
|
void SetWindow( wxWindow *window )
|
||||||
{ m_window = window; }
|
{ m_window = window; }
|
||||||
wxSizer *GetSizer() const
|
wxSizer *GetSizer() const
|
||||||
{ return m_sizer; }
|
{ return m_sizer; }
|
||||||
void SetSizer( wxSizer *sizer )
|
void SetSizer( wxSizer *sizer )
|
||||||
{ m_sizer = sizer; }
|
{ m_sizer = sizer; }
|
||||||
int GetOption() const
|
int GetOption() const
|
||||||
{ return m_option; }
|
{ return m_option; }
|
||||||
int GetFlag() const
|
int GetFlag() const
|
||||||
{ return m_flag; }
|
{ return m_flag; }
|
||||||
int GetBorder() const
|
int GetBorder() const
|
||||||
{ return m_border; }
|
{ return m_border; }
|
||||||
wxObject* GetUserData()
|
wxObject* GetUserData()
|
||||||
{ return m_userData; }
|
{ return m_userData; }
|
||||||
wxPoint GetPosition()
|
wxPoint GetPosition()
|
||||||
{ return m_pos; }
|
{ return m_pos; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxWindow *m_window;
|
wxWindow *m_window;
|
||||||
wxSizer *m_sizer;
|
wxSizer *m_sizer;
|
||||||
wxSize m_size;
|
wxSize m_size;
|
||||||
wxPoint m_pos;
|
wxPoint m_pos;
|
||||||
wxSize m_minSize;
|
wxSize m_minSize;
|
||||||
int m_option;
|
int m_option;
|
||||||
int m_border;
|
int m_border;
|
||||||
int m_flag;
|
int m_flag;
|
||||||
// als: aspect ratio can always be calculated from m_size,
|
// als: aspect ratio can always be calculated from m_size,
|
||||||
// but this would cause precision loss when the window
|
// but this would cause precision loss when the window
|
||||||
// is shrinked. it is safer to preserve initial value.
|
// is shrinked. it is safer to preserve initial value.
|
||||||
float m_ratio;
|
float m_ratio;
|
||||||
wxObject *m_userData;
|
wxObject *m_userData;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_CLASS(wxSizerItem);
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
332
src/common/filename.cpp
Normal file
332
src/common/filename.cpp
Normal file
@@ -0,0 +1,332 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: filename.cpp
|
||||||
|
// Purpose: wxFileName - encapsulates candy
|
||||||
|
// Author: Robert Roebling
|
||||||
|
// Modified by:
|
||||||
|
// Created: 28.12.2000
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 2000 Robert Roebling
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma implementation "filename.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/intl.h"
|
||||||
|
#include "wx/log.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/filename.h"
|
||||||
|
#include "wx/tokenzr.h"
|
||||||
|
#include "wx/filefn.h"
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
// wxFileName
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
wxFileName::wxFileName( const wxFileName &filename )
|
||||||
|
{
|
||||||
|
m_ext = filename.GetExt();
|
||||||
|
m_name = filename.GetName();
|
||||||
|
const wxArrayString &dirs = filename.GetDirs();
|
||||||
|
for (size_t i = 0; i < dirs.GetCount(); i++)
|
||||||
|
{
|
||||||
|
m_dirs.Add( dirs[i] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFileName::Assign( const wxString &path, bool dir_only, wxPathFormat format )
|
||||||
|
{
|
||||||
|
m_ext = wxEmptyString;
|
||||||
|
m_name = wxEmptyString;
|
||||||
|
m_dirs.Clear();
|
||||||
|
|
||||||
|
format = GetFormat( format );
|
||||||
|
|
||||||
|
wxString seps;
|
||||||
|
if (format == wxPATH_DOS)
|
||||||
|
{
|
||||||
|
seps = "/\\";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (format == wxPATH_UNIX)
|
||||||
|
{
|
||||||
|
seps = "/";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
seps = "/"; // or maybe ":" or both ?
|
||||||
|
}
|
||||||
|
|
||||||
|
wxStringTokenizer tn( path, seps );
|
||||||
|
while (tn.HasMoreTokens())
|
||||||
|
{
|
||||||
|
wxString token( tn.GetNextToken() );
|
||||||
|
if (!token.IsEmpty())
|
||||||
|
m_dirs.Add( token );
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!dir_only)
|
||||||
|
{
|
||||||
|
// make last m_dir -> m_name
|
||||||
|
size_t last = m_dirs.GetCount();
|
||||||
|
if (last == 0) return;
|
||||||
|
last--;
|
||||||
|
m_name = m_dirs[last];
|
||||||
|
m_dirs.Remove( last );
|
||||||
|
|
||||||
|
if (m_name == wxT(".")) return;
|
||||||
|
if (m_name == wxT("..")) return;
|
||||||
|
|
||||||
|
// ext?
|
||||||
|
int pos = m_name.Find( wxT('.') );
|
||||||
|
if (pos == -1) return;
|
||||||
|
|
||||||
|
bool has_starting_dot = (pos == 0);
|
||||||
|
if (has_starting_dot)
|
||||||
|
{
|
||||||
|
// remove dot
|
||||||
|
m_name.Remove(0,1);
|
||||||
|
|
||||||
|
// search again
|
||||||
|
pos = m_name.Find( wxT('.') );
|
||||||
|
if (pos == -1)
|
||||||
|
{
|
||||||
|
// add dot back
|
||||||
|
m_name.Prepend( "." );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_ext = m_name;
|
||||||
|
m_ext.Remove( 0, pos+1 );
|
||||||
|
|
||||||
|
m_name.Remove( pos, m_name.Len()-pos );
|
||||||
|
|
||||||
|
if (has_starting_dot)
|
||||||
|
{
|
||||||
|
// add dot back
|
||||||
|
m_name.Prepend( "." );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxFileName::FileExists()
|
||||||
|
{
|
||||||
|
return ::wxFileExists( GetFullPath() );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxFileName::DirExists()
|
||||||
|
{
|
||||||
|
return ::wxDirExists( GetFullPath() );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFileName::AssignCwd()
|
||||||
|
{
|
||||||
|
Assign( wxGetCwd(), TRUE );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFileName::SetCwd()
|
||||||
|
{
|
||||||
|
wxSetWorkingDirectory( GetFullPath() );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFileName::AssignTempFileName( const wxString &prefix )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFileName::Mkdir( int perm )
|
||||||
|
{
|
||||||
|
wxMkdir( GetFullPath(), perm );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFileName::Rmdir()
|
||||||
|
{
|
||||||
|
wxRmdir( GetFullPath() );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFileName::MakeAbsolute()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxFileName::SameAs( const wxFileName &filename, bool upper_on_dos )
|
||||||
|
{
|
||||||
|
wxString file1( GetFullPath() );
|
||||||
|
wxString file2( filename.GetFullPath() );
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
if (upper_on_dos)
|
||||||
|
{
|
||||||
|
file1.MakeUpper();
|
||||||
|
file2.MakeUpper();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return (file1 == file2);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxFileName::IsCaseSensitive( wxPathFormat format )
|
||||||
|
{
|
||||||
|
format = GetFormat( format );
|
||||||
|
|
||||||
|
return (format != wxPATH_DOS);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxFileName::IsRelative( wxPathFormat format )
|
||||||
|
{
|
||||||
|
format = GetFormat( format );
|
||||||
|
|
||||||
|
for (size_t i = 0; i < m_dirs.GetCount(); i++)
|
||||||
|
{
|
||||||
|
if ((format == wxPATH_UNIX) && (i == 0) && (m_dirs[0] == wxT("~"))) return TRUE;
|
||||||
|
|
||||||
|
if (m_dirs[i] == wxT(".")) return TRUE;
|
||||||
|
if (m_dirs[i] == wxT("..")) return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxFileName::IsAbsolute( wxPathFormat format )
|
||||||
|
{
|
||||||
|
return (!IsRelative(format));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxFileName::IsWild( wxPathFormat format )
|
||||||
|
{
|
||||||
|
format = GetFormat( format );
|
||||||
|
|
||||||
|
if (format == wxPATH_DOS)
|
||||||
|
{
|
||||||
|
if (m_name.Find( wxT('*') ) != -1) return TRUE;
|
||||||
|
if (m_name.Find( wxT('?') ) != -1) return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (m_name.Find( wxT('*') ) != -1) return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFileName::AppendDir( const wxString &dir )
|
||||||
|
{
|
||||||
|
m_dirs.Add( dir );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFileName::PrependDir( const wxString &dir )
|
||||||
|
{
|
||||||
|
m_dirs.Insert( dir, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFileName::InsertDir( int before, const wxString &dir )
|
||||||
|
{
|
||||||
|
m_dirs.Insert( dir, before );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFileName::RemoveDir( int pos )
|
||||||
|
{
|
||||||
|
m_dirs.Remove( (size_t)pos );
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxFileName::GetPath( wxPathFormat format ) const
|
||||||
|
{
|
||||||
|
format = GetFormat( format );
|
||||||
|
|
||||||
|
wxString ret;
|
||||||
|
if (format == wxPATH_DOS)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < m_dirs.GetCount(); i++)
|
||||||
|
{
|
||||||
|
ret += m_dirs[i];
|
||||||
|
if (i != m_dirs.GetCount()-1) ret += '\\';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (format == wxPATH_DOS)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < m_dirs.GetCount(); i++)
|
||||||
|
{
|
||||||
|
ret += m_dirs[i];
|
||||||
|
if (i != m_dirs.GetCount()-1) ret += '/';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < m_dirs.GetCount(); i++)
|
||||||
|
{
|
||||||
|
ret += m_dirs[i];
|
||||||
|
if (i != m_dirs.GetCount()-1) ret += "//"; // or maybe ":" ?
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxFileName::GetFullPath( wxPathFormat format ) const
|
||||||
|
{
|
||||||
|
format = GetFormat( format );
|
||||||
|
|
||||||
|
wxString ret;
|
||||||
|
if (format == wxPATH_DOS)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < m_dirs.GetCount(); i++)
|
||||||
|
{
|
||||||
|
ret += m_dirs[i];
|
||||||
|
ret += '\\';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (format == wxPATH_DOS)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < m_dirs.GetCount(); i++)
|
||||||
|
{
|
||||||
|
ret += m_dirs[i];
|
||||||
|
ret += '/';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < m_dirs.GetCount(); i++)
|
||||||
|
{
|
||||||
|
ret += m_dirs[i];
|
||||||
|
ret += '/'; // or maybe ":" ?
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ret += m_name;
|
||||||
|
|
||||||
|
if (!m_ext.IsEmpty())
|
||||||
|
{
|
||||||
|
ret += '.';
|
||||||
|
ret += m_ext;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxPathFormat wxFileName::GetFormat( wxPathFormat format )
|
||||||
|
{
|
||||||
|
if (format == wxPATH_NATIVE)
|
||||||
|
{
|
||||||
|
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||||
|
format = wxPATH_DOS;
|
||||||
|
#endif
|
||||||
|
#if defined(__WXMAC__)
|
||||||
|
format = wxPATH_MAC;
|
||||||
|
#endif
|
||||||
|
#if !defined(__WXMSW__) && !defined(__WXPM__) && !defined(__WXMAC__)
|
||||||
|
format = wxPATH_UNIX;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
return format;
|
||||||
|
}
|
@@ -289,7 +289,8 @@ wxApp::wxApp()
|
|||||||
m_topWindow = (wxWindow *) NULL;
|
m_topWindow = (wxWindow *) NULL;
|
||||||
m_exitOnFrameDelete = TRUE;
|
m_exitOnFrameDelete = TRUE;
|
||||||
|
|
||||||
m_idleTag = gtk_idle_add_priority( 1000, wxapp_idle_callback, (gpointer) NULL );
|
m_idleTag = 0;
|
||||||
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
m_wakeUpTimerTag = 0;
|
m_wakeUpTimerTag = 0;
|
||||||
|
@@ -72,6 +72,7 @@ ALL_SOURCES = \
|
|||||||
common/file.cpp \
|
common/file.cpp \
|
||||||
common/fileconf.cpp \
|
common/fileconf.cpp \
|
||||||
common/filefn.cpp \
|
common/filefn.cpp \
|
||||||
|
common/filename.cpp \
|
||||||
common/filesys.cpp \
|
common/filesys.cpp \
|
||||||
common/fontcmn.cpp \
|
common/fontcmn.cpp \
|
||||||
common/fontmap.cpp \
|
common/fontmap.cpp \
|
||||||
@@ -296,6 +297,7 @@ ALL_HEADERS = \
|
|||||||
fileconf.h \
|
fileconf.h \
|
||||||
filedlg.h \
|
filedlg.h \
|
||||||
filefn.h \
|
filefn.h \
|
||||||
|
filename.h \
|
||||||
filesys.h \
|
filesys.h \
|
||||||
font.h \
|
font.h \
|
||||||
fontdlg.h \
|
fontdlg.h \
|
||||||
@@ -592,6 +594,7 @@ COMMONOBJS = \
|
|||||||
file.o \
|
file.o \
|
||||||
fileconf.o \
|
fileconf.o \
|
||||||
filefn.o \
|
filefn.o \
|
||||||
|
filename.o \
|
||||||
filesys.o \
|
filesys.o \
|
||||||
fontcmn.o \
|
fontcmn.o \
|
||||||
fontmap.o \
|
fontmap.o \
|
||||||
@@ -698,6 +701,7 @@ COMMONDEPS = \
|
|||||||
file.d \
|
file.d \
|
||||||
fileconf.d \
|
fileconf.d \
|
||||||
filefn.d \
|
filefn.d \
|
||||||
|
filename.d \
|
||||||
filesys.d \
|
filesys.d \
|
||||||
fontcmn.d \
|
fontcmn.d \
|
||||||
fontmap.d \
|
fontmap.d \
|
||||||
|
@@ -289,7 +289,8 @@ wxApp::wxApp()
|
|||||||
m_topWindow = (wxWindow *) NULL;
|
m_topWindow = (wxWindow *) NULL;
|
||||||
m_exitOnFrameDelete = TRUE;
|
m_exitOnFrameDelete = TRUE;
|
||||||
|
|
||||||
m_idleTag = gtk_idle_add_priority( 1000, wxapp_idle_callback, (gpointer) NULL );
|
m_idleTag = 0;
|
||||||
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
m_wakeUpTimerTag = 0;
|
m_wakeUpTimerTag = 0;
|
||||||
|
@@ -72,6 +72,7 @@ ALL_SOURCES = \
|
|||||||
common/file.cpp \
|
common/file.cpp \
|
||||||
common/fileconf.cpp \
|
common/fileconf.cpp \
|
||||||
common/filefn.cpp \
|
common/filefn.cpp \
|
||||||
|
common/filename.cpp \
|
||||||
common/filesys.cpp \
|
common/filesys.cpp \
|
||||||
common/fontcmn.cpp \
|
common/fontcmn.cpp \
|
||||||
common/fontmap.cpp \
|
common/fontmap.cpp \
|
||||||
@@ -296,6 +297,7 @@ ALL_HEADERS = \
|
|||||||
fileconf.h \
|
fileconf.h \
|
||||||
filedlg.h \
|
filedlg.h \
|
||||||
filefn.h \
|
filefn.h \
|
||||||
|
filename.h \
|
||||||
filesys.h \
|
filesys.h \
|
||||||
font.h \
|
font.h \
|
||||||
fontdlg.h \
|
fontdlg.h \
|
||||||
@@ -592,6 +594,7 @@ COMMONOBJS = \
|
|||||||
file.o \
|
file.o \
|
||||||
fileconf.o \
|
fileconf.o \
|
||||||
filefn.o \
|
filefn.o \
|
||||||
|
filename.o \
|
||||||
filesys.o \
|
filesys.o \
|
||||||
fontcmn.o \
|
fontcmn.o \
|
||||||
fontmap.o \
|
fontmap.o \
|
||||||
@@ -698,6 +701,7 @@ COMMONDEPS = \
|
|||||||
file.d \
|
file.d \
|
||||||
fileconf.d \
|
fileconf.d \
|
||||||
filefn.d \
|
filefn.d \
|
||||||
|
filename.d \
|
||||||
filesys.d \
|
filesys.d \
|
||||||
fontcmn.d \
|
fontcmn.d \
|
||||||
fontmap.d \
|
fontmap.d \
|
||||||
|
Reference in New Issue
Block a user