Factor out wxProgressDialog::GetTaskDialogRect()
No real changes, just prepare for implementing DoGetSize() in this class by extracting the common part between the existing DoGetPosition() and it in a new function.
This commit is contained in:
@@ -68,6 +68,10 @@ private:
|
|||||||
// been entered.
|
// been entered.
|
||||||
void UpdateExpandedInformation(int value);
|
void UpdateExpandedInformation(int value);
|
||||||
|
|
||||||
|
// Get the task dialog geometry when using the native dialog.
|
||||||
|
wxRect GetTaskDialogRect() const;
|
||||||
|
|
||||||
|
|
||||||
wxProgressDialogTaskRunner *m_taskDialogRunner;
|
wxProgressDialogTaskRunner *m_taskDialogRunner;
|
||||||
|
|
||||||
wxProgressDialogSharedData *m_sharedData;
|
wxProgressDialogSharedData *m_sharedData;
|
||||||
|
@@ -803,17 +803,29 @@ void wxProgressDialog::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
wxGenericProgressDialog::DoMoveWindow(x, y, width, height);
|
wxGenericProgressDialog::DoMoveWindow(x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxRect wxProgressDialog::GetTaskDialogRect() const
|
||||||
|
{
|
||||||
|
wxRect r;
|
||||||
|
|
||||||
|
#ifdef wxHAS_MSW_TASKDIALOG
|
||||||
|
if ( m_sharedData )
|
||||||
|
{
|
||||||
|
wxCriticalSectionLocker locker(m_sharedData->m_cs);
|
||||||
|
r = wxRectFromRECT(wxGetWindowRect(m_sharedData->m_hwnd));
|
||||||
|
}
|
||||||
|
#else // !wxHAS_MSW_TASKDIALOG
|
||||||
|
wxFAIL_MSG( "unreachable" );
|
||||||
|
#endif // wxHAS_MSW_TASKDIALOG/!wxHAS_MSW_TASKDIALOG
|
||||||
|
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
void wxProgressDialog::DoGetPosition(int *x, int *y) const
|
void wxProgressDialog::DoGetPosition(int *x, int *y) const
|
||||||
{
|
{
|
||||||
#ifdef wxHAS_MSW_TASKDIALOG
|
#ifdef wxHAS_MSW_TASKDIALOG
|
||||||
if ( HasNativeTaskDialog() )
|
if ( HasNativeTaskDialog() )
|
||||||
{
|
{
|
||||||
wxRect r;
|
const wxRect r = GetTaskDialogRect();
|
||||||
if ( m_sharedData )
|
|
||||||
{
|
|
||||||
wxCriticalSectionLocker locker(m_sharedData->m_cs);
|
|
||||||
r = wxRectFromRECT(wxGetWindowRect(m_sharedData->m_hwnd));
|
|
||||||
}
|
|
||||||
if (x)
|
if (x)
|
||||||
*x = r.x;
|
*x = r.x;
|
||||||
if (y)
|
if (y)
|
||||||
|
Reference in New Issue
Block a user