]> git.saurik.com Git - wxWidgets.git/blame - user/wxFile/filectrl.h
wxFrame::CreateToolBar() stuff
[wxWidgets.git] / user / wxFile / filectrl.h
CommitLineData
c801d85f
KB
1/*
2 * Author: Robert Roebling
3 *
4 * Copyright: (C) 1997,1998 Robert Roebling
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the wxWindows Licence, which
8 * you have received with this library (see Licence.htm).
9 *
10 */
11
12#ifndef FileList_h
13#define FileList_h
14
15#ifdef __GNUG__
16#pragma interface
17#endif
18
19#include "wx/wx.h"
20#include "wx/listctrl.h"
21
22//-----------------------------------------------------------------------------
23// derived classes
24//-----------------------------------------------------------------------------
25
26class wxFileData;
27class wxFileCtrl;
28
29//-----------------------------------------------------------------------------
30// wxFileData
31//-----------------------------------------------------------------------------
32
33class wxFileData : public wxObject
34{
35 DECLARE_DYNAMIC_CLASS(wxFileData);
36
37 private:
38 wxString m_name;
39 wxString m_fileName;
40 long m_size;
41 int m_hour;
42 int m_minute;
43 int m_year;
44 int m_month;
45 int m_day;
46 wxString m_permissions;
47 bool m_isDir;
48 bool m_isLink;
49 bool m_isExe;
50
51 public:
52 wxFileData( void ) {};
53 wxFileData( const wxString &name, const wxString &fname );
54 wxString GetName(void) const;
55 wxString GetFullName(void) const;
56 wxString GetHint(void) const;
57 wxString GetEntry( const int num );
58 bool IsDir( void );
59 bool IsLink( void );
60 bool IsExe( void );
61 long GetSize( void );
62 bool NewNameIsLegal( const wxString &s );
63 bool Rename( const wxString &s );
64 void MakeItem( wxListItem &item );
65};
66
67//-----------------------------------------------------------------------------
68// wxFileCtrl
69//-----------------------------------------------------------------------------
70
71class wxFileCtrl : public wxListCtrl
72{
73 DECLARE_DYNAMIC_CLASS(wxFileCtrl);
74
75 public:
76
77 static wxFileCtrl* m_lastFocus;
78
79 private:
80 wxString m_dirName;
81 bool m_showHidden;
82
83 public:
84 wxFileCtrl( void );
85 wxFileCtrl( wxWindow *win, const wxWindowID id, const wxString &dirName,
86 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
87 const long style = wxLC_LIST, const wxString &name = "filelist" );
88 void ChangeToListMode();
89 void ChangeToReportMode();
90 void ChangeToIconMode();
91 void ShowHidden( bool show = TRUE );
92 void Update( void );
93 virtual void StatusbarText( char *WXUNUSED(text) ) {};
94 int FillList( wxStringList &list );
95 void DeleteFiles(void);
96 void CopyFiles( char *dest );
97 void MoveFiles( char *dest );
98 void RenameFile(void);
99 void MakeDir(void);
100 void GoToParentDir(void);
101 void GoToHomeDir(void);
102 void GoToDir( const wxString &dir );
103 void GetDir( wxString &dir );
104 void OnListDeleteItem( wxListEvent &event );
105 void OnListKeyDown( wxListEvent &event );
106 void OnListEndLabelEdit( wxListEvent &event );
107 void OnSetFocus( wxFocusEvent &event );
108
109 DECLARE_EVENT_TABLE()
110};
111
112#endif // FileList_h