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

--
Carsten Driesner (cd) - Project Lead OpenOffice.org Framework
Framework wiki: http://wiki.services.openoffice.org/wiki/Framework
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS

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

Reply via email to