Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002860 [JEDI VCL] 00 JVCL Components minor always 2005-04-11 01:14 2005-04-13 01:23
Reporter anonymous View Status public  
Assigned To outchy
Priority normal Resolution fixed  
Status resolved   Product Version
Summary 0002860: Bug: TJvExXXX control mybe did't send message to Form Designer.
Description Hi peter ,I'm dejoy.

Even since ReWrite TJvExXXX controls code hereafter,we detected the bug that control message did't send to form desiger(such as TJvSpeedButton of CM_MOUSEENTER).In TControl.WndProc, call "Form.Designer.IsDesignMsg" first to send message to Designer before dispatch message. All TJvExXXX control's has override " WndProc" procedure, in override WndProc, Dispatch some message Manual, That dosenot call inherited WndProc direct, these message dosenot send to designer too, otherwise call the inherited WndProc passed BaseWndProc called by custom message handler ,Induce maybe the override message handler skip to call inherited proc that the message never send to designer . so ,We must requisite to send message to designer before dispatch message custom in "TJvExXXX.WndProc" . In some control who's inherited of TJvExXXX, message handler killed the messsage who is send to designer. for example,in TJvCustomSpeedButton.MouseEnter ,this code killed the message send to designer:
>>
  if csDesigning in ComponentState then
    Exit;
<<
so we can change to like this ,call inherited proc first before exit porc.
>>
    inherited MouseEnter(Control);
    if csDesigning in ComponentState then
    Exit;
<<
but this is a lot of code of class inherited from TJvExXXX must be rewrite in all custom message handler, and this done maybe make user's oldversion code fallibility and uncertain, if user override the message handler and did't call inherited proc,the bug will occur yet.Of course,we can do this ,but must do the next plan first.

The best way fix this bug is:
Send the message to form desinger in TJvExXXX.WndProc Manual surely before you dispatch some message custom.so I writed a function DispatchIsDesignMsg,call item in TJvExXXX.WndProc before dispatch message Manual,inserted in all TJvExXXX.WndProc, that OK.

>>
function DispatchIsDesignMsg(Control: TControl; var Msg: TMessage):Boolean;
var
  Form: TCustomForm;
begin
  Result := False;
  if Control = nil then
    Exit;

  with Control do
  if (csDesigning in ComponentState) then
  begin
    Form := GetParentForm(Control);
    if (Form <> nil) and (Form.Designer <> nil) then
     Result := Form.Designer.IsDesignMsg(Control, Msg);
  end;
end;
<<

use like this:
>>
procedure TJvExControl.WndProc(var Msg: TMessage);
begin
  if DispatchIsDesignMsg(self,Msg) then
     Exit;
   case Msg.Msg of
....
<<

the files is fixed devtools\JvExVCL\src TJvExXXX control source.I did't fixed the override message handler bug in controls inherited from TJvExXXX,Only just fixed with DispatchIsDesignMsg,this bug is fixed needless.

this jvOfficebutton.pas is clearup file,all file tested ok.
Additional Information
Tags No tags attached.
Attached Files rar file icon JvExVCLsrc.rar [^] (6,860 bytes) 2005-04-11 01:14
? file icon JvOfficeColorButton.pas [^] (27,067 bytes) 2005-04-11 01:16

- Relationships

-  Notes
(0006980)
outchy (administrator)
2005-04-12 11:41

The JVExVCL modifications are now in the CVS.
Expecting a ccmmit of JvOfficeColorButton.pas later in the evening.
(0006981)
outchy (administrator)
2005-04-12 12:09

After looking at the JvOfficeColorButton.pas, you are undoing modifications made about 9 months ago (IT 2105).
http://homepages.borland.com/jedi/issuetracker/view.php?id=2105 [^]
I can't understand why a modification made to solve a bug some months ago have to be undone.
(0006988)
anonymous (viewer)
2005-04-12 22:14

>>I can't understand why a modification made to solve a bug some months ago have to be undone.

Because the jvofficebutton used JVExVCL,and the JVExVCL was rewrited more times, so i rewrite jvofficebutton more times.if jvofficebutton use the lastdate CVS version of JVExVCL,the code can writed simpleness,just only call Protected procedure MouseXXXX(..) is ok,did't need send CM_MOUSEXX message.
(0006992)
outchy (administrator)
2005-04-13 01:23

I committed your changes to the CVS repository.
Thanks for your job :)

- Issue History
Date Modified Username Field Change
2005-04-11 01:14 anonymous New Issue
2005-04-11 01:14 anonymous File Added: JvExVCLsrc.rar
2005-04-11 01:16 anonymous File Added: JvOfficeColorButton.pas
2005-04-12 10:36 outchy Status new => assigned
2005-04-12 10:36 outchy Assigned To => outchy
2005-04-12 11:41 outchy Note Added: 0006980
2005-04-12 12:09 outchy Note Added: 0006981
2005-04-12 12:10 outchy Status assigned => feedback
2005-04-12 22:14 anonymous Note Added: 0006988
2005-04-13 01:23 outchy Status feedback => resolved
2005-04-13 01:23 outchy Resolution open => fixed
2005-04-13 01:23 outchy Note Added: 0006992


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker