• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ wxSize类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: CalcContinuumGeometry

//=================================================================================
void SliderControlBase::CalcContinuumGeometry( ContinuumGeometry& continuumGeometry, const wxSize& size )
{
    continuumGeometry.radius = size.GetHeight() / 2;
    continuumGeometry.leftMostPos.x = continuumGeometry.radius;
    continuumGeometry.leftMostPos.y = size.GetHeight() / 2;
    continuumGeometry.rightMostPos.x = size.GetWidth() - continuumGeometry.radius;
    continuumGeometry.rightMostPos.y = size.GetHeight() / 2;
}
开发者ID:spencerparkin,项目名称:Junk,代码行数:9,代码来源:SliderControlBase.cpp


示例2: PrepareIcon

// This function converts to the right size with the given background colour
wxBitmap PrepareIcon(wxIcon icon, wxSize size)
{
	if (icon.GetWidth() == size.GetWidth() && icon.GetHeight() == size.GetHeight())
		return icon;
	wxBitmap bmp;
	bmp.CopyFromIcon(icon);
	return bmp.ConvertToImage().Rescale(size.GetWidth(), size.GetHeight());
}
开发者ID:ErichKrause,项目名称:filezilla,代码行数:9,代码来源:systemimagelist.cpp


示例3: MakeString

wxString Variant::MakeString (const wxSize & size)
{
    wxString tmp;
    tmp << "{" << size.GetWidth()
        << ", " << size.GetHeight() << "}"
        ;
    return tmp;
}
开发者ID:svn2github,项目名称:fbide,代码行数:8,代码来源:variant.cpp


示例4: SetSize

bool wxVideoXANIM::SetSize(wxSize size)
{
    if (!m_video_output)
        return false;

    m_video_output->SetSize(size.GetWidth(), size.GetHeight());
    return false;
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:8,代码来源:vidxanm.cpp


示例5:

void
TstLayer_t::setSize(const wxSize &sz)
{
    if (sz == mDC->GetSize()) return;
    mSurface->SetWidth(sz.GetWidth());
    mSurface->SetHeight(sz.GetHeight());
    _updateDC();
}
开发者ID:charlesw1234,项目名称:learning,代码行数:8,代码来源:tst-wx.cpp


示例6: SetCenter

void wxPolarAreaChart::SliceArc::Resize(const wxSize &size)
{
    wxDouble x = (size.GetX() / 2);
    wxDouble y = (size.GetY() / 2);
    wxDouble radius = ((x < y) ? x : y);

    SetCenter(x, y);
}
开发者ID:yecaokinux,项目名称:wxCharts,代码行数:8,代码来源:wxpolarareachart.cpp


示例7: realPosition

void wxJigsawInputParameter::Draw(wxDC & dc, const wxPoint & pos, const wxSize & offset, double scale, wxColour color)
{
	wxPoint realPosition(
		pos.x + offset.GetWidth(), 
		pos.y /*+ offset.GetHeight()*/);
	/*wxLogTrace(wxTraceMask(), _("ParameterPos = %i,%i; Offset=%i, %i"),
		realPosition.x, realPosition.y, offset.x, offset.y);*/
	wxSize labelSize;
	wxSize size = GetSize(dc, scale);
	dc.GetTextExtent(m_Label, &labelSize.x, &labelSize.y, 0, 0, (wxFont *)&dc.GetFont());

	//Draw the text with bevel
	wxRect rectText(realPosition, size);
	rectText.x++;
	rectText.y++;
	dc.SetTextForeground(*wxBLACK);
	dc.DrawLabel(m_Label, rectText, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);

	rectText.x--;
	rectText.y--;
	dc.SetTextForeground(*wxWHITE);
	dc.DrawLabel(m_Label, rectText, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);

	
	wxPoint shapePos;
	wxSize shapeSize;
	if(m_Shape)
	{
		shapeSize = m_Shape->GetSize(dc, scale);
		shapePos = wxPoint(
			pos.x + labelSize.x + wxJigsawInputParameter::ParameterSpacing*scale, 
			pos.y + (size.GetHeight()-shapeSize.GetHeight())/2);
		m_Shape->SetPosition(shapePos.x, 
			shapePos.y + (size.GetHeight()-shapeSize.GetHeight())*scale/2 - offset.GetHeight());
		m_Shape->Draw(dc, offset, scale);
	}
	else
	{
		dc.SetPen(*wxBLACK_PEN);

		wxBrush paramBrush(wxColour(color.Red()*.9,color.Green()*.9,color.Blue()*.9)); 
		dc.SetBrush(paramBrush);
		//dc.SetBrush(*wxWHITE_BRUSH);

		shapeSize = wxJigsawInputParameter::GetDefaultParameterSize();
		shapeSize.x *= scale;
		shapeSize.y *= scale;
		shapePos = wxPoint(
			realPosition.x + labelSize.x + wxJigsawInputParameter::ParameterSpacing*scale, 
			realPosition.y + (size.GetHeight()-shapeSize.GetHeight())/2);
		wxJigsawShape::DrawShapeHeader(dc, shapePos, 
			shapeSize, GetStyle());
	}
	//dc.SetBrush(*wxTRANSPARENT_BRUSH);
	//dc.SetPen(*wxBLACK_PEN);
	//dc.DrawRectangle(realPosition, size);
}
开发者ID:cubemoon,项目名称:game-editor,代码行数:57,代码来源:wxJigsawInputParameter.cpp


示例8: switch

wxSize wxRibbonGallery::DoGetNextLargerSize(wxOrientation direction,
                                       wxSize relative_to) const
{
    if(m_art == NULL)
        return relative_to;

    wxMemoryDC dc;

    wxSize client = m_art->GetGalleryClientSize(dc, this, relative_to, NULL,
        NULL, NULL, NULL);

    // No need to grow if the given size can already display every item
    int nitems = (client.GetWidth() / m_bitmap_padded_size.x) *
        (client.GetHeight() / m_bitmap_padded_size.y);
    if(nitems >= (int)m_items.GetCount())
        return relative_to;

    switch(direction)
    {
    case wxHORIZONTAL:
        client.IncBy(m_bitmap_padded_size.x, 0);
        break;
    case wxVERTICAL:
        client.IncBy(0, m_bitmap_padded_size.y);
        break;
    case wxBOTH:
        client.IncBy(m_bitmap_padded_size);
        break;
    }

    client.x = (client.x / m_bitmap_padded_size.x) * m_bitmap_padded_size.x;
    client.y = (client.y / m_bitmap_padded_size.y) * m_bitmap_padded_size.y;

    wxSize size = m_art->GetGallerySize(dc, this, client);
    wxSize minimum = GetMinSize();

    if(size.GetWidth() < minimum.GetWidth() ||
        size.GetHeight() < minimum.GetHeight())
    {
        return relative_to;
    }

    switch(direction)
    {
    case wxHORIZONTAL:
        size.SetHeight(relative_to.GetHeight());
        break;
    case wxVERTICAL:
        size.SetWidth(relative_to.GetWidth());
        break;
    default:
        break;
    }

    return size;
}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:56,代码来源:gallery.cpp


示例9: IsMinimised

bool wxRibbonPanel::IsMinimised(wxSize at_size) const
{
    if(!m_minimised_size.IsFullySpecified())
        return false;

    return (at_size.GetX() <= m_minimised_size.GetX() &&
        at_size.GetY() <= m_minimised_size.GetY()) || 
        at_size.GetX() < m_smallest_unminimised_size.GetX() ||
        at_size.GetY() < m_smallest_unminimised_size.GetY();
}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:10,代码来源:panel.cpp


示例10: check_negative_size

bool check_negative_size(VALUE val, wxSize &size)
{
	size = unwrap<wxSize>(val);
	if(size.GetHeight() <= 0 || size.GetWidth() <= 0)
	{
		rb_raise(rb_eArgError,"%" PRIsVALUE " does have invalid size.", RB_OBJ_STRING(rb_inspect(val)));
		return false;
	}
	return true;
}
开发者ID:Hanmac,项目名称:rwx,代码行数:10,代码来源:wxSize.cpp


示例11: dc

 void RenderCanvas::OnPaint( wxPaintEvent& event )
 {
     // This is required even though dc is not used otherwise.
     // PrepareDC(dc);
     wxPaintDC dc(this);
     const wxSize size = GetClientSize();
     if ( m_RenderManager ) m_RenderManager->ResizeViewport( size.GetWidth(), size.GetHeight() );
     RenderFrame();
     event.Skip();
 }
开发者ID:juergen0815,项目名称:PEngIneLite,代码行数:10,代码来源:wx_render_canvas.cpp


示例12: wxcWrite

bool wxcWrite(const wxString& path, const wxSize& val) {
    wxConfigBase* conf = wxConfigBase::Get(false);
    if (!conf)
        return false;
    if (!conf->Write(path + wxT("_w"), val.GetWidth()))
        return false;
    if (!conf->Write(path + wxT("_h"), val.GetHeight()))
        return false;
    return true;
}
开发者ID:Joeywp,项目名称:OVLMake,代码行数:10,代码来源:confhelp.cpp


示例13: wxMoColour

wxMoColourPanel::wxMoColourPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name  ) :
wxPanel( parent, id,  pos, size, style | wxNO_BORDER | wxFULL_REPAINT_ON_RESIZE, name ), wxMoColour( (wxColour::ChannelType) 0, (wxColour::ChannelType)0, (wxColour::ChannelType)0, (wxColour::ChannelType)255 ) {

  SetBackgroundStyle(wxBG_STYLE_CUSTOM );

  if (!m_Pattern.Create( size.GetWidth(), size.GetHeight(), 24 )) {
        wxMessageBox(wxString("wxMoColourPanel error creating pattern bitmap."));
  }

}
开发者ID:inaes-tic,项目名称:tv-moldeo,代码行数:10,代码来源:wxMoColourPanel.cpp


示例14: SetPixelSize

    void SetPixelSize(const wxSize& pixelSize)
    {
        wxCHECK_RET( pixelSize.GetWidth() >= 0, "negative font width" );
        wxCHECK_RET( pixelSize.GetHeight() != 0, "zero font height" );

        Free();

        m_nativeFontInfo.SetPixelSize(pixelSize);
        m_sizeUsingPixels = true;
    }
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:10,代码来源:font.cpp


示例15: TryParse

bool TryParse( wxSize& dest, wxStringTokenizer& parts )
{
	long result[2];

	if( !parts.HasMoreTokens() || !parts.GetNextToken().ToLong( &result[0] ) ) return false;
	if( !parts.HasMoreTokens() || !parts.GetNextToken().ToLong( &result[1] ) ) return false;
	dest.SetWidth( result[0] );
	dest.SetHeight( result[1] );

	return true;
}
开发者ID:madnessw,项目名称:thesnow,代码行数:11,代码来源:StringHelpers.cpp


示例16: wxWindow

void ClientSizeTestCase::ClientSizeNotNegative()
{
    wxWindow* w = new wxWindow(wxTheApp->GetTopWindow(), -1,
                               wxDefaultPosition, wxDefaultSize,
                               wxBORDER_THEME);
    w->SetSize(wxSize(1,1));
    const wxSize szw = w->GetClientSize();
    CPPUNIT_ASSERT(szw.GetWidth() >= 0);
    CPPUNIT_ASSERT(szw.GetHeight() >= 0);
    w->Destroy();
}
开发者ID:beanhome,项目名称:dev,代码行数:11,代码来源:clientsize.cpp


示例17: SetCenter

void wxDoughnutAndPieChartBase::SliceArc::Resize(const wxSize &size,
                                                 const wxDoughnutAndPieChartOptionsBase& options)
{
    wxDouble x = (size.GetX() / 2) - 2;
    wxDouble y = (size.GetY() / 2) - 2;
    wxDouble outerRadius = ((x < y) ? x : y) - (GetOptions().GetOutlineWidth() / 2);
    wxDouble innerRadius = outerRadius * ((wxDouble)options.GetPercentageInnerCutout()) / 100;

    SetCenter(x, y);
    SetRadiuses(outerRadius, innerRadius);
}
开发者ID:Kvaz1r,项目名称:wxCharts,代码行数:11,代码来源:wxdoughnutandpiechartbase.cpp


示例18: AdjustFontSize

static void AdjustFontSize(wxFont& font, wxDC& dc, const wxSize& pixelSize)
{
    int currentSize = 0;
    int largestGood = 0;
    int smallestBad = 0;

    bool initialGoodFound = false;
    bool initialBadFound = false;

    // NB: this assignment was separated from the variable definition
    // in order to fix a gcc v3.3.3 compiler crash
    currentSize = font.GetPointSize();
    while (currentSize > 0)
    {
        dc.SetFont(font);

        // if currentSize (in points) results in a font that is smaller
        // than required by pixelSize it is considered a good size
        if (dc.GetCharHeight() <= pixelSize.GetHeight() &&
                (!pixelSize.GetWidth() ||
                 dc.GetCharWidth() <= pixelSize.GetWidth()))
        {
            largestGood = currentSize;
            initialGoodFound = true;
        }
        else
        {
            smallestBad = currentSize;
            initialBadFound = true;
        }
        if (!initialGoodFound)
        {
            currentSize /= 2;
        }
        else if (!initialBadFound)
        {
            currentSize *= 2;
        }
        else
        {
            int distance = smallestBad - largestGood;
            if (distance == 1)
                break;

            currentSize = largestGood + distance / 2;
        }

        font.SetPointSize(currentSize);
    }

    if (currentSize != largestGood)
        font.SetPointSize(largestGood);
}
开发者ID:EdgarTx,项目名称:wx,代码行数:53,代码来源:fontcmn.cpp


示例19: wxcRead

wxSize wxcRead(const wxString& path, const wxSize& def) {
    wxConfigBase* conf = wxConfigBase::Get(false);
    if (!conf)
        return def;
    wxSize val = def;
    int i;
    if (conf->Read(path + wxT("_w"), &i, def.GetWidth()))
        val.SetWidth(i);
    if (conf->Read(path + wxT("_h"), &i, def.GetHeight()))
        val.SetHeight(i);
    return val;
}
开发者ID:Joeywp,项目名称:OVLMake,代码行数:12,代码来源:confhelp.cpp


示例20: Add

void wxPolarAreaChart::Add(const wxChartSliceData &slice, 
                           size_t index,
                           const wxSize &size)
{
    wxDouble x = (size.GetX() / 2);
    wxDouble y = (size.GetY() / 2);
    wxDouble radius = ((x < y) ? x : y);

    SliceArc::ptr newSlice = SliceArc::ptr(new SliceArc(slice,
        x, y, 0, 0, radius));
    m_slices.insert(m_slices.begin() + index, newSlice);
}
开发者ID:Kvaz1r,项目名称:wxCharts,代码行数:12,代码来源:wxpolarareachart.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ wxSizeEvent类代码示例发布时间:2022-05-31
下一篇:
C++ wxShowEvent类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap