Hi,

I wouldn't want to burden MenuBar with that because conceptionally it has nothing to do with that. I'd like to create a create a new CommandEvent that you would get through :Notify on the active WorkWindow, which should trigger the respective dialog. We already have that mechanism for triggering special functions (like hangul conversion).

Does that sound reasonable ?

Just my 2 cents, pl

Carsten Driesner wrote:
Pavel Janík wrote:
Hi,

in native Mac OS X application the so called "Application menu" has two menu items - About and Preferences (see e.g. http://tinyurl.com/286gao).

Click on About menu item and/or Preferences... item is cought in VCL. We would like to be able to send events to handle these actions to the application. Ie. we want to have something like SALEVENT_SHUTDOWN for Quit menu item and handle it somewhere in framework.

How to do that? Can you please help us to do so?
Hi Pavel,

That's not an easy task to do. The framework module creates a VCL menu bar and fills the menu bar with items which contain command URLs that will be mapped to the correct code. You want to fill a system menu where no framework code is involved. That's a complete new approach. I would propose to extend the VCL menu bar class. It should provide two additional handlers for About and Preferences which will be triggered by code/events activated by your MacOS X VCL implementation. I can extend the framework code to map these handlers to the correct commands. I think we should discuss this with Philipp Lohmann. May be he has a better idea to solve this problem.

class VCL_DLLPUBLIC MenuBar : public Menu
{
    Link                maCloserHdl;
    Link                maFloatHdl;
    Link                maHideHdl;
/* New */
    Link                maPreferenceHdl;
    Link                maAboutHdl;
/* New */
    ...

    void SetCloserHdl( const Link& rLink );
    const Link& GetCloserHdl() const;
    void SetFloatButtonClickHdl( const Link& rLink );
    const Link& GetFloatButtonClickHdl() const;
    void SetHideButtonClickHdl( const Link& rLink );
    const Link& GetHideButtonClickHdl() const;

/* New */
    void SetAboutHdl( const Link& rLink );
        const Link& GetAboutHdl() const;
    void SetPreferenceHdl( const Link& rLink );
        const Link& GetPreferenceHdl() const;
/* New */
        ...
}

Regards,
Carsten



--
If you give someone a program, you will frustrate them for a day;
if you teach them how to program, you will frustrate them for a lifetime.
     -- Author unknown

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to