The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
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.

69 lines
2.1KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. #pragma once
  14. #include "../jucer_JucerDocument.h"
  15. #include "jucer_ComponentLayoutEditor.h"
  16. class LayoutPropsPanel;
  17. //==============================================================================
  18. /**
  19. Base class for the layout and graphics panels - this takes care of arranging
  20. the properties panel and managing the viewport for the content.
  21. */
  22. class EditingPanelBase : public Component
  23. {
  24. public:
  25. //==============================================================================
  26. EditingPanelBase (JucerDocument& document,
  27. Component* propsPanel,
  28. Component* editorComp);
  29. ~EditingPanelBase() override;
  30. //==============================================================================
  31. void resized() override;
  32. void paint (Graphics& g) override;
  33. void visibilityChanged() override;
  34. virtual void updatePropertiesList() = 0;
  35. virtual Rectangle<int> getComponentArea() const = 0;
  36. double getZoom() const;
  37. void setZoom (double newScale);
  38. void setZoom (double newScale, int anchorX, int anchorY);
  39. // convert a pos relative to this component into a pos on the editor
  40. void xyToTargetXY (int& x, int& y) const;
  41. void dragKeyHeldDown (bool isKeyDown);
  42. class MagnifierComponent;
  43. protected:
  44. JucerDocument& document;
  45. Viewport* viewport;
  46. MagnifierComponent* magnifier;
  47. Component* editor;
  48. Component* propsPanel;
  49. };