当前位置: 首页>>代码示例>>C++>>正文


C++ wxColour::Ok方法代码示例

本文整理汇总了C++中wxColour::Ok方法的典型用法代码示例。如果您正苦于以下问题:C++ wxColour::Ok方法的具体用法?C++ wxColour::Ok怎么用?C++ wxColour::Ok使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxColour的用法示例。


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

示例1: SetForegroundColour

bool wxCheckBox::SetForegroundColour(const wxColour& colour)
{
    if ( !wxCheckBoxBase::SetForegroundColour(colour) )
        return false;

    // the only way to change the checkbox foreground colour under Windows XP
    // is to owner draw it
    if ( wxUxThemeEngine::GetIfActive() )
        MakeOwnerDrawn(colour.Ok());

    return true;
}
开发者ID:EdgarTx,项目名称:wx,代码行数:12,代码来源:checkbox.cpp

示例2: DoMSWControlColor

WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd)
{
    HDC hdc = (HDC)pDC;
    if ( m_hasFgCol )
    {
        ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
    }

    WXHBRUSH hbr = 0;
    if ( !colBg.Ok() )
    {
        hbr = MSWGetBgBrush(pDC, hWnd);

        // if the control doesn't have any bg colour, foreground colour will be
        // ignored as the return value would be 0 -- so forcefully give it a
        // non default background brush in this case
        if ( !hbr && m_hasFgCol )
            colBg = GetBackgroundColour();
    }

    // use the background colour override if a valid colour is given
    if ( colBg.Ok() )
    {
        ::SetBkColor(hdc, wxColourToRGB(colBg));

        // draw children with the same colour as the parent
        wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBg, wxSOLID);

        hbr = (WXHBRUSH)brush->GetResourceHandle();

        // if we use custom background, we should set foreground ourselves too
        if ( !m_hasFgCol )
        {
            ::SetTextColor(hdc, ::GetSysColor(COLOR_WINDOWTEXT));
        }
        //else: already set above
    }

    return hbr;
}
开发者ID:Duion,项目名称:Torsion,代码行数:40,代码来源:control.cpp

示例3: Init

    void wxsMyColourPropertyClass::Init( int type, const wxColour& colour )
    {
        wxColourPropertyValue cpv;

        if ( colour.Ok() )
            cpv.Init( type, colour );
        else
            cpv.Init( type, *wxWHITE );

        m_flags |= wxPG_PROP_STATIC_CHOICES; // Colour selection cannot be changed.

        m_value = wxColourPropertyValueToVariant(cpv);

        OnSetValue();
    }
开发者ID:stahta01,项目名称:EmBlocks,代码行数:15,代码来源:wxscolourproperty.cpp

示例4: SetForegroundColour

bool wxMenuBar::SetForegroundColour(const wxColour& col)
{
    if (!wxWindowBase::SetForegroundColour(col))
        return false;
    if (!col.Ok())
        return false;
    if (m_mainWidget)
        wxDoChangeForegroundColour(m_mainWidget, (wxColour&) col);

    size_t menuCount = GetMenuCount();
    for (size_t i = 0; i < menuCount; i++)
        m_menus.Item(i)->GetData()->SetForegroundColour((wxColour&) col);

    return true;
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:15,代码来源:menu.cpp

示例5: wxGetColourFromUser

wxColour wxGetColourFromUser(wxWindow *parent, const wxColour& colInit, const wxString& caption)
{
    static wxColourData data;
    data.SetChooseFull(true);
    if ( colInit.Ok() )
    {
        data.SetColour((wxColour &)colInit); // const_cast
    }

    wxColour colRet;
    wxColourDialog dialog(parent, &data);
    if (!caption.empty())
        dialog.SetTitle(caption);
    if ( dialog.ShowModal() == wxID_OK )
    {
        colRet = dialog.GetColourData().GetColour();
    }
    //else: leave it invalid

    return colRet;
}
开发者ID:252525fb,项目名称:rpcs3,代码行数:21,代码来源:utilscmn.cpp

示例6: DrawBackground

void wxStdRenderer::DrawBackground(wxDC& dc,
                                   const wxColour& col,
                                   const wxRect& rect,
                                   int WXUNUSED(flags),
                                   wxWindow *window)
{
    wxColour colBg;

    if (col.Ok())
    {
        colBg = col;
    }
    else if (window)
    {
        colBg = m_scheme->GetBackground(window);
    }
    else
    {
        colBg = wxSCHEME_COLOUR(m_scheme, CONTROL);
    }

    DrawSolidRect(dc, colBg, rect);
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:23,代码来源:stdrend.cpp

示例7: GetColourFromUser

wxColour GetColourFromUser(wxWindow *parent, const wxColour& colInit, const wxString& caption, const wxString& palette)
{
    wxColourData data;
    data = sett().GetCustomColors( palette );
    data.SetChooseFull(true);
    if ( colInit.Ok() )
    {
        data.SetColour((wxColour &)colInit); // const_cast
    }

    wxColour colRet;
    wxColourDialog dialog(parent, &data);
    if (!caption.empty())
        dialog.SetTitle(caption);
    if ( dialog.ShowModal() == wxID_OK )
    {
        colRet = dialog.GetColourData().GetColour();
    }
    //else: leave it invalid
    sett().SaveCustomColors( dialog.GetColourData(), palette );

    return colRet;
}
开发者ID:Mailaender,项目名称:springlobby,代码行数:23,代码来源:uiutils.cpp

示例8: draw_data

void FPlot::draw_data (wxDC& dc,
                       double (*compute_y)(vector<Point>::const_iterator,
                                           Model const*),
                       fityk::Data const* data,
                       Model const* model,
                       wxColour const& color, wxColour const& inactive_color,
                       int Y_offset,
                       bool cumulative)
{
    if (data->is_empty())
        return;
    vector<Point>::const_iterator first = data->get_point_at(ftk->view.left()),
                                  last = data->get_point_at(ftk->view.right());
    if (first > data->points().begin())
        --first;
    if (last < data->points().end())
        ++last;
    // prepare coordinates
    int len = last - first;
    if (len <= 0)
        return;
    wxPoint2DDouble *pp = new wxPoint2DDouble[len];
    vector<bool> aa(len);
    vector<double> yy(len);
    Y_offset *= (get_pixel_height(dc) / 100);
    for (int i = 0; i != len; ++i) {
        const Point& p = *(first + i);
        pp[i].m_x = xs.px_d(p.x);
        yy[i] = (*compute_y)((first+i), model);
        if (cumulative && i > 0)
            yy[i] += yy[i-1];
        pp[i].m_y = ys.px_d(yy[i]) - Y_offset;
        aa[i] = p.is_active;
    }

    // draw inactive
    wxColour icol = inactive_color.Ok() ? inactive_color : inactiveDataCol;
    dc.SetPen(wxPen(icol, pen_width));
    dc.SetBrush(wxBrush(icol, wxSOLID));
    draw_data_by_activity(dc, pp, aa, false);
    if (draw_sigma)
        for (int i = 0; i != len; ++i)
            if (!aa[i]) {
                double sigma = (first + i)->sigma;
                dc.DrawLine(iround(pp[i].m_x), ys.px(yy[i] - sigma) - Y_offset,
                            iround(pp[i].m_x), ys.px(yy[i] + sigma) - Y_offset);
            }

    // draw active
    wxColour acol = color.Ok() ? color : activeDataCol;
    dc.SetPen(wxPen(acol, pen_width));
    dc.SetBrush(wxBrush(acol, wxSOLID));
    draw_data_by_activity(dc, pp, aa, true);
    if (draw_sigma)
        for (int i = 0; i != len; ++i)
            if (aa[i]) {
                double sigma = (first + i)->sigma;
                dc.DrawLine(iround(pp[i].m_x), ys.px(yy[i] - sigma) - Y_offset,
                            iround(pp[i].m_x), ys.px(yy[i] + sigma) - Y_offset);
            }

    delete [] pp;
}
开发者ID:darckense,项目名称:fityk,代码行数:63,代码来源:plot.cpp


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