本文整理汇总了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
}
示例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;
}
示例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);
}
示例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;
}
示例5: wxFrame
FenetreZoom::FenetreZoom(FenetrePrincipale *f,wxRect &r)
: wxFrame(NULL, wxID_ANY, _T("Zoom") , r.GetLeftTop(),r.GetSize())
{
fMere = f;
facteurZoom=2;
zoomInactif=false;
}
示例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);
}
示例7: wxHtmlWindow
CustomWxHtmlWindow::CustomWxHtmlWindow(wxWindow *inParent,
const wxRect &inBounds,
BrowserElementWx *inElement)
: wxHtmlWindow(inParent, -1,
inBounds.GetPosition(),
inBounds.GetSize(),
wxHW_SCROLLBAR_AUTO | wxBORDER),
mElement(inElement)
{
}
示例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;
}
示例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());
}
}
示例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));
}
示例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;
}
示例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
}
示例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);
}
示例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));
}
}
示例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;
}