implement wxColourDialog::Move() (patch 548048)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15273 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -40,6 +40,8 @@ public:
|
|||||||
|
|
||||||
virtual int ShowModal();
|
virtual int ShowModal();
|
||||||
|
|
||||||
|
virtual void DoGetPosition( int *x, int *y ) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void DoGetSize(int *width, int *height) const;
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
virtual void DoGetClientSize(int *width, int *height) const;
|
virtual void DoGetClientSize(int *width, int *height) const;
|
||||||
@@ -50,6 +52,8 @@ protected:
|
|||||||
wxColourData m_colourData;
|
wxColourData m_colourData;
|
||||||
wxString m_title;
|
wxString m_title;
|
||||||
|
|
||||||
|
wxPoint m_pos;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxColourDialog)
|
DECLARE_DYNAMIC_CLASS(wxColourDialog)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -81,6 +81,14 @@ UINT CALLBACK wxColourDialogHookProc(HWND hwnd,
|
|||||||
wxColourDialog *dialog = (wxColourDialog *)pCC->lCustData;
|
wxColourDialog *dialog = (wxColourDialog *)pCC->lCustData;
|
||||||
|
|
||||||
::SetWindowText(hwnd, dialog->GetTitle());
|
::SetWindowText(hwnd, dialog->GetTitle());
|
||||||
|
|
||||||
|
wxPoint pos = dialog->GetPosition();
|
||||||
|
if ( pos != wxDefaultPosition )
|
||||||
|
{
|
||||||
|
::SetWindowPos(hwnd, NULL /* Z-order: ignored */,
|
||||||
|
pos.x, pos.y, -1, -1,
|
||||||
|
SWP_NOSIZE | SWP_NOZORDER);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -92,10 +100,13 @@ UINT CALLBACK wxColourDialogHookProc(HWND hwnd,
|
|||||||
|
|
||||||
wxColourDialog::wxColourDialog()
|
wxColourDialog::wxColourDialog()
|
||||||
{
|
{
|
||||||
|
m_pos = wxDefaultPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
|
wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
|
||||||
{
|
{
|
||||||
|
m_pos = wxDefaultPosition;
|
||||||
|
|
||||||
Create(parent, data);
|
Create(parent, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,11 +184,25 @@ wxString wxColourDialog::GetTitle()
|
|||||||
// position/size
|
// position/size
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxColourDialog::DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
|
void wxColourDialog::DoGetPosition(int *x, int *y) const
|
||||||
|
{
|
||||||
|
if ( x )
|
||||||
|
*x = m_pos.x;
|
||||||
|
if ( y )
|
||||||
|
*y = m_pos.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxColourDialog::DoSetSize(int x, int y,
|
||||||
int WXUNUSED(width), int WXUNUSED(height),
|
int WXUNUSED(width), int WXUNUSED(height),
|
||||||
int WXUNUSED(sizeFlags))
|
int WXUNUSED(sizeFlags))
|
||||||
{
|
{
|
||||||
// ignore - we can't change the size of this standard dialog
|
if ( x != -1 )
|
||||||
|
m_pos.x = x;
|
||||||
|
|
||||||
|
if ( y != -1 )
|
||||||
|
m_pos.y = y;
|
||||||
|
|
||||||
|
// ignore the size params - we can't change the size of a standard dialog
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,3 +225,4 @@ void wxColourDialog::DoGetClientSize(int *width, int *height) const
|
|||||||
if ( height )
|
if ( height )
|
||||||
*height = 299;
|
*height = 299;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user