home *** CD-ROM | disk | FTP | other *** search
- #ifndef CPP_LAYOUTER_WINDOWS_H
- #define CPP_LAYOUTER_WINDOWS_H
-
- // Ein GadTools Fenster, das den Layouter unterstützt.
- //
- // Autor: Jochen Becher
- //
- // Historie:
- // Version 1.0 am 14. März 94
-
- #ifndef CPP_LAYOUTER_LAYOUTER_H
- #include <classes/layouter/layouter.h>
- #endif
-
- #ifndef CPP_LIBRARIES_GADTOOLS_H
- #include <classes/libraries/gadtools.h>
- #endif
-
- class LayouterWindowC;
-
- class LayouterSizeHandlerC : public WindowNewsizeHandlerC {
- public:
- LayouterSizeHandlerC(LayouterWindowC &w);
- VOID newsize();
- private:
- LayouterWindowC &window;
- };
-
- class LayouterVerifyHandlerC : public WindowSizeverifyHandlerC {
- public:
- LayouterVerifyHandlerC(LayouterWindowC &w);
- VOID verify();
- private:
- LayouterWindowC &window;
- };
-
- class LayouterMinsizeHandlerC : public WindowChangeHandlerC {
- public:
- LayouterMinsizeHandlerC(LayouterWindowC &);
- VOID activate(BOOL v) { active = v; };
- VOID change();
- private:
- LayouterWindowC &window;
- BOOL active;
- };
-
- class BorderTransparentGroupC : public TransparentGroupLayoutC {
- public:
- BorderTransparentGroupC();
- WORD innerTopBorder() const { return innerTop; };
- WORD innerBottomBorder() const { return innerBottom; };
- WORD innerLeftBorder() const { return innerLeft; };
- WORD innerRightBorder() const { return innerRight; };
- VOID setInnerTopBorder(WORD v) { innerTop = v; };
- VOID setInnerBottomBorder(WORD v) { innerBottom = v; };
- VOID setInnerLeftBorder(WORD v) { innerLeft = v; };
- VOID setInnerRightBorder(WORD v) { innerRight = v; };
- private:
- WORD innerTop;
- WORD innerBottom;
- WORD innerLeft;
- WORD innerRight;
- };
-
- class LayouterWindowC : public GTWindowC {
- friend class LayouterSizeHandlerC;
- friend class LayouterVerifyHandlerC;
- friend class LayouterMinsizeHandlerC;
- public:
- LayouterWindowC(GTIDCMPortC &, ScreenC &, TextAttrC &font,
- Tag tag1type, ...);
- LayouterWindowC(GTIDCMPortC &, ScreenC &, TextAttrC &font,
- struct TagItem *tags = NULL);
- BOOL isValid();
- TextAttrC *font() const { return (TextAttrC *) guiFont; };
- TextAttrC *titlefont() const { return (TextAttrC *) titleFont; };
- VisualInfoC *visualInfo() const { return (VisualInfoC *) &vinfo; };
- ScreenC *screen() const { return (ScreenC *) wScreen; };
- virtual VOID setFallbackFonts(TextAttrC *font, TextAttrC *titlefont = NULL);
- VOID open(Tag tag1type, ...) throw (WindowX, MemoryX)
- { LayouterWindowC::open((struct TagItem *) &tag1type); };
- VOID open(struct TagItem *tags = NULL) throw (WindowX, MemoryX);
- virtual BOOL changeFont(TextAttrC *font, TextAttrC *titlefont = NULL,
- BOOL avoidResize = TRUE);
- virtual BOOL reLayout(BOOL avoidResize = TRUE);
- protected:
- virtual VOID setTextAttrs(TextAttrC *gui, TextAttrC *title);
- private:
- RootGeometryC root;
- TransparentGroupLayoutC innerL;
- BorderTransparentGroupC leftL, rightL, topL, bottomL;
- TransparentLayoutC sizeTop, sizeBottom, sizeLeft, sizeRight;
- GeometryC sizeTopGeo, sizeBottomGeo, sizeLeftGeo, sizeRightGeo;
- protected:
- GeometryGroupC innerGeo;
- GeometryGroupC leftGeo,rightGeo,topGeo,bottomGeo;
- private:
- VisualInfoC vinfo;
- ScreenC *wScreen;
- protected:
- RootGadgetListC gadgets;
- AnchorGadgetListC titlegadgets;
- GTGadgetListC gtgadgets;
- private:
- BOOL setFonts(TextAttrC *font, TextAttrC *titlefont, BOOL avoidResize);
- TextAttrC *guiFont;
- TextAttrC *guiFallback;
- TextAttrC *titleFont;
- TextAttrC *titleFallback;
- GTWindowRefreshHandlerChainC refreshhandler;
- LayouterSizeHandlerC sizehandler;
- LayouterVerifyHandlerC verifyhandler;
- LayouterMinsizeHandlerC minsizehandler;
- BOOL maxWSet, maxHSet;
- };
-
- class LayouterWindowListC : public WindowListC {
- public:
- LayouterWindowListC();
- VOID add(LayouterWindowC &);
- VOID setFallbackFonts(TextAttrC *font, TextAttrC *titlefont = NULL);
- BOOL changeFont(TextAttrC *font, TextAttrC *titlefont = NULL,
- BOOL avoidResize = TRUE);
- };
-
- class StandardWindowC : public LayouterWindowC {
- public:
- StandardWindowC(GTIDCMPortC &, ScreenC &, GadgetC *defaultGadget,
- Tag tag1type, ...);
- StandardWindowC(GTIDCMPortC &, ScreenC &, GadgetC *defaultGadget = NULL,
- struct TagItem *tags = NULL);
- VOID open(Tag tag1type, ...) throw (WindowX, MemoryX)
- { StandardWindowC::open((struct TagItem *) &tag1type); };
- VOID open(struct TagItem *tags = NULL) throw (WindowX, MemoryX);
- VOID setFallbackFonts(TextAttrC *font, TextAttrC *titlefont = NULL);
- VOID setTextAttrs(TextAttrC *font, TextAttrC *titlefont);
- BOOL changeFont(TextAttrC *font, TextAttrC *titlefont = NULL,
- BOOL avoidResize = TRUE);
- TextAttrC *boldFont() const { return (TextAttrC *) &bold; };
- private:
- LTextAttrC defaultF;
- LTextAttrC *textF;
- LTextAttrC *titleF;
- LTextAttrC *textFB;
- LTextAttrC *titleFB;
- FLTextAttrC bold;
- GadgetC *defgadget;
- BOOL firstOpened;
- };
-
- #endif
-