You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ovdCColorGradientSettingView.h 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. #include "../ovd_base.h"
  3. #include "ovdCAbstractSettingView.h"
  4. #include <string>
  5. #include <map>
  6. #include <vector>
  7. namespace OpenViBE {
  8. namespace Designer {
  9. namespace Setting {
  10. typedef struct
  11. {
  12. double percent;
  13. GdkColor color;
  14. GtkColorButton* colorButton;
  15. GtkSpinButton* spinButton;
  16. } color_gradient_data_node_t;
  17. class CColorGradientSettingView final : public CAbstractSettingView
  18. {
  19. public:
  20. CColorGradientSettingView(Kernel::IBox& box, const size_t index, CString& builderName, const Kernel::IKernelContext& ctx);
  21. void getValue(CString& value) const override;
  22. void setValue(const CString& value) override;
  23. void configurePressed();
  24. void initializeGradient();
  25. void refreshColorGradient();
  26. void addColor();
  27. void removeColor();
  28. void spinChange(GtkSpinButton* button);
  29. void colorChange(GtkColorButton* button);
  30. void onChange();
  31. private:
  32. GtkEntry* m_entry = nullptr;
  33. const Kernel::IKernelContext& m_kernelCtx;
  34. CString m_builderName;
  35. GtkWidget* m_dialog = nullptr;
  36. GtkWidget* m_container = nullptr;
  37. GtkWidget* m_drawingArea = nullptr;
  38. std::vector<color_gradient_data_node_t> m_colorGradient;
  39. std::map<GtkColorButton*, size_t> m_colorButtons;
  40. std::map<GtkSpinButton*, size_t> m_spinButtons;
  41. bool m_onValueSetting = false;
  42. };
  43. } // namespace Setting
  44. } // namespace Designer
  45. } // namespace OpenViBE