# include "Ximage.h"

int LoadBox () {
  
  int i, status;
  char Axis[16], Labels[16], Ticks[16];
  Layout *layout;
  
  layout = &section[TheSection];

  KiiScanMessage (sock, "%lf %lf %lf %lf", 
		  &layout[0].axis[0].min, &layout[0].axis[0].max, 
		  &layout[0].axis[1].min, &layout[0].axis[1].max);

  layout[0].axis[3].min = layout[0].axis[1].min;
  layout[0].axis[3].max = layout[0].axis[1].max;
  layout[0].axis[2].min = layout[0].axis[0].min;
  layout[0].axis[2].max = layout[0].axis[0].max;
  
  KiiScanMessage (sock, "%s %s %s", Axis, Labels, Ticks);

  for (i = 0; i < 4; i++) {
    switch (Axis[i]) {
    case '0':
      layout[0].axis[i].isaxis = FALSE;
      break;
    case '1':
      layout[0].axis[i].isaxis = TRUE;
      break;
    case '2':
      layout[0].axis[i].isaxis = TRUE;
      break;
    }
    switch (Ticks[i]) {
    case '0':
      layout[0].axis[i].areticks = FALSE;
      break;
    case '1':
      layout[0].axis[i].areticks = TRUE;
      break;
    case '2':
      layout[0].axis[i].areticks = 2;
      break;
    }
    switch (Labels[i]) {
    case '0':
      layout[0].axis[i].islabel = FALSE;
      break;
    case '1':
      layout[0].axis[i].islabel = TRUE;
      break;
    case '2':
      layout[0].axis[i].islabel = (i < 2);
      break;
    }
  }

  if (USE_XWINDOW) DrawFrame (layout);
  status = TRUE;
  if (status) {
    for (i = 0; i < Nsection; i++) {
      PositionPicture (&section[i]);
    }
    if (USE_XWINDOW) XClearWindow (graphic.display, graphic.window);
    Refresh (1);
  } else {
    FlushDisplay ();
  } 

  return (TRUE);
  
}

/*
  layout[0].X = 0;
  layout[0].Y = 0;
  layout[0].expand = 1;
*/
  
