-
Notifications
You must be signed in to change notification settings - Fork 0
/
ComponentEditors.cpp
61 lines (46 loc) · 1.84 KB
/
ComponentEditors.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <memory>
#include "ComponentEditors.h"
//#include <boost/shared_ptr.hpp>
using std::unique_ptr;
//---------------------------------------------------------------------------
#pragma package(smart_init)
//---------------------------------------------------------------------------
namespace Componenteditors {
//---------------------------------------------------------------------------
void __fastcall TPropEditorWithDialog::CheckEditProperty( _di_IProperty const Prop )
{
if ( Prop->GetName() == propName_ )
Prop->Edit();
}
//---------------------------------------------------------------------------
void __fastcall TPropEditorWithDialog::EditProperty( TPersistent* Component,
String const PropName,
_di_IDesigner const Designer )
{
TDesignerSelectionsPub* Components = new TDesignerSelectionsPub();
propName_ = PropName;
Components->Add( Component );
GetComponentProperties(
Components->operator _di_IDesignerSelections(),
Typinfo::TTypeKinds() << tkClass,
Designer,
&CheckEditProperty
);
}
void EditPropertyDlg( TPersistent* Component, String PropName,
_di_IDesigner Designer )
{
/*
boost::shared_ptr<TPropEditorWithDialog>
Edt( new TPropEditorWithDialog );
Edt->EditProperty( Component, PropName, Designer );
*/
unique_ptr<TPropEditorWithDialog> Edt( new TPropEditorWithDialog );
Edt->EditProperty( Component, PropName, Designer );
}
//---------------------------------------------------------------------------
} // end of namespace Componenteditors
//---------------------------------------------------------------------------