home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / Jim's CDEFs v1.30 / demo Source ƒ / demoDialog.h < prev    next >
Encoding:
Text File  |  1994-11-06  |  2.5 KB  |  103 lines  |  [TEXT/KAHL]

  1. // -----------------------------------------------------------------------------
  2. //    File        : demoDialog.h
  3. //    Date        : August 24, 1994
  4. //    Author        : Jim Stout
  5. //    Purpose        : header file for demoDialog.c
  6. //
  7. // -----------------------------------------------------------------------------
  8. #define MAXFONTSIZES 5
  9. #define TABCNTL 3            // the DITL item number for the tabPanel CDEF
  10. #define STDCTLS 4            // OK, Cancel, Tab Control, Disable on all panels
  11.  
  12. // the types of panels we demo
  13.  
  14. enum {
  15.     BUTTONS = 1,
  16.     POPUPS,
  17.     SPINNERS,
  18.     DATETIME,
  19.     HSLIDERS,
  20.     VSLIDERS,
  21.     PROGBARS,
  22.     POPUPEXT
  23. };
  24.  
  25. enum {                            // controls on the BUTTONS panel
  26.     DISABLE = STDCTLS,
  27.     CB1,
  28.     CB2,
  29.     CB3,
  30.     CB4,
  31.     RB1,
  32.     RB2,
  33.     RB3,
  34.     RB4,
  35.     TB1,
  36.     TB2,
  37.     TB3,
  38.     TB4,
  39.     PB1,
  40.     PB2,
  41.     FONTPOP,
  42.     ST1,
  43.     EDITSIZE,
  44.     SIZEPOP,
  45.     SETFONT
  46. };
  47. enum {                            // controls on the SPINNERS panel
  48.     SPIN1 = STDCTLS+1,
  49.     SPIN2,
  50.     SPIN3,
  51.     SPIN4,
  52.     SPIN5,
  53.     SPIN6,
  54.     SPIN7,
  55.     SPIN8,
  56.     EDITSPIN,
  57.     FRACTSPIN
  58. };
  59.  
  60. #define RESET       STDCTLS+14    // on DATETIME panel
  61.  
  62.  
  63. #define HSLIDER3   STDCTLS+3    // items on the HSLIDER panel
  64. #define HSLIDERVAL STDCTLS+6
  65.  
  66. #define VSLIDER5   STDCTLS+5    // items on the VSLIDER panel
  67. #define VSLIDERVAL STDCTLS+7
  68.  
  69. #define PROG9 STDCTLS+9            // controls on the PROGBARS panel
  70. #define SPIN10 STDCTLS+10
  71.  
  72. // -----------------------------------------------------------------------------
  73. // public routines
  74. // -----------------------------------------------------------------------------
  75.  
  76. extern void            demoDialog        (void);
  77. extern void            comparePopup    (void);
  78.  
  79. // -----------------------------------------------------------------------------
  80. // local routines
  81. // -----------------------------------------------------------------------------
  82.  
  83. static void            processPanel    (DialogPtr theDialog, short currPanel, 
  84.                                         short itemHit);
  85. static void            savePanel        (DialogPtr theDialog, short toPanel);
  86. static void            restorePanel    (DialogPtr theDialog, short toPanel);
  87.  
  88. static pascal char    filter            (DialogPtr theDialog, EventRecord *theEvent, 
  89.                                         short *theItem);
  90. static pascal void    trackSpin        (ControlHandle c, short p);
  91. static pascal void    trackSlider        (ControlHandle c, short p);
  92. static pascal void    fractSpin        (ControlHandle c, short p);
  93.  
  94. static void         setNewFont        (DialogPtr theDialog);
  95.  
  96. static void         changeFont        (DialogPtr theDialog, short newFont, 
  97.                                         long newSize);
  98. static void            adjustSizePopup    (DialogPtr theDialog, long newSize);
  99.  
  100. static short        findSystemFont    (DialogPtr theDialog);
  101.  
  102. static pascal char    filterCompare    (DialogPtr theDialog, EventRecord *theEvent, 
  103.                                         short *theItem);