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.
|
||||
void UpdateExpandedInformation(int value);
|
||||
|
||||
// Get the task dialog geometry when using the native dialog.
|
||||
wxRect GetTaskDialogRect() const;
|
||||
|
||||
|
||||
wxProgressDialogTaskRunner *m_taskDialogRunner;
|
||||
|
||||
wxProgressDialogSharedData *m_sharedData;
|
||||
|
@@ -803,17 +803,29 @@ void wxProgressDialog::DoMoveWindow(int x, int y, int width, int 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
|
||||
{
|
||||
#ifdef wxHAS_MSW_TASKDIALOG
|
||||
if ( HasNativeTaskDialog() )
|
||||
{
|
||||
wxRect r;
|
||||
if ( m_sharedData )
|
||||
{
|
||||
wxCriticalSectionLocker locker(m_sharedData->m_cs);
|
||||
r = wxRectFromRECT(wxGetWindowRect(m_sharedData->m_hwnd));
|
||||
}
|
||||
const wxRect r = GetTaskDialogRect();
|
||||
if (x)
|
||||
*x = r.x;
|
||||
if (y)
|
||||
|
Reference in New Issue
Block a user