With this patch dividers ignore the checked property while still triggering an OnToolButtonClick event.
CODE
Index: NxPropertyItemClasses.pas
===================================================================
--- NxPropertyItemClasses.pas (revision 3.3.5)
+++ NxPropertyItemClasses.pas (working copy)
@@ -539,6 +539,7 @@
procedure TNxToolbarItemButton.SetDivider(const Value: Boolean);
begin
FDivider := Value;
+ Checked := false;
FCollection.FOwner.Change(ckToolButtonRedraw, Index);
end;
Index: NxPropertyItemDisplay.pas
===================================================================
--- NxPropertyItemDisplay.pas (revision 3.3.5)
+++ NxPropertyItemDisplay.pas (working copy)
@@ -449,7 +449,9 @@
ButtonIndex := GetButtonAtPos(X, Y);
if (ButtonIndex < Count) and (ButtonIndex >= 0) then
begin
- if Buttons[ButtonIndex].AutoCheck then Checked[ButtonIndex] := not Checked[ButtonIndex] else
+ if (Buttons[ButtonIndex].AutoCheck) and (not Buttons[ButtonIndex].Divider) then
+ Checked[ButtonIndex] := not Checked[ButtonIndex]
+ else
begin { simple click }
ButtonClick(ButtonIndex);
end;
===================================================================
--- NxPropertyItemClasses.pas (revision 3.3.5)
+++ NxPropertyItemClasses.pas (working copy)
@@ -539,6 +539,7 @@
procedure TNxToolbarItemButton.SetDivider(const Value: Boolean);
begin
FDivider := Value;
+ Checked := false;
FCollection.FOwner.Change(ckToolButtonRedraw, Index);
end;
Index: NxPropertyItemDisplay.pas
===================================================================
--- NxPropertyItemDisplay.pas (revision 3.3.5)
+++ NxPropertyItemDisplay.pas (working copy)
@@ -449,7 +449,9 @@
ButtonIndex := GetButtonAtPos(X, Y);
if (ButtonIndex < Count) and (ButtonIndex >= 0) then
begin
- if Buttons[ButtonIndex].AutoCheck then Checked[ButtonIndex] := not Checked[ButtonIndex] else
+ if (Buttons[ButtonIndex].AutoCheck) and (not Buttons[ButtonIndex].Divider) then
+ Checked[ButtonIndex] := not Checked[ButtonIndex]
+ else
begin { simple click }
ButtonClick(ButtonIndex);
end;