Hallo Community,
is there any way to change the Position of a wxProgressDialog on Screen?
I try it with the funktion "wxProgressDialog->SetPosition()", but the Dialog is always showed at the same Position.
wxProgressDialog SetPosition Topic is solved
Re: wxProgressDialog SetPosition
You did not mention the platform or wxWidgets version.
I cannot confirm the issue on Windows using the current(ish) master, with both generic and native implementations: SetPosition() works as expected.
However, the native version displays centered upon showing for a very short time, before it gets moved to the requested position.
I cannot confirm the issue on Windows using the current(ish) master, with both generic and native implementations: SetPosition() works as expected.
However, the native version displays centered upon showing for a very short time, before it gets moved to the requested position.
Code: Select all
#include <wx/wx.h>
#include <wx/progdlg.h>
class MyApp : public wxApp
{
public:
bool OnInit() override
{
const size_t iterationCount = 25;
wxGenericProgressDialog* dlg;
if ( wxMessageBox("Use native wxProgressDialog?", "Native or Generic", wxYES_NO | wxYES_DEFAULT, nullptr) == wxYES )
dlg = new wxProgressDialog("Iterating", " ", iterationCount, nullptr, wxPD_CAN_ABORT | wxPD_AUTO_HIDE);
else
dlg = new wxGenericProgressDialog("Iterating", " ", iterationCount, nullptr, wxPD_CAN_ABORT | wxPD_AUTO_HIDE);
dlg->SetPosition(wxPoint(10, 10));
for ( size_t i = 1; i <= iterationCount; ++i )
{
wxMilliSleep(500);
if ( !dlg->Update(i, wxString::Format("Iteration %zu", i)) )
break;
}
dlg->Destroy();
return false;
}
}; wxIMPLEMENT_APP(MyApp);
Re: wxProgressDialog SetPosition
Hello PB,
I have tried your postet code in smal projekt. It doesn't work on my System, the ProgressDialog is allwas showed in the middle of my Main-Window. Maybe it's the version 3.0.4
Sorry, forgot to write:
Plattform-Information:
wxWidgets : 3.0.4.
System: Windows 10 - 64 bit
I have tried your postet code in smal projekt. It doesn't work on my System, the ProgressDialog is allwas showed in the middle of my Main-Window. Maybe it's the version 3.0.4
Sorry, forgot to write:
Plattform-Information:
wxWidgets : 3.0.4.
System: Windows 10 - 64 bit
Re: wxProgressDialog SetPosition
It might be possible that the native wxProgressDialog ignores the position (under Windows). With wxGenericProgressDialog it's expected to work. Haven't tested it though.
You can just change wxProgressDialog to wxGenericProgressDialog in your code to test it.
You can just change wxProgressDialog to wxGenericProgressDialog in your code to test it.
Use the source, Luke!
Re: wxProgressDialog SetPosition
Hello doublemax,
Hello PB,
okay, the wxGenericProgressDialog works fine, the positon of the ProgressDialog is changeed.
I think I'll rebuild my classes on these here
Thanks
Hello PB,
okay, the wxGenericProgressDialog works fine, the positon of the ProgressDialog is changeed.
I think I'll rebuild my classes on these here
Thanks
Re: wxProgressDialog SetPosition
Yes, it is. SetPosition() for Windows native dialog was implemented in v3.1.1: https://github.com/wxWidgets/wxWidgets/ ... 4ba9372b0f