1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: textdlgg.h
|
2004-02-07 08:55:49 -05:00
|
|
|
// Purpose: wxTextEntryDialog class
|
1998-05-20 10:01:55 -04:00
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 05:34:04 -05:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __TEXTDLGH_G__
|
|
|
|
#define __TEXTDLGH_G__
|
|
|
|
|
1999-06-28 17:39:49 -04:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2005-08-31 19:48:11 -04:00
|
|
|
#if wxUSE_TEXTDLG
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#include "wx/dialog.h"
|
|
|
|
|
2002-06-23 09:51:32 -04:00
|
|
|
#if wxUSE_VALIDATORS
|
|
|
|
#include "wx/valtext.h"
|
|
|
|
#endif
|
|
|
|
|
1999-06-29 08:34:18 -04:00
|
|
|
class WXDLLEXPORT wxTextCtrl;
|
|
|
|
|
2006-01-16 09:59:55 -05:00
|
|
|
extern WXDLLEXPORT_DATA(const wxChar) wxGetTextFromUserPromptStr[];
|
|
|
|
extern WXDLLEXPORT_DATA(const wxChar) wxGetPasswordFromUserPromptStr[];
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2002-06-23 09:51:32 -04:00
|
|
|
#define wxTextEntryDialogStyle (wxOK | wxCANCEL | wxCENTRE | wxWS_EX_VALIDATE_RECURSIVELY)
|
2000-01-24 13:26:54 -05:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxTextEntryDialog: a dialog with text control, [ok] and [cancel] buttons
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1999-06-28 17:39:49 -04:00
|
|
|
class WXDLLEXPORT wxTextEntryDialog : public wxDialog
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
|
|
|
public:
|
1999-06-28 17:39:49 -04:00
|
|
|
wxTextEntryDialog(wxWindow *parent,
|
|
|
|
const wxString& message,
|
|
|
|
const wxString& caption = wxGetTextFromUserPromptStr,
|
|
|
|
const wxString& value = wxEmptyString,
|
2000-01-24 13:26:54 -05:00
|
|
|
long style = wxTextEntryDialogStyle,
|
1999-06-28 17:39:49 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2002-02-20 08:52:46 -05:00
|
|
|
void SetValue(const wxString& val);
|
1999-06-28 17:39:49 -04:00
|
|
|
wxString GetValue() const { return m_value; }
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2002-06-23 09:51:32 -04:00
|
|
|
#if wxUSE_VALIDATORS
|
2005-09-24 17:43:15 -04:00
|
|
|
void SetTextValidator( const wxTextValidator& validator );
|
2002-06-23 09:51:32 -04:00
|
|
|
void SetTextValidator( long style = wxFILTER_NONE );
|
|
|
|
wxTextValidator* GetTextValidator() { return (wxTextValidator*)m_textctrl->GetValidator(); }
|
|
|
|
#endif
|
|
|
|
// wxUSE_VALIDATORS
|
|
|
|
|
1999-06-28 17:39:49 -04:00
|
|
|
// implementation only
|
1998-05-20 10:01:55 -04:00
|
|
|
void OnOK(wxCommandEvent& event);
|
|
|
|
|
1999-06-28 17:39:49 -04:00
|
|
|
protected:
|
|
|
|
wxTextCtrl *m_textctrl;
|
|
|
|
wxString m_value;
|
2000-01-05 10:35:04 -05:00
|
|
|
long m_dialogStyle;
|
1999-06-28 17:39:49 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
2000-01-24 13:26:54 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxTextEntryDialog)
|
2003-01-02 18:38:11 -05:00
|
|
|
DECLARE_NO_COPY_CLASS(wxTextEntryDialog)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2004-11-09 14:13:15 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxPasswordEntryDialog: dialog with password control, [ok] and [cancel]
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxPasswordEntryDialog : public wxTextEntryDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxPasswordEntryDialog(wxWindow *parent,
|
|
|
|
const wxString& message,
|
|
|
|
const wxString& caption = wxGetPasswordFromUserPromptStr,
|
|
|
|
const wxString& value = wxEmptyString,
|
|
|
|
long style = wxTextEntryDialogStyle,
|
|
|
|
const wxPoint& pos = wxDefaultPosition);
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxPasswordEntryDialog)
|
|
|
|
DECLARE_NO_COPY_CLASS(wxPasswordEntryDialog)
|
|
|
|
};
|
|
|
|
|
1999-07-22 19:39:47 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
1999-07-23 17:03:02 -04:00
|
|
|
// function to get a string from user
|
1999-07-22 19:39:47 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1999-06-28 17:39:49 -04:00
|
|
|
wxString WXDLLEXPORT
|
|
|
|
wxGetTextFromUser(const wxString& message,
|
|
|
|
const wxString& caption = wxGetTextFromUserPromptStr,
|
|
|
|
const wxString& default_value = wxEmptyString,
|
|
|
|
wxWindow *parent = (wxWindow *) NULL,
|
2004-09-09 10:14:20 -04:00
|
|
|
wxCoord x = wxDefaultCoord,
|
|
|
|
wxCoord y = wxDefaultCoord,
|
2004-06-17 12:22:36 -04:00
|
|
|
bool centre = true);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2000-01-24 13:26:54 -05:00
|
|
|
wxString WXDLLEXPORT
|
|
|
|
wxGetPasswordFromUser(const wxString& message,
|
2004-11-09 14:13:15 -05:00
|
|
|
const wxString& caption = wxGetPasswordFromUserPromptStr,
|
2000-01-24 13:26:54 -05:00
|
|
|
const wxString& default_value = wxEmptyString,
|
2004-11-05 21:21:39 -05:00
|
|
|
wxWindow *parent = (wxWindow *) NULL,
|
|
|
|
wxCoord x = wxDefaultCoord,
|
|
|
|
wxCoord y = wxDefaultCoord,
|
|
|
|
bool centre = true);
|
2000-01-24 13:26:54 -05:00
|
|
|
|
2003-05-23 14:59:07 -04:00
|
|
|
#endif
|
|
|
|
// wxUSE_TEXTDLG
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
|
|
|
// __TEXTDLGH_G__
|