Thursday, April 05, 2007, 1:55:29 PM, Marc wrote:

MW> Tom Verhoeff wrote:
>> I have some students who are trying to complete the Delphi 6
>> Text Editor tutorial using Lazarus.  See e.g. Chapter 4 of
>> 
>>       <http://www.win.tue.nl/~hemerik/2IP20/Doc/Qs.pdf>
>> 
>> They run into some problems.  E.g. Lazarus apparently does not
>> (yet) have ActionManagers.  Hence, also the configuration of
>> standard actions like Cut/Copy/Paste is not a matter of a few clicks.
>> 
>> How hard is it to do this "yourself" (i.e. not using an ActionManager,
>> write the necessary code)?  Note that TAction and a number of related
>> facilities are available in Lazarus.

Typically, in Delphi you would do it like this (without TActionManager):

1. Drop an TActionList onto form
2. Add a standard action from StdAcnts unit (e.g. TEditCut) to it
3. Drop a TMainMenu and add a menu item to it
4. Assign the Action property of menu item to necessary TAction.
5. Optionally, drop a TToolBar, add button and assign it to the same
TAction.

These steps do not require any coding.
The same may be done with Lazarus. However, the problem is that its
StdActns unit is currently just a skeleton, it has no functionality.

MW> Yes, actionmanagers at one time were introduced in Delphi. I've never 
MW> taken the time to figure out what I can do with them and why they are 
MW> usefull. So, if someone can give a brief clue, they might get added to 
MW> Lazarus someday.

The ActionManagers look like an attempt to mimic MSOffice 2000 user
interface (the same look, the ability to customize menus and toolbars
at runtime, and the ability to hide rarely used commands).
On the other hand, they represent much more elaborated design than it
was before. Briefly, you drag an action to menu bar and it's
automatically rendered as menu item, then you drag the same action to
the toolbar and it's rendered as a button. The whole thing was designed
to custom paint its UI and support visual styles
(at least partially, as ColorMaps). With proper implementation, this
component could easily be completely cross-platform. However,
regarding its actual implementation I have a feeling that everything
possible and impossible was done so that nobody could ever use it with CLX.

-- 
Best regards,
 Sergei


_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to