Esempio n. 1
0
	void AppFrame::windowResized( Ogre::RenderWindow* rw )
	{
		KUINT width, height, depth;
		KINT left, top;
		rw->getMetrics(width, height, depth, left, top);

		OnSize(width,height);
Esempio n. 2
0
void CWndRepairItemCtrl::SetWndRect( CRect rectWnd, BOOL bOnSize )
{
	m_rectWindow	= rectWnd;
	m_rectClient	= m_rectWindow;

	if( bOnSize )
		OnSize( 0, m_rectClient.Width(), m_rectClient.Height() );
}
Esempio n. 3
0
void CUploadsWnd::OnSkinChange()
{
	OnSize( 0, 0, 0 );
	CPanelWnd::OnSkinChange();
	Skin.Translate( _T("CUploadCtrl"), &m_wndUploads.m_wndHeader);
	Skin.CreateToolBar( _T("CUploadsWnd"), &m_wndToolBar );
	m_wndUploads.OnSkinChange();
}
Esempio n. 4
0
void MeterToolBar::Create(wxWindow * parent)
{
   ToolBar::Create(parent);

   // Simulate a size event to set initial meter placement/size
   wxSizeEvent dummy;
   OnSize(dummy);
}
Esempio n. 5
0
LONG CuDlgSqlQueryPageXML::OnDisplayHeader (WPARAM wParam, LPARAM lParam)
{
	m_bShowStatement = TRUE;
	CRect r;
	GetClientRect (r);
	OnSize (SIZE_RESTORED, r.Width(), r.Height());
	return 0L;
}
Esempio n. 6
0
void GLCanvas::resize( wxSizeEvent& evt )
{
    gravUtil::logVerbose( "GLCanvas::resize: resize callback: to %ix%i\n",
            evt.GetSize().GetWidth(), evt.GetSize().GetHeight() );
    OnSize( evt );
    Refresh( false );
    GLreshape( evt.GetSize().GetWidth(), evt.GetSize().GetHeight() );
}
Esempio n. 7
0
void CViewStatistics::OnInitialUpdate() 
{
	CFormView::OnInitialUpdate();

	m_pDoc       = (CGnucleusDoc*) GetDocument();
	m_autNetwork = m_pDoc->m_autNetwork;

	// Property Sheets
	m_TabMain		  = new CStatisticsMain(this);
	m_TabDistribution = new CStatisticsDistribution(this);
	m_TabPackets	  = new CStatisticsPackets(this);
	m_TabBandwidth	  = new CStatisticsBandwidth(this);
	m_TabLog		  = new CStatisticsLog;
	m_TabMemory		  = new CStatisticsMemory(this);
	m_TabError		  = new CStatisticsError(this);

	//m_pSheet.AddPage(m_TabMain);
	//m_pSheet.AddPage(m_TabDistribution);
	//m_pSheet.AddPage(m_TabPackets);
	//m_pSheet.AddPage(m_TabBandwidth);
	m_pSheet.AddPage(m_TabLog);
	//m_pSheet.AddPage(m_TabMemory);
	//m_pSheet.AddPage(m_TabError);

	CreatePropSheet(this, &m_pSheet);
	SizePropSheet(this, &m_pSheet, IDC_PSHEET_AREA);

	for(int i = 0; i < m_pSheet.GetPageCount(); ++i)
		m_pSheet.SetActivePage(i);
	m_pSheet.SetActivePage(0);

	// Set Title
	//m_TimeStarted = CTime::GetCurrentTime();
	//GetParentFrame()->SetWindowText("Statistics - " + m_TimeStarted.Format("%I:%M %p"));

	// Connected Nodes listbox
	int offSet = m_lstNodes.GetScrollLimit(SB_VERT) ? ::GetSystemMetrics(SM_CXVSCROLL) + 3 : 4;

	CRect rect;
	m_lstNodes.GetWindowRect(&rect);

	m_lstNodes.InsertColumn( 0, "Node", LVCFMT_LEFT,  rect.Width() - offSet, 0);
	m_lstNodes.InsertColumn( 1, "Type", LVCFMT_LEFT, (rect.Width() - offSet) * 0.5, 1);

	m_lstNodes.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP);
	
	// Size all the controls in proportion to the size
	RECT rWin;
	GetClientRect(&rWin);
	OnSize(SIZE_RESTORED, rWin.right, rWin.bottom);

	m_pDoc->m_pViewStatistics.push_back( GetSafeHwnd() );

	OnSockUpdate();
	/*m_TabDistribution->UpdateDistribution();
	m_TabPackets->UpdateData();
	m_TabBandwidth->UpdateBandwidth();*/
}
Esempio n. 8
0
BOOL CSearchWnd::DoSizeDetails()
{
    MSG* pMsg = &AfxGetThreadState()->m_msgCur;
    CRect rcClient;
    CPoint point;

    GetClientRect( &rcClient );
    if ( m_bPanel )
        rcClient.left += Settings.Skin.SidebarWidth;
    if ( ! ( m_bPaused || m_bWaitMore ) )
        rcClient.top += STATUS_HEIGHT;
    rcClient.bottom -= Settings.Skin.ToolbarHeight;

    ClientToScreen( &rcClient );
    ClipCursor( &rcClient );
    SetCapture();
    ScreenToClient( &rcClient );

    int nOffset = 0xFFFF;

    while ( GetAsyncKeyState( VK_LBUTTON ) & 0x8000 )
    {
        while ( ::PeekMessage( pMsg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE ) );

        if ( ! AfxGetThread()->PumpMessage() )
        {
            AfxPostQuitMessage( 0 );
            break;
        }

        GetCursorPos( &point );
        ScreenToClient( &point );

        int nSplit = rcClient.bottom - point.y;

        if ( nOffset == 0xFFFF ) nOffset = m_nDetails - nSplit;
        nSplit += nOffset;

        if ( nSplit < 8 )
            nSplit = 0;
        if ( nSplit > rcClient.Height() - Settings.Skin.Splitter - 8 )
            nSplit = rcClient.Height() - Settings.Skin.Splitter;

        if ( nSplit != m_nDetails )
        {
            m_nDetails = nSplit;
            Settings.Search.DetailPanelSize = nSplit;
            OnSize( SIZE_INTERNAL, 0, 0 );
            Invalidate();
        }
    }

    ReleaseCapture();
    ClipCursor( NULL );

    return TRUE;
}
BOOL COXLayoutManager::RedrawLayout()
{
	if (m_pContainerWnd == NULL || !::IsWindow(m_pContainerWnd->m_hWnd))
		return FALSE;

	CRect rect;
	m_pContainerWnd->GetClientRect(rect);
	return OnSize(rect.Width(), rect.Height());
}
Esempio n. 10
0
void CWndVendorCtrl::SetWndRect( CRect rectWnd, BOOL bOnSize )
{
	m_rectWindow	= rectWnd;
	m_rectClient	= m_rectWindow;
//	m_rectClient.DeflateRect( 3, 3 );

	if( bOnSize )
		OnSize( 0, m_rectClient.Width(), m_rectClient.Height() );
}
Esempio n. 11
0
// -----------------------------------------------------------------------------
// Called when the dialog is resized
// -----------------------------------------------------------------------------
void GfxConvDialog::onResize(wxSizeEvent& e)
{
	OnSize(e);

	gfx_current_->zoomToFit(true, 0.05f);
	gfx_target_->zoomToFit(true, 0.05f);

	e.Skip();
}
Esempio n. 12
0
void MainFrame::OnSuperBox()
{
	if (!project.IsOpen() || superBox.IsValid())
		return;
	superBox.Create(GetHandle(), "", ChildWindowStyle);
	OnSize(0, {});
	activeWindow.SetPos(superBox, {}, SWP_NOSIZE|SWP_NOMOVE);
	superBox.SetFocus();
}
Esempio n. 13
0
LRESULT CMultiLineEditWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    LRESULT lRes = 0;
    BOOL bHandled = TRUE;
    if( uMsg == WM_SIZE ) lRes = OnSize(uMsg, wParam, lParam, bHandled);
    else bHandled = FALSE;
    if( !bHandled ) return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
    return lRes;
}
  LRESULT CHelloWorld::HandleMessage( UINT uMsg, WPARAM wParam, LPARAM lParam )
  {
      LRESULT lRes = 0;
      BOOL bHandled = TRUE;
      switch (uMsg)
      {
      case WM_CREATE:
          lRes = OnCreate(uMsg ,wParam, lParam, bHandled);
          break;
  
      case WM_DESTROY:
          ::PostQuitMessage(0);
          bHandled = FALSE;
          break;
  
      case WM_NCHITTEST:
          lRes = OnNcHitTest(uMsg, wParam, lParam, bHandled);
          break;
  
      case WM_KEYDOWN:
          if (wParam == VK_ESCAPE)
          {
              OnClose();
          }
         break;
 
     case WM_SIZE:
         lRes = OnSize(uMsg, wParam, lParam, bHandled);
         break;
 
     case WM_NCACTIVATE:
         lRes = OnNcActivate(uMsg, wParam, lParam, bHandled);
         break;
 
     case WM_GETMINMAXINFO:
         lRes = true;
         OnGetMinMaxInfo(uMsg, wParam, lParam, bHandled);        
         break;
 
     case WM_SYSCOMMAND:
         lRes = OnSysCommand(uMsg, wParam, lParam, bHandled); 
         break;
 
     case WM_NCCALCSIZE:
         lRes = OnNcCalcSize(uMsg, wParam, lParam, bHandled); 
         break;
 
     default:
         bHandled = FALSE; break;
     }
     
     if (bHandled) return lRes;
     if (m_pm.MessageHandler(uMsg, wParam, lParam, lRes) != 0)
         return lRes;
     return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
 }
Esempio n. 15
0
LRESULT CEColorDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	GetDlgControl(IDC_COLOR_ALPHASLIDER, IID_IUISlider, (void**)&m_alphaSlider);
	IDispEventImpl<1, CEColorDlg, &DIID__IUISliderEvents, &LIBID_UILib, 1, 0>::DispEventAdvise(m_alphaSlider);

	m_alphaSlider->put_minValue(0);
	m_alphaSlider->put_maxValue(255);

	if (FALSE)
	{
#if 0
		CComPtr<IUnknown> spUnknown;
		::CoCreateInstance(CLSID_LHTMLActiveDocument, NULL, CLSCTX_ALL, IID_IUnknown, (void**)&spUnknown);

		m_htmlActiveDoc = spUnknown;
		if (m_htmlActiveDoc)
		{
			CComQIPtr<IOleDocument> oleDocument = m_htmlActiveDoc;
			CComPtr<IOleDocumentView> oleView;
			oleDocument->CreateView(NULL,// *pIPSite,
				NULL,///* [unique][in] */ IStream __RPC_FAR *pstm,
				0,///* [in] */ DWORD dwReserved,
				&oleView);
			m_htmlView = oleView;
		}
#endif
	}

	m_fillrc = CRect(6, 6, 6+18, 6+18);
	m_strokerc = CRect(6+9, 6+9, 6+18+9, 6+18+9);

	m_colorDlg = CreateColorPicker(m_nColorPicker);
	OnSize();

//	CComQIPtr<IUIActiveManager> uiActiveManager = m_app;
//	uiActiveManager->AddEventHandler(this);
	{
#if 0
		static_cast<CWebXMLViewGroup*>(m_viewGroup.p)->m_currentSelectionStyle->addHandler(this);
#endif
		IDispEventImpl<7, CEColorDlg, &DIID__IEXMLViewGroupEvents, &LIBID_LXMLEDITORLib, 1, 0>::DispEventAdvise(m_viewGroup);

		/*
		CComPtr<ILCSSStyleDeclaration> style;
		m_viewGroup->GetCurrentSelectionCSSStyle(&style);

		style->addHandler(this);
		*/

//		IDispEventImpl<2, CSVGFiltersDlg, &DIID__IWebXMLDocumentEvents, &LIBID_WEBEDITORLib, 1, 0>::DispEventAdvise(m_document);

		OnColorChanged();
	}

	return 0;
}
Esempio n. 16
0
 void SUiAnimationWnd::OnShowWindow( BOOL bShow, UINT nStatus )
 {
     SWindow::OnShowWindow(bShow,nStatus);
     if(bShow && m_bResized)
     {
         CRect rcClient;
         GetClientRect(&rcClient);
         OnSize(0,rcClient.Size());
     }
 }
// Load a bitmap from the resources in the button, the bitmap has to have 3 buttonsstates next to each other: Up/Down/Hover
BOOL CToolTipBitmapButton::LoadBitmap(HANDLE hbitmap)
{
	m_Bitmap.Attach(hbitmap);
	BITMAP	bitmapbits;
	m_Bitmap.GetBitmap(&bitmapbits);
	m_ButtonSize.cy=bitmapbits.bmHeight;
	m_ButtonSize.cx=bitmapbits.bmWidth/4; // up, down, focused, disabled
	OnSize(0,m_ButtonSize.cx,m_ButtonSize.cy);
	return TRUE;
}
Esempio n. 18
0
void CPlayerWnd::OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd)
{
	if ( bActivate )
	{
		wndPanel.SetParent( this );
		OnSize( SIZE_INTERNAL, 0, 0 );
	}
	
	CChildWnd::OnMDIActivate( bActivate, pActivateWnd, pDeactivateWnd );
}
Esempio n. 19
0
rviewLookScaleDialog::rviewLookScaleDialog(rmanClientApp *parentApp, const char *name, double scale) : rviewFrame(NULL, lman->lookup("titleLookScaleColl"), -1, -1, lkscale_width, lkscale_height)
{
    panel = new wxPanel(this, 0, 0, lkscale_width, lkscale_height);
    panel->SetLabelPosition(wxVERTICAL);
    collName = new rviewText(panel, name);
    scaleString = new rviewText(panel, scale);
    okBut = new rviewButton(panel);
    cancelBut = new rviewButton(panel);
    parent = parentApp;
    label();

    frameWidth=-1;
    frameHeight=-1;

    OnSize(lkscale_width, lkscale_height);
    OnSize(lkscale_width, lkscale_height);

    Show(TRUE);
}
Esempio n. 20
0
BOOL CLayoutManager::OnWndMsg(UINT message, 
                              WPARAM wParam, LPARAM lParam, 
                              LRESULT * pResult,
			      BOOL bPeek)
{
	int i;
	
	if (! m_bActive)
		return FALSE;

	switch (message)
	{
	case WM_GETMINMAXINFO:
		if (! bPeek)
		{
			MINMAXINFO * pMMI = (LPMINMAXINFO) lParam;
			pMMI->ptMinTrackSize.x = m_dwMinWidth;
			pMMI->ptMinTrackSize.y = m_dwMinHeight;
		}
		break;

	case WM_NCCALCSIZE:
		if (wParam)
			OnNcCalcSize(bPeek, (LPNCCALCSIZE_PARAMS)lParam, pResult);
		break;

	case WM_ERASEBKGND:
		OnEraseBkgnd(bPeek, (HDC)wParam);
		break;

	case WM_SIZE:
		if (! bPeek)
			OnSize(LOWORD(lParam), HIWORD(lParam));
		break;

	case WM_MOVING:
		if (bPeek)
		{
			OnMoving(wParam, (RECT*)lParam); 
			*pResult = TRUE;
			return TRUE;
		}
		break;

	case WM_ENTERSIZEMOVE:
	case WM_EXITSIZEMOVE:
		if (! bPeek)
			break;
		for (i=0; i<m_vControls.size(); i++)
			m_vControls[i].pWnd->SendMessage(message, wParam, lParam);
		break;
	}

	return FALSE;
}
Esempio n. 21
0
BOOL CLibraryFrame::DoSizePanel()
{
	MSG* pMsg = &AfxGetThreadState()->m_msgCur;
	CRect rcClient;
	CPoint point;

	GetClientRect( &rcClient );
	rcClient.left += m_nTreeSize + Settings.Skin.Splitter;
	rcClient.top += Settings.Skin.ToolbarHeight + m_nHeaderSize;
	rcClient.bottom -= Settings.Skin.ToolbarHeight;
	ClientToScreen( &rcClient );
	ClipCursor( &rcClient );
	SetCapture();

	ScreenToClient( &rcClient );

	int nOffset = 0xFFFF;

	while ( GetAsyncKeyState( VK_LBUTTON ) & 0x8000 )
	{
		while ( ::PeekMessage( pMsg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE ) );

		if ( ! AfxGetThread()->PumpMessage() )
		{
			AfxPostQuitMessage( 0 );
			break;
		}

		GetCursorPos( &point );
		ScreenToClient( &point );

		int nSplit = rcClient.bottom - point.y;

		if ( nOffset == 0xFFFF )
			nOffset = m_nPanelSize - nSplit;
		nSplit += nOffset;

		if ( nSplit < 8 )
			nSplit = 0;
		if ( nSplit > rcClient.Height() - Settings.Skin.Splitter - 8 )
			nSplit = rcClient.Height() - Settings.Skin.Splitter;

		if ( nSplit != m_nPanelSize )
		{
			m_nPanelSize = nSplit;
			OnSize( 1982, 0, 0 );
			Invalidate();
		}
	}

	ReleaseCapture();
	ClipCursor( NULL );

	return TRUE;
}
Esempio n. 22
0
BOOL CSnapView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
	DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
	ENSURE(pParentWnd != NULL);
	ASSERT_KINDOF(CFrameWnd, pParentWnd);

	if (!CWnd::Create(lpszClassName, lpszWindowName, dwStyle | WS_CLIPCHILDREN,
		rect, pParentWnd, nID, pContext))
	{
		return FALSE;
	}

	// add your pages here!

	m_pPageBkfst = new CBkfstPage;
	m_pPageLunch = new CLunchPage;
	m_pPageDinner = new CDinnerPage;

	// create the window object

	m_pPropSheet = new CSnapPropertySheet;
	m_pPropSheet->AddPage(m_pPageBkfst);
	m_pPropSheet->AddPage(m_pPageLunch);
	m_pPropSheet->AddPage(m_pPageDinner);

	// create a modeless property page
	if (!m_pPropSheet->Create(this,
			DS_CONTEXTHELP | DS_SETFONT | WS_CHILD | WS_VISIBLE))
	{
		DestroyWindow();
		return FALSE;
	}

	m_pPropSheet->SetWindowPos(NULL, 0, 0, 0, 0,
			SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE);

	// we use the style from the template - but make sure that
	// the WS_BORDER bit is correct.
	// the WS_BORDER bit will be whatever is in dwRequestedStyle

	m_pPropSheet->ModifyStyle(WS_BORDER|WS_CAPTION,
		dwStyle & (WS_BORDER|WS_CAPTION));

	// Force the size requested.
	// Fake a call to OnSize()--it would have been called automatically
	// if this were using the base class implementation of Create().

	CFrameWnd* pParentFrame = GetParentFrame();
	CRect rectSize;
	m_pPropSheet->GetWindowRect(rectSize);
	pParentFrame->CalcWindowRect(rectSize);
	OnSize(SIZE_RESTORED, rectSize.Width(), rectSize.Height());

	return TRUE;
}
Esempio n. 23
0
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 打开文件对话框回调函数
UINT_PTR CALLBACK COpenDlg::OpenDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	UINT i;
	POINT ptPoint;

	switch (uMsg)
	{
	case WM_INITDIALOG:
		m_hWnd = hWnd;
		m_hParent = GetParent(m_hWnd);
		OnInitDialog();
		break;

	case WM_NOTIFY:
		return OnNotify(wParam, lParam);

	case WM_SIZE:
		OnSize();
		break;

	case WM_COMMAND:
		OnCommand(wParam, lParam);
		break;

	case WM_PAINT:
		OnPaint();
		break;

	case WM_LBUTTONDOWN:
		if (CanPreview())
		{
			ptPoint.x = LOWORD(lParam);
			ptPoint.y = HIWORD(lParam);
			if (PtInRect(&m_rtPreview, ptPoint))
			{
				m_pWnd->StepFrame((wParam & MK_CONTROL) ? -1 : 1);
			}
		}
		break;

	case WM_NCDESTROY:
		for (i = 0; i < _NumOf(m_hImageLists); i++)
		{
			ImageList_Destroy(m_hImageLists[i]);
		}
		if (m_hFormatMenu)
		{
			DestroyMenu(m_hFormatMenu);
			m_hFormatMenu = NULL;
		}
		break;
	}

	return 0;
}
Esempio n. 24
0
LRESULT CALLBACK EditorWindow::WindowsProcedure(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	int xPos, yPos;
	static HINSTANCE hInst = GetModuleHandle(NULL);
	HWND hBufferHwnd;
	char s[100];
	IDevice* device;
	int cxClient, cyClient;
	EditorScene* scene = EditorScene::getInstance();
	switch (msg)
	{
	case WM_CREATE:
		OnCreate(hInst, hwnd);
		break;
	case WM_SIZE:
		cxClient = LOWORD(lParam);
		cyClient = HIWORD(lParam);
		OnSize(cxClient, cyClient);
		break;
	case WM_LBUTTONDOWN:
		xPos = LOWORD(lParam);
		yPos = HIWORD(lParam);
		MouseLeftButtonDown(xPos, yPos);
		break;
	case WM_RBUTTONDOWN:
		xPos = LOWORD(lParam);
		yPos = HIWORD(lParam);
		MouseRightButtonDown(xPos, yPos);
		break;
	case WM_RBUTTONUP:
		xPos = LOWORD(lParam);
		yPos = HIWORD(lParam);
		MouseRightButtonUp(xPos, yPos);
		break;
	case WM_MOUSEMOVE:
		xPos = LOWORD(lParam);
		yPos = HIWORD(lParam);
		MouseMove(xPos, yPos);
		break;
	case WM_LBUTTONDBLCLK:
		xPos = LOWORD(lParam);
		yPos = HIWORD(lParam);
		MouseDoubleClicked(xPos, yPos);
		break;
	case WM_COMMAND:
		OnCommand(LOWORD(wParam), HIWORD(wParam), wParam, lParam);
		break;
	case WM_CTLCOLORSTATIC:
		SetTextColor((HDC)wParam, RGB(230,0,0));   // iTextColor is the RGB() color you want for the text
		SetBkColor((HDC)wParam, RGB(230, 0, 0));  // iBkColor is the color you want for the text background 
		return (LRESULT)CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
	}

	return 0;
}
Esempio n. 25
0
void CLogWnd::OnScaleChanged()
{
	GETTHEMEFONT(&m_font, _T("LogWnd"), _T("Font"));
	m_edit.SetFont(m_font);

	MoveWindow(m_edit, 0, 0, 0, 0);
	Invalidate(m_hWnd);
	RECT rc;
	GetClientRect(m_hWnd, &rc);
	OnSize(0, (WORD)rc.right, (WORD)rc.bottom);
}
Esempio n. 26
0
BOOL CChatWnd::DoSizeView()
{
    MSG* pMsg = &AfxGetThreadState()->m_msgCur;

    CRect rcClient;
    GetClientRect( &rcClient );
    ClientToScreen( &rcClient );
    ClipCursor( &rcClient );
    SetCapture();

    GetClientRect( &rcClient );

    int nOffset = 0xFFFF;

    while ( GetAsyncKeyState( VK_LBUTTON ) & 0x8000 )
    {
        while ( ::PeekMessage( pMsg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE ) );

        if ( ! AfxGetThread()->PumpMessage() )
        {
            AfxPostQuitMessage( 0 );
            break;
        }

        CPoint point;
        GetCursorPos( &point );
        ScreenToClient( &point );

        int nSplit = rcClient.right - point.x;

        if ( nOffset == 0xFFFF ) nOffset = m_nUsersSize - nSplit;
        nSplit += nOffset;

        nSplit = max( nSplit, 0 );
        nSplit = min( nSplit, (int)rcClient.right - SPLIT_SIZE );

        if ( nSplit < 8 )
            nSplit = 0;
        if ( nSplit > rcClient.right - SPLIT_SIZE - 8 )
            nSplit = rcClient.right - SPLIT_SIZE;

        if ( nSplit != m_nUsersSize )
        {
            m_nUsersSize = nSplit;
            OnSize( 1982, 0, 0 );
            Invalidate();
        }
    }

    ReleaseCapture();
    ClipCursor( NULL );

    return TRUE;
}
Esempio n. 27
0
	void CControlUI::SetPos(RECT rc, bool bNeedInvalidate)
	{
		if( rc.right < rc.left ) rc.right = rc.left;
		if( rc.bottom < rc.top ) rc.bottom = rc.top;

		CDuiRect invalidateRc = m_rcItem;
		if( ::IsRectEmpty(&invalidateRc) ) invalidateRc = rc;

		if( m_bFloat ) {
			CControlUI* pParent = GetParent();
			/*if( pParent != NULL ) {
				RECT rcParentPos = pParent->GetPos();
				RECT rcCtrl = {rcParentPos.left + rc.left, rcParentPos.top + rc.top, 
					rcParentPos.left + rc.right, rcParentPos.top + rc.bottom};
				m_rcItem = rcCtrl;

				LONG width = rcParentPos.right - rcParentPos.left;
				LONG height = rcParentPos.bottom - rcParentPos.top;
				RECT rcPercent = {(LONG)(width*m_piFloatPercent.left), (LONG)(height*m_piFloatPercent.top),
					(LONG)(width*m_piFloatPercent.right), (LONG)(height*m_piFloatPercent.bottom)};
				m_cXY.cx = rc.left - rcPercent.left;
				m_cXY.cy = rc.top - rcPercent.top;
				m_cxyFixed.cx = rc.right - rcPercent.right - m_cXY.cx;
				m_cxyFixed.cy = rc.bottom - rcPercent.bottom - m_cXY.cy;
			}*/
		}
		else {
			m_rcItem = rc;
		}
		m_rcItem = rc;
		if( m_pManager == NULL ) return;

		if( !m_bSetPos ) {
			m_bSetPos = true;
			if( OnSize ) OnSize(this);
			m_bSetPos = false;
		}

		m_bUpdateNeeded = false;

		if( bNeedInvalidate && IsVisible() ) {
			invalidateRc.Join(m_rcItem);
			CControlUI* pParent = this;
			RECT rcTemp;
			RECT rcParent;
			while( pParent = pParent->GetParent() ) {
				if( !pParent->IsVisible() ) return;
				rcTemp = invalidateRc;
				rcParent = pParent->GetPos();
				if( !::IntersectRect(&invalidateRc, &rcTemp, &rcParent) ) return;
			}
			m_pManager->Invalidate(invalidateRc);
		}
	}
Esempio n. 28
0
void CReBar::OnScaleChanged()
{
	m_fntSearch.Create(m_strSearchBoxFont, m_fSearchBoxFontSize);
	m_eSearch.SetFont(m_fntSearch);

	RECT rc;
	GetClientRect(m_hWnd, &rc);
	OnSize(0, (WORD)rc.right, (WORD)rc.bottom);

	Draw();
}
Esempio n. 29
0
void CCWidget::SetSize(int w, int h){
	if(w<0) w = 1;
	if(h<0) h = 1;

	ResizeChildrenByAnchor(w, h);

	m_Rect.w = w;
	m_Rect.h = h;

	OnSize(w, h);
}
Esempio n. 30
0
LRESULT CALLBACK FEditorViewport::WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
	switch (uMsg)
	{
		case WM_SIZE:
		{
			OnSize( LOWORD( lParam ), HIWORD( lParam ) );
		}
	}
	return 0; //We're transferring control back to C# after this
}