Esempio n. 1
0
void Tab12_Linked::Init()
{
	CtrlLayout(*this);	
	SizePos();
	
	scatter1.SetRange(1000, 40).SetXYMin(0, -20);
	scatter1.SetMouseHandling(true).SetMaxRange(5000).SetMinRange(2);
	scatter2.SetRange(1000, 40).SetXYMin(0, -20);
	scatter2.SetMouseHandling(true).SetMaxRange(5000).SetMinRange(2);
	scatter3.SetRange(1000, 40).SetXYMin(0, -20);
	scatter3.SetMouseHandling(true).SetMaxRange(5000).SetMinRange(2);
	for (int t = 0; t < 1000; ++t) {
		s1 << Pointf(t, 20*sin(6*M_PI*t/500));
		s2 << Pointf(t, 20*sin(6*1.1*M_PI*t/500));
		s3 << Pointf(t, 20*sin(6*1.2*M_PI*t/500));
	}
	scatter1.AddSeries(s1).Legend("Series 1").NoMark().Stroke(2, LtRed());
	scatter2.AddSeries(s2).Legend("Series 2").NoMark().Stroke(2, LtBlue());
	scatter3.AddSeries(s3).Legend("Series 3").NoMark().Stroke(2, LtGreen());
	scatter1.ShowInfo();	
	scatter2.ShowInfo();	
	scatter3.ShowInfo();	
	link = true;
	OnLink();
	link.WhenAction = THISBACK(OnLink);
}
Esempio n. 2
0
Color EditorSyntax::IfColor(char c)
{
	switch(c){
	case IfState::IF:          return LtBlue();
	case IfState::ELIF:        return Gray();
	case IfState::ELSE:        return Green();
	case IfState::ELSE_ERROR:  return LtRed();
	case IfState::ENDIF_ERROR: return LtMagenta();
	default:                   return Null;
	}
}
Esempio n. 3
0
void Ctrl::UpdateArea0(SystemDraw& draw, const Rect& clip, int backpaint)
{
	GuiLock __;
	LTIMING("UpdateArea");
	LLOG("========== UPDATE AREA " << UPP::Name(this) << " ==========");
	if(globalbackbuffer) {
		CtrlPaint(draw, clip);
		LLOG("========== END (TARGET IS BACKBUFFER)");
		return;
	}
	if(backpaint == FULLBACKPAINT || globalbackpaint && !hasdhctrl && !dynamic_cast<DHCtrl *>(this)) {
		ShowRepaintRect(draw, clip, LtRed());
		BackDraw bw;
		bw.Create(draw, clip.GetSize());
		bw.Offset(-clip.TopLeft());
		bw.SetPaintingDraw(draw, clip.TopLeft());
		CtrlPaint(bw, clip);
		bw.Put(draw, clip.TopLeft());
		LLOG("========== END (FULLBACKPAINT)");
		return;
	}
	if(backpaint == TRANSPARENTBACKPAINT) {
		LLOG("TransparentBackpaint");
		Vector<Rect> area;
		GatherTransparentAreas(area, draw, GetRect().GetSize(), clip);
		for(int i = 0; i < area.GetCount(); i++) {
			Rect ar = area[i];
			LLOG("Painting area: " << ar);
			ShowRepaintRect(draw, ar, LtBlue());
			BackDraw bw;
			bw.Create(draw, ar.GetSize());
			bw.Offset(-ar.TopLeft());
			bw.SetPaintingDraw(draw, ar.TopLeft());
			CtrlPaint(bw, ar);
			bw.Put(draw, ar.TopLeft());
			if(!draw.ExcludeClip(ar)) {
				LLOG("========== END");
				return;
			}
		}
		PaintOpaqueAreas(draw, GetRect().GetSize(), clip);
		LLOG("========== END");
		return;
	}
	CtrlPaint(draw, clip);
	LLOG("========== END");
}
Esempio n. 4
0
//==============================================================================================
/*static*/ Color ConnState::ConvertStateToColor(EnumConnState enumConnState) {
	
	switch (enumConnState) {
		case NOCON_NEVER: return Gray();
		case NOCON_WASSUCC: return Green();
		case NOCON_WASFAIL: return Red();
		case NOCON_UNDEF: return LtGray();
		case NOCON_MISCONFIG: return Magenta();
		case CONNECTING_START: return LtYellow();
		case CONNECTING_YAWN: return Yellow();
		case CONNECTING_2NDTRY: return LtMagenta();
		case CONNECTING_3RDTRY: return White();
		case CONNECTING_TIMEOUT: return Cyan();
		case CON_SUCCEED: return LtGreen();
		case CON_FAIL: return LtRed();
		case CON_STALE: return LtBlue();
	}
	
	return Black();
}
Esempio n. 5
0
void FormView::Paint(Draw& w)
{
	if (!IsLayout())
	{
		w.DrawRect(GetRect(), White());
		return;
	}

	Rect r = Zoom(GetPageRect());

	DrawGrid(w);
	DrawRect(w, r, 1, LtBlue());

	w.DrawRect(0, 0, r.left, 3000, White());
	w.DrawRect(r.right + 1, 0, 3000, 3000, White());
	w.DrawRect(r.left, 0, 5000, r.top, White());
	w.DrawRect(r.left, r.bottom + 1, 3000, 3000, White());

//	if (_showInfo)
//	{
//		r.SetSize( Zoom(Size(804, 604)) );
//		DrawRect(w, r.Offseted( Zoom(Size(-2, -2)) ), 1, LtMagenta());
//		r = Zoom(GetPageRect());
//	}

	if (GetObjectCount() > 0 && _showInfo == 2)
	{
		Rect b = Zoom(GetObjectsRect()).Offseted(1, 1);
		b.SetSize( b.GetSize() + Size(-2, -2) );
		DrawRect(w, b, 1, Yellow());
	}

	Vector<int> sel = GetSelected();

	bool coloring = GetBool("View.Coloring");
	int ci = 0;
	if (sel.GetCount() > 0)
	{
		if (sel.GetCount() == 1)
		{
			for (int i = 0; i < GetObjectCount(); ++i)
			{
				if (ci++ == _colors.GetCount() - 1) ci = 0;

				if (coloring && i != sel[0])
					DrawObject(w, i, _colors[ci], false);
				else
					DrawObject(w, i, (!coloring && (i == sel[0])) ? _colors[ci] : LtGray(),
						i == sel[0]);
			}
		}
		else
		{
			for (int i = 0; i < GetObjectCount(); ++i)
			{
				if (ci++ == _colors.GetCount() - 1) ci = 0;

				bool found = false;
				for (int j = 0; j < sel.GetCount(); ++j)
					if ( i == sel[j])
					{
						found = true;
						break;
					}
				if (coloring && !found)
					DrawObject(w, i, _colors[ci], false);
				else
					DrawObject(w, i, (!coloring && found) ? _colors[ci] : LtGray(), false);
			}

			Size g = GetGridSize();
			Rect s = GetSelectionRect().Offseted(-g.cx / 2, -g.cy / 2);
			s.SetSize(s.GetSize() + Size(g.cx, g.cy));

			Vector<int> sel = GetSelected();

			bool a1 = true;	// allow horz align
			bool a2 = true;	// allow vert align
			dword f1;		// first horz align
			dword f2;		// first vert align
	
			for (int i = 0; i < sel.GetCount(); ++i)
			{
				FormObject *pI = GetObject(sel[i]);
				if (!pI) continue;

				if (i == 0) { f1 = pI->GetHAlign(); f2 = pI->GetVAlign(); }

				if (f1 != pI->GetHAlign()) { a1 = false; }
				if (f2 != pI->GetVAlign()) { a2 = false; }
			}

			DrawSprings(w, Zoom(s), f1, f2, a1, a2, a1, a2, false);
			DrawRect(w, Zoom(s), 1, LtRed());

			s = GetSelectionRect().Offseted(-g.cx, -g.cy);
			s.SetSize(s.GetSize() + Size(g.cx * 2, g.cy * 2));

			DrawGroupTools(w, Zoom(s));
		}
		return;
	}

	for (int i = 0; i < GetObjectCount(); ++i)
	{
		if (ci++ == _colors.GetCount() - 1) ci = 0;
		DrawObject(w, i, coloring ? _colors[ci] : LtGray());
	}

	if (sel.GetCount() == 0)
		w.DrawImage(r.right, r.bottom, FormViewImg::SizerBR());
}
Esempio n. 6
0
		if(!next->GetAccessKeysDeep()) {
			lbl.accesskey = ChooseAccessKey(GetText(), used);
			if(lbl.accesskey) Refresh();
			used |= AccessKeyBit(lbl.accesskey);
		}
	}
	Ctrl::AssignAccessKeys(used);
}

Label::Label() {
	noac = false;
}

Label::~Label() {}

CH_COLOR(LabelBoxTextColor, IsDark(SColorFace()) ? Blend(LtBlue(), White) : LtBlue());
CH_COLOR(LabelBoxDisabledTextColor, SColorDisabled());
CH_COLOR(LabelBoxColor, SColorShadow());

LabelBox::LabelBox()
{
	color = Null;
	LabelBase::SetInk(LabelBoxTextColor, LabelBoxDisabledTextColor);
	SetVAlign(ALIGN_TOP);
	#if defined(flagWINGL) || defined(flagLINUXGL)
	ClipToBounds(false);
	#endif
}

void  LabelBox::AssignAccessKeys(dword used)
{