home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / fractal / kaos.lha / fftlib / create_fft_windows.c next >
Encoding:
C/C++ Source or Header  |  1990-01-18  |  2.8 KB  |  100 lines

  1. /*
  2. ### create a lyapunov window ###
  3. */
  4.  
  5. #include <suntool/sunview.h>
  6. #include <suntool/panel.h>
  7.  
  8. void create_fft_windows()
  9. {
  10.     void fft_quit_proc(),fft_go_proc(),fft_show_proc();
  11.     void fft_algorithm_option_proc();
  12.     int i,ipanel_row=0,px,py;
  13.     extern Frame frame,fft_frame,tser_frame;
  14.     extern Panel fft_panel;
  15.     extern Pixfont *boldfont;
  16.     extern Panel_item fft_quit_item,fft_go_item,fft_show_item;
  17.     extern Panel_item fft_algorithm_option_item;
  18.     extern short fft_panel_show,tser_panel_show;
  19.     extern int panel_colormap_on;
  20.     extern int fft_algorithm_option;
  21.     extern char string[];
  22.     
  23.     /* Turn on the flag */    
  24.     if(fft_panel_show){
  25.         window_set(fft_frame,WIN_SHOW,TRUE,0);    
  26.         return;
  27.     }
  28.     else
  29.         fft_panel_show = 1;
  30.  
  31.     if(tser_panel_show){
  32.         px = (int) window_get(tser_frame,WIN_X);
  33.         py = (int) window_get(tser_frame,WIN_Y) + (int) window_get(tser_frame,WIN_HEIGHT);
  34.     }
  35.     else {
  36.         px = (int) window_get(frame,WIN_X) + (int) window_get(frame,WIN_WIDTH)/2;
  37.         py = (int) window_get(frame,WIN_Y) + (int) window_get(frame,WIN_HEIGHT) /2;
  38.     }
  39.     /* Create tser frame */
  40.     fft_frame = window_create(frame,FRAME,
  41.         FRAME_NO_CONFIRM,       TRUE,
  42.         FRAME_LABEL,    "Fourier",
  43.         FRAME_SHOW_LABEL,       TRUE,
  44.         WIN_SHOW,       TRUE,
  45.         WIN_X,  px,
  46.         WIN_Y,  py,
  47.         WIN_FONT, boldfont,
  48.         0);
  49.     if(fft_frame == NULL) {
  50.         system_mess_proc(1,"No more windows. Clean up some windows to make room.");
  51.         fft_panel_show = 0;
  52.         return;
  53.     }
  54.     /* Create Panel */
  55.     fft_panel = window_create(fft_frame, PANEL,
  56.         WIN_X, 0,
  57.         WIN_Y, 0,
  58.         WIN_FONT, boldfont,
  59.         0);
  60.     if(fft_panel == NULL) {
  61.         system_mess_proc(1,"No more windows. Clean up some windows to make room.");
  62.         (void) destroy_fft_windows();
  63.         return;
  64.     }
  65.     /* Create panel items */
  66.     fft_quit_item= panel_create_item(fft_panel, PANEL_BUTTON,
  67.         PANEL_LABEL_Y, ATTR_ROW(ipanel_row++),
  68.         PANEL_LABEL_X, ATTR_COL(0),
  69.         PANEL_LABEL_IMAGE, panel_button_image(fft_panel, "Quit", 5, boldfont),
  70.         PANEL_NOTIFY_PROC, fft_quit_proc,
  71.         0);
  72.     fft_go_item= panel_create_item(fft_panel, PANEL_BUTTON,
  73.         PANEL_LABEL_IMAGE, panel_button_image(fft_panel, "Go", 5, boldfont),
  74.         PANEL_NOTIFY_PROC, fft_go_proc,
  75.         0);
  76.     fft_show_item= panel_create_item(fft_panel, PANEL_BUTTON,
  77.         PANEL_LABEL_IMAGE, panel_button_image(fft_panel, "Show", 5, boldfont),
  78.         PANEL_NOTIFY_PROC, fft_show_proc,
  79.         0);
  80.     fft_algorithm_option_item= panel_create_item(fft_panel, PANEL_CYCLE,
  81.         PANEL_LABEL_Y, ATTR_ROW(ipanel_row++),
  82.         PANEL_LABEL_X, ATTR_COL(0),
  83.         PANEL_DISPLAY_LEVEL, PANEL_CURRENT,
  84.         PANEL_LABEL_STRING, "Algorithm: ",
  85.         PANEL_CHOICE_STRINGS,
  86.             "Danielson-Lanczos",
  87.             "User algorithm A",
  88.             "User algorithm B",
  89.             0,
  90.         PANEL_VALUE, fft_algorithm_option,
  91.         PANEL_NOTIFY_PROC, fft_algorithm_option_proc,
  92.         0);
  93.  
  94.     window_fit(fft_panel);
  95.     window_fit(fft_frame);
  96.  
  97.     if(panel_colormap_on)
  98.         init_panel_colormap((Pixwin *) window_get(fft_panel,WIN_PIXWIN),"fft_panel_cms");
  99. }
  100.