void CMyDialog::OnMouseMove(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default if (!m_bTracked) { TRACKMOUSEEVENT tme; tme.cbSize = sizeof(tme); tme.hwndTrack = m_hWnd; tme.dwFlags = TME_LEAVE; tme.dwHoverTime = 1; m_bTracked = _TrackMouseEvent(&tme); m_bTracked=TRUE; } if (point.y<=30) { if (m_rcClose.PtInRect(point)) { if (!m_bCloseHover) { m_bCloseHover=TRUE; DrawCloseButton(GetDC(),DTS_HOVER); m_bMinHover=FALSE; DrawMinButton(GetDC(),DTS_NORMAL); } } else if (m_rcMin.PtInRect(point)) { if (!m_bMinHover) { m_bMinHover=TRUE; DrawMinButton(GetDC(),DTS_HOVER); m_bCloseHover=FALSE; DrawCloseButton(GetDC(),DTS_NORMAL); } } else { if (m_bCloseHover) { m_bCloseHover=FALSE; DrawCloseButton(GetDC(),DTS_NORMAL); } if (m_bMinHover) { m_bMinHover=FALSE; DrawMinButton(GetDC(),DTS_NORMAL); } } } CDialog::OnMouseMove(nFlags, point); }
LRESULT CMyDialog::OnMouseLeave(WPARAM wParam, LPARAM lParam) { if (m_bCloseHover) { m_bCloseHover=FALSE; DrawCloseButton(GetDC(),DTS_NORMAL); } if (m_bMinHover) { m_bMinHover=FALSE; DrawMinButton(GetDC(),DTS_NORMAL); } m_bTracked=FALSE; return 0; }
void wxAuiGtkTabArt::DrawButton(wxDC& dc, wxWindow* wnd, const wxRect& in_rect, int bitmap_id, int button_state, int orientation, wxRect* out_rect) { GtkWidget *widget = wnd->GetHandle(); wxRect rect = in_rect; if (m_flags &wxAUI_NB_BOTTOM) rect.y += 2 * gtk_widget_get_style(wxGTKPrivate::GetButtonWidget())->ythickness; switch (bitmap_id) { case wxAUI_BUTTON_CLOSE: rect.y -= 2 * gtk_widget_get_style(wxGTKPrivate::GetButtonWidget())->ythickness; rect = DrawCloseButton(dc, widget, button_state, rect, orientation, NULL); break; case wxAUI_BUTTON_LEFT: rect = DrawSimpleArrow(dc, widget, button_state, rect, orientation, GTK_ARROW_LEFT); break; case wxAUI_BUTTON_RIGHT: rect = DrawSimpleArrow(dc, widget, button_state, rect, orientation, GTK_ARROW_RIGHT); break; case wxAUI_BUTTON_WINDOWLIST: { rect.height -= 4 * gtk_widget_get_style(wxGTKPrivate::GetButtonWidget())->ythickness; rect.width = rect.height; rect.x = in_rect.x + in_rect.width - rect.width; if (button_state == wxAUI_BUTTON_STATE_HOVER) wxRendererNative::Get().DrawComboBoxDropButton(wnd, dc, rect, wxCONTROL_CURRENT); else if (button_state == wxAUI_BUTTON_STATE_PRESSED) wxRendererNative::Get().DrawComboBoxDropButton(wnd, dc, rect, wxCONTROL_PRESSED); else wxRendererNative::Get().DrawDropArrow(wnd, dc, rect); } break; } *out_rect = rect; }
static void PaintHDC(LabelWithCloseWnd *w, HDC hdc, const PAINTSTRUCT& ps) { HBRUSH br = CreateSolidBrush(w->bgCol); FillRect(hdc, &ps.rcPaint, br); ClientRect cr(w->hwnd); int x = win::DpiAdjust(w->hwnd, w->padL); int y = win::DpiAdjust(w->hwnd, w->padT); UINT opts = ETO_OPAQUE; if (IsRtl(w->hwnd)) { opts = opts | ETO_RTLREADING; } HGDIOBJ prevFont = NULL; if (w->font) { prevFont = SelectObject(hdc, w->font); } SetTextColor(hdc, w->txtCol); SetBkColor(hdc, w->bgCol); WCHAR *s = win::GetText(w->hwnd); ExtTextOut(hdc, x, y, opts, NULL, s, (UINT)str::Len(s), NULL); free(s); // Text might be too long and invade close button area. We just re-paint // the background, which is not the pretties but works. // A better way would be to intelligently truncate text or shrink the font // size (within reason) x = w->closeBtnPos.x - win::DpiAdjust(w->hwnd, LABEL_BUTTON_SPACE_DX); RectI ri(x, 0, cr.dx - x, cr.dy); RECT r = ri.ToRECT(); FillRect(hdc, &r, br); DrawCloseButton(hdc, w->closeBtnPos, IsMouseOverClose(w)); DeleteObject(br); if (w->font) { SelectObject(hdc, prevFont); } }
void CMyDialog::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default if (m_rcClose.PtInRect(point)) { DrawCloseButton(GetDC(),DTS_CLICKED); m_bCloseHover=FALSE; return; } else if (m_rcMin.PtInRect(point)) { DrawMinButton(GetDC(),DTS_CLICKED); m_bMinHover=FALSE; return; } if (point.y<=30) { PostMessage(WM_NCLBUTTONDOWN,HTCAPTION,MAKELPARAM(point.x,point.y)); } CDialog::OnLButtonDown(nFlags, point); }
void JXTabGroup::Draw ( JXWindowPainter& p, const JRect& rect ) { const JRect ap = GetAperture(); p.SetFont(itsFontName, itsFontSize, itsFontStyle); const JSize lineHeight = p.GetLineHeight(); const JSize tabHeight = 2*(kBorderWidth + kTextMargin) + lineHeight; JIndex selIndex; JRect selRect; const JBoolean hasSelection = itsCardFile->GetCurrentCardIndex(&selIndex); itsTabRects->RemoveAll(); itsCanScrollUpFlag = JI2B(itsFirstDrawIndex > 1); itsCanScrollDownFlag = kJFalse; const JCoordinate scrollArrowWidth = 2*(kArrowWidth + kBorderWidth); const JSize count = itsTitles->GetElementCount(); itsLastDrawIndex = JMax(count, itsFirstDrawIndex); const JColormap* cmap = p.GetColormap(); if (itsEdge == kTop) { JRect r(ap.top + kSelMargin, ap.left + kSelMargin, ap.top + kSelMargin + tabHeight, ap.left + kSelMargin); for (JIndex i=itsFirstDrawIndex; i<=count; i++) { const JString* title = itsTitles->NthElement(i); const JBoolean isSel = JI2B(hasSelection && i == selIndex); const TabInfo info = itsTabInfoList->GetElement(i); r.right += 2*kBorderWidth + info.preMargin +info.postMargin + p.GetStringWidth(*title); if (info.closable) { r.right += kCloseMarginWidth + itsCloseImage->GetWidth(); } JPoint titlePt(r.left + kBorderWidth + info.preMargin, r.top + kBorderWidth + kTextMargin); if (isSel) { // titlePt.y -= kSelMargin; r.top -= kSelMargin; r.Expand(kSelMargin, 0); selRect = r; } if (isSel) { p.SetPenColor(cmap->GetGrayColor(kSelGrayPercentage)); p.SetFilling(kJTrue); p.JPainter::Rect(r); p.SetFilling(kJFalse); } else { DrawTabBorder(p, r, kJFalse); } p.JPainter::String(titlePt, *title); itsTabRects->AppendElement(r); if (isSel) { r.top += kSelMargin; r.Shrink(kSelMargin, 0); } r.Shrink(kBorderWidth, kBorderWidth); DrawTab(i, p, r, itsEdge); DrawCloseButton(i, p, r); r.Expand(kBorderWidth, kBorderWidth); if (r.right >= ap.right - scrollArrowWidth) { if (itsFirstDrawIndex == 1 && i == count && r.right <= ap.right) { break; } itsCanScrollDownFlag = JI2B( itsFirstDrawIndex < count ); itsLastDrawIndex = i; if (r.right > ap.right - scrollArrowWidth && i > itsFirstDrawIndex) { itsLastDrawIndex--; } break; } r.left = r.right; } } else if (itsEdge == kLeft) { JRect r(ap.bottom - kSelMargin, ap.left + kSelMargin, ap.bottom - kSelMargin, ap.left + kSelMargin + tabHeight); for (JIndex i=itsFirstDrawIndex; i<=count; i++) { const JString* title = itsTitles->NthElement(i); const JBoolean isSel = JI2B(hasSelection && i == selIndex); const TabInfo info = itsTabInfoList->GetElement(i); r.top -= 2*kBorderWidth + info.preMargin + info.postMargin + p.GetStringWidth(*title); if (info.closable) { r.top -= kCloseMarginWidth + itsCloseImage->GetWidth(); } JPoint titlePt(r.left + kBorderWidth + kTextMargin, r.bottom - kBorderWidth - info.preMargin); if (isSel) { // titlePt.x -= kSelMargin; r.left -= kSelMargin; r.Expand(0, kSelMargin); selRect = r; } if (isSel) { p.SetPenColor(cmap->GetGrayColor(kSelGrayPercentage)); p.SetFilling(kJTrue); p.JPainter::Rect(r); p.SetFilling(kJFalse); } else { DrawTabBorder(p, r, kJFalse); } p.JPainter::String(90, titlePt, *title); itsTabRects->AppendElement(r); if (isSel) { r.left += kSelMargin; r.Shrink(0, kSelMargin); } r.Shrink(kBorderWidth, kBorderWidth); DrawTab(i, p, r, itsEdge); DrawCloseButton(i, p, r); r.Expand(kBorderWidth, kBorderWidth); if (r.top <= ap.top + scrollArrowWidth) { if (itsFirstDrawIndex == 1 && i == count && r.top >= ap.top) { break; } itsCanScrollDownFlag = JI2B( itsFirstDrawIndex < count ); itsLastDrawIndex = i; if (r.top < ap.top + scrollArrowWidth && i > itsFirstDrawIndex) { itsLastDrawIndex--; } break; } r.bottom = r.top; } } else if (itsEdge == kBottom) { JRect r(ap.bottom - kSelMargin - tabHeight, ap.left + kSelMargin, ap.bottom - kSelMargin, ap.left + kSelMargin); for (JIndex i=itsFirstDrawIndex; i<=count; i++) { const JString* title = itsTitles->NthElement(i); const JBoolean isSel = JI2B(hasSelection && i == selIndex); const TabInfo info = itsTabInfoList->GetElement(i); r.right += 2*kBorderWidth + info.preMargin + info.postMargin + p.GetStringWidth(*title); if (info.closable) { r.right += kCloseMarginWidth + itsCloseImage->GetWidth(); } JPoint titlePt(r.left + kBorderWidth + info.preMargin, r.top + kBorderWidth + kTextMargin); if (isSel) { // titlePt.y += kSelMargin; r.bottom += kSelMargin; r.Expand(kSelMargin, 0); selRect = r; } if (isSel) { p.SetPenColor(cmap->GetGrayColor(kSelGrayPercentage)); p.SetFilling(kJTrue); p.JPainter::Rect(r); p.SetFilling(kJFalse); } else { DrawTabBorder(p, r, kJFalse); } p.JPainter::String(titlePt, *title); itsTabRects->AppendElement(r); if (isSel) { r.bottom -= kSelMargin; r.Shrink(kSelMargin, 0); } r.Shrink(kBorderWidth, kBorderWidth); DrawTab(i, p, r, itsEdge); DrawCloseButton(i, p, r); r.Expand(kBorderWidth, kBorderWidth); if (r.right >= ap.right - scrollArrowWidth) { if (itsFirstDrawIndex == 1 && i == count && r.right <= ap.right) { break; } itsCanScrollDownFlag = JI2B( itsFirstDrawIndex < count ); itsLastDrawIndex = i; if (r.right > ap.right - scrollArrowWidth && i > itsFirstDrawIndex) { itsLastDrawIndex--; } break; } r.left = r.right; } } else if (itsEdge == kRight) { JRect r(ap.top + kSelMargin, ap.right - kSelMargin - tabHeight, ap.top + kSelMargin, ap.right - kSelMargin); for (JIndex i=itsFirstDrawIndex; i<=count; i++) { const JString* title = itsTitles->NthElement(i); const JBoolean isSel = JI2B(hasSelection && i == selIndex); const TabInfo info = itsTabInfoList->GetElement(i); r.bottom += 2*kBorderWidth + info.preMargin + info.postMargin + p.GetStringWidth(*title); if (info.closable) { r.bottom += kCloseMarginWidth + itsCloseImage->GetWidth(); } JPoint titlePt(r.right - kBorderWidth - kTextMargin, r.top + kBorderWidth + info.preMargin); if (isSel) { // titlePt.x += kSelMargin; r.right += kSelMargin; r.Expand(0, kSelMargin); selRect = r; } if (isSel) { p.SetPenColor(cmap->GetGrayColor(kSelGrayPercentage)); p.SetFilling(kJTrue); p.JPainter::Rect(r); p.SetFilling(kJFalse); } else { DrawTabBorder(p, r, kJFalse); } p.JPainter::String(-90, titlePt, *title); itsTabRects->AppendElement(r); if (isSel) { r.right -= kSelMargin; r.Shrink(0, kSelMargin); } r.Shrink(kBorderWidth, kBorderWidth); DrawTab(i, p, r, itsEdge); DrawCloseButton(i, p, r); r.Expand(kBorderWidth, kBorderWidth); if (r.bottom >= ap.bottom - scrollArrowWidth) { if (itsFirstDrawIndex == 1 && i == count && r.bottom <= ap.bottom) { break; } itsCanScrollDownFlag = JI2B( itsFirstDrawIndex < count ); itsLastDrawIndex = i; if (r.bottom > ap.bottom - scrollArrowWidth && i > itsFirstDrawIndex) { itsLastDrawIndex--; } break; } r.top = r.bottom; } } JRect r = itsCardFile->GetFrame(); r.Expand(kBorderWidth, kBorderWidth); JXDrawUpFrame(p, r, kBorderWidth); if (!selRect.IsEmpty()) { DrawTabBorder(p, selRect, kJTrue); } DrawScrollButtons(p, lineHeight); }
BOOL CMyDialog::OnEraseBkgnd(CDC* pDC) { // TODO: Add your message handler code here and/or call default // BOOL bResult=CDialog::OnEraseBkgnd(pDC); if (!m_bHaveStoreBgDC) { CRect rect; GetClientRect(rect); m_bHaveStoreBgDC=TRUE; Color clrStart=Color(230,230,230); Color clrEnd=Color(255,255,255); m_StoreBgDC.DeleteDC(); m_StoreBgDC.CreateCompatibleDC(pDC); CBitmap bmp; bmp.CreateCompatibleBitmap(pDC,rect.Width(),rect.Height()); CBitmap *pOldBmp=m_StoreBgDC.SelectObject(&bmp); Graphics myGraphics(m_StoreBgDC.m_hDC); LinearGradientBrush linGrBrush( Rect(0,0,rect.Width(),rect.Height()), clrStart, clrEnd, LinearGradientModeVertical); myGraphics.FillRectangle(&linGrBrush, 0,31,rect.Width(),rect.Height()); Color clrCaptionStart(219,219,220); Color clrCaptionEnd(190,192,193); LinearGradientBrush linGrBrush1( Rect(0,0,rect.Width(),30), clrCaptionStart, clrCaptionEnd, LinearGradientModeVertical); myGraphics.FillRectangle(&linGrBrush1, 0,0,rect.Width(),30); DrawCloseButton(&m_StoreBgDC,DTS_NORMAL); DrawMinButton(&m_StoreBgDC,DTS_NORMAL); CPen MarkPen(PS_SOLID,1,RGB(158,158,158)); CBrush *pOldBrush=(CBrush *)m_StoreBgDC.SelectStockObject(NULL_BRUSH); CPen *pOldPen=m_StoreBgDC.SelectObject(&MarkPen); m_StoreBgDC.RoundRect(m_rcMin.left-1,m_rcMin.top-5,m_rcClose.right+1,m_rcClose.bottom+1,5,5); CPen penBorder(PS_SOLID,1,RGB(150,150,150)); m_StoreBgDC.SelectObject(&penBorder); m_StoreBgDC.MoveTo(0,30); m_StoreBgDC.LineTo(rect.Width(),30); m_StoreBgDC.MoveTo(m_rcClose.left-1,1); m_StoreBgDC.LineTo(m_rcClose.left-1,21); rect.DeflateRect(0,0,1,1); m_StoreBgDC.RoundRect(rect,CPoint(7,5)); m_StoreBgDC.SelectObject(pOldPen); m_StoreBgDC.SelectObject(pOldBrush); rect.bottom=30; HICON hIcon=GetIcon(FALSE); if (hIcon) //画Icon { DrawIconEx(m_StoreBgDC.m_hDC,5,7,hIcon,16,16,0,NULL,DI_NORMAL | DI_COMPAT); rect.left+=21; m_rcIcon.SetRect(5,7,21,23); } CString str; GetWindowText(str); if (str!="") //写标题 { rect.left+=5; rect.top+=4; m_StoreBgDC.SetBkMode(TRANSPARENT); COLORREF OldClr=m_StoreBgDC.SetTextColor(RGB(50,50,50)); CFont font; font.CreatePointFont(100,"雅黑",&m_StoreBgDC); CFont *pOldFont=m_StoreBgDC.SelectObject(&font); m_StoreBgDC.DrawText(str,rect,DT_VCENTER | DT_SINGLELINE); m_StoreBgDC.SelectObject(pOldFont); m_StoreBgDC.SetTextColor(OldClr); font.DeleteObject(); } /* m_StoreBgDC.SelectObject(pOldBmp);*/ bmp.DeleteObject(); } CRect rect; GetClientRect(rect); pDC->BitBlt(0,0,rect.Width(),rect.Height(),&m_StoreBgDC,0,0,SRCCOPY); return TRUE; }
void wxAuiGtkTabArt::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) { GtkWidget *widget = wnd->GetHandle(); GtkStyle *style_notebook = gtk_widget_get_style(wxGTKPrivate::GetNotebookWidget()); wxRect const &window_rect = wnd->GetRect(); int focus_width = 0; gtk_widget_style_get(wxGTKPrivate::GetNotebookWidget(), "focus-line-width", &focus_width, NULL); int tab_pos; if (m_flags &wxAUI_NB_BOTTOM) tab_pos = wxAUI_NB_BOTTOM; else //if (m_flags & wxAUI_NB_TOP) {} tab_pos = wxAUI_NB_TOP; // TODO: else if (m_flags &wxAUI_NB_LEFT) {} // TODO: else if (m_flags &wxAUI_NB_RIGHT) {} // figure out the size of the tab wxSize tab_size = GetTabSize(dc, wnd, page.caption, page.bitmap, page.active, close_button_state, x_extent); wxRect tab_rect = in_rect; tab_rect.width = tab_size.x; tab_rect.height = tab_size.y; tab_rect.y += 2 * GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder; if (page.active) tab_rect.height += 2 * GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder; // if no bitmap is set, we need a tiny correction if (! page.bitmap.IsOk()) tab_rect.height += 1; int gap_rect_height = 6 * GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder; int gap_rect_x = 1, gap_start = 0, gap_width = 0; int gap_rect_y = tab_rect.y - gap_rect_height; int gap_rect_width = window_rect.width; switch (tab_pos) { case wxAUI_NB_TOP: tab_rect.y -= 2 * GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder; if (!page.active) tab_rect.y += 2 * GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder; gap_rect_y = tab_rect.y + tab_rect.height - GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder / 2; // fall through case wxAUI_NB_BOTTOM: gap_start = tab_rect.x - GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_vborder / 2; gap_width = tab_rect.width; break; // TODO: case wxAUI_NB_LEFT: break; // TODO: case wxAUI_NB_RIGHT: break; } tab_rect.y += GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder / 2; gap_rect_y += GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder / 2; int padding = focus_width + GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder; int clip_width = tab_rect.width; if (tab_rect.x + tab_rect.width > in_rect.x + in_rect.width) clip_width = (in_rect.x + in_rect.width) - tab_rect.x; dc.SetClippingRegion(tab_rect.x, tab_rect.y - GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_vborder, clip_width, tab_rect.height + GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_vborder); GdkRectangle area; area.x = tab_rect.x - GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_vborder; area.y = tab_rect.y - 2 * GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder; area.width = clip_width + GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_vborder; area.height = tab_rect.height + 2 * GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder; wxGTKDCImpl *impldc = (wxGTKDCImpl*) dc.GetImpl(); GdkWindow* window = impldc->GetGDKWindow(); if (tab_pos == wxAUI_NB_BOTTOM) { if (page.active) { gtk_paint_box_gap(style_notebook, window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, widget, const_cast<char*>("notebook"), gap_rect_x, gap_rect_y, gap_rect_width, gap_rect_height, GTK_POS_BOTTOM, gap_start , gap_width); } gtk_paint_extension(style_notebook, window, page.active ? GTK_STATE_NORMAL : GTK_STATE_ACTIVE, GTK_SHADOW_OUT, &area, widget, const_cast<char*>("tab"), tab_rect.x, tab_rect.y, tab_rect.width, tab_rect.height, GTK_POS_TOP); } else { if (page.active) { gtk_paint_box_gap(style_notebook, window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, widget, const_cast<char*>("notebook"), gap_rect_x, gap_rect_y, gap_rect_width, gap_rect_height, GTK_POS_TOP, gap_start , gap_width); } gtk_paint_extension(style_notebook, window, page.active ? GTK_STATE_NORMAL : GTK_STATE_ACTIVE, GTK_SHADOW_OUT, &area, widget, const_cast<char*>("tab"), tab_rect.x, tab_rect.y, tab_rect.width, tab_rect.height, GTK_POS_BOTTOM); } wxCoord textX = tab_rect.x + padding + style_notebook->xthickness; int bitmap_offset = 0; if (page.bitmap.IsOk()) { bitmap_offset = textX; // draw bitmap int bitmapY = tab_rect.y +(tab_rect.height - page.bitmap.GetHeight()) / 2; if(!page.active) { if (tab_pos == wxAUI_NB_TOP) bitmapY += style_notebook->ythickness / 2; else bitmapY -= style_notebook->ythickness / 2; } dc.DrawBitmap(page.bitmap, bitmap_offset, bitmapY, true); textX += page.bitmap.GetWidth() + padding; } wxCoord textW, textH, textY; dc.SetFont(m_normalFont); dc.GetTextExtent(page.caption, &textW, &textH); textY = tab_rect.y + (tab_rect.height - textH) / 2; if(!page.active) { if (tab_pos == wxAUI_NB_TOP) textY += style_notebook->ythickness / 2; else textY -= style_notebook->ythickness / 2; } // draw tab text GdkColor text_colour = page.active ? style_notebook->fg[GTK_STATE_NORMAL] : style_notebook->fg[GTK_STATE_ACTIVE]; dc.SetTextForeground(wxColor(text_colour)); GdkRectangle focus_area; int padding_focus = padding - focus_width; focus_area.x = tab_rect.x + padding_focus; focus_area.y = textY - focus_width; focus_area.width = tab_rect.width - 2 * padding_focus; focus_area.height = textH + 2 * focus_width; if(page.active && (wnd->FindFocus() == wnd) && focus_area.x <= (area.x + area.width)) { // clipping seems not to work here, so we we have to recalc the focus-area manually if((focus_area.x + focus_area.width) > (area.x + area.width)) focus_area.width = area.x + area.width - focus_area.x + focus_width - GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_vborder; gtk_paint_focus (style_notebook, window, GTK_STATE_ACTIVE, NULL, widget, "tab", focus_area.x, focus_area.y, focus_area.width, focus_area.height); } dc.DrawText(page.caption, textX, textY); // draw close-button on tab (if enabled) if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN) { wxRect rect(tab_rect.x, tab_rect.y, tab_rect.width - style_notebook->xthickness, tab_rect.height); if(!page.active) { if (tab_pos == wxAUI_NB_TOP) rect.y += style_notebook->ythickness / 2; else rect.y -= style_notebook->ythickness / 2; } *out_button_rect = DrawCloseButton(dc, widget, close_button_state, rect, wxRIGHT, &area); } tab_rect.width = std::min(tab_rect.width, clip_width); *out_tab_rect = tab_rect; dc.DestroyClippingRegion(); }