Removed most of user dir.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2000-11-27 11:11:12 +00:00
parent b9c6012844
commit 6491f9335e
35 changed files with 0 additions and 14546 deletions

View File

@@ -1,2 +0,0 @@
Linux
linux-gnu

View File

@@ -1,175 +0,0 @@
/*
* Program: wxConvert
*
* Author: Robert Roebling
*
* Copyright: (C) 1997, GNU (Robert Roebling)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* You may not use this program without clapping twice at every
* full hour.
*
*/
#ifdef __GNUG__
#pragma implementation "wxConvert.h"
#endif
#include "wxConvert.h"
#include "wx/textfile.h"
//-----------------------------------------------------------------------------
// main program
//-----------------------------------------------------------------------------
IMPLEMENT_APP(MyApp)
//-----------------------------------------------------------------------------
// MyFrame
//-----------------------------------------------------------------------------
const ID_QUIT = 100;
const ID_2UNIX = 101;
const ID_2DOS = 102;
const ID_2MAC = 103;
IMPLEMENT_DYNAMIC_CLASS( MyFrame, wxFrame )
BEGIN_EVENT_TABLE(MyFrame,wxFrame)
EVT_BUTTON (ID_QUIT, MyFrame::OnCommand)
EVT_BUTTON (ID_2UNIX, MyFrame::OnCommand)
EVT_BUTTON (ID_2DOS, MyFrame::OnCommand)
EVT_BUTTON (ID_2MAC, MyFrame::OnCommand)
END_EVENT_TABLE()
MyFrame::MyFrame(void) :
wxFrame( (wxFrame *) NULL, -1, (char *) "wxConvert", wxPoint(20,20), wxSize(400,160) )
{
CreateStatusBar( 1 );
SetStatusText( "wxConvert v0.1 by Robert Roebling." );
char buf[500];
wxGetWorkingDirectory( buf, 500 );
wxString s( "Dir: " );
s += buf;
m_text = new wxStaticText( this, -1, s, wxPoint(10,50), wxSize(380,-1) );
(void*)new wxButton( this, ID_QUIT, "Quit", wxPoint(10,100), wxSize(60,25) );
(void*)new wxButton( this, ID_2UNIX, "To Unix", wxPoint(180,100), wxSize(60,25) );
(void*)new wxButton( this, ID_2DOS, "To Dos", wxPoint(250,100), wxSize(60,25) );
(void*)new wxButton( this, ID_2MAC, "To Mac", wxPoint(320,100), wxSize(60,25) );
};
void MyFrame::OnCommand( wxCommandEvent &event )
{
switch (event.GetId())
{
case ID_QUIT:
Close( TRUE );
break;
case ID_2UNIX:
case ID_2DOS:
case ID_2MAC:
char buf[500];
wxGetWorkingDirectory( buf, 500 );
wxString s( buf );
Recurse( event.GetId(), s );
break;
};
};
void MyFrame::Convert( int id, const wxString &fname )
{
wxTextFile text(fname );
text.Open();
return;
switch (id)
{
case ID_2UNIX:
text.Write( wxTextFile::Type_Unix );
break;
case ID_2DOS:
text.Write( wxTextFile::Type_Dos );
break;
case ID_2MAC:
text.Write( wxTextFile::Type_Mac );
break;
};
};
void MyFrame::Recurse( int id, const wxString &curdir )
{
wxArrayString paths;
wxString search,path;
search = curdir;
search += "/*";
path = wxFindFirstFile( search, wxDIR );
while (!path.IsNull())
{
paths.Add( path ); // ref counting in action !
path = wxFindNextFile();
};
search = curdir;
search += "/*.cpp";
path = wxFindFirstFile( search, wxFILE );
while (!path.IsNull())
{
m_text->SetLabel( path );
wxYield();
Convert( id, path );
path = wxFindNextFile();
};
for (int i = 0; i < paths.Count(); i++)
{
search = paths[i];
Recurse( id, search );
};
};
//-----------------------------------------------------------------------------
// MyApp
//-----------------------------------------------------------------------------
MyApp::MyApp(void) :
wxApp( )
{
};
bool MyApp::OnInit(void)
{
wxFrame *frame = new MyFrame();
frame->Show( TRUE );
return TRUE;
};

View File

@@ -1,71 +0,0 @@
/*
* Program: wxConvert
*
* Author: Robert Roebling
*
* Copyright: (C) 1997, GNU (Robert Roebling)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __WXCONVERTH__
#define __WXCONVERTH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/wx.h"
//-----------------------------------------------------------------------------
// derived classes
//-----------------------------------------------------------------------------
class MyFrame;
class MyApp;
//-----------------------------------------------------------------------------
// MyFrame
//-----------------------------------------------------------------------------
class MyFrame: public wxFrame
{
DECLARE_DYNAMIC_CLASS(MyFrame)
public:
MyFrame(void);
void OnCommand( wxCommandEvent &event );
void Recurse( int id, const wxString &curdir );
void Convert( int id, const wxString &fname );
wxStaticText *m_text;
DECLARE_EVENT_TABLE()
};
//-----------------------------------------------------------------------------
// MyApp
//-----------------------------------------------------------------------------
class MyApp: public wxApp
{
public:
MyApp(void);
virtual bool OnInit(void);
};
#endif // __WXCONVERTH__

View File

@@ -1,2 +0,0 @@
Linux
linux-gnu

View File

@@ -1,326 +0,0 @@
/*
* Program: FMJobs.cpp
*
* Author: Robert Roebling
*
* Copyright: (C) 1997, GNU (Robert Roebling)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef __GNUG__
#pragma implementation "FMJobs.h"
#endif
#include "FMJobs.h"
#include "wx/utils.h"
#include "wx/filefn.h"
#include "wx/msgdlg.h"
//-----------------------------------------------------------------------------
// wxCopyStatusDia
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxCopyStatusDia,wxDialog);
const ID_CANCEL_COPY = 1000;
BEGIN_EVENT_TABLE(wxCopyStatusDia,wxDialog)
EVT_BUTTON (ID_CANCEL_COPY, wxCopyStatusDia::OnCommand)
END_EVENT_TABLE()
wxCopyStatusDia::wxCopyStatusDia( wxFrame *parent, const wxString &dest, wxArrayString *files ) :
wxDialog( parent, -1, "FileMaker copy job control", wxPoint(180,180), wxSize(500,200) )
{
int w = 0;
int h = 0;
GetSize( &w, &h );
m_dest = dest;
m_files = files;
m_stop = FALSE;
(void)new wxStaticText( this, -1, "Copying files", wxPoint(10,10) );
(void)new wxStaticText( this, -1, "from:", wxPoint(30,40) );
m_sourceMsg = new wxStaticText( this, -1, "", wxPoint(80,40), wxSize(200,-1) );
(void)new wxStaticText( this, -1, " to:", wxPoint(30,70) );
m_destMsg = new wxStaticText( this, -1, "", wxPoint(80,70), wxSize(200,-1) );
(void)new wxStaticText( this, -1, " Kb copied:", wxPoint(30,100) );
m_statusMsg = new wxStaticText( this, -1, "0", wxPoint(120,100), wxSize(100,-1) );
m_cancelButton = new wxButton( this, ID_CANCEL_COPY, "Return", wxPoint(w-130,h-50), wxSize(85,30) );
Centre( wxVERTICAL | wxHORIZONTAL );
m_timer = new wxCopyTimer( this );
m_timer->Start( 300, TRUE );
Show( TRUE );
};
wxCopyStatusDia::~wxCopyStatusDia()
{
delete m_timer;
};
void wxCopyStatusDia::OnCommand( wxCommandEvent &WXUNUSED(event) )
{
if (m_stop) EndModal(wxID_CANCEL);
m_stop = TRUE;
};
void wxCopyStatusDia::DoCopy(void)
{
wxYield();
if (!wxDirExists(m_dest))
{
wxMessageBox( "Target is not a directory or it doesn`t exist. Can`t copy.", "FileMaker" );
return;
};
for (uint i = 0; i < m_files->Count(); i++)
{
wxString src = (*m_files)[i];
if (wxDirExists( src ))
CopyDir( src, m_dest );
else
CopyFile( src, m_dest );
if (m_stop) return;
};
m_stop = TRUE;
};
void wxCopyStatusDia::CopyDir( wxString &srcDir, wxString &destDir )
{
wxString src = srcDir;
wxString dest = destDir;
dest += "/";
dest += wxFileNameFromPath( src );
if (!wxMkdir( dest ))
{
wxMessageBox( "Could not create target directory.", "FileMaker" );
return;
};
wxArrayString list;
src += "/*";
char *f = wxFindFirstFile( src, wxDIR );
while (f)
{
list.Add( f );
f = wxFindNextFile();
};
for (uint i = 0; i < list.Count(); i++)
{
wxString filename = list[i];
if (wxDirExists( filename ))
CopyDir( filename, dest );
else
CopyFile( filename, dest );
if (m_stop) return;
};
};
void wxCopyStatusDia::CopyFile( wxString &src, wxString &destDir )
{
m_sourceMsg->SetLabel( src );
wxString dest = destDir;
dest += "/";
dest += wxFileNameFromPath( src );
m_destMsg->SetLabel( dest );
wxYield();
if (wxFileExists(dest))
{
wxString s = "Target file ";
s += dest;
s += " exists already. Overwrite?";
int ret = wxMessageBox( s, "FileMaker", wxYES_NO );
if (ret == wxNO) return;
};
FILE *fs = (FILE *) NULL, *fd = (FILE *) NULL;
if (!(fs = fopen(src, "rb")))
{
wxString s = "Cannot open source file ";
s += src;
s += ".";
wxMessageBox( s, "FileMaker" );
return;
}
else
if (!(fd = fopen(dest, "wb")))
{
fclose(fs);
wxString s = "Cannot open target file ";
s += dest;
s += ".";
wxMessageBox( s, "FileMaker" );
return;
};
int ch;
long kcounter = 0;
while (!m_stop)
{
int counter = 0;
while ((ch = getc( fs )) != EOF)
{
putc( ch, fd );
counter++;
if (counter == 1000) break;
};
kcounter++;
m_statusMsg->SetLabel( IntToString( kcounter) );
wxYield();
if (ch == EOF) break;
};
fclose( fs );
fclose( fd );
};
//-----------------------------------------------------------------------------
// wxDeleteStatusDia
//-----------------------------------------------------------------------------
/*
IMPLEMENT_DYNAMIC_CLASS(wxDeleteStatusDia,wxDialogBox);
wxDeleteStatusDia::wxDeleteStatusDia( wxFrame *parent, wxStringList *files ) :
wxDialogBox( parent, "FileMaker delete job control", TRUE,
180, 180, 500, 200, wxCAPTION | wxTRANSIENT )
{
int w = 0;
int h = 0;
GetSize( &w, &h );
m_files = files;
m_stop = FALSE;
m_countFiles = 0;
m_countDirs = 0;
wxFont *myFont = wxTheFontList->FindOrCreateFont( 12, wxROMAN, wxNORMAL, wxNORMAL );
SetLabelFont( myFont );
SetButtonFont( myFont );
wxStaticText *msg = new wxStaticText( this, "Deleting file or directory:", 10, 10 );
m_targetMsg = new wxStaticText( this, "", 80, 40, 300 );
msg = new wxStaticText( this, " Directories deleted:", 10, 80 );
m_dirsMsg = new wxStaticText( this, "0", 120, 80, 80 );
msg = new wxStaticText( this, " Files deleted:", 10, 110 );
m_filesMsg = new wxStaticText( this, "0", 120, 110, 100 );
m_cancelButton = new wxButton( this, NULL, "Return", w-130, h-50, 85, 30 );
Centre( wxVERTICAL | wxHORIZONTAL );
m_timer = new wxDeleteTimer( this );
m_timer->Start( 300, TRUE );
Show( TRUE );
};
wxDeleteStatusDia::~wxDeleteStatusDia()
{
delete m_timer;
};
void wxDeleteStatusDia::OnCommand( wxWindow &win, wxCommandEvent &WXUNUSED(event) )
{
if (&win == m_cancelButton)
{
if (m_stop) Show( FALSE );
m_stop = TRUE;
return;
};
};
void wxDeleteStatusDia::DoDelete(void)
{
while (wxTheApp->Pending()) wxTheApp->Dispatch();
wxNode *node = m_files->First();
while (node)
{
char *target = (char*)node->Data();
if (wxDirExists( target ))
DeleteDir( target );
else
DeleteFile( target );
if (m_stop) return;
node = node->Next();
};
m_stop = TRUE;
};
void wxDeleteStatusDia::DeleteDir( char *target )
{
wxString s = target;
s += "// *";
wxStringList list;
char *f = wxFindFirstFile( s );
while (f)
{
list.Add( f );
f = wxFindNextFile();
};
wxNode *node = list.First();
while (node)
{
f = (char*)node->Data();
if (wxDirExists( f ))
DeleteDir( f );
else
DeleteFile( f );
if (m_stop) return;
node = node->Next();
};
if (!wxRmdir( target ))
{
s = "Could not remove directory ";
s += target;
s += ".";
wxMessageBox( s, "FileMaker" );
return;
}
else
{
m_countDirs++;
m_dirsMsg->SetLabel( wxIntToString( m_countDirs) );
};
};
void wxDeleteStatusDia::DeleteFile( char *target )
{
m_targetMsg->SetLabel( target );
while (wxTheApp->Pending()) wxTheApp->Dispatch();
if (!wxRemoveFile( target ))
{
wxString s = "Could not delete file ";
s += target;
s += ".";
wxMessageBox( s, "FileMaker" );
}
else
{
m_countFiles++;
m_filesMsg->SetLabel( wxIntToString( m_countFiles) );
};
};
*/

View File

@@ -1,143 +0,0 @@
/*
* File: FMJobs.h
*
* Author: Robert Roebling
*
* Copyright: (C) 1997, GNU (Robert Roebling)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef FMJobs_h
#define FMJobs_h
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/dialog.h"
#include "wx/frame.h"
#include "wx/button.h"
#include "wx/stattext.h"
#include "wx/timer.h"
//-----------------------------------------------------------------------------
// derived classes
//-----------------------------------------------------------------------------
class wxCopyStatusDia;
class wxDeleteStatusDia;
class wxCopyTimer;
class wxDeleteTimer;
//-----------------------------------------------------------------------------
// wxCopyStatusDia
//-----------------------------------------------------------------------------
class wxCopyStatusDia: public wxDialog
{
DECLARE_DYNAMIC_CLASS( wxCopyStatusDia );
private:
wxString m_dest;
wxArrayString *m_files;
wxButton *m_cancelButton;
wxStaticText *m_sourceMsg;
wxStaticText *m_destMsg;
wxStaticText *m_statusMsg;
bool m_stop;
wxTimer *m_timer;
public:
wxCopyStatusDia(void) : wxDialog() {};
wxCopyStatusDia( wxFrame *parent, const wxString &dest, wxArrayString *files );
~wxCopyStatusDia();
void OnCommand( wxCommandEvent &event );
void DoCopy(void);
private:
void CopyDir( wxString &srcDir, wxString &destDir );
void CopyFile( wxString &src, wxString &destDir );
DECLARE_EVENT_TABLE();
};
//-----------------------------------------------------------------------------
// wxDeleteStatusDia
//-----------------------------------------------------------------------------
/*
class wxDeleteStatusDia: public wxDialog
{
DECLARE_DYNAMIC_CLASS( wxDeleteStatusDia );
private:
wxArrayString *m_files;
wxButton *m_cancelButton;
wxStaticText *m_targetMsg;
wxStaticText *m_filesMsg,*m_dirsMsg;
bool m_stop;
wxTimer *m_timer;
int m_countFiles,m_countDirs;
public:
wxDeleteStatusDia(void) : wxDialog() {};
wxDeleteStatusDia( wxFrame *parent, wxArrayString *files );
~wxDeleteStatusDia();
void OnCommand( wxCommandEvent &event );
void DoDelete(void);
private:
void DeleteDir( wxString &target );
void DeleteFile( wxString &target );
DECLARE_EVENT_TABLE();
};
*/
//-----------------------------------------------------------------------------
// wxTimer
//-----------------------------------------------------------------------------
class wxCopyTimer: public wxTimer
{
private:
wxCopyStatusDia *m_owner;
public:
wxCopyTimer( wxCopyStatusDia *owner ) { m_owner = owner; };
void Notify() { m_owner->DoCopy(); };
};
/*
class wxDeleteTimer: public wxTimer
{
private:
wxDeleteStatusDia *m_owner;
public:
wxDeleteTimer( wxDeleteStatusDia *owner ) { m_owner = owner; };
void Notify() { m_owner->DoDelete(); };
};
*/
#endif // FMJobs_h

View File

@@ -1,31 +0,0 @@
/* XPM */
static char * commanderview_xpm[] = {
"22 22 3 1",
" c None",
". c #000000000000",
"X c #FFFFFFFFFFFF",
" ",
" ",
" ",
" ",
" ",
" ................. ",
" .XXXXXXX.XXXXXXX. ",
" .XX...XX.XX...XX. ",
" .XXXXXXX.XXXXXXX. ",
" .XX...XX.XX..XXX. ",
" .XXXXXXX.XXXXXXX. ",
" .XX..XXX.XX...XX. ",
" .XXXXXXX.XXXXXXX. ",
" .XX...XX.XX...XX. ",
" .XXXXXXX.XXXXXXX. ",
" .XX...XX.XX...XX. ",
" .XXXXXXX.XXXXXXX. ",
" ................. ",
" ",
" ",
" ",
" "};

View File

@@ -1,31 +0,0 @@
/* XPM */
static char * delete_xpm[] = {
"22 22 6 1",
" s None c None",
". c black",
"X c red2",
"o c white",
"O c #DEF6DEF6DEF6",
"+ c grey70",
" ",
" ",
" ",
" ........ ",
" XXX .ooooooO. ",
" XXXXOoooooOo. X ",
" XXXOoooo Oo. XX ",
" .XXXOoo ...XX ",
" .+XXXOo OOXX ",
" .O++XXXOXXX. ",
" .ooO+XXXXX+. ",
" .oooOXXXX+o. ",
" .ooXXXX+XXo. ",
" .XXXX++OXXO. ",
" XXXX++Ooo+XX. ",
" XXXX++OooooO+XX ",
" XXX .OoooooooOXX ",
" .ooooooooo+XX ",
" ...........XX ",
" X ",
" ",
" "};

View File

@@ -1,211 +0,0 @@
/*
* Author: Robert Roebling
*
* Copyright: (C) 1997,1998 Robert Roebling
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the wxWindows Licence, which
* you have received with this library (see Licence.htm).
*
*/
#ifdef __GNUG__
#pragma implementation "dirctrl.h"
#endif
#include "dirctrl.h"
#include "wx/gdicmn.h"
#include "wx/utils.h"
#include "wx/dnd.h"
//-----------------------------------------------------------------------------
// wxDirInfo
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxDirInfo,wxObject)
wxDirInfo::wxDirInfo( const wxString &path )
{
m_showHidden = FALSE;
m_path = path;
if (m_path == "/") m_name ="The Computer";
else
if (m_path == "/home")
{
m_name = "My Home";
m_path = "";
wxGetHomeDir( &m_path );
}
else
if (m_path == "/proc") m_name = "Info Filesystem";
else
if (m_path == "/mnt") m_name = "Mounted Devices";
else
if (m_path == "/usr/X11R6") m_name = "User X11";
else
if (m_path == "/usr") m_name = "User";
else
if (m_path == "/var") m_name = "Variables";
else
if (m_path == "/usr/local") m_name = "User local";
else
if (m_path == "/mnt") m_name = "Mounted Devices";
else
m_name = wxFileNameFromPath( m_path );
};
wxString wxDirInfo::GetName(void) const
{
return m_name;
};
wxString wxDirInfo::GetPath(void) const
{
return m_path;
};
//-----------------------------------------------------------------------------
// wxDirCtrl
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxDirCtrl,wxTreeCtrl)
BEGIN_EVENT_TABLE(wxDirCtrl,wxTreeCtrl)
EVT_TREE_ITEM_EXPANDED (-1, wxDirCtrl::OnExpandItem)
EVT_TREE_ITEM_COLLAPSED (-1, wxDirCtrl::OnCollapseItem)
EVT_TREE_DELETE_ITEM (-1, wxDirCtrl::OnDeleteItem)
END_EVENT_TABLE()
wxDirCtrl::wxDirCtrl(void)
{
m_showHidden = FALSE;
};
wxDirCtrl::wxDirCtrl(wxWindow *parent, const wxWindowID id, const wxString &WXUNUSED(dir),
const wxPoint& pos, const wxSize& size,
const long style, const wxString& name )
:
wxTreeCtrl( parent, id, pos, size, style, name )
{
m_showHidden = FALSE;
wxTreeItem item;
item.m_mask = wxTREE_MASK_TEXT | wxTREE_MASK_CHILDREN | wxTREE_MASK_DATA;
item.m_text = "Sections";
item.m_children = 1;
m_rootId = InsertItem( 0, item );
// SetDropTarget( new wxFileDropTarget() );
};
void wxDirCtrl::OnExpandItem( const wxTreeEvent &event )
{
if (event.m_item.m_itemId == m_rootId)
{
wxTreeItem item;
item.m_mask = wxTREE_MASK_TEXT | wxTREE_MASK_CHILDREN | wxTREE_MASK_DATA;
item.m_children = 1;
wxDirInfo *info = new wxDirInfo( "/" );
item.m_text = info->GetName();
item.m_data = (long)info;
InsertItem( m_rootId, item );
info = new wxDirInfo( "/home" );
item.m_text = info->GetName();
item.m_data = (long)info;
InsertItem( m_rootId, item );
info = new wxDirInfo( "/mnt" );
item.m_text = info->GetName();
item.m_data = (long)info;
InsertItem( m_rootId, item );
info = new wxDirInfo( "/usr" );
item.m_text = info->GetName();
item.m_data = (long)info;
InsertItem( m_rootId, item );
info = new wxDirInfo( "/usr/X11R6" );
item.m_text = info->GetName();
item.m_data = (long)info;
InsertItem( m_rootId, item );
info = new wxDirInfo( "/usr/local" );
item.m_text = info->GetName();
item.m_data = (long)info;
InsertItem( m_rootId, item );
info = new wxDirInfo( "/var" );
item.m_text = info->GetName();
item.m_data = (long)info;
InsertItem( m_rootId, item );
info = new wxDirInfo( "/proc" );
item.m_text = info->GetName();
item.m_data = (long)info;
InsertItem( m_rootId, item );
return;
};
wxDirInfo *info = (wxDirInfo *)event.m_item.m_data;
if (!info) return;
wxArrayString slist;
wxString search,path,filename;
search = info->GetPath();
search += "/*";
path = wxFindFirstFile( search, wxDIR );
while (!path.IsNull())
{
filename = wxFileNameFromPath( path );
if (m_showHidden || (filename[0] != '.'))
{
if ((filename != ".") &&
(filename != "..") &&
(path != "/home") &&
(path != "/usr/X11R6") &&
(path != "/usr/local") &&
(path != "/usr") &&
(path != "/var") &&
(path != "/home") &&
(path != "/proc") &&
(path != "/mnt")
)
slist.Add( path ); // ref counting in action !
};
path = wxFindNextFile();
};
for (uint i = 0; i < slist.Count(); i++)
{
search = slist[i];
search += "/*";
path = wxFindFirstFile( search, wxDIR );
wxDirInfo *child = new wxDirInfo( slist[i] );
wxTreeItem item;
item.m_mask = wxTREE_MASK_TEXT | wxTREE_MASK_CHILDREN | wxTREE_MASK_DATA;
item.m_text = child->GetName();
item.m_children = 0;
if (!path.IsNull()) item.m_children = 1;
item.m_data = (long)child;
InsertItem( event.m_item.m_itemId, item );
};
};
void wxDirCtrl::OnCollapseItem( const wxTreeEvent &event )
{
DeleteChildren( event.m_item.m_itemId );
};
void wxDirCtrl::OnDeleteItem( const wxTreeEvent &event )
{
wxDirInfo *info = (wxDirInfo *)event.m_item.m_data;
if (info) delete info;
};

View File

@@ -1,74 +0,0 @@
/*
* File: DirCtrl.h
* Purpose: dir tree control
* Author: Robert Roebling
* Created: 1997
* Updated:
* Copyright:
*/
#ifndef __DIRCTRLH__
#define __DIRCTRLH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/treectrl.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxDirInfo;
class wxDirCtrl;
//-----------------------------------------------------------------------------
// wxDirInfo
//-----------------------------------------------------------------------------
class wxDirInfo: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxDirInfo)
public:
wxString m_name;
wxString m_path;
bool m_showHidden;
wxDirInfo() {};
wxDirInfo( const wxString &path );
wxString GetName(void) const;
wxString GetPath(void) const;
};
//-----------------------------------------------------------------------------
// wxDirCtrl
//-----------------------------------------------------------------------------
class wxDirCtrl: public wxTreeCtrl
{
DECLARE_DYNAMIC_CLASS(wxDirCtrl)
public:
bool m_showHidden;
int m_dragX,m_dragY;
long m_rootId;
wxDirCtrl(void);
wxDirCtrl(wxWindow *parent, const wxWindowID id = -1, const wxString &dir = "/",
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long style = wxTR_HAS_BUTTONS,
const wxString& name = "wxTreeCtrl" );
void OnExpandItem( const wxTreeEvent &event );
void OnCollapseItem( const wxTreeEvent &event );
void OnDeleteItem( const wxTreeEvent &event );
DECLARE_EVENT_TABLE()
};
#endif

View File

@@ -1,29 +0,0 @@
/* XPM */
static char * exit_xpm[] = {
"22 22 4 1",
" c None",
". c #000000000000",
"X c #820782078207",
"o c #FFFFFFFFFFFF",
" ",
" ",
" ",
" ",
" ",
" . ",
" ..X .o.X ",
" ..X .ooo.X ",
" .o..oo ..XX ",
" .oo .XXXX ",
" .o .XXX ",
" .o .XX ",
" .o.X.o.X ",
" .o.XX .o.X ",
" .o.XX ..X ",
" ..XX ..X ",
" .XX .X ",
" XX XX ",
" ",
" ",
" ",
" "};

View File

@@ -1,544 +0,0 @@
/*
* Author: Robert Roebling
*
* Copyright: (C) 1997,1998 Robert Roebling
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the wxWindows Licence, which
* you have received with this library (see Licence.htm).
*
*/
#ifdef __GNUG__
#pragma implementation "filectrl.h"
#endif
#include "filectrl.h"
#include "wx/dnd.h"
#include "sys/types.h"
#include "sys/stat.h"
#include "dirent.h"
#include "pwd.h"
#include "grp.h"
#include "time.h"
#include "folder.xpm"
#include "txt.xpm"
#include "list.xpm"
#include "find.xpm"
//-----------------------------------------------------------------------------
// wxFileData
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxFileData,wxObject);
wxFileData::wxFileData( const wxString &name, const wxString &fname )
{
m_name = name;
m_fileName = fname;
struct stat buff;
stat( m_fileName.GetData(), &buff );
struct stat lbuff;
lstat( m_fileName.GetData(), &lbuff );
struct tm *t = localtime( &lbuff.st_mtime );
// struct passwd *user = getpwuid( buff.st_uid );
// struct group *grp = getgrgid( buff.st_gid );
m_isDir = S_ISDIR( buff.st_mode );
m_isLink = S_ISLNK( lbuff.st_mode );
m_isExe = ((buff.st_mode & S_IXUSR ) == S_IXUSR );
m_size = buff.st_size;
m_hour = t->tm_hour;
m_minute = t->tm_min;
m_month = t->tm_mon+1;
m_day = t->tm_mday;
m_year = t->tm_year;
m_permissions.sprintf( "%c%c%c",
((( buff.st_mode & S_IRUSR ) == S_IRUSR ) ? 'r' : '-'),
((( buff.st_mode & S_IWUSR ) == S_IWUSR ) ? 'w' : '-'),
((( buff.st_mode & S_IXUSR ) == S_IXUSR ) ? 'x' : '-') );
};
wxString wxFileData::GetName(void) const
{
return m_name;
};
wxString wxFileData::GetFullName(void) const
{
return m_fileName;
};
wxString wxFileData::GetHint(void) const
{
wxString s = m_fileName;
s += " ";
if (m_isDir) s += "<DIR> ";
else if (m_isLink) s += "<LINK> ";
else
{
s += LongToString( m_size );
s += " bytes ";
};
s += IntToString( m_day );
s += ".";
s += IntToString( m_month );
s += ".";
s += IntToString( m_year );
s += " ";
s += IntToString( m_hour );
s += ":";
s += IntToString( m_minute );
s += " ";
s += m_permissions;
return s;
};
wxString wxFileData::GetEntry( const int num )
{
wxString s;
switch (num)
{
case 0:
s = m_name;
break;
case 1:
if (m_isDir) s = "<DIR>";
else if (m_isLink) s = "<LINK>";
else s = LongToString( m_size );
break;
case 2:
if (m_day < 10) s = "0"; else s = "";
s += IntToString( m_day );
s += ".";
if (m_month < 10) s += "0";
s += IntToString( m_month );
s += ".";
if (m_year < 10) s += "0"; // this should happen real soon...
s += IntToString( m_year );
break;
case 3:
if (m_hour < 10) s = "0"; else s = "";
s += IntToString( m_hour );
s += ":";
if (m_minute < 10) s += "0";
s += IntToString( m_minute );
break;
case 4:
s = m_permissions;
break;
default:
s = "No entry";
break;
};
return s;
};
bool wxFileData::IsDir( void )
{
return m_isDir;
};
bool wxFileData::IsExe( void )
{
return m_isExe;
};
bool wxFileData::IsLink( void )
{
return m_isLink;
};
long wxFileData::GetSize( void )
{
return m_size;
};
bool wxFileData::NewNameIsLegal( const wxString &s )
{
wxString fileName = wxPathOnly( m_fileName );
fileName += "/";
fileName += s;
return (!wxFileExists( fileName ));
};
bool wxFileData::Rename( const wxString &s )
{
wxString fileName = wxPathOnly( m_fileName );
fileName += "/";
fileName += s;
bool ret = wxRenameFile( m_fileName, fileName );
if (ret)
{
m_fileName = fileName;
m_name = s;
};
return ret;
};
void wxFileData::MakeItem( wxListItem &item )
{
item.m_text = m_name;
item.m_colour = wxBLACK;
if (IsExe()) item.m_colour = wxRED;
if (IsDir()) item.m_colour = wxBLUE;
if (IsLink())
{
wxColour *dg = wxTheColourDatabase->FindColour( "MEDIUM GREY" );
item.m_colour = dg;
};
item.m_data = (long)this;
};
//-----------------------------------------------------------------------------
// wxFileCtrl
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxFileCtrl,wxListCtrl);
BEGIN_EVENT_TABLE(wxFileCtrl,wxListCtrl)
EVT_SET_FOCUS (wxFileCtrl::OnSetFocus)
END_EVENT_TABLE()
wxFileCtrl *wxFileCtrl::m_lastFocus = (wxFileCtrl *) NULL;
wxFileCtrl::wxFileCtrl( void )
{
m_dirName = "/";
m_showHidden = FALSE;
};
wxFileCtrl::wxFileCtrl( wxWindow *win, const wxWindowID id, const wxString &dirName,
const wxPoint &pos, const wxSize &size,
const long style, const wxString &name ) :
wxListCtrl( win, id, pos, size, style, name )
{
SetItemSpacing( 40 );
wxImageList *imageList = new wxImageList( 30, 30 );
imageList->Add( wxBitmap( folder_xpm ) );
imageList->Add( wxBitmap( txt_xpm ) );
imageList->Add( wxBitmap( list_xpm ) );
imageList->Add( wxBitmap( find_xpm ) );
SetImageList( imageList, wxIMAGE_LIST_NORMAL );
m_dirName = dirName;
m_showHidden = FALSE;
Update();
m_lastFocus = this;
m_dragStartX = 0;
m_dragStartY = 0;
m_dragCount = 0;
// SetDropTarget( new wxFileDropTarget() );
};
void wxFileCtrl::ChangeToListMode()
{
SetSingleStyle( wxLC_LIST );
Update();
};
void wxFileCtrl::ChangeToReportMode()
{
SetSingleStyle( wxLC_REPORT );
Update();
};
void wxFileCtrl::ChangeToIconMode()
{
SetSingleStyle( wxLC_ICON );
Update();
};
void wxFileCtrl::ShowHidden( bool show )
{
m_showHidden = show;
Update();
};
int ListCompare( const long data1, const long data2, const long WXUNUSED(data) )
{
wxFileData *fd1 = (wxFileData*)data1 ;
wxFileData *fd2 = (wxFileData*)data2 ;
if (fd1->IsDir() && !fd2->IsDir()) return -1;
if (fd2->IsDir() && !fd1->IsDir()) return 1;
return strcmp( fd1->GetName(), fd2->GetName() );
};
void wxFileCtrl::Update( void )
{
DeleteAllItems();
for (int i = 0; i < 5; i++) DeleteColumn( 0 );
long my_style = GetWindowStyleFlag();
if (my_style & wxLC_REPORT)
{
InsertColumn( 0, "Name", wxLIST_FORMAT_LEFT, 110 );
InsertColumn( 1, "Size", wxLIST_FORMAT_LEFT, 60 );
InsertColumn( 2, "Date", wxLIST_FORMAT_LEFT, 55 );
InsertColumn( 3, "Time", wxLIST_FORMAT_LEFT, 50 );
InsertColumn( 4, "Permissions", wxLIST_FORMAT_LEFT, 120 );
};
wxFileData *fd = (wxFileData *) NULL;
wxListItem item;
item.m_mask = wxLIST_MASK_TEXT + wxLIST_MASK_DATA;
if (my_style & wxLC_ICON) item.m_mask += wxLIST_MASK_IMAGE;
item.m_itemId = 0;
item.m_col = 0;
wxString s;
wxString res = m_dirName + "/*";
char *f = wxFindFirstFile( res.GetData(), 0 );
while (f)
{
res = wxFileNameFromPath( f );
fd = new wxFileData( res, f );
s = fd->GetName();
if (m_showHidden || (s[0] != '.'))
{
fd->MakeItem( item );
if (my_style & wxLC_REPORT)
{
InsertItem( item );
for (int i = 1; i < 5; i++) SetItem( item.m_itemId, i, fd->GetEntry( i) );
}
else if (my_style & wxLC_LIST)
{
InsertItem( item );
}
else if (my_style & wxLC_ICON)
{
if (fd->IsDir()) item.m_image = 0; else item.m_image = 1;
InsertItem( item );
};
item.m_itemId++;
};
f = wxFindNextFile();
};
SortItems( ListCompare, 0 );
};
int wxFileCtrl::FillList( wxStringList &list )
{
long index = -1;
int count = 0;
wxString s;
for (;;)
{
index = GetNextItem( index, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
if (index == -1) break;
wxListItem item;
item.m_itemId = index;
GetItem( item );
wxFileData *fd = (wxFileData*)item.m_data;
list.Add( fd->GetFullName() );
index++;
count++;
};
if (count == 0)
{
index = GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED );
if (index == -1) return 0;
wxListItem item;
item.m_itemId = index;
GetItem( item );
wxFileData *fd = (wxFileData*)item.m_data;
list.Add( fd->GetFullName() );
count = 1;
};
return count;
};
void wxFileCtrl::DeleteFiles(void)
{
/*
wxStringList list;
int count = FillList( list );
if (count > 0)
{
wxString s = "Delete ";
s += wxIntToString( count );
s += " selected file";
if (count > 1) s += "s";
s += " or director";
if (count > 1) s += "ies?"; else s+= "y?";
if (wxYES == wxMessageBox( s, "Delete", wxYES_NO ))
wxDeleteStatusDia( NULL, &list );
};
*/
};
void wxFileCtrl::CopyFiles( char *WXUNUSED(dest) )
{
/*
wxStringList list;
int count = FillList( list );
wxString s = dest;
int ret = 0; // 0 = nix, 1 = copy, 2 = move
wxCopyMoveDia( (wxFrame*)GetParent(), count, &ret, &s );
if (ret == 1)
wxCopyStatusDia( NULL, s, &list );
*/
};
void wxFileCtrl::MoveFiles( char *WXUNUSED(dest) )
{
};
void wxFileCtrl::RenameFile(void)
{
};
void wxFileCtrl::MakeDir(void)
{
/*
wxString s = wxGetTextFromUser( "Enter new directory name:", "Make directory" );
if (s.IsNull()) return;
if (s == "") return;
if ((s == ".") || (s == ".."))
{
wxMessageBox( "This was obviously an invalid directory name.", "Go away." );
return;
};
wxString dir;
GetDir( dir );
dir += "/";
dir += s;
if (wxFileExists( dir ))
{
wxMessageBox( "Filename exists already. Cannot create directoy.", "Make directory" );
return;
};
wxMkdir( dir );
Update();
*/
};
void wxFileCtrl::GoToParentDir(void)
{
wxString s = m_dirName;
int pos = s.Last( '/' );
if ((pos >= 0) && (s != "/"))
{
s.Remove( pos, s.Length()-pos );
if (s.Length() == 0) s = "/";
m_dirName = s;
Update();
};
};
void wxFileCtrl::GoToHomeDir(void)
{
wxString s = wxGetUserHome( wxString() );
m_dirName = s;
Update();
};
void wxFileCtrl::GoToDir( const wxString &dir )
{
m_dirName = dir;
Update();
};
void wxFileCtrl::GetDir( wxString &dir )
{
dir = m_dirName;
};
/*
void wxFileCtrl::OnDropFiles( int WXUNUSED(n), char **WXUNUSED(data), int WXUNUSED(x), int WXUNUSED(y) )
{
wxString destDir;
wxPoint pt( x, y );
int flag = wxLIST_HITTEST_ONITEM;
long hit = HitTest( pt, flag );
if (hit > -1)
{
wxListItem li;
li.m_itemId = hit;
GetItem( li );
wxFileData *fd = (wxFileData*)li.m_data;
if (fd->IsDir()) fd->GetFullName( destDir );
};
if (destDir.IsNull()) destDir = m_dirName;
int ret = 0; // 0 = nix, 1 = copy, 2 = move
wxCopyMoveDia( (wxFrame*)GetParent(), n, &ret, &destDir );
if (ret == 1)
{
wxStringList slist;
for (int i = 0; i < n; i++) slist.Add( data[i] );
wxCopyStatusDia( NULL, destDir.GetData(), &slist );
Update();
};
};
*/
void wxFileCtrl::OnListDeleteItem( wxListEvent &event )
{
wxFileData *fd = (wxFileData*)event.m_item.m_data;
delete fd;
};
void wxFileCtrl::OnListKeyDown( wxListEvent &event )
{
wxFileData *fd = (wxFileData*)event.m_item.m_data;
if (fd->IsDir())
{
m_dirName = fd->GetFullName();
Update();
Refresh();
return;
};
if (fd->IsExe())
{
wxExecute( fd->GetFullName() );
return;
};
};
void wxFileCtrl::OnListEndLabelEdit( wxListEvent &event )
{
wxFileData *fd = (wxFileData*)event.m_item.m_data;
wxString newName = event.m_item.m_text;
if (fd->NewNameIsLegal( newName ))
{
if (fd->Rename( newName ))
{
Update();
}
else
{
wxString s = "Could not rename file to ";
s += newName;
s += ".";
wxMessageBox( s, "FileMaker", wxOK );
};
}
else
{
wxString s = "File name ";
s += newName;
s += " exists already or is invalid.\n";
s += "Could not rename file.";
wxMessageBox( s, "FileMaker", wxOK );
};
return;
};
void wxFileCtrl::OnSetFocus( wxFocusEvent &event )
{
m_lastFocus = this;
event.Skip();
};

View File

@@ -1,115 +0,0 @@
/*
* Author: Robert Roebling
*
* Copyright: (C) 1997,1998 Robert Roebling
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the wxWindows Licence, which
* you have received with this library (see Licence.htm).
*
*/
#ifndef FileList_h
#define FileList_h
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/wx.h"
#include "wx/listctrl.h"
//-----------------------------------------------------------------------------
// derived classes
//-----------------------------------------------------------------------------
class wxFileData;
class wxFileCtrl;
//-----------------------------------------------------------------------------
// wxFileData
//-----------------------------------------------------------------------------
class wxFileData : public wxObject
{
DECLARE_DYNAMIC_CLASS(wxFileData);
private:
wxString m_name;
wxString m_fileName;
long m_size;
int m_hour;
int m_minute;
int m_year;
int m_month;
int m_day;
wxString m_permissions;
bool m_isDir;
bool m_isLink;
bool m_isExe;
public:
wxFileData( void ) {};
wxFileData( const wxString &name, const wxString &fname );
wxString GetName(void) const;
wxString GetFullName(void) const;
wxString GetHint(void) const;
wxString GetEntry( const int num );
bool IsDir( void );
bool IsLink( void );
bool IsExe( void );
long GetSize( void );
bool NewNameIsLegal( const wxString &s );
bool Rename( const wxString &s );
void MakeItem( wxListItem &item );
};
//-----------------------------------------------------------------------------
// wxFileCtrl
//-----------------------------------------------------------------------------
class wxFileCtrl : public wxListCtrl
{
DECLARE_DYNAMIC_CLASS(wxFileCtrl);
public:
static wxFileCtrl* m_lastFocus;
private:
wxString m_dirName;
bool m_showHidden;
int m_dragStartX;
int m_dragStartY;
int m_dragCount;
public:
wxFileCtrl( void );
wxFileCtrl( wxWindow *win, const wxWindowID id, const wxString &dirName,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = wxLC_LIST, const wxString &name = "filelist" );
void ChangeToListMode();
void ChangeToReportMode();
void ChangeToIconMode();
void ShowHidden( bool show = TRUE );
void Update( void );
virtual void StatusbarText( char *WXUNUSED(text) ) {};
int FillList( wxStringList &list );
void DeleteFiles(void);
void CopyFiles( char *dest );
void MoveFiles( char *dest );
void RenameFile(void);
void MakeDir(void);
void GoToParentDir(void);
void GoToHomeDir(void);
void GoToDir( const wxString &dir );
void GetDir( wxString &dir );
void OnListDeleteItem( wxListEvent &event );
void OnListKeyDown( wxListEvent &event );
void OnListEndLabelEdit( wxListEvent &event );
void OnSetFocus( wxFocusEvent &event );
DECLARE_EVENT_TABLE()
};
#endif // FileList_h

View File

@@ -1,30 +0,0 @@
/* XPM */
static char * fileopen_xpm[] = {
"22 22 5 1",
" c None",
". c #000000000000",
"X c #D75CD75CD75C",
"o c #FFFFFFFFFFFF",
"O c #6DB66DB66DB6",
" ",
" ",
" .... ",
" .. . ",
" ... ",
" ... ",
" .... ",
" .... ",
" .XoX....... ",
" .oXoXoXoXo. ",
" .XoXoXoXoX. ",
" .oXoXo .......... ",
" .XoXo . O O O OO. ",
" .oXo . O O OOOO. ",
" .Xo .OO OOOOOO. ",
" .o . O OOOOOO. ",
" ... O OOOOOO. ",
" ..OOOOOOOOO. ",
" ........... ",
" ",
" ",
" "};

View File

@@ -1,99 +0,0 @@
/* XPM */
static char * find_xpm[] = {
"32 32 64 1",
" s background c None",
". c black",
"X c #FFFFFBEEFFFF",
"o c #AEBAAAAAAEBA",
"O c #4924618579E7",
"+ c #AEBA8A286185",
"@ c #BEFB8A2871C6",
"# c #71C682078617",
"$ c #4924410330C2",
"% c #492451446185",
"& c #49243CF338E3",
"* c #EFBEAAAA8E38",
"= c #AEBA71C66185",
"- c #9E79820769A6",
"; c #5144410338E3",
": c #514434D338E3",
"> c #D75CA28971C6",
", c #514430C230C2",
"< c #618541034103",
"1 c #BEFB8A286185",
"2 c #B6DA7DF75965",
"3 c #410338E330C2",
"4 c #514441034103",
"5 c #AEBA9A696185",
"6 c #9E7971C65144",
"7 c #9E7971C66185",
"8 c #DF7DAEBA9E79",
"9 c #38E338E330C2",
"0 c #410330C22081",
"q c #A69961855144",
"w c #618549244924",
"e c #30C230C22081",
"r c #38E32CB230C2",
"t c #8E3851445144",
"y c #28A228A230C2",
"u c #79E759654924",
"i c #A69969A65965",
"p c #8E3861855144",
"a c #71C661854103",
"s c #208120812081",
"d c #596538E330C2",
"f c #8E3871C65144",
"g c #71C651445144",
"h c #186118611861",
"j c #8E3861854103",
"k c #71C651444103",
"l c #71C641034103",
"z c #514451445144",
"x c #5144514430C2",
"c c #104010401040",
"v c #410330C230C2",
"b c #30C220812081",
"n c #618551444103",
"m c #79E779E779E7",
"M c #6185410330C2",
"N c #38E330C22081",
"B c #6185514430C2",
"V c #38E324922081",
"C c #514400000000",
"Z c #E79DD34CD75C",
"A c #C71BC71BBEFB",
"S c #8E387DF769A6",
"D c #208128A228A2",
"F c #30C238E34103",
" ........ XXXo ",
" ..O......O..Xoo+@ ",
" .#..$.###%..&.@+*X=- ",
" ...;;;.%$:;;;...XX>XXXo ",
" ...$$,$+XXX.##<#..o111@2 ",
" .&.34&+XXoo5.XX#%.$.@@5*X=6 ",
" ..3378X+@@++@@++@@..XX>XXoo+2 ",
".9.0qXXX2++12+XXX.X.w.XXo11@@1 ",
"..erX66==66=11111.o1..1111*XX>>t",
"..yuXi76678X+@2++@@+..:+XXX>+ppa",
"..sdXpppXX=++@=++=8X..w+fqppupge",
"..h<XajtX67==67=*XX*..&qqpjttak.",
"..h<XkwlXfqqiXX*=66=..9qqjjtukd.",
"..h0Xz<xXpppX*i6-==6..yfpppaak,.",
".c.vXz4dXzguXi=&-=7.9.rputgawk.z",
"X..bX,d<XwklX+2==66..rettakkln.m",
"X.c.Xb0,XkM<X$i=q6.v.NjtulkllB. ",
"X4..XbVvXz:hX==66...Nytaakknn<. ",
"X<c...bnX,v0>=76.....pganknwBMz ",
"XM.w.h..Xb0,*6..v..CC.kklkB<<;m ",
"ZMzX#..;......9..N.rC...lBM<dem ",
" =zXXsc........9eNN..CCC.<M:dVm ",
" =oXA<.##hc$9vNryrye.VCCC.4de.z ",
" SoXZMzXXyc;vrNttaVV..VCCC.V.z ",
" -Xk82zXXM.*qjjtukkbb..sCCC.z ",
" SXlA=oXZM.Xpptaakknss..VCCC. ",
" ..z-oXA=zXatganknBx.D..FCCC. ",
" zmSXk82zXtakllBB<.zDD..FCCC. ",
" Xl.SoXuknl<.zz FF..%CCC.",
" ..z-oXakkn.zz %%..OCC.",
" SXkn.zzz %O..OO.",
" Xk.z OO... "};

View File

@@ -1,48 +0,0 @@
/* XPM */
static char * folder_xpm[] = {
"33 33 12 1",
" c None",
". c #D75CA69979E7",
"X c #208120812081",
"o c #FFFFFFFFFFFF",
"O c #B6DA79E74924",
"+ c #596559655965",
"@ c #410341034103",
"# c #514451445144",
"$ c #000000000820",
"% c #8E38596530C2",
"& c #8E3886178617",
"* c #492479E769A6",
" ",
" .. XXX ",
" .o.. X.XXX ",
" .ooo..OOOXXX ",
" .ooooo..OOOXXX ++ ",
"XXX .ooooooo..OOOXXX @#++@ ",
"XOX@X.ooooooooo...OOO@XX+X#+++ ",
"X...@@$.oooooooooo...OOXXX@X@+ ",
"O.....@XXOooooooooooo..OOOX@@X ",
"XO......@%X.ooooooooooo..%%OX@ ",
".O........@XX.oooooooooo.X%XX ",
" %O.........@@$.oooooooo.XX%X ",
" %O...........@@$.oooooo.X%X# ",
" %O.............@@X.oooo.XX%& ",
" .@...............@XX.oo.@XX ",
" %.................@X.o.XXX ",
" OO................O%X..XX@ ",
" +OO.......O..OOOOOOO@..@X& ",
" .%O....OOOOOOOOOOOOOX.+XX ",
" XOOOOOOOOOOOOOOOOOOX+*XX ",
" @OOOOO.OOOOOOOOOOOOX*+XX ",
" .%OOOOOOOOOOOOOOO%OXX#XX ",
" XOOOOOOOOOOO%O%O%%OX++& ",
" @O%O%OO%O%%O%%%%%%%XXX ",
" XXXO%%%%%%%%%%%%%%XXX ",
" OXXX%%%%%%%%%%%%@XX# ",
" OX@X%%%%%%%%%%%XXX ",
" OXXX%%%O%%%%%XXX ",
" OXXX%%%%%%%XX* ",
" OX@X%%%%X%X& ",
" OXXX%%%XX ",
" OXXX%%@ ",
" OXXX "};

View File

@@ -1,29 +0,0 @@
/* XPM */
static char * help_xpm[] = {
"22 22 4 1",
" c None",
". c #000000000000",
"X c #000000008617",
"o c #861782078617",
" ",
" ",
" ",
" ",
" . XXXXXo ",
" .. XX oXXo ",
" ... XXo XXX ",
" .... XXo XXX ",
" ..... oXX oXXo ",
" ...... XXo ",
" ....... XX ",
" ........ XXo ",
" ..... XXo ",
" .. .. ",
" . .. XXX ",
" .. XXX ",
" .. ",
" .. ",
" ",
" ",
" ",
" "};

View File

@@ -1,28 +0,0 @@
/* XPM */
static char * home_xpm[] = {
"22 22 3 1",
" c None",
". c #000000000000",
"X c #FFFFFFFFFFFF",
" ",
" ",
" ",
" .. ",
" . .... ",
" . .XX . ",
" . .XXXX . ",
" ..XXXXXX . ",
" .XXXXXXXX . ",
" .XXXXXXXXX . ",
" ...XXXXXXXX ... ",
" .XXXXXXXX . ",
" .XXX...XX . ",
" .XXX. .XX . ",
" .XXX. .XX . ",
" .XXX. .XX . ",
" .XXX. .XX . ",
" ..... ...... ",
" ",
" ",
" ",
" "};

View File

@@ -1,31 +0,0 @@
/* XPM */
static char * iconview_xpm[] = {
"22 22 3 1",
" c None",
". c #000000000000",
"X c #FFFFFFFFFFFF",
" ",
" ",
" ",
" ",
" ",
" ................. ",
" .XXXXXXXXXXXXXXX. ",
" .XX...XXXXX...XX. ",
" .XX...XXXXX...XX. ",
" .XXXXXXXXXXXXXXX. ",
" .X.....XXX.....X. ",
" .XXXXXXXXXXXXXXX. ",
" .XX...XXXXX...XX. ",
" .XX...XXXXX...XX. ",
" .XXXXXXXXXXXXXXX. ",
" .X.....XXX.....X. ",
" .XXXXXXXXXXXXXXX. ",
" ................. ",
" ",
" ",
" ",
" "};

View File

@@ -1,45 +0,0 @@
/* XPM */
static char * list_xpm[] = {
"32 32 10 1",
" c #DF7DDF7DDF7D",
". c #9E799E79A699",
"X c #AEBAAEBAAEBA",
"o c #FFFFFFFFFFFF",
"O c #514451445144",
"+ c #410341034103",
"@ c #596559655965",
"# c #000000000000",
"$ c #BEFBBEFBBEFB",
"% c #208120812081",
" ",
" . ",
" Xo.. ",
" Xoooo.X ",
" Xooooooo.X ",
" XooooO+ooooXX ",
" XoooooooO+ooo.. ",
" XooooOOoooo@@ooo.. ",
" XoooooooOOooooooooo.X ",
" Xoooo@Ooooo+@oooO+oooo.X",
" Xooooooo@OoooooooooO+oooo",
" XooooooooooO@oooOOoooo@@oo",
" XooooO+ooooooooooooOOoooooo",
" XoooooooO+oooooo@Ooooo+@oooX",
" XooooOOoooo@@oooooo@OooooooOX",
" XoooooooOOooooooooooooO@oooOX#",
" Xoooo@Ooooo+@oooO+oooooooooOX#X",
"Xooooooo@OoooooooooO+ooooooOX#XX",
"O@$oooooooO@oooOOoooo@@oooOX#XX ",
"X#+@$ooooooooooooOOooooooOX#XX ",
" XX#O@ooooooo@Ooooo+@oooOX#XX ",
" XX#OXooooooo@OooooooOX#X ",
" XXO@XoooooooO@oooOX#X ",
" XX#%@XoooooooooOX#X ",
" XX#%@XooooooOX#X ",
" XX#%@XoooOX#X ",
" XX#%@XOX#X ",
" XX#+X#X ",
" XXXX ",
" ",
" ",
" "};

View File

@@ -1,30 +0,0 @@
/* XPM */
static char * listview_xpm[] = {
"22 22 3 1",
" c None",
". c #000000000000",
"X c #FFFFFFFFFFFF",
" ",
" ",
" ",
" ",
" ",
" ................. ",
" .XXXXXXXXXXXXXXX. ",
" .XX.....XXX....X. ",
" .XXXXXXXXXXXXXXX. ",
" .XX...XXXXX..XXX. ",
" .XXXXXXXXXXXXXXX. ",
" .XX..XXXXXX...XX. ",
" .XXXXXXXXXXXXXXX. ",
" .XX.....XXX...XX. ",
" .XXXXXXXXXXXXXXX. ",
" .XX...XXXXXXXXXX. ",
" .XXXXXXXXXXXXXXX. ",
" ................. ",
" ",
" ",
" ",
" "};

View File

@@ -1,29 +0,0 @@
/* XPM */
static char * prev_xpm[] = {
"22 22 4 1",
" c None",
". c #000000000000",
"X c #861782078617",
"o c #FFFFFFFFFFFF",
" ",
" ",
" ",
" ",
" ",
" ....... ",
" ....... ",
" ......X ",
" ........ .ooooo. ",
" .o o. ",
" ..... .o o. ",
" .o o. ",
" ........ . . . ",
" ........ .. . . ",
" . ",
" .... ",
" ",
" ...... ",
" ",
" ",
" ",
" "};

View File

@@ -1,31 +0,0 @@
/* XPM */
static char * reportview_xpm[] = {
"22 22 3 1",
" c None",
". c #000000000000",
"X c #FFFFFFFFFFFF",
" ",
" ",
" ",
" ",
" ",
" ................. ",
" .XXXXXXXXXXXXXXX. ",
" ................. ",
" .XXXXXXXXXXXXXXX. ",
" .XX..XXXX.XX..XX. ",
" .XXXXXXXXXXXXXXX. ",
" .XX...XXX.XX..XX. ",
" .XXXXXXXXXXXXXXX. ",
" .XX...XXX.XX..XX. ",
" .XXXXXXXXXXXXXXX. ",
" .XX...XXX.XX..XX. ",
" .XXXXXXXXXXXXXXX. ",
" ................. ",
" ",
" ",
" ",
" "};

View File

@@ -1,30 +0,0 @@
/* XPM */
static char * save_xpm[] = {
"22 22 5 1",
" c None",
". c #000000000000",
"X c #FFFFFFFFFFFF",
"o c #CB2BCB2BCB2B",
"O c #82077DF77DF7",
" ",
" ",
" ",
" ",
" .............. ",
" . XXXXXXXXXo .O ",
" . X.....XXXo .O ",
" . XXXXXXXXXo .O ",
" . X...XXXXXo .O ",
" . XXXXXXXXXo .O ",
" . XXXXXXXXXo .O ",
" . oooooooooo .O ",
" . OOOOOOOOOO .O ",
" . OOOOOOOOOO .O ",
" . OO OOo .O ",
" . OO OO OOo .O ",
" . OO OO OOo .O ",
" . OO OOo .O ",
" ..............O ",
" OOOOOOOOOOOOOO ",
" ",
" "};

View File

@@ -1,32 +0,0 @@
/* XPM */
static char * search_xpm[] = {
"22 22 4 1",
" c None",
". c #000000000000",
"X c #FFFFFFFFFFFF",
"o c #CB2BCB2BCB2B",
" ",
" ",
" ",
" o.......o ",
" o..o o.. ",
" o. o .o ",
" .o .. ",
" .o o.o ",
" o.o .. ",
" .o .. ",
" o.o o.. ",
" o.o o... ",
" ........oo ",
" ....oo ",
" ...oo ",
" ...oo ",
" ...oo ",
" ...oo ",
" ...oo ",
" oo ",
" ",
" "};

View File

@@ -1,30 +0,0 @@
/* XPM */
static char * singleview_xpm[] = {
"22 22 3 1",
" c None",
". c #000000000000",
"X c #FFFFFFFFFFFF",
" ",
" ",
" ",
" ",
" ",
" ................. ",
" .XXXXXXXXXXXXXXX. ",
" .XX.....XXX....X. ",
" .XXXXXXXXXXXXXXX. ",
" .XX...XXXXX..XXX. ",
" .XXXXXXXXXXXXXXX. ",
" .XX..XXXXXX...XX. ",
" .XXXXXXXXXXXXXXX. ",
" .XX.....XXX...XX. ",
" .XXXXXXXXXXXXXXX. ",
" .XX...XXXXXXXXXX. ",
" .XXXXXXXXXXXXXXX. ",
" ................. ",
" ",
" ",
" ",
" "};

View File

@@ -1,44 +0,0 @@
/* XPM */
static char * trash_xpm[] = {
/* width height ncolors chars_per_pixel */
"32 32 6 1",
/* colors */
" s background c None",
". c black",
"X c white",
"o c grey",
"O c slate grey",
"+ c dark slate grey",
/* pixels */
" ...... ",
" . . ",
" .................... ",
" .XXXXXXXXXXooooooOOOO. ",
" .ooooOoOOO+O+++.+..... ",
" .XXXXoXoOOOO+++++++. ",
" .XXXXXXooooOO++++++. ",
" .XXXoXooOoOO+O++..+. ",
" .XXoXXXOOoo++O++.++. ",
" .XXoXXoOooo+++O+..+. ",
" .XXoXXXOOoo++O++.++. ",
" .XXoXXoOooo+++O+..+. ",
" .XXoXXXOOoo++O++.++. ",
" .XXoXXoOooo+++O+..+. ",
" .XXoXXXOOoo++OO+.++. ",
" .XXoXXoOooo+++O+..+. ",
" .XXoXXXOOoo++OO+.++. ",
" .XXoXXoOooo+++O+..+. ",
" .XXoXXXOOoo++OO+.++. ",
" .XXoXXoOooo+++O+..+. ",
" .XXoXXXOOoo++OO+.++. ",
" .XXoXXoOooo+++O+..+. ",
" .XXoXXXOOoo++OO+.++. ",
" .XXoXXoOooo+++O+..+. ",
" .XXoXXXOOoo++OO+.++. ",
" .XXoXXoOooo+++O+..+. ",
" .XXoXXXOOoo++OO+.++. ",
" .XXoXXoOooO+++++..+. ",
" .XXXoXXoOooO+OOO.++. ",
" .XXXXXXoooOoOOOOO++. ",
" .XXXXXooooooOOOOO++. ",
" .................... "};

View File

@@ -1,31 +0,0 @@
/* XPM */
static char * treeview_xpm[] = {
"22 22 3 1",
" c None",
". c #000000000000",
"X c #FFFFFFFFFFFF",
" ",
" ",
" ",
" ",
" ",
" ................. ",
" .XXXXXXXXXXXXXXX. ",
" .XX.......XXXXXX. ",
" .XXXX.XXXXXXXXXX. ",
" .XXXX.....XXXXXX. ",
" .XXXX.XXXXXXXXXX. ",
" .XXXX.......XXXX. ",
" .XXXX.XXX.XXXXXX. ",
" .XXXX.XXX.....XX. ",
" .XXXX.XXXXXXXXXX. ",
" .XXXX.....XXXXXX. ",
" .XXXXXXXXXXXXXXX. ",
" ................. ",
" ",
" ",
" ",
" "};

View File

@@ -1,53 +0,0 @@
/* XPM */
static char * txt_xpm[] = {
"32 32 18 1",
" c None",
". c #D75CA69979E7",
"X c #BEFBBEFBBEFB",
"o c #208120812081",
"O c #F7DE28A22081",
"+ c #AEBAAEBAAEBA",
"@ c #FFFFD75C0000",
"# c #8E38596530C2",
"$ c #FFFFFFFFFFFF",
"% c #B6DA79E74924",
"& c #9E799E79A699",
"* c #514451445144",
"= c #492479E769A6",
"- c #410341034103",
"; c #000000000000",
": c #596559655965",
"> c #8E3886178617",
", c #410341038E38",
" ",
" .X ",
" Xoo. ",
" O.Xo ",
" ++ +X@O#o ",
" +$$++ +$$%%#o ",
" +$$$$$+$$$@%#o& ",
" +$$$$$+$$$$O%#o$&& ",
" +$$$$$+$$$$$@##o$$$&+ ",
" +$$**$+$$$$$$%O#o$$$$$& ",
" +$$$$$+$$**$$+@%#o$$$$$$=",
" +$$**$+$$$$$*&$O%-o$$$$$-+",
" +$$$$$+$$**$$+$$@%o;+$$$*+;",
" +$$**$+$$$$$*+$$$O##o$+$*+;+",
" +$$$$$+$$**$$+$$$$@#oo$$++;+ ",
" +$$**$+$$$$$*+$$$$$%%#;$$$$++ ",
" +$$$$$+$$**$$+$$*-$$%#oo$$$$$$*",
"+$$$$$+$$$$$*+$$$$$*-O##;$$$$$-+",
"*:X$$+oo+$$$+$$**$$$$%%;o$$$$*+;",
"+;-:X$$+oo:&$$$$$**$$ooo;$$$*+;+",
" +;*:X$$*+$$**$$$$*-X%o$$$*+;+ ",
" +;**++$$$$$**$$$$.#o$$*+;+ ",
" +*+$$=:$$$$*-$$$##$>Xo+ ",
" +$$$$$:*$$$$-*$;X-+-+ ",
" *+$$$$$$$:*$$$$$;,+;& ",
" +*:+$$$$$$$*:$$$=+;+ ",
" +;o:+$$$$$$$$$*+;+ ",
" +;o:+$$$$$$*+;+ ",
" +;o:+$$$*+;+ ",
" +;o:+*+;+ ",
" +;-+;+ ",
" +;+ "};

View File

@@ -1,355 +0,0 @@
/*
* Program: wxFile
*
* Author: Robert Roebling
*
* Copyright: (C) 1997, GNU (Robert Roebling)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef __GNUG__
#pragma implementation "wxFile.h"
#endif
#include "wxFile.h"
#include "wx/dnd.h"
#include "delete.xpm"
#include "home.xpm"
#include "prev.xpm"
#include "fileopen.xpm"
#include "exit.xpm"
#include "listview.xpm"
#include "iconview.xpm"
#include "reportview.xpm"
#include "treeview.xpm"
#include "commanderview.xpm"
#include "singleview.xpm"
#include "save.xpm"
#include "search.xpm"
#include "help.xpm"
//-----------------------------------------------------------------------------
// main program
//-----------------------------------------------------------------------------
IMPLEMENT_APP(MyApp)
//-----------------------------------------------------------------------------
// MyFrame
//-----------------------------------------------------------------------------
const int ID_FILECTRL = 1000;
const int ID_DIRCTRL = 1001;
const int ID_TOOLBAR = 1002;
const int ID_QUIT = 100;
const int ID_ABOUT = 101;
const int ID_LIST = 200;
const int ID_REPORT = 201;
const int ID_ICON = 202;
const int ID_SINGLE = 203;
const int ID_TREE = 204;
const int ID_COMMANDER = 205;
const int ID_HOME = 400;
const int ID_PARENT = 401;
const int ID_MOUNT = 402;
const int ID_SEARCH = 403;
const int ID_DELETE = 501;
const int ID_MD = 502;
IMPLEMENT_DYNAMIC_CLASS( MyFrame, wxFrame )
BEGIN_EVENT_TABLE(MyFrame,wxFrame)
EVT_MENU (ID_ABOUT, MyFrame::OnAbout)
EVT_MENU (ID_QUIT, MyFrame::OnCommand)
EVT_MENU (ID_HOME, MyFrame::OnCommand)
EVT_MENU (ID_PARENT, MyFrame::OnCommand)
EVT_MENU (ID_LIST, MyFrame::OnView)
EVT_MENU (ID_REPORT, MyFrame::OnView)
EVT_MENU (ID_ICON, MyFrame::OnView)
EVT_MENU (ID_TREE, MyFrame::OnView)
EVT_MENU (ID_SINGLE, MyFrame::OnView)
EVT_MENU (ID_COMMANDER, MyFrame::OnView)
EVT_LIST_KEY_DOWN (ID_FILECTRL, MyFrame::OnListKeyDown)
EVT_LIST_DELETE_ITEM (ID_FILECTRL, MyFrame::OnListDeleteItem)
EVT_LIST_END_LABEL_EDIT (ID_FILECTRL, MyFrame::OnListEndLabelEdit)
EVT_LIST_BEGIN_DRAG (ID_FILECTRL, MyFrame::OnListDrag)
EVT_TREE_KEY_DOWN (ID_DIRCTRL, MyFrame::OnTreeKeyDown)
EVT_TREE_SEL_CHANGED (ID_DIRCTRL, MyFrame::OnTreeSelected)
END_EVENT_TABLE()
MyFrame::MyFrame(void) :
wxFrame( (wxFrame *) NULL, -1, (char *) "wxFile", wxPoint(20,20), wxSize(470,360) )
{
wxMenu *file_menu = new wxMenu( "Menu 1" );
file_menu->Append( ID_ABOUT, "About..");
file_menu->Append( ID_QUIT, "Exit");
wxMenu *view_menu = new wxMenu( "Menu 2" );
view_menu->Append( ID_LIST, "List mode");
view_menu->Append( ID_REPORT, "Report mode");
view_menu->Append( ID_ICON, "Icon mode");
wxMenuBar *menu_bar = new wxMenuBar();
menu_bar->Append(file_menu, "File" );
menu_bar->Append(view_menu, "View" );
menu_bar->Show( TRUE );
SetMenuBar( menu_bar );
CreateStatusBar( 2 );
SetStatusText( "Welcome", 0 );
SetStatusText( "wxFile v0.2 by Robert Roebling.", 1 );
wxToolBar *m_tb = CreateToolBar();
m_tb->SetMargins( 2, 2 );
m_tb->AddSeparator();
m_tb->AddTool( ID_QUIT, wxBitmap( exit_xpm ), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Exit wxFile" );
m_tb->AddSeparator();
m_tb->AddTool( ID_PARENT, wxBitmap( prev_xpm ), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Go to parent directory" );
m_tb->AddTool( ID_HOME, wxBitmap( home_xpm ), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Go to home directory" );
m_tb->AddSeparator();
m_tb->AddTool( ID_DELETE, wxBitmap( delete_xpm ), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Delete file" );
m_tb->AddSeparator();
m_tb->AddTool( ID_MD, wxBitmap( fileopen_xpm ), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Create directory" );
m_tb->AddSeparator();
m_tb->AddTool( ID_LIST, wxBitmap( listview_xpm ), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "List view" );
m_tb->AddTool( ID_REPORT, wxBitmap( reportview_xpm ), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Report view" );
m_tb->AddTool( ID_ICON, wxBitmap( iconview_xpm ), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Icon view" );
m_tb->AddSeparator();
m_tb->AddTool( ID_TREE, wxBitmap( treeview_xpm ), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Tree view" );
m_tb->AddTool( ID_COMMANDER, wxBitmap( commanderview_xpm ), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Commander view" );
m_tb->AddTool( ID_SINGLE, wxBitmap( singleview_xpm ), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Single view" );
m_tb->AddSeparator();
m_tb->AddTool( ID_MOUNT, wxBitmap( search_xpm ), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Mount devices" );
m_tb->AddSeparator();
m_tb->AddTool( ID_SEARCH, wxBitmap( save_xpm ), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Find file(s)" );
m_tb->AddSeparator();
m_tb->AddTool( ID_ABOUT, wxBitmap( help_xpm ), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "About wxFile" );
m_tb->Realize();
m_splitter = new wxSplitterWindow( this, -1, wxPoint(0,0), wxSize(400,300), wxSP_3D );
m_leftFile = (wxFileCtrl *) NULL;
m_dir = new wxDirCtrl( m_splitter, ID_DIRCTRL, "/", wxPoint(10,45), wxSize(200,330) );
wxString homepath;
wxGetHomeDir( &homepath );
m_rightFile = new wxFileCtrl( m_splitter, ID_FILECTRL, homepath, wxPoint(220,5), wxSize(200,330) );
m_leftFile = new wxFileCtrl( m_splitter, ID_FILECTRL, homepath, wxPoint(0,5), wxSize(200,330) );
m_leftFile->Show( FALSE );
m_leftFile->m_lastFocus = m_rightFile;
int x = 0;
GetClientSize( &x, (int *) NULL );
m_splitter->SplitVertically( m_dir, m_rightFile, x / 3 );
m_splitter->SetMinimumPaneSize( 10 );
};
void MyFrame::OnView( wxCommandEvent &event )
{
int x = 0;
GetClientSize( &x, (int *) NULL );
switch (event.GetId())
{
case ID_LIST:
m_rightFile->ChangeToListMode();
if (m_splitter->IsSplit() && (m_splitter->GetWindow1() == m_leftFile))
m_leftFile->ChangeToListMode();
break;
case ID_REPORT:
m_rightFile->ChangeToReportMode();
if (m_splitter->IsSplit() && (m_splitter->GetWindow1() == m_leftFile))
m_leftFile->ChangeToReportMode();
break;
case ID_ICON:
m_rightFile->ChangeToIconMode();
if (m_splitter->IsSplit() && (m_splitter->GetWindow1() == m_leftFile))
m_leftFile->ChangeToIconMode();
break;
case ID_TREE:
if (m_splitter->IsSplit())
{
if (m_splitter->GetWindow1() != m_dir)
{
m_splitter->Unsplit( m_leftFile );
m_dir->Show(TRUE);
m_splitter->SplitVertically( m_dir, m_rightFile, x/3 );
};
}
else
{
m_dir->Show(TRUE);
m_splitter->SplitVertically( m_dir, m_rightFile, x/3 );
};
break;
case ID_SINGLE:
if (m_splitter->IsSplit()) m_splitter->Unsplit( m_splitter->GetWindow1() );
break;
case ID_COMMANDER:
if (m_splitter->IsSplit())
{
if (m_splitter->GetWindow1() != m_leftFile)
{
m_splitter->Unsplit( m_dir );
m_leftFile->ChangeToListMode();
m_rightFile->ChangeToListMode();
m_leftFile->Show(TRUE);
m_splitter->SplitVertically( m_leftFile, m_rightFile, x/2 );
};
}
else
{
m_leftFile->ChangeToListMode();
m_rightFile->ChangeToListMode();
m_leftFile->Show(TRUE);
m_splitter->SplitVertically( m_leftFile, m_rightFile, x/2 );
};
break;
default:
break;
};
};
void MyFrame::OnCommand( wxCommandEvent &event )
{
switch (event.GetId())
{
case ID_QUIT:
Close( TRUE );
break;
case ID_HOME:
m_leftFile->m_lastFocus->GoToHomeDir();
break;
case ID_PARENT:
m_leftFile->m_lastFocus->GoToParentDir();
break;
default:
break;
};
};
void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) )
{
wxDialog dialog( this, -1, "About wxFile", wxPoint(100,100), wxSize(540,350), wxDIALOG_MODAL );
int w = 0;
int h = 0;
dialog.GetSize( &w, &h );
int x = 30;
int y = 20;
int step = 20;
(void)new wxStaticBox( &dialog, -1, (const char*)NULL, wxPoint(10,10), wxSize(w-20,h-80) );
(void)new wxStaticText( &dialog, -1, "wxFile v0.1", wxPoint(240,y) );
y += 2*step-10;
(void)new wxStaticText( &dialog, -1, "Written by Robert Roebling, 1998.", wxPoint(x,y) );
y += 2*step;
(void)new wxStaticText( &dialog, -1,
"wxFile uses wxGTK, the GTK port of the wxWindows GUI-library.", wxPoint(x,y) );
y += step;
(void)new wxStaticText( &dialog, -1, "http://www.freiburg.linux.de/~wxxt", wxPoint(x+50,y) );
y += step;
(void)new wxStaticText( &dialog, -1, "http://web.ukonline.co.uk/julian.smart/wxwin", wxPoint(x+50,y) );
y += 2*step;
(void)new wxStaticText( &dialog, -1, "wxFile Copyright: GPL.", wxPoint(x,y) );
y += 2*step;
(void)new wxStaticText( &dialog, -1, "For questions concerning wxGTK, you may mail to:", wxPoint(x,y) );
y += step;
(void)new wxStaticText( &dialog, -1, "roebling@ruf.uni-freiburg.de", wxPoint(x+50,y) );
(void) new wxButton( &dialog, wxID_OK, "Return", wxPoint(w/2-40,h-50), wxSize(80,30) );
dialog.Fit();
dialog.ShowModal();
};
void MyFrame::OnListKeyDown( wxListEvent &event )
{
m_rightFile->m_lastFocus->OnListKeyDown( event );
};
void MyFrame::OnListDeleteItem( wxListEvent &event )
{
m_rightFile->m_lastFocus->OnListDeleteItem( event );
};
void MyFrame::OnListEndLabelEdit( wxListEvent &event )
{
m_rightFile->m_lastFocus->OnListEndLabelEdit( event );
};
void MyFrame::OnListDrag( wxListEvent &event )
{
wxFileDataObject data;
data.AddFile( "/home/karl/test.txt" );
wxDropSource drag( data, m_leftFile->m_lastFocus );
drag.DoDragDrop();
};
void MyFrame::OnTreeSelected( wxTreeEvent &event )
{
wxDirInfo *info = (wxDirInfo*) event.m_item.m_data;
if (info) SetStatusText( info->GetPath() );
};
void MyFrame::OnTreeKeyDown( wxTreeEvent &event )
{
wxDirInfo *info = (wxDirInfo*) event.m_item.m_data;
if (info) m_rightFile->GoToDir( info->GetPath() );
};
//-----------------------------------------------------------------------------
// MyApp
//-----------------------------------------------------------------------------
MyApp::MyApp(void) :
wxApp( )
{
};
bool MyApp::OnInit(void)
{
wxFrame *frame = new MyFrame();
frame->Show( TRUE );
return TRUE;
};

View File

@@ -1,85 +0,0 @@
/*
* Program: wxFile
*
* Author: Robert Roebling
*
* Copyright: (C) 1997, GNU (Robert Roebling)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __WXFILEH__
#define __WXFILEH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/wx.h"
#include "wx/dcscreen.h"
#include "wx/splitter.h"
#include "wx/toolbar.h"
#include "filectrl.h"
#include "dirctrl.h"
//-----------------------------------------------------------------------------
// derived classes
//-----------------------------------------------------------------------------
class MyFrame;
class MyApp;
//-----------------------------------------------------------------------------
// MyFrame
//-----------------------------------------------------------------------------
class MyFrame: public wxFrame
{
DECLARE_DYNAMIC_CLASS(MyFrame)
public:
MyFrame(void);
void OnCommand( wxCommandEvent &event );
void OnAbout( wxCommandEvent &event );
void OnView( wxCommandEvent &event );
void OnListKeyDown( wxListEvent &event );
void OnListDeleteItem( wxListEvent &event );
void OnListEndLabelEdit( wxListEvent &event );
void OnListDrag( wxListEvent &event );
void OnTreeSelected( wxTreeEvent &event );
void OnTreeKeyDown( wxTreeEvent &event );
wxSplitterWindow *m_splitter;
wxFileCtrl *m_rightFile;
wxFileCtrl *m_leftFile;
wxDirCtrl *m_dir;
DECLARE_EVENT_TABLE()
};
//-----------------------------------------------------------------------------
// MyApp
//-----------------------------------------------------------------------------
class MyApp: public wxApp
{
public:
MyApp(void);
virtual bool OnInit(void);
};
#endif // __WXFILEH__

View File

@@ -1,48 +0,0 @@
/* XPM */
static char * folder_xpm[] = {
"33 33 12 1",
" c None",
". c #D75CA69979E7",
"X c #208120812081",
"o c #FFFFFFFFFFFF",
"O c #B6DA79E74924",
"+ c #596559655965",
"@ c #410341034103",
"# c #514451445144",
"$ c #000000000820",
"% c #8E38596530C2",
"& c #8E3886178617",
"* c #492479E769A6",
" ",
" .. XXX ",
" .o.. X.XXX ",
" .ooo..OOOXXX ",
" .ooooo..OOOXXX ++ ",
"XXX .ooooooo..OOOXXX @#++@ ",
"XOX@X.ooooooooo...OOO@XX+X#+++ ",
"X...@@$.oooooooooo...OOXXX@X@+ ",
"O.....@XXOooooooooooo..OOOX@@X ",
"XO......@%X.ooooooooooo..%%OX@ ",
".O........@XX.oooooooooo.X%XX ",
" %O.........@@$.oooooooo.XX%X ",
" %O...........@@$.oooooo.X%X# ",
" %O.............@@X.oooo.XX%& ",
" .@...............@XX.oo.@XX ",
" %.................@X.o.XXX ",
" OO................O%X..XX@ ",
" +OO.......O..OOOOOOO@..@X& ",
" .%O....OOOOOOOOOOOOOX.+XX ",
" XOOOOOOOOOOOOOOOOOOX+*XX ",
" @OOOOO.OOOOOOOOOOOOX*+XX ",
" .%OOOOOOOOOOOOOOO%OXX#XX ",
" XOOOOOOOOOOO%O%O%%OX++& ",
" @O%O%OO%O%%O%%%%%%%XXX ",
" XXXO%%%%%%%%%%%%%%XXX ",
" OXXX%%%%%%%%%%%%@XX# ",
" OX@X%%%%%%%%%%%XXX ",
" OXXX%%%O%%%%%XXX ",
" OXXX%%%%%%%XX* ",
" OX@X%%%%X%X& ",
" OXXX%%%XX ",
" OXXX%%@ ",
" OXXX "};

View File

@@ -1 +0,0 @@
<EFBFBD>PNG

View File

@@ -1,45 +0,0 @@
/* XPM */
static char * list_xpm[] = {
"32 32 10 1",
" c #DF7DDF7DDF7D",
". c #9E799E79A699",
"X c #AEBAAEBAAEBA",
"o c #FFFFFFFFFFFF",
"O c #514451445144",
"+ c #410341034103",
"@ c #596559655965",
"# c #000000000000",
"$ c #BEFBBEFBBEFB",
"% c #208120812081",
" ",
" . ",
" Xo.. ",
" Xoooo.X ",
" Xooooooo.X ",
" XooooO+ooooXX ",
" XoooooooO+ooo.. ",
" XooooOOoooo@@ooo.. ",
" XoooooooOOooooooooo.X ",
" Xoooo@Ooooo+@oooO+oooo.X",
" Xooooooo@OoooooooooO+oooo",
" XooooooooooO@oooOOoooo@@oo",
" XooooO+ooooooooooooOOoooooo",
" XoooooooO+oooooo@Ooooo+@oooX",
" XooooOOoooo@@oooooo@OooooooOX",
" XoooooooOOooooooooooooO@oooOX#",
" Xoooo@Ooooo+@oooO+oooooooooOX#X",
"Xooooooo@OoooooooooO+ooooooOX#XX",
"O@$oooooooO@oooOOoooo@@oooOX#XX ",
"X#+@$ooooooooooooOOooooooOX#XX ",
" XX#O@ooooooo@Ooooo+@oooOX#XX ",
" XX#OXooooooo@OooooooOX#X ",
" XXO@XoooooooO@oooOX#X ",
" XX#%@XoooooooooOX#X ",
" XX#%@XooooooOX#X ",
" XX#%@XoooOX#X ",
" XX#%@XOX#X ",
" XX#+X#X ",
" XXXX ",
" ",
" ",
" "};

File diff suppressed because it is too large Load Diff