UPLOAD - DOSUIT07.ZIP - LAYOUT.CPP

 
Output of file : LAYOUT.CPP contained in archive : DOSUIT07.ZIP

#ifdef ALL
#define LAYOUTA
#define LAYOUTB
#define LAYOUTC
#define LAYOUTD
#endif
#ifndef LAYOUTA
#define LIBRARY_MODULE
#endif

#include
#include "layout.hpp"
#include "window.hpp"


#ifdef LAYOUTA
Space::Space(coord w,coord h,const char *name)
: VObject(w,h,name), minw(w), minh(h)
{
ignoreEvents();
}

coord Space::minwidth() const
{
return minw;
}

coord Space::minheight() const
{
return minh;
}
#endif

#ifdef LAYOUTB
Box::Box(coord w,coord h,BorderFlag b,const char *n)
: Space(w,h,n), bflag(b)
{
if(b & BFtitle)
{
coord mw = strlen(n) + 2;
if(mw > minw)
{
minw = mw;
setwidth(mw);
}
}
}

void Box::paint(Rectangle r)
{
VObject::paint(r);
window->drawbox(*this,r,getcolor(),bflag,name());
}
#endif

#ifdef LAYOUTC
VLine::VLine(coord h,BorderFlag b,const char *n)
: Box(1,h,BorderFlag(b & ~BFtitle),n)
{
}
#endif

#ifdef LAYOUTD
HLine::HLine(coord w,BorderFlag b,const char *n)
: Box(w,1,b,n)
{
}
#endif