本文整理汇总了C++中GetRect函数的典型用法代码示例。如果您正苦于以下问题:C++ GetRect函数的具体用法?C++ GetRect怎么用?C++ GetRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetRect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetActiveView
BOOL CRectItem::OnChangeItemPosition(const CRect& rectPos)
{
CMainView* pView = GetActiveView();
if (pView == NULL)
return FALSE;
ASSERT_VALID(pView);
CRect rc = rectPos;
pView->ClientToDoc(rc);
if (rc != GetRect())
{
// The following lines were commented out because of a bug
// in Microsoft Equation Editor 3.0. The rc keeps growing
// when activated/deactivated.
// Uncomment them if necessary for other objects.
/*
// invalidate old item
Invalidate();
// update to new rectangle
SetRect(rc);
*/
GetDocument()->SetModifiedFlag();
/*
CSize sizeExtent;
GetCachedExtent(&sizeExtent);
SetBaseSize(sizeExtent);
*/
// and invalidate new
Invalidate();
}
return COleClientItem::OnChangeItemPosition(rectPos);
}
示例2: GetTheme
// Rendering:
bool nuiWindow::Draw(nuiDrawContext* pContext)
{
pContext->PushState();
pContext->ResetState();
nuiWindowManager* pRoot = dynamic_cast<nuiWindowManager*>(mpParent);
pContext->EnableBlending(false);
if (!mRawWindow)
{
nuiTheme* pTheme = GetTheme();
NGL_ASSERT(pTheme);
pTheme->DrawWindowShade(pContext, mRect.Size(), nuiColor(1.0f, 1.0f, 1.0f, GetMixedAlpha()), IsParentActive());
pContext->PushClipping();
pContext->Clip(GetRect().Size());
pContext->EnableClipping(true);
if (pRoot->GetActiveWindow() == this)
{
if (mMoving)
pTheme->DrawMovingWindow(pContext, this);
else
pTheme->DrawActiveWindow(pContext, this);
}
else
pTheme->DrawWindow(pContext,this);
pTheme->Release();
pContext->PopClipping();
}
DrawChildren(pContext);
return true;
}
示例3: CHECK_PTR_RET
void wxCodeCompletionBox::DoShowCompletionBox()
{
CHECK_PTR_RET(m_stc);
// guesstimate a line height
wxMemoryDC dc;
wxBitmap bmp(1, 1);
dc.SelectObject(bmp);
wxFont font = m_stc->StyleGetFont(0);
dc.SetFont(font);
wxSize textSize = dc.GetTextExtent("Tp");
int lineHeight = textSize.y + 3; // 3 pixels margins
wxRect rect = GetRect();
wxSize screenSize = ::wxGetDisplaySize();
// determine the box x position
int wordStart = m_startPos;
wxPoint pt = m_stc->PointFromPosition(wordStart);
pt = m_stc->ClientToScreen(pt);
pt.y += lineHeight;
// Check Y axis
if((pt.y + rect.GetHeight()) > screenSize.GetHeight()) {
// the completion box goes out of the Y axis, move it up
pt.y -= lineHeight;
pt.y -= rect.GetHeight();
}
// Check X axis
if((pt.x + rect.GetWidth()) > screenSize.GetWidth()) {
// the completion box goes out of the X axis. Move it to the left
pt.x -= ((pt.x + rect.GetWidth()) - screenSize.GetWidth());
}
Move(pt);
Show();
}
示例4: GetScreenPosition
void MainEmuFrame::OnMoveAround( wxMoveEvent& evt )
{
if( IsBeingDeleted() || !IsVisible() || IsIconized() ) return;
// Uncomment this when doing logger stress testing (and then move the window around
// while the logger spams itself)
// ... makes for a good test of the message pump's responsiveness.
if( EnableThreadedLoggingTest )
Console.Warning( "Threaded Logging Test! (a window move event)" );
// evt.GetPosition() returns the client area position, not the window frame position.
// So read the window's screen-relative position directly.
g_Conf->MainGuiPosition = GetScreenPosition();
// wxGTK note: X sends gratuitous amounts of OnMove messages for various crap actions
// like selecting or deselecting a window, which muck up docking logic. We filter them
// out using 'lastpos' here. :)
static wxPoint lastpos( wxDefaultCoord, wxDefaultCoord );
if( lastpos == evt.GetPosition() ) return;
lastpos = evt.GetPosition();
if( g_Conf->ProgLogBox.AutoDock )
{
if (ConsoleLogFrame* proglog = wxGetApp().GetProgramLog())
{
if (!proglog->IsMaximized())
{
g_Conf->ProgLogBox.DisplayPosition = GetRect().GetTopRight();
proglog->SetPosition(g_Conf->ProgLogBox.DisplayPosition);
}
}
}
evt.Skip();
}
示例5: GetRect
void CFilterEdit::ResizeWindow()
{
if (!::IsWindow(m_hWnd))
return;
CRect editrc, rc;
GetRect(&editrc);
GetClientRect(&rc);
editrc.left = rc.left + 4;
editrc.top = rc.top + 1;
editrc.right = rc.right - 4;
editrc.bottom = rc.bottom - 4;
CWindowDC dc(this);
HGDIOBJ oldFont = dc.SelectObject(GetFont()->GetSafeHandle());
TEXTMETRIC tm = { 0 };
dc.GetTextMetrics(&tm);
dc.SelectObject(oldFont);
m_rcEditArea.left = editrc.left + m_sizeInfoIcon.cx;
m_rcEditArea.right = editrc.right - m_sizeCancelIcon.cx - 5;
m_rcEditArea.top = (rc.Height() - tm.tmHeight) / 2;
m_rcEditArea.bottom = m_rcEditArea.top + tm.tmHeight;
m_rcButtonArea.left = m_rcEditArea.right + 5;
m_rcButtonArea.right = rc.right;
m_rcButtonArea.top = (((rc.bottom)-m_sizeCancelIcon.cy)/2);
m_rcButtonArea.bottom = m_rcButtonArea.top + m_sizeCancelIcon.cy;
m_rcInfoArea.left = 0;
m_rcInfoArea.right = m_rcEditArea.left;
m_rcInfoArea.top = (((rc.bottom)-m_sizeInfoIcon.cy)/2);
m_rcInfoArea.bottom = m_rcInfoArea.top + m_sizeInfoIcon.cy;
SetRect(&m_rcEditArea);
}
示例6: GetGC
void FileDialog::OnPaint()
{
axGC* gc = GetGC();
axRect rect(GetRect());
axRect rect0(axPoint(0, 0), rect.size);
// Background.
gc->SetColor(axColor(0.9, 0.9, 0.9), 1.0);
gc->DrawRectangle(rect0);
// Icon bar.
axRect iconBarRect(1, 1, rect0.size.x - 1, 31);
gc->DrawRectangle(iconBarRect);
gc->DrawRectangleColorFade(iconBarRect,
axColor(0.6, 0.6, 0.6), 1.0,
axColor(0.7, 0.7, 0.7), 1.0);
gc->SetColor(axColor(0.0, 0.0, 0.0), 1.0);
gc->DrawRectangleContour(iconBarRect);
// Folder name.
gc->SetColor(axColor(0.2, 0.2, 0.2), 1.0);
gc->SetFontSize(14);
gc->DrawString(_dirNavigation->GetCurrentDirectoryName(), axPoint(50, 7));
axRect buttonBarRect(1, rect0.size.y - 30, rect0.size.x - 1, 30);
gc->DrawRectangle(buttonBarRect);
gc->DrawRectangleColorFade(buttonBarRect,
axColor(0.6, 0.6, 0.6), 1.0,
axColor(0.7, 0.7, 0.7), 1.0);
gc->SetColor(axColor(0.0, 0.0, 0.0), 1.0);
gc->DrawRectangleContour(buttonBarRect);
}
示例7: input
CString CDiagramGroupbox::Export( UINT /*format*/ )
/* ============================================================
Function : CDiagramGroupbox::Export
Description : Exports this object to str using format
Return : CString - The resulting string
Parameters : UINT format - The format to export to
Usage : An example Export-function. In this case,
we are not using the format parameter, as
we only have one format.
============================================================*/
{
return "";
CString input( "\t<div class='controls' style='border-width:2;border-style:groove;position:absolute;left:%i;top:%i;width:%i;height:%i;'><div class='controls' style='position:absolute;left:6;top:-6;background-color:#c0c0c0;'>%s</div></div>" );
CString str;
CRect rect = GetRect();
CString title = GetTitle();
title.Replace( " ", " " );
str.Format( input, rect.left - 2, rect.top - 2, rect.Width(), rect.Height(), title );
return str;
}
示例8: GetRect
// virtual, overloaded from nuiWidget, to be able to draw the oscillo manually
bool guiOscillo::Draw(nuiDrawContext* pContext)
{
if (mrData.empty())
return false;
const nuiRect& rect = GetRect();
uint32 s1 = mrData[0].size();
uint32 s2 = rect.GetWidth();
uint32 count = MIN(s1, s2);
nuiSize hi = rect.GetHeight();
nuiSize mid = hi / 2;
nuiColor color[2];
color[0] = nuiColor(84,117,203);
color[1] = nuiColor(200,0,0);
for (uint32 c = 0; c < mrData.size(); c++)
{
nuiRenderArray* pArray = new nuiRenderArray(GL_LINE_STRIP);
pArray->EnableArray(nuiRenderArray::eColor, true);
pArray->SetColor(color[c]);
for (uint32 s = 0; s < count; s++)
{
float value = mrData[c][s];
pArray->SetVertex(s, mid + hi * value);
pArray->PushVertex();
}
pContext->DrawArray(pArray);
}
return true;
}
示例9: OnPaint
void Widget::Render(RenderTarget& target, RenderQueue& queue) const
{
OnPaint(target, queue);
if (mUseScissor)
{
Area& area = ResourceManager::Get()->WidgetArea;
area.PushArea(GetRect(true));
const FloatRect& top = area.GetTopArea();
target.Flush();
RenderChildren(target, queue);
queue.SetScissor(true, Vector2f(top.Left, target.GetHeight() - top.Bottom), Vector2f(top.GetSize().x, top.GetSize().y));
target.Flush();
area.PopArea();
}
else
{
queue.SetScissor(false);
RenderChildren(target, queue);
}
}
示例10: GetRect
BOOL CGumpButton::FromString( XML::Node* node )
{
if (!CGumpEntity::FromString(node)) return FALSE;
int normal, over, pressed;;
XML::Node* gump_node = node->findNode("gump");
if (gump_node) {
gump_node->lookupAttribute("normal", normal);
gump_node->lookupAttribute("over", over);
gump_node->lookupAttribute("pressed", pressed);
}
CSize size = GetRect().Size();
SetConstraints(size,size);
CGumpEditorDoc* pDoc = GfxGetGumpDocument(); ASSERT(pDoc);
m_pGump[NORMAL] = pDoc->LoadGump(normal);
m_pGump[HOVER] = pDoc->LoadGump(over);
m_pGump[PRESSED] = pDoc->LoadGump(pressed);
return TRUE;
}
示例11: CalcLineNumberWidth
void CLineNumberEdit::Prepare()
{
// Calc sizes
int width = CalcLineNumberWidth();
CRect rect;
GetClientRect( &rect );
CRect rectEdit( rect );
rect.right = width;
rectEdit.left = rect.right + 3;
// Setting the edit rect and
// creating or moving child control
SetRect( &rectEdit );
if( m_line.m_hWnd )
m_line.MoveWindow( 0, 0, width, rect.Height() );
else
m_line.Create(NULL,WS_CHILD | WS_VISIBLE | SS_NOTIFY, rect, this, 1 );
GetRect( &rectEdit );
// Update line number control data
m_line.SetTopMargin( rectEdit.top );
UpdateTopAndBottom();
}
示例12: GetRect
void duListCtrl::AdjustVisibleLine(int nTop)
{
duRect rcListCtrl;
GetRect(&rcListCtrl);
int i;
for (i = m_nFirstLine; i < m_vtLines.size(); i++)
{
duPlugin *pTemp = m_vtLines[i];
if (pTemp)
{
duRect rcTemp;
pTemp->GetRect(&rcTemp);
pTemp->SetPosTop(nTop);
pTemp->Resize(NULL);
pTemp->SetVisible(TRUE); // 后面的控件还需要SetVisible(FALSE);
nTop += rcTemp.Height();
if (nTop >= rcListCtrl.Height())
break;
}
}
}
示例13: input
CString CDiagramCombobox::Export( UINT /*format*/ )
/* ============================================================
Function : CDiagramCombobox::Export
Description : Exports this object to str using format
Return : CString - The resulting string
Parameters : UINT format - The format to export to
Usage : An example Export-function. In this case,
we are not using the format parameter, as
we only have one format.
============================================================*/
{
return "";
CString input( "\t<select class='controls' style='position:absolute;left:%i;top:%i;width:%i;height:%i;' onchange='JavaScript:comboboxHandler(this)' name='%s'></select>" );
CString str;
CRect rect = GetRect();
str.Format( input, rect.left - 2, rect.top - 2, rect.Width(), rect.Height(), GetName() );
return str;
}
示例14: rg
void ConsoleCanvas::MouseEvent(wxMouseEvent& event)
{
m_pParent->SetCursor ( wxCURSOR_ARROW );
int x,y;
event.GetPosition(&x, &y);
// Check the region of the Route/Leg button
#ifdef __WXMSW__
if(event.LeftDown())
{
wxRegion rg(m_pLegRouteButton->GetRect());
if(rg.Contains(x,y) == wxInRegion)
{
m_bShowRouteTotal = !m_bShowRouteTotal;
if(m_bShowRouteTotal)
pThisLegBox->SetLabel(_("Route"));
else
pThisLegBox->SetLabel(_("This Leg"));
pThisLegBox->Refresh(true);
}
}
/// Why is this necessary???
// Because of the CaptureMouse call in chcanv.cpp when mouse enters concanv region
wxRect rr = GetRect();
if(!rr.Contains(x + rr.x, y + rr.y) )
ReleaseMouse();
#endif
}
示例15: SGD_ASSERT
void Player::Render(void) {
if (m_pCharaterAnim != nullptr) {
// Validate the image
SGD_ASSERT(m_hImage != SGD::INVALID_HANDLE, "Entity::Render - image was not set!");
SGD::Point ptOffset = SGD::Point{
(m_ptPosition /*- m_szSize / 2*/).x - GameplayState::GetInstance()->GetWorldCamPosition().x,
(m_ptPosition /*- m_szSize / 2*/).y - GameplayState::GetInstance()->GetWorldCamPosition().y
};
SGD::Rectangle rectOffset = GetRect();
rectOffset.Offset(-GameplayState::GetInstance()->GetWorldCamPosition().x, -GameplayState::GetInstance()->GetWorldCamPosition().y);
// Draw the image
SGD::GraphicsManager::GetInstance()->DrawRectangle(rectOffset, SGD::Color(255, 255, 0));
//SGD::GraphicsManager::GetInstance()->DrawTexture(m_hImage, ptOffset, m_fRotation, m_szSize / 2, SGD::Color{ 255, 255, 255 });
//SGD::GraphicsManager::GetInstance()->DrawTextureSection(m_hImage, ptOffset, {0.0f, 0.0f, 64.0f, 64.0f}, m_fRotation, m_szSize / 2, SGD::Color{ 255, 255, 255 });
m_pCharaterAnim->Render(ptOffset, m_bIsFlipped);
}
}