Author: aolk
Date: 2006-01-14 16:32:53 -0500 (Sat, 14 Jan 2006)
New Revision: 55588
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
Log:
2006-01-14 Alexander Olk <[EMAIL PROTECTED]>
* FileDialog.cs: When the file listview is focused hitting the
backspace key moves the fileview to the parent directory
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-01-14 21:07:59 UTC (rev 55587)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-01-14 21:32:53 UTC (rev 55588)
@@ -1,3 +1,8 @@
+2006-01-14 Alexander Olk <[EMAIL PROTECTED]>
+
+ * FileDialog.cs: When the file listview is focused hitting the
+ backspace key moves the fileview to the parent directory
+
2006-01-13 Peter Dennis Bartok <[EMAIL PROTECTED]>
* Form.cs:
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
2006-01-14 21:07:59 UTC (rev 55587)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
2006-01-14 21:32:53 UTC (rev 55588)
@@ -738,13 +738,9 @@
currentDirectoryInfo = new DirectoryInfo(
currentDirectoryName );
- dirComboBox.CurrentPath = currentDirectoryName;
-
if ( fileDialog.RestoreDirectory )
restoreDirectory = currentDirectoryName;
- mwfFileView.UpdateFileView(
currentDirectoryInfo );
-
openSaveButton.Click += new EventHandler(
OnClickOpenSaveButton );
cancelButton.Click += new EventHandler(
OnClickCancelButton );
helpButton.Click += new EventHandler(
OnClickHelpButton );
@@ -757,10 +753,13 @@
mwfFileView.DirectoryChanged += new
EventHandler( OnDirectoryChangedFileView );
mwfFileView.ForceDialogEnd += new EventHandler(
OnForceDialogEndFileView );
mwfFileView.SelectedFilesChanged += new
EventHandler( OnSelectedFilesChangedFileView );
+ mwfFileView.OnDirectoryUp += new EventHandler(
OnDirectoryUp );
dirComboBox.DirectoryChanged += new
EventHandler( OnDirectoryChangedDirComboBox );
checkBox.CheckedChanged += new EventHandler(
OnCheckCheckChanged );
+
+ ChangeDirectory (null,currentDirectoryName);
}
public bool MultiSelect
@@ -1102,6 +1101,12 @@
fileDialog.ReadOnlyChecked = checkBox.Checked;
}
+ void OnDirectoryUp (Object sender, EventArgs e)
+ {
+ if (currentDirectoryInfo != null &&
currentDirectoryInfo.Parent != null)
+ ChangeDirectory (null,
currentDirectoryInfo.Parent.FullName);
+ }
+
public void UpdateFilters( )
{
ArrayList filters =
fileDialog.FileFilter.FilterArrayList;
@@ -1740,6 +1745,7 @@
private EventHandler on_selected_files_changed;
private EventHandler on_directory_changed;
private EventHandler on_force_dialog_end;
+ private EventHandler on_one_directory_up;
private string fileName;
private string fullFileName;
@@ -1762,6 +1768,8 @@
LargeImageList = MimeIconEngine.LargeIcons;
View = View.List;
+
+ KeyUp += new KeyEventHandler (MWF_KeyUp);
}
public ArrayList FilterArrayList
@@ -1880,6 +1888,11 @@
UpdateFileViewByDirectoryInfo(
directoryInfo_or_string as DirectoryInfo);
else
UpdateFileViewByString( directoryInfo_or_string
as string );
+
+ if (Items.Count > 0) {
+ ListViewItem item = Items [0];
+ item.Selected = true;
+ }
}
private void UpdateFileViewByDirectoryInfo( DirectoryInfo
inputDirectoryInfo )
@@ -2192,6 +2205,14 @@
base.OnMouseMove (e);
}
+ private void MWF_KeyUp (object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.Back) {
+ if (on_one_directory_up != null)
+ on_one_directory_up (this,
EventArgs.Empty);
+ }
+ }
+
public event EventHandler SelectedFileChanged
{
add { on_selected_file_changed += value; }
@@ -2215,6 +2236,12 @@
add { on_force_dialog_end += value; }
remove { on_force_dialog_end -= value; }
}
+
+ public event EventHandler OnDirectoryUp
+ {
+ add { on_one_directory_up += value; }
+ remove { on_one_directory_up -= value; }
+ }
}
internal class FileFilter
@@ -2295,7 +2322,7 @@
this.imageIndex = imageIndex;
this.name = name;
this.path = path;
- this.XPos = xPos;
+ this.xPos = xPos;
}
public int ImageIndex
@@ -2426,9 +2453,8 @@
if( currentPath == workplace_tmp )
selection = 3;
}
- else
- child_of = CheckChildOf();
+ child_of = CheckChildOf();
BeginUpdate( );
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches