// ridiculously enough, this will replace DirExists with wxDirExists etc
#include "wx/filefn.h"
+#include "wx/datetime.h"
// ----------------------------------------------------------------------------
// constants
bool DirExists();
static bool DirExists( const wxString &dir );
+ // Well, get modification time with sec resolution
+ wxDateTime GetModificationTime();
+
// VZ: also need: IsDirWritable(), IsFileExecutable() &c (TODO)
// various file/dir operations
#include "wx/msw/winundef.h"
#endif
+// at least some of these are required for file mod time
+#ifdef __WXGTK__
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <pwd.h>
+#ifndef __VMS
+# include <grp.h>
+#endif
+# include <time.h>
+#include <unistd.h>
+#endif
+
// ============================================================================
// implementation
// ============================================================================
return ::wxDirExists( dir );
}
+wxDateTime wxFileName::GetModificationTime()
+{
+#ifdef __WXGTK__
+ struct stat buff;
+ stat( GetFullName().fn_str(), &buff );
+
+#if !defined( __EMX__ ) && !defined(__VMS)
+ struct stat lbuff;
+ lstat( GetFullName().fn_str(), &lbuff );
+ struct tm *t = localtime( &lbuff.st_mtime );
+#else
+ struct tm *t = localtime( &buff.st_mtime );
+#endif
+
+ wxDateTime ret( t->tm_mday, (wxDateTime::Month)t->tm_mon, t->tm_year+1900, t->tm_hour, t->tm_min, t->tm_sec );
+#else
+
+ wxDateTime ret = wxDateTime::Now();
+
+#endif
+ return ret;
+}
+
// ----------------------------------------------------------------------------
// CWD and HOME stuff
// ----------------------------------------------------------------------------
if (multi_line)
gtk_widget_show(m_text);
- /* we want to be notified about text changes */
- gtk_signal_connect( GTK_OBJECT(m_text), "changed",
- GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
-
if (multi_line)
{
gtk_signal_connect(GTK_OBJECT(GTK_TEXT(m_text)->vadj), "changed",
gtk_text_set_editable( GTK_TEXT(m_text), 1 );
}
+ /* we want to be notified about text changes */
+ gtk_signal_connect( GTK_OBJECT(m_text), "changed",
+ GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
+
SetBackgroundColour( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW) );
SetForegroundColour( parent->GetForegroundColour() );
if (multi_line)
gtk_widget_show(m_text);
- /* we want to be notified about text changes */
- gtk_signal_connect( GTK_OBJECT(m_text), "changed",
- GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
-
if (multi_line)
{
gtk_signal_connect(GTK_OBJECT(GTK_TEXT(m_text)->vadj), "changed",
gtk_text_set_editable( GTK_TEXT(m_text), 1 );
}
+ /* we want to be notified about text changes */
+ gtk_signal_connect( GTK_OBJECT(m_text), "changed",
+ GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
+
SetBackgroundColour( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW) );
SetForegroundColour( parent->GetForegroundColour() );