2018-12-19 00:13:18 +08:00
/*
2022-07-19 19:40:43 +08:00
Copyright ( c ) 2008 - 2022 Jan W . Krieger ( < jan @ jkrieger . de > )
2018-12-19 00:13:18 +08:00
This software is free software : you can redistribute it and / or modify
it under the terms of the GNU Lesser General Public License ( LGPL ) as published by
2019-02-08 00:24:46 +08:00
the Free Software Foundation , either version 2.1 of the License , or
2018-12-19 00:13:18 +08:00
( at your option ) any later version .
This program 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 ( LGPL ) for more details .
You should have received a copy of the GNU Lesser General Public License ( LGPL )
along with this program . If not , see < http : //www.gnu.org/licenses/>.
*/
# ifndef JKQTPCOMBOBOXES_H
# define JKQTPCOMBOBOXES_H
# include "jkqtplotter/jkqtpbaseplotter.h"
2019-06-22 20:21:32 +08:00
# include "jkqtplotter/jkqtplotter_imexport.h"
2019-06-20 22:06:31 +08:00
# include "jkqtplotter/graphs/jkqtpimage.h"
2018-12-19 00:13:18 +08:00
# include <QComboBox>
2019-05-30 04:40:02 +08:00
# include "jkqtplotter/jkqtpimagetools.h"
# include "jkqtplotter/jkqtptools.h"
2018-12-19 00:13:18 +08:00
/*! \brief class to plot an image from an 2-dimensional array of values
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
2019-01-13 01:53:16 +08:00
\ image html JKQTPMathImageColorPaletteComboBox . png
2018-12-19 00:13:18 +08:00
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPMathImageColorPaletteComboBox : public QComboBox {
2018-12-19 00:13:18 +08:00
Q_OBJECT
public :
JKQTPMathImageColorPaletteComboBox ( QWidget * parent = nullptr ) ;
JKQTPMathImageColorPalette colorPalette ( ) const ;
JKQTPMathImageColorPalette currentColorPalette ( ) const ;
JKQTPMathImageColorPalette getColorPalette ( ) const ;
void setColorPalette ( JKQTPMathImageColorPalette palette ) ;
void setCurrentColorPalette ( JKQTPMathImageColorPalette palette ) ;
2023-07-22 20:26:02 +08:00
Q_SIGNALS :
2018-12-19 00:13:18 +08:00
void currentPaletteChanged ( JKQTPMathImageColorPalette palette ) ;
2023-07-22 20:26:02 +08:00
protected Q_SLOTS :
2018-12-19 00:13:18 +08:00
void intIndexChanged ( int i ) ;
} ;
2019-01-20 17:49:29 +08:00
/*! \brief a QComboBox which shows JKQTPCADrawMode
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPCADrawModeComboBox : public QComboBox {
2018-12-19 00:13:18 +08:00
Q_OBJECT
public :
2019-01-20 17:49:29 +08:00
JKQTPCADrawModeComboBox ( QWidget * parent = nullptr ) ;
2018-12-19 00:13:18 +08:00
2019-01-20 17:49:29 +08:00
JKQTPCADrawMode getDrawMode ( ) const ;
void setDrawMode ( JKQTPCADrawMode position ) ;
2018-12-19 00:13:18 +08:00
protected :
2019-01-20 17:49:29 +08:00
void addDrawMode ( JKQTPCADrawMode position , const QString & name , const QIcon & icon = QIcon ( ) ) ;
2018-12-19 00:13:18 +08:00
} ;
2019-01-20 17:49:29 +08:00
/*! \brief a QComboBox which shows JKQTPCALabelType
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPCALabelTypeComboBox : public QComboBox {
2018-12-19 00:13:18 +08:00
Q_OBJECT
public :
2019-01-20 17:49:29 +08:00
JKQTPCALabelTypeComboBox ( QWidget * parent = nullptr ) ;
2018-12-19 00:13:18 +08:00
2019-01-20 17:49:29 +08:00
JKQTPCALabelType getLabelType ( ) const ;
void setLabelType ( JKQTPCALabelType position ) ;
2018-12-19 00:13:18 +08:00
protected :
2019-01-20 17:49:29 +08:00
void addLabelType ( JKQTPCALabelType position , const QString & name , const QIcon & icon = QIcon ( ) ) ;
2018-12-19 00:13:18 +08:00
} ;
2019-01-20 17:49:29 +08:00
/*! \brief a QComboBox which shows JKQTPLabelPosition
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPLabelPositionComboBox : public QComboBox {
2018-12-19 00:13:18 +08:00
Q_OBJECT
public :
2019-01-20 17:49:29 +08:00
JKQTPLabelPositionComboBox ( QWidget * parent = nullptr ) ;
2018-12-19 00:13:18 +08:00
2019-01-20 17:49:29 +08:00
JKQTPLabelPosition getPosition ( ) const ;
void setPosition ( JKQTPLabelPosition position ) ;
2018-12-19 00:13:18 +08:00
protected :
2019-01-20 17:49:29 +08:00
void addPosition ( JKQTPLabelPosition position , const QString & name , const QIcon & icon = QIcon ( ) ) ;
2018-12-19 00:13:18 +08:00
} ;
2019-01-20 17:49:29 +08:00
/*! \brief a QComboBox which shows JKQTPKeyPosition
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2019-01-20 17:49:29 +08:00
\ image html JKQTPKeyPositionComboBox . png
2018-12-19 00:13:18 +08:00
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPKeyPositionComboBox : public QComboBox {
2018-12-19 00:13:18 +08:00
Q_OBJECT
public :
2019-01-20 17:49:29 +08:00
JKQTPKeyPositionComboBox ( QWidget * parent = nullptr ) ;
2018-12-19 00:13:18 +08:00
2019-01-20 17:49:29 +08:00
JKQTPKeyPosition getPosition ( ) const ;
void setPosition ( JKQTPKeyPosition position ) ;
2023-07-22 20:26:02 +08:00
Q_SIGNALS :
2019-01-20 17:49:29 +08:00
void currentPositionChanged ( JKQTPKeyPosition pos ) ;
2018-12-19 00:13:18 +08:00
protected :
2019-01-20 17:49:29 +08:00
void addPosition ( JKQTPKeyPosition position , const QString & name , const QIcon & icon = QIcon ( ) ) ;
2023-07-22 20:26:02 +08:00
protected Q_SLOTS :
2018-12-19 00:13:18 +08:00
void posChanged ( int index ) ;
} ;
2019-01-20 17:49:29 +08:00
/*! \brief a QComboBox which shows JKQTPKeyPosition
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2019-01-26 20:00:40 +08:00
\ image html JKQTPKeyLayoutComboBox . png
2018-12-19 00:13:18 +08:00
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPKeyLayoutComboBox : public QComboBox {
2018-12-19 00:13:18 +08:00
Q_OBJECT
public :
2019-01-20 17:49:29 +08:00
JKQTPKeyLayoutComboBox ( QWidget * parent = nullptr ) ;
2018-12-19 00:13:18 +08:00
2019-01-20 17:49:29 +08:00
JKQTPKeyLayout getKeyLayout ( ) const ;
void setKeyLayout ( JKQTPKeyLayout layout ) ;
2023-07-22 20:26:02 +08:00
Q_SIGNALS :
2019-01-20 17:49:29 +08:00
void currentLayoutChanged ( JKQTPKeyLayout layout ) ;
2018-12-19 00:13:18 +08:00
protected :
2019-01-20 17:49:29 +08:00
void addKeyLayout ( JKQTPKeyLayout layout , const QString & name ) ;
2023-07-22 20:26:02 +08:00
protected Q_SLOTS :
2018-12-19 00:13:18 +08:00
void currentIndexChangedP ( int index ) ;
} ;
2019-01-20 17:49:29 +08:00
/*! \brief a QComboBox which shows JKQTPErrorPlotstyle
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2019-01-20 17:49:29 +08:00
\ image html JKQTPErrorPlotstyleComboBox . png
2018-12-19 00:13:18 +08:00
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPErrorPlotstyleComboBox : public QComboBox {
2018-12-19 00:13:18 +08:00
Q_OBJECT
public :
2019-01-20 17:49:29 +08:00
JKQTPErrorPlotstyleComboBox ( QWidget * parent = nullptr ) ;
2018-12-19 00:13:18 +08:00
2019-05-06 01:31:20 +08:00
JKQTPErrorPlotstyle getErrorLineStyle ( ) const ;
2019-04-22 19:27:50 +08:00
void setSymbolType ( JKQTPErrorPlotstyle symbol ) ;
2019-01-20 17:49:29 +08:00
void setCurrentErrorStyle ( JKQTPErrorPlotstyle symbol ) ;
2018-12-19 00:13:18 +08:00
protected :
2019-01-20 17:49:29 +08:00
void addSymbol ( JKQTPErrorPlotstyle symbol , const QString & name , const QIcon & icon = QIcon ( ) ) ;
2018-12-19 00:13:18 +08:00
} ;
2019-01-20 17:49:29 +08:00
/*! \brief a QComboBox which shows JKQTPGraphSymbols
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
\ image html JKQTPSymbolComboBox . png
2018-12-19 00:13:18 +08:00
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPSymbolComboBox : public QComboBox {
2018-12-19 00:13:18 +08:00
Q_OBJECT
public :
JKQTPSymbolComboBox ( QWidget * parent = nullptr ) ;
2019-01-20 17:49:29 +08:00
JKQTPGraphSymbols getSymbol ( ) const ;
2019-04-22 19:27:50 +08:00
void setSymbolType ( JKQTPGraphSymbols symbol ) ;
2019-01-20 17:49:29 +08:00
void setCurrentSymbol ( JKQTPGraphSymbols symbol ) ;
2018-12-19 00:13:18 +08:00
protected :
2019-01-20 17:49:29 +08:00
void addSymbol ( JKQTPGraphSymbols symbol , const QString & name ) ;
2018-12-19 00:13:18 +08:00
} ;
/*! \brief a QComboBox to select whether a line, symbols or both should be displayed
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPLinePlotStyleComboBox : public QComboBox {
2018-12-19 00:13:18 +08:00
Q_OBJECT
public :
JKQTPLinePlotStyleComboBox ( QWidget * parent = nullptr ) ;
2019-01-20 17:49:29 +08:00
void setDefaultSymbol ( JKQTPGraphSymbols symbol ) ;
void addUsedSymbol ( JKQTPGraphSymbols symbol ) ;
2018-12-19 00:13:18 +08:00
2019-01-20 17:49:29 +08:00
JKQTPGraphSymbols getSymbol ( ) const ;
2018-12-19 00:13:18 +08:00
bool getDrawLine ( ) const ;
protected :
void refill ( ) ;
2019-01-20 17:49:29 +08:00
void addSymbol ( JKQTPGraphSymbols symbol , bool line , const QString & name = QString ( " " ) , const QVariant & data = QVariant ( ) ) ;
QList < JKQTPGraphSymbols > symbols ;
JKQTPGraphSymbols defaultSymbol ;
2018-12-19 00:13:18 +08:00
} ;
/*! \brief a QComboBox to select whether a line, symbols or both should be displayed, in addition to JKQTPLinePlotStyleComboBox this may also have different symbol sizes!
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPLinePlotStyleWithSymbolSizeComboBox : public QComboBox {
2018-12-19 00:13:18 +08:00
Q_OBJECT
public :
JKQTPLinePlotStyleWithSymbolSizeComboBox ( QWidget * parent = nullptr ) ;
2019-01-20 17:49:29 +08:00
void setDefaultSymbol ( JKQTPGraphSymbols symbol , double size ) ;
void addUsedSymbol ( JKQTPGraphSymbols symbol , double symbolSize , bool line ) ;
2018-12-19 00:13:18 +08:00
2019-01-20 17:49:29 +08:00
JKQTPGraphSymbols getSymbol ( ) const ;
2018-12-19 00:13:18 +08:00
bool getDrawLine ( ) const ;
double getSymbolSize ( ) const ;
protected :
void refill ( ) ;
2019-01-20 17:49:29 +08:00
void addSymbol ( JKQTPGraphSymbols symbol , bool line , double symbolSize , const QString & name = QString ( " " ) , const QVariant & data = QVariant ( ) ) ;
2018-12-19 00:13:18 +08:00
struct styleData {
2019-01-20 17:49:29 +08:00
JKQTPGraphSymbols symbol ;
2018-12-19 00:13:18 +08:00
bool line ;
double symbolSize ;
bool operator = = ( const styleData & other ) const ;
} ;
QList < styleData > symbols ;
2019-01-20 17:49:29 +08:00
JKQTPGraphSymbols defaultSymbol ;
2018-12-19 00:13:18 +08:00
double defaultSize ;
} ;
2019-04-22 19:27:50 +08:00
/*! \brief a QComboBox which shows JKQTPSpecialLineType
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2019-01-26 20:00:40 +08:00
2019-04-22 19:27:50 +08:00
\ see JKQTPSpecialLineType
2018-12-19 00:13:18 +08:00
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPSpecialLineTypeComboBox : public QComboBox {
2018-12-19 00:13:18 +08:00
Q_OBJECT
public :
2019-04-22 19:27:50 +08:00
JKQTPSpecialLineTypeComboBox ( QWidget * parent = nullptr ) ;
2018-12-19 00:13:18 +08:00
2019-04-22 19:27:50 +08:00
JKQTPSpecialLineType getSpecialLineType ( ) const ;
void setSpecialLineType ( JKQTPSpecialLineType step ) ;
void setCurrentStepType ( JKQTPSpecialLineType step ) ;
2018-12-19 00:13:18 +08:00
protected :
2019-04-22 19:27:50 +08:00
void addStep ( JKQTPSpecialLineType step , const QString & name , const QIcon & icon = QIcon ( ) ) ;
2018-12-19 00:13:18 +08:00
} ;
2019-08-01 04:10:26 +08:00
/*! \brief a QComboBox which shows JKQTPMathImageModifierMode
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2019-01-26 20:00:40 +08:00
2019-08-01 04:10:26 +08:00
\ see JKQTPMathImageModifierMode
2018-12-19 00:13:18 +08:00
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPImageModifierModeComboBox : public QComboBox {
2018-12-19 00:13:18 +08:00
Q_OBJECT
public :
JKQTPImageModifierModeComboBox ( QWidget * parent = nullptr ) ;
2019-08-01 04:10:26 +08:00
JKQTPMathImageModifierMode getModifierMode ( ) const ;
void setModifierMode ( JKQTPMathImageModifierMode mode ) ;
2018-12-19 00:13:18 +08:00
protected :
2019-08-01 04:10:26 +08:00
void addMode ( JKQTPMathImageModifierMode mode , const QString & name , const QIcon & icon = QIcon ( ) ) ;
2018-12-19 00:13:18 +08:00
} ;
# endif // JKQTPCOMBOBOXES_H