本文整理汇总了C++中wxRect::GetBottomLeft方法的典型用法代码示例。如果您正苦于以下问题:C++ wxRect::GetBottomLeft方法的具体用法?C++ wxRect::GetBottomLeft怎么用?C++ wxRect::GetBottomLeft使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxRect
的用法示例。
在下文中一共展示了wxRect::GetBottomLeft方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawBackground
void clAuiMainNotebookTabArt::DrawBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect)
{
wxUnusedVar(wnd);
#ifdef __WXGTK__
wxDC& gdc = dc;
#else
wxGCDC gdc;
if(!DrawingUtils::GetGCDC(dc, gdc)) return;
#endif
DoSetColours();
gdc.SetPen(m_activeTabPenColour);
wxBrush brush = DrawingUtils::GetStippleBrush();
brush.SetColour(m_bgColour);
gdc.SetBrush(brush);
gdc.GradientFillLinear(rect, m_bgColour, m_bgColour, wxSOUTH);
wxPoint ptBottomLeft = rect.GetBottomLeft();
wxPoint ptBottomRight = rect.GetBottomRight();
gdc.SetPen(m_activeTabBgColour);
gdc.DrawLine(ptBottomLeft, ptBottomRight);
ptBottomLeft.y -= 1;
ptBottomRight.y -= 1;
gdc.SetPen(m_activeTabPenColour);
gdc.DrawLine(ptBottomLeft, ptBottomRight);
}
示例2: DrawBackground
void clAuiGlossyTabArt::DrawBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect)
{
wxUnusedVar(wnd);
#ifdef __WXGTK__
wxDC &gdc = dc;
#else
wxGCDC gdc;
if ( !DrawingUtils::GetGCDC(dc, gdc) )
return;
#endif
wxColour bgColour, penColour;
DoGetTabAreaBackgroundColour(bgColour, penColour);
m_bgColour = bgColour;
// Allow the plugins to override the default colours
clColourEvent colourEvent( wxEVT_GET_TAB_BORDER_COLOUR );
if ( EventNotifier::Get()->ProcessEvent( colourEvent ) ) {
penColour = colourEvent.GetBorderColour();
}
gdc.SetPen(bgColour);
gdc.SetBrush( bgColour );
gdc.GradientFillLinear(rect, bgColour, bgColour, wxSOUTH);
gdc.SetPen( penColour );
wxPoint ptBottomLeft = rect.GetBottomLeft();
wxPoint ptBottomRight = rect.GetBottomRight();
gdc.DrawLine(ptBottomLeft, ptBottomRight);
}
示例3: DrawBottomRect
void clTabRendererCurved::DrawBottomRect(
clTabInfo::Ptr_t activeTab, const wxRect& clientRect, wxDC& dc, const clTabColours& colours, size_t style)
{
#ifdef __WXOSX__
if(!IS_VERTICAL_TABS(style)) {
wxPoint pt1, pt2;
dc.SetPen(colours.activeTabBgColour);
if(style & kNotebook_BottomTabs) {
// bottom tabs
pt1 = clientRect.GetTopLeft();
pt2 = clientRect.GetTopRight();
DRAW_LINE(pt1, pt2);
} else {
// Top tabs
pt1 = clientRect.GetBottomLeft();
pt2 = clientRect.GetBottomRight();
pt1.y -= 1;
pt2.y -= 1;
DRAW_LINE(pt1, pt2);
}
}
#else
if(!IS_VERTICAL_TABS(style)) {
wxPoint pt1, pt2;
dc.SetPen(colours.activeTabPenColour);
if(style & kNotebook_BottomTabs) {
// bottom tabs
pt1 = clientRect.GetTopLeft();
pt2 = clientRect.GetTopRight();
DRAW_LINE(pt1, pt2);
} else {
// Top tabs
pt1 = clientRect.GetBottomLeft();
pt2 = clientRect.GetBottomRight();
DRAW_LINE(pt1, pt2);
}
}
#endif
}
示例4: DrawFieldSeparator
void wxCustomStatusBarArt::DrawFieldSeparator(wxDC& dc, const wxRect& fieldRect)
{
// draw border line
dc.SetPen(GetPenColour());
wxPoint bottomPt, topPt;
topPt = fieldRect.GetTopLeft();
topPt.y += 2;
bottomPt = fieldRect.GetBottomLeft();
bottomPt.y += 1;
dc.DrawLine(topPt, bottomPt);
}
示例5: Stroke
void SkinRegion::Stroke(wxDC& dc, wxGraphicsContext* gc, const wxRect& rect, int /*n*/)
{
if (!has_border)
return;
int penw = border.GetWidth() / 2.0f;
wxRect r(rect);
r.Deflate(penw, penw);
//border.SetCap(wxCAP_PROJECTING);
if (rounded) {
bool needsDelete = false;
if (!gc) {
gc = wxGraphicsContext::Create((wxWindowDC&)dc);
needsDelete = true;
}
gc->SetBrush(*wxTRANSPARENT_BRUSH);
gc->SetPen(border);
gc->DrawRoundedRectangle(rect.x, rect.y, rect.width, rect.height, rounded * .97);
rect.Inflate(penw, penw);
if (needsDelete)
delete gc;
} else {
dc.SetPen(border);
int offset = (int)(border.GetWidth() % 2 == 0);
wxPoint x(offset, 0);
wxPoint y(0, offset);
dc.DrawLine(rect.GetTopLeft(), rect.GetBottomLeft() + y);
dc.DrawLine(rect.GetBottomLeft() + y, rect.GetBottomRight() + y + x);
dc.DrawLine(rect.GetBottomRight() + y + x, rect.GetTopRight() + x);
dc.DrawLine(rect.GetTopRight() + x, rect.GetTopLeft());
}
}
示例6: GetInvalidatedIconRange
wxSize CDragBar::GetInvalidatedIconRange(const wxRect& rect)
{
switch(m_orientation) {
case wxHORIZONTAL:
{
int first = FindToolFromCoords(rect.GetTopLeft());
if (first == -1)
first = FindToolFromCoords(rect.GetTopLeft() + wxSize(m_margins.GetWidth(), 0));
int last = FindToolFromCoords(rect.GetTopRight());
if (last == -1) {
last = FindToolFromCoords(rect.GetTopRight() - wxSize(m_margins.GetWidth(), 0));
if (last == -1)
last = static_cast<int>(m_items.size() - 1);
}
return wxSize(first, last);
}
case wxVERTICAL:
{
int first = FindToolFromCoords(rect.GetTopLeft());
if (first == -1)
first = FindToolFromCoords(rect.GetTopLeft() + wxSize(0, m_margins.GetHeight()));
int last = FindToolFromCoords(rect.GetBottomLeft());
if (last == -1) {
last = FindToolFromCoords(rect.GetBottomLeft() - wxSize(0, m_margins.GetHeight()));
if (last == -1)
last = static_cast<int>(m_items.size() - 1);
}
return wxSize(first, last);
}
default:
wxFAIL_MSG(wxT("m_orientation not initialized correctly"));
return wxSize(0, 0);
}
}
示例7: overdraw_rectangle
void Canvas::overdraw_rectangle(wxRect rect, wxDC *dc)
{
wxRect edges[4];
wxSize hor(rect.GetWidth(), 1), ver(1, rect.GetHeight());
edges[0] = wxRect( rect.GetTopLeft(), hor );
edges[1] = wxRect( rect.GetTopLeft(), ver );
edges[2] = wxRect( rect.GetTopRight(), ver );
edges[3] = wxRect( rect.GetBottomLeft(), hor );
for (int i = 0; i < 4; i++) {
dc->DrawBitmap( zoomed_bitmap_for_canvas_region( edges[i] ),
edges[i].GetTopLeft() );
}
}
示例8: FinaliseBackground
void clTabRendererClassic::FinaliseBackground(wxWindow* parent, wxDC& dc, const wxRect& clientRect,
const clTabColours& colours, size_t style)
{
wxUnusedVar(parent);
clTabColours c = colours;
if(DrawingUtils::IsDark(c.activeTabBgColour)) {
InitDarkColours(c, c.activeTabBgColour);
} else {
InitLightColours(c, c.activeTabBgColour);
}
dc.SetPen(c.activeTabPenColour);
if(style & kNotebook_BottomTabs) {
dc.DrawLine(clientRect.GetTopLeft(), clientRect.GetTopRight());
} else {
dc.DrawLine(clientRect.GetBottomLeft(), clientRect.GetBottomRight());
}
}
示例9: DrawTab
void clAuiMainNotebookTabArt::DrawTab(wxDC& dc,
wxWindow* wnd,
const wxAuiNotebookPage& page,
const wxRect& in_rect,
int close_button_state,
wxRect* out_tab_rect,
wxRect* out_button_rect,
int* x_extent)
{
if(in_rect.GetHeight() == 0) return; // Tabs are not visible
int curx = 0;
wxGCDC gdc;
if(!DrawingUtils::GetGCDC(dc, gdc)) return;
wxColour penColour = page.active ? m_activeTabPenColour : m_penColour;
wxGraphicsPath path = gdc.GetGraphicsContext()->CreatePath();
gdc.SetPen(penColour);
wxSize sz = GetTabSize(gdc, wnd, page.caption, page.bitmap, page.active, close_button_state, x_extent);
wxRect rr(in_rect.GetTopLeft(), sz);
rr.y += TAB_Y_OFFSET;
rr.width -= 1;
#ifndef __WXMAC__
if(page.active) {
rr.y -= 2;
rr.height += 2;
}
#endif
#ifndef __WXGTK__
rr.height += 4;
#endif
/// the tab start position (x)
curx = rr.x + 7;
// Set clipping region
int clip_width = rr.width;
if(rr.x + clip_width > in_rect.x + in_rect.width) clip_width = (in_rect.x + in_rect.width) - rr.x;
gdc.SetClippingRegion(rr.x, rr.y, clip_width, rr.height);
gdc.SetBrush(m_bgColour);
gdc.SetPen(penColour);
if(page.active) {
gdc.SetBrush(m_activeTabBgColour);
path.AddRoundedRectangle(rr.x, rr.y, rr.width - 1, rr.height, m_tabRadius);
gdc.GetGraphicsContext()->FillPath(path);
gdc.GetGraphicsContext()->StrokePath(path);
} else {
wxGraphicsPath outerPath = gdc.GetGraphicsContext()->CreatePath();
gdc.SetPen(penColour);
outerPath.AddRoundedRectangle(rr.x, rr.y, rr.width - 1, rr.height, m_tabRadius);
gdc.GetGraphicsContext()->StrokePath(outerPath);
gdc.SetPen(m_innerPenColour);
path.AddRoundedRectangle(rr.x + 1, rr.y + 1, rr.width - 3, rr.height - 1, m_tabRadius);
gdc.GetGraphicsContext()->StrokePath(path);
gdc.SetBrush(m_tabBgColour);
gdc.GetGraphicsContext()->StrokePath(path);
gdc.GetGraphicsContext()->FillPath(path);
gdc.SetPen(penColour);
}
if(!page.active) {
// Draw a line at the bottom rect
gdc.SetPen(m_activeTabPenColour);
gdc.DrawLine(in_rect.GetBottomLeft(), in_rect.GetBottomRight());
}
wxString caption = page.caption;
if(caption.IsEmpty()) {
caption = "Tp";
}
wxFont fnt = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
gdc.SetFont(fnt);
wxSize ext = gdc.GetTextExtent(caption);
if(caption == "Tp") caption.Clear();
/// Draw the bitmap
if(page.bitmap.IsOk()) {
int bmpy = (rr.y + (rr.height - page.bitmap.GetHeight()) / 2) - TAB_Y_OFFSET + BMP_Y_SPACER;
gdc.GetGraphicsContext()->DrawBitmap(page.bitmap, curx, bmpy, page.bitmap.GetWidth(), page.bitmap.GetHeight());
curx += page.bitmap.GetWidth();
curx += 3;
}
/// Draw the text
wxColour textColour = page.active ? m_activeTabTextColour : m_tabTextColour;
gdc.SetTextForeground(textColour);
wxDouble textYOffCorrd = (rr.y + (rr.height - ext.y) / 2) - TAB_Y_OFFSET + TEXT_Y_SPACER;
gdc.GetGraphicsContext()->DrawText(page.caption, curx, textYOffCorrd);
// advance the X offset
curx += ext.x;
//.........这里部分代码省略.........
示例10: DrawTab
void clAuiGlossyTabArt::DrawTab(wxDC& dc,
wxWindow* wnd,
const wxAuiNotebookPage& page,
const wxRect& in_rect,
int close_button_state,
wxRect* out_tab_rect,
wxRect* out_button_rect,
int* x_extent)
{
wxColour bgColour = wxColour(EditorConfigST::Get()->GetCurrentOutputviewBgColour());
wxColour penColour;
wxColour textColour;
bool isBgColourDark = DrawingUtils::IsDark(bgColour);
if ( isBgColourDark ) {
penColour = DrawingUtils::LightColour(bgColour, 4.0);
} else {
bgColour = *wxWHITE;
penColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW);
}
textColour = EditorConfigST::Get()->GetCurrentOutputviewFgColour();
int curx = 0;
// Allow the plugins to override the default colours
clColourEvent colourEvent( wxEVT_COLOUR_TAB );
colourEvent.SetIsActiveTab( page.active );
colourEvent.SetPage( page.window );
if ( EventNotifier::Get()->ProcessEvent( colourEvent ) ) {
bgColour = colourEvent.GetBgColour();
textColour = colourEvent.GetFgColour();
}
// Allow the plugins to override the border colour
wxColour originalPenColour = penColour;
clColourEvent borderColourEvent( wxEVT_GET_TAB_BORDER_COLOUR );
if ( EventNotifier::Get()->ProcessEvent( borderColourEvent ) ) {
penColour = borderColourEvent.GetBorderColour();
}
wxGCDC gdc;
if ( !DrawingUtils::GetGCDC(dc, gdc) )
return;
m_penColour = penColour;
wxGraphicsPath path = gdc.GetGraphicsContext()->CreatePath();
gdc.SetPen( penColour );
wxSize sz = GetTabSize(gdc, wnd, page.caption, page.bitmap, page.active, close_button_state, x_extent);
wxRect rr (in_rect.GetTopLeft(), sz);
rr.y += TAB_Y_OFFSET;
rr.width -= 1;
#ifndef __WXMAC__
if ( page.active ) {
rr.y -= 2;
rr.height += 2;
}
#endif
#ifdef __WXGTK__
rr.height += TAB_HEIGHT_SPACER;
#else
rr.height += 4;
#endif
/// the tab start position (x)
curx = rr.x + 7;
// Set clipping region
int clip_width = rr.width;
if (rr.x + clip_width > in_rect.x + in_rect.width)
clip_width = (in_rect.x + in_rect.width) - rr.x;
// since the above code above doesn't play well with WXDFB or WXCOCOA,
// we'll just use a rectangle for the clipping region for now --
gdc.SetClippingRegion(rr.x, rr.y, clip_width, rr.height);
gdc.SetBrush( bgColour );
gdc.SetPen( penColour );
if ( page.active ) {
path.AddRoundedRectangle(rr.x, rr.y, rr.width-1, rr.height, 6.5);
gdc.GetGraphicsContext()->FillPath( path );
gdc.GetGraphicsContext()->StrokePath( path );
} else {
if ( !m_bgColour.IsOk() ) {
wxColour b, p;
DoGetTabAreaBackgroundColour(b, p);
m_bgColour = b;
}
DoDrawInactiveTabSeparator(gdc, rr);
}
if ( !page.active ) {
// Draw a line at the bottom rect
gdc.SetPen(penColour);
gdc.DrawLine(in_rect.GetBottomLeft(), in_rect.GetBottomRight());
}
//.........这里部分代码省略.........
示例11: DrawTab
void clAuiMainNotebookTabArt::DrawTab(wxDC& dc,
wxWindow* wnd,
const wxAuiNotebookPage& page,
const wxRect& in_rect,
int close_button_state,
wxRect* out_tab_rect,
wxRect* out_button_rect,
int* x_extent)
{
int curx = 0;
wxGCDC gdc;
if(!DrawingUtils::GetGCDC(dc, gdc)) return;
wxColour penColour = page.active ? m_activeTabPenColour : m_penColour;
wxGraphicsPath path = gdc.GetGraphicsContext()->CreatePath();
gdc.SetPen(penColour);
wxSize sz = GetTabSize(gdc, wnd, page.caption, page.bitmap, page.active, close_button_state, x_extent);
wxRect rr(in_rect.GetTopLeft(), sz);
rr.y += TAB_Y_OFFSET;
rr.width -= 1;
#ifndef __WXMAC__
if(page.active) {
rr.y -= 2;
rr.height += 2;
}
#endif
#ifdef __WXGTK__
rr.height += TAB_HEIGHT_SPACER;
#else
rr.height += 4;
#endif
/// the tab start position (x)
curx = rr.x + 7;
// Set clipping region
int clip_width = rr.width;
if(rr.x + clip_width > in_rect.x + in_rect.width) clip_width = (in_rect.x + in_rect.width) - rr.x;
gdc.SetClippingRegion(rr.x, rr.y, clip_width, rr.height);
gdc.SetBrush(m_bgColour);
gdc.SetPen(penColour);
if(page.active) {
gdc.SetBrush(m_activeTabBgColour);
path.AddRoundedRectangle(rr.x, rr.y, rr.width - 1, rr.height, TAB_RADIUS);
gdc.GetGraphicsContext()->FillPath(path);
gdc.GetGraphicsContext()->StrokePath(path);
} else {
wxGraphicsPath outerPath = gdc.GetGraphicsContext()->CreatePath();
gdc.SetPen(penColour);
outerPath.AddRoundedRectangle(rr.x, rr.y, rr.width - 1, rr.height, TAB_RADIUS);
gdc.GetGraphicsContext()->StrokePath(outerPath);
gdc.SetPen(m_innerPenColour);
path.AddRoundedRectangle(rr.x + 1, rr.y + 1, rr.width - 3, rr.height - 1, TAB_RADIUS);
gdc.GetGraphicsContext()->StrokePath(path);
gdc.SetBrush(m_tabBgColour);
gdc.GetGraphicsContext()->StrokePath(path);
gdc.GetGraphicsContext()->FillPath(path);
gdc.SetPen(penColour);
}
if(!page.active) {
// Draw a line at the bottom rect
gdc.SetPen(m_activeTabPenColour);
gdc.DrawLine(in_rect.GetBottomLeft(), in_rect.GetBottomRight());
}
wxString caption = page.caption;
if(caption.IsEmpty()) {
caption = "Tp";
}
wxFont fnt = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
if(page.active) {
fnt.SetWeight(wxFONTWEIGHT_BOLD);
}
gdc.SetFont(fnt);
wxSize ext = gdc.GetTextExtent(caption);
if(caption == "Tp") caption.Clear();
/// Draw the bitmap
if(page.bitmap.IsOk()) {
int bmpy = (rr.y + (rr.height - page.bitmap.GetHeight()) / 2) - TAB_Y_OFFSET;
gdc.GetGraphicsContext()->DrawBitmap(page.bitmap, curx, bmpy, page.bitmap.GetWidth(), page.bitmap.GetHeight());
curx += page.bitmap.GetWidth();
curx += 3;
}
/// Draw the text
wxColour textColour = page.active ? m_activeTabTextColour : m_tabTextColour;
gdc.SetTextForeground(textColour);
gdc.GetGraphicsContext()->DrawText(
//.........这里部分代码省略.........