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

List:       koffice-devel
Subject:    Bug:120685
From:       Gary Cramblitt <garycramblitt () comcast ! net>
Date:       2006-01-24 13:14:32
Message-ID: 200601240814.32327.garycramblitt () comcast ! net
[Download RAW message or body]

Attached is patch to permit Menu key to popup context menu in KSpread when 
focus is on a cell of sheet.  Since I'm a kspread newbie, not sure if this is 
correct.  Would someone check please?

Thanks
-- 
Gary Cramblitt (aka PhantomsDad)

["kspread_canvas.cc.patch" (text/x-diff)]

Index: kspread_canvas.cc
===================================================================
--- kspread_canvas.cc	(revision 501955)
+++ kspread_canvas.cc	(working copy)
@@ -2900,7 +2900,8 @@
        (_ev->key() != Key_Left) &&
        (_ev->key() != Key_Home) &&
        (_ev->key() != Key_Enter) &&
-       (_ev->key() != Key_Return) )
+       (_ev->key() != Key_Return) &&
+       (_ev->key() != KGlobalSettings::contextMenuKey()))
   {
     QWidget::keyPressEvent( _ev );
     return;
@@ -2911,6 +2912,17 @@
   _ev->accept();
 
   d->view->doc()->emitBeginOperation(false);
+  if ( _ev->key() == KGlobalSettings::contextMenuKey() ) {
+    Sheet* sheet = activeSheet();
+    if (sheet) {
+      int row = markerRow();
+      int col = markerColumn();
+      KoPoint kop(sheet->columnPos(col, this), sheet->rowPos(row, this));
+      QPoint p = d->view->doc()->zoomPoint(kop);
+      p = mapToGlobal(p);
+      d->view->openPopupMenu( p );
+    }
+  }
   switch( _ev->key() )
   {
    case Key_Return:


_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


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

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