TAdvOfficeColorSelector OnDropDown/OnClick event

TAdvOfficeColorSelector's OnDropDown event will fire the OnClick event. It doesn't matter if its DropDownSplit property is true or false.

According to the document (well, strictly say, there is no document for this control, I just assume TAdvGlowButton's document also applies to this control) , if DropDownSplit is true, OnDropDown and OnClick will be two separated event fired by button area or dropdown area.


< id="ciba_grabword_plugin" ="application/ciba-grabword-plugin" height="0" ="true" width="0">

We have retested this here with the latest version of the component but cannot reproduce this.

With a default TAdvOfficeColorSelector on the form, setting AdvOfficeColorSelector.DropDownButton = true will trigger OnDropDown when the dropdown button is clicked and OnClick when the regular button area is clicked.

Thanks Bruno,

Sorry that I did not write the issue clearly. When I wrote the OnClick event got triggered actually meant the action  which linked to the button got triggered. Usually OnClick event is linked to the Action's Execute procedure.

So if you link the button with an action (set button's action property), the problem will come : Whenever the drop down arrow got clicked, the Action got triggered, just like the the OnClick event got triggered.

 Here is how to re-produce steps
1. Create a form, drop TAdvOfficeColorSelector, TActionList component
2. Add a new action in TActionList
3. Assign the TAction1 to TAdvOfficeColorSelector
4...


procedure TForm1.Action1Execute(Sender: TObject);
begin
  Caption := Caption + ' Action1';
end;

procedure TForm1.AdvOfficeColorSelector1Click(Sender: TObject);
begin
  Caption := Caption + ' - Click';
end;

procedure TForm1.AdvOfficeColorSelector1DropDown(Sender: TObject);
begin
  Caption := 'DropDown';
end;

procedure TForm1.AdvOfficeColorSelector1SelectColor(Sender: TObject; AColor: TColor);
begin
  Caption := caption + ' Select color';
end;


Problem :
1. When click the button on DropDown area, the Action got triggered. I think the action shall only be triggered by OnClick enent.
 
2. When click the button (OnClick), the SelectColor event also got triggered. I think the OnClick event shall be the action of applying color, not selecting color. The SelectColor event shall only links the action of selecting a color in Color dialog box. 

Well these are  just my opinions. Maybe there are some reasons that bound those event together. But I think  it would be easier for developers that those events are not bound and acting together. Right now I have to set and check button's tag value in OnSelect() event and OnClick() event to identify the who actually triggered the event.

Thanks again.

 

< id="ciba_grabword_plugin" ="application/ciba-grabword-plugin" height="0" ="true" width="0">