home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / endo / help.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-03  |  6.1 KB  |  143 lines

  1. /*************************************************************************
  2.  *                                                                       *
  3.  *  Copyright (c) 1992, 1993 Ronald Joe Record                           *
  4.  *                                                                       *
  5.  *  All rights reserved. No part of this program or publication may be   *
  6.  *  reproduced, transmitted, transcribed, stored in a retrieval system,  *
  7.  *  or translated into any language or computer language, in any form or *
  8.  *  by any means, electronic, mechanical, magnetic, optical, chemical,   *
  9.  *  biological, or otherwise, without the prior written permission of:   *
  10.  *                                                                       *
  11.  *      Ronald Joe Record (408) 458-3718                                 *
  12.  *      212 Owen St., Santa Cruz, California 95062 USA                   *
  13.  *                                                                       *
  14.  *************************************************************************/
  15.  
  16. #include "x.h"
  17.  
  18. #define x_str 10
  19.  
  20. void
  21. print_help() 
  22. {
  23.     static char str[80];
  24.     static int y_str, spacing;
  25.     static int ascent, descent, dir;
  26.     static XCharStruct overall;
  27.     static GC gc;
  28.     extern int numattrs;
  29.  
  30.     if (displayplanes > 1)
  31.         gc = Data_GC[CG];
  32.     else
  33.         gc = Data_GC[1];
  34.     XClearWindow(dpy, help);
  35.     init_color(dpy, help, cmap, Colors, STARTCOLOR, MINCOLINDEX, numcolors,
  36.                 numwheels, "endo", "Endo", numattrs);
  37.     y_str = 20;
  38.     sprintf(str,"During run-time, interactive control can be exerted via : ");
  39.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  40.     XQueryTextExtents(dpy,(XID)XGContextFromGC(gc),"Hey!",
  41.             4,&dir,&ascent,&descent,&overall);
  42.     spacing = ascent + descent + 5;
  43.     y_str += spacing;
  44.     sprintf(str,"    Left mouse button rubber-bands a zoom box");
  45.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  46.     y_str += spacing;
  47.     sprintf(str,"    Middle mouse button toggles trajectory display ");
  48.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  49.     y_str += spacing;
  50.     sprintf(str,"    Right mouse button displays a particular trajectory");
  51.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  52.     y_str += spacing;
  53.     sprintf(str,"    < halves the 'dwell', > doubles the 'dwell'");
  54.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  55.     y_str += spacing;
  56.     sprintf(str,"    [ halves the 'settle', ] doubles the 'settle'");
  57.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  58.     y_str += spacing;
  59.     sprintf(str,"    { halves the 'delta', } doubles the 'delta'");
  60.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  61.     y_str += spacing;
  62.     sprintf(str,"    - halves the 'cdelt', + doubles the 'cdelt'");
  63.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  64.     y_str += spacing;
  65.     sprintf(str,"    a toggles display of attractors rather than orbits");
  66.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  67.     y_str += spacing;
  68.     sprintf(str,"    c clears the orbit/attractor display window");
  69.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  70.     y_str += spacing;
  71.     sprintf(str,"    C toggles the critical curve window display");
  72.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  73.     y_str += spacing;
  74.     sprintf(str,"    D flushes the drawing buffer");
  75.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  76.     y_str += spacing;
  77.     sprintf(str,"    e or E recalculates color indices");
  78.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  79.     y_str += spacing;
  80.     sprintf(str,"    f toggles looking for periodicity");
  81.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  82.     y_str += spacing;
  83.     sprintf(str,"    F saves periods to a file");
  84.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  85.     y_str += spacing;
  86.     sprintf(str,"    G redraws the critical curves");
  87.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  88.     y_str += spacing;
  89.     sprintf(str,"    g iterates the selected critical arc");
  90.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  91.     y_str += spacing;
  92.     sprintf(str,"    h or H or ? displays this message");
  93.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  94.     y_str += spacing;
  95.     sprintf(str,"    i or I toggles display of the information window");
  96.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  97.     y_str += spacing;
  98.     sprintf(str,"    M decrements, m increments the map index used");
  99.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  100.     y_str += spacing;
  101.     sprintf(str,"    P toggles the trajectory display");
  102.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  103.     y_str += spacing;
  104.     sprintf(str,"    p toggles the basins of attraction display");
  105.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  106.     y_str += spacing;
  107.     sprintf(str,"    r redraws without recalculating");
  108.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  109.     y_str += spacing;
  110.     sprintf(str,"    R redraws, recalculating with new dwell and settle");
  111.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  112.     y_str += spacing;
  113.     sprintf(str,"    s or S spins the colorwheel");
  114.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  115.     y_str += spacing;
  116.     sprintf(str,"    t switches to alternate critical arc");
  117.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  118.     y_str += spacing;
  119.     sprintf(str,"    u pops back up to the last zoom");
  120.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  121.     y_str += spacing;
  122.     sprintf(str,"    U pops back up to the first picture");
  123.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  124.     y_str += spacing;
  125.     sprintf(str,"    v or V displays the values of various settings");
  126.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  127.     y_str += spacing;
  128.     sprintf(str,"    w decrements, W increments the color wheel index");
  129.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  130.     y_str += spacing;
  131.     sprintf(str,"    x clears the basins of attraction window");
  132.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  133.     y_str += spacing;
  134.     sprintf(str,"    z clears the critical curve window");
  135.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  136.     y_str += spacing;
  137.     sprintf(str,"    q or Q exits");
  138.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  139.     y_str += 2*spacing;
  140.     sprintf(str,"Press 'h', 'H', or '?' to unmap the help window");
  141.     XDrawImageString(dpy,help,gc,x_str,y_str,str,strlen(str));
  142. }
  143.