Jump to content


NextInspector: Divider ToolBarItemButtons can get checked


  • Please log in to reply
1 reply to this topic

#1 Guest_Markus_*

Guest_Markus_*
  • Guests

Posted 10 February 2006 - 02:46 AM

ToolBarButtons set up as "divider" internally take account of the .checked property. This leads to an unnecessary comma separator in the corresponding ToolBarItem text.

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;


#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 10 February 2006 - 04:03 AM

Hello,

I will add this fix. Thank you!

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users