Add wx headers and ext

This commit is contained in:
Joey Yakimowich-Payne 2023-02-06 09:04:33 -07:00
commit 66d3c7b811
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
1531 changed files with 295895 additions and 0 deletions

62
wxheaders/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, Mariano Reingart
// Copyright: (c) 2009 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_ACCEL_H_
#define _WX_QT_ACCEL_H_
/* 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. */
#include "wx/vector.h"
class QShortcut;
template < class T > class QList;
class WXDLLIMPEXP_CORE wxAcceleratorTable : public wxObject
{
public:
wxAcceleratorTable();
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
// Implementation
wxVector<QShortcut*> ConvertShortcutTable( QWidget *parent ) const;
bool Ok() const { return IsOk(); }
bool IsOk() const;
protected:
// ref counting code
virtual wxObjectRefData *CreateRefData() const wxOVERRIDE;
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxAcceleratorTable);
};
#endif // _WX_QT_ACCEL_H_

View file

@ -0,0 +1,53 @@
/////////////////////////////////////////////////////////////////////////////
// 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_
class QPushButton;
//-----------------------------------------------------------------------------
// wxAnyButton
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxAnyButton : public wxAnyButtonBase
{
public:
wxAnyButton();
// implementation
// --------------
virtual void SetLabel( const wxString &label ) wxOVERRIDE;
virtual QWidget *GetHandle() const wxOVERRIDE;
// implementation only
void QtUpdateState();
virtual int QtGetEventType() const = 0;
protected:
virtual wxBitmap DoGetBitmap(State state) const wxOVERRIDE;
virtual void DoSetBitmap(const wxBitmapBundle& bitmap, State which) wxOVERRIDE;
QPushButton *m_qtPushButton;
void QtCreate(wxWindow *parent);
void QtSetBitmap( const wxBitmapBundle &bitmap );
private:
State QtGetCurrentState() const;
typedef wxAnyButtonBase base_type;
wxBitmapBundle m_bitmaps[State_Max];
wxDECLARE_NO_COPY_CLASS(wxAnyButton);
};
#endif // _WX_QT_ANYBUTTON_H_

31
wxheaders/wx/qt/app.h Normal file
View file

@ -0,0 +1,31 @@
/////////////////////////////////////////////////////////////////////////////
// Name: app.h
// Purpose: wxApp class
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2009 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_APP_H_
#define _WX_QT_APP_H_
#include <wx/scopedarray.h>
class QApplication;
class WXDLLIMPEXP_CORE wxApp : public wxAppBase
{
public:
wxApp();
~wxApp();
virtual bool Initialize(int& argc, wxChar **argv) wxOVERRIDE;
private:
wxScopedPtr<QApplication> m_qtApplication;
int m_qtArgc;
wxScopedArray<char*> m_qtArgv;
wxDECLARE_DYNAMIC_CLASS_NO_COPY( wxApp );
};
#endif // _WX_QT_APP_H_

127
wxheaders/wx/qt/bitmap.h Normal file
View file

@ -0,0 +1,127 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/bitmap.h
// Author: Peter Most, Javier Torres, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_BITMAP_H_
#define _WX_QT_BITMAP_H_
class QImage;
class QPixmap;
class QBitmap;
class WXDLLIMPEXP_CORE wxBitmap : public wxBitmapBase
{
public:
wxBitmap();
wxBitmap(QPixmap pix);
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(int width, int height, const wxDC& dc);
wxBitmap(const char* const* bits);
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM);
wxBitmap(const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH, double scale = 1.0);
wxBitmap(const wxImage& image, const wxDC& dc);
// Convert from wxIcon / wxCursor
wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); }
explicit wxBitmap(const wxCursor& cursor);
static void InitStandardHandlers();
virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH) wxOVERRIDE;
virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) wxOVERRIDE;
virtual bool Create(int width, int height, const wxDC& dc);
virtual int GetHeight() const wxOVERRIDE;
virtual int GetWidth() const wxOVERRIDE;
virtual int GetDepth() const wxOVERRIDE;
#if wxUSE_IMAGE
virtual wxImage ConvertToImage() const wxOVERRIDE;
#endif // wxUSE_IMAGE
virtual wxMask *GetMask() const wxOVERRIDE;
virtual void SetMask(wxMask *mask) wxOVERRIDE;
virtual wxBitmap GetSubBitmap(const wxRect& rect) const wxOVERRIDE;
virtual bool SaveFile(const wxString &name, wxBitmapType type,
const wxPalette *palette = NULL) const wxOVERRIDE;
virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE) wxOVERRIDE;
#if wxUSE_PALETTE
virtual wxPalette *GetPalette() const wxOVERRIDE;
virtual void SetPalette(const wxPalette& palette) wxOVERRIDE;
#endif // wxUSE_PALETTE
// implementation:
#if WXWIN_COMPATIBILITY_3_0
wxDEPRECATED(virtual void SetHeight(int height) wxOVERRIDE);
wxDEPRECATED(virtual void SetWidth(int width) wxOVERRIDE);
wxDEPRECATED(virtual void SetDepth(int depth) wxOVERRIDE);
#endif
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 wxOVERRIDE;
QPixmap *GetHandle() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
private:
void InitFromImage(const wxImage& image, int depth, double WXUNUSED(scale));
wxDECLARE_DYNAMIC_CLASS(wxBitmap);
};
class WXDLLIMPEXP_CORE wxMask : public wxMaskBase
{
public:
wxMask();
// Copy constructor
wxMask(const wxMask &mask);
wxMask& operator=(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();
wxBitmap GetBitmap() const;
// Implementation
QBitmap *GetHandle() const;
protected:
// this function is called from Create() to free the existing mask data
void FreeData() wxOVERRIDE;
// by the public wrappers
bool InitFromColour(const wxBitmap& bitmap, const wxColour& colour) wxOVERRIDE;
bool InitFromMonoBitmap(const wxBitmap& bitmap) wxOVERRIDE;
protected:
wxDECLARE_DYNAMIC_CLASS(wxMask);
private:
QBitmap *m_qtBitmap;
};
#endif // _WX_QT_BITMAP_H_

View file

@ -0,0 +1,45 @@
/////////////////////////////////////////////////////////////////////////////
// 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 wxBitmapBundle& bitmap,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxASCII_STR(wxButtonNameStr));
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmapBundle& bitmap,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxASCII_STR(wxButtonNameStr));
bool CreateCloseButton(wxWindow* parent,
wxWindowID winid,
const wxString& name = wxString());
protected:
wxDECLARE_DYNAMIC_CLASS(wxBitmapButton);
private:
// We re-use wxButton
};
#endif // _WX_QT_BMPBUTTN_H_

49
wxheaders/wx/qt/brush.h Normal file
View file

@ -0,0 +1,49 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/brush.h
// Author: Peter Most, Javier Torres, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_BRUSH_H_
#define _WX_QT_BRUSH_H_
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) wxOVERRIDE;
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) wxOVERRIDE;
virtual void SetStyle(wxBrushStyle style) wxOVERRIDE;
virtual void SetStipple(const wxBitmap& stipple) wxOVERRIDE;
bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
virtual wxColour GetColour() const wxOVERRIDE;
virtual wxBrushStyle GetStyle() const wxOVERRIDE;
virtual wxBitmap *GetStipple() const wxOVERRIDE;
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants")
void SetStyle(int style) { SetStyle((wxBrushStyle)style); }
QBrush GetHandle() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxBrush);
};
#endif // _WX_QT_BRUSH_H_

42
wxheaders/wx/qt/button.h Normal file
View file

@ -0,0 +1,42 @@
/////////////////////////////////////////////////////////////////////////////
// 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 = wxASCII_STR(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 = wxASCII_STR(wxButtonNameStr));
virtual wxWindow *SetDefault() wxOVERRIDE;
// implementation only
virtual int QtGetEventType() const wxOVERRIDE { return wxEVT_BUTTON; }
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxButton);
};
#endif // _WX_QT_BUTTON_H_

94
wxheaders/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"
class 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 = wxASCII_STR(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 = wxASCII_STR(wxCalendarNameStr));
virtual bool SetDate(const wxDateTime& date) wxOVERRIDE;
virtual wxDateTime GetDate() const wxOVERRIDE;
virtual bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
const wxDateTime& upperdate = wxDefaultDateTime) wxOVERRIDE;
virtual bool GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const wxOVERRIDE;
virtual bool EnableMonthChange(bool enable = true) wxOVERRIDE;
virtual void Mark(size_t day, bool mark) wxOVERRIDE;
// holidays colours
virtual void SetHoliday(size_t day) wxOVERRIDE;
virtual void SetHolidayColours(const wxColour& colFg, const wxColour& colBg) wxOVERRIDE;
virtual const wxColour& GetHolidayColourFg() const wxOVERRIDE { return m_colHolidayFg; }
virtual const wxColour& GetHolidayColourBg() const wxOVERRIDE { return m_colHolidayBg; }
// header colours
virtual void SetHeaderColours(const wxColour& colFg, const wxColour& colBg) wxOVERRIDE;
virtual const wxColour& GetHeaderColourFg() const wxOVERRIDE { return m_colHeaderFg; }
virtual const wxColour& GetHeaderColourBg() const wxOVERRIDE { return m_colHeaderBg; }
// day attributes
virtual wxCalendarDateAttr *GetAttr(size_t day) const wxOVERRIDE;
virtual void SetAttr(size_t day, wxCalendarDateAttr *attr) wxOVERRIDE;
virtual void ResetAttr(size_t day) wxOVERRIDE { SetAttr(day, NULL); }
virtual void SetWindowStyleFlag(long style) wxOVERRIDE;
using wxCalendarCtrlBase::GenerateAllChangeEvents;
virtual QWidget *GetHandle() const wxOVERRIDE;
protected:
virtual void RefreshHolidays() wxOVERRIDE;
private:
void Init();
void UpdateStyle();
QCalendarWidget *m_qtCalendar;
wxColour m_colHeaderFg,
m_colHeaderBg,
m_colHolidayFg,
m_colHolidayBg;
wxCalendarDateAttr *m_attrs[31];
wxDECLARE_DYNAMIC_CLASS(wxCalendarCtrl);
};
#endif // _WX_QT_CALCTRL_H_

View file

@ -0,0 +1,50 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/checkbox.h
// Author: Peter Most, Sean D'Epagnier, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CHECKBOX_H_
#define _WX_QT_CHECKBOX_H_
class 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 = wxASCII_STR(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 = wxASCII_STR(wxCheckBoxNameStr) );
virtual void SetValue(bool value) wxOVERRIDE;
virtual bool GetValue() const wxOVERRIDE;
virtual void SetLabel(const wxString& label) wxOVERRIDE;
virtual wxString GetLabel() const wxOVERRIDE;
virtual QWidget *GetHandle() const wxOVERRIDE;
protected:
virtual void DoSet3StateValue(wxCheckBoxState state) wxOVERRIDE;
virtual wxCheckBoxState DoGet3StateValue() const wxOVERRIDE;
private:
QCheckBox *m_qtCheckBox;
wxDECLARE_DYNAMIC_CLASS(wxCheckBox);
};
#endif // _WX_QT_CHECKBOX_H_

View file

@ -0,0 +1,58 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/checklst.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// 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 = wxASCII_STR(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 = wxASCII_STR(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 = wxASCII_STR(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 = wxASCII_STR(wxListBoxNameStr));
virtual bool IsChecked(unsigned int item) const wxOVERRIDE;
virtual void Check(unsigned int item, bool check = true) wxOVERRIDE;
private:
virtual void Init() wxOVERRIDE; //common construction
wxDECLARE_DYNAMIC_CLASS(wxCheckListBox);
};
#endif // _WX_QT_CHECKLST_H_

83
wxheaders/wx/qt/choice.h Normal file
View file

@ -0,0 +1,83 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/choice.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CHOICE_H_
#define _WX_QT_CHOICE_H_
class 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 = wxASCII_STR(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 = wxASCII_STR(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 = wxASCII_STR(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 = wxASCII_STR(wxChoiceNameStr) );
virtual wxSize DoGetBestSize() const wxOVERRIDE;
virtual unsigned int GetCount() const wxOVERRIDE;
virtual wxString GetString(unsigned int n) const wxOVERRIDE;
virtual void SetString(unsigned int n, const wxString& s) wxOVERRIDE;
virtual void SetSelection(int n) wxOVERRIDE;
virtual int GetSelection() const wxOVERRIDE;
virtual QWidget *GetHandle() const wxOVERRIDE;
protected:
virtual int DoInsertItems(const wxArrayStringsAdapter & items,
unsigned int pos,
void **clientData,
wxClientDataType type) wxOVERRIDE;
virtual int DoInsertOneItem(const wxString& item, unsigned int pos) wxOVERRIDE;
virtual void DoSetItemClientData(unsigned int n, void *clientData) wxOVERRIDE;
virtual void *DoGetItemClientData(unsigned int n) const wxOVERRIDE;
virtual void DoClear() wxOVERRIDE;
virtual void DoDeleteOneItem(unsigned int pos) wxOVERRIDE;
void QtInitSort(QComboBox *combo);
QComboBox *m_qtComboBox;
private:
wxDECLARE_DYNAMIC_CLASS(wxChoice);
};
#endif // _WX_QT_CHOICE_H_

44
wxheaders/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() wxOVERRIDE;
virtual void Close() wxOVERRIDE;
virtual bool IsOpened() const wxOVERRIDE;
virtual bool AddData( wxDataObject *data ) wxOVERRIDE;
virtual bool SetData( wxDataObject *data ) wxOVERRIDE;
virtual bool GetData( wxDataObject& data ) wxOVERRIDE;
virtual void Clear() wxOVERRIDE;
virtual bool IsSupported( const wxDataFormat& format ) wxOVERRIDE;
virtual bool IsSupportedAsync(wxEvtHandler *sink) wxOVERRIDE;
private:
friend class QtClipBoardSignalHandler;
int Mode();
QtClipBoardSignalHandler *m_SignalHandler;
wxEvtHandlerRef m_sink;
bool m_open;
wxDECLARE_DYNAMIC_CLASS(wxClipboard);
};
#endif // _WX_QT_CLIPBRD_H_

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 = wxASCII_STR(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 = wxASCII_STR(wxColourPickerWidgetNameStr));
protected:
virtual void UpdateColour() wxOVERRIDE;
private:
};
#endif // _WX_QT_CLRPICKER_H_

View file

@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////
// 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"
class QColorDialog;
class WXDLLIMPEXP_CORE wxColourDialog : public wxDialog
{
public:
wxColourDialog() { }
wxColourDialog(wxWindow *parent,
const wxColourData *data = NULL) { Create(parent, data); }
bool Create(wxWindow *parent, const wxColourData *data = NULL);
wxColourData &GetColourData();
private:
QColorDialog *GetQColorDialog() const;
wxColourData m_data;
wxDECLARE_DYNAMIC_CLASS(wxColourDialog);
};
#endif // _WX_QT_COLORDLG_H_

46
wxheaders/wx/qt/colour.h Normal file
View file

@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/colour.h
// Purpose: wxColour class implementation for wxQt
// Author: Kolya Kosenko
// Created: 2010-05-12
// Copyright: (c) 2010 Kolya Kosenko
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_COLOUR_H_
#define _WX_QT_COLOUR_H_
class QColor;
class WXDLLIMPEXP_CORE wxColour : public wxColourBase
{
public:
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
wxColour(const QColor& color);
virtual bool IsOk() const wxOVERRIDE { return m_valid; }
ChannelType Red() const wxOVERRIDE { return m_red; }
ChannelType Green() const wxOVERRIDE { return m_green; }
ChannelType Blue() const wxOVERRIDE { return m_blue; }
ChannelType Alpha() const wxOVERRIDE { return m_alpha; }
bool operator==(const wxColour& color) const;
bool operator!=(const wxColour& color) const;
int GetPixel() const;
QColor GetQColor() const;
protected:
void Init();
virtual void InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a) wxOVERRIDE;
private:
ChannelType m_red, m_green, m_blue, m_alpha;
bool m_valid;
wxDECLARE_DYNAMIC_CLASS(wxColour);
};
#endif // _WX_QT_COLOUR_H_

101
wxheaders/wx/qt/combobox.h Normal file
View file

@ -0,0 +1,101 @@
/////////////////////////////////////////////////////////////////////////////
// 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"
class 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 = wxASCII_STR(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 = wxASCII_STR(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 = wxASCII_STR(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 = wxASCII_STR(wxComboBoxNameStr));
virtual void SetSelection(int n) wxOVERRIDE;
virtual void SetSelection(long from, long to) wxOVERRIDE;
virtual int GetSelection() const wxOVERRIDE { return wxChoice::GetSelection(); }
virtual void GetSelection(long *from, long *to) const wxOVERRIDE;
virtual wxString GetStringSelection() const wxOVERRIDE
{
return wxItemContainer::GetStringSelection();
}
virtual void Clear() wxOVERRIDE;
// See wxComboBoxBase discussion of IsEmpty().
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
virtual void SetValue(const wxString& value) wxOVERRIDE;
virtual void ChangeValue(const wxString& value) wxOVERRIDE;
virtual void AppendText(const wxString &value) wxOVERRIDE;
virtual void Replace(long from, long to, const wxString &value) wxOVERRIDE;
virtual void WriteText(const wxString &value) wxOVERRIDE;
virtual void SetInsertionPoint(long insertion) wxOVERRIDE;
virtual long GetInsertionPoint() const wxOVERRIDE;
virtual void Popup();
virtual void Dismiss();
virtual const wxTextEntry* WXGetTextEntry() const wxOVERRIDE { return this; }
virtual bool QtHandleFocusEvent(QWidget *handler, QFocusEvent *event) wxOVERRIDE;
protected:
// From wxTextEntry:
virtual wxString DoGetValue() const wxOVERRIDE;
private:
void SetActualValue(const wxString& value);
bool IsReadOnly() const;
// From wxTextEntry:
virtual wxWindow *GetEditableWindow() wxOVERRIDE { return this; }
wxDECLARE_DYNAMIC_CLASS(wxComboBox);
};
#endif // _WX_QT_COMBOBOX_H_

38
wxheaders/wx/qt/control.h Normal file
View file

@ -0,0 +1,38 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/control.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// 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 = wxASCII_STR(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 = wxASCII_STR(wxControlNameStr));
virtual wxSize DoGetBestSize() const wxOVERRIDE;
protected:
bool QtCreateControl( wxWindow *parent, wxWindowID id, const wxPoint &pos,
const wxSize &size, long style, const wxValidator &validator,
const wxString &name );
private:
wxDECLARE_DYNAMIC_CLASS(wxControl);
};
#endif // _WX_QT_CONTROL_H_

22
wxheaders/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:
wxDECLARE_ABSTRACT_CLASS(wxControlWithItems);
};
#endif // _WX_QT_CTRLSUB_H_

48
wxheaders/wx/qt/cursor.h Normal file
View file

@ -0,0 +1,48 @@
/////////////////////////////////////////////////////////////////////////////
// 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/image.h"
class QCursor;
class WXDLLIMPEXP_CORE wxCursor : public wxCursorBase
{
public:
wxCursor() { }
wxCursor(wxStockCursor id) { InitFromStock(id); }
#if WXWIN_COMPATIBILITY_2_8
wxCursor(int id) { InitFromStock((wxStockCursor)id); }
#endif
#if wxUSE_IMAGE
wxCursor( const wxImage & image );
wxCursor(const char* const* xpmData);
#endif // wxUSE_IMAGE
wxCursor(const wxString& name,
wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
int hotSpotX = 0, int hotSpotY = 0);
virtual wxPoint GetHotSpot() const wxOVERRIDE;
QCursor &GetHandle() const;
protected:
void InitFromStock( wxStockCursor cursorId );
#if wxUSE_IMAGE
void InitFromImage( const wxImage & image );
#endif
private:
void Init();
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
wxDECLARE_DYNAMIC_CLASS(wxCursor);
};
#endif // _WX_QT_CURSOR_H_

View file

@ -0,0 +1,41 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dataform.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(wxDataFormatId formatId = wxDF_INVALID);
wxDataFormat(const wxString &id);
// Standard methods
const wxString& GetId() const;
void SetId(const wxString& id);
wxDataFormatId GetType() const;
void SetType(wxDataFormatId type);
bool operator==(wxDataFormatId format) const;
bool operator!=(wxDataFormatId format) const;
bool operator==(const wxDataFormat& format) const;
bool operator!=(const wxDataFormat& format) const;
// Direct access to the underlying mime type.
// Equivalent to "id", except "id" is supposed to be
// invalid for standard types, whereas this should
// always be valid (if meaningful).
const wxString& GetMimeType() const;
void SetMimeType(const wxString& mimeType);
private:
wxString m_mimeType;
wxDataFormatId m_formatId;
};
#endif // _WX_QT_DATAFORM_H_

35
wxheaders/wx/qt/dataobj.h Normal file
View file

@ -0,0 +1,35 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/qt/dataobj.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DATAOBJ_H_
#define _WX_QT_DATAOBJ_H_
// ----------------------------------------------------------------------------
// wxDataObject is the same as wxDataObjectBase under wxQT
// ----------------------------------------------------------------------------
class QMimeData;
class WXDLLIMPEXP_CORE wxDataObject : public wxDataObjectBase
{
public:
wxDataObject();
virtual ~wxDataObject();
virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const;
// Adds object's data to Qt mime data appropriately for type
virtual void QtAddDataTo(QMimeData &mimeData) const;
// Sets object's data from Qt mime data appropriately for type
virtual bool QtSetDataFrom(const QMimeData &mimeData);
private:
// Sets object's data from Qt mime data in specific format
virtual void QtSetDataSingleFormat(const QMimeData &mimeData, const wxDataFormat &format);
};
#endif // _WX_QT_DATAOBJ_H_

View file

@ -0,0 +1,37 @@
/////////////////////////////////////////////////////////////////////////////
// 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);
// Overridden to set image data directly, which Qt will write to clipboard in many formats
void QtAddDataTo(QMimeData &mimeData) const wxOVERRIDE;
// Overridden to retrieve image data from any format that Qt can read from clipboard
bool QtSetDataFrom(const QMimeData &mimeData) wxOVERRIDE;
protected:
private:
};
class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase
{
public:
wxFileDataObject();
void AddFile( const wxString &filename );
};
#endif // _WX_QT_DATAOBJ2_H_

141
wxheaders/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 wxBitmapBundle &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 wxBitmapBundle &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 Collapse( const wxDataViewItem & item );
virtual bool IsExpanded( const wxDataViewItem & item ) const;
virtual bool EnableDragSource( const wxDataFormat &format );
virtual bool DoEnableDropTarget( const wxVector<wxDataFormat>& formats );
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
wxWindow *GetMainWindow() { return (wxWindow*) this; }
virtual void OnInternalIdle();
protected:
virtual void DoSetExpanderColumn();
virtual void DoSetIndent();
virtual void DoExpand( const wxDataViewItem & item, bool expandChildren );
private:
virtual wxDataViewItem DoGetCurrentItem() const;
virtual void DoSetCurrentItem(const wxDataViewItem& item);
};
#endif // _WX_QT_DATAVIEW_H_

138
wxheaders/wx/qt/dc.h Normal file
View file

@ -0,0 +1,138 @@
/////////////////////////////////////////////////////////////////////////////
// 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_
class QPainter;
class QImage;
class WXDLLIMPEXP_FWD_CORE wxRegion;
class WXDLLIMPEXP_CORE wxQtDCImpl : public wxDCImpl
{
public:
wxQtDCImpl( wxDC *owner );
~wxQtDCImpl();
virtual bool CanDrawBitmap() const wxOVERRIDE;
virtual bool CanGetTextExtent() const wxOVERRIDE;
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
virtual void DoGetSizeMM(int* width, int* height) const wxOVERRIDE;
virtual int GetDepth() const wxOVERRIDE;
virtual wxSize GetPPI() const wxOVERRIDE;
virtual void SetFont(const wxFont& font) wxOVERRIDE;
virtual void SetPen(const wxPen& pen) wxOVERRIDE;
virtual void SetBrush(const wxBrush& brush) wxOVERRIDE;
virtual void SetBackground(const wxBrush& brush) wxOVERRIDE;
virtual void SetBackgroundMode(int mode) wxOVERRIDE;
#if wxUSE_PALETTE
virtual void SetPalette(const wxPalette& palette) wxOVERRIDE;
#endif // wxUSE_PALETTE
virtual void SetLogicalFunction(wxRasterOperationMode function) wxOVERRIDE;
virtual wxCoord GetCharHeight() const wxOVERRIDE;
virtual wxCoord GetCharWidth() const wxOVERRIDE;
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const wxOVERRIDE;
virtual void Clear() wxOVERRIDE;
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height) wxOVERRIDE;
virtual void DoSetDeviceClippingRegion(const wxRegion& region) wxOVERRIDE;
virtual void DestroyClippingRegion() wxOVERRIDE;
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE) wxOVERRIDE;
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const wxOVERRIDE;
virtual void DoDrawPoint(wxCoord x, wxCoord y) wxOVERRIDE;
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) wxOVERRIDE;
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc) wxOVERRIDE;
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea) wxOVERRIDE;
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE;
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord width, wxCoord height,
double radius) wxOVERRIDE;
virtual void DoDrawEllipse(wxCoord x, wxCoord y,
wxCoord width, wxCoord height) wxOVERRIDE;
virtual void DoCrossHair(wxCoord x, wxCoord y) wxOVERRIDE;
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) wxOVERRIDE;
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = false) wxOVERRIDE;
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) wxOVERRIDE;
virtual void DoDrawRotatedText(const wxString& text,
wxCoord x, wxCoord y, double angle) wxOVERRIDE;
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) wxOVERRIDE;
virtual void DoDrawLines(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset ) wxOVERRIDE;
virtual void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE) wxOVERRIDE;
// Use Qt transformations, as they automatically scale pen widths, text...
virtual void ComputeScaleAndOrigin() wxOVERRIDE;
void QtPreparePainter();
virtual void* GetHandle() const wxOVERRIDE { return (void*) m_qtPainter; }
protected:
virtual QPixmap *GetQPixmap() { return m_qtPixmap; }
QPainter *m_qtPainter;
QPixmap *m_qtPixmap;
wxRegion m_clippingRegion;
private:
enum wxQtRasterColourOp
{
wxQtNONE,
wxQtWHITE,
wxQtBLACK,
wxQtINVERT
};
wxQtRasterColourOp m_rasterColourOp;
QColor *m_qtPenColor;
QColor *m_qtBrushColor;
void ApplyRasterColourOp();
wxDECLARE_CLASS(wxQtDCImpl);
wxDECLARE_NO_COPY_CLASS(wxQtDCImpl);
};
#endif // _WX_QT_DC_H_

View file

@ -0,0 +1,59 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dcclient.h
// Author: Peter Most, Javier Torres, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DCCLIENT_H_
#define _WX_QT_DCCLIENT_H_
#include "wx/qt/dc.h"
#include "wx/scopedptr.h"
class QPicture;
class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxQtDCImpl
{
public:
wxWindowDCImpl( wxDC *owner );
wxWindowDCImpl( wxDC *owner, wxWindow *win );
~wxWindowDCImpl();
protected:
wxWindow *m_window;
private:
wxDECLARE_CLASS(wxWindowDCImpl);
wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl);
};
class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
{
public:
wxClientDCImpl( wxDC *owner );
wxClientDCImpl( wxDC *owner, wxWindow *win );
~wxClientDCImpl();
private:
wxScopedPtr<QPicture> m_pict;
wxDECLARE_CLASS(wxClientDCImpl);
wxDECLARE_NO_COPY_CLASS(wxClientDCImpl);
};
class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxWindowDCImpl
{
public:
wxPaintDCImpl( wxDC *owner );
wxPaintDCImpl( wxDC *owner, wxWindow *win );
private:
wxDECLARE_CLASS(wxPaintDCImpl);
wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl);
};
#endif // _WX_QT_DCCLIENT_H_

View file

@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dcmemory.h
// Author: Peter Most, Javier Torres, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// 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 wxBitmap DoGetAsBitmap(const wxRect *subrect) const wxOVERRIDE;
virtual void DoSelect(const wxBitmap& bitmap) wxOVERRIDE;
virtual const wxBitmap& GetSelectedBitmap() const wxOVERRIDE;
virtual wxBitmap& GetSelectedBitmap() wxOVERRIDE;
private:
wxBitmap m_selected;
DECLARE_CLASS(wxMemoryDCImpl);
DECLARE_NO_COPY_CLASS(wxMemoryDCImpl);
};
#endif // _WX_QT_DCMEMORY_H_

106
wxheaders/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 wxOVERRIDE;
virtual bool CanGetTextExtent() const wxOVERRIDE;
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
virtual void DoGetSizeMM(int* width, int* height) const wxOVERRIDE;
virtual int GetDepth() const wxOVERRIDE;
virtual wxSize GetPPI() const wxOVERRIDE;
virtual void SetFont(const wxFont& font) wxOVERRIDE;
virtual void SetPen(const wxPen& pen) wxOVERRIDE;
virtual void SetBrush(const wxBrush& brush) wxOVERRIDE;
virtual void SetBackground(const wxBrush& brush) wxOVERRIDE;
virtual void SetBackgroundMode(int mode) wxOVERRIDE;
#if wxUSE_PALETTE
virtual void SetPalette(const wxPalette& palette) wxOVERRIDE;
#endif // wxUSE_PALETTE
virtual void SetLogicalFunction(wxRasterOperationMode function) wxOVERRIDE;
virtual wxCoord GetCharHeight() const wxOVERRIDE;
virtual wxCoord GetCharWidth() const wxOVERRIDE;
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const wxOVERRIDE;
virtual void Clear() wxOVERRIDE;
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height) wxOVERRIDE;
virtual void DoSetDeviceClippingRegion(const wxRegion& region) wxOVERRIDE;
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE) wxOVERRIDE;
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const wxOVERRIDE;
virtual void DoDrawPoint(wxCoord x, wxCoord y) wxOVERRIDE;
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) wxOVERRIDE;
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc) wxOVERRIDE;
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea) wxOVERRIDE;
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE;
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord width, wxCoord height,
double radius) wxOVERRIDE;
virtual void DoDrawEllipse(wxCoord x, wxCoord y,
wxCoord width, wxCoord height) wxOVERRIDE;
virtual void DoCrossHair(wxCoord x, wxCoord y) wxOVERRIDE;
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) wxOVERRIDE;
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = false) wxOVERRIDE;
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) wxOVERRIDE;
virtual void DoDrawRotatedText(const wxString& text,
wxCoord x, wxCoord y, double angle) wxOVERRIDE;
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) wxOVERRIDE;
virtual void DoDrawLines(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset ) wxOVERRIDE;
virtual void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE) wxOVERRIDE;
private:
wxDECLARE_CLASS(wxPrinterDCImpl);
wxDECLARE_NO_COPY_CLASS(wxPrinterDCImpl);
};
#endif // _WX_QT_DCPRINT_H_

View file

@ -0,0 +1,27 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dcscreen.h
// Author: Sean D'Epagnier
// Copyright: (c) Sean D'Epagnier
// 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 );
~wxScreenDCImpl();
protected:
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
virtual QPixmap *GetQPixmap() wxOVERRIDE;
wxDECLARE_ABSTRACT_CLASS(wxScreenDCImpl);
};
#endif // _WX_QT_DCSCREEN_H_

17
wxheaders/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_ */

47
wxheaders/wx/qt/dialog.h Normal file
View file

@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dialog.h
// Author: Peter Most, Javier Torres, Mariano Reingart, Sean D'Epagnier
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DIALOG_H_
#define _WX_QT_DIALOG_H_
#include "wx/dialog.h"
class 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 = wxASCII_STR(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 = wxASCII_STR(wxDialogNameStr) );
virtual int ShowModal() wxOVERRIDE;
virtual void EndModal(int retCode) wxOVERRIDE;
virtual bool IsModal() const wxOVERRIDE;
virtual bool Show(bool show = true) wxOVERRIDE;
QDialog *GetDialogHandle() const;
private:
wxDECLARE_DYNAMIC_CLASS( wxDialog );
};
#endif // _WX_QT_DIALOG_H_

46
wxheaders/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_
class QFileDialog;
class WXDLLIMPEXP_CORE wxDirDialog : public wxDirDialogBase
{
public:
wxDirDialog() { }
wxDirDialog(wxWindow *parent,
const wxString& message = wxASCII_STR(wxDirSelectorPromptStr),
const wxString& defaultPath = wxEmptyString,
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxASCII_STR(wxDirDialogNameStr));
bool Create(wxWindow *parent,
const wxString& message = wxASCII_STR(wxDirSelectorPromptStr),
const wxString& defaultPath = wxEmptyString,
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxASCII_STR(wxDirDialogNameStr));
public: // overrides from wxGenericDirDialog
wxString GetPath() const wxOVERRIDE;
void SetPath(const wxString& path) wxOVERRIDE;
private:
virtual QFileDialog *GetQFileDialog() const;
wxDECLARE_DYNAMIC_CLASS(wxDirDialog);
};
#endif // _WX_QT_DIRDLG_H_

54
wxheaders/wx/qt/dnd.h Normal file
View file

@ -0,0 +1,54 @@
/////////////////////////////////////////////////////////////////////////////
// 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) wxCursor(name##_xpm)
class WXDLLIMPEXP_CORE wxDropTarget : public wxDropTargetBase
{
public:
wxDropTarget(wxDataObject *dataObject = NULL);
virtual ~wxDropTarget();
virtual bool OnDrop(wxCoord x, wxCoord y) wxOVERRIDE;
virtual wxDragResult OnData(wxCoord x,
wxCoord y,
wxDragResult def) wxOVERRIDE;
virtual bool GetData() wxOVERRIDE;
wxDataFormat GetMatchingPair();
void ConnectTo(QWidget* widget);
void Disconnect();
private:
class Impl;
Impl* m_pImpl;
};
class WXDLLIMPEXP_CORE wxDropSource: public wxDropSourceBase
{
public:
wxDropSource(wxWindow *win = NULL,
const wxCursor &copy = wxNullCursor,
const wxCursor &move = wxNullCursor,
const wxCursor &none = wxNullCursor);
wxDropSource(wxDataObject& data,
wxWindow *win,
const wxCursor &copy = wxNullCursor,
const wxCursor &move = wxNullCursor,
const wxCursor &none = wxNullCursor);
virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly) wxOVERRIDE;
private:
wxWindow* m_parentWindow;
};
#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_

View file

@ -0,0 +1,192 @@
///////////////////////////////////////////////////////////////////////////////
// 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:
static wxString GetDefaultType() { return wxS("string"); }
wxDataViewTextRenderer( const wxString &varianttype = GetDefaultType(),
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:
static wxString GetDefaultType() { return wxS("wxBitmapBundle"); }
wxDataViewBitmapRenderer( const wxString &varianttype = GetDefaultType(),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value ) const;
bool IsCompatibleVariantType(const wxString& variantType) const;
};
// ---------------------------------------------------------
// wxDataViewToggleRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewToggleRenderer: public wxDataViewRenderer
{
public:
static wxString GetDefaultType() { return wxS("bool"); }
wxDataViewToggleRenderer( const wxString &varianttype = GetDefaultType(),
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:
static wxString GetDefaultType() { return wxS("string"); }
wxDataViewCustomRenderer( const wxString &varianttype = GetDefaultType(),
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:
static wxString GetDefaultType() { return wxS("long"); }
wxDataViewProgressRenderer( const wxString &label = wxEmptyString,
const wxString &varianttype = GetDefaultType(),
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:
static wxString GetDefaultType() { return wxS("wxDataViewIconText"); }
wxDataViewIconTextRenderer( const wxString &varianttype = GetDefaultType(),
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:
static wxString GetDefaultType() { return wxS("datetime"); }
wxDataViewDateRenderer( const wxString &varianttype = GetDefaultType(),
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_

48
wxheaders/wx/qt/evtloop.h Normal file
View file

@ -0,0 +1,48 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/evtloop.h
// Author: Peter Most, Javier Torres, Mariano Reingart, Sean D'Epagnier
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_EVTLOOP_H_
#define _WX_QT_EVTLOOP_H_
class wxQtIdleTimer;
class QEventLoop;
class WXDLLIMPEXP_CORE wxQtEventLoopBase : public wxEventLoopBase
{
public:
wxQtEventLoopBase();
~wxQtEventLoopBase();
virtual int DoRun() wxOVERRIDE;
virtual void ScheduleExit(int rc = 0) wxOVERRIDE;
virtual bool Pending() const wxOVERRIDE;
virtual bool Dispatch() wxOVERRIDE;
virtual int DispatchTimeout(unsigned long timeout) wxOVERRIDE;
virtual void WakeUp() wxOVERRIDE;
virtual void DoYieldFor(long eventsToProcess) wxOVERRIDE;
void ScheduleIdleCheck();
private:
QEventLoop *m_qtEventLoop;
wxObjectDataPtr<wxQtIdleTimer> m_qtIdleTimer;
wxDECLARE_NO_COPY_CLASS(wxQtEventLoopBase);
};
#if wxUSE_GUI
class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxQtEventLoopBase
{
public:
wxGUIEventLoop();
};
#endif // wxUSE_GUI
#endif // _WX_QT_EVTLOOP_H_

58
wxheaders/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_
class QFileDialog;
class WXDLLIMPEXP_CORE wxFileDialog : public wxFileDialogBase
{
public:
wxFileDialog() { }
wxFileDialog(wxWindow *parent,
const wxString& message = wxASCII_STR(wxFileSelectorPromptStr),
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxASCII_STR(wxFileDialogNameStr));
bool Create(wxWindow *parent,
const wxString& message = wxASCII_STR(wxFileSelectorPromptStr),
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxASCII_STR(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 *GetQFileDialog() const;
private:
wxDECLARE_DYNAMIC_CLASS(wxFileDialog);
};
#endif // _WX_QT_FILEDLG_H_

90
wxheaders/wx/qt/font.h Normal file
View file

@ -0,0 +1,90 @@
/////////////////////////////////////////////////////////////////////////////
// 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 QFont;
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);
wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants")
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 wxOVERRIDE;
virtual double GetFractionalPointSize() const wxOVERRIDE;
virtual wxSize GetPixelSize() const wxOVERRIDE;
virtual wxFontStyle GetStyle() const wxOVERRIDE;
virtual int GetNumericWeight() const wxOVERRIDE;
virtual bool GetUnderlined() const wxOVERRIDE;
virtual wxString GetFaceName() const wxOVERRIDE;
virtual wxFontEncoding GetEncoding() const wxOVERRIDE;
virtual const wxNativeFontInfo *GetNativeFontInfo() const wxOVERRIDE;
virtual bool GetStrikethrough() const wxOVERRIDE;
// change the font characteristics
virtual void SetFractionalPointSize(double pointSize) wxOVERRIDE;
virtual void SetPixelSize(const wxSize& pixelSize) wxOVERRIDE;
virtual void SetFamily( wxFontFamily family ) wxOVERRIDE;
virtual void SetStyle( wxFontStyle style ) wxOVERRIDE;
virtual void SetNumericWeight(int weight) wxOVERRIDE;
virtual bool SetFaceName(const wxString& facename) wxOVERRIDE;
virtual void SetUnderlined( bool underlined ) wxOVERRIDE;
virtual void SetStrikethrough(bool strikethrough) wxOVERRIDE;
virtual void SetEncoding(wxFontEncoding encoding) wxOVERRIDE;
wxDECLARE_COMMON_FONT_METHODS();
virtual QFont GetHandle() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
virtual wxFontFamily DoGetFamily() const wxOVERRIDE;
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info) wxOVERRIDE;
wxDECLARE_DYNAMIC_CLASS(wxFont);
};
#endif // _WX_QT_FONT_H_

30
wxheaders/wx/qt/fontdlg.h Normal file
View file

@ -0,0 +1,30 @@
/////////////////////////////////////////////////////////////////////////////
// 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_
class QFontDialog;
class WXDLLIMPEXP_CORE wxFontDialog : public wxFontDialogBase
{
public:
wxFontDialog() { }
wxFontDialog(wxWindow *parent) { Create(parent); }
wxFontDialog(wxWindow *parent, const wxFontData& data) { Create(parent, data); }
protected:
bool DoCreate(wxWindow *parent) wxOVERRIDE;
private:
wxFontData m_data;
wxDECLARE_DYNAMIC_CLASS(wxFontDialog);
};
#endif // _WX_QT_FONTDLG_H_

78
wxheaders/wx/qt/frame.h Normal file
View file

@ -0,0 +1,78 @@
/////////////////////////////////////////////////////////////////////////////
// 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"
class QMainWindow;
class QScrollArea;
class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
{
public:
wxFrame() { Init(); }
wxFrame(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxASCII_STR(wxFrameNameStr))
{
Init();
Create( parent, id, title, pos, size, style, name );
}
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 = wxASCII_STR(wxFrameNameStr));
virtual void SetMenuBar(wxMenuBar *menubar) wxOVERRIDE;
virtual void SetStatusBar(wxStatusBar *statusBar ) wxOVERRIDE;
virtual void SetToolBar(wxToolBar *toolbar) wxOVERRIDE;
virtual void SetWindowStyleFlag( long style ) wxOVERRIDE;
virtual void AddChild( wxWindowBase *child ) wxOVERRIDE;
virtual void RemoveChild( wxWindowBase *child ) wxOVERRIDE;
QMainWindow *GetQMainWindow() const;
virtual QScrollArea *QtGetScrollBarsContainer() const wxOVERRIDE;
protected:
virtual void DoGetClientSize(int *width, int *height) const wxOVERRIDE;
virtual void DoSetClientSize(int width, int height) wxOVERRIDE;
virtual QWidget* QtGetParentWidget() const wxOVERRIDE;
private:
// Common part of all ctors.
void Init()
{
m_qtToolBar = NULL;
}
// Currently active native toolbar.
class QToolBar* m_qtToolBar;
wxDECLARE_DYNAMIC_CLASS( wxFrame );
};
#endif // _WX_QT_FRAME_H_

51
wxheaders/wx/qt/gauge.h Normal file
View file

@ -0,0 +1,51 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/gauge.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_GAUGE_H_
#define _WX_QT_GAUGE_H_
class 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 = wxASCII_STR(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 = wxASCII_STR(wxGaugeNameStr));
virtual QWidget *GetHandle() const wxOVERRIDE;
// set/get the control range
virtual void SetRange(int range) wxOVERRIDE;
virtual int GetRange() const wxOVERRIDE;
virtual void SetValue(int pos) wxOVERRIDE;
virtual int GetValue() const wxOVERRIDE;
private:
QProgressBar *m_qtProgressBar;
wxDECLARE_DYNAMIC_CLASS(wxGauge);
};
#endif // _WX_QT_GAUGE_H_

View file

@ -0,0 +1,87 @@
/////////////////////////////////////////////////////////////////////////////
// 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 <GL/gl.h>
class QGLWidget;
class QGLContext;
class QGLFormat;
class WXDLLIMPEXP_GL wxGLContext : public wxGLContextBase
{
public:
wxGLContext(wxGLCanvas *win,
const wxGLContext *other = NULL,
const wxGLContextAttrs *ctxAttrs = NULL);
/// virtual ~wxGLContext();
virtual bool SetCurrent(const wxGLCanvas& win) const wxOVERRIDE;
wxDECLARE_CLASS(wxGLContext);
};
// ----------------------------------------------------------------------------
// wxGLCanvas: OpenGL output window
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase
{
public:
explicit // avoid implicitly converting a wxWindow* to wxGLCanvas
wxGLCanvas(wxWindow *parent,
const wxGLAttributes& dispAttrs,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
explicit
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);
~wxGLCanvas();
bool Create(wxWindow *parent,
const wxGLAttributes& dispAttrs,
wxWindowID id = wxID_ANY,
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() wxOVERRIDE;
static bool ConvertWXAttrsToQtGL(const int *wxattrs, QGLFormat &format);
private:
// wxDECLARE_EVENT_TABLE();
wxDECLARE_CLASS(wxGLCanvas);
};
#endif // _WX_GLCANVAS_H_

101
wxheaders/wx/qt/listbox.h Normal file
View file

@ -0,0 +1,101 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/listbox.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_LISTBOX_H_
#define _WX_QT_LISTBOX_H_
class QListWidget;
class QModelIndex;
class QScrollArea;
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 = wxASCII_STR(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 = wxASCII_STR(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 = wxASCII_STR(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 = wxASCII_STR(wxListBoxNameStr));
virtual bool IsSelected(int n) const wxOVERRIDE;
virtual int GetSelections(wxArrayInt& aSelections) const wxOVERRIDE;
virtual unsigned int GetCount() const wxOVERRIDE;
virtual wxString GetString(unsigned int n) const wxOVERRIDE;
virtual void SetString(unsigned int n, const wxString& s) wxOVERRIDE;
virtual int GetSelection() const wxOVERRIDE;
virtual QWidget *GetHandle() const wxOVERRIDE;
void QtSendEvent(wxEventType evtType, int rowIndex, bool selected);
protected:
virtual void DoSetFirstItem(int n) wxOVERRIDE;
virtual void DoSetSelection(int n, bool select) wxOVERRIDE;
virtual int DoInsertItems(const wxArrayStringsAdapter & items,
unsigned int pos,
void **clientData,
wxClientDataType type) wxOVERRIDE;
virtual int DoInsertOneItem(const wxString& item, unsigned int pos) wxOVERRIDE;
virtual void DoSetItemClientData(unsigned int n, void *clientData) wxOVERRIDE;
virtual void *DoGetItemClientData(unsigned int n) const wxOVERRIDE;
virtual void DoClear() wxOVERRIDE;
virtual void DoDeleteOneItem(unsigned int pos) wxOVERRIDE;
virtual QScrollArea *QtGetScrollBarsContainer() const wxOVERRIDE;
#if wxUSE_CHECKLISTBOX
bool m_hasCheckBoxes;
#endif // wxUSE_CHECKLISTBOX
QListWidget *m_qtListWidget;
private:
virtual void Init(); //common construction
// Common part of both Create() overloads.
void DoCreate(wxWindow* parent, long style);
void UnSelectAll();
wxDECLARE_DYNAMIC_CLASS(wxListBox);
};
#endif // _WX_QT_LISTBOX_H_

288
wxheaders/wx/qt/listctrl.h Normal file
View file

@ -0,0 +1,288 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/listctrl.h
// Author: Mariano Reingart, Peter Most
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_LISTCTRL_H_
#define _WX_QT_LISTCTRL_H_
#include "wx/textctrl.h"
class wxQtListTreeWidget;
class wxQtListModel;
class wxQtVirtualListModel;
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 = wxASCII_STR(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 = wxASCII_STR(wxListCtrlNameStr));
virtual ~wxListCtrl();
// Attributes
////////////////////////////////////////////////////////////////////////////
// Set the control colours
bool SetForegroundColour(const wxColour& col) wxOVERRIDE;
bool SetBackgroundColour(const wxColour& col) wxOVERRIDE;
// Gets information about this column
bool GetColumn(int col, wxListItem& info) const wxOVERRIDE;
// Sets information about this column
bool SetColumn(int col, const wxListItem& info) wxOVERRIDE;
// Gets the column width
int GetColumnWidth(int col) const wxOVERRIDE;
// Sets the column width
bool SetColumnWidth(int col, int width) wxOVERRIDE;
// Gets the column order from its index or index from its order
int GetColumnOrder(int col) const wxOVERRIDE;
int GetColumnIndexFromOrder(int order) const wxOVERRIDE;
// Gets the column order for all columns
wxArrayInt GetColumnsOrder() const wxOVERRIDE;
// Sets the column order for all columns
bool SetColumnsOrder(const wxArrayInt& orders) wxOVERRIDE;
// 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 wxOVERRIDE;
// Gets the number of columns in the list control
int GetColumnCount() const wxOVERRIDE;
// 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;
virtual bool HasCheckBoxes() const wxOVERRIDE;
virtual bool EnableCheckBoxes(bool enable = true) wxOVERRIDE;
virtual bool IsItemChecked(long item) const wxOVERRIDE;
virtual void CheckItem(long item, bool check) wxOVERRIDE;
// Add or remove a single window style
void SetSingleStyle(long style, bool add = true);
// Set the whole window style
void SetWindowStyleFlag(long style) wxOVERRIDE;
// 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;
// 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) wxOVERRIDE;
// Deletes all columns
bool DeleteAllColumns() wxOVERRIDE;
// 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);
virtual QWidget *GetHandle() const wxOVERRIDE;
protected:
void Init();
// Implement base class pure virtual methods.
virtual long DoInsertColumn(long col, const wxListItem& info) wxOVERRIDE;
void DoUpdateImages(int which) wxOVERRIDE;
bool m_hasCheckBoxes;
private:
// Allow access to OnGetItemXXX() method from the virtual model class.
friend class wxQtVirtualListModel;
wxQtListTreeWidget *m_qtTreeWidget;
wxQtListModel *m_model;
wxDECLARE_DYNAMIC_CLASS( wxListCtrl );
};
#endif

83
wxheaders/wx/qt/mdi.h Normal file
View file

@ -0,0 +1,83 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/mdi.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// 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 = wxASCII_STR(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 = wxASCII_STR(wxFrameNameStr));
// override/implement base class [pure] virtual methods
// ----------------------------------------------------
static bool IsTDI() { return false; }
virtual void ActivateNext() wxOVERRIDE;
virtual void ActivatePrevious() wxOVERRIDE;
protected:
private:
wxDECLARE_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 = wxASCII_STR(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 = wxASCII_STR(wxFrameNameStr));
virtual void Activate() wxOVERRIDE;
wxDECLARE_DYNAMIC_CLASS(wxMDIChildFrame);
};
class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase
{
public:
wxMDIClientWindow();
virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL) wxOVERRIDE;
wxDECLARE_DYNAMIC_CLASS(wxMDIClientWindow);
};
#endif // _WX_QT_MDI_H_

64
wxheaders/wx/qt/menu.h Normal file
View file

@ -0,0 +1,64 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/menu.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_MENU_H_
#define _WX_QT_MENU_H_
class QMenu;
class 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) wxOVERRIDE;
virtual wxMenuItem *DoInsert(size_t pos, wxMenuItem *item) wxOVERRIDE;
virtual wxMenuItem *DoRemove(wxMenuItem *item) wxOVERRIDE;
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) wxOVERRIDE;
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title) wxOVERRIDE;
virtual wxMenu *Remove(size_t pos) wxOVERRIDE;
virtual void EnableTop(size_t pos, bool enable) wxOVERRIDE;
virtual bool IsEnabledTop(size_t pos) const wxOVERRIDE;
virtual void SetMenuLabel(size_t pos, const wxString& label) wxOVERRIDE;
virtual wxString GetMenuLabel(size_t pos) const wxOVERRIDE;
QMenuBar *GetQMenuBar() const { return m_qtMenuBar; }
virtual QWidget *GetHandle() const wxOVERRIDE;
virtual void Attach(wxFrame *frame) wxOVERRIDE;
virtual void Detach() wxOVERRIDE;
private:
QMenuBar *m_qtMenuBar;
wxDECLARE_DYNAMIC_CLASS(wxMenuBar);
};
#endif // _WX_QT_MENU_H_

View file

@ -0,0 +1,52 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/menuitem.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_MENUITEM_H_
#define _WX_QT_MENUITEM_H_
#include "wx/menuitem.h"
#include "wx/bitmap.h"
class QAction;
class wxQtAction;
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) wxOVERRIDE;
virtual void SetCheckable(bool checkable) wxOVERRIDE;
virtual void Enable(bool enable = true) wxOVERRIDE;
virtual bool IsEnabled() const wxOVERRIDE;
virtual void Check(bool check = true) wxOVERRIDE;
virtual bool IsChecked() const wxOVERRIDE;
virtual void SetBitmap(const wxBitmapBundle& bitmap) wxOVERRIDE;
virtual QAction *GetHandle() const;
virtual void SetFont(const wxFont& font);
private:
// Qt is using an action instead of a menu item.
wxQtAction *m_qtAction;
wxDECLARE_DYNAMIC_CLASS( wxMenuItem );
};
#endif // _WX_QT_MENUITEM_H_

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 = wxASCII_STR(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 = wxASCII_STR(wxFrameNameStr))
{
Create(parent, id, title, pos, size, style, name);
}
protected:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxMiniFrame);
};
#endif
// _WX_MINIFRAM_H_

31
wxheaders/wx/qt/msgdlg.h Normal file
View file

@ -0,0 +1,31 @@
/////////////////////////////////////////////////////////////////////////////
// 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"
class QMessageBox;
class WXDLLIMPEXP_CORE wxMessageDialog : public wxMessageDialogBase
{
public:
wxMessageDialog(wxWindow *parent, const wxString& message,
const wxString& caption = wxASCII_STR(wxMessageBoxCaptionStr),
long style = wxOK|wxCENTRE,
const wxPoint& pos = wxDefaultPosition);
virtual ~wxMessageDialog();
// Reimplemented to translate return codes from Qt to wx
virtual int ShowModal() wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxMessageDialog);
};
#endif // _WX_QT_MSGDLG_H_

View file

@ -0,0 +1,30 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/nonownedwnd.h
// Author: Sean D'Epagnier
// Copyright: (c) 2016 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_NONOWNEDWND_H_
#define _WX_QT_NONOWNEDWND_H_
// ----------------------------------------------------------------------------
// wxNonOwnedWindow contains code common to wx{Popup,TopLevel}Window in wxQT.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxNonOwnedWindow : public wxNonOwnedWindowBase
{
public:
wxNonOwnedWindow();
protected:
virtual bool DoClearShape() wxOVERRIDE;
virtual bool DoSetRegionShape(const wxRegion& region) wxOVERRIDE;
#if wxUSE_GRAPHICS_CONTEXT
virtual bool DoSetPathShape(const wxGraphicsPath& path) wxOVERRIDE;
#endif // wxUSE_GRAPHICS_CONTEXT
wxDECLARE_NO_COPY_CLASS(wxNonOwnedWindow);
};
#endif // _WX_QT_NONOWNEDWND_H_

View file

@ -0,0 +1,65 @@
/////////////////////////////////////////////////////////////////////////////
// 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_
class 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 = wxASCII_STR(wxNotebookNameStr));
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxASCII_STR(wxNotebookNameStr));
virtual void SetPadding(const wxSize& padding) wxOVERRIDE;
virtual void SetTabSize(const wxSize& sz) wxOVERRIDE;
virtual bool SetPageText(size_t n, const wxString& strText) wxOVERRIDE;
virtual wxString GetPageText(size_t n) const wxOVERRIDE;
virtual int GetPageImage(size_t n) const wxOVERRIDE;
virtual bool SetPageImage(size_t n, int imageId) wxOVERRIDE;
virtual bool InsertPage(size_t n, wxWindow *page, const wxString& text,
bool bSelect = false, int imageId = -1) wxOVERRIDE;
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const wxOVERRIDE;
int SetSelection(size_t nPage) wxOVERRIDE;
int ChangeSelection(size_t nPage) wxOVERRIDE;
virtual bool DeleteAllPages() wxOVERRIDE;
virtual QWidget *GetHandle() const wxOVERRIDE;
protected:
virtual wxWindow *DoRemovePage(size_t page) wxOVERRIDE;
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_

31
wxheaders/wx/qt/palette.h Normal file
View file

@ -0,0 +1,31 @@
/////////////////////////////////////////////////////////////////////////////
// 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 wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxPalette);
};
#endif // _WX_QT_PALETTE_H_

57
wxheaders/wx/qt/pen.h Normal file
View file

@ -0,0 +1,57 @@
/////////////////////////////////////////////////////////////////////////////
// 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_
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) wxOVERRIDE;
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) wxOVERRIDE;
virtual void SetWidth(int width) wxOVERRIDE;
virtual void SetStyle(wxPenStyle style) wxOVERRIDE;
virtual void SetStipple(const wxBitmap& stipple) wxOVERRIDE;
virtual void SetDashes(int nb_dashes, const wxDash *dash) wxOVERRIDE;
virtual void SetJoin(wxPenJoin join) wxOVERRIDE;
virtual void SetCap(wxPenCap cap) wxOVERRIDE;
virtual wxColour GetColour() const wxOVERRIDE;
virtual wxBitmap *GetStipple() const wxOVERRIDE;
virtual wxPenStyle GetStyle() const wxOVERRIDE;
virtual wxPenJoin GetJoin() const wxOVERRIDE;
virtual wxPenCap GetCap() const wxOVERRIDE;
virtual int GetWidth() const wxOVERRIDE;
virtual int GetDashes(wxDash **ptr) const wxOVERRIDE;
wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants")
void SetStyle(int style) { SetStyle((wxPenStyle)style); }
QPen GetHandle() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxPen);
};
#endif // _WX_QT_PEN_H_

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:
wxDECLARE_DYNAMIC_CLASS(wxPopupWindow);
};
#endif // _WX_QT_POPUPWIN_H_

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 ) wxOVERRIDE;
virtual bool TransferFrom( const wxPrintData &data ) wxOVERRIDE;
virtual bool IsOk() const wxOVERRIDE;
};
class WXDLLIMPEXP_CORE wxQtPrintDialog : public wxPrintDialogBase
{
public:
wxQtPrintDialog(wxWindow *parent, wxPrintDialogData *data);
wxQtPrintDialog(wxWindow *parent, wxPrintData *data);
virtual wxPrintDialogData& GetPrintDialogData() wxOVERRIDE;
virtual wxPrintData& GetPrintData() wxOVERRIDE;
virtual wxDC *GetPrintDC() wxOVERRIDE;
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() wxOVERRIDE;
private:
};
#endif // _WX_QT_PRINTDLG_H_

42
wxheaders/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) wxOVERRIDE;
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true) wxOVERRIDE;
virtual wxDC* PrintDialog(wxWindow *parent) wxOVERRIDE;
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) wxOVERRIDE;
virtual void DetermineScaling() wxOVERRIDE;
protected:
};
#endif // _WX_QT_PRINTQT_H_

View file

@ -0,0 +1,96 @@
///////////////////////////////////////////////////////////////////////////////
// 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 "wx/kbdstate.h"
#include "wx/gdicmn.h"
#include "wx/colour.h"
#include <QtCore/QRect>
#include <QtCore/QSize>
#include <QtCore/QString>
#include <QtGui/QColor>
// Rely on overloading and let the compiler pick the correct version, which makes
// them easier to use then to write wxQtConvertQtRectToWxRect() or wxQtConvertWxRectToQtRect()
inline wxPoint wxQtConvertPoint( const QPoint &point )
{
return wxPoint( point.x(), point.y() );
}
inline QPoint wxQtConvertPoint( const wxPoint &point )
{
return QPoint( point.x, point.y );
}
inline wxRect wxQtConvertRect( const QRect &rect )
{
return wxRect( rect.x(), rect.y(), rect.width(), rect.height() );
}
inline QRect wxQtConvertRect( const wxRect &rect )
{
return QRect( rect.GetX(), rect.GetY(), rect.GetWidth(), rect.GetHeight() );
}
// TODO: Check whether QString::toStdString/QString::toStdWString might be faster
inline wxString wxQtConvertString( const QString &str )
{
return wxString( str.toUtf8().data(), wxConvUTF8 );
}
inline QString wxQtConvertString( const wxString &str )
{
return QString( str.utf8_str() );
}
inline wxColour wxQtConvertColour(const QColor &colour)
{
return wxColour(colour.red(), colour.green(), colour.blue(), colour.alpha());
}
inline QColor wxQtConvertColour(const wxColour &colour)
{
return QColor(colour.Red(), colour.Green(), colour.Blue(), colour.Alpha());
}
#if wxUSE_DATETIME
class WXDLLIMPEXP_FWD_BASE wxDateTime;
class QDate;
wxDateTime wxQtConvertDate(const QDate& date);
QDate wxQtConvertDate(const wxDateTime& date);
#endif // wxUSE_DATETIME
inline wxSize wxQtConvertSize( const QSize &size )
{
return wxSize(size.width(), size.height());
}
inline QSize wxQtConvertSize( const wxSize &size )
{
return QSize(size.GetWidth(), size.GetHeight());
}
Qt::Orientation wxQtConvertOrientation( long style, wxOrientation defaultOrientation );
wxOrientation wxQtConvertOrientation( Qt::Orientation );
wxKeyCode wxQtConvertKeyCode( int key, 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,43 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/private/pointer.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_POINTER_H_
#define _WX_QT_POINTER_H_
#include <QtCore/QPointer>
// Extend QPointer with the ability to delete the object in its destructor. The
// normal behaviour of the QPointer makes sure that this is safe, because if somebody
// has deleted the object, then data() returns NULL and delete does nothing.
template < typename T >
class wxQtPointer : public QPointer< T >
{
public:
inline wxQtPointer()
: QPointer< T >()
{
}
inline wxQtPointer( T *p )
: QPointer< T >( p )
{
}
inline wxQtPointer< T > &operator = ( T *p )
{
QPointer< T >::operator = ( p );
return *this;
}
inline ~wxQtPointer()
{
delete QPointer< T >::data();
}
};
#endif // _WX_QT_POINTER_H_

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 <QtCore/QObject>
#include "wx/private/timer.h"
//-----------------------------------------------------------------------------
// wxTimer
//-----------------------------------------------------------------------------
class QTimerEvent;
class WXDLLIMPEXP_CORE wxQtTimerImpl : public wxTimerImpl, QObject
{
public:
wxQtTimerImpl( wxTimer* timer );
virtual bool Start( int millisecs = -1, bool oneShot = false ) wxOVERRIDE;
virtual void Stop() wxOVERRIDE;
virtual bool IsRunning() const wxOVERRIDE;
protected:
virtual void timerEvent( QTimerEvent * event ) wxOVERRIDE;
private:
int m_timerId;
};
#endif // wxUSE_TIMER
#endif // _WX_QT_TIMER_H_

View file

@ -0,0 +1,99 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/private/treeitemdelegate.h
// Purpose: Delegate to create text edit controls for the tree items
// Author: Matthew Griffin
// Created: 2019-05-29
// Copyright: Matthew Griffin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_PRIVATE_TREEITEM_DELEGATE_H
#define _WX_QT_PRIVATE_TREEITEM_DELEGATE_H
#include <QtWidgets/QStyledItemDelegate>
#include <QtWidgets/QToolTip>
#include "wx/app.h"
#include "wx/textctrl.h"
#include "treeitemfactory.h"
class wxQTTreeItemDelegate : public QStyledItemDelegate
{
public:
explicit wxQTTreeItemDelegate(wxWindow* parent)
: m_parent(parent),
m_textCtrl(NULL)
{
}
QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &WXUNUSED(option), const QModelIndex &index) const wxOVERRIDE
{
if ( m_textCtrl != NULL )
destroyEditor(m_textCtrl->GetHandle(), m_currentModelIndex);
m_currentModelIndex = index;
m_textCtrl = new wxQtListTextCtrl(m_parent, parent);
m_textCtrl->SetFocus();
return m_textCtrl->GetHandle();
}
void destroyEditor(QWidget *WXUNUSED(editor), const QModelIndex &WXUNUSED(index)) const wxOVERRIDE
{
if ( m_textCtrl != NULL )
{
m_currentModelIndex = QModelIndex(); // invalidate the index
wxTheApp->ScheduleForDestruction(m_textCtrl);
m_textCtrl = NULL;
}
}
void setModelData(QWidget *WXUNUSED(editor), QAbstractItemModel *WXUNUSED(model), const QModelIndex &WXUNUSED(index)) const wxOVERRIDE
{
// Don't set model data until wx has had a chance to send out events
}
wxTextCtrl* GetEditControl() const
{
return m_textCtrl;
}
QModelIndex GetCurrentModelIndex() const
{
return m_currentModelIndex;
}
void AcceptModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
{
QStyledItemDelegate::setModelData(editor, model, index);
}
bool helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index)
{
if ( event->type() == QEvent::ToolTip )
{
const QRect &itemRect = view->visualRect(index);
const QSize &bestSize = sizeHint(option, index);
if ( itemRect.width() < bestSize.width() )
{
const QString &value = index.data(Qt::DisplayRole).toString();
QToolTip::showText(event->globalPos(), value, view);
}
else
{
QToolTip::hideText();
}
return true;
}
return QStyledItemDelegate::helpEvent(event, view, option, index);
}
private:
wxWindow* m_parent;
mutable wxTextCtrl* m_textCtrl;
mutable QModelIndex m_currentModelIndex;
};
#endif // _WX_QT_PRIVATE_TREEITEM_DELEGATE_H

View file

@ -0,0 +1,122 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/private/treeitemfactory.h
// Purpose: Factory to create text edit controls for the tree items
// Author: Graham Dawes
// Created: 2019-02-07
// Copyright: Graham Dawes
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_PRIVATE_TREEITEM_FACTORY_H_
#define _WX_QT_PRIVATE_TREEITEM_FACTORY_H_
#include <QtWidgets/QItemEditorFactory>
#include <QtWidgets/QTreeWidget>
#include <QtWidgets/QItemDelegate>
#include "wx/recguard.h"
#include "wx/textctrl.h"
// wxQT Doesn't have a mechanism for "adopting" external widgets so we have to
// create an instance of wxTextCtrl rather than adopting the control QT would
// create.
//
// Unfortunately the factory is given an internal widget as the parent for
// editor.
//
// To work around these issues we create a wxTextCtl parented by the wxListCtrl
// then recalculate its position relative to the internal widget.
class wxQtListTextCtrl : public wxTextCtrl
{
public:
wxQtListTextCtrl(wxWindow* parent, QWidget* actualParent)
: wxTextCtrl(parent, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxNO_BORDER),
m_actualParent(actualParent),
m_moving(0)
{
Bind(wxEVT_MOVE, &wxQtListTextCtrl::OnMove, this);
}
void OnMove(wxMoveEvent &event)
{
// QWidget::move generates a QMoveEvent so we need to guard against
// reentrant calls.
wxRecursionGuard guard(m_moving);
if ( guard.IsInside() )
{
event.Skip();
return;
}
const QPoint eventPos = wxQtConvertPoint(event.GetPosition());
const QPoint globalPos = m_actualParent->mapToGlobal(eventPos);
// For some reason this always gives us the offset from the header info
// the internal control. So we need to treat this as an offset rather
// than a position.
QWidget* widget = GetHandle();
const QPoint offset = widget->mapFromGlobal(globalPos);
widget->move(eventPos + offset);
}
private:
QWidget* m_actualParent;
wxRecursionGuardFlag m_moving;
wxDECLARE_NO_COPY_CLASS(wxQtListTextCtrl);
};
// QT doesn't give us direct access to the editor within the QTreeWidget.
// Instead, we'll supply a factory to create the widget for QT and keep track
// of it ourselves.
class wxQtTreeItemEditorFactory : public QItemEditorFactory
{
public:
explicit wxQtTreeItemEditorFactory(wxWindow* parent)
: m_parent(parent),
m_textCtrl(NULL)
{
}
void AttachTo(QTreeWidget *tree)
{
QAbstractItemDelegate* delegate = tree->itemDelegate();
QItemDelegate *qItemDelegate = static_cast<QItemDelegate*>(delegate);
qItemDelegate->setItemEditorFactory(this);
}
QWidget* createEditor(int WXUNUSED(userType), QWidget* parent) const wxOVERRIDE
{
if (m_textCtrl != NULL)
ClearEditor();
m_textCtrl = new wxQtListTextCtrl(m_parent, parent);
m_textCtrl->SetFocus();
return m_textCtrl->GetHandle();
}
wxTextCtrl* GetEditControl() const
{
return m_textCtrl;
}
void ClearEditor() const
{
delete m_textCtrl;
m_textCtrl = NULL;
}
private:
wxWindow* m_parent;
mutable wxTextCtrl* m_textCtrl;
wxDECLARE_NO_COPY_CLASS(wxQtTreeItemEditorFactory);
};
#endif //_WX_QT_PRIVATE_TREEITEM_FACTORY_H_

View file

@ -0,0 +1,27 @@
///////////////////////////////////////////////////////////////////////////////
// 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__ )
#endif // _WX_QT_UTILS_H_

View file

@ -0,0 +1,461 @@
/////////////////////////////////////////////////////////////////////////////
// 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 <QtCore/QEvent>
#include <QtGui/QCloseEvent>
#include "wx/log.h"
#include "wx/window.h"
#include "wx/qt/private/converter.h"
#include "wx/qt/private/utils.h"
#include <QtWidgets/QGestureEvent>
#include <QtGui/QCursor>
class 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 immediately 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 );
Widget::setMouseTracking(true);
}
void HandleDestroyedSignal()
{
}
virtual Handler *GetHandler() const wxOVERRIDE
{
// Only process the signal / event if the wxWindow is not destroyed
if ( !wxWindow::QtRetrieveWindowPointer( this ) )
{
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 ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleChangeEvent(this, event) )
Widget::changeEvent(event);
else
event->accept();
}
//wxCloseEvent
virtual void closeEvent ( QCloseEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleCloseEvent(this, event) )
Widget::closeEvent(event);
else
event->ignore();
}
//wxContextMenuEvent
virtual void contextMenuEvent ( QContextMenuEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleContextMenuEvent(this, event) )
Widget::contextMenuEvent(event);
else
event->accept();
}
//wxDropFilesEvent
//virtual void dropEvent ( QDropEvent * event ) { }
//wxMouseEvent
virtual void enterEvent ( QEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleEnterEvent(this, event) )
Widget::enterEvent(event);
else
event->accept();
}
//wxFocusEvent.
virtual void focusInEvent ( QFocusEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleFocusEvent(this, event) )
Widget::focusInEvent(event);
else
event->accept();
}
//wxFocusEvent.
virtual void focusOutEvent ( QFocusEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleFocusEvent(this, event) )
Widget::focusOutEvent(event);
else
event->accept();
}
//wxShowEvent
virtual void hideEvent ( QHideEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleShowEvent(this, event) )
Widget::hideEvent(event);
else
event->accept();
}
//wxKeyEvent
virtual void keyPressEvent ( QKeyEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleKeyEvent(this, event) )
Widget::keyPressEvent(event);
else
event->accept();
}
//wxKeyEvent
virtual void keyReleaseEvent ( QKeyEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleKeyEvent(this, event) )
Widget::keyReleaseEvent(event);
else
event->accept();
}
//wxMouseEvent
virtual void leaveEvent ( QEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleEnterEvent(this, event) )
Widget::leaveEvent(event);
else
event->accept();
}
//wxMouseEvent
virtual void mouseDoubleClickEvent ( QMouseEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
Widget::mouseDoubleClickEvent(event);
else
event->accept();
}
//wxMouseEvent
virtual void mouseMoveEvent ( QMouseEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
Widget::mouseMoveEvent(event);
else
event->accept();
}
//wxMouseEvent
virtual void mousePressEvent ( QMouseEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
Widget::mousePressEvent(event);
else
event->accept();
}
//wxMouseEvent
virtual void mouseReleaseEvent ( QMouseEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
Widget::mouseReleaseEvent(event);
else
event->accept();
}
//wxMoveEvent
virtual void moveEvent ( QMoveEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleMoveEvent(this, event) )
Widget::moveEvent(event);
else
event->accept();
}
//wxEraseEvent then wxPaintEvent
virtual void paintEvent ( QPaintEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandlePaintEvent(this, event) )
Widget::paintEvent(event);
else
event->accept();
}
//wxSizeEvent
virtual void resizeEvent ( QResizeEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleResizeEvent(this, event) )
Widget::resizeEvent(event);
else
event->accept();
}
//wxShowEvent
virtual void showEvent ( QShowEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
if ( !this->GetHandler()->QtHandleShowEvent(this, event) )
Widget::showEvent(event);
else
event->accept();
}
//wxMouseEvent
virtual void wheelEvent ( QWheelEvent * event ) wxOVERRIDE
{
if ( !this->GetHandler() )
return;
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 ) { } */
virtual bool event(QEvent *event)
{
if (event->type() == QEvent::Gesture)
{
return gestureEvent(static_cast<QGestureEvent*>(event), event);
}
return Widget::event(event);
}
bool gestureEvent(QGestureEvent *gesture, QEvent *event)
{
if (QGesture *tah = gesture->gesture(Qt::TapAndHoldGesture))
{
// Set the policy so that accepted gestures are taken by the first window that gets them
tah->setGestureCancelPolicy ( QGesture::CancelAllInContext );
tapandholdTriggered(static_cast<QTapAndHoldGesture *>(tah), event);
}
if (QGesture *pan = gesture->gesture(Qt::PanGesture))
{
panTriggered(static_cast<QPanGesture *>(pan), event);
}
if (QGesture *pinch = gesture->gesture(Qt::PinchGesture))
{
pinchTriggered(static_cast<QPinchGesture *>(pinch), event);
}
return true;
}
void tapandholdTriggered(QTapAndHoldGesture *gesture, QEvent *event)
{
wxWindow *win = wxWindow::QtRetrieveWindowPointer( this );
if (gesture->state() == Qt::GestureFinished)
{
if ( win )
{
wxLongPressEvent ev(win->GetId());
ev.SetPosition( wxQtConvertPoint( gesture->position().toPoint() ) );
ev.SetGestureEnd();
win->ProcessWindowEvent( ev );
event->accept();
}
}
else if (gesture->state() == Qt::GestureStarted)
{
event->accept();
}
else
{
event->accept();
}
}
void panTriggered(QPanGesture *gesture, QEvent *event)
{
wxWindow *win = wxWindow::QtRetrieveWindowPointer( this );
if (win)
{
wxPanGestureEvent evp(win->GetId());
QPoint pos = QCursor::pos();
evp.SetPosition( wxQtConvertPoint( pos ) );
QPoint offset = gesture->offset().toPoint();
QPoint offset_last = gesture->lastOffset().toPoint();
QPoint delta(offset.x() - offset_last.x(), offset.y() - offset_last.y());
evp.SetDelta( wxQtConvertPoint( delta ) );
switch(gesture->state())
{
case Qt::GestureStarted:
evp.SetGestureStart();
break;
case Qt::GestureFinished:
case Qt::GestureCanceled:
evp.SetGestureEnd();
break;
default:
break;
}
win->ProcessWindowEvent( evp );
event->accept();
}
}
void pinchTriggered(QPinchGesture *gesture, QEvent *event)
{
wxWindow *win = wxWindow::QtRetrieveWindowPointer( this );
if (win)
{
qreal this_sf = gesture->scaleFactor();
QPoint center_point = gesture->centerPoint().toPoint();
wxZoomGestureEvent evp(win->GetId());
evp.SetPosition( wxQtConvertPoint( center_point ) );
evp.SetZoomFactor( this_sf);
switch(gesture->state())
{
case Qt::GestureStarted:
evp.SetGestureStart();
break;
case Qt::GestureFinished:
case Qt::GestureCanceled:
evp.SetGestureEnd();
break;
default:
break;
}
win->ProcessWindowEvent( evp );
event->accept();
}
}
};
#endif

View file

@ -0,0 +1,97 @@
/////////////////////////////////////////////////////////////////////////////
// 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_
class QGroupBox;
class QButtonGroup;
class QGridLayout;
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 = wxASCII_STR(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 = wxASCII_STR(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 = wxASCII_STR(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 = wxASCII_STR(wxRadioBoxNameStr));
using wxWindowBase::Show;
using wxWindowBase::Enable;
using wxRadioBoxBase::GetDefaultBorder;
virtual bool Enable(unsigned int n, bool enable = true) wxOVERRIDE;
virtual bool Enable(bool enable = true) wxOVERRIDE;
virtual bool Show(unsigned int n, bool show = true) wxOVERRIDE;
virtual bool Show(bool show = true) wxOVERRIDE;
virtual bool IsItemEnabled(unsigned int n) const wxOVERRIDE;
virtual bool IsItemShown(unsigned int n) const wxOVERRIDE;
virtual unsigned int GetCount() const wxOVERRIDE;
virtual wxString GetString(unsigned int n) const wxOVERRIDE;
virtual void SetString(unsigned int n, const wxString& s) wxOVERRIDE;
virtual void SetSelection(int n) wxOVERRIDE;
virtual int GetSelection() const wxOVERRIDE;
virtual QWidget *GetHandle() const wxOVERRIDE;
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.):
QGridLayout *m_qtGridLayout;
wxDECLARE_DYNAMIC_CLASS(wxRadioBox);
};
#endif // _WX_QT_RADIOBOX_H_

View file

@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// 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_
class QRadioButton;
class WXDLLIMPEXP_CORE wxRadioButton : public wxRadioButtonBase
{
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 = wxASCII_STR(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 = wxASCII_STR(wxRadioButtonNameStr) );
virtual void SetValue(bool value) wxOVERRIDE;
virtual bool GetValue() const wxOVERRIDE;
virtual QWidget *GetHandle() const wxOVERRIDE;
private:
QRadioButton *m_qtRadioButton;
wxDECLARE_DYNAMIC_CLASS( wxRadioButton );
};
#endif // _WX_QT_RADIOBUT_H_

93
wxheaders/wx/qt/region.h Normal file
View file

@ -0,0 +1,93 @@
/////////////////////////////////////////////////////////////////////////////
// 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_
class QRegion;
class QRect;
template<class T> class QVector;
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 wxOVERRIDE;
virtual void Clear() wxOVERRIDE;
virtual const QRegion &GetHandle() const;
virtual void QtSetRegion(QRegion region); // Hangs on to this region
protected:
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
virtual bool DoIsEqual(const wxRegion& region) const wxOVERRIDE;
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const wxOVERRIDE;
virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const wxOVERRIDE;
virtual wxRegionContain DoContainsRect(const wxRect& rect) const wxOVERRIDE;
virtual bool DoOffset(wxCoord x, wxCoord y) wxOVERRIDE;
virtual bool DoUnionWithRect(const wxRect& rect) wxOVERRIDE;
virtual bool DoUnionWithRegion(const wxRegion& region) wxOVERRIDE;
virtual bool DoIntersect(const wxRegion& region) wxOVERRIDE;
virtual bool DoSubtract(const wxRegion& region) wxOVERRIDE;
virtual bool DoXor(const wxRegion& region) wxOVERRIDE;
virtual bool DoCombine(const wxRegion& rgn, wxRegionOp op);
private:
wxDECLARE_DYNAMIC_CLASS(wxRegion);
};
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;
wxDECLARE_DYNAMIC_CLASS(wxRegionIterator);
};
#endif // _WX_QT_REGION_H_

View file

@ -0,0 +1,55 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/scrolbar.h
// Author: Peter Most, Javier Torres, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_SCROLBAR_H_
#define _WX_QT_SCROLBAR_H_
#include "wx/scrolbar.h"
class 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 = wxASCII_STR(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 = wxASCII_STR(wxScrollBarNameStr) );
virtual int GetThumbPosition() const wxOVERRIDE;
virtual int GetThumbSize() const wxOVERRIDE;
virtual int GetPageSize() const wxOVERRIDE;
virtual int GetRange() const wxOVERRIDE;
virtual void SetThumbPosition(int viewStart) wxOVERRIDE;
virtual void SetScrollbar(int position, int thumbSize,
int range, int pageSize,
bool refresh = true) wxOVERRIDE;
QScrollBar *GetQScrollBar() const { return m_qtScrollBar; }
QWidget *GetHandle() const wxOVERRIDE;
private:
QScrollBar *m_qtScrollBar;
wxDECLARE_DYNAMIC_CLASS(wxScrollBar);
};
#endif // _WX_QT_SCROLBAR_H_

61
wxheaders/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_
class 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 = wxASCII_STR(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 = wxASCII_STR(wxSliderNameStr));
virtual int GetValue() const wxOVERRIDE;
virtual void SetValue(int value) wxOVERRIDE;
virtual void SetRange(int minValue, int maxValue) wxOVERRIDE;
virtual int GetMin() const wxOVERRIDE;
virtual int GetMax() const wxOVERRIDE;
virtual void DoSetTickFreq(int freq) wxOVERRIDE;
virtual int GetTickFreq() const wxOVERRIDE;
virtual void SetLineSize(int lineSize) wxOVERRIDE;
virtual void SetPageSize(int pageSize) wxOVERRIDE;
virtual int GetLineSize() const wxOVERRIDE;
virtual int GetPageSize() const wxOVERRIDE;
virtual void SetThumbLength(int lenPixels) wxOVERRIDE;
virtual int GetThumbLength() const wxOVERRIDE;
virtual QWidget *GetHandle() const wxOVERRIDE;
private:
QSlider *m_qtSlider;
wxDECLARE_DYNAMIC_CLASS( wxSlider );
};
#endif // _WX_QT_SLIDER_H_

View file

@ -0,0 +1,44 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/spinbutt.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_SPINBUTT_H_
#define _WX_QT_SPINBUTT_H_
#include "wx/spinbutt.h"
class 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 wxOVERRIDE;
virtual void SetValue(int val) wxOVERRIDE;
virtual void SetRange(int min, int max) wxOVERRIDE;
virtual QWidget *GetHandle() const wxOVERRIDE;
private:
QSpinBox *m_qtSpinBox;
wxDECLARE_DYNAMIC_CLASS( wxSpinButton );
};
#endif // _WX_QT_SPINBUTT_H_

128
wxheaders/wx/qt/spinctrl.h Normal file
View file

@ -0,0 +1,128 @@
/////////////////////////////////////////////////////////////////////////////
// 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_
class QSpinBox;
class 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 wxString GetTextValue() const wxOVERRIDE;
virtual void SetValue(const wxString&) wxOVERRIDE {}
virtual void SetSnapToTicks(bool snap_to_ticks) wxOVERRIDE;
virtual bool GetSnapToTicks() const wxOVERRIDE;
virtual void SetSelection(long from, long to) wxOVERRIDE;
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 QWidget *GetHandle() const wxOVERRIDE;
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,
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,
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) wxOVERRIDE;
virtual void SetValue(int val) wxOVERRIDE { wxSpinCtrlQt<int,QSpinBox>::SetValue(val); }
private:
// Common part of all ctors.
void Init()
{
m_base = 10;
}
int m_base;
wxDECLARE_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,
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,
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) wxOVERRIDE;
virtual void SetValue(double val) wxOVERRIDE { wxSpinCtrlQt<double,QDoubleSpinBox>::SetValue(val); }
private:
wxDECLARE_DYNAMIC_CLASS( wxSpinCtrlDouble );
};
#endif // _WX_QT_SPINCTRL_H_

45
wxheaders/wx/qt/statbmp.h Normal file
View file

@ -0,0 +1,45 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/statbmp.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_STATBMP_H_
#define _WX_QT_STATBMP_H_
class QLabel;
class WXDLLIMPEXP_CORE wxStaticBitmap : public wxStaticBitmapBase
{
public:
wxStaticBitmap();
wxStaticBitmap( wxWindow *parent,
wxWindowID id,
const wxBitmapBundle& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxASCII_STR(wxStaticBitmapNameStr) );
bool Create( wxWindow *parent,
wxWindowID id,
const wxBitmapBundle& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxASCII_STR(wxStaticBitmapNameStr));
virtual void SetBitmap(const wxBitmapBundle& bitmap) wxOVERRIDE;
virtual wxBitmap GetBitmap() const wxOVERRIDE;
virtual QWidget *GetHandle() const wxOVERRIDE;
protected:
private:
QLabel *m_qtLabel;
wxDECLARE_DYNAMIC_CLASS(wxStaticBitmap);
};
#endif // _WX_QT_STATBMP_H_

47
wxheaders/wx/qt/statbox.h Normal file
View file

@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////
// 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_
class 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 = wxASCII_STR(wxStaticBoxNameStr));
bool Create(wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxASCII_STR(wxStaticBoxNameStr));
virtual void GetBordersForSizer(int *borderTop, int *borderOther) const wxOVERRIDE;
virtual QWidget *GetHandle() const wxOVERRIDE;
virtual void SetLabel(const wxString& label) wxOVERRIDE;
virtual wxString GetLabel() const wxOVERRIDE;
protected:
private:
QGroupBox *m_qtGroupBox;
wxDECLARE_DYNAMIC_CLASS( wxStaticBox );
};
#endif // _WX_QT_STATBOX_H_

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_
class 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 = wxASCII_STR(wxStaticLineNameStr) );
bool Create( wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLI_HORIZONTAL,
const wxString &name = wxASCII_STR(wxStaticLineNameStr) );
virtual QWidget *GetHandle() const wxOVERRIDE;
private:
QFrame *m_qtFrame;
wxDECLARE_DYNAMIC_CLASS( wxStaticLine );
};
#endif // _WX_QT_STATLINE_H_

View file

@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////
// 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_
class 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 = wxASCII_STR(wxStaticTextNameStr) );
bool Create(wxWindow *parent,
wxWindowID id,
const wxString &label,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxString &name = wxASCII_STR(wxStaticTextNameStr) );
virtual void SetLabel(const wxString& label) wxOVERRIDE;
virtual QWidget *GetHandle() const wxOVERRIDE;
protected:
virtual wxString WXGetVisibleLabel() const wxOVERRIDE;
virtual void WXSetVisibleLabel(const wxString& str) wxOVERRIDE;
private:
QLabel *m_qtLabel;
wxDECLARE_DYNAMIC_CLASS( wxStaticText );
};
#endif // _WX_QT_STATTEXT_H_

View file

@ -0,0 +1,54 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/statusbar.h
// Author: Peter Most, Javier Torres, Mariano Reingart, Sean D'Epagnier
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_STATUSBAR_H_
#define _WX_QT_STATUSBAR_H_
#include "wx/statusbr.h"
class QLabel;
class QStatusBar;
template < class T > class QList;
class WXDLLIMPEXP_CORE wxStatusBar : public wxStatusBarBase
{
public:
wxStatusBar();
wxStatusBar(wxWindow *parent, wxWindowID winid = wxID_ANY,
long style = wxSTB_DEFAULT_STYLE,
const wxString& name = wxASCII_STR(wxStatusBarNameStr));
bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY,
long style = wxSTB_DEFAULT_STYLE,
const wxString& name = wxASCII_STR(wxStatusBarNameStr));
virtual bool GetFieldRect(int i, wxRect& rect) const wxOVERRIDE;
virtual void SetMinHeight(int height) wxOVERRIDE;
virtual int GetBorderX() const wxOVERRIDE;
virtual int GetBorderY() const wxOVERRIDE;
virtual void Refresh( bool eraseBackground = true,
const wxRect *rect = (const wxRect *) NULL ) wxOVERRIDE;
QStatusBar *GetQStatusBar() const { return m_qtStatusBar; }
QWidget *GetHandle() const wxOVERRIDE;
protected:
virtual void DoUpdateStatusText(int number) wxOVERRIDE;
private:
void Init();
void UpdateFields();
QStatusBar *m_qtStatusBar;
wxVector<QLabel*> m_qtPanes;
wxDECLARE_DYNAMIC_CLASS(wxStatusBar);
};
#endif // _WX_QT_STATUSBAR_H_

35
wxheaders/wx/qt/taskbar.h Normal file
View file

@ -0,0 +1,35 @@
/////////////////////////////////////////////////////////////////////////////
// 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_
class QSystemTrayIcon;
class WXDLLIMPEXP_ADV wxTaskBarIcon : public wxTaskBarIconBase
{
public:
wxTaskBarIcon(wxTaskBarIconType iconType = wxTBI_DEFAULT_TYPE);
virtual ~wxTaskBarIcon();
// Accessors
bool IsOk() const { return false; }
bool IsIconInstalled() const { return false; }
// Operations
virtual bool SetIcon(const wxBitmapBundle& icon,
const wxString& tooltip = wxEmptyString) wxOVERRIDE;
virtual bool RemoveIcon() wxOVERRIDE;
virtual bool PopupMenu(wxMenu *menu) wxOVERRIDE;
private:
QSystemTrayIcon *m_qtSystemTrayIcon;
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxTaskBarIcon);
};
#endif // _WX_QT_TASKBAR_H_

View file

@ -0,0 +1,80 @@
/////////////////////////////////////////////////////////////////////////////
// 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_
class QScrollArea;
class wxQtEdit;
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 = wxASCII_STR(wxTextCtrlNameStr));
virtual ~wxTextCtrl();
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 = wxASCII_STR(wxTextCtrlNameStr));
virtual int GetLineLength(long lineNo) const wxOVERRIDE;
virtual wxString GetLineText(long lineNo) const wxOVERRIDE;
virtual int GetNumberOfLines() const wxOVERRIDE;
virtual bool IsModified() const wxOVERRIDE;
virtual void MarkDirty() wxOVERRIDE;
virtual void DiscardEdits() wxOVERRIDE;
virtual bool SetStyle(long start, long end, const wxTextAttr& style) wxOVERRIDE;
virtual bool GetStyle(long position, wxTextAttr& style) wxOVERRIDE;
virtual bool SetDefaultStyle(const wxTextAttr& style) wxOVERRIDE;
virtual long XYToPosition(long x, long y) const wxOVERRIDE;
virtual bool PositionToXY(long pos, long *x, long *y) const wxOVERRIDE;
virtual void ShowPosition(long pos) wxOVERRIDE;
virtual void SetInsertionPoint(long pos) wxOVERRIDE;
virtual long GetInsertionPoint() const wxOVERRIDE;
virtual void SetSelection( long from, long to ) wxOVERRIDE;
virtual void GetSelection(long *from, long *to) const wxOVERRIDE;
virtual wxString DoGetValue() const wxOVERRIDE;
virtual void DoSetValue(const wxString &text, int flags = 0) wxOVERRIDE;
virtual void WriteText(const wxString& text) wxOVERRIDE;
virtual QWidget *GetHandle() const wxOVERRIDE;
protected:
virtual wxSize DoGetBestSize() const wxOVERRIDE;
virtual bool DoLoadFile(const wxString& file, int fileType) wxOVERRIDE;
virtual bool DoSaveFile(const wxString& file, int fileType) wxOVERRIDE;
virtual QScrollArea *QtGetScrollBarsContainer() const wxOVERRIDE;
private:
wxQtEdit *m_qtEdit;
wxDECLARE_DYNAMIC_CLASS( wxTextCtrl );
};
#endif // _WX_QT_TEXTCTRL_H_

View file

@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/textentry.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// 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) wxOVERRIDE;
virtual void Remove(long from, long to) wxOVERRIDE;
virtual void Copy() wxOVERRIDE;
virtual void Cut() wxOVERRIDE;
virtual void Paste() wxOVERRIDE;
virtual void Undo() wxOVERRIDE;
virtual void Redo() wxOVERRIDE;
virtual bool CanUndo() const wxOVERRIDE;
virtual bool CanRedo() const wxOVERRIDE;
virtual void SetInsertionPoint(long pos) wxOVERRIDE;
virtual long GetInsertionPoint() const wxOVERRIDE;
virtual long GetLastPosition() const wxOVERRIDE;
virtual void SetSelection(long from, long to) wxOVERRIDE;
virtual void GetSelection(long *from, long *to) const wxOVERRIDE;
virtual bool IsEditable() const wxOVERRIDE;
virtual void SetEditable(bool editable) wxOVERRIDE;
protected:
virtual wxString DoGetValue() const wxOVERRIDE;
virtual void DoSetValue(const wxString& value, int flags=0) wxOVERRIDE;
virtual wxWindow *GetEditableWindow() wxOVERRIDE;
};
#endif // _WX_QT_TEXTENTRY_H_

75
wxheaders/wx/qt/tglbtn.h Normal file
View file

@ -0,0 +1,75 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/tglbtn.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_TGLBTN_H_
#define _WX_QT_TGLBTN_H_
#include "wx/tglbtn.h"
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 = wxASCII_STR(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 = wxASCII_STR(wxCheckBoxNameStr));
virtual void SetValue(bool state) wxOVERRIDE;
virtual bool GetValue() const wxOVERRIDE;
// implementation only
virtual int QtGetEventType() const wxOVERRIDE { return wxEVT_TOGGLEBUTTON; }
private:
wxDECLARE_DYNAMIC_CLASS(wxToggleButton);
};
class WXDLLIMPEXP_CORE wxBitmapToggleButton: public wxToggleButton
{
public:
wxBitmapToggleButton();
wxBitmapToggleButton(wxWindow *parent,
wxWindowID id,
const wxBitmapBundle& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxASCII_STR(wxCheckBoxNameStr));
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmapBundle& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxASCII_STR(wxCheckBoxNameStr));
private:
wxDECLARE_DYNAMIC_CLASS(wxBitmapToggleButton);
};
#endif // _WX_QT_TGLBTN_H_

85
wxheaders/wx/qt/toolbar.h Normal file
View file

@ -0,0 +1,85 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/toolbar.h
// Author: Sean D'Epagnier, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_TOOLBAR_H_
#define _WX_QT_TOOLBAR_H_
class QActionGroup;
class QToolBar;
class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
{
public:
wxToolBar() { Init(); }
wxToolBar(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTB_DEFAULT_STYLE | wxNO_BORDER,
const wxString& name = wxASCII_STR(wxToolBarNameStr))
{
Init();
Create(parent, id, pos, size, style, name);
}
virtual ~wxToolBar();
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTB_DEFAULT_STYLE | wxNO_BORDER,
const wxString& name = wxASCII_STR(wxToolBarNameStr));
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const wxOVERRIDE;
virtual void SetWindowStyleFlag( long style ) wxOVERRIDE;
virtual void SetToolShortHelp(int id, const wxString& helpString) wxOVERRIDE;
virtual void SetToolNormalBitmap(int id, const wxBitmapBundle& bitmap) wxOVERRIDE;
virtual void SetToolDisabledBitmap(int id, const wxBitmapBundle& bitmap) wxOVERRIDE;
virtual bool Realize() wxOVERRIDE;
virtual wxToolBarToolBase *CreateTool(int toolid,
const wxString& label,
const wxBitmapBundle& bmpNormal,
const wxBitmapBundle& bmpDisabled = wxNullBitmap,
wxItemKind kind = wxITEM_NORMAL,
wxObject *clientData = NULL,
const wxString& shortHelp = wxEmptyString,
const wxString& longHelp = wxEmptyString) wxOVERRIDE;
virtual wxToolBarToolBase *CreateTool(wxControl *control,
const wxString& label) wxOVERRIDE;
QWidget *GetHandle() const wxOVERRIDE;
// Private, only used by wxFrame.
QToolBar *GetQToolBar() const { return m_qtToolBar; }
protected:
QActionGroup* GetActionGroup(size_t pos);
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE;
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE;
virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable) wxOVERRIDE;
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE;
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE;
private:
void Init();
long GetButtonStyle();
QToolBar *m_qtToolBar;
wxDECLARE_DYNAMIC_CLASS(wxToolBar);
};
#endif // _WX_QT_TOOLBAR_H_

43
wxheaders/wx/qt/tooltip.h Normal file
View file

@ -0,0 +1,43 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/tooltip.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_TOOLTIP_H_
#define _WX_QT_TOOLTIP_H_
#include "wx/object.h"
class WXDLLIMPEXP_FWD_CORE wxWindow;
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_

View file

@ -0,0 +1,50 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/toplevel.h
// Purpose: declares wxTopLevelWindowNative class
// Author: Peter Most, Javier Torres, Mariano Reingart
// Copyright: (c) 2009 wxWidgets dev team
// 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 = wxASCII_STR(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 = wxASCII_STR(wxFrameNameStr));
virtual bool Show(bool show = true) wxOVERRIDE;
virtual void Maximize(bool maximize = true) wxOVERRIDE;
virtual void Restore() wxOVERRIDE;
virtual void Iconize(bool iconize = true) wxOVERRIDE;
virtual bool IsMaximized() const wxOVERRIDE;
virtual bool IsIconized() const wxOVERRIDE;
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) wxOVERRIDE;
virtual bool IsFullScreen() const wxOVERRIDE;
virtual void SetTitle(const wxString& title) wxOVERRIDE;
virtual wxString GetTitle() const wxOVERRIDE;
virtual void SetIcons(const wxIconBundle& icons) wxOVERRIDE;
// Styles
virtual void SetWindowStyleFlag( long style ) wxOVERRIDE;
virtual long GetWindowStyleFlag() const wxOVERRIDE;
};
#endif // _WX_QT_TOPLEVEL_H_

150
wxheaders/wx/qt/treectrl.h Normal file
View file

@ -0,0 +1,150 @@
/////////////////////////////////////////////////////////////////////////////
// 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_
class wxQTreeWidget;
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 = wxASCII_STR(wxTreeCtrlNameStr));
virtual ~wxTreeCtrl();
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 = wxASCII_STR(wxTreeCtrlNameStr));
virtual unsigned int GetCount() const wxOVERRIDE;
virtual unsigned int GetIndent() const wxOVERRIDE;
virtual void SetIndent(unsigned int indent) wxOVERRIDE;
virtual void SetImageList(wxImageList *imageList) wxOVERRIDE;
virtual void SetStateImageList(wxImageList *imageList) wxOVERRIDE;
virtual wxString GetItemText(const wxTreeItemId& item) const wxOVERRIDE;
virtual int GetItemImage(const wxTreeItemId& item,
wxTreeItemIcon which = wxTreeItemIcon_Normal) const wxOVERRIDE;
virtual wxTreeItemData *GetItemData(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxColour GetItemTextColour(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxColour GetItemBackgroundColour(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxFont GetItemFont(const wxTreeItemId& item) const wxOVERRIDE;
virtual void SetItemText(const wxTreeItemId& item, const wxString& text) wxOVERRIDE;
virtual void SetItemImage(const wxTreeItemId& item,
int image,
wxTreeItemIcon which = wxTreeItemIcon_Normal) wxOVERRIDE;
virtual void SetItemData(const wxTreeItemId& item, wxTreeItemData *data) wxOVERRIDE;
virtual void SetItemHasChildren(const wxTreeItemId& item, bool has = true) wxOVERRIDE;
virtual void SetItemBold(const wxTreeItemId& item, bool bold = true) wxOVERRIDE;
virtual void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = true) wxOVERRIDE;
virtual void SetItemTextColour(const wxTreeItemId& item, const wxColour& col) wxOVERRIDE;
virtual void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col) wxOVERRIDE;
virtual void SetItemFont(const wxTreeItemId& item, const wxFont& font) wxOVERRIDE;
virtual bool IsVisible(const wxTreeItemId& item) const wxOVERRIDE;
virtual bool ItemHasChildren(const wxTreeItemId& item) const wxOVERRIDE;
virtual bool IsExpanded(const wxTreeItemId& item) const wxOVERRIDE;
virtual bool IsSelected(const wxTreeItemId& item) const wxOVERRIDE;
virtual bool IsBold(const wxTreeItemId& item) const wxOVERRIDE;
virtual size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = true) const wxOVERRIDE;
virtual wxTreeItemId GetRootItem() const wxOVERRIDE;
virtual wxTreeItemId GetSelection() const wxOVERRIDE;
virtual size_t GetSelections(wxArrayTreeItemIds& selections) const wxOVERRIDE;
virtual void SetFocusedItem(const wxTreeItemId& item) wxOVERRIDE;
virtual void ClearFocusedItem() wxOVERRIDE;
virtual wxTreeItemId GetFocusedItem() const wxOVERRIDE;
virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxTreeItemId GetFirstChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const wxOVERRIDE;
virtual wxTreeItemId GetNextChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const wxOVERRIDE;
virtual wxTreeItemId GetLastChild(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxTreeItemId GetNextSibling(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxTreeItemId GetFirstVisibleItem() const wxOVERRIDE;
virtual wxTreeItemId GetNextVisible(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxTreeItemId AddRoot(const wxString& text,
int image = -1, int selImage = -1,
wxTreeItemData *data = NULL) wxOVERRIDE;
virtual void Delete(const wxTreeItemId& item) wxOVERRIDE;
virtual void DeleteChildren(const wxTreeItemId& item) wxOVERRIDE;
virtual void DeleteAllItems() wxOVERRIDE;
virtual void Expand(const wxTreeItemId& item) wxOVERRIDE;
virtual void Collapse(const wxTreeItemId& item) wxOVERRIDE;
virtual void CollapseAndReset(const wxTreeItemId& item) wxOVERRIDE;
virtual void Toggle(const wxTreeItemId& item) wxOVERRIDE;
virtual void Unselect() wxOVERRIDE;
virtual void UnselectAll() wxOVERRIDE;
virtual void SelectItem(const wxTreeItemId& item, bool select = true) wxOVERRIDE;
virtual void SelectChildren(const wxTreeItemId& parent) wxOVERRIDE;
virtual void EnsureVisible(const wxTreeItemId& item) wxOVERRIDE;
virtual void ScrollTo(const wxTreeItemId& item) wxOVERRIDE;
virtual wxTextCtrl *EditLabel(const wxTreeItemId& item, wxClassInfo* textCtrlClass = CLASSINFO(wxTextCtrl)) wxOVERRIDE;
virtual wxTextCtrl *GetEditControl() const wxOVERRIDE;
virtual void EndEditLabel(const wxTreeItemId& item, bool discardChanges = false) wxOVERRIDE;
virtual void SortChildren(const wxTreeItemId& item) wxOVERRIDE;
virtual bool GetBoundingRect(const wxTreeItemId& item, wxRect& rect, bool textOnly = false) const wxOVERRIDE;
virtual void SetWindowStyleFlag(long styles) wxOVERRIDE;
virtual QWidget *GetHandle() const wxOVERRIDE;
protected:
virtual int DoGetItemState(const wxTreeItemId& item) const wxOVERRIDE;
virtual void DoSetItemState(const wxTreeItemId& item, int state) wxOVERRIDE;
virtual wxTreeItemId DoInsertItem(const wxTreeItemId& parent,
size_t pos,
const wxString& text,
int image, int selImage,
wxTreeItemData *data) wxOVERRIDE;
virtual wxTreeItemId DoInsertAfter(const wxTreeItemId& parent,
const wxTreeItemId& idPrevious,
const wxString& text,
int image = -1, int selImage = -1,
wxTreeItemData *data = NULL) wxOVERRIDE;
virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags) const wxOVERRIDE;
virtual void OnImagesChanged() wxOVERRIDE;
private:
void SendDeleteEvent(const wxTreeItemId &item);
wxTreeItemId GetNext(const wxTreeItemId &item) const;
void DoUpdateIconsSize(wxImageList *imageList);
wxQTreeWidget *m_qtTreeWidget;
wxDECLARE_DYNAMIC_CLASS(wxTreeCtrl);
};
#endif // _WX_QT_TREECTRL_H_

259
wxheaders/wx/qt/window.h Normal file
View file

@ -0,0 +1,259 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/window.h
// Purpose: wxWindow class
// Author: Peter Most, Javier Torres, Mariano Reingart
// Copyright: (c) 2009 wxWidgets dev team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_WINDOW_H_
#define _WX_QT_WINDOW_H_
class QShortcut;
template < class T > class QList;
class QWidget;
class QScrollArea;
class QScrollBar;
class QPicture;
class QPainter;
class QPaintEvent;
class QResizeEvent;
class QWheelEvent;
class QKeyEvent;
class QMouseEvent;
class QEvent;
class QMoveEvent;
class QEvent;
class QEvent;
class QCloseEvent;
class QContextMenuEvent;
class QFocusEvent;
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 differentiate 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 = wxASCII_STR(wxPanelNameStr));
bool Create(wxWindowQt *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxASCII_STR(wxPanelNameStr));
// Used by all window classes in the widget creation process.
void PostCreation( bool generic = true );
void AddChild( wxWindowBase *child ) wxOVERRIDE;
virtual bool Show( bool show = true ) wxOVERRIDE;
virtual void SetLabel(const wxString& label) wxOVERRIDE;
virtual wxString GetLabel() const wxOVERRIDE;
virtual void DoEnable( bool enable ) wxOVERRIDE;
virtual void SetFocus() wxOVERRIDE;
// Parent/Child:
static void QtReparent( QWidget *child, QWidget *parent );
virtual bool Reparent( wxWindowBase *newParent ) wxOVERRIDE;
// Z-order
virtual void Raise() wxOVERRIDE;
virtual void Lower() wxOVERRIDE;
// move the mouse to the specified position
virtual void WarpPointer(int x, int y) wxOVERRIDE;
virtual void Update() wxOVERRIDE;
virtual void Refresh( bool eraseBackground = true,
const wxRect *rect = (const wxRect *) NULL ) wxOVERRIDE;
virtual bool SetCursor( const wxCursor &cursor ) wxOVERRIDE;
virtual bool SetFont(const wxFont& font) wxOVERRIDE;
// get the (average) character size for the current font
virtual int GetCharHeight() const wxOVERRIDE;
virtual int GetCharWidth() const wxOVERRIDE;
virtual void SetScrollbar( int orient,
int pos,
int thumbvisible,
int range,
bool refresh = true ) wxOVERRIDE;
virtual void SetScrollPos( int orient, int pos, bool refresh = true ) wxOVERRIDE;
virtual int GetScrollPos( int orient ) const wxOVERRIDE;
virtual int GetScrollThumb( int orient ) const wxOVERRIDE;
virtual int GetScrollRange( int orient ) const wxOVERRIDE;
// scroll window to the specified position
virtual void ScrollWindow( int dx, int dy,
const wxRect* rect = NULL ) wxOVERRIDE;
// Styles
virtual void SetWindowStyleFlag( long style ) wxOVERRIDE;
virtual void SetExtraStyle( long exStyle ) wxOVERRIDE;
virtual bool SetBackgroundStyle(wxBackgroundStyle style) wxOVERRIDE;
virtual bool IsTransparentBackgroundSupported(wxString* reason = NULL) const wxOVERRIDE;
virtual bool SetTransparent(wxByte alpha) wxOVERRIDE;
virtual bool CanSetTransparent() wxOVERRIDE { return true; }
virtual bool SetBackgroundColour(const wxColour& colour) wxOVERRIDE;
virtual bool SetForegroundColour(const wxColour& colour) wxOVERRIDE;
QWidget *GetHandle() const wxOVERRIDE;
#if wxUSE_DRAG_AND_DROP
virtual void SetDropTarget( wxDropTarget *dropTarget ) wxOVERRIDE;
#endif
#if wxUSE_ACCEL
// accelerators
// ------------
virtual void SetAcceleratorTable( const wxAcceleratorTable& accel ) wxOVERRIDE;
#endif // wxUSE_ACCEL
// wxQt implementation internals:
// Caller maintains ownership of pict - window will NOT delete it
void QtSetPicture( QPicture* pict );
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 );
static void QtSendSetCursorEvent(wxWindowQt* win, wxPoint posClient);
#if wxUSE_ACCEL
virtual void QtHandleShortcut ( int command );
#endif // wxUSE_ACCEL
virtual QScrollArea *QtGetScrollBarsContainer() const;
#if wxUSE_TOOLTIPS
// applies tooltip to the widget.
virtual void QtApplyToolTip(const wxString& text);
#endif // wxUSE_TOOLTIPS
protected:
virtual void DoGetTextExtent(const wxString& string,
int *x, int *y,
int *descent = NULL,
int *externalLeading = NULL,
const wxFont *font = NULL) const wxOVERRIDE;
// coordinates translation
virtual void DoClientToScreen( int *x, int *y ) const wxOVERRIDE;
virtual void DoScreenToClient( int *x, int *y ) const wxOVERRIDE;
// capture/release the mouse, used by Capture/ReleaseMouse()
virtual void DoCaptureMouse() wxOVERRIDE;
virtual void DoReleaseMouse() wxOVERRIDE;
// retrieve the position/size of the window
virtual void DoGetPosition(int *x, int *y) const wxOVERRIDE;
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO) wxOVERRIDE;
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
// same as DoSetSize() for the client size
virtual void DoSetClientSize(int width, int height) wxOVERRIDE;
virtual void DoGetClientSize(int *width, int *height) const wxOVERRIDE;
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE;
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip ) wxOVERRIDE;
#endif // wxUSE_TOOLTIPS
#if wxUSE_MENUS
virtual bool DoPopupMenu(wxMenu *menu, int x, int y) wxOVERRIDE;
#endif // wxUSE_MENUS
// Return the parent to use for children being reparented to us: this is
// overridden in wxFrame to use its central widget rather than the frame
// itself.
virtual QWidget* QtGetParentWidget() const { return GetHandle(); }
virtual bool EnableTouchEvents(int eventsMask) wxOVERRIDE;
QWidget *m_qtWindow;
private:
void Init();
QScrollArea *m_qtContainer; // either NULL or the same as m_qtWindow pointer
QScrollBar *m_horzScrollBar; // owned by m_qtWindow when allocated
QScrollBar *m_vertScrollBar; // owned by m_qtWindow when allocated
// Return the viewport of m_qtContainer, if it's used, or just m_qtWindow.
//
// Always returns non-null pointer if the window has been already created.
QWidget *QtGetClientWidget() const;
QScrollBar *QtGetScrollBar( int orientation ) const;
QScrollBar *QtSetScrollBar( int orientation, QScrollBar *scrollBar=NULL );
bool QtSetBackgroundStyle();
QPicture *m_qtPicture; // not owned
wxScopedPtr<QPainter> m_qtPainter; // always allocated
bool m_mouseInside;
#if wxUSE_ACCEL
wxVector<QShortcut*> m_qtShortcuts; // owned by whatever GetHandle() returns
wxScopedPtr<wxQtShortcutHandler> m_qtShortcutHandler; // always allocated
bool m_processingShortcut;
#endif // wxUSE_ACCEL
wxDECLARE_DYNAMIC_CLASS_NO_COPY( wxWindowQt );
};
#endif // _WX_QT_WINDOW_H_