summaryrefslogtreecommitdiffstats
path: root/kpovmodeler/pmrendermodesdialog.h
blob: b2d800bb3ea495441289ae06b5b168cce4fa3b9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
//-*-C++-*-
/*
**************************************************************************
                                 description
                             --------------------
    copyright            : (C) 2001 by Andreas Zehender
    email                : zehender@kde.org
**************************************************************************

**************************************************************************
*                                                                        *
*  This program is free software; you can redistribute it and/or modify  *
*  it under the terms of the GNU General Public License as published by  *
*  the Free Software Foundation; either version 2 of the License, or     *
*  (at your option) any later version.                                   *
*                                                                        *
**************************************************************************/

#ifndef PMRENDERMODESDIALOG_H
#define PMRENDERMODESDIALOG_H

#include "pmrendermode.h"
#include <kdialogbase.h>

class TQCheckBox;
class TQComboBox;
class TQLineEdit;
class TQListBox;
class TQPushButton;
class TQTabWidget;
class KConfig;
class PMIntEdit;
class PMFloatEdit;

/**
 * Dialog for editing a list of render modes.
 * @see PMRenderMode
 */
class PMRenderModesDialog : public KDialogBase
{
   Q_OBJECT
  TQ_OBJECT
public:
   /**
    * Creates a dialog for the modes list
    */
   PMRenderModesDialog( PMRenderModeList* modes, TQWidget* parent = 0, const char* name = 0 );

   static void saveConfig( KConfig* cfg );
   static void restoreConfig( KConfig* cfg );

protected slots:
   /**
    * Called when a mode is selected in the list view
    */
   void slotModeSelected( int index );

   /**
    * Called when the add button is klicked
    */
   void slotAdd( );
   /**
    * Called when the remove button is klicked
    */
   void slotRemove( );
   /**
    * Called when the up button is klicked
    */
   void slotUp( );
   /**
    * Called when the down button is klicked
    */
   void slotDown( );
   /**
    * Called when the edit button is klicked
    */
   void slotEdit( );
   /**
    * Called when the modes are changed
    */
   void slotChanged( );
   virtual void slotOk( );
   
protected:
   virtual void resizeEvent( TQResizeEvent* ev );

private:
   void displayList( );
   void checkButtons( );
   
   PMRenderModeList* m_pOriginalModes;
   PMRenderModeList m_workingModes;
   int m_selectionIndex;

   TQListBox* m_pListBox;
   TQPushButton* m_pAddButton;
   TQPushButton* m_pRemoveButton;
   TQPushButton* m_pUpButton;
   TQPushButton* m_pDownButton;
   TQPushButton* m_pEditButton;
   static TQSize s_size;
};

/**
 * Dialog for editing one render mode
 * @see PMRenderMode
 */
class PMRenderModeDialog : public KDialogBase
{
   Q_OBJECT
  TQ_OBJECT
public:
   /**
    * Creates a dialog for the mode
    */
   PMRenderModeDialog( PMRenderMode* mode, TQWidget* parent = 0, const char* name = 0 );

   static void saveConfig( KConfig* cfg );
   static void restoreConfig( KConfig* cfg );

protected:
   virtual void resizeEvent( TQResizeEvent* ev );


protected slots:
   virtual void slotOk( );
   void slotChanged( );
   void slotTextChanged( const TQString& );
   void slotActivated( int );
   void slotSubsectionToggled( bool );
   void slotAntialiasingToggled( bool );
   void slotJitterToggled( bool );
   void slotToggled( bool );
   
private:
   /**
    * Saves the current changes. Returns true if successful.
    */
   bool saveChanges( );
   /**
    * Returns true if the data is valid
    */
   bool validate( );
   /**
    * Displays the selected mode
    */
   void displayMode( );

   void enableSubsection( bool yes );
   void enableAntialiasing( bool yes );
   void enableJitter( bool yes );
   int qualityToIndex( int quality );
   int indexToQuality( int index );
   
   PMRenderMode* m_pMode;
   
   TQTabWidget* m_pTabWidget;
   TQLineEdit* m_pDescriptionEdit;
   PMIntEdit* m_pHeightEdit;
   PMIntEdit* m_pWidthEdit;
   TQCheckBox* m_pSubsectionBox;
   PMFloatEdit* m_pStartRowEdit;
   PMFloatEdit* m_pEndRowEdit;
   PMFloatEdit* m_pStartColumnEdit;
   PMFloatEdit* m_pEndColumnEdit;
   // quality
   TQComboBox* m_pQualityCombo;
   TQCheckBox* m_pRadiosityBox;
   TQCheckBox* m_pAntialiasingBox;
   TQComboBox* m_pSamplingCombo;
   PMFloatEdit* m_pThresholdEdit;
   TQCheckBox* m_pJitterBox;
   PMFloatEdit* m_pJitterAmountEdit;
   PMIntEdit* m_pAntialiasDepthEdit;
   // output
   TQCheckBox* m_pAlphaBox;
   
   static TQSize s_size;
};

#endif