This forum is temporaily read-only. All existing discussions remain available for reference. For new questions, bug reports or support requests, please contact us at mail@lmdsupport.com.

New Bug: No event handler when VCL Style is applied

edited July 2017 in LMD IDE-Tools
Using latest IDE-Tools. 

When VCL Style is applied, double clicking on a TButton in TLMDDesignPanel does not generate a ModuleValidateEventHandlerName in the TLMDModule. However, when I double click on a button and no VCL Style is applied, ModuleGetEventHandlerName and ModuleValidateEventHandlerName are fired when I doulbe click on a TButton.

You can re-create this bug in the pIDE2 demo app.

Please fix. Thank you.

Comments

  • The problem is in standard Delphi's TButtonStyleHook.WMLButtonDblClk method, which sets Handled parameter to True even in design-time. This way DElphi's styling system in incompatible with Delphi's designer system.
    As a workaround you can declare and register your own style hook class:

    type
      TButtonExStyleHook = class(TButtonStyleHook)
      private
        procedure WMLButtonDblClk(var Message: TWMMouse); message WM_LBUTTONDBLCLK;
      end;

    ...

    procedure TButtonExStyleHook.WMLButtonDblClk(var Message: TWMMouse);
    begin
      if not (csDesigning in Control.ComponentState) then
        inherited;
    end;

    ...

    initialization
      TCustomStyleEngine.UnRegisterStyleHook(TButton, TButtonStyleHook);
      TCustomStyleEngine.RegisterStyleHook(TButton, TButtonExStyleHook);


    So, this effectively fixes the problem.
  • This works as a workaround. Thank you very much for looking into this and finding a solution! Great support!
Sign In or Register to comment.