Changeset 13401
- Timestamp:
- May 16, 2007, 1:16:49 PM (19 years ago)
- Location:
- branches/kapa-mods-2007-05/Ohana/src
- Files:
-
- 1 added
- 19 edited
-
kapa2/include/constants.h (modified) (1 diff)
-
kapa2/include/structures.h (modified) (1 diff)
-
kapa2/src/DefineSection.c (modified) (1 diff)
-
kapa2/src/Image.c (modified) (2 diffs)
-
kapa2/src/LoadFrame.c (modified) (2 diffs)
-
kapa2/src/LoadLabels.c (modified) (1 diff)
-
kapa2/src/LoadObject.c (modified) (1 diff)
-
kapa2/src/LoadOverlay.c (modified) (1 diff)
-
kapa2/src/LoadPicture.c (modified) (1 diff)
-
kapa2/src/LoadTextlines.c (modified) (1 diff)
-
kapa2/src/LoadTickmarks.c (modified) (1 diff)
-
kapa2/src/Reconfig.c (modified) (1 diff)
-
kapa2/src/Resize.c (modified) (1 diff)
-
kapa2/src/Sections.c (modified) (1 diff)
-
kapa2/src/SetImageSize.c (modified) (3 diffs)
-
kapa2/src/SetLimits.c (modified) (2 diffs)
-
kapa2/src/SetNormalHints.c (modified) (1 diff)
-
kapa2/src/UpdatePointer.c (modified) (1 diff)
-
kapa2/src/UpdateStatusBox.c (modified) (3 diffs)
-
libkapa/doc/api.txt (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/kapa-mods-2007-05/Ohana/src/kapa2/include/constants.h
r13320 r13401 10 10 | PointerMotionMask) 11 11 12 # define PAD1 513 # define PAD2 312 # define PAD1 3 13 # define PAD2 5 14 14 # define TEXTPAD 25 15 15 # define COLORPAD 10 16 16 # define TEXT_Y 15 17 # define ZOOM_X 1 7018 # define ZOOM_Y 1 7017 # define ZOOM_X 152 18 # define ZOOM_Y 152 19 19 # define NOVERLAYS 4 20 20 # define BUTTON_WIDTH 28 -
branches/kapa-mods-2007-05/Ohana/src/kapa2/include/structures.h
r13320 r13401 138 138 Button grey_button; 139 139 Button rainbow_button; 140 Button puns_button;140 Button puns_button; 141 141 Button overlay_button[NOVERLAYS]; 142 142 143 143 // location of the status box 144 144 int text_x, text_y; 145 int text_dx, text_dy; 145 146 int location; // position of the zoom/status widgets (0 = none, 1-4 = bottom,left,top,right) 146 147 int MovePointer; -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/DefineSection.c
r13344 r13401 33 33 34 34 if (MoveSection) { 35 SetGraphSize (section); 36 SetImageSize (section); 35 SetSectionSizes (section); 37 36 Refresh (1); 38 37 } -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/Image.c
r13394 r13401 96 96 graphic = GetGraphic (); 97 97 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); 102 102 103 103 XPutImage (graphic[0].display, graphic[0].window, graphic[0].gc, … … 124 124 125 125 /* erase everything below zoom box, then draw */ 126 /* 126 127 XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back); 127 128 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 */ 130 131 DrawButton (graphic, &image[0].PS_button); 131 132 DrawButton (graphic, &image[0].recenter_button); -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadFrame.c
r13394 r13401 11 11 if (section->graph == NULL) { 12 12 section->graph = InitGraph (); 13 Set GraphSize(section);13 SetSectionSizes (section); 14 14 } 15 15 graph = section->graph; … … 62 62 } 63 63 64 Set GraphSize(section);64 SetSectionSizes (section); 65 65 if (USE_XWINDOW) DrawFrame (graph); 66 66 FlushDisplay (); -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadLabels.c
r13344 r13401 11 11 if (section->graph == NULL) { 12 12 section->graph = InitGraph (); 13 Set GraphSize(section);13 SetSectionSizes (section); 14 14 } 15 15 graph = section->graph; -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadObject.c
r13344 r13401 11 11 if (section->graph == NULL) { 12 12 section->graph = InitGraph (); 13 Set GraphSize(section);13 SetSectionSizes (section); 14 14 } 15 15 graph = section->graph; -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadOverlay.c
r13344 r13401 17 17 if (section->image == NULL) { 18 18 section->image = InitImage (); 19 Set ImageSize(section);19 SetSectionSizes (section); 20 20 } 21 21 image = section->image; -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadPicture.c
r13344 r13401 14 14 if (section->image == NULL) { 15 15 section->image = InitImage (); 16 Set ImageSize(section);16 SetSectionSizes (section); 17 17 } 18 18 image = section->image; -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadTextlines.c
r13344 r13401 13 13 if (section->graph == NULL) { 14 14 section->graph = InitGraph (); 15 Set GraphSize(section);15 SetSectionSizes (section); 16 16 } 17 17 -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadTickmarks.c
r13344 r13401 12 12 if (section->image == NULL) { 13 13 section->image = InitImage (); 14 Set ImageSize(section);14 SetSectionSizes (section); 15 15 } 16 16 image = section->image; -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/Reconfig.c
r13320 r13401 25 25 for (i = 0; i < Nsection; i++) { 26 26 section = GetSectionByNumber (i); 27 SetGraphSize (section); 28 SetImageSize (section); 27 SetSectionSizes (section); 29 28 } 30 29 -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/Resize.c
r13344 r13401 30 30 for (i = 0; i < Nsection; i++) { 31 31 section = GetSectionByNumber (i); 32 SetGraphSize (section); 33 SetImageSize (section); 32 SetSectionSizes (section); 34 33 } 35 34 -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/Sections.c
r13344 r13401 147 147 return (TRUE); 148 148 } 149 150 void 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 8 8 9 9 int Xs, Ys, Xe, Ye, dX, dY; 10 int textpad, textdY, WdY; 10 11 KapaImageWidget *image; 12 KapaGraphWidget *graph; 11 13 Graphic *graphic; 12 14 … … 14 16 image = section->image; 15 17 if (image == NULL) return; 18 graph = section->graph; 16 19 17 20 graphic = GetGraphic (); … … 28 31 switch (image[0].location) { 29 32 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 } 34 44 if (USE_XWINDOW) CreatePicture (image, graphic); 35 45 Remap (graphic, image, &image[0].matrix); 36 46 return; 37 47 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 38 225 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; 41 228 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; 56 245 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; 90 280 break; 91 281 92 282 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 (); 144 284 break; 145 285 } -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/SetLimits.c
r13344 r13401 16 16 if (section->graph == NULL) { 17 17 section->graph = InitGraph (); 18 Set GraphSize(section);18 SetSectionSizes (section); 19 19 } 20 20 graph = section->graph; … … 59 59 return (TRUE); 60 60 } 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 17 17 18 18 // 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; 20 21 21 22 sizehints[0].base_width = graphic->dx; -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/UpdatePointer.c
r13344 r13401 14 14 image = section->image; 15 15 if (image == NULL) return (TRUE); 16 if (!image[0].location) return (TRUE); 16 17 17 18 if (image[0].MovePointer && InPicture ((XButtonEvent *)event, &image[0].picture)) { -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/UpdateStatusBox.c
r13320 r13401 14 14 XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back); 15 15 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); 17 17 XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore); 18 18 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); 20 20 21 21 bzero (line, 100); … … 38 38 XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back); 39 39 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); 41 41 XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore); 42 42 } 43 43 bzero (line, 100); 44 sprintf (line, "%2 5.3f", z);44 sprintf (line, "%22.3f", z); 45 45 XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 46 46 image[0].text_x + PAD1, image[0].text_y + textpad + PAD1, line, strlen(line)); 47 47 48 48 bzero (line, 100); 49 sprintf (line, "%1 2.1f %12.1f", x, y);49 sprintf (line, "%10.1f %10.1f", x, y); 50 50 XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 51 51 image[0].text_x + PAD1, image[0].text_y + 2*textpad + 2*PAD1, line, strlen(line)); … … 53 53 bzero (line, 100); 54 54 if (image[0].DecimalDegrees) { 55 sprintf (line, "%1 2.6f %12.6f", ra, dec);55 sprintf (line, "%10.6f %10.6f", ra, dec); 56 56 } else { 57 57 hh_hms (line, ra, dec, ':');
Note:
See TracChangeset
for help on using the changeset viewer.
