tahoma2d/toonz/sources/include/toonzqt/functiontoolbar.h

107 lines
2.3 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef FUNCTIONTOOLBAR_INCLUDED
#define FUNCTIONTOOLBAR_INCLUDED
// TnzCore includes
#include "tdoubleparam.h"
// TnzQt includes
#include "toonzqt/lineedit.h"
// Qt includes
#include <QToolBar>
#include <QAction>
#undef DVAPI
#undef DVVAR
#ifdef TOONZQT_EXPORTS
#define DVAPI DV_EXPORT_API
#define DVVAR DV_EXPORT_VAR
#else
#define DVAPI DV_IMPORT_API
#define DVVAR DV_IMPORT_VAR
#endif
//============================================================
// Forward declarations
class TDoubleParam;
class TFrameHandle;
2016-06-15 18:43:10 +12:00
namespace DVGui {
2016-03-19 06:57:51 +13:00
class MeasuredDoubleLineEdit;
}
class FrameNavigator;
class FunctionKeyframeNavigator;
class FunctionSelection;
//============================================================
2016-06-15 18:43:10 +12:00
namespace DVGui {
class ToolBar : public QToolBar {
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
ToolBar(QWidget *parent = 0) : QToolBar(parent) {
setFixedHeight(22); // ;_;
setIconSize(QSize(23, 17)); //
}
2016-03-19 06:57:51 +13:00
};
}
//*************************************************************************
// FunctionToolbar declaration
//*************************************************************************
class FunctionToolbar final : public DVGui::ToolBar, public TParamObserver {
2016-06-15 18:43:10 +12:00
Q_OBJECT
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
QToolBar *m_valueToolbar, *m_keyframeToolbar;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
DVGui::MeasuredDoubleLineEdit *m_valueFld;
FrameNavigator *m_frameNavigator;
FunctionKeyframeNavigator *m_keyframeNavigator;
DVGui::LineEdit *m_stepFld;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
TDoubleParam *m_curve;
TFrameHandle *m_frameHandle;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
FunctionSelection *m_selection;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
// in una toolbar ogni widget ha un'action associata
QAction
*m_valueFldAction; // brutto: da eliminare. serve solo per fare show/hide
QAction *m_keyframeNavigatorAction; // brutto: da eliminare. serve solo per
// fare show/hide
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
FunctionToolbar(QWidget *parent = 0);
~FunctionToolbar();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setSelection(FunctionSelection *);
void setFrameHandle(TFrameHandle *frameHandle);
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
void onChange(const TParamChange &) override;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
bool anyWidgetHasFocus();
2016-03-19 06:57:51 +13:00
signals:
2016-06-15 18:43:10 +12:00
void numericalColumnToggled();
2016-03-19 06:57:51 +13:00
public slots:
2016-06-15 18:43:10 +12:00
void setCurve(TDoubleParam *curve);
void setFrame(double frame);
2016-03-19 06:57:51 +13:00
private slots:
2016-06-15 18:43:10 +12:00
void onValueFieldChanged();
void onFrameSwitched();
void onNavFrameSwitched();
void onSelectionChanged();
2016-03-19 06:57:51 +13:00
};
2016-06-15 18:43:10 +12:00
#endif // FUNCTIONTOOLBAR_INCLUDED