Monday, 15 February 2010

delphi - Custom PropertyEditors - They never seem to appear -



delphi - Custom PropertyEditors - They never seem to appear -

information

i seem absolutely clueless how should manage component packages , install custom property editors. have spent lastly week or looking @ examples , tutorials, must doing wrong property editors never show in object inspector , require step step instructions seek , solve frustration.

component package

i have 1 package, , set designtime , runtime in options. added bundle units components (ie, mybutton, mylistbox etc) - additionally have unit containing registercomponents procedure. can build , install now, add together components new project , run them without problems.

adding custom propertyeditor

it gets tricky , confusing me want introduce property editor components bundle above.

tmybutton illustration custom button own paint methods, has published properties allow changing appearance of button - in add-on there published list allow selecting preset appearance settings, example:

tmybuttonstyle = (bsstyle1, bsstyle2, bsstyle3)

i want take away list of preset styles , instead add together property object inspector called 'presetstyles'. property of padialog, want show form can visually see different button styles - more graphical way of selecting preset style simple list.

which packages need

if understand, need split designtime packages , runtime packages?

does mean need 2 register units, 1 components , 1 property editors?

i not total sure how manage this, said current bundle designtime , runtime, not sure bundle type should split into. if create new designtime bundle property editors, , create other bundle runtime lose install button. writing confusing me.

installing propertyeditor

one of articles tried next 1 page: http://www.delphisources.ru/pages/faq/master-delphi-7/content/lib0097.html

the thing changed add together own dialog form, , alter register code from:

registerpropertyeditor(typeinfo(string), tmdsoundbutton, 'soundup', tsoundproperty);

to

registerpropertyeditor(typeinfo(string), tmybutton, 'presetstyles', tsoundproperty);

i know still says tsoundproperty, left until working alter class name.

conclusion

what right way of splitting/managing packages between actual components , design side ie propertyeditors?

the propertyeditor never appears on tmybutton in object inspector , have feeling must not configuring packages correctly or something.

i appreciate kind of assistance here, link tutorial guide or nil doing seems work, using lot of examples not working me.

i have 1 package, , set designtime , runtime in options.

to implement custom property/component editors, must separate code 2 packages - 1 runtime only bundle containing implementation code components themselves, , 1 designtime only bundle contains implementation code component registrations , custom editor(s). designtime bundle needs specify runtime package, , designide package, in requires list. runtime bundle gets compiled executables. designtime bundle ide uses components appear in component palette , form designer , interact them.

does mean need 2 register units, 1 components , 1 property editors?

no. runtime bundle should have no registrations @ all. belongs in designtime bundle instead. can have single register() function in designtime bundle registers everything.

if create new designtime bundle property editors, , create other bundle runtime lose install button.

you cannot install runtime bundle ide, designtime package.

one of articles tried next 1 page: http://www.delphisources.ru/pages/faq/master-delphi-7/content/lib0097.html

the thing changed add together own dialog form, , alter register code from:

registerpropertyeditor(typeinfo(string), tmdsoundbutton, 'soundup', tsoundproperty);

to

registerpropertyeditor(typeinfo(string), tmybutton, 'presetstyles', tsoundproperty);

does tmybutton component define presetstyles property string type? cannot define property editor property not exist.

without knowing how presetstyles property implemented in component , represents, not create much sense invoke popup dialog string property (except maybe things filenames , such). based on description, makes more sense implement component editor instead of property editor, , leave existing tmybuttonstyle property lone utilize ide's default editor enum properties. invoke popup dialog, component editor allow user right-click on component , take "edit" (or whatever other string value decide name it) popup menu, or double-click on component, in form designer. can display , edit component desired, , assign changes component when dialog closed.

the propertyeditor never appears on tmybutton in object inspector , have feeling must not configuring packages correctly or something.

it hard know sure since did not show of actual code yet.

delphi custom-controls delphi-xe custom-component

No comments:

Post a Comment