1 // Copyright (C) 2006 Erik Dahlberg
3 // This file is part of LSystem3D.
5 // LSystem3D is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // LSystem3D is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with LSystem3D; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 #include "lindenmayersystem.h"
28 #include "lsystemparameters.h"
29 #include "renderingsurface.h"
36 class GUI
: public FXMainWindow
38 // macro to set up class declaration
46 ID_GENERATE
= FXMainWindow::ID_LAST
,
53 * @param application the FOX application object
54 * @param renderingSurface the rendering surface
55 * @param lsystem the Lindenmayer-system
57 GUI(FXApp
*application
, RenderingSurface
*renderingSurface
, LindenmayerSystem
*lsystem
);
60 * Create and initialize the window
65 * Called by the system when the "Generate" button is pressed
66 * @param sender the sender object
67 * @param selector message type and id
68 * @param data event related data
71 long onGenerateButtonPressed(FXObject
*sender
, FXSelector selector
, void *data
);
74 * Called by the system when the "Help" button is pressed
75 * @param sender the sender object
76 * @param selector message type and id
77 * @param data event related data
80 long onHelpButtonPressed(FXObject
*sender
, FXSelector selector
, void *data
);
93 FXTextField
*_axiomTextField
; // Axiom
94 FXText
*_rulesText
; // Rules
95 FXRealSpinner
*_angleRealSpinner
; // Angle
96 FXSpinner
*_depthSpinner
; // Depth
98 FXRealSpinner
*_diameterRealSpinner
; // Diameter
99 FXRealSpinner
*_diameterFactorRealSpinner
; // Diameter factor
101 FXMessageBox
*_helpMessageBox
; // Help dialog
104 LindenmayerSystem
*_lsystem
; // The Lindenmayer-system
105 LSystemParameters _lsystemParameters
; // Saves/loads l-system parameters from file
106 RenderingSurface
*_renderingSurface
; // The rendering surface