home *** CD-ROM | disk | FTP | other *** search
- #ifndef CPP_BOOPSI_GADGETCLASS_H
- #define CPP_BOOPSI_GADGETCLASS_H
-
- // Klasseninterface für die BOOPSI Gadget Klassen
- //
- // Autor: Jochen Becher
- //
- // Historie:
- // Version 1.0 am 26. Februar 94
-
- #ifndef INTUITION_GADGETCLASS_H
- #include <intuition/gadgetclass.h>
- #endif
-
- #ifndef CPP_BOOPSI_ROOTCLASS_H
- #include <classes/boopsi/rootclass.h>
- #endif
-
- #ifndef CPP_INTUITION_WINDOW_H
- #include <classes/intuition/window.h>
- #endif
-
- #ifndef CPP_INTUITION_GADGETS_H
- #include <classes/intuition/gadgets.h>
- #endif
-
- class BGadgetC : public BoopsiRootC, public GadgetC {
- public:
- WindowC *window() const { return bWindow; };
- VOID setAttrs(Tag tag1type, ...);
- VOID setAttrs(struct TagItem *);
- struct Gadget *rebuild(struct Gadget *prev);
- VOID setLeft(WORD left) { setAttrs(GA_Left,left,TAG_END); };
- VOID setTop(WORD top) { setAttrs(GA_Top,top,TAG_END); };
- VOID setWidth(WORD width) { setAttrs(GA_Width,width,TAG_END); };
- VOID setHeight(WORD height) { setAttrs(GA_Height,height,TAG_END); };
- WORD left() const { return GadgetC::left(); };
- WORD top() const { return GadgetC::top(); };
- WORD width() const { return GadgetC::width(); };
- WORD height() const { return GadgetC::height(); };
- WORD leftBorder() const { return GadgetC::leftBorder(); };
- WORD topBorder() const { return GadgetC::topBorder(); };
- WORD rightBorder() const { return GadgetC::rightBorder(); };
- WORD bottomBorder() const { return GadgetC::bottomBorder(); };
- BOOL disable(BOOL value);
- BOOL isDisabled() const;
- BOOL activate(BOOL value) { return GadgetC::activate(value); };
- ULONG idcmp() const { return GadgetC::idcmp(); };
- VOID setTextAttr(const TextAttrC *t) { GadgetC::setTextAttr(t); };
- VOID setDefTextAttr(const TextAttrC *t) { GadgetC::setDefTextAttr(t); };
- TextAttrC *textAttr() const { return GadgetC::textAttr(); };
- protected:
- BGadgetC(GadgetEventC *, struct IClass *, STRPTR pubclass,
- WindowC &, struct TagItem *);
- BGadgetC(GadgetEventC *, struct IClass *, STRPTR pubclass,
- WindowC &, Tag tag1type, ...);
- WindowC *bWindow;
- };
-
- class BScrollerC : public BGadgetC, public GScrollerC {
- public:
- BScrollerC(GadgetEventC *ev, WindowC &w, Tag tag1type, ...)
- : BGadgetC(ev,NULL,PROPGCLASS,w,(struct TagItem *) &tag1type),
- GScrollerC() { };
- BScrollerC(GadgetEventC *ev, WindowC &w, struct TagItem *tags)
- : BGadgetC(ev,NULL,PROPGCLASS,w,tags), GScrollerC() { };
- struct Gadget *rebuild(struct Gadget *prev) { return BGadgetC::rebuild(prev); };
- VOID erase(WindowC *w) { BGadgetC::erase(w); };
- VOID refresh(WindowC *w) { BGadgetC::refresh(w); };
- VOID setLeft(WORD left) { BGadgetC::setLeft(left); };
- VOID setTop(WORD top) { BGadgetC::setTop(top); };
- VOID setWidth(WORD width) { BGadgetC::setWidth(width); };
- VOID setHeight(WORD height) { BGadgetC::setHeight(height); };
- WORD left() const { return BGadgetC::left(); };
- WORD top() const { return BGadgetC::top(); };
- WORD width() const { return BGadgetC::width(); };
- WORD height() const { return BGadgetC::height(); };
- WORD leftBorder() const { return BGadgetC::leftBorder(); };
- WORD topBorder() const { return BGadgetC::topBorder(); };
- WORD rightBorder() const { return BGadgetC::rightBorder(); };
- WORD bottomBorder() const { return BGadgetC::bottomBorder(); };
- BOOL disable(BOOL value) { return BGadgetC::disable(value); };
- BOOL isDisabled() const { return BGadgetC::isDisabled(); };
- BOOL activate(BOOL value) { return BGadgetC::activate(value); };
- ULONG idcmp() const { return 0; };
- VOID setTextAttr(const TextAttrC *t) { BGadgetC::setTextAttr(t); };
- VOID setDefTextAttr(const TextAttrC *t) { BGadgetC::setDefTextAttr(t); };
- TextAttrC *textAttr() const { return BGadgetC::textAttr(); };
- VOID setPot(UWORD p) { setAttrs(PGA_Top,p,TAG_END); };
- VOID setTotal(UWORD t) { setAttrs(PGA_Total,t,TAG_END); };
- VOID setVisible(UWORD v) { setAttrs(PGA_Visible,v,TAG_END); };
- UWORD pot() { return getAttr(PGA_Top); };
- UWORD total() { return getAttr(PGA_Total); };
- UWORD visible() { return getAttr(PGA_Visible); };
- protected:
- BScrollerC(GadgetEventC *ev, struct IClass *c, STRPTR pubclass,
- WindowC &w, struct TagItem *tags)
- : BGadgetC(ev,NULL,pubclass,w,tags), GScrollerC() { };
- };
-
- class BStrC : public BGadgetC, public GStringC {
- public:
- BStrC(GadgetEventC *ev, WindowC &w, Tag tag1type, ...)
- : BGadgetC(ev,NULL,STRGCLASS,w,(struct TagItem *) &tag1type),
- GStringC() { };
- BStrC(GadgetEventC *ev, WindowC &w,struct TagItem *tags)
- : BGadgetC(ev,NULL,STRGCLASS,w,tags), GStringC() { };
- struct Gadget *rebuild(struct Gadget *prev) { return BGadgetC::rebuild(prev); };
- VOID erase(WindowC *w) { BGadgetC::erase(w); };
- VOID refresh(WindowC *w) { BGadgetC::refresh(w); };
- VOID setLeft(WORD left) { BGadgetC::setLeft(left); };
- VOID setTop(WORD top) { BGadgetC::setTop(top); };
- VOID setWidth(WORD width) { BGadgetC::setWidth(width); };
- VOID setHeight(WORD height) { BGadgetC::setHeight(height); };
- WORD left() const { return BGadgetC::left(); };
- WORD top() const { return BGadgetC::top(); };
- WORD width() const { return BGadgetC::width(); };
- WORD height() const { return BGadgetC::height(); };
- WORD leftBorder() const { return BGadgetC::leftBorder(); };
- WORD topBorder() const { return BGadgetC::topBorder(); };
- WORD rightBorder() const { return BGadgetC::rightBorder(); };
- WORD bottomBorder() const { return BGadgetC::bottomBorder(); };
- BOOL disable(BOOL value) { return BGadgetC::disable(value); };
- BOOL isDisabled() const { return BGadgetC::isDisabled(); };
- BOOL activate(BOOL value) { return BGadgetC::activate(value); };
- ULONG idcmp() const { return 0; };
- VOID setTextAttr(const TextAttrC *t) { BGadgetC::setTextAttr(t); };
- VOID setDefTextAttr(const TextAttrC *t) { BGadgetC::setDefTextAttr(t); };
- TextAttrC *textAttr() const { return BGadgetC::textAttr(); };
- VOID set(STRPTR s) { setAttrs(STRINGA_TextVal,s,TAG_END); };
- STRPTR get() { return (STRPTR) getAttr(STRINGA_TextVal); };
- protected:
- BStrC(GadgetEventC *ev, struct IClass *c, STRPTR pubclass,
- WindowC &w, struct TagItem *tags)
- : BGadgetC(ev,NULL,pubclass,w,tags), GStringC() { };
- };
-
- class BButtonC : public BGadgetC, public GButtonC {
- public:
- BButtonC(GadgetEventC *ev, WindowC &w, Tag tag1type, ...)
- : BGadgetC(ev,NULL,BUTTONGCLASS,w,(struct TagItem *) &tag1type),
- GButtonC() { };
- BButtonC(GadgetEventC *ev, WindowC &w,struct TagItem *tags)
- : BGadgetC(ev,NULL,BUTTONGCLASS,w,tags), GButtonC() { };
- struct Gadget *rebuild(struct Gadget *prev) { return BGadgetC::rebuild(prev); };
- VOID erase(WindowC *w) { BGadgetC::erase(w); };
- VOID refresh(WindowC *w) { BGadgetC::refresh(w); };
- VOID setLeft(WORD left) { BGadgetC::setLeft(left); };
- VOID setTop(WORD top) { BGadgetC::setTop(top); };
- VOID setWidth(WORD width) { BGadgetC::setWidth(width); };
- VOID setHeight(WORD height) { BGadgetC::setHeight(height); };
- WORD left() const { return BGadgetC::left(); };
- WORD top() const { return BGadgetC::top(); };
- WORD width() const { return BGadgetC::width(); };
- WORD height() const { return BGadgetC::height(); };
- WORD leftBorder() const { return BGadgetC::leftBorder(); };
- WORD topBorder() const { return BGadgetC::topBorder(); };
- WORD rightBorder() const { return BGadgetC::rightBorder(); };
- WORD bottomBorder() const { return BGadgetC::bottomBorder(); };
- BOOL disable(BOOL value) { return BGadgetC::disable(value); };
- BOOL isDisabled() const { return BGadgetC::isDisabled(); };
- BOOL activate(BOOL value) { return BGadgetC::activate(value); };
- ULONG idcmp() const { return 0; };
- VOID setTextAttr(const TextAttrC *t) { BGadgetC::setTextAttr(t); };
- VOID setDefTextAttr(const TextAttrC *t) { BGadgetC::setDefTextAttr(t); };
- TextAttrC *textAttr() const { return BGadgetC::textAttr(); };
- protected:
- BButtonC(GadgetEventC *ev, struct IClass *c, STRPTR pubclass,
- WindowC &w, struct TagItem *tags)
- : BGadgetC(ev,NULL,pubclass,w,tags), GButtonC() { };
- };
-
- class BFrbuttonC : public BButtonC {
- public:
- BFrbuttonC(GadgetEventC *ev, WindowC &w, Tag tag1type, ...)
- : BButtonC(ev,NULL,FRBUTTONCLASS,w,(struct TagItem *) &tag1type)
- { };
- BFrbuttonC(GadgetEventC *ev, WindowC &w,struct TagItem *tags)
- : BButtonC(ev,NULL,FRBUTTONCLASS,w,tags) { };
- protected:
- BFrbuttonC(GadgetEventC *ev, struct IClass *c, STRPTR pubclass,
- WindowC &w, struct TagItem *tags)
- : BButtonC(ev,NULL,pubclass,w,tags) { };
- };
-
- #endif
-