1
//////////////////////////////////////////////////////////////////////////////
2
//////////////////////////////////////////////////////////////////////////////
4
// copyright : (C) 2008 by Eran Ifrah
5
// file name : add_option_dialog.cpp
7
// -------------------------------------------------------------------------
10
// / __ \ | | | | (_) |
11
// | / \/ ___ __| | ___| | _| |_ ___
12
// | | / _ \ / _ |/ _ \ | | | __/ _ )
13
// | \__/\ (_) | (_| | __/ |___| | || __/
14
// \____/\___/ \__,_|\___\_____/_|\__\___|
18
// This program is free software; you can redistribute it and/or modify
19
// it under the terms of the GNU General Public License as published by
20
// the Free Software Foundation; either version 2 of the License, or
21
// (at your option) any later version.
23
//////////////////////////////////////////////////////////////////////////////
24
//////////////////////////////////////////////////////////////////////////////
25
///////////////////////////////////////////////////////////////////////////
26
// C++ code generated with wxFormBuilder (version May 5 2007)
27
// http://www.wxformbuilder.org/
29
// PLEASE DO "NOT" EDIT THIS FILE!
30
///////////////////////////////////////////////////////////////////////////
34
#include "wx/wxprec.h"
44
#include "add_option_dialog.h"
45
#include "wx/tokenzr.h"
46
#include <wx/txtstrm.h>
47
#include <wx/sstream.h>
49
///////////////////////////////////////////////////////////////////////////
51
AddOptionDlg::AddOptionDlg( wxWindow* parent, wxString value, int id, wxString title, wxPoint pos, wxSize size, int style ) : wxDialog( parent, id, title, pos, size, style )
53
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
56
bSizer23 = new wxBoxSizer( wxVERTICAL );
58
m_text = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB|wxTE_RICH2);
59
bSizer23->Add( m_text, 1, wxALL|wxEXPAND, 5 );
61
m_staticline9 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
62
bSizer23->Add( m_staticline9, 0, wxEXPAND | wxALL, 5 );
65
bSizer24 = new wxBoxSizer( wxHORIZONTAL );
67
m_buttonOK = new wxButton( this, wxID_OK, wxT("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
68
bSizer24->Add( m_buttonOK, 0, wxALL, 5 );
70
m_buttonCancel = new wxButton( this, wxID_CANCEL, wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
71
bSizer24->Add( m_buttonCancel, 0, wxALL, 5 );
73
bSizer23->Add( bSizer24, 0, wxALIGN_RIGHT, 5 );
75
wxStringTokenizer tkz(value, wxT(";"));
76
while(tkz.HasMoreTokens()){
77
wxString token = tkz.GetNextToken();
79
token = token.Trim(false);
80
m_text->AppendText(token + wxT("\n"));
83
this->SetSizer( bSizer23 );
87
wxString AddOptionDlg::GetValue() const
89
wxStringInputStream input(m_text->GetValue());
90
wxTextInputStream text(input);
93
while( !input.Eof() ){
96
value += text.ReadLine();
99
return value.BeforeLast(wxT(';'));