]>
git.saurik.com Git - wxWidgets.git/blob - src/generic/textdlgg.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxTextEntryDialog
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "textdlgg.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
37 #include "wx/dialog.h"
38 #include "wx/button.h"
39 #include "wx/stattext.h"
40 #include "wx/textctrl.h"
46 #include "wx/statline.h"
49 #include "wx/generic/textdlgg.h"
51 // ----------------------------------------------------------------------------
53 // ----------------------------------------------------------------------------
55 static const int wxID_TEXT
= 3000;
57 // ============================================================================
59 // ============================================================================
61 // ----------------------------------------------------------------------------
63 // ----------------------------------------------------------------------------
65 BEGIN_EVENT_TABLE(wxTextEntryDialog
, wxDialog
)
66 EVT_BUTTON(wxID_OK
, wxTextEntryDialog::OnOK
)
69 IMPLEMENT_CLASS(wxTextEntryDialog
, wxDialog
)
71 wxTextEntryDialog::wxTextEntryDialog(wxWindow
*parent
,
72 const wxString
& message
,
73 const wxString
& caption
,
74 const wxString
& value
,
77 : wxDialog(parent
, -1, caption
, pos
, wxDefaultSize
,
78 wxDEFAULT_DIALOG_STYLE
| wxDIALOG_MODAL
),
81 m_dialogStyle
= style
;
86 wxBoxSizer
*topsizer
= new wxBoxSizer( wxVERTICAL
);
89 topsizer
->Add( CreateTextSizer( message
), 0, wxALL
, 10 );
92 m_textctrl
= new wxTextCtrl(this, wxID_TEXT
, value
,
93 wxDefaultPosition
, wxSize(300, -1),
94 style
& ~wxTextEntryDialogStyle
);
95 topsizer
->Add( m_textctrl
, 1, wxEXPAND
| wxLEFT
|wxRIGHT
, 15 );
99 topsizer
->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND
| wxLEFT
|wxRIGHT
|wxTOP
, 10 );
103 topsizer
->Add( CreateButtonSizer( style
), 0, wxCENTRE
| wxALL
, 10 );
105 SetAutoLayout( TRUE
);
106 SetSizer( topsizer
);
108 topsizer
->SetSizeHints( this );
109 topsizer
->Fit( this );
113 m_textctrl
->SetFocus();
118 void wxTextEntryDialog::OnOK(wxCommandEvent
& WXUNUSED(event
) )
120 m_value
= m_textctrl
->GetValue();
125 #endif // wxUSE_TEXTDLG