IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16772


Ignore:
Timestamp:
Mar 1, 2008, 9:27:04 AM (18 years ago)
Author:
eugene
Message:

adding flipx, flipy buttons; fix element positions

Location:
branches/eam_branch_20080223/Ohana/src/kapa2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080223/Ohana/src/kapa2/include/buttons.h

    r16011 r16772  
    119119   0x42, 0x84, 0x84, 0x00, 0x42, 0x84, 0x84, 0x00, 0x62, 0xc4, 0xc4, 0x00,
    120120   0x5c, 0xb9, 0xb8, 0x00};
     121#define flipx_width 25
     122#define flipx_height 25
     123static unsigned char flipx_bits[] = {
     124   0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
     125   0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x80, 0x10, 0x02, 0x00,
     126   0x40, 0x00, 0x04, 0x00, 0x20, 0x10, 0x08, 0x00, 0x10, 0x10, 0x10, 0x00,
     127   0x08, 0x00, 0x20, 0x00, 0x04, 0x10, 0x40, 0x00, 0x02, 0x10, 0x80, 0x00,
     128   0x01, 0x00, 0x00, 0x01, 0x02, 0x10, 0x80, 0x00, 0x04, 0x10, 0x40, 0x00,
     129   0x08, 0x00, 0x20, 0x00, 0x10, 0x10, 0x10, 0x00, 0x20, 0x10, 0x08, 0x00,
     130   0x40, 0x00, 0x04, 0x00, 0x80, 0x10, 0x02, 0x00, 0x00, 0x11, 0x01, 0x00,
     131   0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
     132   0x00, 0x10, 0x00, 0x00 };
     133#define flipy_width 25
     134#define flipy_height 25
     135static unsigned char flipy_bits[] = {
     136   0x00, 0x10, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00,
     137   0x00, 0x82, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x80, 0x00, 0x02, 0x00,
     138   0x40, 0x00, 0x04, 0x00, 0x20, 0x00, 0x08, 0x00, 0x10, 0x00, 0x10, 0x00,
     139   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     140   0xb7, 0x6d, 0xdb, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     141   0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00, 0x08, 0x00,
     142   0x40, 0x00, 0x04, 0x00, 0x80, 0x00, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00,
     143   0x00, 0x82, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00,
     144   0x00, 0x10, 0x00, 0x00 };
  • branches/eam_branch_20080223/Ohana/src/kapa2/include/prototypes.h

    r16632 r16772  
    195195int           RecenterRescale     PROTO((Graphic *graphic, KapaImageWidget *image));
    196196int           ToggleDEG           PROTO((Graphic *graphic, KapaImageWidget *image));
     197int           FlipImageX          PROTO((Graphic *graphic, KapaImageWidget *image));
     198int           FlipImageY          PROTO((Graphic *graphic, KapaImageWidget *image));
    197199int           Overlay0            PROTO((Graphic *graphic, KapaImageWidget *image));
    198200int           Overlay1            PROTO((Graphic *graphic, KapaImageWidget *image));
  • branches/eam_branch_20080223/Ohana/src/kapa2/include/structures.h

    r16632 r16772  
    180180  Button   heat_button;
    181181  Button   overlay_button[NOVERLAYS];
     182  Button   flipx_button;
     183  Button   flipy_button;
    182184
    183185  // location of the status box
  • branches/eam_branch_20080223/Ohana/src/kapa2/src/ButtonFunctions.c

    r16632 r16772  
    1717  CreateWide (graphic, image);
    1818  Refresh ();
    19   XFlush (graphic[0].display);
    2019  return (TRUE);
    2120}
     
    2928  CreateWide (graphic, image);
    3029  Refresh ();
    31   XFlush (graphic[0].display);
    3230  return (TRUE);
    3331}
     
    4139  CreateWide (graphic, image);
    4240  Refresh ();
    43   XFlush (graphic[0].display);
    4441  return (TRUE);
    4542}
     
    5249  Remap (graphic, image);
    5350  Refresh ();
    54   FlushDisplay (graphic[0].display);
    5551  return (TRUE);
    5652
     
    6258  Remap (graphic, image);
    6359  Refresh ();
    64   FlushDisplay (graphic[0].display);
    6560  return (TRUE);
    6661
     
    7570  Remap (graphic, image);
    7671  Refresh ();
    77   FlushDisplay (graphic[0].display);
    7872  return (TRUE);
    7973
    8074}
    8175
     76int FlipImageX (Graphic *graphic, KapaImageWidget *image) {
     77
     78  image[0].picture.flipx = !image[0].picture.flipx;
     79  image[0].zoom.flipx    = !image[0].zoom.flipx;
     80  image[0].wide.flipx    = !image[0].wide.flipx;
     81 
     82  Remap (graphic, image);
     83  CreateWide (graphic, image);
     84  Refresh ();
     85  return (TRUE);
     86}
     87
     88int FlipImageY (Graphic *graphic, KapaImageWidget *image) {
     89
     90  image[0].picture.flipy = !image[0].picture.flipy;
     91  image[0].zoom.flipy    = !image[0].zoom.flipy;
     92  image[0].wide.flipy    = !image[0].wide.flipy;
     93 
     94  Remap (graphic, image);
     95  CreateWide (graphic, image);
     96  Refresh ();
     97  return (TRUE);
     98}
     99
    82100int ToggleDEG (Graphic *graphic, KapaImageWidget *image) {
    83101
    84   image[0].picture.flipy = !image[0].picture.flipy;
    85   image[0].zoom.flipy = !image[0].zoom.flipy;
    86   image[0].wide.flipy = !image[0].wide.flipy;
    87102  image[0].DecimalDegrees = image[0].DecimalDegrees ^ TRUE;
    88103  StatusBox (graphic, image);
     
    97112  image[0].overlay[0].active = image[0].overlay[0].active ^ TRUE;
    98113  Refresh ();
    99   FlushDisplay (graphic[0].display);
    100114  return (TRUE);
    101115
     
    106120  image[0].overlay[1].active = image[0].overlay[1].active ^ TRUE;
    107121  Refresh ();
    108   FlushDisplay (graphic[0].display);
    109122  return (TRUE);
    110123
     
    115128  image[0].overlay[2].active = image[0].overlay[2].active ^ TRUE;
    116129  Refresh ();
    117   FlushDisplay (graphic[0].display);
    118130  return (TRUE);
    119131
     
    124136  image[0].overlay[3].active = image[0].overlay[3].active ^ TRUE;
    125137  Refresh ();
    126   FlushDisplay (graphic[0].display);
    127138  return (TRUE);
    128139
  • branches/eam_branch_20080223/Ohana/src/kapa2/src/CheckButtons.c

    r16011 r16772  
    2626    button = &image[0].hms_button;
    2727
     28  if (InButton (event, &image[0].flipx_button))
     29    button = &image[0].flipx_button;
     30
     31  if (InButton (event, &image[0].flipy_button))
     32    button = &image[0].flipy_button;
     33
    2834  for (i = 0; i < NOVERLAYS; i++) {
    2935    if (InButton (event, &image[0].overlay_button[i]))
  • branches/eam_branch_20080223/Ohana/src/kapa2/src/Image.c

    r16632 r16772  
    106106  InitButtonSize (&image[0].hms_button, hms_width, hms_height, hms_bits);
    107107  InitButtonFunc (&image[0].hms_button, ToggleDEG);
     108
     109  InitButtonSize (&image[0].flipx_button, flipx_width, flipx_height, flipx_bits);
     110  InitButtonFunc (&image[0].flipx_button, FlipImageX);
     111
     112  InitButtonSize (&image[0].flipy_button, flipy_width, flipy_height, flipy_bits);
     113  InitButtonFunc (&image[0].flipy_button, FlipImageY);
    108114
    109115  return (image);
     
    175181    DrawButton (graphic, &image[0].hms_button);
    176182
     183    DrawButton (graphic, &image[0].flipx_button);
     184    DrawButton (graphic, &image[0].flipy_button);
     185
    177186    for (i = 0; i < NOVERLAYS; i++) {
    178187      DrawButton (graphic, &image[0].overlay_button[i]);
  • branches/eam_branch_20080223/Ohana/src/kapa2/src/SetImageSize.c

    r16632 r16772  
    2626  dY = graphic[0].dy * section[0].dy;
    2727
     28  textpad = USE_XWINDOW ? graphic[0].font[0].ascent : 10;
     29  textdY = 6*textpad + 7*PAD1;
     30  WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1);
     31
    2832  switch (image[0].location) {
    29     case 0:
     33
     34    case 0: // no zoom / status / wide
    3035      if (section->graph) {
    3136          image[0].picture.x  = graph[0].axis[0].fx;
     
    4348      return;
    4449
    45     case 1:
    46       textpad = USE_XWINDOW ? graphic[0].font[0].ascent : 10;
    47       textdY = 6*textpad + 7*PAD1;
    48       WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1);
     50    case 1: // zoom / status / wide on bottom
    4951
    5052      if (section->graph) {
     
    110112      image[0].recenter_button.y = image[0].PS_button.y;
    111113
     114      // add just below
     115      image[0].flipx_button.x = image[0].recenter_button.x + image[0].recenter_button.dx + PAD1;
     116      image[0].flipx_button.y = image[0].recenter_button.y;
     117
     118      image[0].flipy_button.x = image[0].hms_button.x + image[0].hms_button.dx + PAD1;
     119      image[0].flipy_button.y = image[0].hms_button.y;
     120
    112121      // XXX zoom should scale somewhat with the image? (with a min and a max)
    113122      // XXX actually, it is limited by the buttons and status region
    114123      image[0].wide.dx = ZOOM_X;
    115124      image[0].wide.dy = ZOOM_Y;
    116       image[0].wide.x = image[0].recenter_button.x + image[0].recenter_button.dx + PAD1;
    117       image[0].wide.y = image[0].PS_button.y;
    118       break;
    119 
    120     case 3:
    121       textpad = USE_XWINDOW ? graphic[0].font[0].ascent : 10;
    122       textdY = 6*textpad + 7*PAD1;
    123       WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1);
     125      image[0].wide.x = image[0].flipx_button.x + image[0].flipx_button.dx + PAD1;
     126      image[0].wide.y = image[0].zoom.y;
     127      break;
     128
     129    case 3: // zoom / status / wide on top
    124130
    125131      if (section->graph) {
     
    185191      image[0].recenter_button.y = image[0].PS_button.y;
    186192
     193      // add just below
     194      image[0].flipx_button.x = image[0].recenter_button.x + image[0].recenter_button.dx + PAD1;
     195      image[0].flipx_button.y = image[0].recenter_button.y;
     196
     197      image[0].flipy_button.x = image[0].hms_button.x + image[0].hms_button.dx + PAD1;
     198      image[0].flipy_button.y = image[0].hms_button.y;
     199
    187200      // XXX zoom should scale somewhat with the image? (with a min and a max)
    188201      // XXX actually, it is limited by the buttons and status region
    189202      image[0].wide.dx = ZOOM_X;
    190203      image[0].wide.dy = ZOOM_Y;
    191       image[0].wide.x = image[0].PS_button.x;
    192       image[0].wide.y = image[0].PS_button.y + BUTTON_HEIGHT + PAD1;
    193       break;
    194 
    195     case 2:
     204      image[0].wide.x = image[0].flipx_button.x + image[0].flipx_button.dx + PAD1;
     205      image[0].wide.y = image[0].zoom.y;
     206      break;
     207
     208    case 2: // zoom / status / wide on left
    196209
    197210      if (section->graph) {
     
    220233
    221234      /** everything below is tied in x-dir to the zoom box **/
    222       textpad = USE_XWINDOW ? graphic[0].font[0].ascent : 10;
    223235      image[0].text_x = image[0].zoom.x;
    224236      image[0].text_y = image[0].zoom.y + image[0].zoom.dy + PAD1;
     
    258270      image[0].recenter_button.y = image[0].PS_button.y;
    259271
     272      // add just below
     273      image[0].flipx_button.x = image[0].PS_button.x;
     274      image[0].flipx_button.y = image[0].PS_button.y + BUTTON_HEIGHT + PAD1;
     275
     276      image[0].flipy_button.x = image[0].flipx_button.x + image[0].flipx_button.dx + PAD1;
     277      image[0].flipy_button.y = image[0].flipx_button.y;
     278
    260279      // XXX zoom should scale somewhat with the image? (with a min and a max)
    261280      // XXX actually, it is limited by the buttons and status region
    262281      image[0].wide.dx = ZOOM_X;
    263282      image[0].wide.dy = ZOOM_Y;
    264       image[0].wide.x = image[0].recenter_button.x + image[0].recenter_button.dx + PAD1;
    265       image[0].wide.y = image[0].PS_button.y;
    266       break;
    267 
    268     case 4:
     283      image[0].wide.x = image[0].flipx_button.x;
     284      image[0].wide.y = image[0].flipx_button.y + BUTTON_HEIGHT + PAD1;
     285      break;
     286
     287    case 4:  // zoom / status / wide on right
    269288
    270289      if (section->graph) {
     
    293312
    294313      /** everything below is tied in x-dir to the zoom box **/
    295       textpad = USE_XWINDOW ? graphic[0].font[0].ascent : 10;
    296314      image[0].text_x = image[0].zoom.x;
    297315      image[0].text_y = image[0].zoom.y + image[0].zoom.dy + PAD1;
     
    331349      image[0].recenter_button.y = image[0].PS_button.y;
    332350
     351      // add just below
     352      image[0].flipx_button.x = image[0].zoom.x;
     353      image[0].flipx_button.y = image[0].PS_button.y + BUTTON_HEIGHT + PAD1;
     354
     355      image[0].flipy_button.x = image[0].flipx_button.x + image[0].flipx_button.dx + PAD1;
     356      image[0].flipy_button.y = image[0].flipx_button.y;
     357
    333358      // XXX zoom should scale somewhat with the image? (with a min and a max)
    334359      // XXX actually, it is limited by the buttons and status region
    335360      image[0].wide.dx = ZOOM_X;
    336361      image[0].wide.dy = ZOOM_Y;
    337       image[0].wide.x = image[0].PS_button.x;
    338       image[0].wide.y = image[0].PS_button.y + BUTTON_HEIGHT + PAD1;
     362      image[0].wide.x = image[0].flipx_button.x;
     363      image[0].wide.y = image[0].flipx_button.y + BUTTON_HEIGHT + PAD1;
    339364      break;
    340365
Note: See TracChangeset for help on using the changeset viewer.