1879e8e646
This parameter is not modified by wxColourDialog (this might have been the case, or at least the plan, some long time ago) and so has no reason not to be "const". Just add the qualifier to ctor and Create() in all ports. Closes https://github.com/wxWidgets/wxWidgets/pull/1421 Closes #12511.
78 lines
2.3 KiB
C++
78 lines
2.3 KiB
C++
/////////////////////////////////////////////////////////////////////////////
|
|
// Name: wx/msw/colordlg.h
|
|
// Purpose: wxColourDialog class
|
|
// Author: Julian Smart
|
|
// Modified by:
|
|
// Created: 01/02/97
|
|
// Copyright: (c) Julian Smart
|
|
// Licence: wxWindows licence
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef _WX_COLORDLG_H_
|
|
#define _WX_COLORDLG_H_
|
|
|
|
#include "wx/dialog.h"
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// wxColourDialog: dialog for choosing a colours
|
|
// ----------------------------------------------------------------------------
|
|
|
|
class WXDLLIMPEXP_CORE wxColourDialog : public wxDialog
|
|
{
|
|
public:
|
|
wxColourDialog() { Init(); }
|
|
wxColourDialog(wxWindow *parent, const wxColourData *data = NULL)
|
|
{
|
|
Init();
|
|
|
|
Create(parent, data);
|
|
}
|
|
|
|
bool Create(wxWindow *parent, const wxColourData *data = NULL);
|
|
|
|
wxColourData& GetColourData() { return m_colourData; }
|
|
|
|
// override some base class virtuals
|
|
virtual void SetTitle(const wxString& title) wxOVERRIDE;
|
|
virtual wxString GetTitle() const wxOVERRIDE;
|
|
|
|
virtual int ShowModal() wxOVERRIDE;
|
|
|
|
// wxMSW-specific implementation from now on
|
|
// -----------------------------------------
|
|
|
|
// called from the hook procedure on WM_INITDIALOG reception
|
|
virtual void MSWOnInitDone(WXHWND hDlg);
|
|
|
|
// called from the hook procedure
|
|
void MSWCheckIfCurrentChanged(WXCOLORREF currentCol);
|
|
|
|
protected:
|
|
// common part of all ctors
|
|
void Init();
|
|
|
|
virtual void DoGetPosition( int *x, int *y ) const wxOVERRIDE;
|
|
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
|
|
virtual void DoGetClientSize(int *width, int *height) const wxOVERRIDE;
|
|
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE;
|
|
virtual void DoCentre(int dir) wxOVERRIDE;
|
|
|
|
wxColourData m_colourData;
|
|
wxString m_title;
|
|
|
|
// Currently selected colour, used while the dialog is being shown.
|
|
WXCOLORREF m_currentCol;
|
|
|
|
// indicates that the dialog should be centered in this direction if non 0
|
|
// (set by DoCentre(), used by MSWOnInitDone())
|
|
int m_centreDir;
|
|
|
|
// true if DoMoveWindow() had been called
|
|
bool m_movedWindow;
|
|
|
|
|
|
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxColourDialog);
|
|
};
|
|
|
|
#endif // _WX_COLORDLG_H_
|