2
The contents of this file are subject to the Initial Developer's Public
3
License Version 1.0 (the "License"); you may not use this file except in
4
compliance with the License. You may obtain a copy of the License here:
5
http://www.flamerobin.org/license.html.
7
Software distributed under the License is distributed on an "AS IS"
8
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
9
License for the specific language governing rights and limitations under
12
The Original Code is FlameRobin (TM).
14
The Initial Developer of the Original Code is Milan Babuskov.
16
Portions created by the original developer
17
are Copyright (C) 2004 Milan Babuskov.
23
Contributor(s): Michael Hieke, Nando Dessena
26
// For compilers that support precompilation, includes "wx/wx.h".
27
#include "wx/wxprec.h"
33
// for all others, include the necessary headers (this file is usually all you
34
// need because it includes almost all "standard" wxWindows headers
38
//-----------------------------------------------------------------------------
39
// -*- C++ -*- generated by wxGlade 0.2.2 on Fri Aug 27 10:36:29 2004
42
#include "MultilineEnterDialog.h"
43
#include "styleguide.h"
44
//-----------------------------------------------------------------------------
45
bool GetMultilineTextFromUser(const wxString& caption, wxString& default_value, wxWindow *parent)
47
wxString result(default_value);
48
MultilineEnterDialog med(parent, caption, &result);
49
if (wxOK == med.ShowModal())
51
default_value = result;
57
//-----------------------------------------------------------------------------
58
BEGIN_EVENT_TABLE(MultilineEnterDialog, BaseDialog)
59
EVT_BUTTON(MultilineEnterDialog::ID_button_ok, MultilineEnterDialog::OnOkButtonClick)
61
//-----------------------------------------------------------------------------
62
void MultilineEnterDialog::OnOkButtonClick(wxCommandEvent& WXUNUSED(event))
64
*value = text_ctrl_1->GetValue();
67
//-----------------------------------------------------------------------------
68
//void MultilineEnterDialog::OnCancelButtonClick(wxCommandEvent& WXUNUSED(event))
69
//-----------------------------------------------------------------------------
70
MultilineEnterDialog::MultilineEnterDialog(wxWindow* parent, const wxString& title, wxString* initialText):
71
BaseDialog(parent, -1, title)
74
text_ctrl_1 = new wxTextCtrl(this, -1, *initialText, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
75
button_ok = new wxButton(this, ID_button_ok, _("OK"));
76
button_cancel = new wxButton(this, ID_button_cancel, _("Cancel"));
78
button_ok->SetDefault();
80
//-----------------------------------------------------------------------------
81
void MultilineEnterDialog::do_layout()
83
wxBoxSizer* sizerControls = new wxBoxSizer(wxHORIZONTAL);
84
text_ctrl_1->SetSizeHints(300, 150);
85
text_ctrl_1->SetSize(300, 150);
86
sizerControls->Add(text_ctrl_1, 1, wxEXPAND);
87
wxSizer* sizerButtons = styleguide().createButtonSizer(button_ok, button_cancel);
88
layoutSizers(sizerControls, sizerButtons, true);
90
//-----------------------------------------------------------------------------
91
const std::string MultilineEnterDialog::getName() const
93
return "MultilineEnterDialog";
95
//-----------------------------------------------------------------------------