Hello


Hello,

I've a strange bug on a TToolButton

It's a Print button, I've changed it's style to tbsDropDown to let the user select another printer. And now, the OnClick event is not always fired.

As you can see (or not) in this animation, the button seems to click, but the event is not fired (XPS driver show a dialog box) but sometime it's works perfectly.

Under XE3

Comments

  1. haha ! this is MDI related, I've an option to set the FormStyle to MIDChild or Normal, and the bug occurs when it is a MDI child !

    ReplyDelete
  2. found the code that avoid Click in TToolBar.WndProc

    { When the style is tbsDropDown, and we have IE4+, we need
    to subtract the drop down button width of 14 pixels, otherwise
    it will cause the drop down menu to "stick" down }
    if (Style <> tbsDropDown) or
    (GetComCtlVersion >= ComCtlVersionIE4) and
    {$IFDEF CLR}
    (MouseMsg.XPos < Left + Width - 14) then
    {$ELSE}
    (TWMMouse(Message).XPos < Left + Width - 14) then
    {$ENDIF}
    inherited WndProc(Message);

    ReplyDelete
  3. on a MDIChild window the Button's with is 23 while i'ts 38 on a fsNormal...that's strange !

    ReplyDelete

Post a Comment