NEURON
settext.cpp
Go to the documentation of this file.
1 #include <../../nrnconf.h>
2 # include "hoc.h"
3 # define Ret(a) hoc_ret(); hoc_pushx(a);
4 
5 #include "gui-redirect.h"
6 extern Object** (*nrnpy_gui_helper_)(const char* name, Object* obj);
7 extern double (*nrnpy_object_to_double_)(Object*);
8 
9 int newstyle;
10 unsigned int text_style=0, text_size=1, text_orient=0;
11 
12 void hoc_settext(void)
13 {
14  TRY_GUI_REDIRECT_DOUBLE("settext", NULL);
15  if (!ifarg(1)) {
16  text_style = 0;
17  text_size = 1;
18  text_orient = 0;
19  } else if (ifarg(3)) {
20  text_size = *getarg(1);
21  text_style = *getarg(2);
22  text_orient = *getarg(3);
23  } else if (ifarg(2)) {
24  text_size = *getarg(1);
25  text_style = *getarg(2);
26  } else if (ifarg(1)) {
27  text_size = *getarg(1);
28  }
29  if (text_style < 1) text_style = 1;
30  if (text_style > 4) text_style = 0;
31  if (text_orient > 1) text_orient = 0;
32  newstyle = 1;
33  Ret(1.);
34 }
void hoc_settext(void)
Definition: settext.cpp:12
double(* nrnpy_object_to_double_)(Object *)
Definition: xmenu.cpp:14
unsigned int text_orient
Definition: settext.cpp:10
unsigned int text_style
Definition: settext.cpp:10
int newstyle
Definition: settext.cpp:9
#define TRY_GUI_REDIRECT_DOUBLE(name, obj)
Definition: gui-redirect.h:54
#define Ret(a)
Definition: settext.cpp:3
char * name
Definition: init.cpp:16
int ifarg(int)
Definition: code.cpp:1562
unsigned int text_size
Definition: settext.cpp:10
Definition: hocdec.h:226
#define getarg
Definition: hocdec.h:15
return NULL
Definition: cabcode.cpp:461