2018-12-19 00:13:18 +08:00
/*
2019-01-12 23:01:55 +08:00
Copyright ( c ) 2008 - 2019 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
the Free Software Foundation , either version 2 of the License , or
( 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/>.
*/
/** \file jkqtpcomboboxes.h
2019-01-19 16:40:52 +08:00
* \ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
# ifndef JKQTPCOMBOBOXES_H
# define JKQTPCOMBOBOXES_H
# include "jkqtplotter/jkqtpbaseplotter.h"
# include "jkqtplottertools/jkqtp_imexport.h"
2018-12-28 05:52:00 +08:00
# include "jkqtplotter/jkqtpgraphsimage.h"
2018-12-19 00:13:18 +08:00
# include <QComboBox>
# include "jkqtplottertools/jkqtpimagetools.h"
2018-12-28 05:52:00 +08:00
# include "jkqtplottertools/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
*/
class LIB_EXPORT JKQTPMathImageColorPaletteComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPMathImageColorPaletteComboBox ( QWidget * parent = nullptr ) ;
JKQTPMathImageColorPalette colorPalette ( ) const ;
JKQTPMathImageColorPalette currentColorPalette ( ) const ;
JKQTPMathImageColorPalette getColorPalette ( ) const ;
void setColorPalette ( JKQTPMathImageColorPalette palette ) ;
void setCurrentColorPalette ( JKQTPMathImageColorPalette palette ) ;
signals :
void currentPaletteChanged ( JKQTPMathImageColorPalette palette ) ;
protected slots :
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-01-20 17:49:29 +08:00
class 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-01-20 17:49:29 +08:00
class 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-01-20 17:49:29 +08:00
class 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-01-20 17:49:29 +08:00
class 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 ) ;
2018-12-19 00:13:18 +08:00
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 ( ) ) ;
2018-12-19 00:13:18 +08:00
protected slots :
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-01-20 17:49:29 +08:00
class 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 ) ;
2018-12-19 00:13:18 +08:00
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 ) ;
2018-12-19 00:13:18 +08:00
protected slots :
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-01-20 17:49:29 +08:00
class 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-01-20 17:49:29 +08:00
JKQTPErrorPlotstyle getErrorStyle ( ) const ;
void setSymbol ( JKQTPErrorPlotstyle symbol ) ;
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
*/
class LIB_EXPORT JKQTPSymbolComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPSymbolComboBox ( QWidget * parent = nullptr ) ;
2019-01-20 17:49:29 +08:00
JKQTPGraphSymbols getSymbol ( ) const ;
void setSymbol ( JKQTPGraphSymbols symbol ) ;
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
*/
class LIB_EXPORT JKQTPLinePlotStyleComboBox : public QComboBox {
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
*/
class LIB_EXPORT JKQTPLinePlotStyleWithSymbolSizeComboBox : public QComboBox {
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-01-20 17:49:29 +08:00
/*! \brief a QComboBox which shows JKQTPStepType
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2019-01-26 20:00:40 +08:00
\ see JKQTPStepType
2018-12-19 00:13:18 +08:00
*/
2019-01-20 17:49:29 +08:00
class LIB_EXPORT JKQTPStepTypeComboBox : public QComboBox {
2018-12-19 00:13:18 +08:00
Q_OBJECT
public :
2019-01-20 17:49:29 +08:00
JKQTPStepTypeComboBox ( QWidget * parent = nullptr ) ;
2018-12-19 00:13:18 +08:00
2019-01-20 17:49:29 +08:00
JKQTPStepType getStepType ( ) const ;
void setStepType ( JKQTPStepType step ) ;
void setCurrentStepType ( JKQTPStepType step ) ;
2018-12-19 00:13:18 +08:00
protected :
2019-01-20 17:49:29 +08:00
void addStep ( JKQTPStepType step , const QString & name , const QIcon & icon = QIcon ( ) ) ;
2018-12-19 00:13:18 +08:00
} ;
/*! \brief a QComboBox which shows JKQTPMathImageBase::ModifierMode
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2019-01-26 20:00:40 +08:00
\ see JKQTPMathImageBase : : ModifierMode
2018-12-19 00:13:18 +08:00
*/
class LIB_EXPORT JKQTPImageModifierModeComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPImageModifierModeComboBox ( QWidget * parent = nullptr ) ;
JKQTPMathImageBase : : ModifierMode getModifierMode ( ) const ;
void setModifierMode ( JKQTPMathImageBase : : ModifierMode mode ) ;
protected :
void addMode ( JKQTPMathImageBase : : ModifierMode mode , const QString & name , const QIcon & icon = QIcon ( ) ) ;
} ;
# endif // JKQTPCOMBOBOXES_H