BOOL ContextMenu::ShowOverView(Spread* pSpread, DocCoord ClickPos, ClickModifiers ClickMods) { // If there's a menu still around for some reason, get rid of it. if (pCurrentMenu) { pCurrentMenu->Hide(); } // Preserve current ID generator state AutoIDStash = MenuItem::GetAutomaticIDState(); // Make a new root item pRootItem = new MenuItem("CONTEXT"); if (pRootItem) { // OK, make this menu current and try to build it's contents pCurrentMenu=this; if (BuildOverView(pSpread, ClickPos, ClickMods)) { // Kernel menu built OK so create the OILy part of it... CreateContextMenu(pRootItem); return TRUE; } } // Failed to completely build Kernel menu structure so delete anything // that might have been built... Hide(); return FALSE; }
void SVNInfoLog::HandleMouseDown ( const JPoint& pt, const JXMouseButton button, const JSize clickCount, const JXButtonStates& buttonStates, const JXKeyModifiers& modifiers ) { if (button == kJXRightButton && clickCount == 1) { JXKeyModifiers emptyMod(GetDisplay()); SVNTextBase::HandleMouseDown(pt, kJXLeftButton, 2, buttonStates, emptyMod); JString rev; if (GetBaseRevision(&rev)) { CreateContextMenu(); itsContextMenu->PopUp(this, pt, buttonStates, modifiers); } } else { SVNTextBase::HandleMouseDown(pt, button, clickCount, buttonStates, modifiers); } }
void JXInputField::HandleMouseDown ( const JPoint& pt, const JXMouseButton button, const JSize clickCount, const JXButtonStates& buttonStates, const JXKeyModifiers& modifiers ) { if (button == kJXRightButton) { // if (!PointInSelection(pt)) // { // JXTEBase::HandleMouseDown(pt, kJXLeftButton, 1, buttonStates, modifiers); // } CreateContextMenu(); itsContextMenu->PopUp(this, pt, buttonStates, modifiers); } else { ShouldAllowDragAndDrop(modifiers.meta()); JXTEBase::HandleMouseDown(pt, button, clickCount, buttonStates, modifiers); } }
UserSelectView::UserSelectView(QList<UserItem*> uItems, QWidget* parent) : UsersView(uItems, parent) { slotUpdateItems(); // connect(this, SIGNAL(itemClicked(QTreeWidgetItem*, int)), SLOT(slotItemChanged(QTreeWidgetItem*, int))); connect(this, SIGNAL(itemChanged(QTreeWidgetItem*, int)), SLOT(slotItemChanged(QTreeWidgetItem*, int))); CreateContextMenu(); }
void CMusikListCtrl::ShowMenu( wxContextMenuEvent &WXUNUSED(event) ) #endif { wxMenu *context_menu = CreateContextMenu(); if(context_menu) { PopupMenu( context_menu); delete context_menu; } }
wxAreaChartCtrl::wxAreaChartCtrl(wxWindow *parent, wxWindowID id, const wxAreaChartData &data, const wxPoint &pos, const wxSize &size, long style) : wxChartCtrl(parent, id, pos, size, style), m_areaChart(data,size) { CreateContextMenu(); }
// FChart3d------------------------------------------------------------------------------------------------------------ FChart3d::FChart3d() { DataMap3d = 0; Pointer = Triple(0,0,0); Surface3d = new FSurface3d(*this); DrawPointer = new FDrawPointer(&Pointer); addEnrichment(*DrawPointer); CreateContextMenu(); setCoordinateStyle(BOX); }
void CShareBox::Init() { /* Set the window's size and opacity. */ resize(DefaultWidth, DefaultHeight); setWindowOpacity(DefaultOpacity); /* Set the colors and fonts. */ m_text_font.setPixelSize(28); m_text_normal.setRgb(215, 215, 215); m_text_highlight.setRgb(127, 127, 255); m_border_highlight.setRgb(127, 127, 215); /* Create the context menu and show the box. */ CreateContextMenu(); showNormal(); }
FReply SScrubWidget::OnMouseButtonUp( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent ) { bool bHandleLeftMouseButton = MouseEvent.GetEffectingButton() == EKeys::LeftMouseButton && this->HasMouseCapture(); bool bHandleRightMouseButton = MouseEvent.GetEffectingButton() == EKeys::RightMouseButton && this->HasMouseCapture() && bAllowZoom; if ( bHandleRightMouseButton ) { bPanning = false; FTrackScaleInfo TimeScaleInfo(ViewInputMin.Get(), ViewInputMax.Get(), 0.f, 0.f, MyGeometry.Size); FVector2D CursorPos = MyGeometry.AbsoluteToLocal(MouseEvent.GetLastScreenSpacePosition()); float NewValue = TimeScaleInfo.LocalXToInput(CursorPos.X); if( !bMouseMovedDuringPanning ) { CreateContextMenu(NewValue, MouseEvent); } return FReply::Handled().ReleaseMouseCapture(); } else if ( bHandleLeftMouseButton ) { if(DraggingBar) { DraggingBar = false; } else if( bDragging ) { OnEndSliderMovement.ExecuteIfBound( ValueAttribute.Get() ); } else { FTrackScaleInfo TimeScaleInfo(ViewInputMin.Get(), ViewInputMax.Get(), 0.f, 0.f, MyGeometry.Size); FVector2D CursorPos = MyGeometry.AbsoluteToLocal(MouseEvent.GetLastScreenSpacePosition()); float NewValue = TimeScaleInfo.LocalXToInput(CursorPos.X); CommitValue( NewValue, true, false ); } bDragging = false; return FReply::Handled().ReleaseMouseCapture(); } return FReply::Unhandled(); }
logical DesignerMode :: ContextMenuEvent (QContextMenuEvent *pQContextMenuEvent, QWidget *event_target ) { logical term = YES; QAction *action; bool ok = FALSE; QString text; BEGINSEQ if ( !context_menu ) CreateContextMenu(); if ( !ctx_design || !control ) ERROR if ( action = context_menu->exec(pQContextMenuEvent->globalPos()) ) switch ( action->data().toInt() ) { case DMC_Label: ctx_design->EditFieldLabel(control); break; case DMC_Edit: ctx_design->EditField(control); break; case DMC_Refresh: ctx_design->RefreshField(control); break; case DMC_ResetSize: ResetFieldSize(); break; case DMC_Preview: ctx_design->Preview(!ctx_design->HasPreview()); break; case DMC_ReloadControl: ctx_design->RefreshControl(); break; case DMC_Delete: ctx_design->DeleteField(control); break; } RECOVER term = NO; ENDSEQ return(term); }
void JXTabGroup::HandleMouseDown ( const JPoint& pt, const JXMouseButton button, const JSize clickCount, const JXButtonStates& buttonStates, const JXKeyModifiers& modifiers ) { itsDragAction = kInvalidClick; if (button == kJXLeftButton && itsScrollUpRect.Contains(pt)) { if (itsCanScrollUpFlag && itsFirstDrawIndex > 1) // avoid left click when arrow disabled { itsDragAction = kScrollUp; itsScrollUpPushedFlag = kJTrue; itsFirstDrawIndex--; Refresh(); ScrollWait(kInitialScrollDelay); itsScrollUpPushedFlag = kJFalse; // ignore first HandleMouseDrag() } } else if (button == kJXLeftButton && itsScrollDownRect.Contains(pt)) { if (itsCanScrollDownFlag && itsFirstDrawIndex < GetTabCount()) // avoid left click when arrow disabled { itsDragAction = kScrollDown; itsScrollDownPushedFlag = kJTrue; itsFirstDrawIndex++; Refresh(); ScrollWait(kInitialScrollDelay); itsScrollDownPushedFlag = kJFalse; // ignore first HandleMouseDrag() } } else if (button == kJXLeftButton && itsMouseIndex > 0 && itsCloseRect.Contains(pt)) { itsDragAction = kClose; itsClosePushedFlag = kJTrue; Refresh(); } else if (button == kJXLeftButton) { JIndex i; JRect r; if (FindTab(pt, &i, &r)) { ShowTab(i); } } else if (button == kJXRightButton) { CreateContextMenu(); itsContextMenu->PopUp(this, pt, buttonStates, modifiers); } else { ScrollForWheel(button, modifiers); } }
void SVNListBase::HandleMouseDown ( const JPoint& pt, const JXMouseButton button, const JSize clickCount, const JXButtonStates& buttonStates, const JXKeyModifiers& modifiers ) { JTableSelection& s = GetTableSelection(); itsIsDraggingFlag = kJFalse; itsSavedSelection->CleanOut(); JPoint cell; if (button > kJXRightButton) { ScrollForWheel(button, modifiers); } else if (!GetCell(pt, &cell)) { s.ClearSelection(); } else if (button == kJXLeftButton && modifiers.shift()) { itsIsDraggingFlag = s.ExtendSelection(cell); } else if (button == kJXLeftButton && modifiers.control()) { s.InvertCell(cell); if (s.IsSelected(cell)) { s.SetBoat(cell); s.SetAnchor(cell); } else { s.ClearBoat(); s.ClearAnchor(); } } else if (button == kJXLeftButton) { s.ClearSelection(); s.SetBoat(cell); s.SetAnchor(cell); s.SelectCell(cell); itsIsDraggingFlag = kJTrue; if (clickCount == 2) { OpenSelectedItems(); } } else if (button == kJXRightButton && clickCount == 1) { if (CreateContextMenu()) { if (!s.IsSelected(cell)) { s.ClearSelection(); s.SetBoat(cell); s.SetAnchor(cell); s.SelectCell(cell); } itsContextMenu->PopUp(this, pt, buttonStates, modifiers); } } }