1 /********************************************************************************
2 *                                                                               *
3 *                            H e l p   W i n d o w                              *
4 *                                                                               *
5 *********************************************************************************
6 * Copyright (C) 1998,2021 by Jeroen van der Zijp.   All Rights Reserved.        *
7 *********************************************************************************
8 * This program is free software: you can redistribute it and/or modify          *
9 * it under the terms of the GNU General Public License as published by          *
10 * the Free Software Foundation, either version 3 of the License, or             *
11 * (at your option) any later version.                                           *
12 *                                                                               *
13 * This program is distributed in the hope that it will be useful,               *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
16 * GNU General Public License for more details.                                  *
17 *                                                                               *
18 * You should have received a copy of the GNU General Public License             *
19 * along with this program.  If not, see <http://www.gnu.org/licenses/>.         *
20 ********************************************************************************/
21 #include "fx.h"
22 #include "HelpWindow.h"
23 
24 
25 /*******************************************************************************/
26 
27 
28 FXIMPLEMENT(HelpWindow,FXDialogBox,NULL,0)
29 
30 
31 // Construct help dialog box
HelpWindow(FXWindow * own,const FXString & ttl)32 HelpWindow::HelpWindow(FXWindow *own,const FXString& ttl):FXDialogBox(own,ttl,DECOR_TITLE|DECOR_BORDER|DECOR_RESIZE|DECOR_CLOSE,0,0,0,0, 6,6,6,6, 4,4){
33 
34   // Bottom part
35   FXHorizontalFrame *closebox=new FXHorizontalFrame(this,LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH);
36   FXButton *button=new FXButton(closebox,tr("&Close"),NULL,this,FXDialogBox::ID_ACCEPT,BUTTON_INITIAL|BUTTON_DEFAULT|LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK,0,0,0,0, 20,20,5,5);
37 
38   // Text part
39   FXHorizontalFrame *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);
40   helptext=new FXText(editbox,NULL,0,TEXT_READONLY|TEXT_WORDWRAP|LAYOUT_FILL_X|LAYOUT_FILL_Y);
41   helptext->setVisibleRows(50);
42   helptext->setVisibleColumns(90);
43   button->setFocus();
44   }
45 
46 
47 // Set help text
setHelp(const FXString & help)48 void HelpWindow::setHelp(const FXString& help){
49   helptext->setText(help);
50   }
51 
52 
53 // Obtain help text
getHelp() const54 FXString HelpWindow::getHelp() const {
55   return helptext->getText();
56   }
57 
58 
59 // Clean up
~HelpWindow()60 HelpWindow::~HelpWindow(){
61   helptext=(FXText*)-1;
62   }
63