Board index » delphi » Freeware components with source

Freeware components with source

Dwayne Mercredi's freeware component collection is three non-visual
components packaged together:

TIdleAction Component

This component is for taking advantage of idle time in an
application.  The idler unit sets up an event handler for the
Application.OnIdle event that iterates through all TIdleAction
components in the project and calls the OnTrigger event of each.
Ideal for those times when you need to do some low impact,
low priority background tasks such as polling a control's state
for speedbutton enabling or updating the keyboard state on a status
bar.

TLabelWithLineBreaks Component

This component is exactly the TLabel component, except it has the
ability to insert newlines at design time. Simply insert the '|'
character anywhere in the Caption property, and it is automatically
converted to a newline by the property editor.

TCommonCommand Component

This component allows you to group the command components (TMenuItems,
TSpeedButtons, and TButtons) and manipulate them as a group. It has a
design time double click editor that allows you to group the components
visually. Once a component is added to the group, any change made to
one of the properties of the TCommonCommand is automatically passed on
to the contained components.  Currently implements Enabled, Checked,
and OnClick properties. Useful for when multiple menu items
and speed buttons share the exact same set of properties and property
assignments (ie. SpeedButtonPaste, MainMenuPaste, PopupMenuPaste all
implement the same paste operation).

Available at http://www.ee.ualberta.ca/~mercredi/delphi/
--
Dwayne Mercredi              |  mercr...@ee.ualberta.ca
VP External                  |  http://www.ee.ualberta.ca/~mercredi/
Computer Engineering Club    |  cec...@ee.ualberta.ca
University of Alberta        |  http://www.ee.ualberta.ca/~ceclub/

 

Re:Freeware components with source


The TCommonCommand component had a bug which caused a GPF whenever
the component was removed from a form; a version of the components
which fixes this error is now available at the web page
http://www.ee.ualberta.ca/~mercredi/delphi/
My appologies to everyone who has already retrieved the components,
and I urge you to get the updated version.

This bug demonstrated some strange behaviour in the design
of the VCL:
The Notification procedure also gets called to notify a component
when it is about to be removed from its owner.  This can (and did)
lead to the following set of circumstances:

MyComponent.Destroy ->
  Destroy my part of the component
  inherited Destroy

inherited Destroy ->
  Remove self from owner's list
  other cleanup
  free memory

Remove self from owner's list ->
  owner calls MyComponent.Notification(MyComponent, opRemove)

This set of events results in virtual method Notification being
called on a partially destroyed object; if you reference a peice
of your object that has been freed (such as an internal TList)
within Notification, your component will probably GPF when it
is destroyed.  The fix for this is to ensure that the passed
in Component <> Self before accessing anything that may have
been already destroyed.

Anyway, I hope this helps someone else avoid this trap.

Quote
>Dwayne Mercredi's freeware component collection is three non-visual
>components packaged together:
>TIdleAction Component
>This component is for taking advantage of idle time in an
>application.  The idler unit sets up an event handler for the
>Application.OnIdle event that iterates through all TIdleAction
>components in the project and calls the OnTrigger event of each.
>Ideal for those times when you need to do some low impact,
>low priority background tasks such as polling a control's state
>for speedbutton enabling or updating the keyboard state on a status
>bar.
>TLabelWithLineBreaks Component
>This component is exactly the TLabel component, except it has the
>ability to insert newlines at design time. Simply insert the '|'
>character anywhere in the Caption property, and it is automatically
>converted to a newline by the property editor.
>TCommonCommand Component
>This component allows you to group the command components (TMenuItems,
>TSpeedButtons, and TButtons) and manipulate them as a group. It has a
>design time double click editor that allows you to group the components
>visually. Once a component is added to the group, any change made to
>one of the properties of the TCommonCommand is automatically passed on
>to the contained components.  Currently implements Enabled, Checked,
>and OnClick properties. Useful for when multiple menu items
>and speed buttons share the exact same set of properties and property
>assignments (ie. SpeedButtonPaste, MainMenuPaste, PopupMenuPaste all
>implement the same paste operation).
>Available at http://www.ee.ualberta.ca/~mercredi/delphi/

--
Dwayne Mercredi              |  mercr...@ee.ualberta.ca
VP External                  |  http://www.ee.ualberta.ca/~mercredi/
Computer Engineering Club    |  cec...@ee.ualberta.ca
University of Alberta        |  http://www.ee.ualberta.ca/~ceclub/

Other Threads