Andre Poenitz wrote:
> Of course, creating a context menu on right-click which a combo box of
> all available colors is a matter of 20 lines or so in 'pure' Qt, but I
> really don't know how to set this up in LyX's GUII scheme.

Shrug. Let me paint a picture:

class ContextSensitiveMenu {
public:
    typedef std::vector<std::string>::size_type size_type;

    size_type show(InsetBase * inset, 
              std::vector<std::string> const & menu_data) {
        if (is_showing(inset))
            return;
        // store the fact that the menu is visible for this inset.
        register(inset);
        // Invoke Qt code
        return show_menu(menu_data);
    }
private:
    bool is_showing(InsetBase *);
    void register(InsetBase *);
    size_type show_menu(std::vector<std::string> const &);
};

What's the big deal?
        
-- 
Angus

Reply via email to