Board index » cppbuilder » Component editor information

Component editor information


2003-10-17 03:28:08 PM
cppbuilder31
Hi,
I would like to know if a special component editor already exists in BCB5
pro for the following thing :
- a "color detector" :
It's like under photoshop ("color picker").
I have a property (BackgroundColor), and clicking to its button, I'm able to
display picture.
On this picture, and with a special tool, i should be able to select a color
to allocate to my component property (BackgroundColor).
does it already exist or should i create it ?
thanks.
Alain
 
 

Re:Component editor information

"Alain R." < XXXX@XXXXX.COM >wrote in message
Quote
I have a property (BackgroundColor), and clicking to
its button, I'm able to display picture.
On this picture, and with a special tool, i should be able
to select a color to allocate to my component property
(BackgroundColor).
What about using TColorDialog?
Gambit
 

Re:Component editor information

"Alain R." < XXXX@XXXXX.COM >wrote in message
Quote
- a "color detector" :
It's like under photoshop ("color picker").
I have a property (BackgroundColor), and clicking to its button, I'm able to
display picture.
Do you mean that you have registered a custom property editor? It's unclear to
me whether you are looking for a component editor or a property editor.
Quote
On this picture, and with a special tool, i should be able to select a color
to allocate to my component property (BackgroundColor).

does it already exist or should i create it ?
It does not exist. You should create it yourself. It can be easily done. You
could display the image in a TImage component and handle the OnMouseUp-event.
Read the color indicated by the cursor pos;
void __fastcall TMyPropertyEditorForm::Image1MouseUp(
TObject* Sender,
TMouseButton Button, TShiftState Shift, int X, int Y
) {
if( Button == mbLeft )
{
YourComp->BackgroundColor = Image1->Canvas->Pixels[X][Y];
}
}
The only thing you'll need now is the fancy cursor ;)
Ralph
 

{smallsort}