本文整理汇总了C++中wxRect::GetLeft方法的典型用法代码示例。如果您正苦于以下问题:C++ wxRect::GetLeft方法的具体用法?C++ wxRect::GetLeft怎么用?C++ wxRect::GetLeft使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxRect
的用法示例。
在下文中一共展示了wxRect::GetLeft方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _Draw_Frame
//---------------------------------------------------------
void CVIEW_ScatterPlot::_Draw_Frame(wxDC &dc, wxRect r)
{
//-----------------------------------------------------
Draw_Edge(dc, EDGE_STYLE_SIMPLE, r);
//-------------------------------------------------
Draw_Scale(dc, wxRect(r.GetLeft(), r.GetBottom(), r.GetWidth(), 20),
m_Trend.Get_Data_XMin(), m_Trend.Get_Data_XMax(),
true , true , true
);
Draw_Scale(dc, wxRect(r.GetLeft() - 20, r.GetTop(), 20, r.GetHeight()),
m_Trend.Get_Data_YMin(), m_Trend.Get_Data_YMax(),
false, false, false
);
Draw_Text(dc, TEXTALIGN_BOTTOMCENTER,
r.GetLeft() - 25, r.GetTop() + r.GetHeight() / 2, 90.0,
m_sY.c_str()
);
Draw_Text(dc, TEXTALIGN_TOPCENTER,
r.GetLeft() + r.GetWidth() / 2, r.GetBottom() + 20,
m_sX.c_str()
);
//-------------------------------------------------
if( m_Options("REG_SHOW")->asBool() )
{
_Draw_Regression(dc, r);
}
}
示例2: 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;
}
示例3: GetStats
static void GetStats(double *mean, double *stdev, const FloatImg& img, const wxRect& win)
{
// Determine the mean and standard deviation
double sum = 0.0;
double a = 0.0;
double q = 0.0;
double k = 1.0;
double km1 = 0.0;
const int width = img.Size.GetWidth();
const float *p0 = &img.px[win.GetTop() * width + win.GetLeft()];
for (int y = 0; y < win.GetHeight(); y++)
{
const float *end = p0 + win.GetWidth();
for (const float *p = p0; p < end; p++)
{
double const x = (double) *p;
sum += x;
double const a0 = a;
a += (x - a) / k;
q += (x - a0) * (x - a);
km1 = k;
k += 1.0;
}
p0 += width;
}
*mean = sum / km1;
*stdev = sqrt(q / km1);
}
示例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: _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!"));
}
}
示例6: _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)
));
}
示例7: 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);
}
示例8: 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());
}
示例9: FromRect
void PaddingStyle::FromRect(const wxRect& rect) {
Left = rect.GetLeft();
Top = rect.GetTop();
Bottom = rect.GetHeight();
Right = rect.GetWidth();
Width = Left + Right;
Height = Top + Bottom;
}
示例10: 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);
}
示例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: device
wxDCOverlay::wxDCOverlay(wxOverlay &overlay, wxDC *dc) :
m_overlay(overlay)
{
const wxRect device(wxPoint(0, 0), dc->GetSize());
Init(dc,
dc->DeviceToLogicalX(device.GetLeft()),
dc->DeviceToLogicalY(device.GetTop()),
dc->DeviceToLogicalX(device.GetRight()),
dc->DeviceToLogicalY(device.GetBottom()));
}
示例13: _Draw_Regression
//---------------------------------------------------------
void CVIEW_ScatterPlot::_Draw_Regression(wxDC &dc, wxRect r)
{
wxPen oldPen = dc.GetPen();
dc.SetPen(wxPen(
m_Options("REG_COLOR")->asColor(),
m_Options("REG_SIZE" )->asInt()
));
//-----------------------------------------------------
double dx = (r.GetWidth () - 1.) / m_Trend.Get_Data_XStats().Get_Range();
double dy = (r.GetHeight() - 1.) / m_Trend.Get_Data_YStats().Get_Range();
//-----------------------------------------------------
dc.DrawCircle(
GET_DC_X(m_Trend.Get_Data_XStats().Get_Mean()),
GET_DC_Y(m_Trend.Get_Data_YStats().Get_Mean()), 2
);
double ex = m_Trend.Get_Data_XStats().Get_Range() / (double)r.GetWidth();
double x = m_Trend.Get_Data_XMin();
for(int ix=0, ay, by=0; ix<r.GetWidth(); ix++, x+=ex)
{
double y = m_Trend.Get_Value(x);
ay = by; by = r.GetBottom() - (int)(dy * (y - m_Trend.Get_Data_YMin()));
if( ix > 0 && r.GetTop() < ay && ay < r.GetBottom() && r.GetTop() < by && by < r.GetBottom() )
{
dc.DrawLine(r.GetLeft() + ix - 1, ay, r.GetLeft() + ix, by);
}
}
dc.SetPen(oldPen);
//-----------------------------------------------------
Draw_Text(dc, TEXTALIGN_BOTTOMCENTER, r.GetLeft() + r.GetWidth() / 2, r.GetTop(),
m_Trend.Get_Formula(SG_TREND_STRING_Compact).c_str()
);
}
示例14: generateRealImageset
//-----------------------------------------------------------------------
CEGUI::Imageset* EditorDocument::generateRealImageset(const wxString& pathName)
{
const String imagesetName ( CEGUIHelper::ToCEGUIString( m_imagesetName ) );
const String imageFilename ( CEGUIHelper::ToCEGUIString( pathName + m_imageFilename ) );
ImagesetManager& isMgr = ImagesetManager::getSingleton();
if ( isMgr.isImagesetPresent( imagesetName ) )
// TODO: Maybe ask user whether to continue here?
isMgr.destroyImageset( imagesetName );
// create the imageset
Imageset* imageset = isMgr.createImagesetFromImageFile( imagesetName, imageFilename );
// auto-scale options
imageset->setAutoScalingEnabled( m_autoScaled );
imageset->setNativeResolution( CEGUI::Size( m_nativeResolution.x, m_nativeResolution.y ) );
// iterate over all the elements in the class
mapNamedRegion::iterator it;
for( it = m_mapSetRectangles.begin(); it != m_mapSetRectangles.end(); ++it )
{
const String imageName = CEGUIHelper::ToCEGUIString( wxString( it->first ) );
if ( !imageset->isImageDefined( imageName ) )
{
const wxRect r( it->second );
const CEGUI::Rect newDim( ( ( r.GetLeft() > 0 ) ? r.GetLeft() : 0 ),
( ( r.GetTop() > 0 ) ? r.GetTop() : 0 ),
( ( r.GetRight() + 1 > 0 ) ? r.GetRight() + 1 : 0 ),
( ( r.GetBottom() + 1 > 0 ) ? r.GetBottom() + 1 : 0 ) );
const CEGUI::Point p ( 0.0f, 0.0f );
imageset->defineImage( imageName, newDim, p );
}
}
if ( imageset->isImageDefined ( "full_image" ) )
imageset->undefineImage( "full_image" );
return imageset;
}
示例15: CropToUpdateRegion
wxRect MathCell::CropToUpdateRegion(wxRect rect)
{
int left =rect.GetLeft();
int top =rect.GetTop ();
int right =rect.GetRight();
int bottom=rect.GetBottom();
if (left < m_updateRegion.GetLeft()) left = m_updateRegion.GetLeft();
if (right > m_updateRegion.GetRight()) right = m_updateRegion.GetRight();
if (top < m_updateRegion.GetTop()) top = m_updateRegion.GetTop();
if (bottom > m_updateRegion.GetBottom()) bottom = m_updateRegion.GetBottom();
return wxRect(wxPoint(left,top),wxPoint(right,bottom));
}