• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MoveTo函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MoveTo函数的典型用法代码示例。如果您正苦于以下问题:C++ MoveTo函数的具体用法?C++ MoveTo怎么用?C++ MoveTo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了MoveTo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: CorrectDragRect

void CPolySelection::OnDraw( CImage* pImage, COLORREF color )
{
   /*CRect tmpSelection = m_rect;
   CorrectDragRect( &tmpSelection );
   BoundRect( pImage, &tmpSelection );*/

   

   auto hDC = pImage->GetDC();
   auto memoryDC = CDC::FromHandle( hDC );
   CPen    pen( PS_SOLID, 1, color );
   CPen*    pOldPen = memoryDC->SelectObject( &pen );
   //auto origColor = memoryDC->SetDCPenColor( color );

   if( m_verts.size() <= 0 )
   {
      return;
   }

   memoryDC->MoveTo( m_verts[0] );

   for( int i=1; i<(int)m_verts.size(); i++ )
   {
      auto p = m_verts[i];
      memoryDC->LineTo( p );
   }

   if( !m_bIsFinished )
   {
      memoryDC->LineTo( m_nextPoint );
   }
   else
   {
      memoryDC->LineTo( m_verts[0] );
   }

   pImage->ReleaseDC();
}
开发者ID:BLesnau,项目名称:CSE872Project,代码行数:38,代码来源:PolySelection.cpp


示例2: BWindow

DataTranslationsWindow::DataTranslationsWindow()
	:
	BWindow(BRect(0.0f, 0.0f, 597.0f, 368.0f),
		B_TRANSLATE_SYSTEM_NAME("DataTranslations"),
		B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE
			| B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
	fRelease(NULL)
{
	MoveTo(DataTranslationsSettings::Instance()->WindowCorner());

	_SetupViews();

	// Make sure that the window isn't positioned off screen
	BScreen screen;
	BRect screenFrame = screen.Frame();
	if (!screenFrame.Contains(Frame()))
		CenterOnScreen();

	BTranslatorRoster* roster = BTranslatorRoster::Default();
	roster->StartWatching(this);

	Show();
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:23,代码来源:DataTranslationsWindow.cpp


示例3: MoveTo

bool GameDisplayDlg::ProcUserCmd(const POINT& _mp)
{
	int nShowX = _mp.x;
	int nShowY = _mp.y;
	int nClientWidth = m_rcClient.right - m_rcClient.left;
	int nClientHeight = m_rcClient.bottom - m_rcClient.top;
	nShowX += 5;
	nShowY += 5;

	if(nShowX + nClientWidth > m_nScreenWidth)
	{
		int nOffset = nShowX + nClientWidth - m_nScreenWidth;
		nShowX -= nOffset;
	}
	if(nShowY + nClientHeight > m_nScreenHeight)
	{
		int nOffset = nShowY + nClientHeight - m_nScreenHeight;
		nShowY -= nOffset;
	}
	MoveTo(nShowX, nShowY);

	return true;
}
开发者ID:sryanyuan,项目名称:rtttest,代码行数:23,代码来源:GameDisplayDlg.cpp


示例4: updatemainwindow

static void updatemainwindow (void) {
	
	Rect r;
	Str255 s;
	
	r = (*mainwindow).portRect;
	
	EraseRect (&r);
	
	setfontsizestyle (helvetica, 12, 0);
	
	centerstring (r, windowmessage);
	
	NumToString (FreeMem () / 1024, s);
	
	MoveTo (r.left + 3, r.bottom - 3);
	
	setfontsizestyle (geneva, 9, 0);
	
	DrawString (s);
	
	DrawString ("\pK");
	} /*updatemainwindow*/
开发者ID:dvincent,项目名称:frontier,代码行数:23,代码来源:main.c


示例5: MoveTo

/*------------------------------------------------------------------------------*\
	( )
		-	
\*------------------------------------------------------------------------------*/
BRect BmTextControl::layout(BRect frame) {
	if (frame == Frame())
		return frame;
	MoveTo(frame.LeftTop());
	ResizeTo(frame.Width(),frame.Height());
#ifdef __HAIKU__
	float occupiedSpace = 3 + Divider();
	float top = mTextView->Frame().top;
	float height = mTextView->Frame().Height();
	if (mLabelIsMenu) {
		top = mMenuField->MenuBar()->Frame().top;
		height = mMenuField->MenuBar()->Frame().Height();
	}
	mTextView->MoveTo( occupiedSpace, top);
	mTextView->ResizeTo( frame.Width()-occupiedSpace-4, height);
#else
	float occupiedSpace = 3 + Divider();
	mTextView->MoveTo( occupiedSpace, 5);
	mTextView->ResizeTo( frame.Width()-occupiedSpace-4, 
								mTextView->Frame().Height());
#endif // __HAIKU__
	return frame;
}
开发者ID:HaikuArchives,项目名称:Beam,代码行数:27,代码来源:BmTextControl.cpp


示例6: SetViewColor

void CalendarControl::AttachedToWindow(void)
{
 BControl::AttachedToWindow();
 
 pb->SetTarget(this);
 
 if(Parent()!=NULL) view_color=Parent()->ViewColor();
 else
  view_color.red=view_color.green=view_color.blue=view_color.alpha=255;
 
 SetViewColor(view_color); // function of CalendarControl class

#ifdef __UNIVERSAL_INTERFACE
 if(interface==CC_BEOS_INTERFACE)
#endif

#ifdef __BEOS_INTERFACE
  MakeButton(); // for BeOS interface is called only from here,
                // for Zeta interface if color is changed also (in SetViewColor)
#endif
 
 MoveTo(LT);
}
开发者ID:BackupTheBerlios,项目名称:projectconcepto-svn,代码行数:23,代码来源:CalendarControl.cpp


示例7: lock

status_t
InspectorWindow::LoadSettings(const GuiTeamUiSettings& settings)
{
	AutoLocker<BLooper> lock(this);
	if (!lock.IsLocked())
		return B_ERROR;

	BMessage inspectorSettings;
	if (settings.Settings("inspectorWindow", inspectorSettings) != B_OK)
		return B_OK;

	BRect frameRect;
	if (inspectorSettings.FindRect("frame", &frameRect) == B_OK) {
		ResizeTo(frameRect.Width(), frameRect.Height());
		MoveTo(frameRect.left, frameRect.top);
	}

	_LoadMenuFieldMode(fHexMode, "Hex", inspectorSettings);
	_LoadMenuFieldMode(fEndianMode, "Endian", inspectorSettings);
	_LoadMenuFieldMode(fTextMode, "Text", inspectorSettings);

	return B_OK;
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:23,代码来源:InspectorWindow.cpp


示例8: InitializeAABB

/**   
	* @fn void CShoot::Init (void)
	* Used when all the values are initialized by default
	* when reading the global initialization game file.
 */
void CShoot::Init (void)
{
	SubType			=	CSH_DEFAULT;
	Type			=	CHARS_MISSIL;
	Active = Alive  =	false;	///The very first time, when created at the beginning of the game, this device is not available
	
	//Space position and AABB							
	Size.v[XDIM]		=	.05f;	///Update by default the AABB relative to local coordinates
	Size.v[YDIM]		=	0.3f;
	Size.v[ZDIM]		=	0.0f;
	RenderMode		=	CHAR_2D;
	visible			=	true;
#ifdef CHAR_USE_AABB
	InitializeAABB();
#endif
	MoveTo(0.0f, 0.0f, 0.05f);
	Speed.v[YDIM] = CSH_DEFAULT_SPEED;
	Health=100;

	msgUpd = new RTDESK_CMsg;
	msgUpd->Type = RTDESKMSG_BASIC_TYPE;
	msgUpd->Propietary = true;
}
开发者ID:chverma,项目名称:IPV_SpaceInvaders,代码行数:28,代码来源:Shoot.cpp


示例9: while

//-----------------------------------------------------------------------------
//Summary:
//		person move process in traffic system
//-----------------------------------------------------------------------------
void CFreeMovingLogic::ProcessMove( const ElapsedTime& time )
{
	ElapsedTime eTime = time;
	while(!m_routePath.empty())
	{
		LandsideTrafficGraphVertex& vertex = m_routePath.back();
		if (vertex.GetTrafficObjectType() == CLandsideWalkTrafficObjectInSim::CrossWalk_Type)
			return GenerateConflictEvent(eTime);
		else if(vertex.GetTrafficObjectType() == CLandsideWalkTrafficObjectInSim::Walkway_Type)
		{
			CWalkwayInSim* pWalkwayInSim = (CWalkwayInSim*)vertex.GetTrafficInSim();
			pWalkwayInSim->stepIt(m_pPaxLandsideBehavior,vertex,this,eTime);
		}
		else
		{
			//eTime += m_pPaxLandsideBehavior->moveTime();
			MoveTo(eTime,vertex.GetPoint());
			m_routePath.pop_back();
		}
	}

	m_pLandsideTrafficSys->LeaveTrafficSystem(m_pPaxLandsideBehavior,m_emEndState,eTime);
}
开发者ID:chenbk85,项目名称:tphProjects,代码行数:27,代码来源:LandsideTrafficSystem.cpp


示例10: clock

// called when a enemy is on sight 
bool CMonster::OnEnemyOnSight( CPlayer* Enemy )
{
    clock_t etime = clock() - lastSighCheck;
    if(etime<5000) return true;
    if(!IsOnBattle( ))
    {
        if(thisnpc->aggresive>1)
        {
            UINT aggro = GServer->RandNumber(2,15);
            if(thisnpc->aggresive>=aggro && !IsGhostSeed( ))
            {
                Enemy->ClearObject( this->clientid );
				SpawnMonster(Enemy, this );
                StartAction( (CCharacter*) Enemy, NORMAL_ATTACK, 0 );
            }
            else
            if(IsGhostSeed( ) || thisnpc->aggresive>5)
                MoveTo( Enemy->Position->current, true );
        }
        lastSighCheck = clock();
    }
    return true;    
}
开发者ID:osROSE,项目名称:osrose,代码行数:24,代码来源:MonsterEvents.cpp


示例11: calculate_lineto

static void calculate_lineto(void)
{
    RECT rect;
    HPEN hOldPen;
    WINT temp;
    do {
        rect.left = get_rand(0, xMax);
        rect.top = get_rand(0, yMax);
        rect.right = get_rand(0, xMax);
        rect.bottom = get_rand(0, yMax);
        hOldPen = SelectObject(hMemDC, create_pen());
        SetROP2(hMemDC, get_rand(1,17));
        MoveTo(hMemDC, rect.left, rect.top);
        LineTo(hMemDC, rect.right, rect.bottom);
        DeleteObject(SelectObject(hMemDC, hOldPen));
        if (TestSemaphore(&PainterRequired) < 0)
        {
            if (rect.left > rect.right)
            {
                temp = rect.left;
                rect.left = rect.right;
                rect.right = temp;
            }
            if (rect.top > rect.bottom)
            {
                temp = rect.top;
                rect.top = rect.bottom;
                rect.bottom = temp;
            }
            InvalidateRect(hWnd, &rect, FALSE);
            UpdateWindow(hWnd);
        }
    } while ((TestSemaphore(&DemoRun)) && (!TestSemaphore(&SingleRun)));

    if (!TestSemaphore(&SingleRun));
        Signal(&Done);
}
开发者ID:jamjr,项目名称:Helios-NG,代码行数:37,代码来源:gditest.c


示例12: BWindow

VirtualKeyboardWindow::VirtualKeyboardWindow(BInputServerDevice* dev)
	:
	BWindow(BRect(0,0,0,0),"Virtual Keyboard",
	B_NO_BORDER_WINDOW_LOOK, B_FLOATING_ALL_WINDOW_FEEL,
	B_WILL_ACCEPT_FIRST_CLICK | B_AVOID_FOCUS),
	fDevice(dev)
{
	BScreen screen;
	BRect screenRect(screen.Frame());

	ResizeTo(screenRect.Width(), screenRect.Height() / 3);
	MoveTo(0,screenRect.Height() - screenRect.Height() / 3);

	SetLayout(new BGroupLayout(B_VERTICAL));

	//Add to an options window later, use as list for now
	fMapListView = new BListView("Maps");
	fFontMenu = new BMenu("Font");
	fLayoutMenu = new BMenu("Layout");

	_LoadMaps();
	_LoadLayouts(fLayoutMenu);
	_LoadFonts();

	KeymapListItem* current =
		static_cast<KeymapListItem*>(fMapListView->LastItem());
	fCurrentKeymap.Load(current->EntryRef());


	fKeyboardView = new KeyboardLayoutView("Keyboard",fDevice);
	fKeyboardView->GetKeyboardLayout()->SetDefault();
	fKeyboardView->SetEditable(false);
	fKeyboardView->SetKeymap(&fCurrentKeymap);

	AddChild(BGroupLayoutBuilder(B_VERTICAL)
		.Add(fKeyboardView));
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:37,代码来源:VirtualKeyboardWindow.cpp


示例13: real_position

    void MoveSplineInit::Stop()
    {
        MoveSpline& move_spline = *unit.movespline;

        // No need to stop if we are not moving
        if (move_spline.Finalized())
            return;

        Location real_position(unit.GetPositionX(), unit.GetPositionY(), unit.GetPositionZ(), unit.GetOrientation());


        // there is a big chance that current position is unknown if current state is not finalized, need compute it
        // this also allows calculate spline position and update map position in much greater intervals
        if (!move_spline.Finalized())
            real_position = move_spline.ComputePosition();

        if (args.path.empty())
        {
            // should i do the things that user should do?
            MoveTo(real_position);
        }

        // current first vertex
        args.path[0] = real_position;

        args.flags = MoveSplineFlag::Done;
        unit.m_movementInfo.RemoveMovementFlag(MovementFlags(MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_SPLINE_ENABLED));
        move_spline.Initialize(args);

        WorldPacket data(SMSG_MONSTER_MOVE, 64);
        data << unit.GetPackGUID();

        data << real_position.x << real_position.y << real_position.z;
        data << move_spline.GetId();
        data << uint8(MonsterMoveStop);
        unit.SendMessageToSet(&data, true);
    }
开发者ID:superwow,项目名称:foton.core,代码行数:37,代码来源:MoveSplineInit.cpp


示例14: MoveToCommand

void MoveToCommand (void)
{
	char *command;
	int32_t targets[6];

	do {

		if (!(command = GetArgument ())) {
			break;
		}
		targets[0] = decatoi (command);
		if (!(command = GetArgument ())) {
			break;
		}
		targets[1] = decatoi (command);
		if (!(command = GetArgument ())) {
			break;
		}
		targets[2] = decatoi (command);
		if (!(command = GetArgument ())) {
			break;
		}
		targets[3] = decatoi (command);
		if (!(command = GetArgument ())) {
			break;
		}
		targets[4] = decatoi (command);
		if (!(command = GetArgument ())) {
			break;
		}
		targets[5] = decatoi (command);

		MoveTo (targets[0], targets[1], targets[2], targets[3], targets[4], targets[5]);

	} while (0);
}
开发者ID:bikerglen,项目名称:robot-arm-v01,代码行数:36,代码来源:helloworld.c


示例15: if

void Game_Player::PerformTeleport() {
	if (!teleporting) return;

	teleporting = false;

	// Finish (un)boarding process
	if (location.boarding) {
		location.boarding = false;
		location.aboard = true;
	} else if (location.unboarding) {
		location.unboarding = false;
		location.aboard = false;
	}

	// Reset sprite if it was changed by a move
	// Even when target is the same map
	Refresh();

	if (Game_Map::GetMapId() != new_map_id) {
		pattern = RPG::EventPage::Frame_middle;
		Game_Map::Setup(new_map_id);
		last_pan_x = 0;
		last_pan_y = 0;
	}

	SetOpacity(255);

	MoveTo(new_x, new_y);
	if (new_direction >= 0) {
		SetDirection(new_direction);
		SetSpriteDirection(new_direction);
	}

	if (InVehicle())
		GetVehicle()->MoveTo(new_x, new_y);
}
开发者ID:rohkea,项目名称:Player,代码行数:36,代码来源:game_player.cpp


示例16: DrawInstrumentName

static void DrawInstrumentName(int ch, char *comm)
{
	char		buf[80];
	RGBColor	black={0,0,0};
	Rect		box;

	SetPortWindowPort(win.ref);
	RGBForeColor(&black);
	
		//channel number
	MoveTo(2, UPPER_MERGIN+CHANNEL_HIGHT*(ch+1)-1);
	snprintf(buf, 80,"%2d", ch+1);
	DrawText(buf, 0, strlen(buf));
		
		//InstrumentName
	box.top=UPPER_MERGIN+CHANNEL_HIGHT*ch;
	box.left=20;
	box.bottom=box.top+12;
	box.right=LEFT_MERGIN-10;
	if( !comm || !*comm )
		EraseRect(&box);
	else
		TETextBox(comm, strlen(comm), &box, teFlushDefault);
}
开发者ID:OS2World,项目名称:MM-SOUND-TiMidity-MCD,代码行数:24,代码来源:mac_trace.c


示例17: CALLED

void
BTextControl::_UpdateFrame()
{
	CALLED();

	if (fLayoutData->label_layout_item && fLayoutData->text_view_layout_item) {
		BRect labelFrame = fLayoutData->label_layout_item->Frame();
		BRect textFrame = fLayoutData->text_view_layout_item->Frame();

		// update divider
		fDivider = textFrame.left - labelFrame.left;

		MoveTo(labelFrame.left, labelFrame.top);
		BSize oldSize = Bounds().Size();
		ResizeTo(textFrame.left + textFrame.Width() - labelFrame.left,
			textFrame.top + textFrame.Height() - labelFrame.top);
		BSize newSize = Bounds().Size();

		// If the size changes, ResizeTo() will trigger a relayout, otherwise
		// we need to do that explicitly.
		if (newSize != oldSize)
			Relayout();
	}
}
开发者ID:mmanley,项目名称:Antares,代码行数:24,代码来源:TextControl.cpp


示例18: Refresh

void Game_Player::PerformTeleport() {
	if (!teleporting) return;

	teleporting = false;

	if (Game_Map::GetMapId() != new_map_id) {
		Refresh(); // Reset sprite if it was changed by a move
		Game_Map::Update(); // Execute remaining events (e.g. ones listed after a teleport)
		Game_Map::Setup(new_map_id);
		last_pan_x = 0;
		last_pan_y = 0;
	}

	SetOpacity(255);

	MoveTo(new_x, new_y);
	if (new_direction >= 0) {
		SetDirection(new_direction);
		SetSpriteDirection(new_direction);
	}

	if (InVehicle())
		GetVehicle()->MoveTo(new_x, new_y);
}
开发者ID:Uladox,项目名称:Player,代码行数:24,代码来源:game_player.cpp


示例19: max_c

// Loads the application settings file from (loadMsg) and resizes the interface
// to match the previously saved settings.  Because this is a non-essential
// file, errors are ignored when loading the settings.
void
ShortcutsWindow::_LoadWindowSettings(const BMessage& loadMsg)
{
	BRect frame;
	if (loadMsg.FindRect("window frame", &frame) == B_OK) {
		// Ensure the frame does not resize below the computed minimum.
		float width = max_c(Bounds().right, frame.right - frame.left);
		float height = max_c(Bounds().bottom, frame.bottom - frame.top);
		ResizeTo(width, height);

		// Ensure the frame is not placed outside of the screen.
		BScreen screen(this);
		float left = min_c(screen.Frame().right - width, frame.left);
		float top = min_c(screen.Frame().bottom - height, frame.top);
		MoveTo(left, top);
	}

	for (int i = 0; i < fColumnListView->CountColumns(); i++) {
		CLVColumn* column = fColumnListView->ColumnAt(i);
		float columnWidth;
		if (loadMsg.FindFloat("column width", i, &columnWidth) == B_OK)
			column->SetWidth(max_c(column->Width(), columnWidth));
	}
}
开发者ID:Barrett17,项目名称:haiku-contacts-kit-old,代码行数:27,代码来源:ShortcutsWindow.cpp


示例20: SetCurrentLineWidth

/**
 * HPGL polygon: fill not supported (but closed, at least)
 */
void HPGL_PLOTTER::PlotPoly( const std::vector<wxPoint>& aCornerList,
                             FILL_T aFill, int aWidth )
{
    if( aCornerList.size() <= 1 )
        return;

    SetCurrentLineWidth( aWidth );

    MoveTo( aCornerList[0] );

    for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
        LineTo( aCornerList[ii] );

    // Close polygon if filled.
    if( aFill )
    {
        int ii = aCornerList.size() - 1;

        if( aCornerList[ii] != aCornerList[0] )
            LineTo( aCornerList[0] );
    }

    PenFinish();
}
开发者ID:corecode,项目名称:kicad-source-mirror,代码行数:27,代码来源:common_plotHPGL_functions.cpp



注:本文中的MoveTo函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MoveToEx函数代码示例发布时间:2022-05-30
下一篇:
C++ MoveTemp函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap