Helper class used for creation of property handlers which can be edited only in separate form which is usually shown modally. Property handlers for editing Gradient, RectC, Image,... type properties are the examples of how this base class can be used.
You can find more information in comments below. Overrided methods can be found in corresponding base class.
/*
No inline editing allowed. Show preview and button for modal form editor opening. Derived class should override NotifyOnActivateModal() and show corresponding modal form*/
class CPropertyHandlerModal :public CPropertyHandler
{
protected:
virtual void NotifyOnActivateModal() = 0; // Called when modal form of the handler should be shown
public:
IBuiltInControlListener *getListener() override;
// Since 5.0.0
bool isDown() override;
void setListener(IBuiltInControlListener *value) override;
void UpdateFromStyle(IStyle *style, const String &class_name) override;
void Render(const bool last_pass, const Mat4f &matrix, const Block *block) override;
// State change notifications
void NotifyOnAttach() override;
void NotifyOnDeactivate() override;
void NotifyOnFreeResources() override;
// Mouse input notifications
bool NotifyOnMouseHover(const Point &position) override;
bool NotifyOnMouseLeave() override;
bool NotifyOnMouseMove(const Point &position, const bool left, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseLeftDown(const Point &position, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseLeftUp(const Point &position, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseLeftDoubleClick(const Point &position, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseMiddleDown(const Point &position, const bool left, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseMiddleUp(const Point &position, const bool left, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseMiddleDoubleClick(const Point &position, const bool left, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseRightDown(const Point &position, const bool left, const bool middle, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseRightUp(const Point &position, const bool left, const bool middle, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseRightDoubleClick(const Point &position, const bool left, const bool middle, const bool ctrl, const bool alt, const bool shift) override;
void NotifyOnMouseDownCancel() override;
bool NotifyOnMouseVerticalWheel(const Point &position, const bool left, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift, const int delta) override;
bool NotifyOnMouseHorizontalWheel(const Point &position, const bool left, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift, const int delta) override;
// Keyboard input notifications
bool NotifyOnKeyDown(const Key key, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
bool NotifyOnKeyUp(const Key key, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
bool NotifyOnChar(const wchar_t chr, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
bool NotifyOnDeadChar(const wchar_t chr, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
// Other input notifications
bool NotifyOnDropFiles(const Point &position, const StringArray &filenames) override;
// Clipboard notifications
bool NotifyOnPasteString(const String &text) override;
CPropertyHandlerModal(IPackage *package, const String &name);
Rect getBorderWidth() const; // Return open modal button border widths
BorderColor getBorderColor() const; // Return open modal button border colors
Color getBackgroundColor() const; // Return open modal button background color
bool setBorderWidth(const Rect &value); // Set open modal button border widths
bool setBorderColor(const BorderColor &value); // Set open modal button border colors
bool setBackgroundColor(const Color &value); // Set open modal button background color
};
Namespace: | nitisa::standard |
Include: | Standard/Package/Core/PropertyHandlerModal.h |