IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 24, 2006, 2:42:35 PM (20 years ago)
Author:
eugene
Message:

moved check_permissions to libohana, added buttons to Kii

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kii/event/InterpretPresses.c

    r2466 r6674  
    1010 
    1111  if ((event[0].type == ButtonPress) && InPicture (event, &layout[0].picture)) {
    12     Reorient (graphic, layout, event);
     12    ReorientOnButton (graphic, layout, event);
    1313  }
    1414
     
    5050}
    5151
     52void ReorientOnButton (Graphic *graphic, Layout *layout, XButtonEvent *mouse_event) {
     53
     54  double X, Y;
     55
     56  Screen_to_Image (&X, &Y, (double)mouse_event[0].x, (double)mouse_event[0].y, layout);
     57  X = 0.5*layout[0].matrix.Naxis[0] - X;
     58  Y = 0.5*layout[0].matrix.Naxis[1] - Y;
     59
     60  switch (mouse_event[0].button) {
     61    case 1:
     62      Reorient (graphic, layout, X, Y, 0);
     63      break;
     64    case 2:
     65      Reorient (graphic, layout, X, Y, -1);
     66      break;
     67    case 3:
     68      Reorient (graphic, layout, X, Y, +1);
     69      break;
     70    default:
     71      break;
     72  }
     73}
Note: See TracChangeset for help on using the changeset viewer.