home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmiSoft / Dev / Gui / Cit.lha / CIT / citra / CITNumberSlider.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-02-14  |  3.5 KB  |  105 lines

  1. //
  2. //                    CITNumberSlider include
  3. //
  4. //                          StormC
  5. //
  6. //                     version 2003.02.13
  7. //
  8.  
  9. #ifndef CITNUMBERSLIDER_H
  10. #define CITNUMBERSLIDER_H TRUE
  11.  
  12. #include "CITGroup.h"
  13. #include "CITText.h"
  14. #include "CITSlider.h"
  15.  
  16. // Text position values
  17. #define NSP_LEFT   0
  18. #define NSP_RIGHT  1
  19. #define NSP_ABOVE  2
  20. #define NSP_BELOW  3
  21.  
  22. //
  23. // CITNumSlider for internal use only
  24. //
  25. class CITNumSlider:public CITSlider
  26. {
  27.   protected:
  28.     virtual BOOL Create(CITWindow* CITWd,CITContainer* parent);
  29. };
  30.  
  31. class CITNumberSlider:public CITHGroup
  32. {
  33.   public:
  34.     CITNumberSlider();
  35.     ~CITNumberSlider();
  36.  
  37.     void Text(char* text,UWORD textLen=0);
  38.  
  39.     // Redirection of CITGadget methods
  40.     void TextPosition(UWORD pos) { textPos = pos;}
  41.     void Disabled(BOOL b = TRUE) { numSlider.Disabled(b); }
  42.     void Selected(BOOL b = TRUE) { numSlider.Selected(b); }
  43.     void Activate() { numSlider.Activate(); }
  44.     void RelVerify(BOOL b = TRUE) { numSlider.RelVerify(b); }
  45.     void FollowMouse(BOOL b = TRUE) { numSlider.FollowMouse(b); }
  46.     void TabCycle(BOOL b = TRUE) { numSlider.TabCycle(b); }
  47.     void GadgetHelp(BOOL b = TRUE) { numSlider.GadgetHelp(b); }
  48.     void ReadOnly(BOOL b = TRUE) { numSlider.ReadOnly(b); }
  49.     void Underscore(char c) { numSlider.Underscore(c); }
  50.  
  51.     void LabelFont(struct TextAttr* attr) { numSlider.LabelFont(attr); }
  52.     void LabelForegroundPen(LONG pen) { numSlider.LabelForegroundPen(pen); }
  53.     void LabelBackgroundPen(LONG pen) { numSlider.LabelBackgroundPen(pen); }
  54.     void LabelMode(UBYTE mode) { numSlider.LabelMode(mode); }
  55.     void LabelSoftStyle(UBYTE style) { numSlider.LabelSoftStyle(style); }
  56.     void LabelJustification(UWORD pos) { numSlider.LabelJustification(pos); }
  57.     void LabelText(char* text) { numSlider.LabelText(text); }
  58.     void Id(ULONG GadgetID) { numSlider.Id(GadgetID); }
  59.     
  60.     // Redirection of CITSlider methods
  61.     void Orientation(WORD orien) { numSlider.Orientation(orien); }
  62.     void Ticks(LONG ticks) { numSlider.Ticks(ticks); }
  63.     void ShortTicks(BOOL b = TRUE) { numSlider.ShortTicks(b); }
  64.     void TickSize(WORD tSize) { numSlider.TickSize(tSize); }
  65.     void KnobImage(struct Image* im) { numSlider.KnobImage(im); }
  66.     void BodyFill(WORD bFill) { numSlider.BodyFill(bFill); }
  67.     void BodyImage(struct Image* im) { numSlider.BodyImage(im); }
  68.     void Gradient(BOOL b = TRUE) { numSlider.Gradient(b); }
  69.     void PenArray(UWORD pen) { numSlider.PenArray(pen); }
  70.     void Invert(BOOL b = TRUE) { numSlider.Invert(b); }
  71.     void KnobDelta(WORD kDelta) { numSlider.KnobDelta(kDelta); }
  72.  
  73.     void EventHandler(void (*p)(ULONG Id,ULONG eventFlag),ULONG eventType=IDCMP_GADGETUP)
  74.       { numSlider.EventHandler(p,eventType); }
  75.     void EventHandler(void *that, void *p,ULONG eventType=IDCMP_GADGETUP)
  76.       { numSlider.EventHandler(that,p,eventType); }
  77.     void CallbackHook(ULONG (*p)(APTR,APTR,ULONG),ULONG userData)
  78.       { numSlider.CallbackHook(p,userData); }
  79.     void CallbackHook(void *that, void *p,ULONG userData)
  80.       { numSlider.CallbackHook(that,p,userData); }
  81.    
  82.   protected:
  83.     virtual BOOL Create(CITWindow* CITWd,CITContainer* parent);
  84.     virtual void Delete();
  85.     virtual void HandleEvent(UWORD id,ULONG eventType,UWORD code);
  86.     virtual void HandleIDCMPHook(IntuiMessage* intuiMsg);
  87.  
  88.     virtual void printValue(WORD level);
  89.     
  90.     CITNumSlider numSlider;
  91.     CITText      numText;
  92.     UWORD        textPos;
  93.     
  94.     char formatStr[128];
  95.     char outputStr[128];
  96.  
  97. };
  98.  
  99. enum
  100. {
  101.   MUMBERSLIDERCLASS_FLAGBITUSED = SLIDERCLASS_FLAGBITUSED
  102. };
  103.  
  104. #endif
  105.