예제 #1
0
void Graph::configureAxes()
{
  Tcl_HashSearch cursor;
  for (Tcl_HashEntry *hPtr=Tcl_FirstHashEntry(&axes_.table, &cursor);
       hPtr; hPtr = Tcl_NextHashEntry(&cursor)) {
    Axis *axisPtr = (Axis*)Tcl_GetHashValue(hPtr);
    axisPtr->configure();
  }
}
예제 #2
0
int Graph::createAxes()
{
  for (int ii=0; ii<4; ii++) {
    int isNew;
    Tcl_HashEntry* hPtr = 
      Tcl_CreateHashEntry(&axes_.table, axisNames[ii].name, &isNew);
    Chain* chain = new Chain();

    Axis* axisPtr = new Axis(this, axisNames[ii].name, ii, hPtr);
    if (!axisPtr)
      return TCL_ERROR;
    AxisOptions* ops = (AxisOptions*)axisPtr->ops();

    Tcl_SetHashValue(hPtr, axisPtr);

    axisPtr->refCount_ = 1;
    axisPtr->use_ =1;
    
    axisPtr->setClass(!(ii&1) ? CID_AXIS_X : CID_AXIS_Y);

    if (Tk_InitOptions(interp_, (char*)axisPtr->ops(), 
		       axisPtr->optionTable(), tkwin_) != TCL_OK)
      return TCL_ERROR;

    if (axisPtr->configure() != TCL_OK)
      return TCL_ERROR;

    if ((axisPtr->margin_ == MARGIN_RIGHT) || (axisPtr->margin_ == MARGIN_TOP))
      ops->hide = 1;

    axisChain_[ii] = chain;
    axisPtr->link = chain->append(axisPtr);
    axisPtr->chain = chain;
  }
  return TCL_OK;
}