View Issue Details

IDProjectCategoryView StatusLast Update
0002860JEDI VCL00 JVCL Componentspublic2005-04-13 01:23
ReporteranonymousAssigned Tooutchy 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version3.10 
Summary0002860: Bug: TJvExXXX control mybe did't send message to Form Designer.
DescriptionHi 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.
TagsNo tags attached.

Activities

2005-04-11 01:14

 

JvExVCLsrc.rar (6,860 bytes)

2005-04-11 01:16

 

JvOfficeColorButton.pas (27,067 bytes)

outchy

2005-04-12 11:41

administrator   ~0006980

The JVExVCL modifications are now in the CVS.
Expecting a ccmmit of JvOfficeColorButton.pas later in the evening.

outchy

2005-04-12 12:09

administrator   ~0006981

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.

anonymous

2005-04-12 22:14

viewer   ~0006988

>>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.

outchy

2005-04-13 01:23

administrator   ~0006992

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