Exemplo n.º 1
0
  //
  // TerrainCursorPos::TerrainCursorPos
  //
  TerrainCursorPos::TerrainCursorPos(IControl *parent) : ICStatic(parent)
  {
    // Create a buffer for the display
    SetTextString(buf, FALSE);

    // Setup justification
    SetTextJustify(JUSTIFY_RIGHT);
  }
Exemplo n.º 2
0
static void col_cb(ListStructure *sel, int n, int *values, void *data)
{
    SSDataUI *ui = (SSDataUI *) data;
    Quark *ssd = (Quark *) sel->anydata;
    
    if (ssd && n == 1) {
        int col = values[0];
        SetSensitive(ui->col_label->text, TRUE);
        SetTextString(ui->col_label, ssd_get_col_label(ssd, col));
    } else {
        SetSensitive(ui->col_label->text, FALSE);
    }
}
Exemplo n.º 3
0
void update_point_locator(int gno, int setno, int loc)
{
    int col, ncols;
    Datapoint dpoint;
    char *s, buf[64];
    
    if (points_frame == NULL) {
        return;
    }
    
    if (get_datapoint(gno, setno, loc, &ncols, &dpoint) == RETURN_SUCCESS) {
        SelectListChoice(track_set_sel, setno);

        s = copy_string(NULL, "(");
        for (col = 0; col < ncols; col++) {
            sprintf(buf, "%g", dpoint.ex[col]);
            s = concat_strings(s, buf);
            if (col != ncols - 1) {
                s = concat_strings(s, ", ");
            }
        }
        if (dpoint.s != NULL) {
            s = concat_strings(s, ", \"");
            s = concat_strings(s, dpoint.s);
            s = concat_strings(s, "\"");
        }
        s = concat_strings(s, ")");
        SetTextString(locate_point_item, s);
        xfree(s);

        sprintf(buf, "%d", loc);
        xv_setstr(goto_index_item, buf);
    } else {
        track_setno = -1;
        SelectListChoices(track_set_sel, 0, NULL);
        SetTextString(locate_point_item, "");
        xv_setstr(goto_index_item, "");
    }
}
Exemplo n.º 4
0
//
// ICWindow::PostConfigure
//
// Post configuration
//
void ICWindow::PostConfigure()
{
  // Adjust window so that client size == configured size
  if (windowStyle & STYLE_ADJUSTWINDOW)
  {
    ClipRect r = GetAdjustmentRect();

    size.x += (r.p0.x - r.p1.x);
    size.y += (r.p0.y - r.p1.y);
    geom.size.x += (r.p0.x - r.p1.x);
    geom.size.y += (r.p0.y - r.p1.y);
  }

  // Post configure IControl
  IControl::PostConfigure();

  // If a title bar is specified create a control for it
  if (windowStyle & STYLE_TITLEBAR)
  {
    IControl *closeBtn = NULL;

    if (titleBarConfig)
    {
      // Use custom defined title bar
      titleBar = IFace::CreateControl(TitleBarCtlName, titleBarConfig, this);

      if (!(windowStyle & STYLE_NOSYSBUTTONS) && (windowStyle & STYLE_CLOSEBUTTON) && closeBtnConfig)
      {
        // Use custom defined close button
        closeBtn = IFace::CreateControl(CloseBtnCtlName, closeBtnConfig, this);
      }
    }
    else
    {
      // Otherwise use the default code style
      Bool thinTitle;
      S32 titleHeight;

      if (windowStyle & STYLE_THINTITLEBAR)
      {
        thinTitle = TRUE;
        titleHeight = IFace::GetMetric(IFace::THIN_TITLE_HEIGHT);
      }
      else
      {
        thinTitle = FALSE;
        titleHeight = IFace::GetMetric(IFace::TITLE_HEIGHT);
      }

      // Find the title font
      Font *font = FontSys::GetFont(IFace::GetMetric(thinTitle ? IFace::THIN_TITLE_FONT : IFace::TITLE_FONT));
      if (font == NULL)
      {
        ERR_FATAL(("Title font not found"));
      }

      // Create title bar
      titleBar = new ICWindowTitle(this);

      // Hard coded defaults
      titleBar->SetName(TitleBarCtlName);
      titleBar->SetSize(0, titleHeight);
      titleBar->SetPos(0, -titleHeight);
      titleBar->SetGeometry("WinParentWidth", NULL);
      titleBar->SetStyle("TitleGradient", "DropShadow", NULL);
      titleBar->SetFont(font);
      titleBar->SetColorGroup(IFace::data.cgTitle);
      titleBar->SetTextJustify(JUSTIFY_LEFT);

      // Create close button after titlebar
      if (!(windowStyle & STYLE_NOSYSBUTTONS) && (windowStyle & STYLE_CLOSEBUTTON))
      {
        closeBtn = new ICSystemButton(ICSystemButton::CLOSE, this);

        // Hard coded defaults
        closeBtn->SetName(CloseBtnCtlName);
        closeBtn->SetSize(titleHeight - 2, titleHeight - 2);
        closeBtn->SetPos(-2, -titleHeight+1);
        closeBtn->SetGeometry("Right", NULL);
      }
    }

    // Common configuration
    SetTextString(textStr ? textStr : Utils::Ansi2Unicode(ident.str), TRUE);
  }
}