HelpWindow.cpp
上传用户:cnxinhai
上传日期:2013-08-06
资源大小:265k
文件大小:5k
- /********************************************************************************
- * *
- * H e l p W i n d o w *
- * *
- *********************************************************************************
- * Copyright (C) 1998,2001 by Jeroen van der Zijp. All Rights Reserved. *
- *********************************************************************************
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Lesser General Public *
- * License as published by the Free Software Foundation; either *
- * version 2.1 of the License, or (at your option) any later version. *
- * *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this library; if not, write to the Free Software *
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
- *********************************************************************************
- * $Id: HelpWindow.cpp,v 1.6 2001/03/14 04:10:27 jeroen Exp $ *
- *********************************************************************************
- * Modifications to the original Help Window (C) 2001, Adam Schlag *
- * no change in license is granted however; this file is still under the LGPL. *
- ********************************************************************************/
- // FOX library include file
- #include <fx.h>
- // this class' header file
- #include "HelpWindow.h"
- // this contains the text to display in the windows
- #include "FreeburnHelpText.h"
- // basic FreeBurn def file
- #include "FreeburnDefs.h"
- #include <stdio.h>
- #include <stdlib.h>
- /*******************************************************************************/
-
- FXIMPLEMENT(HelpWindow,FXDialogBox,NULL,0)
- // Construct help dialog box
- HelpWindow::HelpWindow(FXWindow *owner, const FXchar* displayText, const FXchar* titleText, FXbool useFixedFont):
- FXDialogBox(owner,titleText,DECOR_TITLE|DECOR_BORDER|DECOR_MINIMIZE|DECOR_MAXIMIZE|DECOR_CLOSE|DECOR_RESIZE|DECOR_MENU,
- 0,0,0,0, 6,6,6,6, 4,4)
- {
-
- // Bottom part
- m_closebox=new FXHorizontalFrame(this,LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH);
- m_okButton=new FXButton(m_closebox,fbHelpCloseButtonText,NULL,this,FXDialogBox::ID_ACCEPT,BUTTON_DEFAULT|LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK,0,0,0,0, 20,20,5,5);
- // Editor part
- m_editbox=new FXHorizontalFrame(this,LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK,0,0,0,0, 0,0,0,0);
- m_helptext=new FXText(m_editbox,NULL,0,TEXT_READONLY|TEXT_WORDWRAP|LAYOUT_FILL_X|LAYOUT_FILL_Y);
- m_helptext->setVisRows(30);
- m_helptext->setVisCols(80);
-
- if (useFixedFont)
- {
- FXFont* textFont = new FXFont(getApp(),FIXED_FONT,10);
- m_helptext->setFont(textFont);
- }
- else
- {
- FXFont* textFont = new FXFont(getApp(),HELP_FONT,10);
- m_helptext->setFont(textFont);
- }
-
- // Fill with help
- m_helptext->setText(displayText,strlen(displayText));
- m_helptext->setTabColumns(35);
- }
- // Clean up
- HelpWindow::~HelpWindow(){
- m_helptext=(FXText*)-1;
- }
- void HelpWindow::setWindowBaseColor(FXColor baseColor, FXColor hiliteColor, FXColor shadowColor){
- m_closebox->setBackColor(baseColor);
- m_closebox->setHiliteColor(hiliteColor);
- m_closebox->setShadowColor(shadowColor);
-
- m_editbox->setBackColor(baseColor);
- m_editbox->setHiliteColor(hiliteColor);
- m_editbox->setShadowColor(shadowColor);
-
- m_okButton->setBackColor(baseColor);
- m_okButton->setHiliteColor(hiliteColor);
- m_okButton->setShadowColor(shadowColor);
-
- m_helptext->verticalScrollbar()->setBackColor(baseColor);
- m_helptext->verticalScrollbar()->setHiliteColor(hiliteColor);
- m_helptext->verticalScrollbar()->setShadowColor(shadowColor);
-
- this->setBackColor(baseColor);
- }
-
- void HelpWindow::setWindowForeColor(FXColor color){
- m_okButton->setTextColor(color);
-
- m_helptext->setTextColor(color);
- }
-
- void HelpWindow::setWindowBackColor(FXColor color){
- m_helptext->setBackColor(color);
- }
-
- void HelpWindow::setWindowBordColor(FXColor color){
- m_closebox->setBorderColor(color);
-
- m_editbox->setBorderColor(color);
-
- m_okButton->setBorderColor(color);
-
- m_helptext->verticalScrollbar()->setBorderColor(color);
- }