Merge wxQT branch into the trunk.

This merges in the latest sources from GSoC 2014 wxQt project with just a few
minor corrections, mostly undoing wrong changes to common files in that branch
(results of a previous bad merge?) and getting rid of whitespace-only changes.
Also remove debug logging from wxGrid.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-08-24 01:50:11 +00:00
parent d513d3e2f0
commit df13791078
381 changed files with 24333 additions and 938 deletions

62
include/wx/qt/accel.h Normal file
View File

@@ -0,0 +1,62 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/accel.h
// Purpose: wxAcceleratorTable class
// Author: Peter Most, Javier Torres
// Modified by:
// Created: 09/08/09
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_ACCEL_H_
#define _WX_QT_ACCEL_H_
#include <QtCore/QList>
#include <QtWidgets/QShortcut>
/* wxQt accelerators implementation:
*
* Storing:
* QShortcuts are stored in wxWindow (m_qtShortcuts) to allow to delete them
* when the accelerator table is changed, and also because we need to specify
* a not-null parent from them, which is unknown at the moment of creating the
* accelerator table. So, the accelerator table only contains a list of
* wxAcceleratorEntries, which are converted to a list of QShortcuts when
* the table is fixed to a wxWindow.
*
* Passing keypresses to accelerators:
* The accelerators are implemented using QShortcut's. As there is no easy way
* to call them, we must pass all keypress events through the QApplication
* notify() function (which is the one that checks if the keypress match any
* shortcut.
*
* Executing commands when a QShortcut is triggered:
* Each QShortcut has a property ("wxQt_Command") set with the number of the
* wx command it is associated to. Then, its activated() signal is connected to
* a small handler (wxQtShortcutHandler in window_qt.h) which calls the main
* handler (wxWindow::QtHandleShortcut) passing the command extracted from the
* QShortcut. This handler will finally create and send the appropriate wx
* event to the window. */
class WXDLLIMPEXP_CORE wxAcceleratorTable : public wxObject
{
public:
wxAcceleratorTable();
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
// Implementation
QList< QShortcut* > ConvertShortcutTable( QWidget *parent ) const;
bool Ok() const { return IsOk(); }
bool IsOk() const;
protected:
// ref counting code
virtual wxObjectRefData *CreateRefData() const;
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
private:
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
};
#endif // _WX_QT_ACCEL_H_

47
include/wx/qt/anybutton.h Normal file
View File

@@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/anybutton.h
// Purpose: wxQT wxAnyButton class declaration
// Author: Mariano Reingart
// Copyright: (c) 2014 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_ANYBUTTON_H_
#define _WX_QT_ANYBUTTON_H_
#include <QtWidgets/QPushButton>
//-----------------------------------------------------------------------------
// wxAnyButton
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxAnyButton : public wxAnyButtonBase
{
public:
wxAnyButton()
{
}
// implementation
// --------------
virtual void SetLabel( const wxString &label );
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
virtual QPushButton *GetHandle() const;
protected:
QPushButton *m_qtPushButton;
void QtCreate(wxWindow *parent);
void QtSetBitmap( const wxBitmap &bitmap );
private:
typedef wxAnyButtonBase base_type;
wxDECLARE_NO_COPY_CLASS(wxAnyButton);
};
#endif // _WX_QT_ANYBUTTON_H_

32
include/wx/qt/app.h Normal file
View File

@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////
// Name: app.h
// Purpose: wxApp class
// Author: Peter Most
// Modified by:
// Created: 08/08/09
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_APP_H_
#define _WX_QT_APP_H_
#include <QtWidgets/QApplication>
class WXDLLIMPEXP_CORE wxApp : public wxAppBase
{
public:
wxApp();
~wxApp();
virtual bool Initialize(int& argc, wxChar **argv);
private:
QApplication *m_qtApplication;
int m_qtArgc;
char **m_qtArgv;
wxDECLARE_DYNAMIC_CLASS_NO_COPY( wxApp );
};
#endif // _WX_QT_APP_H_

122
include/wx/qt/bitmap.h Normal file
View File

@@ -0,0 +1,122 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/bitmap.h
// Author: Peter Most
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_BITMAP_H_
#define _WX_QT_BITMAP_H_
class WXDLLIMPEXP_FWD_CORE wxPixelDataBase;
class WXDLLIMPEXP_FWD_CORE wxImage;
class QImage;
class QPixmap;
class QBitmap;
class WXDLLIMPEXP_CORE wxBitmap : public wxBitmapBase
{
public:
wxBitmap();
wxBitmap(QPixmap pix);
wxBitmap(const wxBitmap& bmp);
wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBitmap(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
wxBitmap(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH);
wxBitmap(const char* const* bits);
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM);
wxBitmap(const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH);
static void InitStandardHandlers();
virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH);
virtual bool Create(int width, int height, const wxDC& WXUNUSED(dc));
virtual int GetHeight() const;
virtual int GetWidth() const;
virtual int GetDepth() const;
#if wxUSE_IMAGE
virtual wxImage ConvertToImage() const;
#endif // wxUSE_IMAGE
virtual wxMask *GetMask() const;
virtual void SetMask(wxMask *mask);
virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
virtual bool SaveFile(const wxString &name, wxBitmapType type,
const wxPalette *palette = NULL) const;
virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
#if wxUSE_PALETTE
virtual wxPalette *GetPalette() const;
virtual void SetPalette(const wxPalette& palette);
#endif // wxUSE_PALETTE
// copies the contents and mask of the given (colour) icon to the bitmap
virtual bool CopyFromIcon(const wxIcon& icon);
// implementation:
virtual void SetHeight(int height);
virtual void SetWidth(int width);
virtual void SetDepth(int depth);
void *GetRawData(wxPixelDataBase& data, int bpp);
void UngetRawData(wxPixelDataBase& data);
// these functions are internal and shouldn't be used, they risk to
// disappear in the future
bool HasAlpha() const;
QPixmap *GetHandle() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
DECLARE_DYNAMIC_CLASS(wxBitmap)
};
class WXDLLIMPEXP_CORE wxMask : public wxObject
{
public:
wxMask();
// Copy constructor
wxMask(const wxMask &mask);
// Construct a mask from a bitmap and a colour indicating the transparent
// area
wxMask(const wxBitmap& bitmap, const wxColour& colour);
// Construct a mask from a bitmap and a palette index indicating the
// transparent area
wxMask(const wxBitmap& bitmap, int paletteIndex);
// Construct a mask from a mono bitmap (copies the bitmap).
wxMask(const wxBitmap& bitmap);
virtual ~wxMask();
bool Create(const wxBitmap& bitmap, const wxColour& colour);
bool Create(const wxBitmap& bitmap, int paletteIndex);
bool Create(const wxBitmap& bitmap);
wxBitmap GetBitmap() const;
// Implementation
QBitmap *GetHandle() const;
protected:
DECLARE_DYNAMIC_CLASS(wxMask)
private:
QBitmap *m_qtBitmap;
};
#endif // _WX_QT_BITMAP_H_

40
include/wx/qt/bmpbuttn.h Normal file
View File

@@ -0,0 +1,40 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/bmpbuttn.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_BMPBUTTN_H_
#define _WX_QT_BMPBUTTN_H_
class WXDLLIMPEXP_CORE wxBitmapButton : public wxBitmapButtonBase
{
public:
wxBitmapButton();
wxBitmapButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& bitmap,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmap& bitmap,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
protected:
wxDECLARE_DYNAMIC_CLASS(wxBitmapButton);
private:
// We re-use wxButton
};
#endif // _WX_QT_BMPBUTTN_H_

48
include/wx/qt/brush.h Normal file
View File

@@ -0,0 +1,48 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/brush.h
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_BRUSH_H_
#define _WX_QT_BRUSH_H_
#include <QtCore/Qt>
class QBrush;
class WXDLLIMPEXP_CORE wxBrush : public wxBrushBase
{
public:
wxBrush();
wxBrush(const wxColour& col, wxBrushStyle style = wxBRUSHSTYLE_SOLID);
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants")
wxBrush(const wxColour& col, int style);
wxBrush(const wxBitmap& stipple);
virtual void SetColour(const wxColour& col);
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b);
virtual void SetStyle(wxBrushStyle style);
virtual void SetStipple(const wxBitmap& stipple);
bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
virtual wxColour GetColour() const;
virtual wxBrushStyle GetStyle() const;
virtual wxBitmap *GetStipple() const;
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants")
void SetStyle(int style) { SetStyle((wxBrushStyle)style); }
QBrush GetHandle() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
};
#endif // _WX_QT_BRUSH_H_

39
include/wx/qt/button.h Normal file
View File

@@ -0,0 +1,39 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/button.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_BUTTON_H_
#define _WX_QT_BUTTON_H_
#include "wx/control.h"
#include "wx/button.h"
class WXDLLIMPEXP_CORE wxButton : public wxButtonBase
{
public:
wxButton();
wxButton(wxWindow *parent, wxWindowID id,
const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
virtual wxWindow *SetDefault();
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxButton);
};
#endif // _WX_QT_BUTTON_H_

94
include/wx/qt/calctrl.h Normal file
View File

@@ -0,0 +1,94 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/calctrl.h
// Purpose: wxCalendarCtrl control implementation for wxQt
// Author: Kolya Kosenko
// Created: 2010-05-12
// Copyright: (C) 2010 Kolya Kosenko
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CALCTRL_H_
#define _WX_QT_CALCTRL_H_
#include "wx/calctrl.h"
#include <QtWidgets/QCalendarWidget>
class WXDLLIMPEXP_ADV wxCalendarCtrl : public wxCalendarCtrlBase
{
public:
wxCalendarCtrl() { Init(); }
wxCalendarCtrl(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAL_SHOW_HOLIDAYS,
const wxString& name = wxCalendarNameStr)
{
Init();
Create(parent, id, date, pos, size, style, name);
}
virtual ~wxCalendarCtrl();
bool Create(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAL_SHOW_HOLIDAYS,
const wxString& name = wxCalendarNameStr);
virtual bool SetDate(const wxDateTime& date);
virtual wxDateTime GetDate() const;
virtual bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
const wxDateTime& upperdate = wxDefaultDateTime);
virtual bool GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const;
virtual bool EnableMonthChange(bool enable = true);
virtual void Mark(size_t day, bool mark);
// holidays colours
virtual void SetHoliday(size_t day);
virtual void SetHolidayColours(const wxColour& colFg, const wxColour& colBg);
virtual const wxColour& GetHolidayColourFg() const { return m_colHolidayFg; }
virtual const wxColour& GetHolidayColourBg() const { return m_colHolidayBg; }
// header colours
virtual void SetHeaderColours(const wxColour& colFg, const wxColour& colBg);
virtual const wxColour& GetHeaderColourFg() const { return m_colHeaderFg; }
virtual const wxColour& GetHeaderColourBg() const { return m_colHeaderBg; }
// day attributes
virtual wxCalendarDateAttr *GetAttr(size_t day) const;
virtual void SetAttr(size_t day, wxCalendarDateAttr *attr);
virtual void ResetAttr(size_t day) { SetAttr(day, NULL); }
virtual void SetWindowStyleFlag(long style);
using wxCalendarCtrlBase::GenerateAllChangeEvents;
virtual QCalendarWidget *GetHandle() const;
protected:
virtual void RefreshHolidays();
private:
void Init();
void UpdateStyle();
QCalendarWidget *m_qtCalendar;
wxColour m_colHeaderFg,
m_colHeaderBg,
m_colHolidayFg,
m_colHolidayBg;
wxCalendarDateAttr *m_attrs[31];
DECLARE_DYNAMIC_CLASS(wxCalendarCtrl)
};
#endif // _WX_QT_CALCTRL_H_

47
include/wx/qt/checkbox.h Normal file
View File

@@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/checkbox.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CHECKBOX_H_
#define _WX_QT_CHECKBOX_H_
#include <QtWidgets/QCheckBox>
class WXDLLIMPEXP_CORE wxCheckBox : public wxCheckBoxBase
{
public:
wxCheckBox();
wxCheckBox( wxWindow *parent, wxWindowID id, const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr );
virtual void SetValue(bool value);
virtual bool GetValue() const;
virtual QCheckBox *GetHandle() const;
protected:
virtual void DoSet3StateValue(wxCheckBoxState state);
virtual wxCheckBoxState DoGet3StateValue() const;
private:
QCheckBox *m_qtCheckBox;
wxDECLARE_DYNAMIC_CLASS(wxCheckBox);
};
#endif // _WX_QT_CHECKBOX_H_

58
include/wx/qt/checklst.h Normal file
View File

@@ -0,0 +1,58 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/checklst.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CHECKLST_H_
#define _WX_QT_CHECKLST_H_
class WXDLLIMPEXP_CORE wxCheckListBox : public wxCheckListBoxBase
{
public:
wxCheckListBox();
wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int nStrings = 0,
const wxString *choices = (const wxString *)NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
virtual ~wxCheckListBox();
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
virtual bool IsChecked(unsigned int item) const;
virtual void Check(unsigned int item, bool check = true);
private:
virtual void Init(); //common construction
wxDECLARE_DYNAMIC_CLASS(wxCheckListBox);
};
#endif // _WX_QT_CHECKLST_H_

81
include/wx/qt/choice.h Normal file
View File

@@ -0,0 +1,81 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/choice.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CHOICE_H_
#define _WX_QT_CHOICE_H_
#include <QtWidgets/QComboBox>
class WXDLLIMPEXP_CORE wxChoice : public wxChoiceBase
{
public:
wxChoice();
wxChoice( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = (const wxString *) NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr );
wxChoice( wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr );
bool Create( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr );
bool Create( wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr );
virtual wxSize DoGetBestSize() const;
virtual unsigned int GetCount() const;
virtual wxString GetString(unsigned int n) const;
virtual void SetString(unsigned int n, const wxString& s);
virtual void SetSelection(int n);
virtual int GetSelection() const;
virtual QComboBox *GetHandle() const;
protected:
virtual int DoInsertItems(const wxArrayStringsAdapter & items,
unsigned int pos,
void **clientData,
wxClientDataType type);
virtual int DoInsertOneItem(const wxString& item, unsigned int pos);
virtual void DoSetItemClientData(unsigned int n, void *clientData);
virtual void *DoGetItemClientData(unsigned int n) const;
virtual void DoClear();
virtual void DoDeleteOneItem(unsigned int pos);
QComboBox *m_qtComboBox;
private:
DECLARE_DYNAMIC_CLASS(wxChoice)
};
#endif // _WX_QT_CHOICE_H_

44
include/wx/qt/clipbrd.h Normal file
View File

@@ -0,0 +1,44 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/toolbar.h
// Author: Sean D'Epagnier
// Copyright: (c) Sean D'Epagnier 2014
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CLIPBRD_H_
#define _WX_QT_CLIPBRD_H_
#include "wx/weakref.h"
class QtClipBoardSignalHandler;
class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
{
public:
wxClipboard();
~wxClipboard();
virtual bool Open();
virtual void Close();
virtual bool IsOpened() const;
virtual bool AddData( wxDataObject *data );
virtual bool SetData( wxDataObject *data );
virtual bool GetData( wxDataObject& data );
virtual void Clear();
virtual bool IsSupported( const wxDataFormat& format );
virtual bool IsSupportedAsync(wxEvtHandler *sink);
private:
friend class QtClipBoardSignalHandler;
int Mode();
QtClipBoardSignalHandler *m_SignalHandler;
wxEvtHandlerRef m_sink;
bool m_open;
DECLARE_DYNAMIC_CLASS(wxClipboard)
};
#endif // _WX_QT_CLIPBRD_H_

50
include/wx/qt/clrpicker.h Normal file
View File

@@ -0,0 +1,50 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/clrpicker.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CLRPICKER_H_
#define _WX_QT_CLRPICKER_H_
#include "wx/generic/clrpickerg.h"
// TODO: A QtColorPicker is available from
// http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Widgets/qtcolorpicker/
// How to integrate into wxWidgets:
//
// class WXDLLIMPEXP_CORE wxColourPickerWidget : public wxButton, public wxColourPickerWidgetBase
// TODO: For now we reuse the existing wxGenericColourButton but this should be
// changed to use the above mentioned color picker.
class WXDLLIMPEXP_CORE wxColourPickerWidget : public wxGenericColourButton
{
public:
wxColourPickerWidget();
wxColourPickerWidget(wxWindow *parent,
wxWindowID id,
const wxColour& initial = *wxBLACK,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCLRBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxColourPickerWidgetNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxColour& initial = *wxBLACK,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCLRBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxColourPickerWidgetNameStr);
protected:
virtual void UpdateColour();
private:
};
#endif // _WX_QT_CLRPICKER_H_

33
include/wx/qt/colordlg.h Normal file
View File

@@ -0,0 +1,33 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/colordlg.h
// Author: Sean D'Epagnier
// Copyright: (c) Sean D'Epagnier 2014
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_COLORDLG_H_
#define _WX_QT_COLORDLG_H_
#include "wx/dialog.h"
#include <QtWidgets/QColorDialog>
class WXDLLIMPEXP_CORE wxColourDialog : public wxDialog
{
public:
wxColourDialog() { }
wxColourDialog(wxWindow *parent,
wxColourData *data = NULL) { Create(parent, data); }
bool Create(wxWindow *parent, wxColourData *data = NULL);
wxColourData &GetColourData();
QColorDialog *GetHandle() const { return static_cast<QColorDialog *>(m_qtWindow); }
private:
wxColourData m_data;
};
#endif // _WX_QT_COLORDLG_H_

48
include/wx/qt/colour.h Normal file
View File

@@ -0,0 +1,48 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/colour.h
// Purpose: wxColour class implementation for wxQt
// Author: Peter Most, Kolya Kosenko
// Created: 2010-05-12
// Copyright: (C) 2010 Kolya Kosenko
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_COLOUR_H_
#define _WX_QT_COLOUR_H_
#include <QtGui/QColor>
class WXDLLIMPEXP_CORE wxColour : public wxColourBase
{
public:
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
wxColour(const QColor& color) : m_qtColor(color) {}
virtual bool IsOk() const { return m_qtColor.isValid(); }
virtual ChannelType Red() const { return m_qtColor.red(); }
virtual ChannelType Green() const { return m_qtColor.green(); }
virtual ChannelType Blue() const { return m_qtColor.blue(); }
virtual ChannelType Alpha() const { return m_qtColor.alpha(); }
bool operator==(const wxColour& color) const
{ return m_qtColor == color.m_qtColor; }
bool operator!=(const wxColour& color) const
{ return m_qtColor != color.m_qtColor; }
int GetPixel() const;
QColor GetHandle() const { return m_qtColor; };
protected:
virtual void
InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a)
{ m_qtColor.setRgb(r, g, b, a); }
private:
QColor m_qtColor;
DECLARE_DYNAMIC_CLASS(wxColour)
};
#endif // _WX_QT_COLOUR_H_

92
include/wx/qt/combobox.h Normal file
View File

@@ -0,0 +1,92 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/combobox.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_COMBOBOX_H_
#define _WX_QT_COMBOBOX_H_
#include "wx/choice.h"
#include <QtWidgets/QComboBox>
class WXDLLIMPEXP_CORE wxComboBox : public wxChoice, public wxTextEntry
{
public:
wxComboBox();
wxComboBox(wxWindow *parent,
wxWindowID id,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
wxComboBox(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = (const wxString *) NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
virtual void SetSelection(int n) { wxChoice::SetSelection(n); }
virtual void SetSelection(long from, long to);
virtual int GetSelection() const { return wxChoice::GetSelection(); }
virtual void GetSelection(long *from, long *to) const;
virtual wxString GetStringSelection() const
{
return wxItemContainer::GetStringSelection();
}
virtual void Clear()
{
wxTextEntry::Clear();
wxItemContainer::Clear();
}
// See wxComboBoxBase discussion of IsEmpty().
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
virtual void Popup();
virtual void Dismiss();
protected:
// From wxTextEntry:
virtual wxString DoGetValue() const;
private:
// From wxTextEntry:
virtual wxWindow *GetEditableWindow() wxOVERRIDE { return this; }
DECLARE_DYNAMIC_CLASS(wxComboBox)
};
#endif // _WX_QT_COMBOBOX_H_

38
include/wx/qt/control.h Normal file
View File

@@ -0,0 +1,38 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/control.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CONTROL_H_
#define _WX_QT_CONTROL_H_
class WXDLLIMPEXP_CORE wxControl : public wxControlBase
{
public:
wxControl();
wxControl(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr);
virtual wxSize DoGetBestSize() const;
protected:
bool QtCreateControl( wxWindow *parent, wxWindowID id, const wxPoint &pos,
const wxSize &size, long style, const wxValidator &validator,
const wxString &name );
private:
DECLARE_DYNAMIC_CLASS(wxControl)
};
#endif // _WX_QT_CONTROL_H_

22
include/wx/qt/ctrlsub.h Normal file
View File

@@ -0,0 +1,22 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/ctrlsub.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CTRLSUB_H_
#define _WX_QT_CTRLSUB_H_
class WXDLLIMPEXP_CORE wxControlWithItems : public wxControlWithItemsBase
{
public:
wxControlWithItems();
protected:
private:
DECLARE_ABSTRACT_CLASS(wxControlWithItems)
};
#endif // _WX_QT_CTRLSUB_H_

46
include/wx/qt/cursor.h Normal file
View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: cursor.h
// Author: Sean D'Epagnier
// Copyright: (c) Sean D'Epagnier 2014
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CURSOR_H_
#define _WX_QT_CURSOR_H_
#include "wx/gdicmn.h"
#include "wx/gdiobj.h"
#include "wx/image.h"
#include <QtGui/QCursor>
class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject
{
public:
wxCursor() { }
wxCursor( const wxCursor & );
wxCursor( const wxImage& image ) { InitFromImage(image); }
wxCursor( const wxString& name,
wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
int hotSpotX = 0, int hotSpotY = 0 );
wxCursor(wxStockCursor id) { InitFromStock(id); }
#if WXWIN_COMPATIBILITY_2_8
wxCursor(int id) { InitFromStock((wxStockCursor)id); }
#endif
QCursor m_qtCursor;
protected:
void InitFromStock( wxStockCursor cursorId );
#if wxUSE_IMAGE
void InitFromImage( const wxImage & image );
#endif
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
DECLARE_DYNAMIC_CLASS( wxCursor )
};
#endif // _WX_QT_CURSOR_H_

39
include/wx/qt/dataform.h Normal file
View File

@@ -0,0 +1,39 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/toolbar.h
// Author: Sean D'Epagnier
// Copyright: (c) Sean D'Epagnier 2014
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DATAFORM_H_
#define _WX_QT_DATAFORM_H_
class WXDLLIMPEXP_CORE wxDataFormat
{
public:
wxDataFormat();
wxDataFormat( wxDataFormatId formatId );
wxDataFormat(const wxString &id);
wxDataFormat(const QString &id);
wxDataFormat(const wxChar *id);
void SetId( const wxChar *id );
bool operator==(wxDataFormatId format) const;
bool operator!=(wxDataFormatId format) const;
bool operator==(const wxDataFormat& format) const;
bool operator!=(const wxDataFormat& format) const;
// string ids are used for custom types - this SetId() must be used for
// application-specific formats
wxString GetId() const;
void SetId( const wxString& id );
// implementation
wxDataFormatId GetType() const;
void SetType( wxDataFormatId type );
QString m_MimeType;
};
#endif // _WX_QT_DATAFORM_H_

30
include/wx/qt/dataobj.h Normal file
View File

@@ -0,0 +1,30 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/qt/dataobj.cpp
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DATAOBJ_H_
#define _WX_QT_DATAOBJ_H_
#include <QMimeData>
class WXDLLIMPEXP_CORE wxDataObject : public wxDataObjectBase
{
public:
wxDataObject() {}
virtual bool IsSupportedFormat(const wxDataFormat& format, Direction dir) const;
virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const;
virtual size_t GetFormatCount(Direction dir = Get) const;
virtual void GetAllFormats(wxDataFormat *formats, Direction dir = Get) const;
virtual size_t GetDataSize(const wxDataFormat& format) const;
virtual bool GetDataHere(const wxDataFormat& format, void *buf) const;
virtual bool SetData(const wxDataFormat& format, size_t len, const void * buf);
private:
QMimeData m_qtMimeData; // to handle formats that have no helper classes
};
#endif // _WX_QT_DATAOBJ_H_

32
include/wx/qt/dataobj2.h Normal file
View File

@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dataobj2.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DATAOBJ2_H_
#define _WX_QT_DATAOBJ2_H_
class WXDLLIMPEXP_CORE wxBitmapDataObject : public wxBitmapDataObjectBase
{
public:
wxBitmapDataObject();
wxBitmapDataObject(const wxBitmap& bitmap);
protected:
private:
};
class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase
{
public:
wxFileDataObject();
void AddFile( const wxString &filename );
};
#endif // _WX_QT_DATAOBJ2_H_

141
include/wx/qt/dataview.h Normal file
View File

@@ -0,0 +1,141 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dataview.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DATAVIEW_H_
#define _WX_QT_DATAVIEW_H_
class WXDLLIMPEXP_ADV wxDataViewColumn: public wxDataViewColumnBase
{
public:
wxDataViewColumn( const wxString &title, wxDataViewRenderer *renderer,
unsigned int model_column, int width = wxDVC_DEFAULT_WIDTH,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn( const wxBitmap &bitmap, wxDataViewRenderer *renderer,
unsigned int model_column, int width = wxDVC_DEFAULT_WIDTH,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
// setters:
virtual void SetTitle( const wxString &title );
virtual void SetBitmap( const wxBitmap &bitmap );
virtual void SetOwner( wxDataViewCtrl *owner );
virtual void SetAlignment( wxAlignment align );
virtual void SetSortable( bool sortable );
virtual void SetSortOrder( bool ascending );
virtual void SetAsSortKey(bool sort = true);
virtual void SetResizeable( bool resizeable );
virtual void SetHidden( bool hidden );
virtual void SetMinWidth( int minWidth );
virtual void SetWidth( int width );
virtual void SetReorderable( bool reorderable );
virtual void SetFlags(int flags);
// getters:
virtual wxString GetTitle() const;
virtual wxAlignment GetAlignment() const;
virtual bool IsSortable() const;
virtual bool IsSortOrderAscending() const;
virtual bool IsSortKey() const;
virtual bool IsResizeable() const;
virtual bool IsHidden() const;
virtual int GetWidth() const;
virtual int GetMinWidth() const;
virtual bool IsReorderable() const;
virtual int GetFlags() const;
};
class WXDLLIMPEXP_ADV wxDataViewCtrl: public wxDataViewCtrlBase
{
public:
wxDataViewCtrl();
wxDataViewCtrl( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator );
virtual ~wxDataViewCtrl();
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator );
virtual bool AssociateModel( wxDataViewModel *model );
virtual bool PrependColumn( wxDataViewColumn *col );
virtual bool AppendColumn( wxDataViewColumn *col );
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col );
virtual unsigned int GetColumnCount() const;
virtual wxDataViewColumn* GetColumn( unsigned int pos ) const;
virtual bool DeleteColumn( wxDataViewColumn *column );
virtual bool ClearColumns();
virtual int GetColumnPosition( const wxDataViewColumn *column ) const;
virtual wxDataViewColumn *GetSortingColumn() const;
virtual wxDataViewItem GetSelection() const;
virtual int GetSelections( wxDataViewItemArray & sel ) const;
virtual void SetSelections( const wxDataViewItemArray & sel );
virtual void Select( const wxDataViewItem & item );
virtual void Unselect( const wxDataViewItem & item );
virtual bool IsSelected( const wxDataViewItem & item ) const;
virtual void SelectAll();
virtual void UnselectAll();
virtual void EnsureVisible( const wxDataViewItem& item,
const wxDataViewColumn *column = NULL );
virtual void HitTest( const wxPoint &point,
wxDataViewItem &item,
wxDataViewColumn *&column ) const;
virtual wxRect GetItemRect( const wxDataViewItem &item,
const wxDataViewColumn *column = NULL ) const;
virtual void Expand( const wxDataViewItem & item );
virtual void Collapse( const wxDataViewItem & item );
virtual bool IsExpanded( const wxDataViewItem & item ) const;
virtual bool EnableDragSource( const wxDataFormat &format );
virtual bool EnableDropTarget( const wxDataFormat &format );
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
wxWindow *GetMainWindow() { return (wxWindow*) this; }
virtual void OnInternalIdle();
protected:
virtual void DoSetExpanderColumn();
virtual void DoSetIndent();
private:
virtual wxDataViewItem DoGetCurrentItem() const;
virtual void DoSetCurrentItem(const wxDataViewItem& item);
};
#endif // _WX_QT_DATAVIEW_H_

134
include/wx/qt/dc.h Normal file
View File

@@ -0,0 +1,134 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dc.h
// Author: Peter Most, Javier Torres, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DC_H_
#define _WX_QT_DC_H_
#include <QtGui/QPainter>
class QImage;
class WXDLLIMPEXP_FWD_CORE wxRegion;
class WXDLLIMPEXP_CORE wxQtDCImpl : public wxDCImpl
{
public:
wxQtDCImpl( wxDC *owner );
~wxQtDCImpl();
virtual bool CanDrawBitmap() const;
virtual bool CanGetTextExtent() const;
virtual void DoGetSize(int *width, int *height) const;
virtual void DoGetSizeMM(int* width, int* height) const;
virtual int GetDepth() const;
virtual wxSize GetPPI() const;
virtual void SetFont(const wxFont& font);
virtual void SetPen(const wxPen& pen);
virtual void SetBrush(const wxBrush& brush);
virtual void SetBackground(const wxBrush& brush);
virtual void SetBackgroundMode(int mode);
#if wxUSE_PALETTE
virtual void SetPalette(const wxPalette& palette);
#endif // wxUSE_PALETTE
virtual void SetLogicalFunction(wxRasterOperationMode function);
virtual wxCoord GetCharHeight() const;
virtual wxCoord GetCharWidth() const;
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const;
virtual void Clear();
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
virtual void DoSetDeviceClippingRegion(const wxRegion& region);
virtual void DestroyClippingRegion();
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE);
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
virtual void DoDrawPoint(wxCoord x, wxCoord y);
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc);
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea);
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord width, wxCoord height,
double radius);
virtual void DoDrawEllipse(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
virtual void DoCrossHair(wxCoord x, wxCoord y);
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = false);
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
virtual void DoDrawRotatedText(const wxString& text,
wxCoord x, wxCoord y, double angle);
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height,
wxDC *source,
wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop = wxCOPY,
bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord,
wxCoord ysrcMask = wxDefaultCoord);
virtual void DoDrawLines(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset );
virtual void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
// Use Qt transformations, as they automatically scale pen widths, text...
virtual void ComputeScaleAndOrigin();
void QtPreparePainter();
virtual void* GetHandle() const { return (void*) m_qtPainter; }
protected:
QPainter *m_qtPainter;
QImage *m_qtImage;
wxRegion *m_clippingRegion;
private:
enum wxQtRasterColourOp
{
wxQtNONE,
wxQtWHITE,
wxQtBLACK,
wxQtINVERT
};
wxQtRasterColourOp m_rasterColourOp;
QColor m_qtPenColor;
QColor m_qtBrushColor;
void ApplyRasterColourOp();
};
#endif // _WX_QT_DC_H_

46
include/wx/qt/dcclient.h Normal file
View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dcclient.h
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DCCLIENT_H_
#define _WX_QT_DCCLIENT_H_
#include "wx/qt/dc.h"
class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxQtDCImpl
{
public:
wxWindowDCImpl( wxDC *owner );
wxWindowDCImpl( wxDC *owner, wxWindow *win );
~wxWindowDCImpl();
protected:
wxWindow *m_window;
private:
};
class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
{
public:
wxClientDCImpl( wxDC *owner );
wxClientDCImpl( wxDC *owner, wxWindow *win );
~wxClientDCImpl();
};
class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxWindowDCImpl
{
public:
wxPaintDCImpl( wxDC *owner );
wxPaintDCImpl( wxDC *owner, wxWindow *win );
};
#endif // _WX_QT_DCCLIENT_H_

32
include/wx/qt/dcmemory.h Normal file
View File

@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dcmemory.h
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DCMEMORY_H_
#define _WX_QT_DCMEMORY_H_
#include "wx/qt/dcclient.h"
class WXDLLIMPEXP_CORE wxMemoryDCImpl : public wxQtDCImpl
{
public:
wxMemoryDCImpl( wxMemoryDC *owner );
wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap );
wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc );
~wxMemoryDCImpl();
virtual void DoSelect(const wxBitmap& bitmap);
virtual const wxBitmap& GetSelectedBitmap() const;
virtual wxBitmap& GetSelectedBitmap();
protected:
private:
wxBitmap m_selected;
};
#endif // _WX_QT_DCMEMORY_H_

106
include/wx/qt/dcprint.h Normal file
View File

@@ -0,0 +1,106 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dcprint.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DCPRINT_H_
#define _WX_QT_DCPRINT_H_
#include "wx/dc.h"
class WXDLLIMPEXP_CORE wxPrinterDCImpl : public wxDCImpl
{
public:
wxPrinterDCImpl( wxPrinterDC *, const wxPrintData & );
virtual bool CanDrawBitmap() const;
virtual bool CanGetTextExtent() const;
virtual void DoGetSize(int *width, int *height) const;
virtual void DoGetSizeMM(int* width, int* height) const;
virtual int GetDepth() const;
virtual wxSize GetPPI() const;
virtual void SetFont(const wxFont& font);
virtual void SetPen(const wxPen& pen);
virtual void SetBrush(const wxBrush& brush);
virtual void SetBackground(const wxBrush& brush);
virtual void SetBackgroundMode(int mode);
#if wxUSE_PALETTE
virtual void SetPalette(const wxPalette& palette);
#endif // wxUSE_PALETTE
virtual void SetLogicalFunction(wxRasterOperationMode function);
virtual wxCoord GetCharHeight() const;
virtual wxCoord GetCharWidth() const;
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const;
virtual void Clear();
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
virtual void DoSetDeviceClippingRegion(const wxRegion& region);
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE);
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
virtual void DoDrawPoint(wxCoord x, wxCoord y);
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc);
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea);
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord width, wxCoord height,
double radius);
virtual void DoDrawEllipse(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
virtual void DoCrossHair(wxCoord x, wxCoord y);
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = false);
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
virtual void DoDrawRotatedText(const wxString& text,
wxCoord x, wxCoord y, double angle);
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height,
wxDC *source,
wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop = wxCOPY,
bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord,
wxCoord ysrcMask = wxDefaultCoord);
virtual void DoDrawLines(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset );
virtual void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
protected:
private:
};
#endif // _WX_QT_DCPRINT_H_

23
include/wx/qt/dcscreen.h Normal file
View File

@@ -0,0 +1,23 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dcscreen.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DCSCREEN_H_
#define _WX_QT_DCSCREEN_H_
#include "wx/qt/dcclient.h"
class WXDLLIMPEXP_CORE wxScreenDCImpl : public wxWindowDCImpl
{
public:
wxScreenDCImpl( wxScreenDC *owner );
protected:
private:
};
#endif // _WX_QT_DCSCREEN_H_

17
include/wx/qt/defs.h Normal file
View File

@@ -0,0 +1,17 @@
/*
* Name: wx/qt/defs.h
* Author: Peter Most
* Copyright: (c) Peter Most
* Licence: wxWindows licence
*/
#ifndef _WX_QT_DEFS_H_
#define _WX_QT_DEFS_H_
#ifdef __cplusplus
typedef class QWidget *WXWidget;
#endif
#endif /* _WX_QT_DEFS_H_ */

46
include/wx/qt/dialog.h Normal file
View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dialog.h
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DIALOG_H_
#define _WX_QT_DIALOG_H_
#include "wx/dialog.h"
#include <QtWidgets/QDialog>
class WXDLLIMPEXP_CORE wxDialog : public wxDialogBase
{
public:
wxDialog();
wxDialog( wxWindow *parent, wxWindowID id,
const wxString &title,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString &name = wxDialogNameStr );
virtual ~wxDialog();
bool Create( wxWindow *parent, wxWindowID id,
const wxString &title,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString &name = wxDialogNameStr );
virtual int ShowModal();
virtual void EndModal(int retCode);
virtual bool IsModal() const;
virtual QDialog *GetHandle() const;
private:
wxDECLARE_DYNAMIC_CLASS( wxDialog );
};
#endif // _WX_QT_DIALOG_H_

46
include/wx/qt/dirdlg.h Normal file
View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dirdlg.h
// Author: Sean D'Epagnier
// Copyright: (c) 2014 Sean D'Epagnier
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DIRDLG_H_
#define _WX_QT_DIRDLG_H_
#include <QtWidgets/QFileDialog>
class WXDLLIMPEXP_CORE wxDirDialog : public wxDirDialogBase
{
public:
wxDirDialog() { }
wxDirDialog(wxWindow *parent,
const wxString& message = wxDirSelectorPromptStr,
const wxString& defaultPath = wxEmptyString,
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxDirDialogNameStr);
bool Create(wxWindow *parent,
const wxString& message = wxDirSelectorPromptStr,
const wxString& defaultPath = wxEmptyString,
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxDirDialogNameStr);
public: // overrides from wxGenericDirDialog
wxString GetPath() const wxOVERRIDE;
void SetPath(const wxString& path) wxOVERRIDE;
virtual QFileDialog *GetHandle() const;
private:
DECLARE_DYNAMIC_CLASS(wxDirDialog)
};
#endif // _WX_QT_DIRDLG_H_

46
include/wx/qt/dnd.h Normal file
View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dnd.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DND_H_
#define _WX_QT_DND_H_
#define wxDROP_ICON(name) wxICON(name)
class WXDLLIMPEXP_CORE wxDropTarget : public wxDropTargetBase
{
public:
wxDropTarget(wxDataObject *dataObject = NULL );
virtual bool OnDrop(wxCoord x, wxCoord y);
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
virtual bool GetData();
wxDataFormat GetMatchingPair();
protected:
private:
};
class WXDLLIMPEXP_CORE wxDropSource: public wxDropSourceBase
{
public:
wxDropSource( wxWindow *win = NULL,
const wxIcon &copy = wxNullIcon,
const wxIcon &move = wxNullIcon,
const wxIcon &none = wxNullIcon);
wxDropSource( wxDataObject& data,
wxWindow *win,
const wxIcon &copy = wxNullIcon,
const wxIcon &move = wxNullIcon,
const wxIcon &none = wxNullIcon);
virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly);
};
#endif // _WX_QT_DND_H_

View File

@@ -0,0 +1,32 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dvrenderer.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DVRENDERER_H_
#define _WX_QT_DVRENDERER_H_
// ----------------------------------------------------------------------------
// wxDataViewRenderer
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewRenderer: public wxDataViewRendererBase
{
public:
wxDataViewRenderer( const wxString &varianttype,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
virtual void SetMode( wxDataViewCellMode mode );
virtual wxDataViewCellMode GetMode() const;
virtual void SetAlignment( int align );
virtual int GetAlignment() const;
virtual void EnableEllipsize(wxEllipsizeMode mode = wxELLIPSIZE_MIDDLE);
virtual wxEllipsizeMode GetEllipsizeMode() const;
};
#endif // _WX_QT_DVRENDERER_H_

176
include/wx/qt/dvrenderers.h Normal file
View File

@@ -0,0 +1,176 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dvrenderers.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DVRENDERERS_H_
#define _WX_QT_DVRENDERERS_H_
// ---------------------------------------------------------
// wxDataViewTextRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewTextRenderer: public wxDataViewRenderer
{
public:
wxDataViewTextRenderer( const wxString &varianttype = wxT("string"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value ) const;
void SetAlignment( int align );
};
// ---------------------------------------------------------
// wxDataViewBitmapRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewBitmapRenderer: public wxDataViewRenderer
{
public:
wxDataViewBitmapRenderer( const wxString &varianttype = wxT("wxBitmap"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value ) const;
};
// ---------------------------------------------------------
// wxDataViewToggleRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewToggleRenderer: public wxDataViewRenderer
{
public:
wxDataViewToggleRenderer( const wxString &varianttype = wxT("bool"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value ) const;
};
// ---------------------------------------------------------
// wxDataViewCustomRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewCustomRenderer: public wxDataViewRenderer
{
public:
wxDataViewCustomRenderer( const wxString &varianttype = wxT("string"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT,
bool no_init = false );
virtual ~wxDataViewCustomRenderer();
virtual bool Render( wxRect cell, wxDC *dc, int state ) = 0;
void RenderText( const wxString &text, int xoffset, wxRect cell, wxDC *dc, int state );
virtual wxSize GetSize() const = 0;
virtual bool Activate( wxRect WXUNUSED(cell),
wxDataViewModel *WXUNUSED(model), const wxDataViewItem &WXUNUSED(item), unsigned int WXUNUSED(col) )
{ return false; }
virtual bool LeftClick( wxPoint WXUNUSED(cursor), wxRect WXUNUSED(cell),
wxDataViewModel *WXUNUSED(model), const wxDataViewItem &WXUNUSED(item), unsigned int WXUNUSED(col) )
{ return false; }
virtual bool StartDrag( wxPoint WXUNUSED(cursor), wxRect WXUNUSED(cell),
wxDataViewModel *WXUNUSED(model), const wxDataViewItem &WXUNUSED(item), unsigned int WXUNUSED(col) )
{ return false; }
// Create DC on request
virtual wxDC *GetDC();
};
// ---------------------------------------------------------
// wxDataViewProgressRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewProgressRenderer: public wxDataViewCustomRenderer
{
public:
wxDataViewProgressRenderer( const wxString &label = wxEmptyString,
const wxString &varianttype = wxT("long"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
virtual ~wxDataViewProgressRenderer();
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value ) const;
virtual bool Render( wxRect cell, wxDC *dc, int state );
virtual wxSize GetSize() const;
};
// ---------------------------------------------------------
// wxDataViewIconTextRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewIconTextRenderer: public wxDataViewCustomRenderer
{
public:
wxDataViewIconTextRenderer( const wxString &varianttype = wxT("wxDataViewIconText"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
virtual ~wxDataViewIconTextRenderer();
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value ) const;
virtual bool Render( wxRect cell, wxDC *dc, int state );
virtual wxSize GetSize() const;
virtual bool HasEditorCtrl() const { return true; }
virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value );
virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value );
};
// ---------------------------------------------------------
// wxDataViewDateRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewDateRenderer: public wxDataViewCustomRenderer
{
public:
wxDataViewDateRenderer( const wxString &varianttype = wxT("datetime"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
int align = wxDVR_DEFAULT_ALIGNMENT );
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value ) const;
virtual bool Render( wxRect cell, wxDC *dc, int state );
virtual wxSize GetSize() const;
virtual bool Activate( wxRect cell,
wxDataViewModel *model, const wxDataViewItem &item, unsigned int col );
};
// -------------------------------------
// wxDataViewChoiceRenderer
// -------------------------------------
class WXDLLIMPEXP_ADV wxDataViewChoiceRenderer: public wxDataViewCustomRenderer
{
public:
wxDataViewChoiceRenderer( const wxArrayString &choices,
wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE,
int alignment = wxDVR_DEFAULT_ALIGNMENT );
virtual bool Render( wxRect rect, wxDC *dc, int state );
virtual wxSize GetSize() const;
virtual bool SetValue( const wxVariant &value );
virtual bool GetValue( wxVariant &value ) const;
void SetAlignment( int align );
};
#endif // _WX_QT_DVRENDERERS_H_

78
include/wx/qt/evtloop.h Normal file
View File

@@ -0,0 +1,78 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/evtloop.h
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_EVTLOOP_H_
#define _WX_QT_EVTLOOP_H_
#include <QtCore/QTimer>
class WXDLLIMPEXP_BASE wxQtEventLoopBase : public wxEventLoopBase
{
public:
wxQtEventLoopBase();
~wxQtEventLoopBase();
virtual int DoRun();
virtual void ScheduleExit(int rc = 0);
virtual bool Pending() const;
virtual bool Dispatch();
virtual int DispatchTimeout(unsigned long timeout);
virtual void WakeUp();
virtual void DoYieldFor(long eventsToProcess);
#if wxUSE_EVENTLOOP_SOURCE
virtual wxEventLoopSource *AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags);
#endif // wxUSE_EVENTLOOP_SOURCE
protected:
private:
QTimer *m_qtIdleTimer;
wxDECLARE_NO_COPY_CLASS(wxQtEventLoopBase);
};
#if wxUSE_GUI
class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxQtEventLoopBase
{
public:
wxGUIEventLoop();
};
#else // !wxUSE_GUI
#if wxUSE_CONSOLE_EVENTLOOP
class WXDLLIMPEXP_BASE wxConsoleEventLoop : public wxQtEventLoopBase
{
public:
wxConsoleEventLoop();
};
#endif // wxUSE_CONSOLE_EVENTLOOP
#endif // wxUSE_GUI
class wxQtEventLoopBase;
class wxQtIdleTimer : public QTimer
{
public:
wxQtIdleTimer( wxQtEventLoopBase *eventLoop );
virtual bool eventFilter( QObject * watched, QEvent * event );
private:
void idle();
private:
wxQtEventLoopBase *m_eventLoop;
};
#endif // _WX_QT_EVTLOOP_H_

58
include/wx/qt/filedlg.h Normal file
View File

@@ -0,0 +1,58 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/filedlg.h
// Author: Sean D'Epagnier
// Copyright: (c) 2014 Sean D'Epagnier
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_FILEDLG_H_
#define _WX_QT_FILEDLG_H_
#include <QtWidgets/QFileDialog>
class WXDLLIMPEXP_CORE wxFileDialog : public wxFileDialogBase
{
public:
wxFileDialog() { }
wxFileDialog(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxFileDialogNameStr);
bool Create(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxFileDialogNameStr);
virtual wxString GetPath() const wxOVERRIDE;
virtual void GetPaths(wxArrayString& paths) const wxOVERRIDE;
virtual wxString GetFilename() const wxOVERRIDE;
virtual void GetFilenames(wxArrayString& files) const wxOVERRIDE;
virtual int GetFilterIndex() const wxOVERRIDE;
virtual void SetMessage(const wxString& message) wxOVERRIDE;
virtual void SetPath(const wxString& path) wxOVERRIDE;
virtual void SetDirectory(const wxString& dir) wxOVERRIDE;
virtual void SetFilename(const wxString& name) wxOVERRIDE;
virtual void SetWildcard(const wxString& wildCard) wxOVERRIDE;
virtual void SetFilterIndex(int filterIndex) wxOVERRIDE;
virtual bool SupportsExtraControl() const wxOVERRIDE { return true; }
virtual QFileDialog *GetHandle() const;
private:
DECLARE_DYNAMIC_CLASS(wxFileDialog)
};
#endif // _WX_QT_FILEDLG_H_

82
include/wx/qt/font.h Normal file
View File

@@ -0,0 +1,82 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/font.h
// Author: Peter Most, Javier Torres, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_FONT_H_
#define _WX_QT_FONT_H_
class WXDLLIMPEXP_CORE wxFont : public wxFontBase
{
public:
wxFont();
wxFont(const wxFontInfo& info);
wxFont(const wxString& nativeFontInfoString);
wxFont(const wxNativeFontInfo& info);
wxFont(const QFont& font);
wxFont(int size,
wxFontFamily family,
wxFontStyle style,
wxFontWeight weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
wxFont(const wxSize& pixelSize,
wxFontFamily family,
wxFontStyle style,
wxFontWeight weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
wxFont(int size,
int family,
int style,
int weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
bool Create(wxSize size,
wxFontFamily family,
wxFontStyle style,
wxFontWeight weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
// accessors: get the font characteristics
virtual int GetPointSize() const;
virtual wxFontStyle GetStyle() const;
virtual wxFontWeight GetWeight() const;
virtual bool GetUnderlined() const;
virtual wxString GetFaceName() const;
virtual wxFontEncoding GetEncoding() const;
virtual const wxNativeFontInfo *GetNativeFontInfo() const;
// change the font characteristics
virtual void SetPointSize( int pointSize );
virtual void SetFamily( wxFontFamily family );
virtual void SetStyle( wxFontStyle style );
virtual bool SetFaceName(const wxString& facename);
virtual void SetWeight( wxFontWeight weight );
virtual void SetUnderlined( bool underlined );
virtual void SetEncoding(wxFontEncoding encoding);
wxDECLARE_COMMON_FONT_METHODS();
virtual QFont GetHandle() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
virtual wxFontFamily DoGetFamily() const;
DECLARE_DYNAMIC_CLASS( wxFont )
};
#endif // _WX_QT_FONT_H_

32
include/wx/qt/fontdlg.h Normal file
View File

@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/fontdlg.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_FONTDLG_H_
#define _WX_QT_FONTDLG_H_
#include <QtWidgets/QFontDialog>
class WXDLLIMPEXP_CORE wxFontDialog : public wxFontDialogBase
{
public:
wxFontDialog() { }
wxFontDialog(wxWindow *parent) { Create(parent); }
wxFontDialog(wxWindow *parent, const wxFontData& data) { Create(parent, data); }
virtual QFontDialog *GetHandle() const { return static_cast<QFontDialog *>(m_qtWindow); }
protected:
bool DoCreate(wxWindow *parent);
private:
wxFontData m_data;
DECLARE_DYNAMIC_CLASS(wxFontDialog)
};
#endif // _WX_QT_FONTDLG_H_

61
include/wx/qt/frame.h Normal file
View File

@@ -0,0 +1,61 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/frame.h
// Purpose: wxFrame class interface
// Author: Peter Most
// Modified by:
// Created: 09.08.09
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_FRAME_H_
#define _WX_QT_FRAME_H_
#include "wx/frame.h"
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QScrollArea>
class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
{
public:
wxFrame();
wxFrame(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
virtual ~wxFrame();
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
virtual void SetMenuBar(wxMenuBar *menubar);
virtual void SetStatusBar(wxStatusBar *statusBar );
virtual void SetToolBar(wxToolBar *toolbar);
virtual void SetWindowStyleFlag( long style );
virtual void AddChild( wxWindowBase *child );
virtual void RemoveChild( wxWindowBase *child );
virtual QMainWindow *GetHandle() const
{
return static_cast<QMainWindow*>(m_qtWindow);
}
virtual QAbstractScrollArea *QtGetScrollBarsContainer() const;
private:
wxDECLARE_DYNAMIC_CLASS( wxFrame );
};
#endif // _WX_QT_FRAME_H_

51
include/wx/qt/gauge.h Normal file
View File

@@ -0,0 +1,51 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/gauge.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_GAUGE_H_
#define _WX_QT_GAUGE_H_
#include <QtWidgets/QProgressBar>
class WXDLLIMPEXP_CORE wxGauge : public wxGaugeBase
{
public:
wxGauge();
wxGauge(wxWindow *parent,
wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr);
virtual QProgressBar *GetHandle() const;
// set/get the control range
virtual void SetRange(int range);
virtual int GetRange() const;
virtual void SetValue(int pos);
virtual int GetValue() const;
private:
QProgressBar *m_qtProgressBar;
wxDECLARE_DYNAMIC_CLASS(wxGauge);
};
#endif // _WX_QT_GAUGE_H_

65
include/wx/qt/glcanvas.h Normal file
View File

@@ -0,0 +1,65 @@
/////////////////////////////////////////////////////////////////////////////
// Name: include/wx/qt/glcanvas.cpp
// Author: Sean D'Epagnier
// Copyright: (c) Sean D'Epagnier 2014
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GLCANVAS_H_
#define _WX_GLCANVAS_H_
#include <QtOpenGL/QGLWidget>
class WXDLLIMPEXP_GL wxGLContext : public wxGLContextBase
{
public:
wxGLContext(wxGLCanvas *win, const wxGLContext* other = NULL);
/// virtual ~wxGLContext();
virtual bool SetCurrent(const wxGLCanvas& win) const wxOVERRIDE;
private:
QGLContext *m_glContext;
DECLARE_CLASS(wxGLContext)
};
// ----------------------------------------------------------------------------
// wxGLCanvas: OpenGL output window
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase
{
public:
wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas
wxGLCanvas(wxWindow *parent,
wxWindowID id = wxID_ANY,
const int *attribList = NULL,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const int *attribList = NULL,
const wxPalette& palette = wxNullPalette);
virtual bool SwapBuffers();
static bool ConvertWXAttrsToQtGL(const int *wxattrs, QGLFormat &format);
virtual QGLWidget *GetHandle() const { return static_cast<QGLWidget *>(m_qtWindow); }
private:
// DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxGLCanvas)
};
#endif // _WX_GLCANVAS_H_

95
include/wx/qt/listbox.h Normal file
View File

@@ -0,0 +1,95 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/listbox.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_LISTBOX_H_
#define _WX_QT_LISTBOX_H_
#include <QtWidgets/QListWidget>
class WXDLLIMPEXP_CORE wxListBox : public wxListBoxBase
{
public:
wxListBox();
wxListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
wxListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
virtual ~wxListBox();
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
virtual bool IsSelected(int n) const;
virtual int GetSelections(wxArrayInt& aSelections) const;
virtual unsigned int GetCount() const;
virtual wxString GetString(unsigned int n) const;
virtual void SetString(unsigned int n, const wxString& s);
virtual void SetSelection(int n);
virtual int GetSelection() const;
virtual QListWidget *GetHandle() const;
void QtSendEvent(wxEventType evtType, const QModelIndex &index, bool selected);
protected:
virtual void DoSetFirstItem(int n);
virtual void DoSetSelection(int n, bool select);
virtual int DoInsertItems(const wxArrayStringsAdapter & items,
unsigned int pos,
void **clientData,
wxClientDataType type);
virtual int DoInsertOneItem(const wxString& item, unsigned int pos);
virtual void DoSetItemClientData(unsigned int n, void *clientData);
virtual void *DoGetItemClientData(unsigned int n) const;
virtual void DoClear();
virtual void DoDeleteOneItem(unsigned int pos);
virtual QScrollArea *QtGetScrollBarsContainer() const;
#if wxUSE_CHECKLISTBOX
bool m_hasCheckBoxes;
#endif // wxUSE_CHECKLISTBOX
QListWidget *m_qtListWidget;
private:
virtual void Init(); //common construction
DECLARE_DYNAMIC_CLASS(wxListBox)
};
#endif // _WX_QT_LISTBOX_H_

322
include/wx/qt/listctrl.h Normal file
View File

@@ -0,0 +1,322 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/listctrl.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_LISTCTRL_H_
#define _WX_QT_LISTCTRL_H_
#include "wx/textctrl.h"
#include <QtWidgets/QTreeWidget>
class WXDLLIMPEXP_FWD_CORE wxImageList;
class WXDLLIMPEXP_CORE wxListCtrl: public wxListCtrlBase
{
public:
wxListCtrl();
wxListCtrl(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListCtrlNameStr);
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListCtrlNameStr);
virtual ~wxListCtrl();
// Attributes
////////////////////////////////////////////////////////////////////////////
// Set the control colours
bool SetForegroundColour(const wxColour& col);
bool SetBackgroundColour(const wxColour& col);
// Gets information about this column
bool GetColumn(int col, wxListItem& info) const;
// Sets information about this column
bool SetColumn(int col, const wxListItem& info);
// Gets the column width
int GetColumnWidth(int col) const;
// Sets the column width
bool SetColumnWidth(int col, int width);
// Gets the column order from its index or index from its order
int GetColumnOrder(int col) const;
int GetColumnIndexFromOrder(int order) const;
// Gets the column order for all columns
wxArrayInt GetColumnsOrder() const;
// Sets the column order for all columns
bool SetColumnsOrder(const wxArrayInt& orders);
// Gets the number of items that can fit vertically in the
// visible area of the list control (list or report view)
// or the total number of items in the list control (icon
// or small icon view)
int GetCountPerPage() const;
// return the total area occupied by all the items (icon/small icon only)
wxRect GetViewRect() const;
// Gets the edit control for editing labels.
wxTextCtrl* GetEditControl() const;
// Gets information about the item
bool GetItem(wxListItem& info) const;
// Sets information about the item
bool SetItem(wxListItem& info);
// Sets a string field at a particular column
long SetItem(long index, int col, const wxString& label, int imageId = -1);
// Gets the item state
int GetItemState(long item, long stateMask) const;
// Sets the item state
bool SetItemState(long item, long state, long stateMask);
// Sets the item image
bool SetItemImage(long item, int image, int selImage = -1);
bool SetItemColumnImage(long item, long column, int image);
// Gets the item text
wxString GetItemText(long item, int col = 0) const;
// Sets the item text
void SetItemText(long item, const wxString& str);
// Gets the item data
wxUIntPtr GetItemData(long item) const;
// Sets the item data
bool SetItemPtrData(long item, wxUIntPtr data);
bool SetItemData(long item, long data);
// Gets the item rectangle
bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const;
// Gets the subitem rectangle in report mode
bool GetSubItemRect(long item, long subItem, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const;
// Gets the item position
bool GetItemPosition(long item, wxPoint& pos) const;
// Sets the item position
bool SetItemPosition(long item, const wxPoint& pos);
// Gets the number of items in the list control
int GetItemCount() const;
// Gets the number of columns in the list control
int GetColumnCount() const;
// get the horizontal and vertical components of the item spacing
wxSize GetItemSpacing() const;
// Foreground colour of an item.
void SetItemTextColour( long item, const wxColour& col);
wxColour GetItemTextColour( long item ) const;
// Background colour of an item.
void SetItemBackgroundColour( long item, const wxColour &col);
wxColour GetItemBackgroundColour( long item ) const;
// Font of an item.
void SetItemFont( long item, const wxFont &f);
wxFont GetItemFont( long item ) const;
// Gets the number of selected items in the list control
int GetSelectedItemCount() const;
// Gets the text colour of the listview
wxColour GetTextColour() const;
// Sets the text colour of the listview
void SetTextColour(const wxColour& col);
// Gets the index of the topmost visible item when in
// list or report view
long GetTopItem() const;
// Add or remove a single window style
void SetSingleStyle(long style, bool add = true);
// Set the whole window style
void SetWindowStyleFlag(long style);
// Searches for an item, starting from 'item'.
// item can be -1 to find the first item that matches the
// specified flags.
// Returns the item or -1 if unsuccessful.
long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const;
// Gets one of the three image lists
wxImageList *GetImageList(int which) const;
// Sets the image list
// N.B. There's a quirk in the Win95 list view implementation.
// If in wxLC_LIST mode, it'll *still* display images by the labels if
// there's a small-icon image list set for the control - even though you
// haven't specified wxLIST_MASK_IMAGE when inserting.
// So you have to set a NULL small-icon image list to be sure that
// the wxLC_LIST mode works without icons. Of course, you may want icons...
void SetImageList(wxImageList *imageList, int which);
void AssignImageList(wxImageList *imageList, int which);
// are we in report mode?
bool InReportView() const;
// are we in virtual report mode?
bool IsVirtual() const;
// refresh items selectively (only useful for virtual list controls)
void RefreshItem(long item);
void RefreshItems(long itemFrom, long itemTo);
// Operations
////////////////////////////////////////////////////////////////////////////
// Arranges the items
bool Arrange(int flag = wxLIST_ALIGN_DEFAULT);
// Deletes an item
bool DeleteItem(long item);
// Deletes all items
bool DeleteAllItems();
// Deletes a column
bool DeleteColumn(int col);
// Deletes all columns
bool DeleteAllColumns();
// Clears items, and columns if there are any.
void ClearAll();
// Edit the label
wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl));
// End label editing, optionally cancelling the edit
bool EndEditLabel(bool cancel);
// Ensures this item is visible
bool EnsureVisible(long item);
// Find an item whose label matches this string, starting from the item after 'start'
// or the beginning if 'start' is -1.
long FindItem(long start, const wxString& str, bool partial = false);
// Find an item whose data matches this data, starting from the item after 'start'
// or the beginning if 'start' is -1.
long FindItem(long start, wxUIntPtr data);
// Find an item nearest this position in the specified direction, starting from
// the item after 'start' or the beginning if 'start' is -1.
long FindItem(long start, const wxPoint& pt, int direction);
// Determines which item (if any) is at the specified point,
// giving details in 'flags' (see wxLIST_HITTEST_... flags above)
// Request the subitem number as well at the given coordinate.
long HitTest(const wxPoint& point, int& flags, long* ptrSubItem = NULL) const;
// Inserts an item, returning the index of the new item if successful,
// -1 otherwise.
long InsertItem(const wxListItem& info);
// Insert a string item
long InsertItem(long index, const wxString& label);
// Insert an image item
long InsertItem(long index, int imageIndex);
// Insert an image/string item
long InsertItem(long index, const wxString& label, int imageIndex);
// set the number of items in a virtual list control
void SetItemCount(long count);
// Scrolls the list control. If in icon, small icon or report view mode,
// x specifies the number of pixels to scroll. If in list view mode, x
// specifies the number of columns to scroll.
// If in icon, small icon or list view mode, y specifies the number of pixels
// to scroll. If in report view mode, y specifies the number of lines to scroll.
bool ScrollList(int dx, int dy);
// Sort items.
// fn is a function which takes 3 long arguments: item1, item2, data.
// item1 is the long data associated with a first item (NOT the index).
// item2 is the long data associated with a second item (NOT the index).
// data is the same value as passed to SortItems.
// The return value is a negative number if the first item should precede the second
// item, a positive number of the second item should precede the first,
// or zero if the two items are equivalent.
// data is arbitrary data to be passed to the sort function.
bool SortItems(wxListCtrlCompare fn, wxIntPtr data);
// these functions are only used for virtual list view controls, i.e. the
// ones with wxLC_VIRTUAL style (not currently implemented in wxQT)
// return the text for the given column of the given item
virtual wxString OnGetItemText(long item, long column) const;
// return the icon for the given item. In report view, OnGetItemImage will
// only be called for the first column. See OnGetItemColumnImage for
// details.
virtual int OnGetItemImage(long item) const;
// return the icon for the given item and column.
virtual int OnGetItemColumnImage(long item, long column) const;
// return the attribute for the given item and column (may return NULL if none)
virtual wxListItemAttr *OnGetItemColumnAttr(long item, long WXUNUSED(column)) const
{
return OnGetItemAttr(item);
}
virtual QTreeWidget *GetHandle() const;
protected:
void Init();
// Implement base class pure virtual methods.
long DoInsertColumn(long col, const wxListItem& info);
QTreeWidgetItem *QtGetItem(int id) const;
wxImageList * m_imageListNormal; // The image list for normal icons
wxImageList * m_imageListSmall; // The image list for small icons
wxImageList * m_imageListState; // The image list state icons (not implemented yet)
bool m_ownsImageListNormal,
m_ownsImageListSmall,
m_ownsImageListState;
private:
QTreeWidget *m_qtTreeWidget;
wxDECLARE_DYNAMIC_CLASS( wxListCtrl );
};
#endif

80
include/wx/qt/mdi.h Normal file
View File

@@ -0,0 +1,80 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/mdi.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_MDI_H_
#define _WX_QT_MDI_H_
class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
{
public:
wxMDIParentFrame();
wxMDIParentFrame(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr);
// override/implement base class [pure] virtual methods
// ----------------------------------------------------
static bool IsTDI() { return false; }
virtual void ActivateNext();
virtual void ActivatePrevious();
protected:
private:
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
};
class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxMDIChildFrameBase
{
public:
wxMDIChildFrame();
wxMDIChildFrame(wxMDIParentFrame *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
bool Create(wxMDIParentFrame *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
virtual void Activate();
};
class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase
{
public:
wxMDIClientWindow();
virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL);
};
#endif // _WX_QT_MDI_H_

62
include/wx/qt/menu.h Normal file
View File

@@ -0,0 +1,62 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/menu.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_MENU_H_
#define _WX_QT_MENU_H_
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
class WXDLLIMPEXP_CORE wxMenu : public wxMenuBase
{
public:
wxMenu(long style = 0);
wxMenu(const wxString& title, long style = 0);
virtual QMenu *GetHandle() const;
protected:
virtual wxMenuItem *DoAppend(wxMenuItem *item);
virtual wxMenuItem *DoInsert(size_t pos, wxMenuItem *item);
virtual wxMenuItem *DoRemove(wxMenuItem *item);
private:
QMenu *m_qtMenu;
wxDECLARE_DYNAMIC_CLASS(wxMenu);
};
class WXDLLIMPEXP_CORE wxMenuBar : public wxMenuBarBase
{
public:
wxMenuBar();
wxMenuBar(long style);
wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long style = 0);
virtual bool Append(wxMenu *menu, const wxString& title);
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
virtual wxMenu *Remove(size_t pos);
virtual void EnableTop(size_t pos, bool enable);
virtual void SetMenuLabel(size_t pos, const wxString& label);
virtual wxString GetMenuLabel(size_t pos) const;
virtual QMenuBar *GetHandle() const;
virtual void Attach(wxFrame *frame);
virtual void Detach();
private:
QMenuBar *m_qtMenuBar;
wxDECLARE_DYNAMIC_CLASS(wxMenuBar);
};
#endif // _WX_QT_MENU_H_

50
include/wx/qt/menuitem.h Normal file
View File

@@ -0,0 +1,50 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/menuitem.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_MENUITEM_H_
#define _WX_QT_MENUITEM_H_
#include "wx/menuitem.h"
#include <QtWidgets/QAction>
class WXDLLIMPEXP_FWD_CORE wxBitmap;
class WXDLLIMPEXP_FWD_CORE wxMenu;
class WXDLLIMPEXP_CORE wxMenuItem : public wxMenuItemBase
{
public:
wxMenuItem(wxMenu *parentMenu = NULL,
int id = wxID_SEPARATOR,
const wxString& text = wxEmptyString,
const wxString& help = wxEmptyString,
wxItemKind kind = wxITEM_NORMAL,
wxMenu *subMenu = NULL);
virtual void SetItemLabel(const wxString& str);
virtual void SetCheckable(bool checkable);
virtual void Enable(bool enable = true);
virtual bool IsEnabled() const;
virtual void Check(bool check = true);
virtual bool IsChecked() const;
void SetBitmap(const wxBitmap& bitmap);
const wxBitmap& GetBitmap() const;
virtual QAction *GetHandle() const;
private:
// Qt is using an action instead of a menu item.
QAction *m_qtAction;
wxDECLARE_DYNAMIC_CLASS( wxMenuItem );
};
#endif // _WX_QT_MENUITEM_H_

48
include/wx/qt/minifram.h Normal file
View File

@@ -0,0 +1,48 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/minifram.h
// Purpose: wxMiniFrame class
// Author: Mariano Reingart
// Copyright: (c) 2014 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MINIFRAM_H_
#define _WX_MINIFRAM_H_
#include "wx/frame.h"
class WXDLLIMPEXP_CORE wxMiniFrame : public wxFrame
{
public:
wxMiniFrame() { }
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER,
const wxString& name = wxFrameNameStr)
{
return wxFrame::Create(parent, id, title, pos, size,
style | wxFRAME_TOOL_WINDOW | wxFRAME_NO_TASKBAR,
name);
}
wxMiniFrame(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER,
const wxString& name = wxFrameNameStr)
{
Create(parent, id, title, pos, size, style, name);
}
protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMiniFrame)
};
#endif
// _WX_MINIFRAM_H_

33
include/wx/qt/msgdlg.h Normal file
View File

@@ -0,0 +1,33 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/msgdlg.h
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_MSGDLG_H_
#define _WX_QT_MSGDLG_H_
#include "wx/msgdlg.h"
#include <QtWidgets/QMessageBox>
class WXDLLIMPEXP_CORE wxMessageDialog : public wxMessageDialogBase
{
public:
wxMessageDialog(wxWindow *parent, const wxString& message,
const wxString& caption = wxMessageBoxCaptionStr,
long style = wxOK|wxCENTRE,
const wxPoint& pos = wxDefaultPosition);
virtual ~wxMessageDialog();
// Reimplemented to translate return codes from Qt to wx
virtual int ShowModal();
virtual QMessageBox *GetHandle() const;
private:
QMessageBox *m_qtMessageBox;
};
#endif // _WX_QT_MSGDLG_H_

64
include/wx/qt/notebook.h Normal file
View File

@@ -0,0 +1,64 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/notebook.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_NOTEBOOK_H_
#define _WX_QT_NOTEBOOK_H_
#include <QtWidgets/QTabWidget>
class WXDLLIMPEXP_CORE wxNotebook : public wxNotebookBase
{
public:
wxNotebook();
wxNotebook(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxNotebookNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxNotebookNameStr);
virtual void SetPadding(const wxSize& padding);
virtual void SetTabSize(const wxSize& sz);
virtual bool SetPageText(size_t n, const wxString& strText);
virtual wxString GetPageText(size_t n) const;
virtual int GetPageImage(size_t n) const;
virtual bool SetPageImage(size_t n, int imageId);
virtual bool InsertPage(size_t n, wxWindow *page, const wxString& text,
bool bSelect = false, int imageId = -1);
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const;
int SetSelection(size_t nPage) { return DoSetSelection(nPage, SetSelection_SendEvent); }
int ChangeSelection(size_t nPage) { return DoSetSelection(nPage); }
virtual QTabWidget *GetHandle() const;
protected:
virtual wxWindow *DoRemovePage(size_t page);
int DoSetSelection(size_t nPage, int flags = 0);
private:
QTabWidget *m_qtTabWidget;
// internal array to store imageId for each page:
wxVector<int> m_images;
wxDECLARE_DYNAMIC_CLASS( wxNotebook );
};
#endif // _WX_QT_NOTEBOOK_H_

28
include/wx/qt/palette.h Normal file
View File

@@ -0,0 +1,28 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/palette.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_PALETTE_H_
#define _WX_QT_PALETTE_H_
class WXDLLIMPEXP_CORE wxPalette : public wxPaletteBase
{
public:
wxPalette();
wxPalette(int n, unsigned char *red, unsigned char *green, unsigned char *blue);
bool Create(int n, unsigned char *red, unsigned char *green, unsigned char *blue);
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
};
#endif // _WX_QT_PALETTE_H_

56
include/wx/qt/pen.h Normal file
View File

@@ -0,0 +1,56 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/pen.h
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_PEN_H_
#define _WX_QT_PEN_H_
#include <QtCore/Qt>
class QPen;
class WXDLLIMPEXP_CORE wxPen : public wxPenBase
{
public:
wxPen();
wxPen( const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID );
wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants")
wxPen(const wxColour& col, int width, int style);
bool operator==(const wxPen& pen) const;
bool operator!=(const wxPen& pen) const;
virtual void SetColour(const wxColour& col);
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b);
virtual void SetWidth(int width);
virtual void SetStyle(wxPenStyle style);
virtual void SetStipple(const wxBitmap& stipple);
virtual void SetDashes(int nb_dashes, const wxDash *dash);
virtual void SetJoin(wxPenJoin join);
virtual void SetCap(wxPenCap cap);
virtual wxColour GetColour() const;
virtual wxBitmap *GetStipple() const;
virtual wxPenStyle GetStyle() const;
virtual wxPenJoin GetJoin() const;
virtual wxPenCap GetCap() const;
virtual int GetWidth() const;
virtual int GetDashes(wxDash **ptr) const;
wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants")
void SetStyle(int style) { SetStyle((wxPenStyle)style); }
QPen GetHandle() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
};
#endif // _WX_QT_PEN_H_

23
include/wx/qt/popupwin.h Normal file
View File

@@ -0,0 +1,23 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/popupwin.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_POPUPWIN_H_
#define _WX_QT_POPUPWIN_H_
class WXDLLIMPEXP_CORE wxPopupWindow : public wxPopupWindowBase
{
public:
wxPopupWindow();
wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE);
protected:
private:
DECLARE_DYNAMIC_CLASS(wxPopupWindow)
};
#endif // _WX_QT_POPUPWIN_H_

56
include/wx/qt/printdlg.h Normal file
View File

@@ -0,0 +1,56 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/printdlg.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_PRINTDLG_H_
#define _WX_QT_PRINTDLG_H_
#include "wx/prntbase.h"
#include "wx/printdlg.h"
class WXDLLIMPEXP_CORE wxQtPrintNativeData: public wxPrintNativeDataBase
{
public:
wxQtPrintNativeData();
virtual bool TransferTo( wxPrintData &data );
virtual bool TransferFrom( const wxPrintData &data );
virtual bool IsOk() const;
};
class WXDLLIMPEXP_CORE wxQtPrintDialog : public wxPrintDialogBase
{
public:
wxQtPrintDialog(wxWindow *parent, wxPrintDialogData *data);
wxQtPrintDialog(wxWindow *parent, wxPrintData *data);
virtual wxPrintDialogData& GetPrintDialogData();
virtual wxPrintData& GetPrintData();
virtual wxDC *GetPrintDC();
protected:
private:
};
class WXDLLIMPEXP_CORE wxQtPageSetupDialog: public wxPageSetupDialogBase
{
public:
wxQtPageSetupDialog();
wxQtPageSetupDialog(wxWindow *parent, wxPageSetupDialogData *data = NULL);
bool Create(wxWindow *parent, wxPageSetupDialogData *data = NULL);
virtual wxPageSetupDialogData& GetPageSetupDialogData();
private:
};
#endif // _WX_QT_PRINTDLG_H_

42
include/wx/qt/printqt.h Normal file
View File

@@ -0,0 +1,42 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/printqt.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_PRINTQT_H_
#define _WX_QT_PRINTQT_H_
#include "wx/prntbase.h"
class WXDLLIMPEXP_CORE wxQtPrinter : public wxPrinterBase
{
public:
wxQtPrinter( wxPrintDialogData *data = NULL );
virtual bool Setup(wxWindow *parent);
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true);
virtual wxDC* PrintDialog(wxWindow *parent);
private:
};
class WXDLLIMPEXP_CORE wxQtPrintPreview : public wxPrintPreviewBase
{
public:
wxQtPrintPreview(wxPrintout *printout,
wxPrintout *printoutForPrinting = NULL,
wxPrintDialogData *data = NULL);
wxQtPrintPreview(wxPrintout *printout,
wxPrintout *printoutForPrinting,
wxPrintData *data);
virtual bool Print(bool interactive);
virtual void DetermineScaling();
protected:
};
#endif // _WX_QT_PRINTQT_H_

View File

@@ -0,0 +1,58 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/converter.h
// Purpose: Converter utility classes and functions
// Author: Peter Most, Kolya Kosenko
// Created: 02/28/10
// Copyright: (c) Peter Most
// (c) 2010 Kolya Kosenko
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CONVERTER_H_
#define _WX_QT_CONVERTER_H_
#include "wx/defs.h"
#include <QtCore/Qt>
// Rely on overloading and let the compiler pick the correct version, which makes
// them easier to use then to write wxQtConvertQtRectToWxRect() or wxQtConvertWxRectToQtRect()
class WXDLLIMPEXP_FWD_CORE wxPoint;
class QPoint;
wxPoint wxQtConvertPoint( const QPoint &point );
QPoint wxQtConvertPoint( const wxPoint &point );
class WXDLLIMPEXP_FWD_CORE wxRect;
class QRect;
wxRect wxQtConvertRect( const QRect &rect );
QRect wxQtConvertRect( const wxRect &rect );
class WXDLLIMPEXP_FWD_BASE wxString;
class QString;
wxString wxQtConvertString( const QString &str );
QString wxQtConvertString( const wxString &str );
#if wxUSE_DATETIME
class WXDLLIMPEXP_FWD_BASE wxDateTime;
class QDate;
wxDateTime wxQtConvertDate(const QDate& date);
QDate wxQtConvertDate(const wxDateTime& date);
#endif // wxUSE_DATETIME
class WXDLLIMPEXP_FWD_BASE wxSize;
class QSize;
wxSize wxQtConvertSize( const QSize &size );
QSize wxQtConvertSize( const wxSize &size );
Qt::Orientation wxQtConvertOrientation( long style, wxOrientation defaultOrientation );
wxOrientation wxQtConvertOrientation( Qt::Orientation );
wxKeyCode wxQtConvertKeyCode( int key, const Qt::KeyboardModifiers modifiers );
void wxQtFillKeyboardModifiers( Qt::KeyboardModifiers modifiers, wxKeyboardState *state );
int wxQtConvertKeyCode( int keyCode, int modifiers, Qt::KeyboardModifiers &qtmodifiers );
#endif // _WX_QT_CONVERTER_H_

View File

@@ -0,0 +1,30 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/utils.h
// Purpose: utility classes and/or functions
// Author: Peter Most, Javier Torres
// Created: 15/05/10
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_UTILS_H_
#define _WX_QT_UTILS_H_
#include "wx/mousestate.h"
#include <QtCore/Qt>
void wxQtFillMouseButtons( Qt::MouseButtons buttons, wxMouseState *state );
void wxMissingImplementation( const char fileName[], unsigned lineNumber,
const char feature[] );
#define wxMISSING_IMPLEMENTATION( feature )\
wxMissingImplementation( __FILE__, __LINE__, feature )
#define wxMISSING_FUNCTION() \
wxMISSING_IMPLEMENTATION( __WXFUNCTION__ )
// global function handle Qt objects destruction (just for debugging now)
void wxQtHandleDestroyedSignal(QObject *qobj = 0);
#endif // _WX_QT_UTILS_H_

View File

@@ -0,0 +1,332 @@
/////////////////////////////////////////////////////////////////////////////
// Name: include/wx/qt/winevent_qt.h
// Purpose: QWidget to wxWindow event handler
// Author: Javier Torres, Peter Most
// Modified by:
// Created: 21.06.10
// Copyright: (c) Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_EVENTSIGNALFORWARDER_H_
#define _WX_QT_EVENTSIGNALFORWARDER_H_
#include "wx/window.h"
#include "wx/qt/private/converter.h"
#include "wx/qt/private/utils.h"
#include <QtCore/QEvent>
#include <QtGui/QPaintEvent>
template< typename Handler >
class wxQtSignalHandler
{
protected:
wxQtSignalHandler( Handler *handler )
{
m_handler = handler;
}
void EmitEvent( wxEvent &event ) const
{
wxWindow *handler = GetHandler();
event.SetEventObject( handler );
handler->HandleWindowEvent( event );
}
virtual Handler *GetHandler() const
{
return m_handler;
}
private:
Handler *m_handler;
};
template < typename Widget, typename Handler >
class wxQtEventSignalHandler : public Widget, public wxQtSignalHandler< Handler >
{
public:
wxQtEventSignalHandler( wxWindow *parent, Handler *handler )
: Widget( parent != NULL ? parent->GetHandle() : NULL )
, wxQtSignalHandler< Handler >( handler )
{
// Set immediatelly as it is used to check if wxWindow is alive
wxWindow::QtStoreWindowPointer( this, handler );
// Handle QWidget destruction signal AFTER it gets deleted
QObject::connect( this, &QObject::destroyed, this,
&wxQtEventSignalHandler::HandleDestroyedSignal );
}
void HandleDestroyedSignal()
{
wxQtHandleDestroyedSignal(this);
}
virtual Handler *GetHandler() const
{
// Only process the signal / event if the wxWindow is not destroyed
if ( !wxWindow::QtRetrieveWindowPointer( this ) )
{
wxLogDebug( wxT("%s win pointer is NULL (wxWindow is deleted)!"),
Widget::staticMetaObject.className()
);
return NULL;
}
else
return wxQtSignalHandler< Handler >::GetHandler();
}
protected:
/* Not implemented here: wxHelpEvent, wxIdleEvent wxJoystickEvent,
* wxMouseCaptureLostEvent, wxMouseCaptureChangedEvent,
* wxPowerEvent, wxScrollWinEvent, wxSysColourChangedEvent */
//wxActivateEvent
virtual void changeEvent ( QEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::changeEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleChangeEvent(this, event) )
Widget::changeEvent(event);
else
event->accept();
}
//wxCloseEvent
virtual void closeEvent ( QCloseEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::closeEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleCloseEvent(this, event) )
Widget::closeEvent(event);
else
event->accept();
}
//wxContextMenuEvent
virtual void contextMenuEvent ( QContextMenuEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::contextMenuEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleContextMenuEvent(this, event) )
Widget::contextMenuEvent(event);
else
event->accept();
}
//wxDropFilesEvent
//virtual void dropEvent ( QDropEvent * event ) { }
//wxMouseEvent
virtual void enterEvent ( QEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::enterEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleEnterEvent(this, event) )
Widget::enterEvent(event);
else
event->accept();
}
//wxFocusEvent.
virtual void focusInEvent ( QFocusEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::focusInEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleFocusEvent(this, event) )
Widget::focusInEvent(event);
else
event->accept();
}
//wxFocusEvent.
virtual void focusOutEvent ( QFocusEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::focusOutEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleFocusEvent(this, event) )
Widget::focusOutEvent(event);
else
event->accept();
}
//wxShowEvent
virtual void hideEvent ( QHideEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::hideEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleShowEvent(this, event) )
Widget::hideEvent(event);
else
event->accept();
}
//wxKeyEvent
virtual void keyPressEvent ( QKeyEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::keyPressEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleKeyEvent(this, event) )
Widget::keyPressEvent(event);
else
event->accept();
}
//wxKeyEvent
virtual void keyReleaseEvent ( QKeyEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::keyReleaseEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleKeyEvent(this, event) )
Widget::keyReleaseEvent(event);
else
event->accept();
}
//wxMouseEvent
virtual void leaveEvent ( QEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::leaveEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleEnterEvent(this, event) )
Widget::leaveEvent(event);
else
event->accept();
}
//wxMouseEvent
virtual void mouseDoubleClickEvent ( QMouseEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::mouseDoubleClickEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
Widget::mouseDoubleClickEvent(event);
else
event->accept();
}
//wxMouseEvent
virtual void mouseMoveEvent ( QMouseEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::mouseMoveEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
Widget::mouseMoveEvent(event);
else
event->accept();
}
//wxMouseEvent
virtual void mousePressEvent ( QMouseEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::mousePressEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
Widget::mousePressEvent(event);
else
event->accept();
}
//wxMouseEvent
virtual void mouseReleaseEvent ( QMouseEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::mouseReleaseEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
Widget::mouseReleaseEvent(event);
else
event->accept();
}
//wxMoveEvent
virtual void moveEvent ( QMoveEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::moveEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleMoveEvent(this, event) )
Widget::moveEvent(event);
else
event->accept();
}
//wxEraseEvent then wxPaintEvent
virtual void paintEvent ( QPaintEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::paintEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandlePaintEvent(this, event) )
Widget::paintEvent(event);
else
event->accept();
}
//wxSizeEvent
virtual void resizeEvent ( QResizeEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::resizeEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleResizeEvent(this, event) )
Widget::resizeEvent(event);
else
event->accept();
}
//wxShowEvent
virtual void showEvent ( QShowEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::showEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleShowEvent(this, event) )
Widget::showEvent(event);
else
event->accept();
}
//wxMouseEvent
virtual void wheelEvent ( QWheelEvent * event )
{
if ( !this->GetHandler() )
wxLogDebug( wxT("%s::wheelEvent for invalid handler!"),
Widget::staticMetaObject.className() );
else if ( !this->GetHandler()->QtHandleWheelEvent(this, event) )
Widget::wheelEvent(event);
else
event->accept();
}
/* Unused Qt events
virtual void actionEvent ( QActionEvent * event ) { }
virtual void dragEnterEvent ( QDragEnterEvent * event ) { }
virtual void dragLeaveEvent ( QDragLeaveEvent * event ) { }
virtual void dragMoveEvent ( QDragMoveEvent * event ) { }
virtual void inputMethodEvent ( QInputMethodEvent * event ) { }
virtual bool macEvent ( EventHandlerCallRef caller, EventRef event ) { }
virtual bool qwsEvent ( QWSEvent * event ) { }
virtual void tabletEvent ( QTabletEvent * event ) { }
virtual bool winEvent ( MSG * message, long * result ) { }
virtual bool x11Event ( XEvent * event ) { } */
};
#endif

95
include/wx/qt/radiobox.h Normal file
View File

@@ -0,0 +1,95 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/radiobox.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_RADIOBOX_H_
#define _WX_QT_RADIOBOX_H_
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QVBoxLayout>
class WXDLLIMPEXP_CORE wxRadioBox : public wxControl, public wxRadioBoxBase
{
public:
wxRadioBox();
wxRadioBox(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
int majorDim = 0,
long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
wxRadioBox(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim = 0,
long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
int majorDim = 0,
long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim = 0,
long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
using wxWindowBase::Show;
using wxWindowBase::Enable;
using wxRadioBoxBase::GetDefaultBorder;
virtual bool Enable(unsigned int n, bool enable = true);
virtual bool Show(unsigned int n, bool show = true);
virtual bool IsItemEnabled(unsigned int n) const;
virtual bool IsItemShown(unsigned int n) const;
virtual unsigned int GetCount() const;
virtual wxString GetString(unsigned int n) const;
virtual void SetString(unsigned int n, const wxString& s);
virtual void SetSelection(int n);
virtual int GetSelection() const;
virtual QGroupBox *GetHandle() const;
private:
// The 'visual' group box:
QGroupBox *m_qtGroupBox;
// Handles the mutual exclusion of buttons:
QButtonGroup *m_qtButtonGroup;
// Autofit layout for buttons (either vert. or horiz.):
QBoxLayout *m_qtBoxLayout;
DECLARE_DYNAMIC_CLASS(wxRadioBox)
};
#endif // _WX_QT_RADIOBOX_H_

48
include/wx/qt/radiobut.h Normal file
View File

@@ -0,0 +1,48 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/radiobut.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_RADIOBUT_H_
#define _WX_QT_RADIOBUT_H_
#include <QtWidgets/QRadioButton>
class WXDLLIMPEXP_CORE wxRadioButton : public wxControl
{
public:
wxRadioButton();
wxRadioButton( wxWindow *parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxRadioButtonNameStr );
bool Create( wxWindow *parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxRadioButtonNameStr );
virtual void SetValue(bool value);
virtual bool GetValue() const;
virtual QRadioButton *GetHandle() const;
protected:
private:
QRadioButton *m_qtRadioButton;
wxDECLARE_DYNAMIC_CLASS( wxRadioButton );
};
#endif // _WX_QT_RADIOBUT_H_

86
include/wx/qt/region.h Normal file
View File

@@ -0,0 +1,86 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/region.h
// Purpose: header for wxRegion
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_REGION_H_
#define _WX_QT_REGION_H_
#include <QtGui/QRegion>
class WXDLLIMPEXP_CORE wxRegion : public wxRegionBase
{
public:
wxRegion();
wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
wxRegion(const wxRect& rect);
wxRegion(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
wxRegion(const wxBitmap& bmp);
wxRegion(const wxBitmap& bmp, const wxColour& transp, int tolerance = 0);
virtual bool IsEmpty() const;
virtual void Clear();
virtual QRegion GetHandle() const;
virtual void QtSetRegion(QRegion region); // Hangs on to this region
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
virtual bool DoIsEqual(const wxRegion& region) const;
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const;
virtual wxRegionContain DoContainsRect(const wxRect& rect) const;
virtual bool DoOffset(wxCoord x, wxCoord y);
virtual bool DoUnionWithRect(const wxRect& rect);
virtual bool DoUnionWithRegion(const wxRegion& region);
virtual bool DoIntersect(const wxRegion& region);
virtual bool DoSubtract(const wxRegion& region);
virtual bool DoXor(const wxRegion& region);
private:
};
class WXDLLIMPEXP_CORE wxRegionIterator: public wxObject
{
public:
wxRegionIterator();
wxRegionIterator(const wxRegion& region);
wxRegionIterator(const wxRegionIterator& ri);
~wxRegionIterator();
wxRegionIterator& operator=(const wxRegionIterator& ri);
void Reset();
void Reset(const wxRegion& region);
bool HaveRects() const;
operator bool () const;
wxRegionIterator& operator ++ ();
wxRegionIterator operator ++ (int);
wxCoord GetX() const;
wxCoord GetY() const;
wxCoord GetW() const;
wxCoord GetWidth() const;
wxCoord GetH() const;
wxCoord GetHeight() const;
wxRect GetRect() const;
private:
QVector< QRect > *m_qtRects;
int m_pos;
};
#endif // _WX_QT_REGION_H_

54
include/wx/qt/scrolbar.h Normal file
View File

@@ -0,0 +1,54 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/scrolbar.h
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_SCROLBAR_H_
#define _WX_QT_SCROLBAR_H_
#include "wx/scrolbar.h"
#include <QtWidgets/QScrollBar>
class WXDLLIMPEXP_FWD_CORE wxQtScrollBar;
class WXDLLIMPEXP_CORE wxScrollBar : public wxScrollBarBase
{
public:
wxScrollBar();
wxScrollBar( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxScrollBarNameStr );
bool Create( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxScrollBarNameStr );
virtual int GetThumbPosition() const;
virtual int GetThumbSize() const;
virtual int GetPageSize() const;
virtual int GetRange() const;
virtual void SetThumbPosition(int viewStart);
virtual void SetScrollbar(int position, int thumbSize,
int range, int pageSize,
bool refresh = true);
virtual QScrollBar* GetHandle() const;
private:
QScrollBar *m_qtScrollBar;
DECLARE_DYNAMIC_CLASS(wxScrollBar)
};
#endif // _WX_QT_SCROLBAR_H_

61
include/wx/qt/slider.h Normal file
View File

@@ -0,0 +1,61 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/slider.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_SLIDER_H_
#define _WX_QT_SLIDER_H_
#include <QtWidgets/QSlider>
class WXDLLIMPEXP_CORE wxSlider : public wxSliderBase
{
public:
wxSlider();
wxSlider(wxWindow *parent,
wxWindowID id,
int value, int minValue, int maxValue,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSliderNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
int value, int minValue, int maxValue,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSliderNameStr);
virtual int GetValue() const;
virtual void SetValue(int value);
virtual void SetRange(int minValue, int maxValue);
virtual int GetMin() const;
virtual int GetMax() const;
virtual void DoSetTickFreq(int freq);
virtual int GetTickFreq() const;
virtual void SetLineSize(int lineSize);
virtual void SetPageSize(int pageSize);
virtual int GetLineSize() const;
virtual int GetPageSize() const;
virtual void SetThumbLength(int lenPixels);
virtual int GetThumbLength() const;
virtual QSlider *GetHandle() const;
private:
QSlider *m_qtSlider;
wxDECLARE_DYNAMIC_CLASS( wxSlider );
};
#endif // _WX_QT_SLIDER_H_

43
include/wx/qt/spinbutt.h Normal file
View File

@@ -0,0 +1,43 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/spinbutt.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_SPINBUTT_H_
#define _WX_QT_SPINBUTT_H_
#include "wx/spinbutt.h"
#include <QtWidgets/QSpinBox>
class WXDLLIMPEXP_CORE wxSpinButton : public wxSpinButtonBase
{
public:
wxSpinButton();
wxSpinButton(wxWindow *parent,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_VERTICAL,
const wxString& name = wxSPIN_BUTTON_NAME);
bool Create(wxWindow *parent,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_VERTICAL,
const wxString& name = wxSPIN_BUTTON_NAME);
virtual int GetValue() const;
virtual void SetValue(int val);
virtual QSpinBox *GetHandle() const;
private:
QSpinBox *m_qtSpinBox;
wxDECLARE_DYNAMIC_CLASS( wxSpinButton );
};
#endif // _WX_QT_SPINBUTT_H_

127
include/wx/qt/spinctrl.h Normal file
View File

@@ -0,0 +1,127 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/spinctrl.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_SPINCTRL_H_
#define _WX_QT_SPINCTRL_H_
#include <QtWidgets/QSpinBox>
#include <QtWidgets/QDoubleSpinBox>
// Take advantage of the Qt compile time polymorphy and use a template to avoid
// copy&paste code for the usage of QSpinBox/QDoubleSpinBox.
template < typename T, typename Widget >
class WXDLLIMPEXP_CORE wxSpinCtrlQt : public wxSpinCtrlBase
{
public:
wxSpinCtrlQt();
wxSpinCtrlQt( wxWindow *parent, wxWindowID id, const wxString& value,
const wxPoint& pos, const wxSize& size, long style,
T min, T max, T initial, T inc,
const wxString& name );
bool Create( wxWindow *parent, wxWindowID id, const wxString& value,
const wxPoint& pos, const wxSize& size, long style,
T min, T max, T initial, T inc,
const wxString& name );
virtual void SetValue(const wxString&) {}
virtual void SetSnapToTicks(bool snap_to_ticks);
virtual bool GetSnapToTicks() const;
virtual void SetSelection(long from, long to);
virtual void SetValue(T val);
void SetRange(T minVal, T maxVal);
void SetIncrement(T inc);
T GetValue() const;
T GetMin() const;
T GetMax() const;
T GetIncrement() const;
virtual Widget *GetHandle() const;
protected:
Widget *m_qtSpinBox;
};
class WXDLLIMPEXP_CORE wxSpinCtrl : public wxSpinCtrlQt< int, QSpinBox >
{
public:
wxSpinCtrl();
wxSpinCtrl(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
const wxString& name = wxT("wxSpinCtrl"));
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
const wxString& name = wxT("wxSpinCtrl"));
virtual int GetBase() const wxOVERRIDE { return m_base; }
virtual bool SetBase(int base) wxOVERRIDE;
virtual void SetValue(const wxString & val);
virtual void SetValue(int val) { wxSpinCtrlQt::SetValue(val); }
private:
// Common part of all ctors.
void Init()
{
m_base = 10;
}
int m_base;
DECLARE_DYNAMIC_CLASS( wxSpinCtrl )
};
class WXDLLIMPEXP_CORE wxSpinCtrlDouble : public wxSpinCtrlQt< double, QDoubleSpinBox >
{
public:
wxSpinCtrlDouble();
wxSpinCtrlDouble(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
const wxString& name = wxT("wxSpinCtrlDouble"));
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
const wxString& name = wxT("wxSpinCtrlDouble"));
void SetDigits(unsigned digits);
unsigned GetDigits() const;
virtual int GetBase() const wxOVERRIDE { return 10; }
virtual bool SetBase(int WXUNUSED(base)) wxOVERRIDE { return false; }
virtual void SetValue(const wxString & val);
virtual void SetValue(double val) { wxSpinCtrlQt::SetValue(val); }
private:
wxDECLARE_DYNAMIC_CLASS( wxSpinCtrlDouble );
};
#endif // _WX_QT_SPINCTRL_H_

47
include/wx/qt/statbmp.h Normal file
View File

@@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/statbmp.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_STATBMP_H_
#define _WX_QT_STATBMP_H_
#include <QtWidgets/QLabel>
class WXDLLIMPEXP_CORE wxStaticBitmap : public wxStaticBitmapBase
{
public:
wxStaticBitmap();
wxStaticBitmap( wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticBitmapNameStr );
bool Create( wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticBitmapNameStr);
virtual void SetIcon(const wxIcon& icon);
virtual void SetBitmap(const wxBitmap& bitmap);
virtual wxBitmap GetBitmap() const;
virtual wxIcon GetIcon() const;
virtual QLabel *GetHandle() const;
protected:
private:
QLabel *m_qtLabel;
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
};
#endif // _WX_QT_STATBMP_H_

44
include/wx/qt/statbox.h Normal file
View File

@@ -0,0 +1,44 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/statbox.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_STATBOX_H_
#define _WX_QT_STATBOX_H_
#include <QtWidgets/QGroupBox>
class WXDLLIMPEXP_CORE wxStaticBox : public wxStaticBoxBase
{
public:
wxStaticBox();
wxStaticBox(wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticBoxNameStr);
virtual void GetBordersForSizer(int *borderTop, int *borderOther) const;
virtual QGroupBox *GetHandle() const;
protected:
private:
QGroupBox *m_qtGroupBox;
wxDECLARE_DYNAMIC_CLASS( wxStaticBox );
};
#endif // _WX_QT_STATBOX_H_

40
include/wx/qt/statline.h Normal file
View File

@@ -0,0 +1,40 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/statline.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_STATLINE_H_
#define _WX_QT_STATLINE_H_
#include <QtWidgets/QFrame>
class WXDLLIMPEXP_CORE wxStaticLine : public wxStaticLineBase
{
public:
wxStaticLine();
wxStaticLine( wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLI_HORIZONTAL,
const wxString &name = wxStaticLineNameStr );
bool Create( wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLI_HORIZONTAL,
const wxString &name = wxStaticLineNameStr );
virtual QFrame *GetHandle() const;
private:
QFrame *m_qtFrame;
wxDECLARE_DYNAMIC_CLASS( wxStaticLine );
};
#endif // _WX_QT_STATLINE_H_

42
include/wx/qt/stattext.h Normal file
View File

@@ -0,0 +1,42 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/stattext.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_STATTEXT_H_
#define _WX_QT_STATTEXT_H_
#include <QtWidgets/QLabel>
class WXDLLIMPEXP_CORE wxStaticText : public wxStaticTextBase
{
public:
wxStaticText();
wxStaticText(wxWindow *parent,
wxWindowID id,
const wxString &label,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxString &name = wxStaticTextNameStr );
bool Create(wxWindow *parent,
wxWindowID id,
const wxString &label,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxString &name = wxStaticTextNameStr );
void SetLabel(const wxString& label);
QLabel *GetHandle() const;
private:
QLabel *m_qtLabel;
wxDECLARE_DYNAMIC_CLASS( wxStaticText );
};
#endif // _WX_QT_STATTEXT_H_

51
include/wx/qt/statusbar.h Normal file
View File

@@ -0,0 +1,51 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/statusbar.h
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_STATUSBAR_H_
#define _WX_QT_STATUSBAR_H_
#include "wx/statusbr.h"
#include <QtWidgets/QLabel>
#include <QtWidgets/QStatusBar>
class WXDLLIMPEXP_CORE wxStatusBar : public wxStatusBarBase
{
public:
wxStatusBar() {}
wxStatusBar(wxWindow *parent, wxWindowID winid = wxID_ANY,
long style = wxSTB_DEFAULT_STYLE,
const wxString& name = wxStatusBarNameStr);
bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY,
long style = wxSTB_DEFAULT_STYLE,
const wxString& name = wxStatusBarNameStr);
virtual bool GetFieldRect(int i, wxRect& rect) const;
virtual void SetMinHeight(int height);
virtual int GetBorderX() const;
virtual int GetBorderY() const;
virtual void Refresh( bool eraseBackground = true,
const wxRect *rect = (const wxRect *) NULL );
virtual QStatusBar *GetHandle() const;
protected:
virtual void DoUpdateStatusText(int number);
private:
void Init();
void UpdateFields();
QStatusBar *m_qtStatusBar;
QList< QLabel* > m_qtPanes;
DECLARE_DYNAMIC_CLASS( wxStatusBar )
};
#endif // _WX_QT_STATUSBAR_H_

34
include/wx/qt/taskbar.h Normal file
View File

@@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/taskbar.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_TASKBAR_H_
#define _WX_QT_TASKBAR_H_
#include <QtWidgets/QSystemTrayIcon>
class WXDLLIMPEXP_CORE wxTaskBarIcon : public wxTaskBarIconBase
{
public:
wxTaskBarIcon(wxTaskBarIconType iconType = wxTBI_DEFAULT_TYPE);
// Accessors
bool IsOk() const { return false; }
bool IsIconInstalled() const { return false; }
// Operations
virtual bool SetIcon(const wxIcon& icon,
const wxString& tooltip = wxEmptyString);
virtual bool RemoveIcon();
virtual bool PopupMenu(wxMenu *menu);
private:
QSystemTrayIcon m_qtSystemTrayIcon;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxTaskBarIcon)
};
#endif // _WX_QT_TASKBAR_H_

79
include/wx/qt/textctrl.h Normal file
View File

@@ -0,0 +1,79 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/textctrl.h
// Author: Mariano Reingart, Peter Most
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_TEXTCTRL_H_
#define _WX_QT_TEXTCTRL_H_
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QTextEdit>
class WXDLLIMPEXP_CORE wxTextCtrl : public wxTextCtrlBase
{
public:
wxTextCtrl();
wxTextCtrl(wxWindow *parent,
wxWindowID id,
const wxString &value = wxEmptyString,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString &name = wxTextCtrlNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString &value = wxEmptyString,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString &name = wxTextCtrlNameStr);
virtual int GetLineLength(long lineNo) const;
virtual wxString GetLineText(long lineNo) const;
virtual int GetNumberOfLines() const;
virtual bool IsModified() const;
virtual void MarkDirty();
virtual void DiscardEdits();
virtual bool SetStyle(long start, long end, const wxTextAttr& style);
virtual bool GetStyle(long position, wxTextAttr& style);
virtual bool SetDefaultStyle(const wxTextAttr& style);
virtual long XYToPosition(long x, long y) const;
virtual bool PositionToXY(long pos, long *x, long *y) const;
virtual void ShowPosition(long pos);
virtual void SetInsertionPoint(long pos);
virtual long GetInsertionPoint() const;
virtual void SetSelection( long from, long to );
virtual void GetSelection(long *from, long *to) const;
virtual wxString DoGetValue() const;
virtual void DoSetValue(const wxString &text, int flags = 0);
virtual void WriteText(const wxString& text);
virtual QWidget *GetHandle() const;
protected:
virtual wxSize DoGetBestSize() const;
virtual bool DoLoadFile(const wxString& file, int fileType);
virtual bool DoSaveFile(const wxString& file, int fileType);
virtual QScrollArea *QtGetScrollBarsContainer() const;
private:
QLineEdit *m_qtLineEdit;
QTextEdit *m_qtTextEdit;
wxDECLARE_DYNAMIC_CLASS( wxTextCtrl );
};
#endif // _WX_QT_TEXTCTRL_H_

48
include/wx/qt/textentry.h Normal file
View File

@@ -0,0 +1,48 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/textentry.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_TEXTENTRY_H_
#define _WX_QT_TEXTENTRY_H_
class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase
{
public:
wxTextEntry();
virtual void WriteText(const wxString& text);
virtual void Remove(long from, long to);
virtual void Copy();
virtual void Cut();
virtual void Paste();
virtual void Undo();
virtual void Redo();
virtual bool CanUndo() const;
virtual bool CanRedo() const;
virtual void SetInsertionPoint(long pos);
virtual long GetInsertionPoint() const;
virtual long GetLastPosition() const;
virtual void SetSelection(long from, long to);
virtual void GetSelection(long *from, long *to) const;
virtual bool IsEditable() const;
virtual void SetEditable(bool editable);
protected:
virtual wxString DoGetValue() const;
virtual void DoSetValue(const wxString& value, int flags=0);
virtual wxWindow *GetEditableWindow();
private:
};
#endif // _WX_QT_TEXTENTRY_H_

78
include/wx/qt/tglbtn.h Normal file
View File

@@ -0,0 +1,78 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/tglbtn.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_TGLBTN_H_
#define _WX_QT_TGLBTN_H_
#include "wx/tglbtn.h"
extern WXDLLIMPEXP_DATA_CORE(const char) wxCheckBoxNameStr[];
class WXDLLIMPEXP_CORE wxBitmapToggleButton: public wxToggleButtonBase
{
public:
wxBitmapToggleButton();
wxBitmapToggleButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
virtual void SetValue(bool state);
virtual bool GetValue() const;
virtual QPushButton *GetHandle() const;
private:
DECLARE_DYNAMIC_CLASS(wxBitmapToggleButton)
};
class WXDLLIMPEXP_CORE wxToggleButton : public wxToggleButtonBase
{
public:
wxToggleButton();
wxToggleButton(wxWindow *parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
virtual void SetValue(bool state);
virtual bool GetValue() const;
virtual QPushButton *GetHandle() const;
private:
};
#endif // _WX_QT_TGLBTN_H_

39
include/wx/qt/timer.h Normal file
View File

@@ -0,0 +1,39 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/timer.h
// Author: Javier Torres
// Copyright: (c) Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_TIMER_H_
#define _WX_QT_TIMER_H_
#if wxUSE_TIMER
#include "wx/private/timer.h"
#include <QtCore/QObject>
//-----------------------------------------------------------------------------
// wxTimer
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxQtTimerImpl : public wxTimerImpl, QObject
{
public:
wxQtTimerImpl( wxTimer* timer );
virtual bool Start( int millisecs = -1, bool oneShot = false );
virtual void Stop();
virtual bool IsRunning() const;
protected:
virtual void timerEvent( QTimerEvent * event );
private:
int m_timerId;
};
#endif // wxUSE_TIMER
#endif // _WX_QT_TIMER_H_

77
include/wx/qt/toolbar.h Normal file
View File

@@ -0,0 +1,77 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/toolbar.h
// Author: Sean D'Epagnier
// Copyright: (c) Sean D'Epagnier 2014
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include <QtWidgets/QToolBar>
#ifndef _WX_QT_TOOLBAR_H_
#define _WX_QT_TOOLBAR_H_
class wxQtToolBar;
class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
{
public:
wxToolBar() { Init(); }
wxToolBar(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER | wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr)
{
Init();
Create(parent, id, pos, size, style, name);
}
virtual ~wxToolBar();
void Init();
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER | wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr);
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
virtual QToolBar *GetHandle() const;
virtual void SetWindowStyleFlag( long style );
virtual bool Realize() wxOVERRIDE;
virtual wxToolBarToolBase *CreateTool(int toolid,
const wxString& label,
const wxBitmap& bmpNormal,
const wxBitmap& bmpDisabled,
wxItemKind kind,
wxObject *clientData,
const wxString& shortHelp,
const wxString& longHelp);
virtual wxToolBarToolBase *CreateTool(wxControl *control,
const wxString& label);
protected:
QActionGroup* GetActionGroup(size_t pos);
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
private:
Qt::ToolButtonStyle GetButtonStyle();
QToolBar *m_qtToolBar;
DECLARE_DYNAMIC_CLASS(wxToolBar)
};
#endif // _WX_QT_TOOLBAR_H_

41
include/wx/qt/tooltip.h Normal file
View File

@@ -0,0 +1,41 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/tooltip.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_TOOLTIP_H_
#define _WX_QT_TOOLTIP_H_
#include "wx/object.h"
class WXDLLIMPEXP_CORE wxToolTip : public wxObject
{
public:
// controlling tooltip behaviour: globally change tooltip parameters
// enable or disable the tooltips globally
static void Enable(bool flag);
// set the delay after which the tooltip appears
static void SetDelay(long milliseconds);
// set the delay after which the tooltip disappears or how long the
// tooltip remains visible
static void SetAutoPop(long milliseconds);
// set the delay between subsequent tooltips to appear
static void SetReshow(long milliseconds);
wxToolTip(const wxString &tip);
void SetTip(const wxString& tip);
const wxString& GetTip() const;
// the window we're associated with
void SetWindow(wxWindow *win);
wxWindow *GetWindow() const { return m_window; }
private:
wxString m_text;
wxWindow* m_window; // main window we're associated with
};
#endif // _WX_QT_TOOLTIP_H_

51
include/wx/qt/toplevel.h Normal file
View File

@@ -0,0 +1,51 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/toplevel.h
// Purpose: declares wxTopLevelWindowNative class
// Author: Peter Most, Javier Torres
// Modified by:
// Created: 09.08.09
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_TOPLEVEL_H_
#define _WX_QT_TOPLEVEL_H_
class WXDLLIMPEXP_CORE wxTopLevelWindowQt : public wxTopLevelWindowBase
{
public:
wxTopLevelWindowQt();
wxTopLevelWindowQt(wxWindow *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
virtual void Maximize(bool maximize = true);
virtual void Restore();
virtual void Iconize(bool iconize = true);
virtual bool IsMaximized() const;
virtual bool IsIconized() const;
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
virtual bool IsFullScreen() const;
virtual void SetTitle(const wxString& title);
virtual wxString GetTitle() const;
virtual void SetIcons(const wxIconBundle& icons);
// Styles
virtual void SetWindowStyleFlag( long style );
virtual long GetWindowStyleFlag() const;
};
#endif // _WX_QT_TOPLEVEL_H_

141
include/wx/qt/treectrl.h Normal file
View File

@@ -0,0 +1,141 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/treectrl.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_TREECTRL_H_
#define _WX_QT_TREECTRL_H_
#include <QtWidgets/QTreeWidget>
class WXDLLIMPEXP_CORE wxTreeCtrl : public wxTreeCtrlBase
{
public:
wxTreeCtrl();
wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTreeCtrlNameStr);
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTreeCtrlNameStr);
virtual unsigned int GetCount() const;
virtual unsigned int GetIndent() const;
virtual void SetIndent(unsigned int indent);
virtual void SetImageList(wxImageList *imageList);
virtual void SetStateImageList(wxImageList *imageList);
virtual wxString GetItemText(const wxTreeItemId& item) const;
virtual int GetItemImage(const wxTreeItemId& item,
wxTreeItemIcon which = wxTreeItemIcon_Normal) const;
virtual wxTreeItemData *GetItemData(const wxTreeItemId& item) const;
virtual wxColour GetItemTextColour(const wxTreeItemId& item) const;
virtual wxColour GetItemBackgroundColour(const wxTreeItemId& item) const;
virtual wxFont GetItemFont(const wxTreeItemId& item) const;
virtual void SetItemText(const wxTreeItemId& item, const wxString& text);
virtual void SetItemImage(const wxTreeItemId& item,
int image,
wxTreeItemIcon which = wxTreeItemIcon_Normal);
virtual void SetItemData(const wxTreeItemId& item, wxTreeItemData *data);
virtual void SetItemHasChildren(const wxTreeItemId& item, bool has = true);
virtual void SetItemBold(const wxTreeItemId& item, bool bold = true);
virtual void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = true);
virtual void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
virtual void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col);
virtual void SetItemFont(const wxTreeItemId& item, const wxFont& font);
virtual bool IsVisible(const wxTreeItemId& item) const;
virtual bool ItemHasChildren(const wxTreeItemId& item) const;
virtual bool IsExpanded(const wxTreeItemId& item) const;
virtual bool IsSelected(const wxTreeItemId& item) const;
virtual bool IsBold(const wxTreeItemId& item) const;
virtual size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = true) const;
virtual wxTreeItemId GetRootItem() const;
virtual wxTreeItemId GetSelection() const;
virtual size_t GetSelections(wxArrayTreeItemIds& selections) const;
virtual void SetFocusedItem(const wxTreeItemId& item);
virtual void ClearFocusedItem();
virtual wxTreeItemId GetFocusedItem() const;
virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const;
virtual wxTreeItemId GetFirstChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
virtual wxTreeItemId GetNextChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
virtual wxTreeItemId GetLastChild(const wxTreeItemId& item) const;
virtual wxTreeItemId GetNextSibling(const wxTreeItemId& item) const;
virtual wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const;
virtual wxTreeItemId GetFirstVisibleItem() const;
virtual wxTreeItemId GetNextVisible(const wxTreeItemId& item) const;
virtual wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const;
virtual wxTreeItemId AddRoot(const wxString& text,
int image = -1, int selImage = -1,
wxTreeItemData *data = NULL);
virtual void Delete(const wxTreeItemId& item);
virtual void DeleteChildren(const wxTreeItemId& item);
virtual void DeleteAllItems();
virtual void Expand(const wxTreeItemId& item);
virtual void Collapse(const wxTreeItemId& item);
virtual void CollapseAndReset(const wxTreeItemId& item);
virtual void Toggle(const wxTreeItemId& item);
virtual void Unselect();
virtual void UnselectAll();
virtual void SelectItem(const wxTreeItemId& item, bool select = true);
virtual void SelectChildren(const wxTreeItemId& parent);
virtual void EnsureVisible(const wxTreeItemId& item);
virtual void ScrollTo(const wxTreeItemId& item);
virtual wxTextCtrl *EditLabel(const wxTreeItemId& item, wxClassInfo* textCtrlClass = CLASSINFO(wxTextCtrl));
virtual wxTextCtrl *GetEditControl() const;
virtual void EndEditLabel(const wxTreeItemId& item, bool discardChanges = false);
virtual void SortChildren(const wxTreeItemId& item);
virtual bool GetBoundingRect(const wxTreeItemId& item, wxRect& rect, bool textOnly = false) const;
virtual QTreeWidget *GetHandle() const;
protected:
virtual int DoGetItemState(const wxTreeItemId& item) const;
virtual void DoSetItemState(const wxTreeItemId& item, int state);
virtual wxTreeItemId DoInsertItem(const wxTreeItemId& parent,
size_t pos,
const wxString& text,
int image, int selImage,
wxTreeItemData *data);
virtual wxTreeItemId DoInsertAfter(const wxTreeItemId& parent,
const wxTreeItemId& idPrevious,
const wxString& text,
int image = -1, int selImage = -1,
wxTreeItemData *data = NULL);
virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags) const;
private:
QTreeWidget *m_qtTreeWidget;
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
};
#endif // _WX_QT_TREECTRL_H_

218
include/wx/qt/window.h Normal file
View File

@@ -0,0 +1,218 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/window.h
// Purpose: wxWindow class
// Author: Peter Most, Javier Torres, Mariano Reingart
// Created: 09/08/09
// Copyright: (c) 2009 wxWidgets dev team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_WINDOW_H_
#define _WX_QT_WINDOW_H_
#include <QtWidgets/QWidget>
#include <QtWidgets/QScrollArea>
class WXDLLIMPEXP_FWD_CORE wxScrollBar;
class WXDLLIMPEXP_FWD_CORE wxQtShortcutHandler;
/* wxQt specific notes:
*
* Remember to implement the Qt object getters on all subclasses:
* - GetHandle() returns the Qt object
* - QtGetScrollBarsContainer() returns the widget where scrollbars are placed
* For example, for wxFrame, GetHandle() is the QMainWindow,
* QtGetScrollBarsContainer() is the central widget and QtGetContainer() is a widget
* in a layout inside the central widget that also contains the scrollbars.
* Return 0 from QtGetScrollBarsContainer() to disable SetScrollBar() and friends
* for wxWindow subclasses.
*
*
* Event handling is achieved by using the template class wxQtEventForwarder
* found in winevent_qt.(h|cpp) to send all Qt events here to QtHandleXXXEvent()
* methods. All these methods receive the Qt event and the handler. This is
* done because events of the containers (the scrolled part of the window) are
* sent to the same wxWindow instance, that must be able to differenciate them
* as some events need different handling (paintEvent) depending on that.
* We pass the QWidget pointer to all event handlers for consistency.
*/
class WXDLLIMPEXP_CORE wxWindowQt : public wxWindowBase
{
public:
wxWindowQt();
~wxWindowQt();
wxWindowQt(wxWindowQt *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
bool Create(wxWindowQt *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
// Used by all window classes in the widget creation process.
void PostCreation( bool generic = true );
void AddChild( wxWindowBase *child );
virtual bool Show( bool show = true );
virtual void SetLabel(const wxString& label);
virtual wxString GetLabel() const;
virtual void DoEnable( bool enable );
virtual void SetFocus();
// Parent/Child:
static void QtReparent( QWidget *child, QWidget *parent );
virtual bool Reparent( wxWindowBase *newParent );
// Z-order
virtual void Raise();
virtual void Lower();
// move the mouse to the specified position
virtual void WarpPointer(int x, int y);
virtual void Update();
virtual void Refresh( bool eraseBackground = true,
const wxRect *rect = (const wxRect *) NULL );
virtual bool SetFont(const wxFont& font);
// get the (average) character size for the current font
virtual int GetCharHeight() const;
virtual int GetCharWidth() const;
virtual void SetScrollbar( int orient,
int pos,
int thumbvisible,
int range,
bool refresh = true );
virtual void SetScrollPos( int orient, int pos, bool refresh = true );
virtual int GetScrollPos( int orient ) const;
virtual int GetScrollThumb( int orient ) const;
virtual int GetScrollRange( int orient ) const;
// scroll window to the specified position
virtual void ScrollWindow( int dx, int dy,
const wxRect* rect = NULL );
// Styles
virtual void SetWindowStyleFlag( long style );
virtual void SetExtraStyle( long exStyle );
virtual bool SetBackgroundStyle(wxBackgroundStyle style);
virtual bool IsTransparentBackgroundSupported(wxString* reason = NULL) const;
virtual bool SetTransparent(wxByte alpha);
virtual bool CanSetTransparent() { return true; }
virtual WXWidget GetHandle() const;
virtual void SetDropTarget( wxDropTarget *dropTarget );
#if wxUSE_ACCEL
// accelerators
// ------------
virtual void SetAcceleratorTable( const wxAcceleratorTable& accel );
#endif // wxUSE_ACCEL
// wxQt implementation internals:
virtual QPicture *QtGetPicture() const;
QPainter *QtGetPainter();
virtual bool QtHandlePaintEvent ( QWidget *handler, QPaintEvent *event );
virtual bool QtHandleResizeEvent ( QWidget *handler, QResizeEvent *event );
virtual bool QtHandleWheelEvent ( QWidget *handler, QWheelEvent *event );
virtual bool QtHandleKeyEvent ( QWidget *handler, QKeyEvent *event );
virtual bool QtHandleMouseEvent ( QWidget *handler, QMouseEvent *event );
virtual bool QtHandleEnterEvent ( QWidget *handler, QEvent *event );
virtual bool QtHandleMoveEvent ( QWidget *handler, QMoveEvent *event );
virtual bool QtHandleShowEvent ( QWidget *handler, QEvent *event );
virtual bool QtHandleChangeEvent ( QWidget *handler, QEvent *event );
virtual bool QtHandleCloseEvent ( QWidget *handler, QCloseEvent *event );
virtual bool QtHandleContextMenuEvent ( QWidget *handler, QContextMenuEvent *event );
virtual bool QtHandleFocusEvent ( QWidget *handler, QFocusEvent *event );
static void QtStoreWindowPointer( QWidget *widget, const wxWindowQt *window );
static wxWindowQt *QtRetrieveWindowPointer( const QWidget *widget );
#if wxUSE_ACCEL
virtual void QtHandleShortcut ( int command );
#endif // wxUSE_ACCEL
virtual QAbstractScrollArea *QtGetScrollBarsContainer() const;
protected:
virtual void DoGetTextExtent(const wxString& string,
int *x, int *y,
int *descent = NULL,
int *externalLeading = NULL,
const wxFont *font = NULL) const;
// coordinates translation
virtual void DoClientToScreen( int *x, int *y ) const;
virtual void DoScreenToClient( int *x, int *y ) const;
// capture/release the mouse, used by Capture/ReleaseMouse()
virtual void DoCaptureMouse();
virtual void DoReleaseMouse();
// retrieve the position/size of the window
virtual void DoGetPosition(int *x, int *y) const;
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
virtual void DoGetSize(int *width, int *height) const;
// same as DoSetSize() for the client size
virtual void DoSetClientSize(int width, int height);
virtual void DoGetClientSize(int *width, int *height) const;
virtual void DoMoveWindow(int x, int y, int width, int height);
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip );
#endif // wxUSE_TOOLTIPS
#if wxUSE_MENUS
virtual bool DoPopupMenu(wxMenu *menu, int x, int y);
#endif // wxUSE_MENUS
QWidget *m_qtWindow;
private:
void Init();
QScrollArea *m_qtContainer;
wxScrollBar *m_horzScrollBar;
wxScrollBar *m_vertScrollBar;
void QtOnScrollBarEvent( wxScrollEvent& event );
wxScrollBar *QtGetScrollBar( int orientation ) const;
wxScrollBar *QtSetScrollBar( int orientation, wxScrollBar *scrollBar=NULL );
bool QtSetBackgroundStyle();
QPicture *m_qtPicture;
QPainter *m_qtPainter;
bool m_mouseInside;
#if wxUSE_ACCEL
QList< QShortcut* > m_qtShortcuts;
wxQtShortcutHandler *m_qtShortcutHandler;
bool m_processingShortcut;
#endif // wxUSE_ACCEL
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS_NO_COPY( wxWindowQt );
};
#endif // _WX_QT_WINDOW_H_