Move XFE_RDFPopupMenu in PopupMenu.(cpp|h)

so the toolbars can use it too.
This commit is contained in:
slamm%netscape.com 1998-10-13 23:46:51 +00:00
parent f919eae25a
commit f4b1652435
3 changed files with 49 additions and 14 deletions

View File

@ -276,3 +276,35 @@ XFE_SimplePopupMenu::PushButtonActivate(Widget w, XtPointer userData)
{
; // Do nothing for now.
}
//////////////////////////////////////////////////////////////////////////
//
// RDFPopupMenu
//
//////////////////////////////////////////////////////////////////////////
XFE_RDFPopupMenu::XFE_RDFPopupMenu(String name, Widget parent,
HT_View view,
Boolean isWorkspace, Boolean isBackground)
: XFE_SimplePopupMenu(name, parent)
{
m_pane = HT_GetPane(view);
HT_Cursor cursor = HT_NewContextualMenuCursor(view,
isWorkspace, isBackground);
HT_MenuCmd command;
while(HT_NextContextMenuItem(cursor, &command))
{
if (command == HT_CMD_SEPARATOR)
addSeparator();
else
addPushButton(HT_GetMenuCmdName(command), (XtPointer)command,
HT_IsMenuCmdEnabled(m_pane, command));
}
}
void
XFE_RDFPopupMenu::PushButtonActivate(Widget /* w */, XtPointer userData)
{
HT_DoMenuCmd(m_pane, (HT_MenuCmd)(int)userData);
}

View File

@ -27,6 +27,8 @@
#include "Menu.h"
#include "htrdf.h" // For HT_View for XFE_RDFPopupMenu
class XFE_PopupMenuBase
{
public:
@ -75,4 +77,18 @@ public:
virtual void PushButtonActivate(Widget w, XtPointer userData);
};
class XFE_RDFPopupMenu : public XFE_SimplePopupMenu
{
public:
XFE_RDFPopupMenu(String name, Widget parent,
HT_View view,
Boolean isWorkspace, Boolean isBackground);
void PushButtonActivate(Widget w, XtPointer userData);
protected:
HT_Pane m_pane;
};
#endif /* _xfe_popupmenu_h */

View File

@ -32,20 +32,6 @@
#include "IconGroup.h"
#include "htrdf.h"
#include "NavCenterView.h"
#include "PopupMenu.h"
class XFE_RDFPopupMenu : public XFE_SimplePopupMenu
{
public:
XFE_RDFPopupMenu(String name, Widget parent,
HT_View view,
Boolean isWorkspace, Boolean isBackground);
void PushButtonActivate(Widget w, XtPointer userData);
protected:
HT_Pane m_pane;
};
//////////////////////////////////////////////////////////////////////////
class XFE_ColumnData
@ -58,6 +44,7 @@ public:
uint32 token_type;
};
//////////////////////////////////////////////////////////////////////////
class XFE_RDFPopupMenu;
class XFE_RDFTreeView : public XFE_View,
public XFE_RDFBase