//-----------------------------------------------------------------------------
// wx.NET - DirDialog.cs
//
// The wxDirDialog wrapper class.
//
// Written by Bryan Bulten (bryan@bulten.ca)
// (C) 2003 Bryan Bulten
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//
// $Id: DirDialog.cs,v 1.8 2007/11/11 14:14:46 harald_meyer Exp $
//-----------------------------------------------------------------------------
using System;
using System.Drawing;
using System.Runtime.InteropServices;
namespace wx{
public class DirDialog : Dialog
{
[DllImport("wx-c")] static extern IntPtr wxDirDialog_ctor(IntPtr parent, IntPtr message, IntPtr defaultPath, uint style, int posX, int posY, int width, int height, IntPtr name);
[DllImport("wx-c")] static extern void wxDirDialog_SetPath(IntPtr self, IntPtr path);
[DllImport("wx-c")] static extern IntPtr wxDirDialog_GetPath(IntPtr self);
[DllImport("wx-c")] static extern uint wxDirDialog_GetStyle(IntPtr self);
[DllImport("wx-c")] static extern void wxDirDialog_SetStyle(IntPtr self, uint style);
[DllImport("wx-c")] static extern void wxDirDialog_SetMessage(IntPtr self, IntPtr message);
[DllImport("wx-c")] static extern IntPtr wxDirDialog_GetMessage(IntPtr self);
[DllImport("wx-c")] static extern int wxDirDialog_ShowModal(IntPtr self);
//-----------------------------------------------------------------------------
public DirDialog(IntPtr wxObject)
: base(wxObject) { }
public DirDialog(Window parent)
: this(parent, "Choose a directory", "", 0, wxDefaultPosition, wxDefaultSize, "DirDialog") { }
public DirDialog(Window parent, string message)
: this(parent, message, "", 0, wxDefaultPosition, wxDefaultSize, "DirDialog") { }
public DirDialog(Window parent, string message, string defaultPath)
: this(parent, message, defaultPath, 0, wxDefaultPosition, wxDefaultSize, "DirDialog") { }
public DirDialog(Window parent, string message, string defaultPath, uint style)
: this(parent, message, defaultPath, style, wxDefaultPosition, wxDefaultSize, "DirDialog") { }
public DirDialog(Window parent, string message, string defaultPath, uint style, Point pos)
: this(parent, message, defaultPath, style, pos, wxDefaultSize, "DirDialog") { }
public DirDialog(Window parent, string message, string defaultPath, uint style, Point pos, Size size)
: this(parent, message, defaultPath, style, pos, size, "DirDialog") { }
public DirDialog(Window parent, string message, string defaultPath, uint style, Point pos, Size size, string name)
: this(parent, wxString.SafeNew(message), wxString.SafeNew(defaultPath), style, pos.X, pos.Y, size.Width, size.Height, wxString.SafeNew(name))
{
}
public DirDialog(Window parent, wxString message, wxString defaultPath, uint style, int posX, int posY, int width, int height, wxString name)
: this(wxDirDialog_ctor(Object.SafePtr(parent), Object.SafePtr(message), Object.SafePtr(defaultPath), (uint)style, posX, posY, width, height, Object.SafePtr(name)))
{
}
//-----------------------------------------------------------------------------
public string Path
{
set
{
wxString wxValue = wxString.SafeNew(value);
wxDirDialog_SetPath(wxObject, Object.SafePtr(wxValue));
}
get { return new wxString(wxDirDialog_GetPath(wxObject), true); }
}
//-----------------------------------------------------------------------------
public string Message
{
set
{
wxString wxMessage = wxString.SafeNew(value);
wxDirDialog_SetMessage(wxObject, Object.SafePtr(wxMessage));
}
get { return new wxString(wxDirDialog_GetMessage(wxObject), true); }
}
//-----------------------------------------------------------------------------
public override int ShowModal()
{
return wxDirDialog_ShowModal(wxObject);
}
//-----------------------------------------------------------------------------
public uint style
{
set { wxDirDialog_SetStyle(wxObject, value); }
get { return wxDirDialog_GetStyle(wxObject); }
}
//-----------------------------------------------------------------------------
}
}
|