home *** CD-ROM | disk | FTP | other *** search
-
- #include <classes/Layouter/BoopsiGadgets.h>
-
- LBButtonC::LBButtonC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BButtonC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGButtonC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBButtonC::LBButtonC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BButtonC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGButtonC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBButtonC::layoutWidth()
- {
- return FALSE;
- }
-
- BOOL LBButtonC::layoutHeight()
- {
- return FALSE;
- }
-
- VOID LBButtonC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBButtonC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBFrButtonC::LBFrButtonC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BFrbuttonC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGButtonC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBFrButtonC::LBFrButtonC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BFrbuttonC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGButtonC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBFrButtonC::layoutWidth()
- {
- return FALSE;
- }
-
- BOOL LBFrButtonC::layoutHeight()
- {
- return FALSE;
- }
-
- VOID LBFrButtonC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBFrButtonC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBIButtonC::LBIButtonC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BIButtonC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGButtonC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBIButtonC::LBIButtonC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BIButtonC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGButtonC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBIButtonC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(getAttr(IBTA_AutoWidth));
- };
- return TRUE;
- }
-
- BOOL LBIButtonC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(getAttr(IBTA_AutoHeight));
- };
- return TRUE;
- }
-
- VOID LBIButtonC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBIButtonC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBStringC::LBStringC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BStringC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGStringC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBStringC::LBStringC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BStringC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGStringC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBStringC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(getAttr(STRA_AutoWidth));
- };
- return TRUE;
- }
-
- BOOL LBStringC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(getAttr(STRA_AutoHeight));
- };
- return TRUE;
- }
-
- VOID LBStringC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBStringC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBIntegerC::LBIntegerC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BIntegerC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGIntegerC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBIntegerC::LBIntegerC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BIntegerC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGIntegerC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBIntegerC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(getAttr(STRA_AutoWidth));
- };
- return TRUE;
- }
-
- BOOL LBIntegerC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(getAttr(STRA_AutoHeight));
- };
- return TRUE;
- }
-
- VOID LBIntegerC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBIntegerC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBCheckboxC::LBCheckboxC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BCheckboxC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGCheckboxC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBCheckboxC::LBCheckboxC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BCheckboxC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGCheckboxC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBCheckboxC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(getAttr(CBA_AutoWidth));
- };
- return TRUE;
- }
-
- BOOL LBCheckboxC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(getAttr(CBA_AutoHeight));
- };
- return TRUE;
- }
-
- VOID LBCheckboxC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBCheckboxC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBRadioC::LBRadioC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BRadioC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGRadioC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBRadioC::LBRadioC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BRadioC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGRadioC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBRadioC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(getAttr(RDA_AutoWidth));
- };
- return TRUE;
- }
-
- BOOL LBRadioC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(getAttr(RDA_AutoHeight));
- };
- return TRUE;
- }
-
- VOID LBRadioC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBRadioC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBCycleC::LBCycleC(GadgetEventC *ev, WindowC &w, stringarray &l,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BCycleC(ev,w,l,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGCycleC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBCycleC::LBCycleC(GadgetEventC *ev, WindowC &w, stringarray &l,
- WORD Width, WORD Height, struct TagItem *tags)
- : BCycleC(ev,w,l,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGCycleC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBCycleC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(getAttr(CYA_AutoWidth));
- };
- return TRUE;
- }
-
- BOOL LBCycleC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(getAttr(CYA_AutoHeight));
- };
- return TRUE;
- }
-
- VOID LBCycleC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBCycleC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBSliderC::LBSliderC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BSliderC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGSliderC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBSliderC::LBSliderC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BSliderC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGSliderC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBSliderC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(getAttr(SLA_AutoWidth));
- };
- return TRUE;
- }
-
- BOOL LBSliderC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(getAttr(SLA_AutoHeight));
- };
- return TRUE;
- }
-
- VOID LBSliderC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBSliderC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBScrollerC::LBScrollerC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BScrollerC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGScrollerC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBScrollerC::LBScrollerC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BScrollerC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGScrollerC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBScrollerC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(12);
- };
- return TRUE;
- }
-
- BOOL LBScrollerC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(12);
- };
- return TRUE;
- }
-
- VOID LBScrollerC::setWidth(WORD w)
- {
- BScrollerC::setWidth(w);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBScrollerC::setHeight(WORD h)
- {
- BScrollerC::setHeight(h);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBArrowScrollerC::LBArrowScrollerC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BArrowScrollerC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGScrollerC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBArrowScrollerC::LBArrowScrollerC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BArrowScrollerC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGScrollerC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBArrowScrollerC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(getAttr(ASCA_AutoWidth));
- };
- return TRUE;
- }
-
- BOOL LBArrowScrollerC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(getAttr(ASCA_AutoHeight));
- };
- return TRUE;
- }
-
- VOID LBArrowScrollerC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBArrowScrollerC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBListC::LBListC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BListC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGListviewC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBListC::LBListC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BListC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGListviewC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBListC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(getAttr(LSA_AutoWidth));
- };
- return TRUE;
- }
-
- BOOL LBListC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(getAttr(LSA_AutoHeight));
- };
- return TRUE;
- }
-
- VOID LBListC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBListC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBListviewC::LBListviewC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BListviewC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGListviewC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBListviewC::LBListviewC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BListviewC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGListviewC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBListviewC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(getAttr(LSA_AutoWidth));
- };
- return TRUE;
- }
-
- BOOL LBListviewC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(getAttr(LSA_AutoHeight));
- };
- return TRUE;
- }
-
- VOID LBListviewC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBListviewC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBTextC::LBTextC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BTextC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGTextC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBTextC::LBTextC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BTextC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGTextC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBTextC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(getAttr(LBA_AutoWidth));
- };
- return TRUE;
- }
-
- BOOL LBTextC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(getAttr(LBA_AutoHeight));
- };
- return TRUE;
- }
-
- VOID LBTextC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBTextC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBNumberC::LBNumberC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BNumberC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LGNumberC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBNumberC::LBNumberC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BNumberC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LGNumberC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBNumberC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(getAttr(LBA_AutoWidth));
- };
- return TRUE;
- }
-
- BOOL LBNumberC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(getAttr(LBA_AutoHeight));
- };
- return TRUE;
- }
-
- VOID LBNumberC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBNumberC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBWBIconDropC::LBWBIconDropC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BWBIconDropC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LayoutC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBWBIconDropC::LBWBIconDropC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BWBIconDropC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LayoutC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBWBIconDropC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(getAttr(WBIDA_AutoWidth));
- };
- return TRUE;
- }
-
- BOOL LBWBIconDropC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(getAttr(WBIDA_AutoHeight));
- };
- return TRUE;
- }
-
- VOID LBWBIconDropC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBWBIconDropC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- LBSplitviewC::LBSplitviewC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, Tag tag1type, ...)
- : BSplitviewC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, (struct TagItem *) &tag1type),
- LayoutC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- LBSplitviewC::LBSplitviewC(GadgetEventC *ev, WindowC &w,
- WORD Width, WORD Height, struct TagItem *tags)
- : BSplitviewC(ev,w,
- GA_Width, Width,
- GA_Height, Height,
- TAG_MORE, tags),
- LayoutC()
- {
- aWidth = (Width == LAYOUT_AUTOSIZE);
- aHeight = (Height == LAYOUT_AUTOSIZE);
- }
-
- BOOL LBSplitviewC::layoutWidth()
- {
- if (autoWidth())
- {
- setWidth(4);
- };
- return TRUE;
- }
-
- BOOL LBSplitviewC::layoutHeight()
- {
- if (autoHeight())
- {
- setHeight(4);
- };
- return TRUE;
- }
-
- VOID LBSplitviewC::setWidth(WORD w)
- {
- setAttrs(GA_Width,(ULONG) w, TAG_END);
- if (w == LAYOUT_AUTOSIZE)
- aWidth = TRUE;
- }
-
- VOID LBSplitviewC::setHeight(WORD h)
- {
- setAttrs(GA_Height,(ULONG) h, TAG_END);
- if (h == LAYOUT_AUTOSIZE)
- aHeight = TRUE;
- }
-
- // *************************************************************
-
- SplitviewHookC::SplitviewHookC(GeometryC &splitview)
- : GeometryHookC(),
- splitviewGeo(splitview)
- {
- }
-
- ULONG SplitviewHookC::layout(GeometryC *object, struct LayoutParamPkt *param)
- {
- switch (param->command)
- {
- case LAYOUTC_PRELEFT:
- {
- if (!splitviewGeo.preLayoutX(param->count))
- return LAYOUTR_ERROR;
- UWORD level = ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_Level);
- UWORD width = object->leftBorder() + object->layoutObject()->width() + object->rightBorder() + param->offset + 2;
- param->coor_result = (width * level) / (65536 - level);
- return LAYOUTR_OK;
- break;
- };
- case LAYOUTC_PRERIGHT:
- {
- if (!splitviewGeo.preLayoutX(param->count))
- return LAYOUTR_ERROR;
- UWORD level = ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_Level);
- if (level == 0)
- return LAYOUTR_ERROR;
- UWORD width = object->leftBorder() + object->layoutObject()->width() + object->rightBorder() + param->offset + 2;
- param->coor_result = (width * (65536 - level)) / level;
- return LAYOUTR_OK;
- break;
- };
- case LAYOUTC_PRETOP:
- {
- if (!splitviewGeo.preLayoutY(param->count))
- return LAYOUTR_ERROR;
- UWORD level = ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_Level);
- UWORD height = object->topBorder() + object->layoutObject()->height() + object->bottomBorder() + param->offset + 2;
- param->coor_result = (height * level) / (65536 - level);
- return LAYOUTR_OK;
- break;
- };
- case LAYOUTC_PREBOTTOM:
- {
- if (!splitviewGeo.preLayoutY(param->count))
- return LAYOUTR_ERROR;
- UWORD level = ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_Level);
- if (level == 0)
- return LAYOUTR_ERROR;
- UWORD height = object->topBorder() + object->layoutObject()->height() + object->bottomBorder() + param->offset + 2;
- param->coor_result = (height * (65536 - level)) / level;
- return LAYOUTR_OK;
- break;
- };
- case LAYOUTC_LEFT:
- {
- if (!splitviewGeo.layoutX(param->parentPosition,
- param->parentSize,param->count))
- return LAYOUTR_ERROR;
- param->coor_result = param->parentPosition +
- ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_RBPosition) +
- object->layoutObject()->leftBorder() + param->offset;
- WORD margin = object->leftBorder() + object->pWidth() + object->rightBorder();
- if (margin > ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_RBMargin))
- ((LBSplitviewC *) splitviewGeo.layoutObject())->setAttrs(
- SVA_RBMargin, margin,
- TAG_END);
- return LAYOUTR_OK;
- break;
- };
- case LAYOUTC_RIGHT:
- {
- if (!splitviewGeo.layoutX(param->parentPosition,
- param->parentSize,param->count))
- return LAYOUTR_ERROR;
- param->coor_result = param->parentPosition +
- ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_LUSize) -
- object->layoutObject()->rightBorder() + 1 + param->offset;
- WORD margin = object->leftBorder() + object->pWidth() + object->rightBorder();
- if (margin > ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_LUMargin))
- ((LBSplitviewC *) splitviewGeo.layoutObject())->setAttrs(
- SVA_LUMargin, margin,
- TAG_END);
- return LAYOUTR_OK;
- break;
- };
- case LAYOUTC_TOP:
- {
- if (!splitviewGeo.layoutY(param->parentPosition,
- param->parentSize,param->count))
- return LAYOUTR_ERROR;
- param->coor_result = param->parentPosition +
- ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_RBPosition) +
- object->layoutObject()->topBorder() + param->offset;
- WORD margin = object->topBorder() + object->pHeight() + object->bottomBorder();
- if (margin > ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_RBMargin))
- ((LBSplitviewC *) splitviewGeo.layoutObject())->setAttrs(
- SVA_RBMargin, margin,
- TAG_END);
- return LAYOUTR_OK;
- break;
- };
- case LAYOUTC_BOTTOM:
- {
- if (!splitviewGeo.layoutY(param->parentPosition,
- param->parentSize,param->count))
- return LAYOUTR_ERROR;
- param->coor_result = param->parentPosition +
- ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_LUSize) -
- object->layoutObject()->bottomBorder() + 1 + param->offset;
- WORD margin = object->topBorder() + object->pHeight() + object->bottomBorder();
- if (margin > ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_LUMargin))
- ((LBSplitviewC *) splitviewGeo.layoutObject())->setAttrs(
- SVA_LUMargin, margin,
- TAG_END);
- return LAYOUTR_OK;
- break;
- };
- };
- return LAYOUTR_UNKNOWN;
- }
-
- // *************************************************************
-
-