View Issue Details

IDProjectCategoryView StatusLast Update
0001657JEDI VCL04 Feature Requestpublic2004-07-22 10:13
ReporterobonesAssigned Toobones 
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001657: Get a new style of appearing for TJvDesktopAlert
DescriptionHi

This addressed to everybody, but mostly to Peter as he is the one who created that nice component.
As you already know, the fading doesn't work with D5 and C5. Moreover, even if it is compiled in the application, it won't work under windows before Windows 2000.
So there is a need for an alternative method of appearing. I got the idea from Panda Antivirus which does the exact same thing, but instead of fading, it appears from the center as a growing rectangle. This is quite easy to do with regions applied to windows.
However, I don't really have time to think about the way to implement this nicely, so I just launch the idea in the air, hoping that someone will grasp it <g>.
TagsNo tags attached.

Activities

user72

2004-04-17 09:03

  ~0003921

It should work with D5 as long as the OS supports it (W2k+)

Do you have any example code to look at regarding using regions to grow the form?

I am thinking that maybe AnimateWindow might be used instead...

obones

2004-04-17 19:05

administrator   ~0003924

Last edited: 2004-04-17 19:34

This should work under Windows from NT3.51 and 95 up to the latest version.
There shouldn't be much to modify for Linux, provided there is a way to apply regions to a window.

<code>
procedure GrowFromCenter(AForm: TForm; Appear: Boolean=True);
var
  i: Integer;
  growthSteps: Integer;
  XGrowth, YGrowth: Integer;
  RegionRect: TRect;
  Region: HRGN;
  AppearFactor: Integer;
begin
  // The number of growth steps should be determined from the
  // duration of appearing (disappearing) animation
  growthSteps := 50;

  // determine the growth rate for X and Y directions
  XGrowth := AForm.Width div growthSteps;
  YGrowth := AForm.Height div growthSteps;

  if Appear then
  begin
    RegionRect := TRect(0,0,0,0);
    AppearFactor := 1;
  end
  else
  begin
    RegionRect := TRect(0,0,AForm.Width,AForm.Height);
    AppearFactor := -1;
  end;

  for i := 0 to growthSteps-1 do
  begin
    Region := CreateRectRgnIndirect(@RegionRect);
    SetWindowRgn(AForm.Handle, Region, True);
    // Note: According to the documentation, we don't have to destroy the region
    // This of course only applies to Windows

    // Grow the rectangle and keep it centered
    InflateRect(RegionRect, AppearFactor*XGrowth, AppearFactor*YGrowth);
    OffsetRect(RegionRect, -AppearFactor*(RegionRect.right-RegionRect.left) div 2,
                           -AppearFactor*(RegionRect.bottom-RegionRect.top) div 2);
  end;
end;
</code>

edited on: 04-17-04 19:34

user72

2004-04-18 01:57

  ~0003926

Thanks for the code, I will have a look at implementing this (as well as the MSN method) ASAP

user72

2004-06-25 05:06

  ~0004630

I won't have time to look into this issue, so someone else has to take over.

obones

2004-07-22 10:13

administrator   ~0004800

This is now implemented and in CVS. Please see the comments in changelog.txt at the root of the source tree.

Issue History

Date Modified Username Field Change
2004-04-17 01:30 obones New Issue
2004-04-17 09:03 user72 Note Added: 0003921
2004-04-17 19:05 obones Note Added: 0003924
2004-04-17 19:34 obones Note Edited: 0003924
2004-04-18 01:57 user72 Note Added: 0003926
2004-04-18 01:57 user72 Assigned To => user72
2004-04-18 01:57 user72 Status new => assigned
2004-06-25 05:06 user72 Note Added: 0004630
2004-06-25 05:06 user72 Assigned To user72 =>
2004-06-25 05:06 user72 Status assigned => acknowledged
2004-07-05 00:38 obones Status acknowledged => assigned
2004-07-05 00:38 obones Assigned To => obones
2004-07-22 10:13 obones Status assigned => resolved
2004-07-22 10:13 obones Resolution open => fixed
2004-07-22 10:13 obones Note Added: 0004800