home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC7.DMS / in.adf / classes.lha / Classes / BOOPSI / gadgetclass.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-31  |  8.1 KB  |  187 lines

  1. #ifndef CPP_BOOPSI_GADGETCLASS_H
  2. #define CPP_BOOPSI_GADGETCLASS_H
  3.  
  4. // Klasseninterface für die BOOPSI Gadget Klassen
  5. //
  6. // Autor: Jochen Becher
  7. //
  8. // Historie:
  9. // Version 1.0 am 26. Februar 94
  10.  
  11. #ifndef INTUITION_GADGETCLASS_H
  12. #include <intuition/gadgetclass.h>
  13. #endif
  14.  
  15. #ifndef CPP_BOOPSI_ROOTCLASS_H
  16. #include <classes/boopsi/rootclass.h>
  17. #endif
  18.  
  19. #ifndef CPP_INTUITION_WINDOW_H
  20. #include <classes/intuition/window.h>
  21. #endif
  22.  
  23. #ifndef CPP_INTUITION_GADGETS_H
  24. #include <classes/intuition/gadgets.h>
  25. #endif
  26.  
  27. class BGadgetC : public BoopsiRootC, public GadgetC {
  28. public:
  29.     WindowC *window() const { return bWindow; };
  30.     VOID setAttrs(Tag tag1type, ...);
  31.     VOID setAttrs(struct TagItem *);
  32.     struct Gadget *rebuild(struct Gadget *prev);
  33.     VOID setLeft(WORD left) { setAttrs(GA_Left,left,TAG_END); };
  34.     VOID setTop(WORD top) { setAttrs(GA_Top,top,TAG_END); };
  35.     VOID setWidth(WORD width) { setAttrs(GA_Width,width,TAG_END); };
  36.     VOID setHeight(WORD height) { setAttrs(GA_Height,height,TAG_END); };
  37.     WORD left() const { return GadgetC::left(); };
  38.     WORD top() const { return GadgetC::top(); };
  39.     WORD width() const { return GadgetC::width(); };
  40.     WORD height() const { return GadgetC::height(); };
  41.     WORD leftBorder() const { return GadgetC::leftBorder(); };
  42.     WORD topBorder() const { return GadgetC::topBorder(); };
  43.     WORD rightBorder() const { return GadgetC::rightBorder(); };
  44.     WORD bottomBorder() const { return GadgetC::bottomBorder(); };
  45.     BOOL disable(BOOL value);
  46.     BOOL isDisabled() const;
  47.     BOOL activate(BOOL value) { return GadgetC::activate(value); };
  48.     ULONG idcmp() const { return GadgetC::idcmp(); };
  49.     VOID setTextAttr(const TextAttrC *t) { GadgetC::setTextAttr(t); };
  50.     VOID setDefTextAttr(const TextAttrC *t) { GadgetC::setDefTextAttr(t); };
  51.     TextAttrC *textAttr() const { return GadgetC::textAttr(); };
  52. protected:
  53.     BGadgetC(GadgetEventC *, struct IClass *, STRPTR pubclass,
  54.         WindowC &, struct TagItem *);
  55.     BGadgetC(GadgetEventC *, struct IClass *, STRPTR pubclass,
  56.         WindowC &, Tag tag1type, ...);
  57.     WindowC *bWindow;
  58. };
  59.  
  60. class BScrollerC : public BGadgetC, public GScrollerC {
  61. public:
  62.     BScrollerC(GadgetEventC *ev, WindowC &w, Tag tag1type, ...)
  63.         : BGadgetC(ev,NULL,PROPGCLASS,w,(struct TagItem *) &tag1type),
  64.           GScrollerC() { };
  65.     BScrollerC(GadgetEventC *ev, WindowC &w, struct TagItem *tags)
  66.         : BGadgetC(ev,NULL,PROPGCLASS,w,tags), GScrollerC() { };
  67.     struct Gadget *rebuild(struct Gadget *prev) { return BGadgetC::rebuild(prev); };
  68.     VOID erase(WindowC *w) { BGadgetC::erase(w); };
  69.     VOID refresh(WindowC *w) { BGadgetC::refresh(w); };
  70.     VOID setLeft(WORD left) { BGadgetC::setLeft(left); };
  71.     VOID setTop(WORD top) { BGadgetC::setTop(top); };
  72.     VOID setWidth(WORD width) { BGadgetC::setWidth(width); };
  73.     VOID setHeight(WORD height) { BGadgetC::setHeight(height); };
  74.     WORD left() const { return BGadgetC::left(); };
  75.     WORD top() const { return BGadgetC::top(); };
  76.     WORD width() const { return BGadgetC::width(); };
  77.     WORD height() const { return BGadgetC::height(); };
  78.     WORD leftBorder() const { return BGadgetC::leftBorder(); };
  79.     WORD topBorder() const { return BGadgetC::topBorder(); };
  80.     WORD rightBorder() const { return BGadgetC::rightBorder(); };
  81.     WORD bottomBorder() const { return BGadgetC::bottomBorder(); };
  82.     BOOL disable(BOOL value) { return BGadgetC::disable(value); };
  83.     BOOL isDisabled() const { return BGadgetC::isDisabled(); };
  84.     BOOL activate(BOOL value) { return BGadgetC::activate(value); };
  85.     ULONG idcmp() const { return 0; };
  86.     VOID setTextAttr(const TextAttrC *t) { BGadgetC::setTextAttr(t); };
  87.     VOID setDefTextAttr(const TextAttrC *t) { BGadgetC::setDefTextAttr(t); };
  88.     TextAttrC *textAttr() const { return BGadgetC::textAttr(); };
  89.     VOID setPot(UWORD p) { setAttrs(PGA_Top,p,TAG_END); };
  90.     VOID setTotal(UWORD t) { setAttrs(PGA_Total,t,TAG_END); };
  91.     VOID setVisible(UWORD v) { setAttrs(PGA_Visible,v,TAG_END); };
  92.     UWORD pot() { return getAttr(PGA_Top); };
  93.     UWORD total() { return getAttr(PGA_Total); };
  94.     UWORD visible() { return getAttr(PGA_Visible); };
  95. protected:
  96.     BScrollerC(GadgetEventC *ev, struct IClass *c, STRPTR pubclass,
  97.         WindowC &w, struct TagItem *tags)
  98.         : BGadgetC(ev,NULL,pubclass,w,tags), GScrollerC() { };
  99. };
  100.  
  101. class BStrC : public BGadgetC, public GStringC {
  102. public:
  103.     BStrC(GadgetEventC *ev, WindowC &w, Tag tag1type, ...)
  104.         : BGadgetC(ev,NULL,STRGCLASS,w,(struct TagItem *) &tag1type),
  105.           GStringC() { };
  106.     BStrC(GadgetEventC *ev, WindowC &w,struct TagItem *tags)
  107.         : BGadgetC(ev,NULL,STRGCLASS,w,tags), GStringC() { };
  108.     struct Gadget *rebuild(struct Gadget *prev) { return BGadgetC::rebuild(prev); };
  109.     VOID erase(WindowC *w) { BGadgetC::erase(w); };
  110.     VOID refresh(WindowC *w) { BGadgetC::refresh(w); };
  111.     VOID setLeft(WORD left) { BGadgetC::setLeft(left); };
  112.     VOID setTop(WORD top) { BGadgetC::setTop(top); };
  113.     VOID setWidth(WORD width) { BGadgetC::setWidth(width); };
  114.     VOID setHeight(WORD height) { BGadgetC::setHeight(height); };
  115.     WORD left() const { return BGadgetC::left(); };
  116.     WORD top() const { return BGadgetC::top(); };
  117.     WORD width() const { return BGadgetC::width(); };
  118.     WORD height() const { return BGadgetC::height(); };
  119.     WORD leftBorder() const { return BGadgetC::leftBorder(); };
  120.     WORD topBorder() const { return BGadgetC::topBorder(); };
  121.     WORD rightBorder() const { return BGadgetC::rightBorder(); };
  122.     WORD bottomBorder() const { return BGadgetC::bottomBorder(); };
  123.     BOOL disable(BOOL value) { return BGadgetC::disable(value); };
  124.     BOOL isDisabled() const { return BGadgetC::isDisabled(); };
  125.     BOOL activate(BOOL value) { return BGadgetC::activate(value); };
  126.     ULONG idcmp() const { return 0; };
  127.     VOID setTextAttr(const TextAttrC *t) { BGadgetC::setTextAttr(t); };
  128.     VOID setDefTextAttr(const TextAttrC *t) { BGadgetC::setDefTextAttr(t); };
  129.     TextAttrC *textAttr() const { return BGadgetC::textAttr(); };
  130.     VOID set(STRPTR s) { setAttrs(STRINGA_TextVal,s,TAG_END); };
  131.     STRPTR get() { return (STRPTR) getAttr(STRINGA_TextVal); };
  132. protected:
  133.     BStrC(GadgetEventC *ev, struct IClass *c, STRPTR pubclass,
  134.         WindowC &w, struct TagItem *tags)
  135.         : BGadgetC(ev,NULL,pubclass,w,tags), GStringC() { };
  136. };
  137.  
  138. class BButtonC : public BGadgetC, public GButtonC {
  139. public:
  140.     BButtonC(GadgetEventC *ev, WindowC &w, Tag tag1type, ...)
  141.         : BGadgetC(ev,NULL,BUTTONGCLASS,w,(struct TagItem *) &tag1type),
  142.           GButtonC() { };
  143.     BButtonC(GadgetEventC *ev, WindowC &w,struct TagItem *tags)
  144.         : BGadgetC(ev,NULL,BUTTONGCLASS,w,tags), GButtonC() { };
  145.     struct Gadget *rebuild(struct Gadget *prev) { return BGadgetC::rebuild(prev); };
  146.     VOID erase(WindowC *w) { BGadgetC::erase(w); };
  147.     VOID refresh(WindowC *w) { BGadgetC::refresh(w); };
  148.     VOID setLeft(WORD left) { BGadgetC::setLeft(left); };
  149.     VOID setTop(WORD top) { BGadgetC::setTop(top); };
  150.     VOID setWidth(WORD width) { BGadgetC::setWidth(width); };
  151.     VOID setHeight(WORD height) { BGadgetC::setHeight(height); };
  152.     WORD left() const { return BGadgetC::left(); };
  153.     WORD top() const { return BGadgetC::top(); };
  154.     WORD width() const { return BGadgetC::width(); };
  155.     WORD height() const { return BGadgetC::height(); };
  156.     WORD leftBorder() const { return BGadgetC::leftBorder(); };
  157.     WORD topBorder() const { return BGadgetC::topBorder(); };
  158.     WORD rightBorder() const { return BGadgetC::rightBorder(); };
  159.     WORD bottomBorder() const { return BGadgetC::bottomBorder(); };
  160.     BOOL disable(BOOL value) { return BGadgetC::disable(value); };
  161.     BOOL isDisabled() const { return BGadgetC::isDisabled(); };
  162.     BOOL activate(BOOL value) { return BGadgetC::activate(value); };
  163.     ULONG idcmp() const { return 0; };
  164.     VOID setTextAttr(const TextAttrC *t) { BGadgetC::setTextAttr(t); };
  165.     VOID setDefTextAttr(const TextAttrC *t) { BGadgetC::setDefTextAttr(t); };
  166.     TextAttrC *textAttr() const { return BGadgetC::textAttr(); };
  167. protected:
  168.     BButtonC(GadgetEventC *ev, struct IClass *c, STRPTR pubclass,
  169.         WindowC &w, struct TagItem *tags)
  170.         : BGadgetC(ev,NULL,pubclass,w,tags), GButtonC() { };
  171. };
  172.  
  173. class BFrbuttonC : public BButtonC {
  174. public:
  175.     BFrbuttonC(GadgetEventC *ev, WindowC &w, Tag tag1type, ...)
  176.         : BButtonC(ev,NULL,FRBUTTONCLASS,w,(struct TagItem *) &tag1type)
  177.             { };
  178.     BFrbuttonC(GadgetEventC *ev, WindowC &w,struct TagItem *tags)
  179.         : BButtonC(ev,NULL,FRBUTTONCLASS,w,tags) { };
  180. protected:
  181.     BFrbuttonC(GadgetEventC *ev, struct IClass *c, STRPTR pubclass,
  182.         WindowC &w, struct TagItem *tags)
  183.         : BButtonC(ev,NULL,pubclass,w,tags) { };
  184. };
  185.  
  186. #endif
  187.