class CCL::ColorPicker
Overview
#include <colorpicker.h> class ColorPicker: public CCL::Component, public CCL::PopupSelectorClient { public: // classes class ColorPickerHueMouseHandler; class ColorPickerSLMouseHandler; class HSLColorWheel; class RGBSlider; // fields bool applyPresetPalette = true); IPopupSelectorClient; // methods DECLARE_CLASS (ColorPicker, Component); PROPERTY_BOOL (hslDirty, HSLDirty) const; bool hasPresets () const; bool hasPresetPalette () const; bool popup (IVisualStyle* popupStyle = nullptr, bool useMousePos = false); virtual IUnknown*CCL_API getObject (StringID name, UIDRef classID); virtual tbool CCL_API paramChanged (IParameter* param); virtual void CCL_API notify (ISubject* subject, MessageRef msg); virtual tbool CCL_API invokeMethod (Variant& returnValue, MessageRef msg); virtual tbool CCL_API getProperty (Variant& var, MemberID propertyId) const; virtual IView*CCL_API createPopupView (SizeLimit& limits); virtual IView*CCL_API createView ( StringID name, VariantRef data, const Rect& bounds ); virtual Result CCL_API onMouseDown ( const MouseEvent& event, IWindow& popupWindow ); virtual Result CCL_API onMouseUp (const MouseEvent& event, IWindow& popupWindow); virtual Result CCL_API onEventProcessed ( const GUIEvent& event, IWindow& popupWindow, IView* view ); virtual void CCL_API onPopupClosed (Result result); };
Inherited Members
public: // typedefs typedef CStringRef MemberID; // enums enum Flags; enum Result; // structs struct ObjectEntry; // fields IObjectNode; StringRef title = nullptr); kMutable; UIDRef classID override; CLASS_INTERFACES (ObjectNode) protected String title; ParamContainer paramList; SignalSlotList signalSlots; LinkedList <ObjectEntry> objects; kAcceptOnMouseUp; acceptOnMouseUp kAcceptAfterSwipe; // methods virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0; virtual unsigned int CCL_API retain () = 0; virtual unsigned int CCL_API release () = 0; Unknown& operator = (const Unknown&); unsigned int getRetainCount () const; virtual Object*CCL_API revealObject (const void* moduleAddress) = 0; virtual void CCL_API addObserver (IObserver* observer) = 0; virtual void CCL_API removeObserver (IObserver* observer) = 0; virtual void CCL_API signal (MessageRef msg) = 0; virtual void CCL_API deferSignal (IMessage* msg) = 0; static ISubject void addObserver (IUnknown* unknown, IObserver* observer); static void removeObserver (IUnknown* unknown, IObserver* observer); virtual void CCL_API notify (ISubject* subject, MessageRef msg) = 0; static IObserver void notify ( IUnknown* unknown, ISubject* subject, MessageRef msg ); virtual const ITypeInfo&CCL_API getTypeInfo () const = 0; virtual tbool CCL_API getProperty (Variant& var, MemberID propertyId) const = 0; virtual tbool CCL_API setProperty (MemberID propertyId, const Variant& var) = 0; virtual tbool CCL_API getPropertyNames (IPropertyCollector& collector) const = 0; virtual tbool CCL_API invokeMethod (Variant& returnValue, MessageRef msg) = 0; DECLARE_BASE_CLASS (Object); virtual void CCL_API removeObserver (IObserver* observer); virtual void CCL_API signal (MessageRef msg); virtual void CCL_API deferSignal (IMessage* msg); virtual void deferChanged (); virtual void CCL_API notify (ISubject* subject, MessageRef msg); virtual bool equals (const Object& obj) const; virtual int compare (const Object& obj) const; virtual bool load (const Storage& storage); virtual bool save (const Storage& storage) const; virtual bool save (const OutputStorage& storage) const; virtual bool toString (String& string, int flags = 0) const; virtual int getHashCode (int size) const; IUnknown* asUnknown (); static void addGarbageCollected (Object* obj, bool globalScope = true); static void deferDestruction (Object* obj); static const void* getModuleAddress (); virtual StringRef CCL_API getObjectID () const = 0; virtual UIDRef CCL_API getObjectUID () const = 0; virtual UIDRef CCL_API getClassUID () const = 0; virtual IObjectNode*CCL_API getParent () const = 0; virtual IObjectNode*CCL_API getRoot () const = 0; virtual int CCL_API countChildren () const = 0; virtual IObjectNode*CCL_API getChild (int index) const = 0; virtual IObjectNode*CCL_API findChild (StringRef id) const = 0; virtual tbool CCL_API getChildDelegates (IMutableArray& delegates) const = 0; virtual tbool CCL_API getChildPath (String& path) const = 0; virtual IObjectNode*CCL_API lookupChild (StringRef path) const = 0; virtual StringRef CCL_API getObjectID () const; virtual UIDRef CCL_API getObjectUID () const; virtual UIDRef CCL_API getClassUID () const; virtual IObjectNode*CCL_API getParent () const; virtual IObjectNode*CCL_API getRoot () const; virtual int CCL_API countChildren () const; virtual IObjectNode*CCL_API getChild (int index) const; virtual IObjectNode*CCL_API findChild (StringRef id) const; virtual tbool CCL_API getChildDelegates (IMutableArray& delegates) const; virtual tbool CCL_API getChildPath (String& path) const; virtual IObjectNode*CCL_API lookupChild (StringRef path) const; DECLARE_CLASS (ObjectNode, Object); void setName (StringRef name); bool setUniqueName (StringRef name); StringRef getName () const; virtual Iterator* newIterator () const; virtual bool addChild (ObjectNode* child); virtual bool insertChild (int index, ObjectNode* child); virtual bool addChildSorted (ObjectNode* child); virtual bool removeChild (ObjectNode* child); virtual void removeAll (); virtual ObjectNode* findChildNode (StringRef id) const; virtual ObjectNode* findChildNode (MetaClassRef typeID) const; template <class T> T* findChildNode (StringRef id) const; template <class T> T* findChildNode () const; template <class T> T* getChildNode (int index) const; template <class I> I* findChildByInterface (bool deep = false) const; ObjectNode* getChildNode (int index) const; int getChildIndex (const ObjectNode* child) const; virtual StringRef getChildID (const ObjectNode* child) const; ObjectNode* getParentNode () const; template <class T> T* getParentNode () const; bool getRelativePath (String& path, ObjectNode* subNode) const; void signalDeep (MessageRef msg, bool recursive = false); virtual void notifyChildren ( ISubject* subject, MessageRef msg, bool recursive = false ); tresult queryChildInterface (UIDRef iid, void** ptr, bool recursive = false); template <class Lambda> bool visitChildren ( const Lambda& visitLambda, bool recursive ) const; void dump (int level = 0); virtual StringRef CCL_API getObjectID () const; virtual UIDRef CCL_API getObjectUID () const; virtual UIDRef CCL_API getClassUID () const; virtual IObjectNode*CCL_API getParent () const; virtual IObjectNode*CCL_API getRoot () const; virtual int CCL_API countChildren () const; virtual IObjectNode*CCL_API getChild (int index) const; virtual IObjectNode*CCL_API findChild (StringRef id) const; virtual tresult CCL_API initialize (IUnknown* context = nullptr) = 0; virtual tresult CCL_API terminate () = 0; virtual tbool CCL_API canTerminate () const = 0; virtual IUnknown*CCL_API getExtension (StringID id) = 0; template <typename IFace> IFace* getExtensionI (); template <typename IFace> static IFace* getExtensionI (IUnknown* unk); virtual int CCL_API countParameters () const = 0; virtual IParameter*CCL_API getParameterAt (int index) const = 0; virtual IParameter*CCL_API findParameter (StringID name) const = 0; virtual IParameter*CCL_API getParameterByTag (int tag) const = 0; virtual IUnknown*CCL_API getObject (StringID name, UIDRef classID) = 0; virtual tbool CCL_API paramChanged (IParameter* param) = 0; virtual void CCL_API paramEdit (IParameter* param, tbool begin) = 0; virtual IView*CCL_API createView ( StringID name, VariantRef data, const Rect& bounds ) = 0; virtual tbool CCL_API checkCommandCategory (CStringRef category) const = 0; virtual tbool CCL_API interpretCommand (const CommandMsg& msg) = 0; virtual tresult CCL_API appendContextMenu (IContextMenu& contextMenu) = 0; DECLARE_CLASS (Component, ObjectNode); PROPERTY_FLAG (flags, kStorable, isStorable); isMutable StringRef getTitle () const; void setTitle (StringRef title); bool hasTitle () const; IUnknown* getContext () const; Component* getComponent (StringRef name) const; template <class C> C* getComponent (StringRef name) const; bool addComponent (Component* c); bool addIComponent (IComponent* c); void signalHasChild (Component* c); Component* lookupComponent (StringRef path) const; template <class C> C* lookupComponent (StringRef path) const; virtual tresult CCL_API initialize (IUnknown* context = nullptr); virtual tresult CCL_API terminate (); virtual tbool CCL_API canTerminate () const; virtual IUnknown*CCL_API getExtension (StringID id); DECLARE_PARAMETER_LOOKUP (paramList); virtual tbool CCL_API paramChanged (IParameter* param); virtual void CCL_API paramEdit (IParameter* param, tbool begin); virtual IView*CCL_API createView ( StringID name, VariantRef data, const Rect& bounds ); virtual tbool CCL_API checkCommandCategory (CStringRef category) const; virtual tbool CCL_API interpretCommand (const CommandMsg& msg); virtual tresult CCL_API appendContextMenu (IContextMenu& contextMenu); virtual ITheme* getTheme () const; virtual bool load (const Storage& storage); virtual bool save (const Storage& storage) const; virtual bool toString (String& string, int flags) const; void addObject (StringID name, IUnknown* object); void addObject (StringID name, Object* object); bool loadIdentity (const Storage& storage); bool saveIdentity (const Storage& storage) const; bool loadChild (const Storage& storage, Component& child); bool saveChild (const Storage& storage, const Component& child) const; bool loadChildren ( const Storage& storage, bool loadEmpty = false, bool onlyStorable = false ); bool saveChildren (const Storage& storage, bool onlyStorable = false) const; void signalHasChild (StringRef name); void signalPropertyChanged (StringID propertyID, bool deferred = false); void propertyChanged (StringID propertyID); IUnknown* resolveToOriginalContext (IUnknown* context); virtual tbool CCL_API getProperty (Variant& var, MemberID propertyId) const; virtual tbool CCL_API invokeMethod (Variant& returnValue, MessageRef msg); virtual IView*CCL_API createPopupView (SizeLimit& limits) = 0; virtual void CCL_API attached (IWindow& popupWindow) = 0; virtual Result CCL_API onMouseDown ( const MouseEvent& event, IWindow& popupWindow ) = 0; virtual Result CCL_API onMouseUp (const MouseEvent& event, IWindow& popupWindow) = 0; virtual Result CCL_API onKeyDown (const KeyEvent& event) = 0; virtual Result CCL_API onKeyUp (const KeyEvent& event) = 0; virtual Result CCL_API onEventProcessed ( const GUIEvent& event, IWindow& popupWindow, IView* view ) = 0; virtual void CCL_API onPopupClosed (Result result) = 0; virtual int32 CCL_API getPopupBehavior () = 0; virtual tbool CCL_API mouseWheelOnSource ( const MouseWheelEvent& event, IView* source ) = 0; virtual ITouchHandler*CCL_API createTouchHandler ( const TouchEvent& event, IWindow* window ) = 0; virtual void CCL_API setCursorPosition (PointRef where) = 0; virtual tbool CCL_API setToDefault () = 0; PROPERTY_FLAG (flags, kAcceptOnMouseDown, acceptOnMouseDown); acceptOnMouseUp PROPERTY_FLAG (flags, kAcceptOnDoubleClick, acceptOnDoubleClick); acceptOnMouseUp acceptAfterSwipe PROPERTY_FLAG ( behavior, IPopupSelector::kCloseAfterDrag, closeAfterDrag ); acceptOnMouseUp acceptAfterSwipe restoreMousePos PROPERTY_FLAG ( behavior, IPopupSelector::kWantsMouseUpOutside, wantsMouseUpOutside ); acceptOnMouseUp acceptAfterSwipe restoreMousePos hideHScroll bool isIgnoringMouseClick () const;
Detailed Documentation
Methods
virtual IUnknown*CCL_API getObject (StringID name, UIDRef classID)
Get object by name and class id.
virtual tbool CCL_API paramChanged (IParameter* param)
The given parameter changed its value, usually caused by user interaction.
virtual void CCL_API notify (ISubject* subject, MessageRef msg)
Receive notification from subject.
virtual tbool CCL_API invokeMethod (Variant& returnValue, MessageRef msg)
Call method.
virtual tbool CCL_API getProperty (Variant& var, MemberID propertyId) const
Get property value by name.
virtual IView*CCL_API createPopupView (SizeLimit& limits)
Create the view that should popup.
Obey the given limits.
virtual Result CCL_API onMouseDown ( const MouseEvent& event, IWindow& popupWindow )
Called before the event is processed.
Return kOkay or kCancel to close popup. Point is in window coords.
virtual Result CCL_API onMouseUp (const MouseEvent& event, IWindow& popupWindow)
Called before the event is processed.
Return kOkay or kCancel to close popup. Point is in window coords.
virtual Result CCL_API onEventProcessed ( const GUIEvent& event, IWindow& popupWindow, IView* view )
Called after a mouseDown or keyDown has been processed.
virtual void CCL_API onPopupClosed (Result result)
Called when popup has been closed.
Passes the result from onMouseDown / onKeyDown.