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