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


C++ wxRect::GetSize方法代码示例

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


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

示例1: dc

CStatusLineCtrl::CStatusLineCtrl(CQueueView* pParent, const t_EngineData* const pEngineData, const wxRect& initialPosition)
	: m_pEngineData(pEngineData)
{
	m_mdc = 0;
	m_pPreviousStatusText = 0;
	m_last_elapsed_seconds = 0;
	m_last_left = 0;
	m_last_bar_split = -1;
	m_last_permill = -1;

	wxASSERT(pEngineData);

#ifdef __WXMSW__
	Create(pParent, wxID_ANY, initialPosition.GetPosition(), initialPosition.GetSize());
#else
	Create(pParent->GetMainWindow(), wxID_ANY, initialPosition.GetPosition(), initialPosition.GetSize());
#endif

	SetOwnFont(pParent->GetFont());
	SetForegroundColour(pParent->GetForegroundColour());
	SetBackgroundStyle(wxBG_STYLE_CUSTOM);
	SetBackgroundColour(pParent->GetBackgroundColour());

	m_transferStatusTimer.SetOwner(this);

	m_pParent = pParent;
	m_pStatus = 0;
	m_lastOffset = -1;
	
	m_gcLastTimeStamp = wxDateTime::Now();
	m_gcLastOffset = -1;
	m_gcLastSpeed = -1;

	SetTransferStatus(0);


	// Calculate field widths so that the contents fit under every language.
	if (!m_initialized)
	{
		m_initialized = true;
		wxClientDC dc(this);
		dc.SetFont(GetFont());

		wxCoord w, h;
		wxTimeSpan elapsed(100, 0, 0);
		dc.GetTextExtent(elapsed.Format(_("%H:%M:%S elapsed")), &w, &h);
		m_textHeight = h;
		m_fieldOffsets[0] = 50 + w;

		dc.GetTextExtent(elapsed.Format(_("%H:%M:%S left")), &w, &h);
		m_fieldOffsets[1] = m_fieldOffsets[0] + 20 + w;

		m_fieldOffsets[2] = m_fieldOffsets[1] + 20;
		m_fieldOffsets[3] = m_fieldOffsets[2] + PROGRESSBAR_WIDTH + 20;
	}

#ifdef __WXGTK__
	ResetCursor(this);
#endif
}
开发者ID:idgaf,项目名称:FileZilla3,代码行数:60,代码来源:statuslinectrl.cpp

示例2: OnInit

bool MyApp::OnInit() {
    Aux::logsStr("", wxT("Wherbarium [" + wxDateTime::Now().Format(wxT("%Y-%m-%d %H:%M:%S")) + "] - IN"), logPut);
    try {
        // setting divers
        wxInitAllImageHandlers(); // évite les problèmes de handlers d'images
        SetExitOnFrameDelete(false); // évite la fermeture de l'application sur un close quelconque !!!
        
        // variables de dimensionnement
        ecranRectGbl.SetPosition(wxPoint(0, 0));
        ecranRectGbl.SetSize(wxSize(wxSystemSettings::GetMetric(wxSYS_SCREEN_X), wxSystemSettings::GetMetric(wxSYS_SCREEN_Y)));
        
        wxDisplay *display = new wxDisplay();
        clientRectGbl = display->GetClientArea();

        gapGbl = 16;
        winRectGbl.SetPosition(wxPoint(clientRectGbl.GetX()+gapGbl, clientRectGbl.GetY()+gapGbl));
        winRectGbl.SetSize(wxSize(clientRectGbl.width-2*gapGbl, clientRectGbl.height-2*gapGbl));
        win3RectGbl = winRectGbl;
        win3RectGbl.SetWidth(winRectGbl.GetWidth()/3);
        
        wxSystemSettings sysSet;
        dimScrollXGbl = sysSet.GetMetric(wxSYS_VSCROLL_X, NULL);
        dimScrollYGbl = sysSet.GetMetric(wxSYS_HSCROLL_Y, NULL);
        
        Aux::logsPoint("MyApp::OnInit::ecranRectGbl", ecranRectGbl.GetPosition(), logNop);
        Aux::logsSize("MyApp::OnInit::ecranRectGbl", ecranRectGbl.GetSize(), logNop);
        Aux::logsPoint("MyApp::OnInit::clientRectGbl", clientRectGbl.GetPosition(), logNop);
        Aux::logsSize("MyApp::OnInit::clientRectGbl", clientRectGbl.GetSize(), logNop);
        Aux::logsPoint("MyApp::OnInit::winRectGbl", winRectGbl.GetPosition(), logNop);
        Aux::logsSize("MyApp::OnInit::winRectGbl", winRectGbl.GetSize(), logNop);
        Aux::logsPoint("MyApp::OnInit::win3RectGbl", win3RectGbl.GetPosition(), logNop);
        Aux::logsSize("MyApp::OnInit::win3RectGbl", win3RectGbl.GetSize(), logNop);
        
        wxString dbDir = "/Users/" + wxGetUserId() + "/Pictures/Wherbarium/Connect/";
        if (! wxDir::Exists(dbDir)) {
            wxDir::Make(dbDir);
        }
        wxArrayString *files = new wxArrayString();
        wxDir::GetAllFiles(dbDir, files);
        wxString dbFile = dbDir + "Wherbarium.db";
        wxFile *fileConnect;
        if (files->size() == 0) {
            fileConnect = new wxFile();
            fileConnect->Create(dbFile, false, wxS_DEFAULT);
        } else if (files->size() != 1) {
            Exit();
        }
        
        string tableName = "tblConnParams";
        sqlite = new SQLite(string(dbFile), tableName);
        sqliteStatement = sqlite->ptrTableConnParams();
        
        // début des opérations de l'application
        InitApp *initApp = new InitApp();
        initApp->nop();
        
    } catch (const exception &e) { Aux::logsStr("", e.what(), logPut); }
    return true;
}
开发者ID:Nadot,项目名称:Wherbarium,代码行数:59,代码来源:main.cpp

示例3: Create

GestionCarnet::GestionCarnet() {
    Aux::logsInOut("GestionCarnet::GestionCarnet", logIn, logNop);
    try {
        Create(NULL, wxID_ANY, _("Chargement des photos"), winRectGbl.GetPosition(), winRectGbl.GetSize(), wxDEFAULT_FRAME_STYLE, className);
        this->Show(false); // !!! hum ...
        AppMenuBar &appMenuBar = AppMenuBar::Instance();
        appMenuBar.disableAllMenus();
        
        ObjPlante *objPlante = new ObjPlante();
        tableOfPhotosOfCarnet = new TableOfPhotos(this, winRectGbl.GetSize(), objPlante, this->getClassName());
    } catch (const exception &e) { Aux::logsStr("", e.what(), logPut); }
    Aux::logsInOut("GestionCarnet::GestionCarnet", logOut, logNop);
}
开发者ID:Nadot,项目名称:Wherbarium,代码行数:13,代码来源:PhInitGestionCarnet.cpp

示例4: Copy

bool LfnTech::Copy(
	void* destBase,
	const void* srcBase,
	const wxRect& destBounds,
	const wxRect& srcBounds,
	const wxPoint& destPoint,
	const wxRect& srcRect,
	int destStride,
	int srcStride,
	int bytesPerPixel)
{
	bool result = false;

	if (!destBounds.IsEmpty() && !srcBounds.IsEmpty())
	{
		wxPoint destPointClipped(destPoint);
		wxPoint srcPointClipped(srcRect.GetPosition());
		wxSize sizeClipped(srcRect.GetSize());

		// Clip against src bounds, then against dest bounds, then once again
		// against src bounds in case the dest clip translation moved it significantly.
		Clip(srcBounds, srcPointClipped, sizeClipped, destPointClipped);
		Clip(destBounds, destPointClipped, sizeClipped, srcPointClipped);
		Clip(srcBounds, srcPointClipped, sizeClipped, destPointClipped);

		result = Copy(destBase, srcBase, destPointClipped, wxRect(srcPointClipped, sizeClipped), destStride, srcStride, bytesPerPixel);
	}

	return result;
}
开发者ID:CUGsongchao,项目名称:lafarren-image-completer,代码行数:30,代码来源:ImageUtils.cpp

示例5: wxFrame

FenetreZoom::FenetreZoom(FenetrePrincipale	*f,wxRect &r)
    : wxFrame(NULL, wxID_ANY, _T("Zoom") , r.GetLeftTop(),r.GetSize())
{
    fMere = f;
    facteurZoom=2;
    zoomInactif=false;
}
开发者ID:LaurentBerger,项目名称:wxOpenCV,代码行数:7,代码来源:FenetreZoom.cpp

示例6: location

MovieElement::MovieElement(Stage *inStage, const wxString &inName,
                           Halyard::TCallbackPtr inDispatcher,
                           const wxRect &inBounds,
                           const wxString &inLocation,
                           long inWindowStyle,
                           MovieWindowStyle inMovieWindowStyle,
                           float inVolume)
    : Widget(inStage, inName, inDispatcher),
      mLocationInfo(inLocation), mMovieWindow(NULL),
      mHaveSentMediaErrorEvent(false),
      mHaveSentMediaTimeoutEvent(false)
{
    mMovieWindow = new MovieWindowNative(inStage, -1, inBounds.GetPosition(),
                                         inBounds.GetSize(), inWindowStyle,
                                         inMovieWindowStyle);
    mMovieWindow->SetVolume("all", inVolume);
    try {
        mMovieWindow->SetMovie(inLocation);
    } catch (std::exception &e) {
        // Log this exception.  We'll report it in our Idle() method,
        // because many movie errors occur after playback has started, so
        // it's more consistent to handle this one that way.
        std::string location(inLocation.mb_str());
        gLog.Info("halyard", "Movie error: %s for %s", e.what(),
                  location.c_str());
    }
    InitializeWidgetWindow(mMovieWindow);
}
开发者ID:colonelqubit,项目名称:halyard,代码行数:28,代码来源:MovieElement.cpp

示例7: wxHtmlWindow

CustomWxHtmlWindow::CustomWxHtmlWindow(wxWindow *inParent,
                                       const wxRect &inBounds,
                                       BrowserElementWx *inElement)
    : wxHtmlWindow(inParent, -1,
                   inBounds.GetPosition(),
                   inBounds.GetSize(),
                   wxHW_SCROLLBAR_AUTO | wxBORDER),
      mElement(inElement)
{
}
开发者ID:emk,项目名称:halyard,代码行数:10,代码来源:BrowserElementWx.cpp

示例8: Create

/*********************************************************************************************
>	virtual BOOL CRenderWnd::Create(const wxRect& rect,
									wxWindow* parent, UINT32 id)
	Author:		Justin_Flude (Xara Group Ltd) <[email protected]>
	Created:	ages ago
	Inputs:		Windows instance-style flags; a
				rectangle describing the position of the scroller; a pointer to its
				parent window; a child window numeric identifier
	Outputs:	-
	Returns:	TRUE if the window is successfully created.
	Purpose:	Registers a new window class with the operating system, which accepts
				double clicks, is byte-aligned in video RAM and is responsible for
				drawing is own backgrounds.
	Errors:		-
	Scope:	    Public
	SeeAlso:    CCamView::OnCreate()

**********************************************************************************************/ 
BOOL CRenderWnd::Create(const wxRect& rect,
						wxWindow *pParent, UINT32 id)
{
	BOOL ok=wxWindow::Create(pParent, id, rect.GetTopLeft(), rect.GetSize(), wxNO_FULL_REPAINT_ON_RESIZE);
	SetExtraStyle(wxWS_EX_PROCESS_IDLE);
#if defined(__WXGTK__)
	::SetDoubleBuffer(this, m_DoubleBuffer);
#endif
	return ok;
}
开发者ID:vata,项目名称:xarino,代码行数:28,代码来源:rendwnd.cpp

示例9: DrawThumbnail

void wxPDFViewPage::DrawThumbnail(wxPDFViewPagesClient* client, wxDC& dc, const wxRect& rect)
{
	dc.SetBackground(*wxTRANSPARENT_BRUSH);
	dc.SetPen(*wxLIGHT_GREY_PEN);
	dc.DrawRectangle(rect.Inflate(1, 1));

	wxBitmap bmp = client->GetCachedBitmap(m_index, rect.GetSize());
	if (bmp.Ok())
	{
		dc.DrawBitmap(bmp, rect.GetPosition());
	}
}
开发者ID:amitdo,项目名称:wxPDFView,代码行数:12,代码来源:PDFViewPages.cpp

示例10: DrawPlainBackground

void CLMainAuiTBArt::DrawPlainBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect)
{
    wxUnusedVar(wnd);
    wxBitmap bmp(rect.GetSize());
    wxMemoryDC dcMem;
    dcMem.SelectObject(bmp);
    dcMem.SetPen(DrawingUtils::GetPanelBgColour());
    dcMem.SetBrush(DrawingUtils::GetPanelBgColour());
    dcMem.DrawRectangle(rect);
    dcMem.SelectObject(wxNullBitmap);
    dc.DrawBitmap(bmp, wxPoint(0, 0));
}
开发者ID:eranif,项目名称:codelite,代码行数:12,代码来源:cl_aui_tb_are.cpp

示例11: ClampPosition

wxPoint ClampPosition( const wxRect& viewport, const wxRect& extent )
{
    const wxSize delta( viewport.GetSize() - extent.GetSize() ); 

    wxPoint newTopLeft( viewport.GetPosition() );

    if( delta.x < 0 )
    {
        // viewport smaller than extent
        int minX = extent.GetPosition().x;
        int maxX = ( extent.GetPosition().x + extent.GetSize().x ) - viewport.GetSize().x;
        newTopLeft.x = clamp( newTopLeft.x, minX, maxX );
    }
    else
    {
        // viewport larger than extent
        newTopLeft.x = extent.GetPosition().x - ( delta.x / 2 );
    }

    if( delta.y < 0 )
    {
        // viewport smaller than extent
        int minY = extent.GetPosition().y;
        int maxY = ( extent.GetPosition().y + extent.GetSize().y ) - viewport.GetSize().y;
        newTopLeft.y = clamp( newTopLeft.y, minY, maxY );
    }
    else
    {
        // viewport larger than extent
        newTopLeft.y = extent.GetPosition().y - ( delta.y / 2 );
    }

    return newTopLeft;
}
开发者ID:rsaxvc,项目名称:qanddview,代码行数:34,代码来源:ImagePanel.cpp

示例12: AddButton

void tcButtonConsole::AddButton(wxRect bounds, long command, std::string caption)
{
    wxSize buttonSize = bounds.GetSize();
    wxPoint buttonPosition = bounds.GetPosition();

#if 0
    tcButton *buttonToAdd = new tcButton(this, buttonPosition, buttonSize);
    buttonToAdd->SetCaption(caption);
    buttonToAdd->SetCommand(command);
    buttonToAdd->SetSendRedraw(true);

    buttons.push_back(buttonToAdd);
#endif
}
开发者ID:WarfareCode,项目名称:gcblue,代码行数:14,代码来源:tcButtonConsole.cpp

示例13: ResizeGripper

void wxDialog::ResizeGripper()
{
    wxASSERT_MSG( m_hGripper, wxT("shouldn't be called if we have no gripper") );

    HWND hwndGripper = (HWND)m_hGripper;

    const wxRect rectGripper = wxRectFromRECT(wxGetWindowRect(hwndGripper));
    const wxSize size = GetClientSize() - rectGripper.GetSize();

    ::SetWindowPos(hwndGripper, HWND_BOTTOM,
                   size.x, size.y,
                   rectGripper.width, rectGripper.height,
                   SWP_NOACTIVATE);
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:14,代码来源:dialog.cpp

示例14: DrawPrint

void wxPDFViewPage::DrawPrint(wxDC& dc, const wxRect& rect, bool forceBitmap)
{
	FPDF_PAGE page = GetPage();

	int renderFlags = FPDF_ANNOT | FPDF_PRINTING;
#ifdef wxPDFVIEW_USE_RENDER_TO_DC
	if (!forceBitmap)
	{
		FPDF_RenderPage(dc.GetHDC(), page, rect.x, rect.y, rect.width, rect.height, 0, renderFlags);
	} else
#endif
	{
		wxBitmap bmp = CreateBitmap(page, m_pages->form(), rect.GetSize(), renderFlags);
		dc.DrawBitmap(bmp, wxPoint(0, 0));
	}
}
开发者ID:amitdo,项目名称:wxPDFView,代码行数:16,代码来源:PDFViewPages.cpp

示例15: Reparent

bool wxSpinCtrl::Reparent(wxWindowBase *newParent)
{
    // Reparenting both the updown control and its buddy does not seem to work:
    // they continue to be connected somehow, but visually there is no feedback
    // on the buddy edit control. To avoid this problem, we reparent the buddy
    // window normally, but we recreate the updown control and reassign its
    // buddy.

    // Get the position before changing the parent as it would be offset after
    // changing it.
    const wxRect rect = GetRect();

    if ( !wxWindowBase::Reparent(newParent) )
        return false;

    newParent->GetChildren().DeleteObject(this);

    // destroy the old spin button after detaching it from this wxWindow object
    // (notice that m_hWnd will be reset by UnsubclassWin() so save it first)
    const HWND hwndOld = GetHwnd();
    UnsubclassWin();
    if ( !::DestroyWindow(hwndOld) )
    {
        wxLogLastError(wxT("DestroyWindow"));
    }

    // create and initialize the new one
    if ( !wxSpinButton::Create(GetParent(), GetId(),
                               rect.GetPosition(), rect.GetSize(),
                               GetWindowStyle(), GetName()) )
        return false;

    // reapply our values to wxSpinButton
    wxSpinButton::SetValue(GetValue());
    SetRange(m_min, m_max);

    // also set the size again with wxSIZE_ALLOW_MINUS_ONE flag: this is
    // necessary if our original position used -1 for either x or y
    SetSize(rect, wxSIZE_ALLOW_MINUS_ONE);

    // associate it with the buddy control again
    ::SetParent(GetBuddyHwnd(), GetHwndOf(GetParent()));
    (void)::SendMessage(GetHwnd(), UDM_SETBUDDY, (WPARAM)GetBuddyHwnd(), 0);

    return true;
}
开发者ID:krossell,项目名称:wxWidgets,代码行数:46,代码来源:spinctrl.cpp


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