IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13401


Ignore:
Timestamp:
May 16, 2007, 1:16:49 PM (19 years ago)
Author:
eugene
Message:

sync graph and image sizes

Location:
branches/kapa-mods-2007-05/Ohana/src
Files:
1 added
19 edited

Legend:

Unmodified
Added
Removed
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/include/constants.h

    r13320 r13401  
    1010 | PointerMotionMask)
    1111
    12 # define PAD1  5
    13 # define PAD2  3
     12# define PAD1  3
     13# define PAD2  5
    1414# define TEXTPAD 25
    1515# define COLORPAD 10
    1616# define TEXT_Y 15
    17 # define ZOOM_X 170
    18 # define ZOOM_Y 170
     17# define ZOOM_X 152
     18# define ZOOM_Y 152
    1919# define NOVERLAYS 4
    2020# define BUTTON_WIDTH 28
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/include/structures.h

    r13320 r13401  
    138138  Button   grey_button;
    139139  Button   rainbow_button;
    140   Button   puns_button;
     140  Button    puns_button;
    141141  Button   overlay_button[NOVERLAYS];
    142142
    143143  // location of the status box
    144144  int      text_x, text_y;
     145  int      text_dx, text_dy;
    145146  int      location;          // position of the zoom/status widgets (0 = none, 1-4 = bottom,left,top,right)
    146147  int      MovePointer;
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/DefineSection.c

    r13344 r13401  
    3333
    3434  if (MoveSection) {
    35     SetGraphSize (section);
    36     SetImageSize (section);
     35    SetSectionSizes (section);
    3736    Refresh (1);
    3837  }
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/Image.c

    r13394 r13401  
    9696  graphic = GetGraphic ();
    9797
    98   XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
    99   XDrawRectangle (graphic[0].display, graphic[0].window, graphic[0].gc,
    100                   image[0].picture.x, image[0].picture.y,
    101                   image[0].picture.dx + 1, image[0].picture.dy + 1);
     98  XSetForeground (graphic[0].display,  graphic[0].gc, graphic[0].fore);
     99  XDrawRectangle (graphic[0].display,  graphic[0].window, graphic[0].gc,
     100                  image[0].picture.x,  image[0].picture.y,
     101                  image[0].picture.dx+1, image[0].picture.dy+1);
    102102 
    103103  XPutImage (graphic[0].display, graphic[0].window, graphic[0].gc,
     
    124124 
    125125    /* erase everything below zoom box, then draw */
     126    /*
    126127    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back);
    127128    XFillRectangle (graphic[0].display, graphic[0].window, graphic[0].gc,
    128                     image[0].text_x, image[0].text_x, image[0].zoom.dx, graphic[0].dy);
    129    
     129                    image[0].text_x, image[0].text_x, image[0].text_dx, image[0].text_dy);
     130    */   
    130131    DrawButton (graphic, &image[0].PS_button);
    131132    DrawButton (graphic, &image[0].recenter_button);
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadFrame.c

    r13394 r13401  
    1111  if (section->graph == NULL) {
    1212    section->graph = InitGraph ();
    13     SetGraphSize (section);
     13    SetSectionSizes (section);
    1414  }
    1515  graph = section->graph;
     
    6262  }
    6363
    64   SetGraphSize (section);
     64  SetSectionSizes (section);
    6565  if (USE_XWINDOW) DrawFrame (graph);
    6666  FlushDisplay ();
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadLabels.c

    r13344 r13401  
    1111  if (section->graph == NULL) {
    1212    section->graph = InitGraph ();
    13     SetGraphSize (section);
     13    SetSectionSizes (section);
    1414  }
    1515  graph = section->graph;
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadObject.c

    r13344 r13401  
    1111  if (section->graph == NULL) {
    1212    section->graph = InitGraph ();
    13     SetGraphSize (section);
     13    SetSectionSizes (section);
    1414  }
    1515  graph = section->graph;
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadOverlay.c

    r13344 r13401  
    1717  if (section->image == NULL) {
    1818    section->image = InitImage ();
    19     SetImageSize (section);
     19    SetSectionSizes (section);
    2020  }
    2121  image   = section->image;
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadPicture.c

    r13344 r13401  
    1414  if (section->image == NULL) {
    1515    section->image = InitImage ();
    16     SetImageSize (section);
     16    SetSectionSizes (section);
    1717  }
    1818  image = section->image;
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadTextlines.c

    r13344 r13401  
    1313    if (section->graph == NULL) {
    1414    section->graph = InitGraph ();
    15     SetGraphSize (section);
     15    SetSectionSizes (section);
    1616  }
    1717
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadTickmarks.c

    r13344 r13401  
    1212  if (section->image == NULL) {
    1313    section->image = InitImage ();
    14     SetImageSize (section);
     14    SetSectionSizes (section);
    1515  }
    1616  image   = section->image;
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/Reconfig.c

    r13320 r13401  
    2525  for (i = 0; i < Nsection; i++) {
    2626      section = GetSectionByNumber (i);
    27       SetGraphSize (section);
    28       SetImageSize (section);
     27      SetSectionSizes (section);
    2928  }
    3029
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/Resize.c

    r13344 r13401  
    3030  for (i = 0; i < Nsection; i++) {
    3131      section = GetSectionByNumber (i);
    32       SetGraphSize (section);
    33       SetImageSize (section);
     32      SetSectionSizes (section);
    3433  }
    3534
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/Sections.c

    r13344 r13401  
    147147  return (TRUE);
    148148}
     149
     150void SetSectionSizes (Section *section) {
     151
     152    SetGraphSize (section);
     153    SetImageSize (section);
     154    return;
     155}
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/SetImageSize.c

    r13394 r13401  
    88
    99  int Xs, Ys, Xe, Ye, dX, dY;
     10  int textpad, textdY, WdY;
    1011  KapaImageWidget *image;
     12  KapaGraphWidget *graph;
    1113  Graphic *graphic;
    1214
     
    1416  image = section->image;
    1517  if (image == NULL) return;
     18  graph = section->graph;
    1619
    1720  graphic = GetGraphic ();
     
    2831  switch (image[0].location) {
    2932    case 0:
    30       image[0].picture.dx = dX - 2*PAD1;
    31       image[0].picture.dy = dY - 2*PAD1;
    32       image[0].picture.x = Xs + PAD1;
    33       image[0].picture.y = Ys + PAD1;
     33      if (section->graph) {
     34          image[0].picture.x = graph[0].axis[0].fx;
     35          image[0].picture.y = graph[0].axis[1].fy + graph[0].axis[1].dfy;
     36          image[0].picture.dx = graph[0].axis[0].dfx;
     37          image[0].picture.dy = -graph[0].axis[1].dfy;
     38      } else {
     39          image[0].picture.dx = dX - 2*PAD1;
     40          image[0].picture.dy = dY - 2*PAD1;
     41          image[0].picture.x = Xs + PAD1;
     42          image[0].picture.y = Ys + PAD1;
     43      }
    3444      if (USE_XWINDOW) CreatePicture (image, graphic);
    3545      Remap (graphic, image, &image[0].matrix);
    3646      return;
    3747
     48    case 1:
     49      textpad = graphic[0].font[0].ascent;
     50      textdY = 6*textpad + 7*PAD1;
     51      WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1);
     52
     53      image[0].picture.dx = dX - 2*PAD1;
     54      image[0].picture.dy = dY - 5*PAD1 - WdY - COLORPAD;
     55      image[0].picture.x = Xs + PAD1;
     56      image[0].picture.y = Ys + 2*PAD1 + COLORPAD;
     57
     58      image[0].cmapbar.dx = dX - 2*PAD1;
     59      image[0].cmapbar.dy = COLORPAD;
     60      image[0].cmapbar.x = Xs + PAD1;
     61      image[0].cmapbar.y = Ys + PAD1;
     62
     63      // XXX zoom should scale somewhat with the image? (with a min and a max)
     64      // XXX actually, it is limited by the buttons and status region
     65      image[0].zoom.dx = ZOOM_X;
     66      image[0].zoom.dy = ZOOM_Y;
     67      image[0].zoom.x = Xs + PAD1;
     68      image[0].zoom.y = image[0].picture.y + image[0].picture.dy + PAD1;
     69
     70      /** everything below is tied in x-dir to the zoom box **/
     71      image[0].text_x = image[0].zoom.x + image[0].zoom.dx + PAD1;
     72      image[0].text_y = image[0].zoom.y;
     73      image[0].text_dx = ZOOM_X;
     74      image[0].text_dy = 6*textpad + 7*PAD1;
     75
     76      image[0].overlay_button[0].x = image[0].text_x;
     77      image[0].overlay_button[0].y = image[0].text_y + image[0].text_dy + PAD1;
     78   
     79      image[0].overlay_button[1].x = image[0].overlay_button[0].x + image[0].overlay_button[0].dx + PAD1;
     80      image[0].overlay_button[1].y = image[0].overlay_button[0].y;
     81
     82      image[0].overlay_button[2].x = image[0].overlay_button[1].x + image[0].overlay_button[1].dx + PAD1;
     83      image[0].overlay_button[2].y = image[0].overlay_button[0].y;
     84
     85      image[0].overlay_button[3].x = image[0].overlay_button[2].x + image[0].overlay_button[2].dx + PAD1;
     86      image[0].overlay_button[3].y = image[0].overlay_button[0].y;
     87
     88      image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
     89      image[0].hms_button.y = image[0].overlay_button[0].y;
     90
     91      image[0].PS_button.x = image[0].text_x;
     92      image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
     93
     94      /** everything below is tied to the PS_button in y-dir + the neighbor in x-dir **/
     95      image[0].grey_button.x = image[0].PS_button.x + image[0].PS_button.dx + PAD1;
     96      image[0].grey_button.y = image[0].PS_button.y;
     97
     98      image[0].rainbow_button.x = image[0].grey_button.x + image[0].grey_button.dx + PAD1;
     99      image[0].rainbow_button.y = image[0].PS_button.y;
     100
     101      image[0].puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1;
     102      image[0].puns_button.y = image[0].PS_button.y;
     103
     104      image[0].recenter_button.x = image[0].puns_button.x + image[0].puns_button.dx + PAD1;
     105      image[0].recenter_button.y = image[0].PS_button.y;
     106      break;
     107
     108    case 3:
     109      textpad = graphic[0].font[0].ascent;
     110      textdY = 6*textpad + 7*PAD1;
     111      WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1);
     112
     113      image[0].picture.dx = dX - 2*PAD1;
     114      image[0].picture.dy = dY - 5*PAD1 - WdY - COLORPAD;
     115      image[0].picture.x = Xs + PAD1;
     116      image[0].picture.y = Ys + 4*PAD1 + COLORPAD + WdY;
     117
     118      image[0].cmapbar.dx = dX - 2*PAD1;
     119      image[0].cmapbar.dy = COLORPAD;
     120      image[0].cmapbar.x = Xs + PAD1;
     121      image[0].cmapbar.y = Ys + PAD1;
     122
     123      // XXX zoom should scale somewhat with the image? (with a min and a max)
     124      // XXX actually, it is limited by the buttons and status region
     125      image[0].zoom.dx = ZOOM_X;
     126      image[0].zoom.dy = ZOOM_Y;
     127      image[0].zoom.x = Xs + PAD1;
     128      image[0].zoom.y = Ys + 2*PAD1 + COLORPAD;
     129
     130      /** everything below is tied in x-dir to the zoom box **/
     131      image[0].text_x = image[0].zoom.x + image[0].zoom.dx + PAD1;
     132      image[0].text_y = image[0].zoom.y;
     133      image[0].text_dx = ZOOM_X;
     134      image[0].text_dy = 6*textpad + 7*PAD1;
     135
     136      image[0].overlay_button[0].x = image[0].text_x;
     137      image[0].overlay_button[0].y = image[0].text_y + image[0].text_dy + PAD1;
     138   
     139      image[0].overlay_button[1].x = image[0].overlay_button[0].x + image[0].overlay_button[0].dx + PAD1;
     140      image[0].overlay_button[1].y = image[0].overlay_button[0].y;
     141
     142      image[0].overlay_button[2].x = image[0].overlay_button[1].x + image[0].overlay_button[1].dx + PAD1;
     143      image[0].overlay_button[2].y = image[0].overlay_button[0].y;
     144
     145      image[0].overlay_button[3].x = image[0].overlay_button[2].x + image[0].overlay_button[2].dx + PAD1;
     146      image[0].overlay_button[3].y = image[0].overlay_button[0].y;
     147
     148      image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
     149      image[0].hms_button.y = image[0].overlay_button[0].y;
     150
     151      image[0].PS_button.x = image[0].text_x;
     152      image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
     153
     154      /** everything below is tied to the PS_button in y-dir + the neighbor in x-dir **/
     155      image[0].grey_button.x = image[0].PS_button.x + image[0].PS_button.dx + PAD1;
     156      image[0].grey_button.y = image[0].PS_button.y;
     157
     158      image[0].rainbow_button.x = image[0].grey_button.x + image[0].grey_button.dx + PAD1;
     159      image[0].rainbow_button.y = image[0].PS_button.y;
     160
     161      image[0].puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1;
     162      image[0].puns_button.y = image[0].PS_button.y;
     163
     164      image[0].recenter_button.x = image[0].puns_button.x + image[0].puns_button.dx + PAD1;
     165      image[0].recenter_button.y = image[0].PS_button.y;
     166      break;
     167
     168    case 2:
     169      image[0].picture.dx = dX - 3*PAD1 - ZOOM_X;
     170      image[0].picture.dy = dY - 3*PAD1 - COLORPAD;
     171      image[0].picture.x = Xs + 2*PAD1 + ZOOM_X;
     172      image[0].picture.y = Ys + 2*PAD1 + COLORPAD;
     173
     174      image[0].cmapbar.dx = dX - 2*PAD1;
     175      image[0].cmapbar.dy = COLORPAD;
     176      image[0].cmapbar.x = Xs + PAD1;
     177      image[0].cmapbar.y = Ys + PAD1;
     178
     179      // XXX zoom should scale somewhat with the image? (with a min and a max)
     180      // XXX actually, it is limited by the buttons and status region
     181      image[0].zoom.dx = ZOOM_X;
     182      image[0].zoom.dy = ZOOM_Y;
     183      image[0].zoom.x = Xs + PAD1;
     184      image[0].zoom.y = image[0].picture.y;
     185
     186      /** everything below is tied in x-dir to the zoom box **/
     187      textpad = graphic[0].font[0].ascent;
     188      image[0].text_x = image[0].zoom.x;
     189      image[0].text_y = image[0].zoom.y + image[0].zoom.dy + PAD1;
     190      image[0].text_dx = ZOOM_X;
     191      image[0].text_dy = 6*textpad + 7*PAD1;
     192
     193      image[0].overlay_button[0].x = image[0].text_x;
     194      image[0].overlay_button[0].y = image[0].text_y + image[0].text_dy + PAD1;
     195   
     196      image[0].overlay_button[1].x = image[0].overlay_button[0].x + image[0].overlay_button[0].dx + PAD1;
     197      image[0].overlay_button[1].y = image[0].overlay_button[0].y;
     198
     199      image[0].overlay_button[2].x = image[0].overlay_button[1].x + image[0].overlay_button[1].dx + PAD1;
     200      image[0].overlay_button[2].y = image[0].overlay_button[0].y;
     201
     202      image[0].overlay_button[3].x = image[0].overlay_button[2].x + image[0].overlay_button[2].dx + PAD1;
     203      image[0].overlay_button[3].y = image[0].overlay_button[0].y;
     204
     205      image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
     206      image[0].hms_button.y = image[0].overlay_button[0].y;
     207
     208      image[0].PS_button.x = image[0].zoom.x;
     209      image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
     210
     211      /** everything below is tied to the PS_button in y-dir + the neighbor in x-dir **/
     212      image[0].grey_button.x = image[0].PS_button.x + image[0].PS_button.dx + PAD1;
     213      image[0].grey_button.y = image[0].PS_button.y;
     214
     215      image[0].rainbow_button.x = image[0].grey_button.x + image[0].grey_button.dx + PAD1;
     216      image[0].rainbow_button.y = image[0].PS_button.y;
     217
     218      image[0].puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1;
     219      image[0].puns_button.y = image[0].PS_button.y;
     220
     221      image[0].recenter_button.x = image[0].puns_button.x + image[0].puns_button.dx + PAD1;
     222      image[0].recenter_button.y = image[0].PS_button.y;
     223      break;
     224
    38225    case 4:
    39       image[0].picture.dx = dX - 2*PAD1 - ZOOM_X;
    40       image[0].picture.dy = dY - 2*PAD1 - PAD2 - COLORPAD - 25;
     226      image[0].picture.dx = dX - 3*PAD1 - ZOOM_X;
     227      image[0].picture.dy = dY - 3*PAD1 - COLORPAD;
    41228      image[0].picture.x = Xs + PAD1;
    42       image[0].picture.y = Ys + PAD1 + PAD2 + COLORPAD;
    43 
    44       image[0].cmapbar.dx = dX - 2*PAD1;
    45       image[0].cmapbar.dy = COLORPAD;
    46       image[0].cmapbar.x = Xs + PAD1;
    47       image[0].cmapbar.y = Ys + PAD1;
    48 
    49       // XXX zoom should scale somewhat with the image (with a min and a max)
    50       image[0].zoom.dx = ZOOM_X;
    51       image[0].zoom.dy = ZOOM_Y;
    52       image[0].zoom.x = Xs + dX - PAD1 - ZOOM_X;
    53       image[0].zoom.y = Ys + PAD1 + PAD2 + COLORPAD;
    54 
    55       /** everything below is tied in x-dir to the zoom box **/
     229      image[0].picture.y = Ys + 2*PAD1 + COLORPAD;
     230
     231      image[0].cmapbar.dx = dX - 2*PAD1;
     232      image[0].cmapbar.dy = COLORPAD;
     233      image[0].cmapbar.x = Xs + PAD1;
     234      image[0].cmapbar.y = Ys + PAD1;
     235
     236      // XXX zoom should scale somewhat with the image? (with a min and a max)
     237      // XXX actually, it is limited by the buttons and status region
     238      image[0].zoom.dx = ZOOM_X;
     239      image[0].zoom.dy = ZOOM_Y;
     240      image[0].zoom.x = image[0].picture.x + image[0].picture.dx + PAD1;
     241      image[0].zoom.y = image[0].picture.y;
     242
     243      /** everything below is tied in x-dir to the zoom box **/
     244      textpad = graphic[0].font[0].ascent;
    56245      image[0].text_x = image[0].zoom.x;
    57       image[0].text_y = image[0].zoom.y + image[0].zoom.dy + PAD2;
    58 
    59       /*  image[0].PS_button.y = graphic[0].dy - BUTTON_HEIGHT - PAD1; */
    60       image[0].PS_button.x = image[0].zoom.x + 5;
    61       image[0].PS_button.y = Ys + 2*ZOOM_Y;
    62 
    63       /** everything below is tied to the PS_button in y-dir **/
    64       image[0].grey_button.x = image[0].PS_button.x + image[0].PS_button.dx + PAD1;
    65       image[0].grey_button.y = image[0].PS_button.y;
    66 
    67       image[0].rainbow_button.x = image[0].grey_button.x + image[0].grey_button.dx + PAD1;
    68       image[0].rainbow_button.y = image[0].PS_button.y;
    69 
    70       image[0].puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1;
    71       image[0].puns_button.y = image[0].PS_button.y;
    72 
    73       image[0].recenter_button.x = image[0].puns_button.x + image[0].puns_button.dx + PAD1;
    74       image[0].recenter_button.y = image[0].PS_button.y;
    75 
    76       image[0].overlay_button[0].x = image[0].zoom.x + 5;
    77       image[0].overlay_button[0].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1;
    78    
    79       image[0].overlay_button[1].x = image[0].overlay_button[0].x + image[0].overlay_button[0].dx + PAD1;
    80       image[0].overlay_button[1].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1;
    81 
    82       image[0].overlay_button[2].x = image[0].overlay_button[1].x + image[0].overlay_button[1].dx + PAD1;
    83       image[0].overlay_button[2].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1;
    84 
    85       image[0].overlay_button[3].x = image[0].overlay_button[2].x + image[0].overlay_button[2].dx + PAD1;
    86       image[0].overlay_button[3].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1;
    87 
    88       image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
    89       image[0].hms_button.y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1;
     246      image[0].text_y = image[0].zoom.y + image[0].zoom.dy + PAD1;
     247      image[0].text_dx = ZOOM_X;
     248      image[0].text_dy = 6*textpad + 7*PAD1;
     249
     250      image[0].overlay_button[0].x = image[0].text_x;
     251      image[0].overlay_button[0].y = image[0].text_y + image[0].text_dy + PAD1;
     252   
     253      image[0].overlay_button[1].x = image[0].overlay_button[0].x + image[0].overlay_button[0].dx + PAD1;
     254      image[0].overlay_button[1].y = image[0].overlay_button[0].y;
     255
     256      image[0].overlay_button[2].x = image[0].overlay_button[1].x + image[0].overlay_button[1].dx + PAD1;
     257      image[0].overlay_button[2].y = image[0].overlay_button[0].y;
     258
     259      image[0].overlay_button[3].x = image[0].overlay_button[2].x + image[0].overlay_button[2].dx + PAD1;
     260      image[0].overlay_button[3].y = image[0].overlay_button[0].y;
     261
     262      image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
     263      image[0].hms_button.y = image[0].overlay_button[0].y;
     264
     265      image[0].PS_button.x = image[0].zoom.x;
     266      image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
     267
     268      /** everything below is tied to the PS_button in y-dir + the neighbor in x-dir **/
     269      image[0].grey_button.x = image[0].PS_button.x + image[0].PS_button.dx + PAD1;
     270      image[0].grey_button.y = image[0].PS_button.y;
     271
     272      image[0].rainbow_button.x = image[0].grey_button.x + image[0].grey_button.dx + PAD1;
     273      image[0].rainbow_button.y = image[0].PS_button.y;
     274
     275      image[0].puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1;
     276      image[0].puns_button.y = image[0].PS_button.y;
     277
     278      image[0].recenter_button.x = image[0].puns_button.x + image[0].puns_button.dx + PAD1;
     279      image[0].recenter_button.y = image[0].PS_button.y;
    90280      break;
    91281
    92282    default:
    93       image[0].picture.dx = dX - 2*PAD1 - ZOOM_X;
    94       image[0].picture.dy = dY - 2*PAD1 - PAD2 - COLORPAD - 25;
    95       image[0].picture.x = Xs + PAD1;
    96       image[0].picture.y = Ys + PAD1 + PAD2 + COLORPAD;
    97 
    98       image[0].cmapbar.dx = dX - 2*PAD1;
    99       image[0].cmapbar.dy = COLORPAD;
    100       image[0].cmapbar.x = Xs + PAD1;
    101       image[0].cmapbar.y = Ys + PAD1;
    102 
    103       // XXX zoom should scale somewhat with the image (with a min and a max)
    104       image[0].zoom.dx = ZOOM_X;
    105       image[0].zoom.dy = ZOOM_Y;
    106       image[0].zoom.x = Xs + dX - PAD1 - ZOOM_X;
    107       image[0].zoom.y = Ys + PAD1 + PAD2 + COLORPAD;
    108 
    109       /** everything below is tied in x-dir to the zoom box **/
    110       image[0].text_x = image[0].zoom.x;
    111       image[0].text_y = image[0].zoom.y + image[0].zoom.dy + PAD2;
    112 
    113       /*  image[0].PS_button.y = graphic[0].dy - BUTTON_HEIGHT - PAD1; */
    114       image[0].PS_button.x = image[0].zoom.x + 5;
    115       image[0].PS_button.y = Ys + 2*ZOOM_Y;
    116 
    117       /** everything below is tied to the PS_button in y-dir **/
    118       image[0].grey_button.x = image[0].PS_button.x + image[0].PS_button.dx + PAD1;
    119       image[0].grey_button.y = image[0].PS_button.y;
    120 
    121       image[0].rainbow_button.x = image[0].grey_button.x + image[0].grey_button.dx + PAD1;
    122       image[0].rainbow_button.y = image[0].PS_button.y;
    123 
    124       image[0].puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1;
    125       image[0].puns_button.y = image[0].PS_button.y;
    126 
    127       image[0].recenter_button.x = image[0].puns_button.x + image[0].puns_button.dx + PAD1;
    128       image[0].recenter_button.y = image[0].PS_button.y;
    129 
    130       image[0].overlay_button[0].x = image[0].zoom.x + 5;
    131       image[0].overlay_button[0].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1;
    132    
    133       image[0].overlay_button[1].x = image[0].overlay_button[0].x + image[0].overlay_button[0].dx + PAD1;
    134       image[0].overlay_button[1].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1;
    135 
    136       image[0].overlay_button[2].x = image[0].overlay_button[1].x + image[0].overlay_button[1].dx + PAD1;
    137       image[0].overlay_button[2].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1;
    138 
    139       image[0].overlay_button[3].x = image[0].overlay_button[2].x + image[0].overlay_button[2].dx + PAD1;
    140       image[0].overlay_button[3].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1;
    141 
    142       image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
    143       image[0].hms_button.y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1;
     283      abort ();
    144284      break;
    145285  }
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/SetLimits.c

    r13344 r13401  
    1616  if (section->graph == NULL) {
    1717    section->graph = InitGraph ();
    18     SetGraphSize (section);
     18    SetSectionSizes (section);
    1919  }
    2020  graph = section->graph;
     
    5959  return (TRUE);
    6060}
    61 
    62 /* example for image:
    63    
    64     section->image = InitImage ();
    65     SetImageSize (section);
    66 */
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/SetNormalHints.c

    r13320 r13401  
    1717
    1818  // XXX : can we drop the position flag
    19   sizehints[0].flags = USPosition | USSize | PMinSize;
     19  // sizehints[0].flags = USPosition | USSize | PMinSize;
     20  sizehints[0].flags = USSize | PMinSize;
    2021
    2122  sizehints[0].base_width = graphic->dx;
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/UpdatePointer.c

    r13344 r13401  
    1414  image   = section->image;
    1515  if (image == NULL) return (TRUE);
     16  if (!image[0].location) return (TRUE);
    1617
    1718  if (image[0].MovePointer && InPicture ((XButtonEvent *)event, &image[0].picture)) {
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/UpdateStatusBox.c

    r13320 r13401  
    1414    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back);
    1515    XFillRectangle (graphic[0].display, graphic[0].window, graphic[0].gc,
    16                     image[0].text_x, image[0].text_y, ZOOM_X, 6*textpad+7*PAD1); 
     16                    image[0].text_x, image[0].text_y, image[0].text_dx, image[0].text_dy); 
    1717    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
    1818    XDrawRectangle (graphic[0].display, graphic[0].window, graphic[0].gc,
    19                     image[0].text_x, image[0].text_y, ZOOM_X, 6*textpad+7*PAD1);
     19                    image[0].text_x, image[0].text_y, image[0].text_dx, image[0].text_dy);
    2020 
    2121    bzero (line, 100);
     
    3838    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back);
    3939    XFillRectangle (graphic[0].display, graphic[0].window, graphic[0].gc,
    40                     image[0].text_x + 1, image[0].text_y + 1, ZOOM_X - 2, 3*textpad+3*PAD1 +1); 
     40                    image[0].text_x+1, image[0].text_y+1, image[0].text_dx-2, image[0].text_dy-2); 
    4141    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
    4242  }
    4343  bzero (line, 100);
    44   sprintf (line, "%25.3f", z);
     44  sprintf (line, "%22.3f", z);
    4545  XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc,
    4646               image[0].text_x + PAD1, image[0].text_y + textpad + PAD1, line, strlen(line));
    4747 
    4848  bzero (line, 100);
    49   sprintf (line, "%12.1f %12.1f", x, y);
     49  sprintf (line, "%10.1f %10.1f", x, y);
    5050  XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc,
    5151               image[0].text_x + PAD1, image[0].text_y + 2*textpad + 2*PAD1, line, strlen(line));
     
    5353  bzero (line, 100);
    5454  if (image[0].DecimalDegrees) {
    55     sprintf (line, "%12.6f %12.6f", ra, dec);
     55    sprintf (line, "%10.6f %10.6f", ra, dec);
    5656  } else {
    5757    hh_hms (line, ra, dec, ':');
Note: See TracChangeset for help on using the changeset viewer.