Jspice3
bascmd.c File Reference
#include "spice.h"
#include "sced.h"
#include "scedmacs.h"
Include dependency graph for bascmd.c:

Go to the source code of this file.

Functions

void Basic (int *LookedAhead)
 
void Undo ()
 
static void subct_color ()
 
void Color (int *LookedAhead)
 
void Bgrnd (int *LookedAhead)
 
void Hlite (int *LookedAhead)
 
static void subct_color (int *LookedAhead)
 
void RGB ()
 
void AlterColor (char RGB, char PlusOrMinus)
 
void SetGrid (int *LookedAhead)
 
void MenuParams (int *LookedAhead)
 
void MenuPrompt (int *LookedAhead)
 
void MenuMore (int *LookedAhead)
 
void ShowRGB ()
 
void Edit (int Ready, int Center, int Modified)
 
void TitleWindow ()
 
void Save ()
 
void WriteCell ()
 
static void newtok (char **p, char *t)
 
int FixCellName (char *cname)
 
void Rdraw ()
 
void ShowFull ()
 
void Expand ()
 

Variables

char * MenuUNDO
 
char * MenuBGRND
 
char * MenuHLITE
 
char * MenuRGB
 
char * MenuPLUSR
 
char * MenuMINSR
 
char * MenuPLUSG
 
char * MenuMINSG
 
char * MenuPLUSB
 
char * MenuMINSB
 
char * MenuGRID
 
char * MenuMENU
 
char * MenuPRMPT
 
char * MenuMORE
 
char * MenuHELP
 
char * MenuUPDAT
 
char * MenuSUBCT
 
char * MenuEDIT
 
char * MenuSAVE
 
char * MenuRDRAW
 
char * MenuVIEW
 
char * MenuEXPND
 

Function Documentation

void AlterColor ( char  RGB,
char  PlusOrMinus 
)

Definition at line 249 of file bascmd.c.

253 {
254  int *which;
255  char *menu;
256  double R,G,B;
257  double M = FBMAXINTENSITY;
258 
259  switch (RGB) {
260  case 'r':
261  case 'R':
262  if (PlusOrMinus == '+')
263  menu = MenuPLUSR;
264  else
265  menu = MenuMINSR;
266  which = &ColorTable[Parameters.kpColor].klR;
267  break;
268  case 'g':
269  case 'G':
270  if (PlusOrMinus == '+')
271  menu = MenuPLUSG;
272  else
273  menu = MenuMINSG;
274  which = &ColorTable[Parameters.kpColor].klG;
275  break;
276  case 'b':
277  case 'B':
278  if (PlusOrMinus == '+')
279  menu = MenuPLUSB;
280  else
281  menu = MenuMINSB;
282  which = &ColorTable[Parameters.kpColor].klB;
283  break;
284  default:
285  return;
286  }
287  MenuSelect(menu);
288  if (PlusOrMinus == '+') {
289  if (*which == FBMAXINTENSITY) *which = 0;
290  else if (((*which) += 10) > FBMAXINTENSITY)
291  *which = FBMAXINTENSITY;
292  }
293  else {
294  if (*which == 0) *which = FBMAXINTENSITY;
295  else if (((*which) -= 10) < 0) *which = 0;
296  }
301 
302  ShowRGB();
303  MenuDeselect(menu);
304 }
void DevDefineColor()
char * MenuMINSR
Definition: scedintr.c:59
char * MenuMINSG
Definition: scedintr.c:58
char * MenuPLUSB
Definition: scedintr.c:60
int kpColor
Definition: sced.h:252
void RGB()
Definition: bascmd.c:238
char * MenuPLUSR
Definition: scedintr.c:62
struct kl * ColorTable
Definition: init.c:20
int klR
Definition: sced.h:95
void MenuDeselect()
#define G
Definition: parse.c:441
#define R
Definition: parse.c:444
struct kp Parameters
Definition: init.c:19
char * MenuPLUSG
Definition: scedintr.c:61
char * MenuMINSB
Definition: scedintr.c:57
int klB
Definition: sced.h:95
#define FBMAXINTENSITY
Definition: scedmacs.h:48
int klG
Definition: sced.h:95
void ShowRGB()
Definition: bascmd.c:481
Definition: sced.h:363
void MenuSelect()
void Basic ( int *  LookedAhead)

Definition at line 30 of file bascmd.c.

33 {
34  *LookedAhead = False;
39 }
#define DrawingColor
Definition: sced.h:87
int kpColor
Definition: sced.h:252
#define BASICMENU
Definition: sced.h:56
void ShowCommandMenu()
Definition: viewport.c:121
char kpMenu
Definition: sced.h:319
struct kp Parameters
Definition: init.c:19
MENU * BasicMenu
Definition: scedintr.c:49
#define False
Definition: scedstub.c:15
void FixMenuPrefix()
void Bgrnd ( int *  LookedAhead)

Definition at line 184 of file bascmd.c.

187 {
190  ShowPrompt("Set RGB of background color.");
191  (void)PointColor(LookedAhead);
193  ErasePrompt();
195 }
void ErasePrompt()
Definition: viewport.c:538
#define DrawingColor
Definition: sced.h:87
int kpColor
Definition: sced.h:252
int PointColor()
char * MenuBGRND
Definition: scedintr.c:66
void MenuDeselect()
struct kp Parameters
Definition: init.c:19
#define BackgroundColor
Definition: sced.h:73
void MenuSelect()
void ShowPrompt(char *str)
Definition: scedstub.c:71
void Color ( int *  LookedAhead)

Definition at line 82 of file bascmd.c.

85 {
86  int i = 0;
87  char OldMenu;
88 
91  i++;
92  AmbiguityMenu[i].mEntry = " ";
94  i++;
97  i++;
98  AmbiguityMenu[i].mEntry = " ";
100  i++;
103  i++;
106  i++;
109  i++;
112  i++;
115  i++;
118  i++;
121  i++;
122  AmbiguityMenu[i].mEntry = " ";
124  i++;
127  i++;
130  i++;
133  i++;
136  i++;
139  i++;
142  i++;
143  AmbiguityMenu[i].mEntry = " ";
145  i++;
148  i++;
150  OldMenu = Parameters.kpMenu;
154  ShowPrompt("Hit ESC to exit.");
155 
156  loop {
157  switch (PointLoop(LookedAhead)) {
158  case PL_CMD:
159  if (Matching(MenuSUBCT)) {
160  *LookedAhead = False;
161  subct_color(LookedAhead);
162  if (*LookedAhead == True && !Matching(MenuSUBCT))
163  goto quit;
164  continue;
165  }
166  if (Matching(MenuHELP)) {
167  SCEDhelp();
168  *LookedAhead = False;
169  continue;
170  }
171  case PL_ESC:
172  goto quit;
173  case PL_PCW:
174  continue;
175  }
176  }
177 quit:
178  Parameters.kpMenu = OldMenu;
179  ShowCommandMenu();
180 }
#define PL_ESC
Definition: sced.h:62
short mActive
Definition: sced.h:365
#define loop
Definition: cdmacs.h:11
char * MenuMINSR
Definition: scedintr.c:59
char * MenuHLITE
Definition: scedintr.c:82
char * MenuMINSG
Definition: scedintr.c:58
int PointLoop()
char * MenuMENU
Definition: scedintr.c:86
char * MenuPLUSB
Definition: scedintr.c:60
#define PL_PCW
Definition: sced.h:65
char * mEntry
Definition: sced.h:364
void SCEDhelp()
Definition: scedintr.c:1090
#define Matching(string)
Definition: scedmacs.h:63
char * MenuSUBCT
Definition: scedintr.c:106
char * MenuPLUSR
Definition: scedintr.c:62
char * MenuPRMPT
Definition: scedintr.c:96
void ShowCommandMenu()
Definition: viewport.c:121
char * MenuRGB
Definition: scedintr.c:100
char * MenuBGRND
Definition: scedintr.c:66
void ShowMenu()
char kpMenu
Definition: sced.h:319
#define NULL
Definition: spdefs.h:121
struct kp Parameters
Definition: init.c:19
char * MenuPLUSG
Definition: scedintr.c:61
#define True
Definition: scedstub.c:16
char * MenuUPDAT
Definition: scedintr.c:109
#define AMBIGUITYMENU
Definition: sced.h:57
static void subct_color()
char * MenuMINSB
Definition: scedintr.c:57
MENU AmbiguityMenu[DefMenuSize]
Definition: scedintr.c:51
char * MenuMORE
Definition: scedintr.c:87
#define False
Definition: scedstub.c:15
void FixMenuPrefix()
#define PL_CMD
Definition: sced.h:64
char * MenuGRID
Definition: scedintr.c:79
void ShowPrompt(char *str)
Definition: scedstub.c:71
char * MenuHELP
Definition: scedintr.c:81
void Edit ( int  Ready,
int  Center,
int  Modified 
)

Definition at line 513 of file bascmd.c.

516 {
517  /*
518  * Ready == True if the name of the cell to be edited is
519  * already in Parameters.kpCellName.
520  * Center == True if the cell should be automatically centered.
521  * Pop does NOT want it to be--it wants it to be exactly where it was
522  * when it was pushed into.
523  */
524  char *TypeIn,*CellName,*NextCellName();
525  char cbuf[128];
526  struct s *TempCellDesc;
527  FILE *fp, *gp;
528 
530 
531  TempCellDesc = Parameters.kpCellDesc;
532 
533  if (Not Ready){
534  ShowPrompt("Cell?");
535  CellName = FBEdit(NULL);
536  if (CellName == NULL) {
537  ErasePrompt();
539  return;
540  }
541  while (isspace(*CellName)) CellName++;
542  if (*CellName == '\0') {
543  /* get next cellname from argument list */
544  CellName = NextCellName();
545  if (CellName == NULL) {
546  if (Parameters.kpCellName == NULL
547  Or *Parameters.kpCellName == '\0')
548  CellName = DEFAULT_EDIT_FILE;
549  else
550  CellName = Parameters.kpCellName;
551  }
552  }
553  else {
554  strcpy(cbuf,CellName);
555  CellName = cbuf;
556  }
557 
558  fp = POpen(CellName,"r",(char **)NULL);
559  if (fp) {
560  if (!IsSymFile(fp)) {
561 
562  /* If model library is called by name, and
563  * the file is not in the CWD, drop a copy
564  * of the system model library into the CWD.
565  */
566  if (!strcmp(CellName,ModelLibrary)) {
567  if (access(ModelLibrary,0)) {
568  int c;
569 
570  rewind(fp);
571  gp = fopen(ModelLibrary,"w");
572  if (gp) {
573  while ((c = getc(fp)) != EOF)
574  putc(c,gp);
575  fclose(gp);
576  }
577  }
578  }
579  fclose(fp);
580 
581  if (!dispdev->windows) {
582  DevHalt();
583  (void)inp_edit(CellName);
584 
585  if (substring(ModelLibrary,CellName)) {
588  }
589 
593  sprintf(TypeOut,"Editing: %s",Parameters.kpCellName);
595  }
596  else {
597  (void)inp_edit(CellName);
598  if (substring(ModelLibrary,CellName)) {
601  }
603  ErasePrompt();
604  }
605  return;
606  }
607  else
608  fclose(fp);
609  }
610 
612  && Parameters.kpCellDesc) {
613  sprintf(TypeOut,
614  "You've modified %s. Do you want to save it (y)?",
617  TypeIn = FBEdit(NULL);
618  if (TypeIn == NULL) {
619  ErasePrompt();
621  return;
622  }
623  if (TypeIn[0] != 'n' && TypeIn[0] != 'N')
624  WriteCell();
625  }
626 
627  ClearContext();
628 
629  if (!strcmp(Parameters.kpCellName,CellName)) {
630  if (TempCellDesc) {
631  if (Not CDClose(TempCellDesc))
632  MallocFailed();
633  }
634  }
635  else
636  strcpy(Parameters.kpCellName,CellName);
637  }
638 
639  /* strip off any path prefix */
641  ShowPromptAndWait("Warning: internal path overflow");
642  }
643 
644  SQClear(); /* clear selset queue */
645  GPclearGraf(); /* clear graf references */
648  ShowPrompt("Building database. Please wait.");
652  DefaultWindows();
655  sprintf(TypeOut,"Can't edit cell %s. MORE",Parameters.kpCellName);
657  (void)FBGetchar(ERASE);
658  sprintf(TypeOut,"%s",CDStatusString);
661  }
662  else {
664  if (TempCellDesc && (TempCellDesc != Parameters.kpCellDesc))
665  if (Not CDClose(TempCellDesc))
666  MallocFailed();
669 
670  if (CDStatusInt == CDNEWSYMBOL)
671  DefaultWindows();
672  elif (Center)
673  CenterFullView();
675 
676  /*
677  * CDUnmark is expensive and has two purposes!
678  * First, we make sure that all objects begin with a 0 info field.
679  * We will therefore see EVERYTHING in the symbol during redisplay.
680  * Secondly, the bounding boxes are recomputed and therefore
681  * propogated correctly through the hierarchy.
682  */
683  CDUnmark(Parameters.kpCellDesc);
684  Redisplay(View->kvCoarseWindow);
685  if (CDStatusInt == CDNEWSYMBOL) {
686  sprintf(TypeOut,"Editing new cell: %s",Parameters.kpCellName);
688  }
689  else {
690  sprintf(TypeOut,"Editing: %s",Parameters.kpCellName);
694  }
695  Parameters.kpModified = Modified;
696  TitleWindow();
697  }
698  SaveLastView();
700 }
void ErasePrompt()
Definition: viewport.c:538
void Redisplay()
#define Or
Definition: cdmacs.h:15
struct ka * kvCoarseWindow
Definition: sced.h:149
int kpModified
Definition: sced.h:261
char * strcpy()
Definition: cddefs.h:119
if(TDesc==NULL)
Definition: cd.c:1326
void CenterFullView()
Definition: init.c:466
#define ERASE
Definition: scedmacs.h:11
#define Not
Definition: cdmacs.h:16
struct s * kpCellDesc
Definition: sced.h:207
DISPDEVICE * dispdev
Definition: display.c:112
char * kpCellName
Definition: sced.h:210
int CDUnmark()
void WriteCell()
Definition: bascmd.c:740
int CDStatusInt
Definition: cd.c:75
void EraseLargeCoarseViewport()
Definition: viewport.c:583
struct s * kpTopDesc
Definition: sced.h:213
int FixCellName(char *cname)
Definition: bascmd.c:846
int CDOpen()
int DevNewViewport()
void ShowPromptAndWait()
void ClearContext()
Definition: subckt.c:944
void ModelLibraryClose()
Definition: library.c:446
bool windows
Definition: plotdev.h:61
void MallocFailed()
Definition: scedintr.c:857
int CDClose()
int substring()
void MenuDeselect()
void DevHalt()
Definition: display.c:226
#define NULL
Definition: spdefs.h:121
char TypeOut[200]
Definition: init.c:23
struct kp Parameters
Definition: init.c:19
#define elif
Definition: cdmacs.h:10
void DefaultWindows()
Definition: init.c:239
short FBGetchar()
char * kpTopName
Definition: sced.h:216
int access(char *pth, int m)
Definition: libfuncs.c:75
struct kv * View
Definition: init.c:17
int kpShowTerminals
Definition: sced.h:255
static double c
Definition: vectors.c:16
void DisplayTerminals()
char * MenuEDIT
Definition: scedintr.c:75
int IsSymFile(FILE *fp)
Definition: scedintr.c:727
#define DISPLAY
Definition: scedmacs.h:12
void RedisplaySCED()
#define CDNEWSYMBOL
Definition: cddefs.h:29
void SaveLastView()
Definition: display.c:297
#define ModelLibrary
Definition: sced.h:30
char * CDStatusString
Definition: cd.c:77
void GPclearGraf()
Definition: grafintr.c:364
#define EOS
Definition: cdmacs.h:9
void ModelLibraryOpen()
char * FBEdit()
GRAPH * currentgraph
Definition: graphdb.c:21
void SQClear()
Definition: choose.c:690
bool inp_edit()
char * NextCellName()
Definition: scedintr.c:852
void ConnectRecursive()
void TitleWindow()
Definition: bascmd.c:704
FILE * POpen()
#define DEFAULT_EDIT_FILE
Definition: sced.h:23
void MenuSelect()
void ShowPrompt(char *str)
Definition: scedstub.c:71
void Expand ( )

Definition at line 920 of file bascmd.c.

922 {
923  extern char *MenuEXPND;
924 
926  MenuDeselect(MenuEXPND);
928  }
929  else {
930  MenuSelect(MenuEXPND);
932  }
935 }
void Redisplay()
struct ka * kvCoarseWindow
Definition: sced.h:149
void EraseLargeCoarseViewport()
Definition: viewport.c:583
int kpExpandInstances
Definition: sced.h:231
void MenuDeselect()
struct kp Parameters
Definition: init.c:19
#define True
Definition: scedstub.c:16
struct kv * View
Definition: init.c:17
#define False
Definition: scedstub.c:15
void MenuSelect()
char * MenuEXPND
Definition: scedintr.c:76
int FixCellName ( char *  cname)

Definition at line 846 of file bascmd.c.

852 {
853  char *c, *p;
854  char tok[81];
855  int i, ret = 0;
856 
857  c = strrchr(cname,DIR_TERM);
858  if (!c)
859  return (0);
860  *c = '\0';
861 
862  p = PGetPath();
863  while (*p) {
864  newtok(&p,tok);
865 #ifdef MSDOS
866  if (!stricmp(tok,cname))
867 #else
868  if (!strcmp(tok,cname))
869 #endif
870  goto done;
871  }
872  ret = PAppendPath(cname);
873 
874 done:
875  for (i = 0, c++; *c; i++, c++)
876  cname[i] = *c;
877  cname[i] = '\0';
878  return (ret);
879 }
static void newtok(char **p, char *t)
Definition: bascmd.c:831
FILE * p
Definition: proc2mod.c:48
static double c
Definition: vectors.c:16
int PAppendPath()
char * PGetPath()
Definition: paths.c:67
void Hlite ( int *  LookedAhead)

Definition at line 199 of file bascmd.c.

202 {
205  ShowPrompt("Set RGB of highlighting color.");
206  (void)PointColor(LookedAhead);
208  ErasePrompt();
210 }
void ErasePrompt()
Definition: viewport.c:538
char * MenuHLITE
Definition: scedintr.c:82
#define DrawingColor
Definition: sced.h:87
int kpColor
Definition: sced.h:252
int PointColor()
void MenuDeselect()
struct kp Parameters
Definition: init.c:19
void MenuSelect()
void ShowPrompt(char *str)
Definition: scedstub.c:71
#define HighlightingColor
Definition: sced.h:74
void MenuMore ( int *  LookedAhead)

Definition at line 465 of file bascmd.c.

468 {
471  ShowPromptWithColor("Set RGB for \"more\" window text.",
472  MoreTextColor);
473  (void)PointColor(LookedAhead);
475  ErasePrompt();
477 }
void ErasePrompt()
Definition: viewport.c:538
void ShowPromptWithColor()
#define DrawingColor
Definition: sced.h:87
int kpColor
Definition: sced.h:252
int PointColor()
void MenuDeselect()
struct kp Parameters
Definition: init.c:19
char * MenuMORE
Definition: scedintr.c:87
#define MoreTextColor
Definition: sced.h:81
void MenuSelect()
void MenuParams ( int *  LookedAhead)

Definition at line 398 of file bascmd.c.

401 {
403 
405  ShowPrompt("Set RGB for menu text (point in window for next).");
406  switch (PointColor(LookedAhead)) {
407  case PL_ESC:
408  case PL_CMD:
409  goto quit;
410  }
411 
413  ShowPrompt("Set RGB for menu prefix (point in window for next).");
414  switch (PointColor(LookedAhead)) {
415  case PL_ESC:
416  case PL_CMD:
417  goto quit;
418  }
419 
421  ShowPrompt(
422  "Set RGB for selected menu text (point in window for next).");
423  switch (PointColor(LookedAhead)) {
424  case PL_ESC:
425  case PL_CMD:
426  goto quit;
427  }
428 
430  ShowPrompt(
431  "Set RGB for selected prefix (point in window for next).");
432  switch (PointColor(LookedAhead)) {
433  case PL_ESC:
434  case PL_CMD:
435  goto quit;
436  }
437 
439  ShowPrompt("Set RGB for menu highlighting.");
440  (void)PointColor(LookedAhead);
441 
442 quit:
443  ErasePrompt();
446 }
#define PL_ESC
Definition: sced.h:62
void ErasePrompt()
Definition: viewport.c:538
char * MenuMENU
Definition: scedintr.c:86
#define DrawingColor
Definition: sced.h:87
int kpColor
Definition: sced.h:252
int PointColor()
#define MenuSelectedColor
Definition: sced.h:77
void MenuDeselect()
struct kp Parameters
Definition: init.c:19
#define MenuHighlightingColor
Definition: sced.h:79
#define MenuSelectedPrefixColor
Definition: sced.h:78
#define MenuTextColor
Definition: sced.h:75
#define MenuTextPrefixColor
Definition: sced.h:76
#define PL_CMD
Definition: sced.h:64
void MenuSelect()
void ShowPrompt(char *str)
Definition: scedstub.c:71
void MenuPrompt ( int *  LookedAhead)

Definition at line 450 of file bascmd.c.

453 {
456  ShowPrompt("Set RGB for message text.");
457  (void)PointColor(LookedAhead);
459  ErasePrompt();
461 }
void ErasePrompt()
Definition: viewport.c:538
#define PromptTextColor
Definition: sced.h:80
#define DrawingColor
Definition: sced.h:87
int kpColor
Definition: sced.h:252
int PointColor()
char * MenuPRMPT
Definition: scedintr.c:96
void MenuDeselect()
struct kp Parameters
Definition: init.c:19
void MenuSelect()
void ShowPrompt(char *str)
Definition: scedstub.c:71
static void newtok ( char **  p,
char *  t 
)
static

Definition at line 831 of file bascmd.c.

834 {
835  char *s = *p;
836 
837  while (isspace(*s)) s++;
838  while (*s && !isspace(*s)) *t++ = *s++;
839  *t = '\0';
840  while (isspace(*s)) s++;
841  *p = s;
842 }
Definition: cddefs.h:119
FILE * p
Definition: proc2mod.c:48
Definition: cddefs.h:215
Definition: cddefs.h:192
void Rdraw ( )

Definition at line 897 of file bascmd.c.

899 {
903 }
char * MenuRDRAW
Definition: scedintr.c:99
void MenuDeselect()
void RedisplaySCED()
GRAPH * currentgraph
Definition: graphdb.c:21
void MenuSelect()
void RGB ( )

Definition at line 238 of file bascmd.c.

240 {
242  ErasePrompt();
243  ShowRGB();
245 }
void ErasePrompt()
Definition: viewport.c:538
char * MenuRGB
Definition: scedintr.c:100
void MenuDeselect()
void ShowRGB()
Definition: bascmd.c:481
void MenuSelect()
void Save ( )

Definition at line 715 of file bascmd.c.

717 {
718  FILE *fp;
719 
720  ShowPrompt("Saving circuit. Please wait.");
721  if (CDUpdate(Parameters.kpCellDesc,(char *)NULL)) {
724  fp = POpen(Parameters.kpCellName,"a",(char **)NULL);
725  if (fp) {
726  DumpSpiceFile(fp);
727  fclose(fp);
728  }
729  }
731  MallocFailed();
732  ShowPrompt("Current circuit has been saved.");
733  }
734  else
735  ShowPrompt("Can't save circuit.");
736 }
int kpModified
Definition: sced.h:261
int CDUpdate()
#define Not
Definition: cdmacs.h:16
struct s * kpCellDesc
Definition: sced.h:207
char * kpCellName
Definition: sced.h:210
struct s * kpTopDesc
Definition: sced.h:213
void MallocFailed()
Definition: scedintr.c:857
#define NULL
Definition: spdefs.h:121
struct kp Parameters
Definition: init.c:19
void DumpSpiceFile()
int CDReflect()
#define False
Definition: scedstub.c:15
FILE * POpen()
void ShowPrompt(char *str)
Definition: scedstub.c:71
void SetGrid ( int *  LookedAhead)

Definition at line 308 of file bascmd.c.

311 {
312  char *TypeIn;
313  double d;
314  int OldParameter = Parameters.kpShowGridInLargeViewport;
315  int i;
316 
319  sprintf(TypeOut,"Hex code for grid line style, 0 for point grid (%x)?",
322  TypeIn = FBEdit(NULL);
323  if (TypeIn == NULL) goto quit;
324  if (sscanf(TypeIn,"%x",&i) == 1 && i >= 0 && i < 256)
326 
327  sprintf(TypeOut,"Show grid above layout geometries (%c)?",
328  Parameters.kpGridOnTop ? 'Y' : 'N');
330  TypeIn = FBEdit(NULL);
331  if (TypeIn == NULL) goto quit;
332  if (*TypeIn == 'n' Or *TypeIn == 'N')
334  elif (*TypeIn == 'y' Or *TypeIn == 'Y')
335  Parameters.kpGridOnTop = True;
336 
337  sprintf(TypeOut,"Show grid in coarse viewport of a split screen (%c)?",
338  Parameters.kpShowGridInLargeViewport ? 'Y' : 'N');
339  ShowPrompt(TypeOut);
340  TypeIn = FBEdit(NULL);
341  if (TypeIn == NULL) goto quit;
342  if (*TypeIn == 'n' Or *TypeIn == 'N')
343  Parameters.kpShowGridInLargeViewport = False;
344  elif (*TypeIn == 'y' Or *TypeIn == 'Y')
345  Parameters.kpShowGridInLargeViewport = True;
346 
347  Parameters.kpColor = FineGridColor;
348  ShowPrompt(
349  "Set RGB for fine grid lines (point in window for next).");
350  switch (PointColor(LookedAhead)) {
351  case PL_ESC:
352  case PL_CMD:
353  goto quit;
354  }
355 
357  ShowPrompt("Set RGB for coarse grid lines.");
358  switch (PointColor(LookedAhead)) {
359  case PL_ESC:
360  case PL_CMD:
361  goto quit;
362  }
363  }
364  sprintf(TypeOut,
365  "Enter new grid interval (currently %g, CR to turn grid %s): ",
366  (double)Parameters.kpGrid/RESOLUTION,
367  Parameters.kpGridDisplayed ? "off" : "on" );
369  TypeIn = FBEdit(NULL);
370  if (TypeIn != NULL) {
371  if (!strlen(TypeIn)) {
373  ErasePrompt();
374  }
375  elif (sscanf(TypeIn,"%lg",&d) == 1 And d > 0) {
377  if (Parameters.kpGrid == 0)
378  Parameters.kpGrid = 1;
379  sprintf(TypeOut,"Grid line spacing now %g.",
380  (double)Parameters.kpGrid/RESOLUTION);
382  }
383  else
384  goto quit;
385  }
386 quit:
387  if (Parameters.kpShowGridInLargeViewport Or OldParameter)
389  else
391  ErasePrompt();
394 }
#define PL_ESC
Definition: sced.h:62
void ErasePrompt()
Definition: viewport.c:538
#define Or
Definition: cdmacs.h:15
if(TDesc==NULL)
Definition: cd.c:1326
#define CoarseGridColor
Definition: sced.h:82
#define FineGridColor
Definition: sced.h:83
#define DrawingColor
Definition: sced.h:87
int kpColor
Definition: sced.h:252
int PointColor()
int kpGridDisplayed
Definition: sced.h:240
void RGB()
Definition: bascmd.c:238
int kpGridLineStyle
Definition: sced.h:237
void MenuDeselect()
int kpShowGridInLargeViewport
Definition: sced.h:246
Definition: cddefs.h:237
char kpMenu
Definition: sced.h:319
#define NULL
Definition: spdefs.h:121
char TypeOut[200]
Definition: init.c:23
struct kp Parameters
Definition: init.c:19
#define elif
Definition: cdmacs.h:10
Definition: sced.h:120
#define True
Definition: scedstub.c:16
#define RESOLUTION
Definition: sced.h:36
#define AMBIGUITYMENU
Definition: sced.h:57
void RedisplaySCED()
Definition: cddefs.h:177
void ShowFineViewport()
Definition: viewport.c:610
#define And
Definition: cdmacs.h:14
long kpGrid
Definition: sced.h:234
char * FBEdit()
GRAPH * currentgraph
Definition: graphdb.c:21
int kpGridOnTop
Definition: sced.h:243
#define False
Definition: scedstub.c:15
#define PL_CMD
Definition: sced.h:64
char * MenuGRID
Definition: scedintr.c:79
void MenuSelect()
long Y
Definition: actions.c:450
void ShowPrompt(char *str)
Definition: scedstub.c:71
Definition: newgraf.h:78
void ShowFull ( )

Definition at line 907 of file bascmd.c.

909 {
911  SaveLastView();
913  CenterFullView();
916 }
void Redisplay()
struct ka * kvCoarseWindow
Definition: sced.h:149
void CenterFullView()
Definition: init.c:466
void EraseLargeCoarseViewport()
Definition: viewport.c:583
char * MenuVIEW
Definition: scedintr.c:110
void MenuDeselect()
struct kv * View
Definition: init.c:17
void SaveLastView()
Definition: display.c:297
void MenuSelect()
void ShowRGB ( )

Definition at line 481 of file bascmd.c.

483 {
484  int r,g,b;
485 
489 
492 
493  sprintf(TypeOut," (%d,%d,%d)",r,g,b);
494 
497 }
#define PromptTextColor
Definition: sced.h:80
void DevSetColor()
#define ERASE
Definition: scedmacs.h:11
#define gi_numtextcols
Definition: scedmacs.h:61
int kpColor
Definition: sced.h:252
struct kl * ColorTable
Definition: init.c:20
int klR
Definition: sced.h:95
#define ROW_COLUMN
Definition: scedmacs.h:15
char TypeOut[200]
Definition: init.c:23
struct kp Parameters
Definition: init.c:19
void OutlineText()
int klB
Definition: sced.h:95
Definition: cddefs.h:162
void FBText()
int klG
Definition: sced.h:95
Definition: cddefs.h:227
#define gi_numtextrows
Definition: scedmacs.h:60
#define FILL
Definition: scedmacs.h:13
int kpLastCursorColumn
Definition: sced.h:293
static void subct_color ( )
static
static void subct_color ( int *  LookedAhead)
static

Definition at line 214 of file bascmd.c.

217 {
220  ShowPrompt(
221  "Set RGB of unexpanded subcircuit box (point in window for next).");
222  switch (PointColor(LookedAhead)) {
223  case PL_ESC:
224  case PL_CMD:
225  goto quit;
226  }
228  ShowPrompt("Set RGB of unexpanded subcircuit label.");
229  (void)PointColor(LookedAhead);
230 quit:
232  ErasePrompt();
234 }
#define PL_ESC
Definition: sced.h:62
void ErasePrompt()
Definition: viewport.c:538
#define InstanceBBColor
Definition: sced.h:84
#define InstanceNameColor
Definition: sced.h:85
#define DrawingColor
Definition: sced.h:87
int kpColor
Definition: sced.h:252
int PointColor()
char * MenuSUBCT
Definition: scedintr.c:106
void MenuDeselect()
struct kp Parameters
Definition: init.c:19
#define PL_CMD
Definition: sced.h:64
void MenuSelect()
void ShowPrompt(char *str)
Definition: scedstub.c:71
void TitleWindow ( )

Definition at line 704 of file bascmd.c.

706 {
707  char Title[80];
708 
709  sprintf(Title,"Circuit: %s",Parameters.kpCellName);
710  DevTitle(Title,"sced");
711 }
char * kpCellName
Definition: sced.h:210
struct kp Parameters
Definition: init.c:19
void DevTitle()
void Undo ( )

Definition at line 43 of file bascmd.c.

45 {
47  ShowPrompt("Sorry, but it's too late.");
49 }
char * MenuUNDO
Definition: objects.c:115
void MenuDeselect()
void MenuSelect()
void ShowPrompt(char *str)
Definition: scedstub.c:71
void WriteCell ( )

Definition at line 740 of file bascmd.c.

742 {
743  struct prpty *PDesc;
744  char *TypeIn,NewName[128],*t;
745  FILE *fp;
746 
748  if (Parameters.kpCellName[0] == '\0') {
749  ShowPrompt("There isn't anything to write.");
751  return;
752  }
753  ShowPrompt("Circuit name?");
754  TypeIn = FBEdit(Parameters.kpCellName);
755  if (TypeIn == NULL Or *TypeIn == '\0' Or *TypeIn == '\n') {
757  ErasePrompt();
758  return;
759  }
760  t = NewName;
761  while (isspace(*TypeIn)) TypeIn++;
762  if (*TypeIn == '\0') {
764  ErasePrompt();
765  return;
766  }
767  while (*TypeIn && !isspace(*TypeIn))
768  *t++ = *TypeIn++;
769  *t = '\0';
770 
771  ShowPrompt("Writing circuit. Please wait.");
772 
773  if (strcmp(Parameters.kpCellName,NewName)) {
774  /* new name given */
775  TypeIn = Parameters.kpCellDesc->sName;
776  Parameters.kpCellDesc->sName = NewName;
777 
778  /* change the subcircuit's reference name */
780  for (; PDesc; PDesc = PDesc->prpty_Succ)
781  if (PDesc->prpty_Value == P_NAME) break;
782  if (PDesc && PDesc->prpty_Data->p_name.subname) {
783  t = PDesc->prpty_Data->p_name.subname;
784  PDesc->prpty_Data->p_name.subname = NewName;
785  }
786 
787  if (Not CDUpdate(Parameters.kpCellDesc,NewName)) {
788  ShowPrompt("Can't save circuit.");
790  Parameters.kpCellDesc->sName = TypeIn;
791  return;
792  }
793  if (PDesc && PDesc->prpty_Data->p_name.subname) {
794  PDesc->prpty_Data->p_name.subname = t;
795  }
797  Parameters.kpCellDesc->sName = TypeIn;
799  fp = POpen(NewName,"a",(char **)NULL);
800  if (fp) {
801  DumpSpiceFile(fp);
802  fclose(fp);
803  }
804  }
805  UpdateParent(NewName);
806  ShowPrompt("New circuit has been saved.");
807  }
808  else {
809  if (Not CDUpdate(Parameters.kpCellDesc,(char *)NULL)) {
810  ShowPrompt("Can't save circuit.");
812  return;
813  }
815  fp = POpen(Parameters.kpCellName,"a",(char **)NULL);
816  if (fp) {
817  DumpSpiceFile(fp);
818  fclose(fp);
819  }
820  }
821  ShowPrompt("Current circuit has been saved.");
824  MallocFailed();
825  }
827 }
struct prpty * sPrptyList
Definition: cddefs.h:133
void ErasePrompt()
Definition: viewport.c:538
void UpdateParent()
#define Or
Definition: cdmacs.h:15
int prpty_Value
Definition: cdprpty.h:67
int kpModified
Definition: sced.h:261
int CDUpdate()
#define Not
Definition: cdmacs.h:16
struct s * kpCellDesc
Definition: sced.h:207
char * kpCellName
Definition: sced.h:210
struct s * kpTopDesc
Definition: sced.h:213
union prp_data * prpty_Data
Definition: cdprpty.h:65
void MallocFailed()
Definition: scedintr.c:857
void MenuDeselect()
#define NULL
Definition: spdefs.h:121
struct kp Parameters
Definition: init.c:19
char * subname
Definition: cdprpty.h:48
void DumpSpiceFile()
char * MenuSAVE
Definition: scedintr.c:102
#define P_NAME
Definition: cdprpty.h:13
int CDReflect()
struct prpty * prpty_Succ
Definition: cdprpty.h:66
char * FBEdit()
#define False
Definition: scedstub.c:15
struct prp_name p_name
Definition: cdprpty.h:55
char * sName
Definition: cddefs.h:122
FILE * POpen()
Definition: cddefs.h:192
void MenuSelect()
Definition: cdprpty.h:62
void ShowPrompt(char *str)
Definition: scedstub.c:71

Variable Documentation

char* MenuBGRND

Definition at line 66 of file scedintr.c.

char* MenuEDIT

Definition at line 75 of file scedintr.c.

char* MenuEXPND

Definition at line 76 of file scedintr.c.

char* MenuGRID

Definition at line 79 of file scedintr.c.

char* MenuHELP

Definition at line 81 of file scedintr.c.

char* MenuHLITE

Definition at line 82 of file scedintr.c.

char* MenuMENU

Definition at line 86 of file scedintr.c.

char * MenuMINSB

Definition at line 57 of file scedintr.c.

char * MenuMINSG

Definition at line 58 of file scedintr.c.

char * MenuMINSR

Definition at line 59 of file scedintr.c.

char* MenuMORE

Definition at line 87 of file scedintr.c.

char* MenuPLUSB

Definition at line 60 of file scedintr.c.

char* MenuPLUSG

Definition at line 61 of file scedintr.c.

char* MenuPLUSR

Definition at line 62 of file scedintr.c.

char* MenuPRMPT

Definition at line 96 of file scedintr.c.

char* MenuRDRAW

Definition at line 99 of file scedintr.c.

char* MenuRGB

Definition at line 100 of file scedintr.c.

char* MenuSAVE

Definition at line 102 of file scedintr.c.

char* MenuSUBCT

Definition at line 106 of file scedintr.c.

char * MenuUNDO

Definition at line 115 of file objects.c.

char* MenuUPDAT

Definition at line 109 of file scedintr.c.

char* MenuVIEW

Definition at line 110 of file scedintr.c.