view anagram/guisupport/redmenudc.cpp @ 22:5581ef01f993

Regen all the AG output. This also fixes the line number output in the tools (cgbigen/helpgen/help2html), apparently because those files weren't regenerated last go.
author David A. Holland
date Mon, 13 Jun 2022 00:06:39 -0400
parents 13d2b8934445
children
line wrap: on
line source

/*
 * AnaGram, A System for Syntax Directed Programming
 * Copyright 1993-2002 Parsifal Software. All Rights Reserved.
 * See the file COPYING for license and usage terms.
 *
 * redmenudc.cpp
 */

#include "cint.h"
#include "dc.h"
#include "q1glbl.h"
#include "redmenudc.h"
#include "stacks.h"
#include "token.h"
#include "ut.h"

//#define INCLUDE_LOGGING
#include "log.h"


static int reduction_menu_tabs[] = {7,0};

reduction_menu_dc::reduction_menu_dc(unsigned rn)
  : dc("Select Reduction Token", AgString::format("Rule %d", rn))
{
  int length;
  int i, dw;
  rule_number = rn;
  //des->c_size = cursor_bar_size;

  if (rn == 0) {
    length = 0;
  }
  else {
    length = ibnfn[rn];
  }

  for (i = dw = 0; i < length; i++) {
    int tn = ibnfs[ibnfb[rn] + i];
    int k;
    ics();
    atkn(tn);
    k = reduction_menu_tabs[0] + rcs();
    if (k > dw) {
      dw = k;
    }
  }
  tab_stops = reduction_menu_tabs;
  des->d_size = cint(dw, length);
  //manual_resize = 0;
  //resize_window();
}

void reduction_menu_dc::getLine(unsigned ln) const {
  unsigned tn;

  tn = ibnfs[ibnfb[rule_number] + ln];
  //ssprintf("T%03u: ", tn);
  ssprintf("T%03u:\t", tn);
  atkn(tn);
}