Пример #1
0
void ArrangeOKCancel(Ctrl& ok, Ctrl& cancel)
{
	if(SwapOKCancel() &&
	   ok.GetPos().x.GetB() == cancel.GetPos().x.GetB() &&
	   ok.GetPos().y.GetB() == cancel.GetPos().y.GetB()) {
	       Ctrl::LogPos h = ok.GetPos();
	       ok.SetPos(cancel.GetPos());
	       cancel.SetPos(h);
	}   
}
Пример #2
0
void Themed::WriteTheme()
{
	if(IsNull(sWriteDir))
		return;
	RealizeDirectory(sWriteDir);
	String imgdir = AppendFileName(sWriteDir, GetClass() + ".image");
	FileOut out(AppendFileName(sWriteDir, GetClass() + ".class"));
	VectorMap<String, String> prop;
	VectorMap<String, Image> img;
	ThemeProperties tm(prop, img, false);
	Properties(tm);
	RealizeDirectory(imgdir);
	SaveImages(imgdir, NULL, img);
	SaveProp(out, prop, "");
	Ctrl *p = dynamic_cast<Ctrl *>(this);
	if(p)
		for(Ctrl *q = p->GetFirstChild(); q; q = q->GetNext()) {
			Themed *t = dynamic_cast<Themed *>(q);
			if(t && t->id.GetCount()) {
//				prop.Clear();
//				ThemeProperties tm(prop, img, false);
//				t->Properties(tm);
				out << t->id;
				Ctrl::LogPos pos = q->GetPos();
				switch(pos.x.GetAlign()) {
				case Ctrl::LEFT:   out << Format(" left %d, %d", pos.x.GetA(), pos.x.GetB()); break;
				case Ctrl::RIGHT:  out << Format(" right %d, %d", pos.x.GetA(), pos.x.GetB()); break;
				case Ctrl::SIZE:   out << Format(" hsize %d, %d", pos.x.GetA(), pos.x.GetB()); break;
				case Ctrl::CENTER: out << Format(" hcenter %d, %d", pos.x.GetB(), pos.x.GetA()); break;
				}
				switch(pos.y.GetAlign()) {
				case Ctrl::TOP:    out << Format(" top %d, %d", pos.y.GetA(), pos.y.GetB()); break;
				case Ctrl::BOTTOM: out << Format(" bottom %d, %d", pos.y.GetA(), pos.y.GetB()); break;
				case Ctrl::SIZE:   out << Format(" vsize %d, %d", pos.y.GetA(), pos.y.GetB()); break;
				case Ctrl::CENTER: out << Format(" vcenter %d, %d", pos.y.GetB(), pos.y.GetA()); break;
				}
				out << "\r\n";
//				SaveProp(out, prop, "   ");
			}
		}
}
Пример #3
0
//same as above but it does it for a specific Ctrl already
Ctrl::LogPos LogPosPopUp::MakeLogPos(Ctrl::LogPos p, const Ctrl& c)
{
	if(!c.GetParent()) return p;
	//reconvert to logpos using new align
	return MakeLogPos(p, c.GetPos(), c.GetParent()->GetSize());
}