FreeburnGlobalTextDialog.cpp
上传用户:cnxinhai
上传日期:2013-08-06
资源大小:265k
文件大小:9k
源码类别:
DVD
开发平台:
Visual C++
- /* This is the class definition for the Global CD Text Dialog.
- *
- * Copyright (C) 2001, 2002 Adam Schlag
- */
- /*
- * FreeBurn Software License
- * (based on the Apache Software License)
- *
- * Version 1.1
- *
- * Copyright (c) 2001, 2002 The FreeBurn Project. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment:
- *
- * "This product includes software developed by the FreeBurn
- * Project (http://freeburn.sourceforge.net/)."
- *
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FreeBurn" and "FreeBurn Project" must not be
- * used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please
- * contact aschlag@users.sourceforge.net.
- *
- * 5. Products derived from this software may not be called "FreeBurn",
- * nor may "FreeBurn" appear in their name, without prior written
- * permission of the FreeBurn Project.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE FREEBURN PROJECT OR ITS
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the FreeBurn Project. For more
- * information on the FreeBurn Project and FreeBurn, please see
- * <http://freeburn.sourceforge.net/>.
- *
- * This software is distributed with software that is released under the GNU
- * General Public License (GPL). You can find the terms of this license in the
- * file GPL.txt distributed in this package. You can find information on the
- * software distributed with this package in the file PROGRAMS.txt.
- */
- #include <fx.h>
- #include <FXPNGIcon.h>
- #include "FreeBurn.h"
- #include "FreeburnGlobalTextDialog.h"
- #include "FreeburnDefs.h"
- #include "FreeburnGlobalTextDialogText.h"
- FXIMPLEMENT(CFreeburnGlobalTextDialog,FXDialogBox,NULL,0)
- // Construct help dialog box
- CFreeburnGlobalTextDialog::CFreeburnGlobalTextDialog(FXWindow* owner):FXDialogBox(owner,
- fbGlobalTextDialogTitleText,DECOR_TITLE|DECOR_BORDER, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4)
- {
- // set up the main container for the dialog
- FXVerticalFrame* globalTextFrame = new FXVerticalFrame(this, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y);
- // add the title label
- new FXLabel(globalTextFrame, fbGlobalTextDialogTitleLabelText, NULL, LAYOUT_LEFT);
- // add a horizontal ridge separator
- new FXHorizontalSeparator(globalTextFrame, SEPARATOR_RIDGE|LAYOUT_FILL_X);
- // add a label specifying the language
- new FXLabel(globalTextFrame, fbGlobalTextDialogLanguageLabelText, NULL, LAYOUT_LEFT);
- // set up a matrix to hold the labels/text fields for each cd text property
- FXMatrix* textMatrix = new FXMatrix(globalTextFrame, 2,
- MATRIX_BY_COLUMNS|PACK_UNIFORM_HEIGHT|LAYOUT_FILL_X|LAYOUT_CENTER_Y);
- // set the row for the title
- new FXLabel(textMatrix, fbGlobalTextDialogCdTitleLabelText, NULL, LAYOUT_LEFT);
- m_titleField = new FXTextField(textMatrix, 40, this, ID_LAST,
- LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
- // set the row for the performer
- new FXLabel(textMatrix, fbGlobalTextDialogPerformerLabelText, NULL, LAYOUT_LEFT);
- m_performerField = new FXTextField(textMatrix, 40, this, ID_LAST,
- LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
- // set the row for the songwriter
- new FXLabel(textMatrix, fbGlobalTextDialogSongwriterLabelText, NULL, LAYOUT_LEFT);
- m_songwriterField = new FXTextField(textMatrix, 40, this, ID_LAST,
- LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
- // set the row for the composer
- new FXLabel(textMatrix, fbGlobalTextDialogComposerLabelText, NULL, LAYOUT_LEFT);
- m_composerField = new FXTextField(textMatrix, 40, this, ID_LAST,
- LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
- // set the row for the arranger
- new FXLabel(textMatrix, fbGlobalTextDialogArrangerLabelText, NULL, LAYOUT_LEFT);
- m_arrangerField = new FXTextField(textMatrix, 40, this, ID_LAST,
- LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
- // set the row for the message
- new FXLabel(textMatrix, fbGlobalTextDialogMessageLabelText, NULL, LAYOUT_LEFT);
- m_messageField = new FXTextField(textMatrix, 40, this, ID_LAST,
- LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
- // set the row for the discid
- new FXLabel(textMatrix, fbGlobalTextDialogDiscidLabelText, NULL, LAYOUT_LEFT);
- m_discidField = new FXTextField(textMatrix, 40, this, ID_LAST,
- LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
- // set the row for the genre
- new FXLabel(textMatrix, fbGlobalTextDialogGenreLabelText, NULL, LAYOUT_LEFT);
- m_genreField = new FXTextField(textMatrix, 40, this, ID_LAST,
- LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
- // set up the buttons for canceling or accepting changes
- new FXHorizontalSeparator(globalTextFrame, SEPARATOR_GROOVE|LAYOUT_FILL_X);
- FXHorizontalFrame* buttonFrame = new FXHorizontalFrame(globalTextFrame, LAYOUT_BOTTOM|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH);
- new FXButton(buttonFrame, fbGlobalTextDialogOkButtonText, NULL, this, FXDialogBox::ID_ACCEPT,
- BUTTON_DEFAULT|LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK, 0, 0, 0, 0, 20, 20);
- new FXButton(buttonFrame, fbGlobalTextDialogCancelButtonText, NULL, this, FXDialogBox::ID_CANCEL,
- LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK, 0, 0, 0, 0, 20, 20);
- }
- // Clean up
- CFreeburnGlobalTextDialog::~CFreeburnGlobalTextDialog()
- {
- }
- void CFreeburnGlobalTextDialog::setTitleString(FXString str)
- {
- m_titleField->setText(str);
- }
- FXString CFreeburnGlobalTextDialog::getTitleString()
- {
- return m_titleField->getText();
- }
- void CFreeburnGlobalTextDialog::setPerformerString(FXString str)
- {
- m_performerField->setText(str);
- }
- FXString CFreeburnGlobalTextDialog::getPerformerString()
- {
- return m_performerField->getText();
- }
- void CFreeburnGlobalTextDialog::setSongwriterString(FXString str)
- {
- m_songwriterField->setText(str);
- }
- FXString CFreeburnGlobalTextDialog::getSongwriterString()
- {
- return m_songwriterField->getText();
- }
- void CFreeburnGlobalTextDialog::setComposerString(FXString str)
- {
- m_composerField->setText(str);
- }
- FXString CFreeburnGlobalTextDialog::getComposerString()
- {
- return m_composerField->getText();
- }
- void CFreeburnGlobalTextDialog::setArrangerString(FXString str)
- {
- m_arrangerField->setText(str);
- }
- FXString CFreeburnGlobalTextDialog::getArrangerString()
- {
- return m_arrangerField->getText();
- }
- void CFreeburnGlobalTextDialog::setMessageString(FXString str)
- {
- m_messageField->setText(str);
- }
- FXString CFreeburnGlobalTextDialog::getMessageString()
- {
- return m_messageField->getText();
- }
- void CFreeburnGlobalTextDialog::setDiscidString(FXString str)
- {
- m_discidField->setText(str);
- }
- FXString CFreeburnGlobalTextDialog::getDiscidString()
- {
- return m_discidField->getText();
- }
- void CFreeburnGlobalTextDialog::setGenreString(FXString str)
- {
- m_genreField->setText(str);
- }
- FXString CFreeburnGlobalTextDialog::getGenreString()
- {
- return m_genreField->getText();
- }