当前位置: 首页>>代码示例>>C++>>正文


C++ OnResize函数代码示例

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


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

示例1: GetBarStyle

void CEGControlBar::OnSize(UINT nType, int cx, int cy)
{
	CControlBar::OnSize(nType, cx, cy);

	DWORD dwStyle = GetBarStyle();
	if ( (dwStyle & CBRS_LEFT ) == CBRS_LEFT ) {
		m_dragRect.SetRect( cx - SPLITTER_SIZE, 0, cx, cy);
	} else if ( (dwStyle & CBRS_RIGHT ) == CBRS_RIGHT ) {
		m_dragRect.SetRect( 0, 0, SPLITTER_SIZE, cy);
	} else if ( (dwStyle & CBRS_TOP ) == CBRS_TOP ) {
		m_dragRect.SetRect( 0, cy - SPLITTER_SIZE, cx, cy);
	} else {
		m_dragRect.SetRect( 0, 0, cx, SPLITTER_SIZE);
	}
	
	CRect rc;
	GetInsideRect( rc );
	OnResize ( rc );
}
开发者ID:AnthonyNystrom,项目名称:GenXSource,代码行数:19,代码来源:EGCtrlBar.cpp

示例2: SetWindowPos

void D3D11App::SwitchResolution()
{
	SettingsData lSettings = *Settings->GetData();
	mcWidth = lSettings.mWidth;
	mcHeight = lSettings.mHeight;
	BOOL lpIsFullscreen = (BOOL)lSettings.mIsFullscreen;
	mDirect3D->GetSwapChain()->GetFullscreenState(&mIsFullscreen, nullptr);

	// Resize window and set window position at center of screen
	if (!mIsFullscreen)
	{
		SetWindowPos(mhMainWnd, HWND_TOP,
			static_cast<int>((GetSystemMetrics(SM_CXSCREEN)*0.5) - (mcWidth*0.5)),
			static_cast<int>((GetSystemMetrics(SM_CYSCREEN)*0.5) - (mcHeight*0.5)),
			mcWidth, mcHeight, SWP_FRAMECHANGED);
	}

	OnResize();
}
开发者ID:Gnidleif,项目名称:3D_Project,代码行数:19,代码来源:D3D11App.cpp

示例3: CMGControl

//---------------------------------------------------------------------------//
// Constructor
//
//---------------------------------------------------------------------------//  
CMGFXFilters::CMGFXFilters(CMGControl *pParent, CMGEffect *pEffect) : CMGControl(pParent, 0,0,0,0)
{
  m_Align      = MGALIGN_CLIENT;
  m_FilterVars = NULL;

  m_PanelSup = NEW CMGPanel(this, 0,0,0,118, MGALIGN_TOP);
  m_PanelInf = NEW CMGPanel(this, 0,0,0,0, MGALIGN_CLIENT);

  m_LBFilters = NEW CMGListBox(m_PanelSup, 1,0,294,81, MGALIGN_NONE, true);
  m_LBFilters->m_OnSelectItem = boost::bind(&CMGFXFilters::OnSelectFilter,this,_1);
  for (size_t i = 0; i < g_pAppMain->FilterList().size(); i++)
      m_LBFilters->Add(g_pAppMain->FilterList()[i]);

  // Filter slots
  for (int i = 0; i < MAX_FILTERS; i++)
    m_FXFilter[i] = NEW CMGFXFilter(m_PanelSup, this, pEffect, 1+59*i, 82, i);

  OnResize();
}
开发者ID:EQ4,项目名称:neonv2,代码行数:23,代码来源:MGFXFilters.cpp

示例4: switch

 LRESULT D3DWnd::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
     switch (uMsg)
     {
     case WM_PAINT:
         {
             OnRender();
         }
         break;
     case WM_SIZE:
         {
             OnResize(LOWORD(lParam),HIWORD(lParam));
         }
         break;
     default:
         break;
     }
     return WindowWnd::OnSysMessage(uMsg,wParam,lParam);
 }
开发者ID:yearling,项目名称:YYUI,代码行数:19,代码来源:D2DWnd.cpp

示例5: Resize

  void Resize(UPixelScalar width, UPixelScalar height) {
    AssertNoneLocked();
    AssertThread();

#ifndef USE_GDI
    if (width == GetWidth() && height == GetHeight())
      return;

    size = { width, height };

    Invalidate();
    OnResize(size);
#else /* USE_GDI */
    ::SetWindowPos(hWnd, nullptr, 0, 0, width, height,
                   SWP_NOMOVE | SWP_NOZORDER |
                   SWP_NOACTIVATE | SWP_NOOWNERZORDER);
    // XXX store new size?
#endif
  }
开发者ID:Adrien81,项目名称:XCSoar,代码行数:19,代码来源:Window.hpp

示例6: switch

int View3D::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
  switch(uMsg) {
    case WM_MOUSEMOVE:
      OnMouseMove(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
      return 0;

    case WM_LBUTTONUP:
      OnLButtonUp(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
      return 0;

    case WM_LBUTTONDOWN:
      OnLButtonDown(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
      return 0;

    case WM_RBUTTONUP:
      OnRButtonUp(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
      return 0;

    case WM_RBUTTONDOWN:
      OnRButtonDown(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
      return 0;

//    case WM_MOUSEWHEEL:
//      OnMouseWheel(GET_WHEEL_DELTA_WPARAM(wParam));
//      return 0;

    case WM_SIZE:
      OnResize(LOWORD(lParam), HIWORD(lParam));
      return 0;

//    case WM_PAINT:
//      RenderScene();
//      return 0;

    case WM_DESTROY:
      Destroy();
      return 0;
  }

  return (int)DefWindowProc(hWnd, uMsg, wParam, lParam);
}
开发者ID:olegp,项目名称:v3d,代码行数:42,代码来源:View3D.cpp

示例7: if

void HexEditorCtrl::OnMouseRight( wxMouseEvent& event ){
	if(event.GetEventObject() == hex_ctrl)
		LastRightClickAt = hex_ctrl->PixelCoordToInternalPosition( event.GetPosition() )/2;
	else if(event.GetEventObject() == text_ctrl)
		LastRightClickAt = text_ctrl->PixelCoordToInternalPosition( event.GetPosition() );
	else if( event.GetEventObject() == offset_ctrl)
		{
		//m_static_offset->SetLabel( offset_ctrl->hex_offset==true ? _("Offset: DEC") : _("Offset: HEX"));
		//event.Skip(true);
		offset_ctrl->OnMouseRight( event );
		int x,y;
		DoGetSize(&x,&y);
		wxSizeEvent mevent(wxSize(x,y));
		OnResize(mevent);
		return;//to avoid ShowContextMenu
		}
	else
		std::cout << "Right click captured without ctrl!\n";
	ShowContextMenu( event );
	}
开发者ID:sustmi,项目名称:sus107-dt,代码行数:20,代码来源:HexEditorCtrl.cpp

示例8: glEnable

void LoadingObjDemo::Initialize()
{
	glEnable(GL_DEPTH_TEST);
	glClearColor(0.4f, 0.7f, 0.2f, 1.0f);
	PrintUniformInfo();

	program.Initialize();
	program.AddShaderFile(ShaderType::Vertex, "Assets/Shaders/Vertex/uniforms.vert");
	program.AddShaderFile(ShaderType::Fragment, "Assets/Shaders/Fragment/uniforms.frag");
	program.Build();

	input->addBinding(GLFW_KEY_LEFT, [this](InputInfo info){
		camera->MoveLeft();
		program.UpdateUniformBlock("TransformBlock");
	});

	input->addBinding(GLFW_KEY_RIGHT, [this](InputInfo info) {
		camera->MoveRight();
		program.UpdateUniformBlock("TransformBlock");
	});


	input->addBinding(GLFW_KEY_UP, [this](InputInfo info) {
		camera->MoveForward();
		program.UpdateUniformBlock("TransformBlock");
	});

	input->addBinding(GLFW_KEY_DOWN, [this](InputInfo info) {
		camera->MoveBack();
		program.UpdateUniformBlock("TransformBlock");
	});
	
	UniformBufferBlock uniformBufferBlock("TransformBlock", {
		{ "TransformBlock.projection",&camera->GetProjection()[0][0],sizeof(mat4) },
		{ "TransformBlock.view",&camera->GetView()[0][0],sizeof(mat4) },
	});

	program.AddUniformBlock(uniformBufferBlock);
	InitializeObj("Assets/Models/Obj/monkey.obj");
	OnResize(width, height);
}
开发者ID:DarriusWrightGD,项目名称:GraphicsProgramming,代码行数:41,代码来源:LoadingObjDemo.cpp

示例9: BuildUi

void LobbyState::SetServerData(ServerData data)
{
	mServerData = data;

	if(mDatabase->GetPublicIp() == data.publicIp)
		mClient->ConnectToServer(data.localIp);
	else
		mClient->ConnectToServer(data.publicIp);

	mClient->SetServerData(mServerData);
	
	float chatWidth = 600;
	float chatHeight = 250;
	mClient->GetChat()->SetDimensions(GLib::GetClientWidth()/2-chatWidth/2, GLib::GetClientHeight() - chatHeight - 100, chatWidth, chatHeight);

	mIsHost = mClient->GetName() == mServerData.host ? true : false;

	// [NOTE][HACK]
	BuildUi();
	OnResize(GLib::GetClientWidth(), GLib::GetClientHeight());
}
开发者ID:simplerr,项目名称:Project-Warlock,代码行数:21,代码来源:LobbyState.cpp

示例10: OnResize

bool Window::FilterEvent(const Event& event)
{
    // Notify the input object
    myInput.OnEvent(event);

    // Notify resize events to the derived class
    if (event.Type == Event::Resized)
        OnResize();

    // Don't forward to the user MouseMove events generated by SetCursorPosition
    if ((event.Type        == Event::MouseMoved) &&
        (event.MouseMove.X == mySetCursorPosX)   &&
        (event.MouseMove.Y == mySetCursorPosY))
    {
        mySetCursorPosX = 0xFFFF;
        mySetCursorPosY = 0xFFFF;
        return false;
    }

    return true;
}
开发者ID:vidjogamer,项目名称:ProjectTemplate,代码行数:21,代码来源:Window.cpp

示例11: TFormMachine

//---------------------------------------------------------------------------
__fastcall TFormTriplet::TFormTriplet(TComponent* Owner,
    TFormSimStagecraftMain * const formParent)
  : TFormMachine(Owner,formParent),
    mTriplet(boost::shared_ptr<Triplet>(new Triplet))
{

  //Control
  //Connect
  mSocket220_1 = boost::shared_ptr<Socket220Control>(
    new Socket220Control(this,mTriplet->mSocket220_1,ImageSocket220_1));
  mSocket220_2 = boost::shared_ptr<Socket220Control>(
    new Socket220Control(this,mTriplet->mSocket220_2,ImageSocket220_2));
  mSocket220_3 = boost::shared_ptr<Socket220Control>(
    new Socket220Control(this,mTriplet->mSocket220_3,ImageSocket220_3));
  mPlug220 = boost::shared_ptr<Plug220Control>(
    new Plug220Control(this,mTriplet->mPlug,ImagePlug220));

  CreateWatermark(ImageView,ImageWatermark);

  OnResize(0);
}
开发者ID:RLED,项目名称:ProjectRichelBilderbeek,代码行数:22,代码来源:UnitFormTriplet.cpp

示例12: while

void Window::Update(void)
{
	XEvent event;

	// Obtenemos y procesamos los eventos de ventana
	long mascaraWindow = EnterWindowMask | LeaveWindowMask | FocusChangeMask | ResizeRedirectMask ; 
	while (XCheckMaskEvent(Small::Window::Instance().dpy,  mascaraWindow, &event))
	{
		switch(event.type)
		{
			case FocusIn:
				OnFocusIn();
				break;
			case FocusOut:
				OnFocusOut();
				break;
			case ConfigureNotify:
				OnResize(event.xconfigure.width, event.xconfigure.height);
				break;
		};
	};
};
开发者ID:libercv,项目名称:smallengine,代码行数:22,代码来源:linuxwindow.cpp

示例13: sizeof

  void cMainWindow::LoadWindowPosition()
  {
    int iShowCmd = 0;
    int iX = 0;
    int iY = 0;
    int iWidth = 0;
    int iHeight = 0;
    iShowCmd = SW_SHOWNORMAL;
    iWidth = 1080;
    iHeight = 720;
    /*if (settings.GetWindowStateAndPosition(TEXT("Window"), TEXT("Show"), iShowCmd, iX, iY, iWidth, iHeight))*/ {
      // Get a handle to the monitor
      const POINT position = { iX, iY };
      HMONITOR hMonitor = ::MonitorFromPoint(position, MONITOR_DEFAULTTONEAREST);

      // Get the monitor info
      MONITORINFO monInfo;
      monInfo.cbSize = sizeof(MONITORINFO);
      if (::GetMonitorInfo(hMonitor, &monInfo) == 0) {
        LOG<<TEXT("cMainWindow::LoadWindowPosition GetMonitorInfo FAILED, returning")<<std::endl;
        return;
      }

      // Adjust for work area
      iX += monInfo.rcWork.left - monInfo.rcMonitor.left;
      iY += monInfo.rcWork.top  - monInfo.rcMonitor.top;
      // Ensure top left point is on screen
      const POINT point = { iX, iY };
      if (::PtInRect(&monInfo.rcWork, point) == FALSE ) {
        iX = monInfo.rcWork.left;
        iY = monInfo.rcWork.top;
      }

      ::SetWindowPos(hwndWindow, NULL, iX, iY, iWidth, iHeight, iShowCmd);
    }

    OnResize(iWidth, iHeight);
  }
开发者ID:pilkch,项目名称:diesel,代码行数:38,代码来源:win32mmapplication.cpp

示例14: switch

	LRESULT CALLBACK SystemWindow::LocalWndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
		
		switch(msg)
		{
		case WM_SIZE:
			OnResize(static_cast<u32>(LOWORD(lparam)), static_cast<u32>(HIWORD(lparam)), static_cast<window::WINDOW_RESIZE_STATE>(wparam));
			break;
		case WM_MOVE:
			OnMove(static_cast<u32>(LOWORD(lparam)), static_cast<u32>(HIWORD(lparam)));
			break;
		case WM_CLOSE:
			OnClose();
			break;
		case WM_DESTROY:
			OnDestroy();
			break;

		default:
			//We don't handle the message so let the Default Window Proc handle it
			return DefWindowProcW(hwnd, msg, wparam, lparam);
		}
		return 0;
	}
开发者ID:chongtianfeiyu,项目名称:Landan,代码行数:23,代码来源:SystemWindow.cpp

示例15: while

void EmuWindow_SDL2::PollEvents() {
    SDL_Event event;

    // SDL_PollEvent returns 0 when there are no more events in the event queue
    while (SDL_PollEvent(&event)) {
        switch (event.type) {
        case SDL_WINDOWEVENT:
            switch (event.window.event) {
            case SDL_WINDOWEVENT_SIZE_CHANGED:
            case SDL_WINDOWEVENT_RESIZED:
            case SDL_WINDOWEVENT_MAXIMIZED:
            case SDL_WINDOWEVENT_RESTORED:
            case SDL_WINDOWEVENT_MINIMIZED:
                OnResize();
                break;
            case SDL_WINDOWEVENT_CLOSE:
                is_open = false;
                break;
            }
            break;
        case SDL_KEYDOWN:
        case SDL_KEYUP:
            OnKeyEvent(static_cast<int>(event.key.keysym.scancode), event.key.state);
            break;
        case SDL_MOUSEMOTION:
            OnMouseMotion(event.motion.x, event.motion.y);
            break;
        case SDL_MOUSEBUTTONDOWN:
        case SDL_MOUSEBUTTONUP:
            OnMouseButton(event.button.button, event.button.state, event.button.x, event.button.y);
            break;
        case SDL_QUIT:
            is_open = false;
            break;
        }
    }
}
开发者ID:JamePeng,项目名称:citra,代码行数:37,代码来源:emu_window_sdl2.cpp


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