Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::AbstractPropertyEditor Class Reference

#include <vcf/ApplicationKit/AbstractPropertyEditor.h>

Inheritance diagram for VCF::AbstractPropertyEditor:

VCF::ObjectWithCallbacks VCF::PropertyEditor VCF::Object VCF::BoolPropertyEditor VCF::ColorPropertyEditor VCF::CursorPropertyEditor VCF::DefaultListModelPropertyEditor VCF::DefaultMenuItemPropertyEditor VCF::DoublePropertyEditor VCF::EnumPropertyEditor VCF::EnumSetPropertyEditor VCF::FontPropertyEditor VCF::ImageFilenamePropertyEditor VCF::ImagePropertyEditor VCF::IntegerPropertyEditor VCF::StringPropertyEditor List of all members.

Public Member Functions

 AbstractPropertyEditor ()
virtual ~AbstractPropertyEditor ()
virtual void setProperty (Property *property)
 This sets the current property instance for the property editor.
virtual int getAttributes ()
 This method returns a mask of potential attributes.
virtual ControlcreateEditingControl ()
 Returns a control instance that belongs to this editor.
virtual void edit ()
 This method is used to edit the property value.
virtual void paintValue (VariantData *value, GraphicsContext *context, const Rect &bounds, const DrawUIState &state)
 Paints a representation of the editor.
virtual VariantDatagetValue ()
 Returns the value for the property.
virtual void setValue (VariantData *value)
 Set's the value on the property editor.
virtual String getValueAsText ()
 Like getValue(), but this returns the value in text format.
virtual void setValueAsText (const String &textValue)
 Like setValue() but allows the value to be a string.
virtual std::vector< StringgetStringValues ()
 Returns an array of potential values for the property.
virtual std::vector< PropertyEditor * > getSubProperties ()
 Returns a array of proeprty editors from the current value of this editor.
bool sort (const String &strVal1, const String &strVal2)
 only implement this if sortValues() returns true.
virtual String getPropertyDescription ()
 This returns a string that describes the property.
virtual String getPropertyName ()
 This returns a string that describes the property.
virtual bool equalTo (PropertyEditor *editor)
 This method needs to be oveeriden so to specify when two PropertyEditor(s) can be considered equal.
virtual String getPropertyType ()
 Returns the property type that this editor instance is associated with.
virtual void internal_setPropertyType (const String &type)
 Don't call this - this is used strictly by the framework.
virtual ComponentgetRootDesignerComponent ()
 returns the root component that is being edited in a form designer.
virtual void setRootDesignerComponent (Component *rootDesigner)
 Sets the root component that is being edited in a form designer.

Protected Attributes

Propertyproperty_
int attributes_
VariantData data_
String propertyType_
String propertyDescription_
String propertyName_
ComponentrootDesignerComponent_

Constructor & Destructor Documentation

VCF::AbstractPropertyEditor::AbstractPropertyEditor  )  [inline]
 

virtual VCF::AbstractPropertyEditor::~AbstractPropertyEditor  )  [inline, virtual]
 


Member Function Documentation

virtual Control* VCF::AbstractPropertyEditor::createEditingControl  )  [inline, virtual]
 

Returns a control instance that belongs to this editor.

This control instance is managed by the tool using this property editor so you just need to create it. This may be called multiple times, it is the callers responsibility to delete the control, the editor implementor does not need to worry about this. For simple editors this may return null which will mean the implementation of the UI conntrol is up to the host environment. Typically editors for things like numbers, text, etc, will by default use an edit control or, if the property editor support a list of values, a combo box.

Returns:
Control a new instance of the control for this editor or NULL if the editor doesn't support this.

Implements VCF::PropertyEditor.

virtual void VCF::AbstractPropertyEditor::edit  )  [inline, virtual]
 

This method is used to edit the property value.

This is an optional method to implement, and only needs to be done if createEditingControl() returns a non null value. If createEditingControl() is NULL then it's assumed that the actual editing process will be completely handled by the host of the property editor.

If the implementor does edit this method, then it's up to the implemementor to properly transfer the contents of the propert value to the control.

Implements VCF::PropertyEditor.

Reimplemented in VCF::ColorPropertyEditor, VCF::FontPropertyEditor, VCF::ImageFilenamePropertyEditor, and VCF::ImagePropertyEditor.

virtual bool VCF::AbstractPropertyEditor::equalTo PropertyEditor editor  )  [inline, virtual]
 

This method needs to be oveeriden so to specify when two PropertyEditor(s) can be considered equal.

Implements VCF::PropertyEditor.

virtual int VCF::AbstractPropertyEditor::getAttributes  )  [inline, virtual]
 

This method returns a mask of potential attributes.

Implements VCF::PropertyEditor.

virtual String VCF::AbstractPropertyEditor::getPropertyDescription  )  [inline, virtual]
 

This returns a string that describes the property.

A host that displays a UI should first try and call the property's Property::getDescription() method. If this returns an empty string, then the host should call the property editor's getPropertyDescription().

See also:
Property::getDescription()

paOverridePropertyDescription

Implements VCF::PropertyEditor.

virtual String VCF::AbstractPropertyEditor::getPropertyName  )  [inline, virtual]
 

This returns a string that describes the property.

A host that displays a UI should first try and call the property's Property::getName() method. If this returns an empty string, then the host should call the property editor's getPropertyName().

See also:
Property::getName()

paOverridePropertyName

Implements VCF::PropertyEditor.

virtual String VCF::AbstractPropertyEditor::getPropertyType  )  [inline, virtual]
 

Returns the property type that this editor instance is associated with.

Implements VCF::PropertyEditor.

virtual Component* VCF::AbstractPropertyEditor::getRootDesignerComponent  )  [inline, virtual]
 

returns the root component that is being edited in a form designer.

This may or may not be a control.

Implements VCF::PropertyEditor.

virtual std::vector<String> VCF::AbstractPropertyEditor::getStringValues  )  [inline, virtual]
 

Returns an array of potential values for the property.

Only usable if the PropertEditor::paHasValues bit is set.

See also:
PropertEditor::paHasValues

Implements VCF::PropertyEditor.

Reimplemented in VCF::BoolPropertyEditor, VCF::EnumPropertyEditor, VCF::CursorPropertyEditor, and VCF::ColorPropertyEditor.

virtual std::vector<PropertyEditor*> VCF::AbstractPropertyEditor::getSubProperties  )  [inline, virtual]
 

Returns a array of proeprty editors from the current value of this editor.

The requirement, of course, is that the variant data that is returned by getValue() is a pdObject. This is not meaningful to call unless PropertEditor::paHasSubProperties is set.

See also:
PropertEditor::paHasSubProperties

Implements VCF::PropertyEditor.

Reimplemented in VCF::EnumSetPropertyEditor, and VCF::FontPropertyEditor.

virtual VariantData* VCF::AbstractPropertyEditor::getValue  )  [inline, virtual]
 

Returns the value for the property.

Note that this value is completely independant of the actual value that may be crurently stored in the source object's property. The assignment of this value to the source's property is up to the tool/IDE/etc that is using this interface.

Implements VCF::PropertyEditor.

virtual String VCF::AbstractPropertyEditor::getValueAsText  )  [inline, virtual]
 

Like getValue(), but this returns the value in text format.

This value is used for display purposes if the editor doesn't support custom painting.

Implements VCF::PropertyEditor.

Reimplemented in VCF::EnumSetPropertyEditor, and VCF::CursorPropertyEditor.

virtual void VCF::AbstractPropertyEditor::internal_setPropertyType const String type  )  [inline, virtual]
 

Don't call this - this is used strictly by the framework.

Implements VCF::PropertyEditor.

virtual void VCF::AbstractPropertyEditor::paintValue VariantData value,
GraphicsContext context,
const Rect bounds,
const DrawUIState state
[inline, virtual]
 

Paints a representation of the editor.

This will only get called if needsCustomPaint() method returns true. This is for custom painting of the property editor when it is not being edited.

Implements VCF::PropertyEditor.

Reimplemented in VCF::ColorPropertyEditor, and VCF::FontPropertyEditor.

virtual void VCF::AbstractPropertyEditor::setProperty Property property  )  [inline, virtual]
 

This sets the current property instance for the property editor.

This should only get called if the property editor has the paEditorRequestsProperty attribute set.

Implements VCF::PropertyEditor.

virtual void VCF::AbstractPropertyEditor::setRootDesignerComponent Component rootDesigner  )  [inline, virtual]
 

Sets the root component that is being edited in a form designer.

This may or may not be a control. This root component is then used by some property editor's to enumerator choices for assign values to properties. For example a component proeprty editor might try and find all sub components of the root component whose class name matches a certain criteria and disply these as possible choices to assign a value to the property editor.

Implements VCF::PropertyEditor.

virtual void VCF::AbstractPropertyEditor::setValue VariantData value  )  [inline, virtual]
 

Set's the value on the property editor.

Implements VCF::PropertyEditor.

virtual void VCF::AbstractPropertyEditor::setValueAsText const String textValue  )  [inline, virtual]
 

Like setValue() but allows the value to be a string.

Implements VCF::PropertyEditor.

Reimplemented in VCF::CursorPropertyEditor, and VCF::ColorPropertyEditor.

bool VCF::AbstractPropertyEditor::sort const String strVal1,
const String strVal2
[inline, virtual]
 

only implement this if sortValues() returns true.

If this is the case, then return true if strVal1 is greater than strVal2.

Implements VCF::PropertyEditor.

Reimplemented in VCF::ColorPropertyEditor.


Member Data Documentation

int VCF::AbstractPropertyEditor::attributes_ [protected]
 

VariantData VCF::AbstractPropertyEditor::data_ [protected]
 

Property* VCF::AbstractPropertyEditor::property_ [protected]
 

String VCF::AbstractPropertyEditor::propertyDescription_ [protected]
 

String VCF::AbstractPropertyEditor::propertyName_ [protected]
 

String VCF::AbstractPropertyEditor::propertyType_ [protected]
 

Component* VCF::AbstractPropertyEditor::rootDesignerComponent_ [protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information