[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kuml
Subject:    overview
From:       Jake Fear <fear1 () home ! com>
Date:       1999-12-06 9:30:59
[Download RAW message or body]

Hi, This message is probably of interest mainly to diagram writers.  Previously
in the WinOverView class there was some popup menu handling hard coded in.  That
meant if you wanted to provide popup menus for your LVIDiagrams you had to do
it in the WinOverView class.  It was also based on a hard coded type match,
basically just a C switch.  The original mechanism is still in place (so no
need to change right away) but a new mechanism will soon be checked in (I am
testing it now).  There is now a pure virtual class named PopupProvider that
looks like this:

class PopupProvider {

public:
virtual KPopupMenu* getPopupMenu() = 0;
virtual void setPopupMenu(KPopupMenu* popup) = 0;
};

That means we replaced the switch with polymorphic behavior on the part of the
LVIDiagrams.  

This interface is implmented by LVIDiagrams.  The default just returns null. 
You would be expected to override this behavior to provide your own popup menu. 
This keeps it more component oriented, so diagram writers don't have to look at
the guts of the WinOverView class to add their popups.  Keep an eye out for the
checkin, should be in the next 24 hours or so.

There are a few other places with this kind of hard coded switch logic.  It
should be avoided when possible (which is almost always), polymorphic behavior
is prefereable.

Cheers
 -- 
Jake Fear

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic