Topic: Moving Coordinate System With mbRight

I know you can click the "Move coordinate system with mouse..." button or press Ctrl+M or hold the shift key and drag with the left mouse button. I think it would also be nice to be able to move the coordinate system with the right mouse button. I don't think it would be that hard it implement and the right mouse button isn't used for anything else so it would only enhance user experience.

I didn't actually compile the code, but this is a general idea of how I think you could add it. Note: this is from the v4.3 software posted on sourceforge, I don't know if much has changed since then.

In Unit1.cpp

in the function

void __fastcall TForm1::Image1MouseDown(TObject *Sender, TMouseButton Button,
    TShiftState Shift, int X, int Y)
    case mbRight:
      if(CursorState != csMoveLabel && CursorState != csMoveLegend)
      {
        TPoint Pos = Image1->ClientToScreen(TPoint(X, Y));
        if(Data.FindLabel(X, Y))
          PopupMenu3->Popup(Pos.x, Pos.y);
        else if(Draw.InsideLegend(X, Y))
          PopupMenu4->Popup(Pos.x, Pos.y);

        SetCursorState(csIdle);
      }else if(CursorState == csIdle)
        SetCursorState(csMove);

That should allow you to drag the screen as long as the mouse is not on top of any labels or legend.

Now to take care of letting the mouse button up add the if(Button == mbRight) part after the switch block for the mbLeft mouse button check in the function

void __fastcall TForm1::Image1MouseUp(TObject *Sender, TMouseButton Button,
    TShiftState Shift, int X, int Y)
      ...
      case csZoomWindow:
        SetCursorState(csIdle);
        if(X != xZoom && Y != yZoom)
          //Zoom to user selected window;don't change coordinates
          ZoomWindow(Draw.xCoord(Shape1->Left), Draw.xCoord(Shape1->Left+Shape1->Width), Draw.yCoord(Shape1->Top+Shape1->Height), Draw.yCoord(Shape1->Top));
        break;
    }
  if(Button == mbRight)
    switch(CursorState)
    {
      case csMoving:
        SetCursorState(csMove);
        break;
    }

Like I said, I can't compile this to test it so I'm hoping its right. All in all it will give one more capability and add an extra zest of user friendliness.

Re: Moving Coordinate System With mbRight

I will consider it, but I think there are enough ways to move the coordinate system already. You can also hold Ctrl down and use the arrow keys.

Re: Moving Coordinate System With mbRight

No worries, just a suggestion. I unintentionally dragged the coordinate system with the right mouse button and though, "hmm I wonder if that would be difficult to implement". Great program and super useful nonetheless.