FreeburnDiscImageDialog.cpp
上传用户:cnxinhai
上传日期:2013-08-06
资源大小:265k
文件大小:7k
源码类别:
DVD
开发平台:
Visual C++
- /* This is the class definition for the Disc Image 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 "FreeburnDiscImageDialog.h"
- #include "FreeburnDefs.h"
- #include "FreeburnDiscImageDialogText.h"
- #ifndef FREEBURN_ICONS_H
- #include "FreeburnIcons.h"
- #define FREEBURN_ICONS_H
- #endif
- // Message Map for this class
- FXDEFMAP(CFreeburnDiscImageDialog) CFreeburnDiscImageDialogMap[]={
- //________Message_Type_________________________ID___________________________________Message_Handler___________
- FXMAPFUNC(SEL_COMMAND, CFreeburnDiscImageDialog::ID_COMMAND_FIELD, CFreeburnDiscImageDialog::onCmdCommandField)
- };
- FXIMPLEMENT(CFreeburnDiscImageDialog,FXDialogBox,CFreeburnDiscImageDialogMap,ARRAYNUMBER(CFreeburnDiscImageDialogMap))
- // Construct help dialog box
- CFreeburnDiscImageDialog::CFreeburnDiscImageDialog(FXWindow* owner):
- FXDialogBox(owner,fbDiscImageDialogTitleText,DECOR_TITLE|DECOR_BORDER, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4)
- {
- // set up the main container for the dialog
- FXVerticalFrame* imageDiscFrame = new FXVerticalFrame(this, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y);
- // add the title label
- new FXLabel(imageDiscFrame, fbDiscImageDialogTitleLabelText, NULL, LAYOUT_LEFT);
- // add a horizontal ridge separator
- new FXHorizontalSeparator(imageDiscFrame, SEPARATOR_RIDGE|LAYOUT_FILL_X);
- // set up a label specifying that we're going to run mkisofs, as well as
- // a button to open the mkisofs online man page for extra help
- FXMatrix* imageProgramMatrix = new FXMatrix(imageDiscFrame, 2, MATRIX_BY_COLUMNS|PACK_UNIFORM_HEIGHT|LAYOUT_FILL_X);
- // this is a radio button for specifying TAO recording with cdrecord
- new FXLabel(imageProgramMatrix, fbDiscImageDialogMkisofsText, NULL,
- LAYOUT_CENTER_Y|LAYOUT_FILL_COLUMN|ICON_BEFORE_TEXT);
- // this adds a button that will show the mkisofs man page
- m_MkisofsHelp = new FXButton(imageProgramMatrix, fbDiscImageDialogMkisofsHelpButtonText, NULL, owner,
- CFreeBurn::ID_HELP_MKISOFS, BUTTON_NORMAL);
- // now add a check button that will allow an option to run the command through a UNIX shell
- m_commandFlag = new FXCheckButton(imageDiscFrame, fbDiscImageDialogUseUnixShellText, this, ID_LAST,
- ICON_BEFORE_TEXT|LAYOUT_LEFT);
- // horizontal line to separate the sections
- new FXHorizontalSeparator(imageDiscFrame, SEPARATOR_LINE|LAYOUT_FILL_X);
- // Label identifying the text field to specify command line options
- new FXLabel(imageDiscFrame, fbDiscImageDialogCommandLineOptsText, NULL, LAYOUT_LEFT);
- // The text field to specify the command line options
- m_commandField = new FXTextField(imageDiscFrame, 50, this, ID_COMMAND_FIELD,
- TEXTFIELD_ENTER_ONLY|FRAME_SUNKEN|FRAME_THICK|LAYOUT_LEFT);
- // set up the buttons for canceling or accepting changes
- new FXHorizontalSeparator(imageDiscFrame, SEPARATOR_GROOVE|LAYOUT_FILL_X);
- FXHorizontalFrame* buttonFrame = new FXHorizontalFrame(imageDiscFrame, LAYOUT_BOTTOM|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH);
- new FXButton(buttonFrame, fbDiscImageDialogOkButtonText, NULL, this, FXDialogBox::ID_ACCEPT,
- BUTTON_DEFAULT|LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK, 0, 0, 0, 0, 20, 20);
- new FXButton(buttonFrame, fbDiscImageDialogCancelButtonText, NULL, this, FXDialogBox::ID_CANCEL,
- LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK, 0, 0, 0, 0, 20, 20);
- }
- // Clean up
- CFreeburnDiscImageDialog::~CFreeburnDiscImageDialog()
- {
- }
- // Set the icon for the help button(s) in the dialog
- void CFreeburnDiscImageDialog::setHelpIcon(FXIcon* helpIcon)
- {
- m_MkisofsHelp->setIcon(helpIcon);
- }
- // set the use unix shell flag
- void CFreeburnDiscImageDialog::setShellFlag(FXbool flag)
- {
- m_commandFlag->setCheck(flag);
- }
- // get the use unix shell flag
- FXbool CFreeburnDiscImageDialog::getShellFlag()
- {
- return m_commandFlag->getCheck();
- }
- // get the command line string
- void CFreeburnDiscImageDialog::setCommandString(FXString string)
- {
- m_commandField->setText(string);
- }
- // set the command line string
- FXString CFreeburnDiscImageDialog::getCommandString()
- {
- return m_commandField->getText();
- }
- long CFreeburnDiscImageDialog::onCmdCommandField(FXObject* sender, FXSelector sel, void* ptr)
- {
- // on an accept from the text area (enter on the keyboard), close the dialog
- FXDialogBox::onCmdAccept(sender, sel, ptr);
- return 1;
- }