Skip to content

Commit

Permalink
Delete editor_controls and use xrSdkControls instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Kovalenko committed Oct 18, 2014
1 parent 1f913bf commit d4128a2
Show file tree
Hide file tree
Showing 81 changed files with 217 additions and 840 deletions.
14 changes: 7 additions & 7 deletions src/editor/editor.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,13 @@
</ItemDefinitionGroup>
<ItemGroup>
<Reference Include="DockPanelSkin">
<HintPath>..\..\sdk\binaries\DockPanelSkin.dll</HintPath>
<HintPath>$(xrSdkDir)binaries\DockPanelSkin.dll</HintPath>
</Reference>
<Reference Include="Flobbster.Windows.Forms.PropertyGrid">
<HintPath>..\..\sdk\binaries\Flobbster.Windows.Forms.PropertyGrid.dll</HintPath>
<HintPath>$(xrSdkDir)binaries\Flobbster.Windows.Forms.PropertyGrid.dll</HintPath>
</Reference>
<Reference Include="WeifenLuo.WinFormsUI.Docking">
<HintPath>$(xrSdkDir)binaries\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualC">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
Expand Down Expand Up @@ -135,9 +138,6 @@
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
<Reference Include="WeifenLuo.WinFormsUI.Docking">
<HintPath>..\..\sdk\binaries\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="AssemblyInfo.cpp" />
Expand Down Expand Up @@ -345,8 +345,8 @@
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)editor_controls\editor_controls.vcxproj">
<Project>{b45374aa-c7ed-42cf-bbd3-deaa2b7acb48}</Project>
<ProjectReference Include="$(SolutionDir)editors\xrSdkControls\xrSdkControls.csproj">
<Project>{e9dc16a3-d0fa-4924-af6e-f6fdf3ea0661}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
4 changes: 2 additions & 2 deletions src/editor/property_boolean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ property_boolean::!property_boolean ()
delete (m_setter);
}

System::Object ^property_boolean::get_value ()
System::Object ^property_boolean::GetValue ()
{
return ((*m_getter)());
}

void property_boolean::set_value (System::Object ^object)
void property_boolean::SetValue (System::Object ^object)
{
(*m_setter) (safe_cast<bool>(object));
}
7 changes: 4 additions & 3 deletions src/editor/property_boolean.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
#define PROPERTY_BOOLEAN_HPP_INCLUDED

#include "property_holder_include.hpp"
using XRay::SdkControls::IProperty;

public ref class property_boolean : public property_value {
public ref class property_boolean : public IProperty {
public:
typedef editor::property_holder::boolean_getter_type boolean_getter_type;
typedef editor::property_holder::boolean_setter_type boolean_setter_type;
Expand All @@ -23,8 +24,8 @@ public ref class property_boolean : public property_value {
);
virtual ~property_boolean ();
!property_boolean ();
virtual System::Object ^get_value ();
virtual void set_value (System::Object ^object);
virtual System::Object ^GetValue ();
virtual void SetValue (System::Object ^object);

private:
boolean_getter_type *m_getter;
Expand Down
4 changes: 2 additions & 2 deletions src/editor/property_boolean_reference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ property_boolean_reference::!property_boolean_reference ()
delete (m_value);
}

System::Object ^property_boolean_reference::get_value ()
System::Object ^property_boolean_reference::GetValue ()
{
return (m_value->get());
}

void property_boolean_reference::set_value (System::Object ^object)
void property_boolean_reference::SetValue (System::Object ^object)
{
bool value = safe_cast<bool>(object);
m_value->set (value);
Expand Down
7 changes: 4 additions & 3 deletions src/editor/property_boolean_reference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@

#include "property_holder_include.hpp"

public ref class property_boolean_reference : public property_value {
public ref class property_boolean_reference : public XRay::SdkControls::IProperty
{
public:
property_boolean_reference (bool& value);
virtual ~property_boolean_reference ();
!property_boolean_reference ();
virtual System::Object ^get_value ();
virtual void set_value (System::Object ^object);
virtual System::Object ^GetValue ();
virtual void SetValue (System::Object ^object);

private:
value_holder<bool>* m_value;
Expand Down
4 changes: 2 additions & 2 deletions src/editor/property_boolean_values_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ property_boolean_values_value::property_boolean_values_value (
m_collection->Add (to_string(values[i]));
}

void property_boolean_values_value::set_value (Object ^object)
void property_boolean_values_value::SetValue (Object ^object)
{
String^ string_value = dynamic_cast<String^>(object);
int index = m_collection->IndexOf(string_value);
VERIFY ((index < 2));
VERIFY ((index >= 0));
inherited::set_value ((index == 1));
inherited::SetValue ((index == 1));
}
2 changes: 1 addition & 1 deletion src/editor/property_boolean_values_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public ref class property_boolean_values_value : public property_boolean {
boolean_setter_type const &setter,
LPCSTR values[2]
);
virtual void set_value (Object ^object) override;
virtual void SetValue (Object ^object) override;

public:
collection_type ^m_collection;
Expand Down
4 changes: 2 additions & 2 deletions src/editor/property_boolean_values_value_reference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ property_boolean_values_value_reference::property_boolean_values_value_reference
m_collection->Add (to_string(values[i]));
}

void property_boolean_values_value_reference::set_value (Object ^object)
void property_boolean_values_value_reference::SetValue (Object ^object)
{
String^ string_value = dynamic_cast<String^>(object);
int index = m_collection->IndexOf(string_value);
VERIFY ((index < 2));
VERIFY ((index >= 0));
inherited::set_value ((index == 1));
inherited::SetValue ((index == 1));
}
2 changes: 1 addition & 1 deletion src/editor/property_boolean_values_value_reference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public ref class property_boolean_values_value_reference : public property_boole

public:
property_boolean_values_value_reference (bool& value, LPCSTR values[2]);
virtual void set_value (Object ^object) override;
virtual void SetValue (Object ^object) override;

public:
collection_type ^m_collection;
Expand Down
4 changes: 2 additions & 2 deletions src/editor/property_collection_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ property_collection_base::!property_collection_base ()
{
}

Object ^property_collection_base::get_value ()
Object ^property_collection_base::GetValue ()
{
return (this);
}

void property_collection_base::set_value (Object ^object)
void property_collection_base::SetValue (Object ^object)
{
}

Expand Down
6 changes: 3 additions & 3 deletions src/editor/property_collection_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ref class property_collection_converter;
[System::ComponentModel::EditorAttribute(property_collection_editor::typeid,System::Drawing::Design::UITypeEditor::typeid)]
[System::ComponentModel::TypeConverter(property_collection_converter::typeid)]
public ref class property_collection_base abstract :
public property_value,
public XRay::SdkControls::IProperty,
public System::Collections::IList
{
public:
Expand All @@ -32,8 +32,8 @@ public ref class property_collection_base abstract :
property_collection_base ();
virtual ~property_collection_base ();
!property_collection_base ();
virtual Object ^get_value ();
virtual void set_value (Object ^object);
virtual Object ^GetValue ();
virtual void SetValue (Object ^object);

public:
virtual void CopyTo (Array^ items, int index);
Expand Down
2 changes: 1 addition & 1 deletion src/editor/property_collection_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Object^ property_collection_editor::CreateInstance (Type^ type)
{
property_container^ container = safe_cast<property_container^>(Context->Instance);
PropertySpecDescriptor^ descriptor = safe_cast<PropertySpecDescriptor^>(Context->PropertyDescriptor);
property_value^ raw_value = container->value(descriptor->item);
IProperty^ raw_value = container->GetProperty(descriptor->item);
property_collection^ collection = safe_cast<property_collection^>(raw_value);
return (collection->create());
}
Expand Down
10 changes: 5 additions & 5 deletions src/editor/property_color_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ property_color_base::!property_color_base ()
delete (m_container);
}

Object^ property_color_base::get_value ()
Object^ property_color_base::GetValue ()
{
return (m_container);
}

void property_color_base::set_value (Object ^object)
void property_color_base::SetValue (Object ^object)
{
Color color = safe_cast<Color>(object);
editor::color value;
Expand Down Expand Up @@ -209,7 +209,7 @@ void property_color_base::blue (float value)
set_value_raw (current);
}

void property_color_base::on_double_click (editor::controls::property_grid^ property_grid)
void property_color_base::OnDoubleClick (XRay::SdkControls::PropertyGrid^ property_grid)
{
#if 0
ColorDialog ^dialog = gcnew ColorDialog();
Expand All @@ -219,7 +219,7 @@ void property_color_base::on_double_click (editor::controls::property_grid^ prop
if (dialog->ShowDialog() == System::Windows::Forms::DialogResult::Cancel)
return;

set_value (::Color(dialog->Color.R/255.f, dialog->Color.G/255.f, dialog->Color.B/255.f));
SetValue (::Color(dialog->Color.R/255.f, dialog->Color.G/255.f, dialog->Color.B/255.f));
property_grid->Refresh ();
#endif // #if 0
}
Expand All @@ -236,7 +236,7 @@ static void increment_and_clamp (float& value, float const& increment)
value = 0.f;
}

void property_color_base::increment (float const% increment)
void property_color_base::Increment (float increment)
{
float increment_value = increment*s_increment_factor;
editor::color value = get_value_raw();
Expand Down
14 changes: 7 additions & 7 deletions src/editor/property_color_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public value struct Color {
}; // value struct Color

public ref class property_color_base abstract :
public property_value,
public XRay::SdkControls::IProperty,
public property_container_holder,
public editor::controls::property_mouse_events,
public editor::controls::property_incrementable
public XRay::SdkControls::IMouseListener,
public XRay::SdkControls::IIncrementable
{
public:
typedef System::Attribute Attribute;
Expand All @@ -64,10 +64,10 @@ public ref class property_color_base abstract :
void blue (float value);

public:
virtual System::Object ^get_value ();
virtual void set_value (System::Object ^object);
virtual void on_double_click (editor::controls::property_grid^ property_grid);
virtual void increment (float const% increment);
virtual System::Object ^GetValue ();
virtual void SetValue (System::Object ^object);
virtual void OnDoubleClick (XRay::SdkControls::PropertyGrid^ property_grid);
virtual void Increment (float increment);

public:
virtual editor::color get_value_raw () = 0;
Expand Down
14 changes: 7 additions & 7 deletions src/editor/property_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void property_container::update_names (String^ name)
try_update_name (i, name);
}

void property_container::add_property (PropertySpec^ description, property_value^ value)
void property_container::add_property (PropertySpec^ description, IProperty^ value)
{
VERIFY (!m_properties[description]);

Expand All @@ -168,10 +168,10 @@ void property_container::add_property (PropertySpec^ description, property_val
m_ordered_properties->Add (description);
}

property_value^ property_container::value (PropertySpec^ description)
IProperty^ property_container::GetProperty (PropertySpec^ description)
{
VERIFY (m_properties[description]);
return (safe_cast<property_value^>(m_properties[description]));
return (safe_cast<IProperty^>(m_properties[description]));
}

IDictionary% property_container::properties ()
Expand All @@ -188,16 +188,16 @@ ArrayList% property_container::ordered_properties ()

void property_container::get_value_handler (Object^ sender, PropertySpecEventArgs^ e)
{
property_value ^value = safe_cast<property_value^>(m_properties[e->Property]);
IProperty ^value = safe_cast<IProperty^>(m_properties[e->Property]);
VERIFY (value);
e->Value = value->get_value();
e->Value = value->GetValue();
}

void property_container::set_value_handler (Object^ sender, PropertySpecEventArgs^ e)
{
property_value ^value = safe_cast<property_value^>(m_properties[e->Property]);
IProperty ^value = safe_cast<IProperty^>(m_properties[e->Property]);
VERIFY (value);
value->set_value (e->Value);
value->SetValue (e->Value);
}

void property_container::clear ()
Expand Down
9 changes: 4 additions & 5 deletions src/editor/property_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

#ifndef PROPERTY_CONTAINER_HPP_INCLUDED
#define PROPERTY_CONTAINER_HPP_INCLUDED

interface class property_value;
using XRay::SdkControls::IProperty;
class property_holder;
ref class property_container_converter;

Expand All @@ -18,7 +17,7 @@ interface class property_container_holder;
[System::ComponentModel::TypeConverterAttribute(property_container_converter::typeid)]
public ref class property_container :
public Flobbster::Windows::Forms::PropertyBag,
public property_container_interface
public XRay::SdkControls::IPropertyContainer
{
public:
typedef Flobbster::Windows::Forms::PropertySpec PropertySpec;
Expand All @@ -34,8 +33,8 @@ public ref class property_container :
!property_container ();
property_holder& holder ();
property_container_holder% container_holder ();
void add_property (PropertySpec^ description, property_value^ value);
virtual property_value^ value (PropertySpec^ description);
void add_property (PropertySpec^ description, IProperty^ value);
virtual IProperty^ GetProperty (PropertySpec^ description);
IDictionary% properties ();
ArrayList% ordered_properties ();
void clear ();
Expand Down
4 changes: 2 additions & 2 deletions src/editor/property_converter_boolean_values.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ StandardValuesCollection ^property_converter_boolean_values::GetStandardValues (
{
property_container^ container = safe_cast<property_container^>(context->Instance);
PropertySpecDescriptor^ descriptor = safe_cast<PropertySpecDescriptor^>(context->PropertyDescriptor);
property_value^ raw_value = container->value(descriptor->item);
IProperty^ raw_value = container->GetProperty(descriptor->item);
property_boolean_values_value^ value = safe_cast<property_boolean_values_value^>(raw_value);
return (gcnew StandardValuesCollection(value->m_collection));
}
Expand Down Expand Up @@ -58,7 +58,7 @@ Object^ property_converter_boolean_values::ConvertTo (

property_container^ container = safe_cast<property_container^>(context->Instance);
PropertySpecDescriptor^ descriptor = safe_cast<PropertySpecDescriptor^>(context->PropertyDescriptor);
property_value^ raw_value = container->value(descriptor->item);
IProperty^ raw_value = container->GetProperty(descriptor->item);
property_boolean_values_value^ real_value = safe_cast<property_boolean_values_value^>(raw_value);
bool bool_value = safe_cast<bool>(value);
return (real_value->m_collection[bool_value ? 1 : 0]);
Expand Down
4 changes: 2 additions & 2 deletions src/editor/property_converter_float_enum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ StandardValuesCollection ^property_converter_float_enum::GetStandardValues (ITyp
{
property_container^ container = safe_cast<property_container^>(context->Instance);
PropertySpecDescriptor^ descriptor = safe_cast<PropertySpecDescriptor^>(context->PropertyDescriptor);
property_value^ raw_value = container->value(descriptor->item);
IProperty^ raw_value = container->GetProperty(descriptor->item);
property_float_enum_value^ value = safe_cast<property_float_enum_value^>(raw_value);
return (gcnew StandardValuesCollection(value->m_collection));
}
Expand Down Expand Up @@ -63,7 +63,7 @@ Object^ property_converter_float_enum::ConvertTo (

property_container^ container = safe_cast<property_container^>(context->Instance);
PropertySpecDescriptor^ descriptor = safe_cast<PropertySpecDescriptor^>(context->PropertyDescriptor);
property_value^ raw_value = container->value(descriptor->item);
IProperty^ raw_value = container->GetProperty(descriptor->item);
property_float_enum_value^ real_value = safe_cast<property_float_enum_value^>(raw_value);
float float_value = safe_cast<float>(value);

Expand Down
4 changes: 2 additions & 2 deletions src/editor/property_converter_integer_enum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ StandardValuesCollection ^property_converter_integer_enum::GetStandardValues (IT
{
property_container^ container = safe_cast<property_container^>(context->Instance);
PropertySpecDescriptor^ descriptor = safe_cast<PropertySpecDescriptor^>(context->PropertyDescriptor);
property_value^ raw_value = container->value(descriptor->item);
IProperty^ raw_value = container->GetProperty(descriptor->item);
property_integer_enum_value^ value = safe_cast<property_integer_enum_value^>(raw_value);
return (gcnew StandardValuesCollection(value->m_collection));
}
Expand Down Expand Up @@ -63,7 +63,7 @@ Object^ property_converter_integer_enum::ConvertTo (

property_container^ container = safe_cast<property_container^>(context->Instance);
PropertySpecDescriptor^ descriptor = safe_cast<PropertySpecDescriptor^>(context->PropertyDescriptor);
property_value^ raw_value = container->value(descriptor->item);
IProperty^ raw_value = container->GetProperty(descriptor->item);
property_integer_enum_value^ real_value = safe_cast<property_integer_enum_value^>(raw_value);
int int_value = safe_cast<int>(value);

Expand Down
Loading

0 comments on commit d4128a2

Please sign in to comment.