Index: /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/buttons.h
===================================================================
--- /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/buttons.h	(revision 29213)
+++ /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/buttons.h	(revision 29214)
@@ -1,5 +1,5 @@
 #define PS_width 25
 #define PS_height 25
-static char PS_bits[] = {
+char PS_bits[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x81, 0x3f, 0x00,
    0x82, 0x67, 0x60, 0x00, 0x02, 0x26, 0x40, 0x00, 0x02, 0x24, 0x40, 0x00,
@@ -13,5 +13,5 @@
 #define grey_width 25
 #define grey_height 25
-static char grey_bits[] = {
+char grey_bits[] = {
    0x90, 0x40, 0xf7, 0x01, 0x04, 0xaa, 0xad, 0x01, 0x68, 0xd5, 0xfe, 0x01,
    0x82, 0x28, 0xdb, 0x01, 0x10, 0xd2, 0x75, 0x01, 0x40, 0xad, 0xee, 0x01,
@@ -25,5 +25,5 @@
 #define rainbow_width 25
 #define rainbow_height 25
-static char rainbow_bits[] = {
+char rainbow_bits[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x80, 0xff, 0x00, 0x00, 0x70, 0x00, 0x01, 0x00, 0x0c, 0x7f, 0x00,
@@ -37,5 +37,5 @@
 #define recenter_width 25
 #define recenter_height 25
-static char recenter_bits[] = {
+char recenter_bits[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00,
    0x80, 0xef, 0x03, 0x00, 0xe0, 0x00, 0x0e, 0x00, 0x30, 0x00, 0x18, 0x00,
@@ -49,5 +49,5 @@
 #define heat_width 25
 #define heat_height 25
-static char heat_bits[] = {
+char heat_bits[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0xd8, 0x01,
    0x00, 0x0c, 0x37, 0x00, 0xf8, 0xc9, 0x6f, 0x00, 0x0c, 0xde, 0xf0, 0x00,
@@ -61,5 +61,5 @@
 #define red_width 25
 #define red_height 25
-static char red_bits[] = {
+char red_bits[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xfc, 0x03, 0x00,
    0x20, 0x07, 0x06, 0x00, 0xe0, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x08, 0x00,
@@ -73,5 +73,5 @@
 #define green_width 25
 #define green_height 25
-static char green_bits[] = {
+char green_bits[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00,
    0x00, 0x06, 0x04, 0x00, 0x80, 0x03, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00,
@@ -85,5 +85,5 @@
 #define blue_width 25
 #define blue_height 25
-static char blue_bits[] = {
+char blue_bits[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xfe, 0x00, 0x00,
    0xc0, 0x83, 0x07, 0x00, 0xc0, 0x00, 0x0c, 0x00, 0x40, 0x00, 0x08, 0x00,
@@ -97,5 +97,5 @@
 #define yellow_width 25
 #define yellow_height 25
-static char yellow_bits[] = {
+char yellow_bits[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x18, 0x00,
    0x80, 0x01, 0x0c, 0x00, 0x00, 0x03, 0x06, 0x00, 0x00, 0x02, 0x02, 0x00,
@@ -107,19 +107,7 @@
    0x00, 0x30, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00};
-#define hms_width 25
-#define hms_height 25
-static char hms_bits[] = {
-   0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
-   0x02, 0x00, 0x00, 0x00, 0x02, 0x01, 0xf0, 0x00, 0x1e, 0xef, 0x89, 0x00,
-   0x22, 0x11, 0x09, 0x00, 0x22, 0x11, 0x71, 0x00, 0x22, 0x11, 0x81, 0x00,
-   0x22, 0x11, 0x89, 0x00, 0x22, 0x01, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00,
-   0x1e, 0xc7, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x80, 0x00,
-   0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00,
-   0x40, 0x80, 0x80, 0x00, 0x5c, 0xb8, 0xb8, 0x00, 0x62, 0xc4, 0xc4, 0x00,
-   0x42, 0x84, 0x84, 0x00, 0x42, 0x84, 0x84, 0x00, 0x62, 0xc4, 0xc4, 0x00,
-   0x5c, 0xb9, 0xb8, 0x00};
 #define flipx_width 25
 #define flipx_height 25
-static char flipx_bits[] = {
+char flipx_bits[] = {
    0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x80, 0x10, 0x02, 0x00,
@@ -133,5 +121,5 @@
 #define flipy_width 25
 #define flipy_height 25
-static char flipy_bits[] = {
+char flipy_bits[] = {
    0x00, 0x10, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00,
    0x00, 0x82, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x80, 0x00, 0x02, 0x00,
@@ -143,2 +131,23 @@
    0x00, 0x82, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00,
    0x00, 0x10, 0x00, 0x00 };
+#define hms_width 25
+#define hms_height 12
+char hms_bits[] = {
+   0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+   0x02, 0x00, 0x00, 0x00, 0x02, 0x01, 0xf0, 0x00, 0x1e, 0xef, 0x89, 0x00,
+   0x22, 0x11, 0x09, 0x00, 0x22, 0x11, 0x71, 0x00, 0x22, 0x11, 0x81, 0x00,
+   0x22, 0x11, 0x89, 0x00, 0x22, 0x01, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00};
+#define ddd_width 25
+#define ddd_height 12
+char ddd_bits[] = {
+   0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00,
+   0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00, 0x5c, 0xb8, 0xb8, 0x00,
+   0x62, 0xc4, 0xc4, 0x00, 0x42, 0x84, 0x84, 0x00, 0x42, 0x84, 0x84, 0x00,
+   0x62, 0xc4, 0xc4, 0x00, 0x5c, 0xb9, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00};
+#define hex_width 25
+#define hex_height 12
+char hex_bits[] = {
+   0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+   0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0x00, 0x1e, 0x00, 0x88, 0x00,
+   0x22, 0x00, 0x08, 0x00, 0x22, 0x00, 0x70, 0x00, 0x22, 0x00, 0x80, 0x00,
+   0x22, 0x00, 0x88, 0x00, 0x22, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00};
Index: /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/prototypes.h
===================================================================
--- /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/prototypes.h	(revision 29213)
+++ /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/prototypes.h	(revision 29214)
@@ -203,4 +203,5 @@
 int	      RecenterRescale	  PROTO((Graphic *graphic, KapaImageWidget *image));
 int	      ToggleDEG		  PROTO((Graphic *graphic, KapaImageWidget *image));
+int	      ToggleHEX		  PROTO((Graphic *graphic, KapaImageWidget *image));
 int	      FlipImageX	  PROTO((Graphic *graphic, KapaImageWidget *image));
 int	      FlipImageY	  PROTO((Graphic *graphic, KapaImageWidget *image));
Index: /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/structures.h
===================================================================
--- /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/structures.h	(revision 29213)
+++ /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/structures.h	(revision 29214)
@@ -186,4 +186,5 @@
   Button   recenter_button;
   Button   hms_button; /* toggle HMS/DECIMAL mode (DECIMAL_DEG macro) */
+  Button   hex_button; /* toggle HEX / FLOAT mode */
   Button   grey_button;
   Button   rainbow_button;
@@ -199,4 +200,5 @@
   int      MovePointer;
   int      DecimalDegrees;
+  int      HexValue;
 
   // double   X, Y;           /* image pixel at screen center */
Index: /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/ButtonFunctions.c
===================================================================
--- /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/ButtonFunctions.c	(revision 29213)
+++ /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/ButtonFunctions.c	(revision 29214)
@@ -1,3 +1,4 @@
 # include "Ximage.h"
+# include "buttons.h"
 
 int PSfunction (Graphic *graphic, KapaImageWidget *image) {
@@ -103,8 +104,17 @@
 
   image[0].DecimalDegrees = image[0].DecimalDegrees ^ TRUE;
+  image[0].hms_button.bitmap = (image[0].DecimalDegrees) ? hms_bits : ddd_bits;
+  StatusBox (graphic, image);
+  DrawButton (graphic, &image[0].hms_button);
+  FlushDisplay ();
+  return (TRUE);
+}
+
+int ToggleHEX (Graphic *graphic, KapaImageWidget *image) {
+
+  image[0].HexValue = image[0].HexValue ^ TRUE;
   StatusBox (graphic, image);
   FlushDisplay ();
   return (TRUE);
-
 }
 
Index: /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/CheckButtons.c
===================================================================
--- /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/CheckButtons.c	(revision 29213)
+++ /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/CheckButtons.c	(revision 29214)
@@ -25,4 +25,7 @@
   if (InButton (event, &image[0].hms_button)) 
     button = &image[0].hms_button;
+
+  if (InButton (event, &image[0].hex_button)) 
+    button = &image[0].hex_button;
 
   if (InButton (event, &image[0].flipx_button)) 
Index: /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/Image.c
===================================================================
--- /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/Image.c	(revision 29213)
+++ /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/Image.c	(revision 29214)
@@ -70,4 +70,6 @@
   image[0].MovePointer = TRUE;
   image[0].DecimalDegrees  = TRUE;
+  image[0].HexValue  = FALSE;
+
   ALLOCATE (image[0].picture.data, char, 1);   /* allocate so later free will not crash! */
   ALLOCATE (image[0].cmapbar.data, char, 1);   /* allocate so later free will not crash! */
@@ -104,6 +106,13 @@
   InitButtonFunc (&image[0].overlay_button[3], Overlay3);
 
-  InitButtonSize (&image[0].hms_button, hms_width, hms_height, hms_bits);
+  if (image[0].DecimalDegrees) {
+    InitButtonSize (&image[0].hms_button, hms_width, hms_height, hms_bits);
+  } else {
+    InitButtonSize (&image[0].hms_button, ddd_width, ddd_height, ddd_bits);
+  }
   InitButtonFunc (&image[0].hms_button, ToggleDEG);
+
+  InitButtonSize (&image[0].hex_button, hex_width, hex_height, hex_bits);
+  InitButtonFunc (&image[0].hex_button, ToggleHEX);
 
   InitButtonSize (&image[0].flipx_button, flipx_width, flipx_height, flipx_bits);
@@ -117,6 +126,6 @@
 
 void InitButtonSize (Button *button, int width, int height, char *bitmap) {
-  button->dx = BUTTON_WIDTH;
-  button->dy = BUTTON_HEIGHT;
+  button->dx = width + 2;
+  button->dy = height + 2;
   button->width = width;
   button->height = height;
@@ -185,4 +194,5 @@
     DrawButton (graphic, &image[0].heat_button);
     DrawButton (graphic, &image[0].hms_button);
+    DrawButton (graphic, &image[0].hex_button);
 
     DrawButton (graphic, &image[0].flipx_button);
Index: /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/SetImageSize.c
===================================================================
--- /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/SetImageSize.c	(revision 29213)
+++ /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/SetImageSize.c	(revision 29214)
@@ -96,4 +96,7 @@
       image[0].hms_button.y = image[0].overlay_button[0].y;
 
+      image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
+      image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1;
+
       image[0].PS_button.x = image[0].text_x;
       image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
@@ -175,4 +178,7 @@
       image[0].hms_button.y = image[0].overlay_button[0].y;
 
+      image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
+      image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1;
+
       image[0].PS_button.x = image[0].text_x;
       image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
@@ -254,4 +260,7 @@
       image[0].hms_button.y = image[0].overlay_button[0].y;
 
+      image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
+      image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1;
+
       image[0].PS_button.x = image[0].zoom.x;
       image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
@@ -332,4 +341,7 @@
       image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
       image[0].hms_button.y = image[0].overlay_button[0].y;
+
+      image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
+      image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1;
 
       image[0].PS_button.x = image[0].zoom.x;
Index: /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/UpdateStatusBox.c
===================================================================
--- /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/UpdateStatusBox.c	(revision 29213)
+++ /branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/UpdateStatusBox.c	(revision 29214)
@@ -43,5 +43,10 @@
   }
   bzero (line, 100);
-  sprintf (line, "%22.3f", z);
+
+  if (image[0].HexValue) {
+    sprintf (line, "%04x", (int) z);
+  } else {
+    sprintf (line, "%22.3f", z);
+  }
   XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 
 	       image[0].text_x + PAD1, image[0].text_y + textpad + PAD1, line, strlen(line));
