FreeburnAbout.cpp
上传用户:cnxinhai
上传日期:2013-08-06
资源大小:265k
文件大小:9k
- /* This is the class definition for the About 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 "FreeburnAbout.h"
- #include "FreeburnDefs.h"
- #include "FreeburnAboutText.h"
- #ifndef FREEBURN_ICONS_H
- #include "FreeburnIcons.h"
- #define FREEBURN_ICONS_H
- #endif
- FXIMPLEMENT(CFreeburnAbout,FXDialogBox,NULL,0)
- // Construct help dialog box
- CFreeburnAbout::CFreeburnAbout(FXWindow *owner):
- FXDialogBox(owner,fbAboutTitleText,DECOR_TITLE|DECOR_BORDER, 0, 0, 0, 0, 6, 6, 6, 6, 4, 4)
- {
- // Setup a vertical frame for the rest of the dialog
- FXVerticalFrame* ContentFrame = new FXVerticalFrame(this, LAYOUT_FILL_X|LAYOUT_FILL_Y);
-
- // set up the font to use in the text widgets used in the dialog
- FXFont* textFont = new FXFont(getApp(), SANS_SERIF, 10);
- // set up a fixed font for the panes that will look better with a fixed font
- FXFont* fixedFont = new FXFont(getApp(), FIXED_FONT, 10);
-
- // Setup the switcher to hold the items described in the dialog
- FXSwitcher* aboutSwitcher = new FXSwitcher(ContentFrame, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_LEFT|FRAME_RIDGE);
-
- // Place the about message in the first tab
- FXString message = fbAboutContentsText;
- FXHorizontalFrame* aboutFrame = new FXHorizontalFrame(aboutSwitcher, LAYOUT_FILL_X|LAYOUT_FILL_Y);
- // Place the dialog icon, or picture
- m_DialogIcon = new FXPNGIcon(getApp(), freeburn_fullsize_png);
- new FXLabel(aboutFrame, NULL, m_DialogIcon,LAYOUT_FILL_Y|JUSTIFY_CENTER_X|JUSTIFY_CENTER_Y,
- 0, 0, 0, 0, 0, 20, 0, 0);
- new FXLabel(aboutFrame, message, NULL, LAYOUT_FILL_X|LAYOUT_FILL_Y|JUSTIFY_LEFT|JUSTIFY_TOP);
-
- // Place the credits message in the second tab
- FXVerticalFrame* CreditsFrame = new FXVerticalFrame(aboutSwitcher,
- LAYOUT_FILL_X|LAYOUT_FILL_Y|JUSTIFY_LEFT|JUSTIFY_TOP);
- FXString credits = fbAboutCreditsText;
- FXText* creditsText = new FXText(CreditsFrame,this,ID_CREDITS_TEXT,
- LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_LEFT|TEXT_READONLY|TEXT_WORDWRAP);
- creditsText->setFont(textFont);
- creditsText->setText(credits);
- creditsText->setBackColor(getApp()->getBaseColor());
-
- // Place the license message in the third tab
- FXVerticalFrame* LicenseFrame = new FXVerticalFrame(aboutSwitcher,
- LAYOUT_FILL_X|LAYOUT_FILL_Y|JUSTIFY_LEFT|JUSTIFY_TOP);
- FXString license = fbAboutLicenseText;
- FXText* licenseText = new FXText(LicenseFrame,this,ID_LICENSE_TEXT,
- LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_LEFT|TEXT_READONLY|TEXT_WORDWRAP);
- licenseText->setFont(fixedFont);
- licenseText->setText(license);
- licenseText->setBackColor(getApp()->getBaseColor());
-
- // Place the programs message in the fourth tab
- FXVerticalFrame* ProgramsFrame = new FXVerticalFrame(aboutSwitcher,
- LAYOUT_FILL_X|LAYOUT_FILL_Y|JUSTIFY_LEFT|JUSTIFY_TOP);
- FXString programs = fbAboutProgramsText;
- FXText* programsText = new FXText(ProgramsFrame,this,ID_PROGRAMS_TEXT,
- LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_LEFT|TEXT_READONLY|TEXT_WORDWRAP);
- programsText->setFont(textFont);
- programsText->setText(programs);
- programsText->setBackColor(getApp()->getBaseColor());
-
- // Place the GPL message in the fifth tab
- FXVerticalFrame* GPLFrame = new FXVerticalFrame(aboutSwitcher,
- LAYOUT_FILL_X|LAYOUT_FILL_Y|JUSTIFY_LEFT|JUSTIFY_TOP);
- FXString GPL = fbAboutGPLText;
- FXText* GPLText = new FXText(GPLFrame,this,ID_GPL_TEXT,
- LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_LEFT|TEXT_READONLY|TEXT_WORDWRAP);
- GPLText->setFont(fixedFont);
- GPLText->setText(GPL);
- GPLText->setBackColor(getApp()->getBaseColor());
-
- // Place the LGPL message in the fifth tab
- FXVerticalFrame* LGPLFrame = new FXVerticalFrame(aboutSwitcher,
- LAYOUT_FILL_X|LAYOUT_FILL_Y|JUSTIFY_LEFT|JUSTIFY_TOP);
- FXString LGPL = fbAboutLGPLText;
- FXText* LGPLText = new FXText(LGPLFrame,this,ID_LGPL_TEXT,
- LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_LEFT|TEXT_READONLY|TEXT_WORDWRAP);
- LGPLText->setFont(fixedFont);
- LGPLText->setText(LGPL);
- LGPLText->setBackColor(getApp()->getBaseColor());
-
- // Button frame for the switcher buttons
- FXHorizontalFrame* switcherButtonFrame = new FXHorizontalFrame(ContentFrame,LAYOUT_FILL_X|PACK_UNIFORM_WIDTH);
-
- // Add buttons to handle the switcher items
- new FXButton(switcherButtonFrame, fbAboutTabText, NULL, aboutSwitcher,
- FXSwitcher::ID_OPEN_FIRST, LAYOUT_FILL_X|LAYOUT_CENTER_X|FRAME_RAISED|FRAME_THICK);
- new FXButton(switcherButtonFrame, fbAboutCreditsTabText, NULL, aboutSwitcher,
- FXSwitcher::ID_OPEN_SECOND, LAYOUT_FILL_X|LAYOUT_CENTER_X|FRAME_RAISED|FRAME_THICK);
- new FXButton(switcherButtonFrame, fbAboutLicenseTabText, NULL, aboutSwitcher,
- FXSwitcher::ID_OPEN_THIRD, LAYOUT_FILL_X|LAYOUT_CENTER_X|FRAME_RAISED|FRAME_THICK);
- new FXButton(switcherButtonFrame, fbAboutProgramsTabText, NULL, aboutSwitcher,
- FXSwitcher::ID_OPEN_FOURTH, LAYOUT_FILL_X|LAYOUT_CENTER_X|FRAME_RAISED|FRAME_THICK);
- new FXButton(switcherButtonFrame, fbAboutGPLTabText, NULL, aboutSwitcher,
- FXSwitcher::ID_OPEN_FIFTH, LAYOUT_FILL_X|LAYOUT_CENTER_X|FRAME_RAISED|FRAME_THICK);
- new FXButton(switcherButtonFrame, fbAboutLGPLTabText, NULL, aboutSwitcher,
- FXSwitcher::ID_OPEN_SIXTH, LAYOUT_FILL_X|LAYOUT_CENTER_X|FRAME_RAISED|FRAME_THICK);
-
- // Add a separator line
- new FXHorizontalSeparator(ContentFrame);
-
- // Bottom part
- FXHorizontalFrame* ButtonFrame = new FXHorizontalFrame(ContentFrame,
- LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH);
- new FXButton(ButtonFrame, fbAboutOkButtonText, NULL, this, FXDialogBox::ID_ACCEPT,
- BUTTON_DEFAULT|LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK, 0, 0, 0, 0, 20, 20, 5, 5);
- }
- // Clean up (we can't delete the stuff we created
- // for the tab book, though)
- CFreeburnAbout::~CFreeburnAbout()
- {
- delete m_DialogIcon;
- }