本文整理汇总了C++中wxRect::GetRight方法的典型用法代码示例。如果您正苦于以下问题:C++ wxRect::GetRight方法的具体用法?C++ wxRect::GetRight怎么用?C++ wxRect::GetRight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxRect
的用法示例。
在下文中一共展示了wxRect::GetRight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _Draw
//---------------------------------------------------------
void CVIEW_ScatterPlot::_Draw(wxDC &dc, wxRect r)
{
r = _Draw_Get_rDiagram(r);
if( m_Trend.Get_Data_Count() > 1 )
{
//-------------------------------------------------
if( m_Options("DISPLAY")->asInt() == 1 )
{
if( m_Options("DENSITY_LEG")->asBool() )
{
r.SetRight(r.GetRight() - 40);
_Draw_Legend(dc, wxRect(r.GetRight() + 10, r.GetTop(), 40 - 20, r.GetHeight()));
}
_Draw_Image (dc, r);
}
else
{
_Draw_Points(dc, r);
}
//-------------------------------------------------
_Draw_Frame(dc, r);
}
else
{
Draw_Text(dc, TEXTALIGN_CENTER, r.GetLeft() + r.GetWidth() / 2, r.GetTop() + r.GetHeight() / 2, _TL("Invalid data!"));
}
}
示例2: OnDrawSeparator
void MyHtmlListBox::OnDrawSeparator(wxDC& dc, wxRect& rect, size_t) const
{
if ( ((MyFrame *)GetParent())->
GetMenuBar()->IsChecked(HtmlLbox_DrawSeparator) )
{
dc.SetPen(*wxBLACK_DASHED_PEN);
dc.DrawLine(rect.x, rect.y, rect.GetRight(), rect.y);
dc.DrawLine(rect.x, rect.GetBottom(), rect.GetRight(), rect.GetBottom());
}
}
示例3: DrawPageBackground
void wxRibbonAUIArtProvider::DrawPageBackground(
wxDC& dc,
wxWindow* WXUNUSED(wnd),
const wxRect& rect)
{
dc.SetPen(*wxTRANSPARENT_PEN);
dc.SetBrush(m_background_brush);
dc.DrawRectangle(rect.x + 1, rect.y, rect.width - 2, rect.height - 1);
dc.SetPen(m_page_border_pen);
dc.DrawLine(rect.x, rect.y, rect.x, rect.y + rect.height);
dc.DrawLine(rect.GetRight(), rect.y, rect.GetRight(), rect.y +rect.height);
dc.DrawLine(rect.x, rect.GetBottom(), rect.GetRight()+1, rect.GetBottom());
}
示例4: DrawFocus
//
// Draws a focus rectangle (Taken directly from wxWidgets source)
//
void AColor::DrawFocus(wxDC & dc, wxRect & rect)
{
// draw the pixels manually: note that to behave in the same manner as
// DrawRect(), we must exclude the bottom and right borders from the
// rectangle
wxCoord x1 = rect.GetLeft(),
y1 = rect.GetTop(),
x2 = rect.GetRight(),
y2 = rect.GetBottom();
dc.SetPen(wxPen(wxT("MEDIUM GREY"), 0, wxSOLID));
// this seems to be closer than what Windows does than wxINVERT although
// I'm still not sure if it's correct
dc.SetLogicalFunction(wxAND_REVERSE);
wxCoord z;
for ( z = x1 + 1; z < x2; z += 2 )
dc.DrawPoint(z, y1);
wxCoord shift = z == x2 ? 0 : 1;
for ( z = y1 + shift; z < y2; z += 2 )
dc.DrawPoint(x2, z);
shift = z == y2 ? 0 : 1;
for ( z = x2 - shift; z > x1; z -= 2 )
dc.DrawPoint(z, y2);
shift = z == x1 ? 0 : 1;
for ( z = y2 - shift; z > y1; z -= 2 )
dc.DrawPoint(x1, z);
dc.SetLogicalFunction(wxCOPY);
}
示例5: DoRefreshRect
void wxWindowDFB::DoRefreshRect(const wxRect& rect)
{
wxWindow *parent = GetParent();
wxCHECK_RET( parent, "no parent" );
// don't overlap outside of the window (NB: 'rect' is in window coords):
wxRect r(rect);
r.Intersect(wxRect(GetSize()));
if ( r.IsEmpty() )
return;
wxLogTrace(TRACE_PAINT,
"%p ('%s'): refresh rect [%i,%i,%i,%i]",
this, GetName().c_str(),
rect.x, rect.y, rect.GetRight(), rect.GetBottom());
// convert the refresh rectangle to parent's coordinates and
// recursively refresh the parent:
r.Offset(GetPosition());
r.Offset(parent->GetClientAreaOrigin());
// normal windows cannot extend out of its parent's client area, so don't
// refresh any hidden parts:
if ( !CanBeOutsideClientArea() )
r.Intersect(parent->GetClientRect());
parent->DoRefreshRect(r);
}
示例6: InvalidateRect
void Stage::InvalidateRect(const wxRect &inRect) {
wxLogTrace(TRACE_STAGE_DRAWING, wxT("Invalidating: %d %d %d %d"),
inRect.x, inRect.y, inRect.GetRight(), inRect.GetBottom());
// We want to make sure that we never try to do any drawing off
// the edges of the screen. Certain platforms, (like wxMac) get
// very upset when you try to draw from or to rects that lie off
// the screen. Since this is how all of the dirty regions enter
// the system, we clip our dirty rect to the screen and make sure
// we have something left before continuing.
wxRect r(inRect.Intersect(wxRect(wxPoint(0, 0), GetSize())));
if (r.IsEmpty())
return;
// It's a little bit inelegant to maintain two different dirty lists,
// but they get cleared by different actions.
mRectsToComposite.MergeRect(r);
// Trigger screen repaint events--and update our manual refresh
// list--but only if Quake 2 is not being displayed. (Quake 2 covers
// the entire stage, and if we repaint the screen, it will flicker.)
// The entire screen will automatically be refreshed when Quake 2
// is hidden.
if (!GameEngineIsDisplayed()) {
mRectsToRefresh.MergeRect(r);
Refresh(FALSE, &r);
}
}
示例7: _Draw_Get_rDiagram
//---------------------------------------------------------
wxRect CVIEW_ScatterPlot::_Draw_Get_rDiagram(wxRect r)
{
return( wxRect(
wxPoint(r.GetLeft () + 45, r.GetTop () + 20),
wxPoint(r.GetRight() - 20, r.GetBottom() - 40)
));
}
示例8: Draw
void wxGridCellIconRenderer::Draw(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc,
const wxRect& rectCell, int row, int col, bool isSelected)
{
wxGridCellRenderer::Draw(grid, attr, dc, rectCell, row, col, isSelected);
const char** psz=NULL;
// if (grid.GetCellValue(row, col) == wxT("IDI_PC"))
// psz = szIconPC;
// else psz = szIconNomad;
wxIcon icon(psz);
icon.SetHeight(16);
icon.SetWidth(16);
// wxColour colourBackGround = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE);
// dc.SetBrush(wxBrush(colourBackGround, wxSOLID));
// dc.SetPen(wxPen(colourBackGround, 1, wxSOLID));
// dc.DrawRectangle(rectCell);
int nMargin = (rectCell.GetHeight() - icon.GetHeight()) /2;
if (nMargin < 0) nMargin = 0;
dc.DrawIcon(icon, rectCell.x, rectCell.y+nMargin);
if (m_border == wxLAYOUT_TOP)
{
dc.SetPen(wxPen(*wxBLACK, 1, wxDOT));
dc.DrawLine(rectCell.GetRight(), rectCell.GetTop(),
rectCell.GetLeft(), rectCell.GetTop());
}
// dc.DrawIcon(icon, 16, 0);
}
示例9: GetSubImageWithAlpha
/// Gets a rectangle from within another image, INCLUDING the alpha channel
/// \bug in wxWidgets, wxImage::GetSubImage should do this itself.
wxImage GetSubImageWithAlpha( const wxImage & Src, const wxRect &rect )
{
//First part of this code is lifted from wxImage::GetSubImage() source code.
wxImage image;
wxCHECK_MSG( Src.Ok(), image, wxT("invalid image") );
wxCHECK_MSG( (rect.GetLeft()>=0) && (rect.GetTop()>=0) && (
rect.GetRight()<=Src.GetWidth()) && (rect.GetBottom()<=Src.GetHeight()),
image, wxT("invalid subimage size") );
int subwidth=rect.GetWidth();
const int subheight=rect.GetHeight();
image.Create( subwidth, subheight, false );
unsigned char *subdata = image.GetData(), *data=Src.GetData();
wxCHECK_MSG( subdata, image, wxT("unable to create image") );
// JKC: Quick hack - don't deal with masks - need to understand macro M_IMGDATA first.
// if (Src.M_IMGDATA->m_hasMask)
// image.SetMaskColour( Src.M_IMGDATA->m_maskRed, Src.M_IMGDATA->m_maskGreen, Src.M_IMGDATA->m_maskBlue );
int subleft=3*rect.GetLeft();
int width=3*Src.GetWidth();
subwidth*=3;
data+=rect.GetTop()*width+subleft;
for (long j = 0; j < subheight; ++j)
{
memcpy( subdata, data, subwidth);
subdata+=subwidth;
data+=width;
}
// OK, so we've copied the RGB data.
// Now do the Alpha channel.
wxASSERT( Src.HasAlpha() );
image.InitAlpha();
subleft/=3;
width/=3;
subwidth/=3;
data =Src.GetAlpha();
subdata =image.GetAlpha();
data+=rect.GetTop()*width+subleft;
for (long j = 0; j < subheight; ++j)
{
memcpy( subdata, data, subwidth);
subdata+=subwidth;
data+=width;
}
return image;
}
示例10: InUpdateRegion
bool MathCell::InUpdateRegion(wxRect rect)
{
return
(rect.GetRight() >= m_updateRegion.GetLeft() ) &&
(rect.GetLeft() <= m_updateRegion.GetRight() ) &&
(rect.GetBottom() >= m_updateRegion.GetTop() ) &&
(rect.GetTop() <= m_updateRegion.GetBottom());
}
示例11: set_bbox
void configuration_visitor::set_bbox(const wxRect& r) {
boost::shared_ptr<vector_layer_ghost> ghost = m_panel->vectorlayerghost();
if(!ghost) return;
ghost->reset<vector_layer_ghost::Rectangle>();
ghost->add_point(wxRealPoint(r.GetLeft (),r.GetTop ()));
ghost->add_point(wxRealPoint(r.GetRight(),r.GetBottom()));
ghost->m_penRectangle = wxPen(*wxRED, 2, wxDOT);
ghost->m_brushRectangle = wxBrush(*wxRED, wxTRANSPARENT);
}
示例12: CombineRectangles
// Calculate the area that contains both rectangles
static wxRect CombineRectangles(const wxRect& rect1, const wxRect& rect2)
{
wxRect rect;
int right1 = rect1.GetRight();
int bottom1 = rect1.GetBottom();
int right2 = rect2.GetRight();
int bottom2 = rect2.GetBottom();
wxPoint topLeft = wxPoint(wxMin(rect1.x, rect2.x), wxMin(rect1.y, rect2.y));
wxPoint bottomRight = wxPoint(wxMax(right1, right2), wxMax(bottom1, bottom2));
rect.x = topLeft.x; rect.y = topLeft.y;
rect.SetRight(bottomRight.x);
rect.SetBottom(bottomRight.y);
return rect;
}
示例13: DrawFrameWithoutLabel
void wxStdRenderer::DrawFrameWithoutLabel(wxDC& dc,
const wxRect& rectFrame,
const wxRect& rectLabel)
{
// draw left, bottom and right lines entirely
DrawVerticalLine(dc, rectFrame.GetLeft(),
rectFrame.GetTop(), rectFrame.GetBottom() - 2);
DrawHorizontalLine(dc, rectFrame.GetBottom() - 1,
rectFrame.GetLeft(), rectFrame.GetRight());
DrawVerticalLine(dc, rectFrame.GetRight() - 1,
rectFrame.GetTop(), rectFrame.GetBottom() - 1);
// and 2 parts of the top line
DrawHorizontalLine(dc, rectFrame.GetTop(),
rectFrame.GetLeft() + 1, rectLabel.GetLeft());
DrawHorizontalLine(dc, rectFrame.GetTop(),
rectLabel.GetRight(), rectFrame.GetRight() - 2);
}
示例14: _Draw_Legend
//---------------------------------------------------------
void CVIEW_ScatterPlot::_Draw_Legend(wxDC &dc, wxRect r)
{
CSG_Colors Colors(*m_Options("DENSITY_PAL")->asColors());
Colors.Set_Count(r.GetHeight());
for(int i=0, y=r.GetBottom(); i<Colors.Get_Count(); i++, y--)
{
Draw_FillRect(dc, Get_Color_asWX(Colors.Get_Color(i)), r.GetLeft(), y, r.GetRight(), y + 1);
}
// r.Offset(0, -r.GetHeight());
Draw_Edge(dc, EDGE_STYLE_SIMPLE, r);
Draw_Text(dc, TEXTALIGN_BOTTOMLEFT, 2 + r.GetRight(), r.GetBottom(), "0");
Draw_Text(dc, TEXTALIGN_TOPLEFT , 2 + r.GetRight(), r.GetTop (), wxString::Format("%d", (int)m_Count.Get_Max()));
}
示例15: OnPrintPage
bool EditorPrintout::OnPrintPage(int pageNum) {
wxASSERT(m_line && m_lineList);
if (m_pages.empty()) return true;
unsigned int page_ndx = pageNum-1; // page numbers start from one
const unsigned int lastline = m_pages[page_ndx];
unsigned int line_id = page_ndx ? m_pages[page_ndx-1]+1 : 0;
// Make page size scale with screen resolution
MapScreenSizeToPage();
const wxRect rect = GetLogicalPageRect();
unsigned int ypos = rect.y;
// We may have gotten a new dc, so we need a new line
wxDC& dc = *GetDC();
const wxFont& font = m_theme.font;
dc.SetFont(font);
FixedLine line(dc, m_printDoc.GetDocument(), s_sel, s_brackets, s_lastpos, s_isShadow, m_theme);
line.SetPrintMode();
line.Init();
line.SetWordWrap(cxWRAP_SMART);
line.SetWidth(rect.width - m_gutter_width);
// Draw gutter separator
const unsigned int sep_xpos = m_gutter_width - 5;
const unsigned int number_right = m_gutter_width - 8;
dc.DrawLine(sep_xpos, rect.y, sep_xpos, rect.y + m_page_height);
// Draw lines
while (line_id <= lastline) {
// Draw line number
const wxString linenumber = wxString::Format(wxT("%u"), line_id+1);
const wxSize ln_ext = dc.GetTextExtent(linenumber);
dc.DrawText(linenumber, number_right - ln_ext.x, ypos);
// Draw line
line.SetLine(m_lineList->offset(line_id), m_lineList->end(line_id));
line.DrawLine(rect.x + m_gutter_width, ypos, rect, false);
ypos += line.GetHeight();
++line_id;
}
// Draw footer title
ypos = rect.GetBottom() - m_line->GetCharHeight();
dc.DrawText(m_printDoc.GetName(), 0, ypos);
// Draw footer pagenum
const wxString pagefooter = wxString::Format(wxT("%d / %d"), pageNum, m_pages.size());
const wxSize extent = dc.GetTextExtent(pagefooter);
dc.DrawText(pagefooter, rect.GetRight() - extent.x, ypos);
return true;
}