|
Nope, free to use, free to distribute and modify... etc.
Although if you use it in a comericial product i'd like to now what that product is , and i'd like you to put my name somewhere in the credits text.
Creative minds - create creative creations!
|
|
|
|
|
Congratulations for the control!
How I get the value of a property?
Marco Antonio
São Paulo - Brasil
|
|
|
|
|
Well , i thought of adding a GetValue method, but i didn't... And this is why:
This control is supposed to be just a UI representation of some object's properties,
you should of course have the initial properties of the object to fill the control with.
When you get a "PropertyChanged" notification from the control you are passed the new value of the property as the event parameter, you should then update that property in your object...
So there is no really a need for get property method, since the control already pesses the new value when the property is changed...
Creative minds - create creative creations!
|
|
|
|
|
OK
Tks
|
|
|
|
|
sorry, how to recieve the notification message ("PropertyChanged")?
Does my code have any error?
afx_msg void OnPropertyChanged(LPCTSTR PropertyName, const VARIANT& NewValue);
ON_NOTIFY("PropertyChanged", 201, OnPropertyChanged)
afx_msg void CmvObjBar::OnPropertyChanged(LPCTSTR PropertyName, const VARIANT& NewValue)
{
---
}
thx...
troy
|
|
|
|
|
How to do that i delete some items, not all?
thx
|
|
|
|
|
The code should be :
afx_msg void OnPropertyChangedProplistctrl1(LPCTSTR PropertyName, const VARIANT FAR& NewValue);<br />
<br />
DECLARE_EVENTSINK_MAP()<br />
<br />
BEGIN_EVENTSINK_MAP(CVCDemoDlg, CDialog)<br />
ON_EVENT(CVCDemoDlg, IDC_PROPLISTCTRL1, 1 , OnPropertyChangedProplistctrl1, VTS_BSTR VTS_VARIANT)<br />
END_EVENTSINK_MAP()<br />
<br />
void CVCDemoDlg::OnPropertyChangedProplistctrl1(LPCTSTR PropertyName, const VARIANT FAR& NewValue) <br />
{<br />
<br />
}
Creative minds - create creative creations!
|
|
|
|
|
How to translate the ON_EVENT message by myself ?
ON_EVENT belong what kinds of message type ?
ex: i translate a NM_CLICK notification message.
LRESULT CMyStatic::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if (message == WM_NOTIFY)
{
NMHDR* pNMHDR = (NMHDR*)lParam;
if (pNMHDR->code == NM_CLICK ||
pNMHDR->code == LVN_BEGINDRAG ||
pNMHDR->code == LVN_ITEMCHANGED ||
pNMHDR->code == LVN_ENDLABELEDIT ||
pNMHDR->code == NM_CUSTOMDRAW ||
pNMHDR->code == NM_RCLICK )
::SendMessage(pWnd, WM_NOTIFY, wParam, lParam);
}
return CStatic::WindowProc(message, wParam, lParam);
}
|
|
|
|
|
This atricle has been updated at 05/11/2004
Most of the asked before questions has been resolved.
Creative minds - create creative creations!
|
|
|
|
|
in VB 6 when i add a Combobox property
how can i set the value for the property?... always display the first item of array
For example, I have a myprop object, the value property is 2, but this property have a combo box
dim myarray (5) as string
dim x as integer
for each itemx in myprop.combotext
myarray(x)=x & ":" & itemx ' "1:Option1" , "2:Option2"
x=x+1
next
Prop.AddProperty myprop.cat, myprop.name, myarray, myprop.Description, ButtonNone, True
myvalue=myprop.value & ":" & myprop.ComboText.Item(myprop.value)
Prop.SetValue myprop.nombre, myvalue
in the last line I get the next error message:
Run Time Error 380: Wrong Parameter Type
Thanks for your help
Elias Castañeda
|
|
|
|
|
Set the button type parameter to the desired selection :
Instead of:
MicroElias Corporation Framework wrote:
Prop.AddProperty myprop.cat, myprop.name, myarray, myprop.Description, ButtonNone, True
myvalue=myprop.value & ":" & myprop.ComboText.Item(myprop.value)
Prop.SetValue myprop.nombre, myvalue
Use:
Prop.AddProperty myprop.cat, myprop.name, myarray, myprop.Description, myprop.nombre, True
Assuming that
myprop.nombre is the number of the current selection.
Creative minds - create creative creations!
|
|
|
|
|
i'm try the following code with array[2] and get the same result
Prop.AddProperty myprop.cat, myprop.name, myarray, myprop.Description, 0, True
Prop.AddProperty myprop.cat, myprop.name, myarray, myprop.Description, 1, True
Prop.AddProperty myprop.cat, myprop.name, myarray, myprop.Description, 2, True
always the first element of the array is showed.
What's wrong?: I need download the component again? Thanks.
Elias
|
|
|
|
|
MicroElias Corporation Framework wrote:
What's wrong?: I need download the component again? Thanks.
Yes you are but whait till Sunday...
You'll see when i midify the page that the version is updated...
Creative minds - create creative creations!
|
|
|
|
|
Alex Hazanov wrote:
Yes you are but whait till Sunday...
You'll see when i midify the page that the version is updated...
The hour is late and i'm missing keys on the keyboard...
Alex Hazanov wrote:
Yes you are but whait = wait till Sunday...
You'll see when i midify = modify the page that the version is updated...
Creative minds - create creative creations!
|
|
|
|
|
ok, dont worry... usually it happens
|
|
|
|
|
hi, I'm working in a program in vb that needs multiple property lists in a tabbed dialog in the same form, but the property_change event only is called for one control and the other control ignore the event, when i change a property in any control then all the controls locks and any changes in properties are not allowed but if i call to the metod .clear and refill the controls they works again...
What can I do?
Thanks for you help...
Elias
|
|
|
|
|
This is resolved in the new version which I'll upload by the end of the week.
Also it's illegal to call SetValue() inside the PropertyChanged event!
Unless you call SetValue on another property list
|
|
|
|
|
The last message is from me... Sorry , forgot to login.
Creative minds - create creative creations!
|
|
|
|
|
Hey I'm trying to use the pretty nice control with
C#.
Every thing seems to until I start to add some property items. The AddProperty Method crashes with
a System.NullRefenceException.
Any Idea or Experiences?
Thanks a lot Sebastian
|
|
|
|
|
What is exact code you are using?
Creative minds - create creative creations!
|
|
|
|
|
First of all let me thank you for excellent concept and design.
I have 2 questions
1. How to use AxtiveX control in VC ?
Could you give demo dialog based application ?
2. If i don't want to use an activex but i want to subclass list control then
how to it with your class.
Thanks in advance
Togather we can build prosperity
|
|
|
|
|
Veeeeeerryyyy easy!
Just create a dialog, right click -> Insert AxtiveX control (of course you have to register it first with regsrv32) ->select "PropList control". Now you have the control in the dialog.
Create amember variable for it as if it was any other control , and the class wizard will sugest creating a wrapper, say yes.
Now you have a class that wrapps the functionality of the control, and a member variable of the same class. From here use it just as any other control, and the functions are the same as in VB.
The only problem is to pass the property values as VARIANT, you can use a COLEVariant, CCOMVariant or _variant_t as a wrapper (_variant_t is the most usefull since it has lots of extructors). Use SafeArrays to pass in the String arrays for combo boxes like this:
COleSafeArray saStrings;
BSTR strings[2];
strings[0] = ::SysAllocString(L"First");
strings[1] = ::SysAllocString(L"Second");
saStrings.CreateOneDim(VT_BSTR,2,strings);
m_propertyList.AddProperty("General","Caption",saStrings,"Description",ButtonNone,TRUE);
That's it!
Creative minds - create creative creations!
|
|
|
|
|
Thank you for quick reply.
I added following code and it worked
_variant_t objvar;
objvar = ::SysAllocString(L"First");
m_proplist.AddProperty("General","Caption", objvar, "Description",3,TRUE);
but
Following code didnot worked
COleSafeArray saStrings;
BSTR strings[2];
strings[0] = ::SysAllocString(L"First");
strings[1] = ::SysAllocString(L"Second");
saStrings.CreateOneDim(VT_BSTR,2,strings);
m_propertyList.AddProperty("General","Caption",saStrings,"Description",ButtonNone,TRUE);
It gives me error into line containing
saStrings.CreateOneDim(VT_BSTR,2,strings);
I don't think problem into your code as CreateOneDim method of
COleSafeArray gives an error. If you came across such problem
please update us.
kdvyas
Togather we can build prosperity
|
|
|
|
|
This is strange , since it worked for me... What was the error?
Creative minds - create creative creations!
|
|
|
|
|
hi,
I used the AddProperty commands that you suggested and got nothing on the right,meaning no editbox no buttons.
What did I miss?
|
|
|
|
|