////////////////////////////////////////////////////////////////////////////
// CTEDrawPopup クラスのインプリメンテーション
//
////////////////////////////////////////////////////////////////////////////

#include "TEDrawPopup.h"
#include "TaEditShell.h"

////////////////////////////////////////////////////////////////////////////
// 構築/破棄
////////////////////////////////////////////////////////////////////////////

CTEDrawPopup::CTEDrawPopup()
{

}

CTEDrawPopup::~CTEDrawPopup()
{

}

////////////////////////////////////////////////////////////////////////////
// メソッド
////////////////////////////////////////////////////////////////////////////

// 表示
void CTEDrawPopup::Popup( XButtonPressedEvent* event )
{
	bool f;
	f = m_TaEditShell->GetEnableCopyPasteMenu();
	XtSetSensitive( m_menuPopupCut, f ? True : False );
	XtSetSensitive( m_menuPopupCopy, f ? True : False );
	f = m_TaEditShell->GetEnableUndoMenu();
	XtSetSensitive( m_menuPopupUndo, f ? True : False );
	f = m_TaEditShell->GetEnableRedoMenu();
	XtSetSensitive( m_menuPopupRedo, f ? True : False );

	XmMenuPosition( m_menuPopup, event );
	XtManageChild( m_menuPopup );
}

void CTEDrawPopup::OnUndo( Widget w, XtPointer event )
{
	m_TaEditShell->OnEditUndo( w, event );
}

void CTEDrawPopup::OnRedo( Widget w, XtPointer event )
{
	m_TaEditShell->OnEditRedo( w, event );
}

void CTEDrawPopup::OnCut( Widget w, XtPointer event )
{
	m_TaEditShell->OnEditCut( w, event );
}

void CTEDrawPopup::OnCopy( Widget w, XtPointer event )
{
	m_TaEditShell->OnEditCopy( w, event );
}

void CTEDrawPopup::OnPaste( Widget w, XtPointer event )
{
	m_TaEditShell->OnEditPaste( w, event );
}

