1 /*
2  * Copyright (C) 2002 - David W. Durham
3  *
4  * This file is part of ReZound, an audio editing application.
5  *
6  * ReZound is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published
8  * by the Free Software Foundation; either version 2 of the License,
9  * or (at your option) any later version.
10  *
11  * ReZound is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
19  */
20 
21 #include "CUserNotesDialog.h"
22 
23 #include "../backend/CLoadedSound.h"
24 #include "../backend/CSound.h"
25 
26 CUserNotesDialog *gUserNotesDialog=NULL;
27 
28 
29 FXDEFMAP(CUserNotesDialog) CUserNotesDialogMap[]=
30 {
31 //	Message_Type			ID					Message_Handler
32 	//FXMAPFUNC(SEL_COMMAND,	CUserNotesDialog::ID_OKAY_BUTTON,	CUserNotesDialog::onOkayButton),
33 };
34 
35 
FXIMPLEMENT(CUserNotesDialog,FXModalDialogBox,CUserNotesDialogMap,ARRAYNUMBER (CUserNotesDialogMap))36 FXIMPLEMENT(CUserNotesDialog,FXModalDialogBox,CUserNotesDialogMap,ARRAYNUMBER(CUserNotesDialogMap))
37 
38 
39 
40 // ----------------------------------------
41 
42 CUserNotesDialog::CUserNotesDialog(FXWindow *mainWindow) :
43 	FXModalDialogBox(mainWindow,N_("User Notes"),450,400,FXModalDialogBox::ftVertical),
44 
45 	notesFrame(new FXPacker(getFrame(),FRAME_SUNKEN|FRAME_THICK | LAYOUT_FILL_X|LAYOUT_FILL_Y, 0,0,0,0, 0,0,0,0, 0,0)),
46 		notesTextBox(new FXText(notesFrame,NULL,0,TEXT_WORDWRAP | LAYOUT_FILL_X|LAYOUT_FILL_Y))
47 {
48 }
49 
~CUserNotesDialog()50 CUserNotesDialog::~CUserNotesDialog()
51 {
52 }
53 
show(CLoadedSound * loadedSound,FXint placement)54 void CUserNotesDialog::show(CLoadedSound *loadedSound,FXint placement)
55 {
56 	notesTextBox->setText(loadedSound->sound->getUserNotes().c_str());
57 	if(execute(placement))
58 	{
59 		loadedSound->sound->setIsModified(true);
60 		loadedSound->sound->setUserNotes(notesTextBox->getText().text());
61 	}
62 }
63 
64