FreeburnTrackTextDialog.cpp
上传用户:cnxinhai
上传日期:2013-08-06
资源大小:265k
文件大小:8k
源码类别:

DVD

开发平台:

Visual C++

  1. /* This is the class definition for the Track CD Text Dialog.
  2.  *
  3.  * Copyright (C) 2001, 2002  Adam Schlag
  4.  */
  5. /*
  6.  * FreeBurn Software License
  7.  * (based on the Apache Software License)
  8.  * 
  9.  * Version 1.1
  10.  * 
  11.  * Copyright (c) 2001, 2002 The FreeBurn Project. All rights reserved.
  12.  * 
  13.  * Redistribution and use in source and binary forms, with or without 
  14.  * modification, are permitted provided that the following conditions are met:
  15.  * 
  16.  * 1. Redistributions of source code must retain the above copyright 
  17.  * notice, this list of conditions and the following disclaimer.
  18.  * 
  19.  * 2. Redistributions in binary form must reproduce the above copyright 
  20.  * notice, this list of conditions and the following disclaimer in the 
  21.  * documentation and/or other materials provided with the distribution.
  22.  * 
  23.  * 3. The end-user documentation included with the redistribution, if any, must 
  24.  * include the following acknowledgment:
  25.  * 
  26.  *  "This product includes software developed by the FreeBurn 
  27.  *     Project (http://freeburn.sourceforge.net/)."
  28.  * 
  29.  * Alternately, this acknowledgment may appear in the software itself, 
  30.  * if and wherever such third-party acknowledgments normally appear.
  31.  * 
  32.  * 4. The names "FreeBurn" and "FreeBurn Project" must not be 
  33.  * used to endorse or promote products derived from this software 
  34.  * without prior written permission. For written permission, please 
  35.  * contact aschlag@users.sourceforge.net.
  36.  * 
  37.  * 5. Products derived from this software may not be called "FreeBurn", 
  38.  * nor may "FreeBurn" appear in their name, without prior written 
  39.  * permission of the FreeBurn Project.
  40.  * 
  41.  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED 
  42.  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
  43.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
  44.  * DISCLAIMED. IN NO EVENT SHALL THE FREEBURN PROJECT OR ITS 
  45.  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
  46.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
  47.  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
  48.  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
  49.  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
  50.  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
  51.  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
  52.  * SUCH DAMAGE.
  53.  * 
  54.  * This software consists of voluntary contributions made by many 
  55.  * individuals on behalf of the FreeBurn Project. For more 
  56.  * information on the FreeBurn Project and FreeBurn, please see 
  57.  * <http://freeburn.sourceforge.net/>.
  58.  * 
  59.  * This software is distributed with software that is released under the GNU 
  60.  * General Public License (GPL).  You can find the terms of this license in the
  61.  * file GPL.txt distributed in this package.  You can find information on the
  62.  * software distributed with this package in the file PROGRAMS.txt.
  63.  */
  64. #include <fx.h>
  65. #include <FXPNGIcon.h>
  66. #include "FreeBurn.h"
  67. #include "FreeburnTrackTextDialog.h"
  68. #include "FreeburnDefs.h"
  69. #include "FreeburnTrackTextDialogText.h"
  70. FXIMPLEMENT(CFreeburnTrackTextDialog,FXDialogBox,NULL,0)
  71. // Construct help dialog box
  72. CFreeburnTrackTextDialog::CFreeburnTrackTextDialog(FXWindow* owner):FXDialogBox(owner,
  73.     fbTrackTextDialogTitleText,DECOR_TITLE|DECOR_BORDER, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4)
  74. {
  75.     // set up the main container for the dialog
  76.     FXVerticalFrame* trackTextFrame = new FXVerticalFrame(this, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  77.     
  78.     // add the title label
  79.     new FXLabel(trackTextFrame, fbTrackTextDialogTitleLabelText, NULL, LAYOUT_LEFT);
  80.     
  81.     // add a horizontal ridge separator
  82.     new FXHorizontalSeparator(trackTextFrame, SEPARATOR_RIDGE|LAYOUT_FILL_X);
  83.     
  84.     // add a label specifying the language
  85.     new FXLabel(trackTextFrame, fbTrackTextDialogLanguageLabelText, NULL, LAYOUT_LEFT);
  86.     
  87.     // set up a matrix to hold the labels/text fields for each cd text property
  88.     FXMatrix* textMatrix = new FXMatrix(trackTextFrame, 2, 
  89.         MATRIX_BY_COLUMNS|PACK_UNIFORM_HEIGHT|LAYOUT_FILL_X|LAYOUT_CENTER_Y);
  90.         
  91.     // set the row for the title
  92.     new FXLabel(textMatrix, fbTrackTextDialogTrackTitleLabelText, NULL, LAYOUT_LEFT);
  93.     m_titleField = new FXTextField(textMatrix, 40, this, ID_LAST, 
  94.         LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
  95.         
  96.     // set the row for the performer
  97.     new FXLabel(textMatrix, fbTrackTextDialogPerformerLabelText, NULL, LAYOUT_LEFT);
  98.     m_performerField = new FXTextField(textMatrix, 40, this, ID_LAST, 
  99.         LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
  100.     
  101.     // set the row for the songwriter
  102.     new FXLabel(textMatrix, fbTrackTextDialogSongwriterLabelText, NULL, LAYOUT_LEFT);
  103.     m_songwriterField = new FXTextField(textMatrix, 40, this, ID_LAST, 
  104.         LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
  105.         
  106.     // set the row for the composer
  107.     new FXLabel(textMatrix, fbTrackTextDialogComposerLabelText, NULL, LAYOUT_LEFT);
  108.     m_composerField = new FXTextField(textMatrix, 40, this, ID_LAST, 
  109.         LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
  110.         
  111.     // set the row for the arranger
  112.     new FXLabel(textMatrix, fbTrackTextDialogArrangerLabelText, NULL, LAYOUT_LEFT);
  113.     m_arrangerField = new FXTextField(textMatrix, 40, this, ID_LAST, 
  114.         LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
  115.         
  116.     // set the row for the message
  117.     new FXLabel(textMatrix, fbTrackTextDialogMessageLabelText, NULL, LAYOUT_LEFT);
  118.     m_messageField = new FXTextField(textMatrix, 40, this, ID_LAST, 
  119.         LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
  120.     
  121.     // set the row for the isrc
  122.     new FXLabel(textMatrix, fbTrackTextDialogIsrcLabelText, NULL, LAYOUT_LEFT);
  123.     m_isrcField = new FXTextField(textMatrix, 15, this, ID_LAST, 
  124.         TEXTFIELD_LIMITED|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW);
  125.         
  126.     // set up the buttons for canceling or accepting changes
  127.     new FXHorizontalSeparator(trackTextFrame, SEPARATOR_GROOVE|LAYOUT_FILL_X);
  128.     FXHorizontalFrame* buttonFrame = new FXHorizontalFrame(trackTextFrame, LAYOUT_BOTTOM|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH);
  129.     new FXButton(buttonFrame, fbTrackTextDialogOkButtonText,     NULL, this, FXDialogBox::ID_ACCEPT,
  130.         BUTTON_DEFAULT|LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK, 0, 0, 0, 0, 20, 20);
  131.     new FXButton(buttonFrame, fbTrackTextDialogCancelButtonText, NULL, this, FXDialogBox::ID_CANCEL,
  132.         LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK,                0, 0, 0, 0, 20, 20);  
  133. }
  134. // Clean up 
  135. CFreeburnTrackTextDialog::~CFreeburnTrackTextDialog()
  136. {
  137. }
  138. void CFreeburnTrackTextDialog::setTitleString(FXString str)
  139. {
  140.     m_titleField->setText(str);
  141. }
  142. FXString CFreeburnTrackTextDialog::getTitleString()
  143. {
  144.     return m_titleField->getText();
  145. }
  146.     
  147. void CFreeburnTrackTextDialog::setPerformerString(FXString str)
  148. {
  149.     m_performerField->setText(str);
  150. }
  151. FXString CFreeburnTrackTextDialog::getPerformerString()
  152. {
  153.     return m_performerField->getText();
  154. }
  155.     
  156. void CFreeburnTrackTextDialog::setSongwriterString(FXString str)
  157. {
  158.     m_songwriterField->setText(str);
  159. }
  160. FXString CFreeburnTrackTextDialog::getSongwriterString()
  161. {
  162.     return m_songwriterField->getText();
  163. }
  164.     
  165. void CFreeburnTrackTextDialog::setComposerString(FXString str)
  166. {
  167.     m_composerField->setText(str);
  168. }
  169. FXString CFreeburnTrackTextDialog::getComposerString()
  170. {
  171.     return m_composerField->getText();
  172. }
  173.     
  174. void CFreeburnTrackTextDialog::setArrangerString(FXString str)
  175. {
  176.     m_arrangerField->setText(str);
  177. }
  178. FXString CFreeburnTrackTextDialog::getArrangerString()
  179. {
  180.     return m_arrangerField->getText();
  181. }
  182.     
  183. void CFreeburnTrackTextDialog::setMessageString(FXString str)
  184. {
  185.     m_messageField->setText(str);
  186. }
  187. FXString CFreeburnTrackTextDialog::getMessageString()
  188. {
  189.     return m_messageField->getText();
  190. }
  191.     
  192. void CFreeburnTrackTextDialog::setIsrcString(FXString str)
  193. {
  194.     m_isrcField->setText(str);
  195. }
  196. FXString CFreeburnTrackTextDialog::getIsrcString()
  197. {
  198.     return m_isrcField->getText();
  199. }