本文整理汇总了C++中wxRect::GetPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ wxRect::GetPosition方法的具体用法?C++ wxRect::GetPosition怎么用?C++ wxRect::GetPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxRect
的用法示例。
在下文中一共展示了wxRect::GetPosition方法的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: GetLocation
// Returns the rectangle for this object (id = 0) or a child element (id > 0).
wxAccStatus SplitterWindowAccessible::GetLocation(wxRect& rect, int elementId)
{
wxSplitterWindow* splitter = wxDynamicCast(GetWindow(), wxSplitterWindow);
if (splitter && elementId == 2 && splitter->IsSplit())
{
wxSize clientSize = splitter->GetClientSize();
if (splitter->GetSplitMode() == wxSPLIT_VERTICAL)
{
rect.x = splitter->GetSashPosition();
rect.y = 0;
rect.SetPosition(splitter->ClientToScreen(rect.GetPosition()));
rect.width = splitter->GetSashSize();
rect.height = clientSize.y;
}
else
{
rect.x = 0;
rect.y = splitter->GetSashPosition();
rect.SetPosition(splitter->ClientToScreen(rect.GetPosition()));
rect.width = clientSize.x;
rect.height = splitter->GetSashSize();
}
return wxACC_OK;
}
// Let the framework handle the other cases.
return wxACC_NOT_IMPLEMENTED;
}
示例3:
// Returns the rectangle for this object (id = 0) or a child element (id > 0).
// rect is in screen coordinates.
wxAccStatus
KeyViewAx::GetLocation(wxRect & rect, int elementId)
{
int line;
if (IdToLine(elementId, line))
{
wxRect rectLine;
rectLine.width = mView->GetClientSize().GetWidth();
// iterate over all visible lines
for (int i = 0; i < line; i++)
{
wxCoord hLine = mView->GetLineHeight(i);
rectLine.height = hLine;
rect = rectLine;
wxPoint margins = mView->GetMargins();
rect.Deflate(margins.x, margins.y);
rectLine.y += hLine;
}
rect.SetPosition(mView->ClientToScreen(rect.GetPosition()));
}
else
{
rect = mView->GetRect();
rect.SetPosition(mView->GetParent()->ClientToScreen(rect.GetPosition()));
}
return wxACC_OK;
}
示例4: 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;
}
示例5: 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;
}
示例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: GetLocation
// Returns the rectangle for this object (id = 0) or a child element (id > 0).
// rect is in screen coordinates.
wxAccStatus GridAx::GetLocation(wxRect & rect, int elementId)
{
wxRect r;
int row;
int col;
if (GetRowCol(elementId, row, col)) {
rect = mGrid->CellToRect(row, col);
rect.SetPosition(mGrid->GetGridWindow()->ClientToScreen(rect.GetPosition()));
}
else {
rect = mGrid->GetRect();
rect.SetPosition(mGrid->GetParent()->ClientToScreen(rect.GetPosition()));
}
return wxACC_OK;
}
示例8: 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;
}
示例9: GetLocation
// Returns the rectangle for this object (id = 0) or a child element (id > 0).
// rect is in screen coordinates.
wxAccStatus AButtonAx::GetLocation( wxRect& rect, int WXUNUSED(elementId) )
{
AButton *ab = wxDynamicCast( GetWindow(), AButton );
rect = ab->GetRect();
rect.SetPosition( ab->GetParent()->ClientToScreen( rect.GetPosition() ) );
return wxACC_OK;
}
示例10: GetLocation
// Returns the rectangle for this object (id = 0) or a child element (id > 0).
// rect is in screen coordinates.
wxAccStatus HtmlWindowAx::GetLocation( wxRect& rect, int WXUNUSED(elementId) )
{
HtmlWindow *hw = wxDynamicCast( GetWindow(), HtmlWindow );
rect = hw->GetRect();
rect.SetPosition( hw->GetParent()->ClientToScreen( rect.GetPosition() ) );
return wxACC_OK;
}
示例11: GetLocation
// Returns the rectangle for this object (id = 0) or a child element (id > 0).
// rect is in screen coordinates.
wxAccStatus ASliderAx::GetLocation( wxRect& rect, int WXUNUSED(elementId) )
{
ASlider *as = wxDynamicCast( GetWindow(), ASlider );
rect = as->GetRect();
rect.SetPosition( as->GetParent()->ClientToScreen( rect.GetPosition() ) );
return wxACC_OK;
}
示例12: wxHtmlWindow
CustomWxHtmlWindow::CustomWxHtmlWindow(wxWindow *inParent,
const wxRect &inBounds,
BrowserElementWx *inElement)
: wxHtmlWindow(inParent, -1,
inBounds.GetPosition(),
inBounds.GetSize(),
wxHW_SCROLLBAR_AUTO | wxBORDER),
mElement(inElement)
{
}
示例13: 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());
}
}
示例14: dir
FichiersToUpload::FichiersToUpload() {
Model *model = new Model();
if (model->isUserDemo()) {
wxMessageBox(_("L'utilisateur \"demo\" ne peut pas ajouter de photos"));
return;
} else {
AppMenuBar &appMenuBar = AppMenuBar::Instance();
appMenuBar.disableAllMenus();
wxString toUploadPath = model->getCurBaseDir() + wxT("PhotosToUpload/");
wxDir dir(toUploadPath);
if ( !dir.IsOpened() ) {
wxMessageBox(_("Répertoire \"") + toUploadPath + _("\" ne peut être ouvert"), _("Erreur fatale"));
return;
}
AfficheFileTransfer *afficheFileTransfer = new AfficheFileTransfer(this, win3RectGbl.GetPosition(), win3RectGbl.GetSize(), _T("Téléchargement d'une liste de fichiers photos"), className, true);
wxArrayString fileNames;
wxDir::GetAllFiles(toUploadPath, &fileNames, wxT("*.jpg"), wxDIR_DEFAULT);
wxDir::GetAllFiles(toUploadPath, &fileNames, wxT("*.JPG"), wxDIR_DEFAULT);
wxDir::GetAllFiles(toUploadPath, &fileNames, wxT("*.jpeg"), wxDIR_DEFAULT);
wxDir::GetAllFiles(toUploadPath, &fileNames, wxT("*.JPEG"), wxDIR_DEFAULT);
if (fileNames.size() == 0) {
afficheFileTransfer->addItem(_("Aucun fichier au format JPEG dans le répertoire :"));
afficheFileTransfer->addLine(wxT("\"") + model->getCurBaseDir());
afficheFileTransfer->addLine(wxT("PhotosToUpload/\""));
wxMessageBox(_("Seuls les fichiers au format JPEG (extensions .JPEG | .JPG | .jpeg | .jpg) sont acceptés"), _("Rappel"));
return;
} else {
afficheFileTransfer->addItem(_("Nombre de fichiers à télecharger : ")+to_string(fileNames.size()));
afficheFileTransfer->wait();
afficheFileTransfer->temps(_("Début : "));
for (int ijk=0; ijk<fileNames.size(); ijk++) {
wxString flnIn = wxFileNameFromPath(fileNames[ijk]);
afficheFileTransfer->addLine(_("Fichier[") + to_string(ijk) + wxT("] : \"") + flnIn + wxT("\""));
// Aux::logsNumber("ijk", ijk, logPut);
int sts = model->addFichierToTblFichiers(toUploadPath, flnIn);
if (sts == 0) {
afficheFileTransfer->addLine(_("Le fichier existe déjà"));
}
model->moveFichierAfterLoaded(toUploadPath+flnIn, toUploadPath + "../PhotosUploaded/" + flnIn);
}
afficheFileTransfer->temps(_("Fin : "));
afficheFileTransfer->addDummy();
afficheFileTransfer->addLine(_("Les fichiers téléchargés sont maintenant dans le répertoire : "));
afficheFileTransfer->addLine(wxT("\"") + model->getCurBaseDir());
afficheFileTransfer->addLine(wxT("PhotosUploaded/\""));
}
}
}
示例15: 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);
}