您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wxCopyRectToRECT函数代码示例

51自学网 2021-06-03 10:09:02
  C++
这篇教程C++ wxCopyRectToRECT函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中wxCopyRectToRECT函数的典型用法代码示例。如果您正苦于以下问题:C++ wxCopyRectToRECT函数的具体用法?C++ wxCopyRectToRECT怎么用?C++ wxCopyRectToRECT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了wxCopyRectToRECT函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: drawRect

void wxAuiMSWTabArt::DrawBorder(wxDC& dc, wxWindow* wnd, const wxRect& rect){    if ( !IsThemed() )    {        wxAuiGenericTabArt::DrawBorder(dc, wnd, rect);        return;    }    wxRect drawRect(rect);    drawRect.y += m_maxTabHeight + wnd->FromDIP(1);    drawRect.height -= m_maxTabHeight;    // Mask border not covered by native theme    wxRect topDrawRect(rect);    topDrawRect.height = drawRect.height;    dc.SetPen(wxPen(wnd->GetBackgroundColour(), GetBorderWidth(wnd)));    dc.DrawRectangle(topDrawRect);    RECT r;    wxCopyRectToRECT(drawRect, r);    wxUxThemeHandle hTheme(wnd, L"TAB");    ::DrawThemeBackground(        hTheme,        GetHdcOf(dc.GetTempHDC()),        TABP_PANE,        0,        &r,        NULL);}
开发者ID:oneeyeman1,项目名称:wxWidgets,代码行数:32,


示例2: WXUNUSED

voidwxRendererMSW::DoDrawFrameControl(UINT type,                                  UINT kind,                                  wxWindow * WXUNUSED(win),                                  wxDC& dc,                                  const wxRect& rect,                                  int flags){    wxCHECK_RET( dc.GetImpl(), wxT("Invalid wxDC") );    wxRect adjustedRect = dc.GetImpl()->MSWApplyGDIPlusTransform(rect);    RECT r;    wxCopyRectToRECT(adjustedRect, r);    int style = kind;    if ( flags & wxCONTROL_CHECKED )        style |= DFCS_CHECKED;    if ( flags & wxCONTROL_DISABLED )        style |= DFCS_INACTIVE;    if ( flags & wxCONTROL_FLAT )        style |= DFCS_MONO;    if ( flags & wxCONTROL_PRESSED )        style |= DFCS_PUSHED;    if ( flags & wxCONTROL_CURRENT )        style |= DFCS_HOT;    if ( flags & wxCONTROL_UNDETERMINED )        // Using DFCS_BUTTON3STATE here doesn't work (as might be expected),        // use the following two styles to get the same look of a check box        // in the undetermined state.        style |= DFCS_INACTIVE | DFCS_CHECKED;    ::DrawFrameControl(GetHdcOf(dc.GetTempHDC()), &r, type, style);}
开发者ID:chromylei,项目名称:third_party,代码行数:34,


示例3: GetPageSize

bool wxNotebook::MSWPrintChild(WXHDC hDC, wxWindow *child){    // solid background colour overrides themed background drawing    if ( !UseBgCol() && DoDrawBackground(hDC, child) )        return true;    // If we're using a solid colour (for example if we've switched off    // theming for this notebook), paint it    if (UseBgCol())    {        wxRect r = GetPageSize();        if ( r.IsEmpty() )            return false;        RECT rc;        wxCopyRectToRECT(r, rc);        // map rect to the coords of the window we're drawing in        if ( child )            ::MapWindowPoints(GetHwnd(), GetHwndOf(child), (POINT *)&rc, 2);        wxBrush brush(GetBackgroundColour());        HBRUSH hbr = GetHbrushOf(brush);        ::FillRect((HDC) hDC, &rc, hbr);        return true;    }    return wxNotebookBase::MSWPrintChild(hDC, child);}
开发者ID:chromylei,项目名称:third_party,代码行数:31,


示例4: hTheme

voidwxRendererXP::DrawTreeItemButton(wxWindow *win,                                 wxDC& dc,                                 const wxRect& rect,                                 int flags){    wxUxThemeHandle hTheme(win, L"TREEVIEW");    if ( !hTheme )    {        m_rendererNative.DrawTreeItemButton(win, dc, rect, flags);        return;    }    wxCHECK_RET( dc.GetImpl(), wxT("Invalid wxDC") );    wxRect adjustedRect = dc.GetImpl()->MSWApplyGDIPlusTransform(rect);    RECT r;    wxCopyRectToRECT(adjustedRect, r);    int state = flags & wxCONTROL_EXPANDED ? GLPS_OPENED : GLPS_CLOSED;    wxUxThemeEngine::Get()->DrawThemeBackground                            (                                hTheme,                                GetHdcOf(dc.GetTempHDC()),                                TVP_GLYPH,                                state,                                &r,                                NULL                            );}
开发者ID:chromylei,项目名称:third_party,代码行数:31,


示例5: WXUNUSED

voidwxRendererMSW::DoDrawFrameControl(UINT type,                                  UINT kind,                                  wxWindow * WXUNUSED(win),                                  wxDC& dc,                                  const wxRect& rect,                                  int flags){    RECT r;    wxCopyRectToRECT(rect, r);    int style = kind;    if ( flags & wxCONTROL_CHECKED )        style |= DFCS_CHECKED;    if ( flags & wxCONTROL_DISABLED )        style |= DFCS_INACTIVE;    if ( flags & wxCONTROL_FLAT )        style |= DFCS_MONO;    if ( flags & wxCONTROL_PRESSED )        style |= DFCS_PUSHED;    if ( flags & wxCONTROL_CURRENT )        style |= DFCS_HOT;    ::DrawFrameControl(GetHdcOf(dc.GetTempHDC()), &r, type, style);}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:25,


示例6: hTheme

voidwxRendererXP::DrawTreeItemButton(wxWindow *win,                                 wxDC& dc,                                 const wxRect& rect,                                 int flags){    wxUxThemeHandle hTheme(win, L"TREEVIEW");    if ( !hTheme )    {        m_rendererNative.DrawTreeItemButton(win, dc, rect, flags);        return;    }    RECT r;    wxCopyRectToRECT(rect, r);    int state = flags & wxCONTROL_EXPANDED ? GLPS_OPENED : GLPS_CLOSED;    wxUxThemeEngine::Get()->DrawThemeBackground                            (                                hTheme,                                GetHdcOf(dc.GetTempHDC()),                                TVP_GLYPH,                                state,                                &r,                                NULL                            );}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:27,


示例7: hTheme

voidwxRendererXP::DrawItemSelectionRect(wxWindow *win,                                    wxDC& dc,                                    const wxRect& rect,                                    int flags){    wxUxThemeHandle hTheme(win, L"LISTVIEW");    const int itemState = GetListItemState(flags);    wxUxThemeEngine* const te = wxUxThemeEngine::Get();    if ( te->IsThemePartDefined(hTheme, LVP_LISTITEM, itemState) )    {        RECT rc;        wxCopyRectToRECT(rect, rc);        if ( te->IsThemeBackgroundPartiallyTransparent(hTheme, LVP_LISTITEM, itemState) )            te->DrawThemeParentBackground(GetHwndOf(win), GetHdcOf(dc.GetTempHDC()), &rc);        te->DrawThemeBackground(hTheme, GetHdcOf(dc.GetTempHDC()), LVP_LISTITEM, itemState, &rc, 0);    }    else    {        m_rendererNative.DrawItemSelectionRect(win, dc, rect, flags);    }}
开发者ID:Asmodean-,项目名称:Ishiiruka,代码行数:25,


示例8: wxCopyRectToRECT

void wxAuiMSWToolBarArt::DrawOverflowButton(    wxDC& dc,    wxWindow* wnd,    const wxRect& rect,    int state){    if ( m_themed )    {        RECT r;        wxCopyRectToRECT(rect, r);        wxUxThemeHandle hTheme(wnd, L"Rebar");        int chevState;        if ( state & wxAUI_BUTTON_STATE_PRESSED )            chevState = CHEVS_PRESSED;        else if ( state & wxAUI_BUTTON_STATE_HOVER )                chevState = CHEVS_HOT;        else            chevState = CHEVS_NORMAL;        wxUxThemeEngine::Get()->DrawThemeBackground(            hTheme,            GetHdcOf(dc.GetTempHDC()),            (m_flags & wxAUI_TB_VERTICAL) ? RP_CHEVRONVERT : RP_CHEVRON,            chevState,            &r,            NULL);    }    else        wxAuiGenericToolBarArt::DrawOverflowButton(dc, wnd, rect, state);}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:32,


示例9: wxCopyRectToRECT

void wxTaskBarButtonImpl::SetThumbnailClip(const wxRect& rect){    m_thumbnailClipRect = rect;    RECT rc;    wxCopyRectToRECT(rect, rc);    m_taskbarList->SetThumbnailClip(m_parent->GetHWND(), rect.IsEmpty() ? NULL : &rc);}
开发者ID:EEmmanuel7,项目名称:wxWidgets,代码行数:7,


示例10: GetPageSize

WXHBRUSH wxNotebook::QueryBgBitmap(){    wxRect r = GetPageSize();    if ( r.IsEmpty() )        return 0;    wxUxThemeHandle theme(this, L"TAB");    if ( !theme )        return 0;    RECT rc;    wxCopyRectToRECT(r, rc);    WindowHDC hDC(GetHwnd());    wxUxThemeEngine::Get()->GetThemeBackgroundExtent                            (                                theme,                                (HDC) hDC,                                9 /* TABP_PANE */,                                0,                                &rc,                                &rc                            );    MemoryHDC hDCMem(hDC);    CompatibleBitmap hBmp(hDC, rc.right, rc.bottom);    SelectInHDC selectBmp(hDCMem, hBmp);    if ( !DoDrawBackground((WXHDC)(HDC)hDCMem) )        return 0;    return (WXHBRUSH)::CreatePatternBrush(hBmp);}
开发者ID:AdmiralCurtiss,项目名称:pcsx2,代码行数:34,


示例11: wxCHECK_RET

voidwxRendererXP::DoDrawButtonLike(HTHEME htheme,                               int part,                               wxDC& dc,                               const wxRect& rect,                               int flags){    wxCHECK_RET( dc.GetImpl(), wxT("Invalid wxDC") );    wxRect adjustedRect = dc.GetImpl()->MSWApplyGDIPlusTransform(rect);    RECT r;    wxCopyRectToRECT(adjustedRect, r);    // the base state is always 1, whether it is PBS_NORMAL,    // {CBS,RBS}_UNCHECKEDNORMAL or CBS_NORMAL    int state = 1;    // XBS_XXX is followed by XBX_XXXHOT, then XBS_XXXPRESSED and DISABLED    enum    {        NORMAL_OFFSET,        HOT_OFFSET,        PRESSED_OFFSET,        DISABLED_OFFSET,        STATES_COUNT    };    // in both RBS_ and CBS_ enums CHECKED elements are offset by 4 from base    // (UNCHECKED) ones and MIXED are offset by 4 again as there are all states    // from the above enum in between them    if ( flags & wxCONTROL_CHECKED )        state += STATES_COUNT;    else if ( flags & wxCONTROL_UNDETERMINED )        state += 2*STATES_COUNT;    if ( flags & wxCONTROL_DISABLED )        state += DISABLED_OFFSET;    else if ( flags & wxCONTROL_PRESSED )        state += PRESSED_OFFSET;    else if ( flags & wxCONTROL_CURRENT )        state += HOT_OFFSET;    // wxCONTROL_ISDEFAULT flag is only valid for push buttons    else if ( part == BP_PUSHBUTTON && (flags & wxCONTROL_ISDEFAULT) )        state = PBS_DEFAULTED;    wxUxThemeEngine::Get()->DrawThemeBackground                            (                                htheme,                                GetHdcOf(dc.GetTempHDC()),                                part,                                state,                                &r,                                NULL                            );}
开发者ID:chromylei,项目名称:third_party,代码行数:56,


示例12: wxCopyRectToRECT

bool wxListBox::RefreshItem(size_t n){    wxRect rect;    if ( !GetItemRect(n, rect) )        return false;    RECT rc;    wxCopyRectToRECT(rect, rc);    return ::InvalidateRect((HWND)GetHWND(), &rc, FALSE) == TRUE;}
开发者ID:Zombiebest,项目名称:Dolphin,代码行数:11,


示例13: hTheme

void ModernDockArt::DrawPaneButton(wxDC& dc,							  wxWindow* window,							  int button,							  int button_state,							  const wxRect& _rect,							  wxAuiPaneInfo& pane){	bool usingTheme = false;#ifdef __WXMSW__#if wxUSE_UXTHEME    if (wxUxThemeEngine::Get())    {        wxUxThemeHandle hTheme(m_win, L"WINDOW");        if (hTheme)        {			usingTheme = true;			// Get the real button position (compensating for borders)			//const wxRect rect(_rect.x, _rect.y+m_button_border_size, m_button_size, m_button_size);			const unsigned int ypos = _rect.y + (_rect.height/2) - (m_button_size/2); // center vertically			const wxRect rect(_rect.x, ypos, m_real_button_size, m_real_button_size);			// Draw the themed close button			RECT rc;			wxCopyRectToRECT(rect, rc);			int state = 0;			switch (button_state) {			case wxAUI_BUTTON_STATE_NORMAL:				state = 1; // CBS_NORMAL				break;			case wxAUI_BUTTON_STATE_HOVER:				state = 2; // CBS_HOT				break;			case wxAUI_BUTTON_STATE_PRESSED:				state = 3; // CBS_PUSHED				break;			default:				wxASSERT_MSG(false, wxT("Unknown state"));			}			wxUxThemeEngine::Get()->DrawThemeBackground(hTheme, GetHdcOf(dc), 19 /*WP_SMALLCLOSEBUTTON*/,                	state, &rc, NULL);		}	}#endif // wxUSE_UXTHEME#endif // __WXMSW__	// Fallback to default closebutton if themes are not enabled	if (!usingTheme) wxAuiDefaultDockArt::DrawPaneButton(dc, window, button, button_state, _rect, pane);}
开发者ID:boulerne,项目名称:e,代码行数:53,


示例14: theme

bool wxNotebook::DoDrawBackground(WXHDC hDC, wxWindow *child){    wxUxThemeHandle theme(child ? child : this, L"TAB");    if ( !theme )        return false;    // get the notebook client rect (we're not interested in drawing tabs    // themselves)    wxRect r = GetPageSize();    if ( r.IsEmpty() )        return false;    RECT rc;    wxCopyRectToRECT(r, rc);    // map rect to the coords of the window we're drawing in    if ( child )        ::MapWindowPoints(GetHwnd(), GetHwndOf(child), (POINT *)&rc, 2);    // we have the content area (page size), but we need to draw all of the    // background for it to be aligned correctly    wxUxThemeEngine::Get()->GetThemeBackgroundExtent                            (                                theme,                                (HDC) hDC,                                9 /* TABP_PANE */,                                0,                                &rc,                                &rc                            );    wxUxThemeEngine::Get()->DrawThemeBackground                            (                                theme,                                (HDC) hDC,                                9 /* TABP_PANE */,                                0,                                &rc,                                NULL                            );    return true;}
开发者ID:chromylei,项目名称:third_party,代码行数:42,


示例15: wxCopyRectToRECT

void wxAuiMSWTabArt::DrawBackground(wxDC& dc,    wxWindow* wnd,    const wxRect& rect){    if ( !IsThemed() )    {        wxAuiGenericTabArt::DrawBackground(dc, wnd, rect);        return;    }    int borderHeight = 2;    wxRect drawRect = rect;    drawRect.height -= borderHeight;    // Draw background    dc.SetBrush(wxBrush(wnd->GetBackgroundColour()));    dc.SetPen(*wxTRANSPARENT_PEN);    dc.DrawRectangle(drawRect);    // Draw top border    drawRect.y = drawRect.height;    drawRect.height = borderHeight + 2;    drawRect.Inflate(1, 0);    RECT r;    wxCopyRectToRECT(drawRect, r);    wxUxThemeHandle hTheme(wnd, L"TAB");    ::DrawThemeBackground(        hTheme,        GetHdcOf(dc.GetTempHDC()),        TABP_PANE,        0,        &r,        NULL);}
开发者ID:oneeyeman1,项目名称:wxWidgets,代码行数:39,


示例16: WXUNUSED

bool wxMenuItem::OnDrawItem(wxDC& dc, const wxRect& rc,                            wxODAction WXUNUSED(act), wxODStatus stat){    const MenuDrawData* data = MenuDrawData::Get();    wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl();    HDC hdc = GetHdcOf(*impl);    RECT rect;    wxCopyRectToRECT(rc, rect);    int imgWidth = wxMax(GetMarginWidth(), data->CheckSize.cx);    if ( IsOwnerDrawn() )    {        // font and colors to use        wxFont font;        GetFontToUse(font);        wxColour colText, colBack;        GetColourToUse(stat, colText, colBack);        // calculate metrics of item parts        RECT rcSelection = rect;        data->ItemMargin.ApplyTo(rcSelection);        RECT rcSeparator = rcSelection;        data->SeparatorMargin.ApplyTo(rcSeparator);        RECT rcGutter = rcSelection;        rcGutter.right = data->ItemMargin.cxLeftWidth                       + data->CheckBgMargin.cxLeftWidth                       + data->CheckMargin.cxLeftWidth                       + imgWidth                       + data->CheckMargin.cxRightWidth                       + data->CheckBgMargin.cxRightWidth;        RECT rcText = rcSelection;        rcText.left = rcGutter.right + data->TextBorder;        // we draw the text label vertically centered, but this results in it        // being 1px too low compared to native menus for some reason, fix it        if ( data->MenuLayout() != MenuDrawData::FullTheme )            rcText.top--;#if wxUSE_UXTHEME        // If a custom background colour is explicitly specified, we should use        // it instead of the default theme background.        wxUxThemeEngine* const theme = GetBackgroundColour().IsOk()                                        ? NULL                                        : MenuDrawData::GetUxThemeEngine();        if ( theme )        {            POPUPITEMSTATES state;            if ( stat & wxODDisabled )            {                state = (stat & wxODSelected) ? MPI_DISABLEDHOT                                              : MPI_DISABLED;            }            else if ( stat & wxODSelected )            {                state = MPI_HOT;            }            else            {                state = MPI_NORMAL;            }            wxUxThemeHandle hTheme(GetMenu()->GetWindow(), L"MENU");            if ( theme->IsThemeBackgroundPartiallyTransparent(hTheme,                    MENU_POPUPITEM, state) )            {                theme->DrawThemeBackground(hTheme, hdc,                                           MENU_POPUPBACKGROUND,                                           0, &rect, NULL);            }            theme->DrawThemeBackground(hTheme, hdc, MENU_POPUPGUTTER,                                       0, &rcGutter, NULL);            if ( IsSeparator() )            {                rcSeparator.left = rcGutter.right;                theme->DrawThemeBackground(hTheme, hdc, MENU_POPUPSEPARATOR,                                           0, &rcSeparator, NULL);                return true;            }            theme->DrawThemeBackground(hTheme, hdc, MENU_POPUPITEM,                                       state, &rcSelection, NULL);        }        else#endif // wxUSE_UXTHEME        {            if ( IsSeparator() )            {                DrawEdge(hdc, &rcSeparator, EDGE_ETCHED, BF_TOP);                return true;//.........这里部分代码省略.........
开发者ID:emutavchi,项目名称:pxCore,代码行数:101,


示例17: GetHdcOf

// draw the itembool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc,                              wxODAction, wxODStatus stat){    // we do nothing if item isn't ownerdrawn    if ( !IsOwnerDrawn() )        return true;    wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl();    HDC hdc = GetHdcOf(*impl);    RECT rect;    wxCopyRectToRECT(rc, rect);    {        // set the font and colors        wxFont font;        GetFontToUse(font);        wxColour colText, colBack;        GetColourToUse(stat, colText, colBack);        SelectInHDC selFont(hdc, GetHfontOf(font));        wxMSWImpl::wxTextColoursChanger textCol(hdc, colText, colBack);        wxMSWImpl::wxBkModeChanger bkMode(hdc, wxBRUSHSTYLE_TRANSPARENT);        AutoHBRUSH hbr(wxColourToPalRGB(colBack));        SelectInHDC selBrush(hdc, hbr);        ::FillRect(hdc, &rect, hbr);        // using native API because it recognizes '&'        wxString text = GetName();        SIZE sizeRect;        ::GetTextExtentPoint32(hdc, text.c_str(), text.length(), &sizeRect);        int flags = DST_PREFIXTEXT;        if ( (stat & wxODDisabled) && !(stat & wxODSelected) )            flags |= DSS_DISABLED;        if ( (stat & wxODHidePrefix) )            flags |= DSS_HIDEPREFIX;        int x = rc.x + GetMarginWidth();        int y = rc.y + (rc.GetHeight() - sizeRect.cy) / 2;        int cx = rc.GetWidth() - GetMarginWidth();        int cy = sizeRect.cy;        ::DrawState(hdc, NULL, NULL, wxMSW_CONV_LPARAM(text),                    text.length(), x, y, cx, cy, flags);    } // reset to default the font, colors and brush    if (stat & wxODHasFocus)        ::DrawFocusRect(hdc, &rect);    return true;}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:62,


示例18: switch

void wxAuiMSWTabArt::DrawButton(wxDC& dc,    wxWindow* wnd,    const wxRect& in_rect,    int bitmap_id,    int button_state,    int orientation,    wxRect* out_rect){    if ( !IsThemed() )    {        wxAuiGenericTabArt::DrawButton(dc, wnd, in_rect, bitmap_id, button_state, orientation, out_rect);        return;    }    const wchar_t* themeId = NULL;    int part = 0;    switch (bitmap_id)    {    case wxAUI_BUTTON_CLOSE:        themeId = L"Window";        part = WP_CLOSEBUTTON;        break;    case wxAUI_BUTTON_LEFT:        themeId = L"Spin";        part = SPNP_DOWNHORZ;        break;    case wxAUI_BUTTON_RIGHT:        themeId = L"Spin";        part = SPNP_UPHORZ;        break;    case wxAUI_BUTTON_WINDOWLIST:        themeId = L"Combobox";        part = CP_DROPDOWNBUTTON;        break;    }    wxRect rect = in_rect;    if ( orientation == wxLEFT )    {        rect.SetX(in_rect.x);        rect.SetY(((in_rect.y + in_rect.height) / 2) - (m_closeBtnSize.GetHeight() / 2));        rect.SetWidth(m_closeBtnSize.GetWidth());        rect.SetHeight(m_closeBtnSize.GetHeight());    }    else    {        rect = wxRect(in_rect.x + in_rect.width - m_closeBtnSize.GetWidth(),            ((in_rect.y + in_rect.height) / 2) - (m_closeBtnSize.GetHeight() / 2),            m_closeBtnSize.GetWidth(), m_closeBtnSize.GetHeight());    }    if ( bitmap_id == wxAUI_BUTTON_LEFT ||        bitmap_id == wxAUI_BUTTON_RIGHT )    {        rect.y = in_rect.y;        rect.height = in_rect.height - wnd->FromDIP(7);    }    dc.SetPen(*wxTRANSPARENT_PEN);    dc.SetBrush(wxBrush(m_baseColour));    dc.DrawRectangle(rect);    int btnState;    if ( button_state == wxAUI_BUTTON_STATE_DISABLED )        btnState = TTCS_PRESSED + 1;    else if ( button_state == wxAUI_BUTTON_STATE_HOVER )        btnState = TTCS_HOT;    else if ( button_state == wxAUI_BUTTON_STATE_PRESSED )        btnState = TTCS_PRESSED;    else        btnState = TTCS_NORMAL;    wxUxThemeHandle hTheme(wnd, themeId);    wxRect btnRect(rect);    btnRect.width -= wnd->FromDIP(1);    RECT btnR;    wxCopyRectToRECT(btnRect, btnR);    ::DrawThemeBackground(hTheme, GetHdcOf(dc.GetTempHDC()), part, btnState, &btnR, NULL);    if ( out_rect )        *out_rect = rect;}
开发者ID:oneeyeman1,项目名称:wxWidgets,代码行数:86,


示例19: hTheme

void wxAuiMSWToolBarArt::DrawDropDownButton(    wxDC& dc,    wxWindow* wnd,    const wxAuiToolBarItem& item,    const wxRect& rect){    if ( m_themed )    {        wxUxThemeHandle hTheme(wnd, L"Toolbar");        wxUxThemeEngine* const te = wxUxThemeEngine::Get();        int dropDownWidth = 14;        int textWidth = 0, textHeight = 0, textX = 0, textY = 0;        int bmpX = 0, bmpY = 0;        wxRect buttonRect = wxRect(rect.x,            rect.y,            rect.width - dropDownWidth,            rect.height);        wxRect dropDownRect = wxRect(rect.x + rect.width - dropDownWidth - 1,            rect.y,            dropDownWidth + 1,            rect.height);        if ( m_flags & wxAUI_TB_TEXT )        {            dc.SetFont(m_font);            int tx, ty;            if ( m_flags & wxAUI_TB_TEXT )            {                dc.GetTextExtent(wxT("ABCDHgj"), &tx, &textHeight);                textWidth = 0;            }            dc.GetTextExtent(item.GetLabel(), &textWidth, &ty);        }        RECT btnR;        wxCopyRectToRECT(buttonRect, btnR);        RECT dropDownR;        wxCopyRectToRECT(dropDownRect, dropDownR);        int btnState;        if ( item.GetState() & wxAUI_BUTTON_STATE_DISABLED )            btnState = TS_DISABLED;        else if ( item.GetState() & wxAUI_BUTTON_STATE_PRESSED )            btnState = TS_PRESSED;        else if ( item.GetState() & wxAUI_BUTTON_STATE_HOVER )            btnState = TS_HOT;        else            btnState = TS_NORMAL;        te->DrawThemeBackground(            hTheme,            GetHdcOf(dc.GetTempHDC()),            TP_SPLITBUTTON,            btnState,            &btnR,            NULL);        te->DrawThemeBackground(            hTheme,            GetHdcOf(dc.GetTempHDC()),            TP_SPLITBUTTONDROPDOWN,            btnState,            &dropDownR,            NULL);        if ( m_textOrientation == wxAUI_TBTOOL_TEXT_BOTTOM )        {            bmpX = buttonRect.x +                (buttonRect.width / 2) -                (item.GetBitmap().GetWidth() / 2);            bmpY = buttonRect.y +                ((buttonRect.height - textHeight) / 2) -                (item.GetBitmap().GetHeight() / 2);            textX = rect.x + (rect.width / 2) - (textWidth / 2) + 1;            textY = rect.y + rect.height - textHeight - 1;        }        else if ( m_textOrientation == wxAUI_TBTOOL_TEXT_RIGHT )        {            bmpX = rect.x + 3;            bmpY = rect.y +                (rect.height / 2) -                (item.GetBitmap().GetHeight() / 2);            textX = bmpX + 3 + item.GetBitmap().GetWidth();            textY = rect.y +                (rect.height / 2) -                (textHeight / 2);        }        wxBitmap bmp;        if ( item.GetState() & wxAUI_BUTTON_STATE_DISABLED )        {            bmp = item.GetDisabledBitmap();//.........这里部分代码省略.........
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:101,


示例20: CHECK_HR

//.........这里部分代码省略.........    CHECK_HR(hret);    // document advise    m_docAdviseCookie = 0;    hret = m_oleObject->Advise(adviseSink, &m_docAdviseCookie);    CHECK_HR(hret);    // TODO:Needed?//    hret = m_viewObject->SetAdvise(DVASPECT_CONTENT, 0, adviseSink);    m_oleObject->SetHostNames(L"wxActiveXContainer", NULL);    OleSetContainedObject(m_oleObject, TRUE);    OleRun(m_oleObject);    // Get IOleInPlaceObject interface    hret = m_oleInPlaceObject.QueryInterface(        IID_IOleInPlaceObject, m_ActiveX);    CHECK_HR(hret);    // status    DWORD dwMiscStatus;    m_oleObject->GetMiscStatus(DVASPECT_CONTENT, &dwMiscStatus);    CHECK_HR(hret);    // set client site first ?    if (dwMiscStatus & OLEMISC_SETCLIENTSITEFIRST)        m_oleObject->SetClientSite(m_clientSite);    // stream init    wxAutoIPersistStreamInit        pPersistStreamInit(IID_IPersistStreamInit, m_oleObject);    if (pPersistStreamInit.Ok())    {        hret = pPersistStreamInit->InitNew();        CHECK_HR(hret);    }    if (! (dwMiscStatus & OLEMISC_SETCLIENTSITEFIRST))        m_oleObject->SetClientSite(m_clientSite);    m_oleObjectHWND = 0;    if (m_oleInPlaceObject.Ok())    {        hret = m_oleInPlaceObject->GetWindow(&m_oleObjectHWND);        if (SUCCEEDED(hret))            ::SetActiveWindow(m_oleObjectHWND);    }    if (! (dwMiscStatus & OLEMISC_INVISIBLEATRUNTIME))    {        RECT posRect;        wxCopyRectToRECT(m_realparent->GetClientSize(), posRect);        if (posRect.right > 0 && posRect.bottom > 0 &&            m_oleInPlaceObject.Ok())        {            m_oleInPlaceObject->SetObjectRects(&posRect, &posRect);        }        hret = m_oleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, NULL,            m_clientSite, 0, (HWND)m_realparent->GetHWND(), &posRect);        CHECK_HR(hret);        hret = m_oleObject->DoVerb(OLEIVERB_SHOW, 0, m_clientSite, 0,            (HWND)m_realparent->GetHWND(), &posRect);        CHECK_HR(hret);    }    if (! m_oleObjectHWND && m_oleInPlaceObject.Ok())    {        hret = m_oleInPlaceObject->GetWindow(&m_oleObjectHWND);        CHECK_HR(hret);    }    if (m_oleObjectHWND)    {        ::SetActiveWindow(m_oleObjectHWND);        ::ShowWindow(m_oleObjectHWND, SW_SHOW);        this->AssociateHandle(m_oleObjectHWND);        this->Reparent(m_realparent);        wxWindow* pWnd = m_realparent;        int id = m_realparent->GetId();        pWnd->Connect(id, wxEVT_SIZE,            wxSizeEventHandler(wxActiveXContainer::OnSize), 0, this);//        this->Connect(GetId(), wxEVT_PAINT,//            wxPaintEventHandler(wxActiveXContainer::OnPaint), 0, this);        pWnd->Connect(id, wxEVT_SET_FOCUS,            wxFocusEventHandler(wxActiveXContainer::OnSetFocus), 0, this);        pWnd->Connect(id, wxEVT_KILL_FOCUS,            wxFocusEventHandler(wxActiveXContainer::OnKillFocus), 0, this);    }}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:101,


示例21: WXUNUSED

void wxComboCtrl::OnPaintEvent( wxPaintEvent& WXUNUSED(event) ){    // TODO: Convert drawing in this function to Windows API Code    wxSize sz = GetClientSize();    wxDC* dcPtr = wxAutoBufferedPaintDCFactory(this);    wxDC& dc = *dcPtr;    const wxRect& rectButton = m_btnArea;    wxRect rectTextField = m_tcArea;    // FIXME: Either SetBackgroundColour or GetBackgroundColour    //        doesn't work under Vista, so here's a temporary    //        workaround.    //        In the theme-less rendering code below, this fixes incorrect    //        background on read-only comboboxes (they are gray, but should be    //        white).    wxColour bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);#if wxUSE_UXTHEME    const bool isEnabled = IsThisEnabled();    wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl();    HDC hDc = GetHdcOf(*impl);    HWND hWnd = GetHwndOf(this);    wxUxThemeHandle hTheme(this, L"COMBOBOX");#endif // wxUSE_UXTHEME    wxRect borderRect(0,0,sz.x,sz.y);    if ( m_iFlags & wxCC_IFLAG_BUTTON_OUTSIDE )    {        borderRect = m_tcArea;        borderRect.Inflate(1);    }    int drawButFlags = 0;#if wxUSE_UXTHEME    if ( hTheme )    {        const bool useVistaComboBox = ::wxGetWinVersion() >= wxWinVersion_Vista;        RECT rFull;        wxCopyRectToRECT(borderRect, rFull);        RECT rButton;        wxCopyRectToRECT(rectButton, rButton);        RECT rBorder;        wxCopyRectToRECT(borderRect, rBorder);        bool isNonStdButton = (m_iFlags & wxCC_IFLAG_BUTTON_OUTSIDE) ||                              (m_iFlags & wxCC_IFLAG_HAS_NONSTANDARD_BUTTON);        //        // Get some states for themed drawing        int butState;        if ( !isEnabled )        {            butState = CBXS_DISABLED;        }        // Vista will display the drop-button as depressed always        // when the popup window is visilbe        else if ( (m_btnState & wxCONTROL_PRESSED) ||                  (useVistaComboBox && !IsPopupWindowState(Hidden)) )        {            butState = CBXS_PRESSED;        }        else if ( m_btnState & wxCONTROL_CURRENT )        {            butState = CBXS_HOT;        }        else        {            butState = CBXS_NORMAL;        }        int comboBoxPart = 0;  // For XP, use the 'default' part        RECT* rUseForBg = &rBorder;        bool drawFullButton = false;        int bgState = butState;        const bool isFocused = (FindFocus() == GetMainWindowOfCompositeControl()) ? true : false;        if ( useVistaComboBox )        {            // Draw the entire control as a single button?            if ( !isNonStdButton )            {                if ( HasFlag(wxCB_READONLY) )                    drawFullButton = true;            }            if ( drawFullButton )            {                comboBoxPart = CP_READONLY;                rUseForBg = &rFull;//.........这里部分代码省略.........
开发者ID:catalinr,项目名称:wxWidgets,代码行数:101,



注:本文中的wxCopyRectToRECT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ wxCursor函数代码示例
C++ wxConstCast函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。