Example #1
0
	virtual int drawIn(dxO& _dxo,DrawFuncType* _pDrawFunc){
		if(MoveAreaSize.x<=0 || MoveAreaSize.y<=0)return 0;
		_dxo.movePos(-viewpos);
		int ans=(*_pDrawFunc)(_dxo);
		Rint rect=_dxo.getArea();
		adjDrawArea(rect);
		_dxo.movePos(viewpos);

		if(rect.pos2.x-rect.pos1.x>MoveAreaSize.x){
			Pint tabpos;
			Pint tabsize;
			tabsize.x=MoveAreaSize.x*(MoveAreaSize.x-10)/(rect.pos2.x-rect.pos1.x);
			if(tabsize.x<5)tabsize.x=5;
			tabsize.y=10;
			tabpos.x=viewpos.x-rect.pos1.x;
			tabpos.y=0;
			_dxo.draw(Pint(0,MoveAreaSize.y-10),dxoSlider(Pint(MoveAreaSize.x-10,10),tabsize,tabpos,Pint(rect.pos2.x-rect.pos1.x-MoveAreaSize.x,0),MoveAreaClr),true,196);
//			dxo::Draw(dxoTab(pos+Pint(0,MoveAreaSize.y-10),Pint(MoveAreaSize.x-10,10),tabsize,tabpos,Pint(rect.pos2.x-rect.pos1.x-MoveAreaSize.x,0),Color,128,FrameTabBlend*AreaBlend/255));
			viewpos.x=tabpos.x+rect.pos1.x;
		}

		if(rect.pos2.y-rect.pos1.y>MoveAreaSize.y){
			Pint tabpos;
			Pint tabsize;
			tabsize.y=MoveAreaSize.y*(MoveAreaSize.y-10)/(rect.pos2.y-rect.pos1.y);
			if(tabsize.y<5)tabsize.y=5;
			tabsize.x=10;
			tabpos.y=viewpos.y-rect.pos1.y;
			tabpos.x=0;
			_dxo.draw(Pint(MoveAreaSize.x-10,0),dxoSlider(Pint(10,MoveAreaSize.y-10),tabsize,tabpos,Pint(0,rect.pos2.y-rect.pos1.y-MoveAreaSize.y),MoveAreaClr),true,196);
//			dxo::Draw(dxoTab(pos+Pint(MoveAreaSize.x-10,0),Pint(10,MoveAreaSize.y-10),tabsize,tabpos,Pint(0,rect.pos2.y-rect.pos1.y-MoveAreaSize.y),Color,128,FrameTabBlend*AreaBlend/255));
			viewpos.y=tabpos.y+rect.pos1.y;
		}

		if(!(rect.pos2-rect.pos1<=MoveAreaSize)){
			_dxo.draw(MoveAreaSize-Pint(10,10),dxoButIO(Pint(10,10),"",MoveAreaClr,false),true,196);
//			dxo::Draw(dxoButIO(pos+MoveAreaSize-Pint(10,10),Pint(10,10),Color,1,"",0,POS::center,FrameTabBlend*AreaBlend/255,0));
		}
		return 0;
	}
Example #2
0
	virtual int drawIn(dxO& _dxo,DrawFuncType* _pDrawFunc){
		_dxo.movePos(-viewpos);
		int ans=(*_pDrawFunc)(_dxo);
		Rint rect=_dxo.getArea();
		adjDrawArea(rect);
		_dxo.movePos(viewpos);

		if(rect.pos1.x<viewpos.x){
			dxoBox tmpbox(Pint(10,MoveAreaSize.y),MoveAreaClr);
			if(tmpbox.pIn(Pint(0,0),_dxo.GtoD(dx::getMosPos())) && _dxo.checkActive()){
				_dxo.draw(Pint(0,0),tmpbox,true,196);
				_dxo.draw(Pint(0,MoveAreaSize.y/2),dxoTriangle(Pint(10,-7),Pint(10,7),MoveAreaClr),true,196);
				if(dx::getMosL()>0)viewpos.x-=10;
				else if(dx::getMosR()>0)viewpos.x=rect.pos1.x;
				else viewpos.x-=2;
			}else{
				_dxo.draw(Pint(0,0),tmpbox,true,128);
				_dxo.draw(Pint(0,MoveAreaSize.y/2),dxoTriangle(Pint(10,-7),Pint(10,7),MoveAreaClr),true,128);
			}
		}
		if(rect.pos1.y<viewpos.y){
			dxoBox tmpbox(Pint(MoveAreaSize.x,10),MoveAreaClr);
			if(tmpbox.pIn(Pint(0,0),_dxo.GtoD(dx::getMosPos())) && _dxo.checkActive()){
				_dxo.draw(Pint(0,0),tmpbox,true,196);
				_dxo.draw(Pint(MoveAreaSize.x/2,0),dxoTriangle(Pint(-7,10),Pint(7,10),MoveAreaClr),true,196);
				if(dx::getMosL()>0)viewpos.y-=10;
				else if(dx::getMosR()>0)viewpos.y=rect.pos1.y;
				else viewpos.y-=2;
			}else{
				_dxo.draw(Pint(0,0),tmpbox,true,128);
				_dxo.draw(Pint(MoveAreaSize.x/2,0),dxoTriangle(Pint(-7,10),Pint(7,10),MoveAreaClr),true,128);
			}
		}
		if(rect.pos2.x>viewpos.x+MoveAreaSize.x){
			dxoBox tmpbox(Pint(10,MoveAreaSize.y),MoveAreaClr);
			if(tmpbox.pIn(Pint(MoveAreaSize.x-10,0),_dxo.GtoD(dx::getMosPos())) && _dxo.checkActive()){
				_dxo.draw(Pint(MoveAreaSize.x-10,0),tmpbox,true,196);
				_dxo.draw(Pint(MoveAreaSize.x,MoveAreaSize.y/2),dxoTriangle(Pint(-10,-7),Pint(-10,7),MoveAreaClr),true,196);
				if(dx::getMosL()>0)viewpos.x+=10;
				else if(dx::getMosR()>0)viewpos.x=rect.pos2.x-MoveAreaSize.x;
				else viewpos.x+=2;
			}else{
				_dxo.draw(Pint(MoveAreaSize.x-10,0),tmpbox,true,128);
				_dxo.draw(Pint(MoveAreaSize.x,MoveAreaSize.y/2),dxoTriangle(Pint(-10,-7),Pint(-10,7),MoveAreaClr),true,128);
			}
		}
		if(rect.pos2.y>viewpos.y+MoveAreaSize.y){
			dxoBox tmpbox(Pint(MoveAreaSize.x,10),MoveAreaClr);
			if(tmpbox.pIn(Pint(0,MoveAreaSize.y-10),_dxo.GtoD(dx::getMosPos())) && _dxo.checkActive()){
				_dxo.draw(Pint(0,MoveAreaSize.y-10),tmpbox,true,196);
				_dxo.draw(Pint(MoveAreaSize.x/2,MoveAreaSize.y),dxoTriangle(Pint(-7,-10),Pint(7,-10),MoveAreaClr),true,196);
				if(dx::getMosL()>0)viewpos.y+=10;
				else if(dx::getMosR()>0)viewpos.y=rect.pos2.y-MoveAreaSize.y;
				else viewpos.y+=2;
			}else{
				_dxo.draw(Pint(0,MoveAreaSize.y-10),tmpbox,true,128);
				_dxo.draw(Pint(MoveAreaSize.x/2,MoveAreaSize.y),dxoTriangle(Pint(-7,-10),Pint(7,-10),MoveAreaClr),true,128);
			}
		}

		return 0;
	}