ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

editrecorddialog.cpp

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #include "editrecorddialog.h"
00024 #include "gui/widgets/edittext.h"
00025 #include "common/translation.h"
00026 
00027 
00028 namespace GUI {
00029 
00030 const Common::String EditRecordDialog::getAuthor() {
00031     return _authorEdit->getEditString();
00032 }
00033 
00034 void EditRecordDialog::setAuthor(const Common::String &author) {
00035     _authorEdit->setEditString(author);
00036 }
00037 
00038 const Common::String EditRecordDialog::getNotes() {
00039     return _notesEdit->getEditString();
00040 }
00041 
00042 void EditRecordDialog::setNotes(const Common::String &desc) {
00043     _notesEdit->setEditString(desc);
00044 }
00045 
00046 const Common::String EditRecordDialog::getName() {
00047     return _nameEdit->getEditString();
00048 }
00049 
00050 void EditRecordDialog::setName(const Common::String &name) {
00051     _nameEdit->setEditString(name);
00052 }
00053 
00054 EditRecordDialog::~EditRecordDialog() {
00055 }
00056 
00057 EditRecordDialog::EditRecordDialog(const Common::String author, const Common::String name, const Common::String notes) : Dialog("EditRecordDialog") {
00058     new StaticTextWidget(this,"EditRecordDialog.AuthorLabel",_("Author:"));
00059     new StaticTextWidget(this,"EditRecordDialog.NameLabel",_("Name:"));
00060     new StaticTextWidget(this,"EditRecordDialog.NotesLabel",_("Notes:"));
00061     _authorEdit = new EditTextWidget(this, "EditRecordDialog.AuthorEdit","");
00062     _notesEdit = new EditTextWidget(this, "EditRecordDialog.NotesEdit","");
00063     _nameEdit = new EditTextWidget(this, "EditRecordDialog.NameEdit","");
00064     _authorEdit->setEditString(author);
00065     _notesEdit->setEditString(notes);
00066     _nameEdit->setEditString(name);
00067     new GUI::ButtonWidget(this, "EditRecordDialog.Cancel", _("Cancel"), 0, kCloseCmd);
00068     new GUI::ButtonWidget(this, "EditRecordDialog.OK", _("Ok"), 0, kOKCmd);
00069 }
00070 
00071 void EditRecordDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
00072     switch(cmd) {
00073     case kCloseCmd:
00074         setResult(kCloseCmd);
00075         close();
00076         break;
00077     case kOKCmd:
00078         setResult(kOKCmd);
00079         close();
00080         break;
00081     default:
00082         Dialog::handleCommand(sender, cmd, data);
00083         break;
00084     }
00085 }
00086 
00087 }


Generated on Sat Jul 20 2019 05:01:01 for ResidualVM by doxygen 1.7.1
curved edge   curved edge