Merge branch 'master' into web-request

Merge with the latest master in preparation for merging into master.

Rebake to resolve conflicts in generated files.
This commit is contained in:
Vadim Zeitlin
2020-12-12 17:44:45 +01:00
3934 changed files with 147571 additions and 96246 deletions

View File

@@ -14,62 +14,6 @@
typedef struct _GdkPixbufAnimation GdkPixbufAnimation;
typedef struct _GdkPixbufAnimationIter GdkPixbufAnimationIter;
// ----------------------------------------------------------------------------
// wxAnimation
// Unlike the generic wxAnimation object (see generic\animate.cpp), we won't
// use directly wxAnimationHandlers as gdk-pixbuf already provides the
// concept of handler and will automatically use the available handlers.
// Like generic wxAnimation object, this implementation of wxAnimation is
// refcounted so that assignment is very fast
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxAnimation : public wxAnimationBase
{
public:
wxAnimation(const wxString &name, wxAnimationType type = wxANIMATION_TYPE_ANY)
: m_pixbuf(NULL) { LoadFile(name, type); }
wxAnimation(GdkPixbufAnimation *p = NULL);
wxAnimation(const wxAnimation&);
~wxAnimation() { UnRef(); }
wxAnimation& operator= (const wxAnimation&);
virtual bool IsOk() const wxOVERRIDE
{ return m_pixbuf != NULL; }
// unfortunately GdkPixbufAnimation does not expose these info:
virtual unsigned int GetFrameCount() const wxOVERRIDE { return 0; }
virtual wxImage GetFrame(unsigned int frame) const wxOVERRIDE;
// we can retrieve the delay for a frame only after building
// a GdkPixbufAnimationIter...
virtual int GetDelay(unsigned int WXUNUSED(frame)) const wxOVERRIDE { return 0; }
virtual wxSize GetSize() const wxOVERRIDE;
virtual bool LoadFile(const wxString &name, wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
virtual bool Load(wxInputStream &stream, wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
// Implementation
public: // used by GTK callbacks
GdkPixbufAnimation *GetPixbuf() const
{ return m_pixbuf; }
void SetPixbuf(GdkPixbufAnimation* p);
protected:
GdkPixbufAnimation *m_pixbuf;
private:
void UnRef();
typedef wxAnimationBase base_type;
wxDECLARE_DYNAMIC_CLASS(wxAnimation);
};
// ----------------------------------------------------------------------------
// wxAnimationCtrl
// ----------------------------------------------------------------------------
@@ -87,7 +31,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxAC_DEFAULT_STYLE,
const wxString& name = wxAnimationCtrlNameStr)
const wxString& name = wxASCII_STR(wxAnimationCtrlNameStr))
{
Init();
@@ -99,7 +43,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxAC_DEFAULT_STYLE,
const wxString& name = wxAnimationCtrlNameStr);
const wxString& name = wxASCII_STR(wxAnimationCtrlNameStr));
~wxAnimationCtrl();
@@ -112,9 +56,7 @@ public: // public API
virtual bool LoadFile(const wxString& filename, wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
virtual bool Load(wxInputStream& stream, wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
virtual void SetAnimation(const wxAnimation &anim) wxOVERRIDE;
virtual wxAnimation GetAnimation() const wxOVERRIDE
{ return wxAnimation(m_anim); }
void SetAnimation(const wxAnimation &anim) wxOVERRIDE;
virtual bool Play() wxOVERRIDE;
virtual void Stop() wxOVERRIDE;
@@ -123,7 +65,10 @@ public: // public API
bool SetBackgroundColour( const wxColour &colour ) wxOVERRIDE;
static wxAnimation CreateCompatibleAnimation();
protected:
virtual wxAnimationImpl* DoCreateAnimationImpl() const wxOVERRIDE;
virtual void DisplayStaticImage() wxOVERRIDE;
virtual wxSize DoGetBestSize() const wxOVERRIDE;
@@ -133,6 +78,11 @@ protected:
void ResetAnim();
void ResetIter();
// Helpers to safely access methods in the wxAnimationGTKImpl that are
// specific to the gtk implementation
GdkPixbufAnimation *AnimationImplGetPixbuf() const;
void AnimationImplSetPixbuf(GdkPixbufAnimation* p);
protected: // internal vars
GdkPixbufAnimation *m_anim;

View File

@@ -23,8 +23,6 @@ public:
m_isPressed = false;
}
virtual bool Enable( bool enable = true ) wxOVERRIDE;
// implementation
// --------------
@@ -41,19 +39,21 @@ public:
protected:
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
virtual void DoEnable(bool enable) wxOVERRIDE;
virtual wxBitmap DoGetBitmap(State which) const wxOVERRIDE;
virtual void DoSetBitmap(const wxBitmap& bitmap, State which) wxOVERRIDE;
virtual void DoSetBitmapPosition(wxDirection dir) wxOVERRIDE;
// update the bitmap to correspond to the current button state
void GTKUpdateBitmap();
private:
typedef wxAnyButtonBase base_type;
// focus event handler: calls GTKUpdateBitmap()
void GTKOnFocus(wxFocusEvent& event);
// update the bitmap to correspond to the current button state
void GTKUpdateBitmap();
// return the state whose bitmap is being currently shown (so this is
// different from the real current state, e.g. it could be State_Normal
// even if the button is pressed if no button was set for State_Pressed)

View File

@@ -72,11 +72,6 @@ public:
{ Create(sz, depth); }
wxBitmap( const char bits[], int width, int height, int depth = 1 );
wxBitmap( const char* const* bits );
#ifdef wxNEEDS_CHARPP
// needed for old GCC
wxBitmap(char** data)
{ *this = wxBitmap(const_cast<const char* const*>(data)); }
#endif
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE );
#if wxUSE_IMAGE
wxBitmap(const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH, double scale = 1.0);
@@ -133,16 +128,17 @@ public:
#endif
#ifdef __WXGTK3__
GdkPixbuf* GetPixbufNoMask() const;
cairo_t* CairoCreate() const;
void Draw(cairo_t* cr, int x, int y, bool useMask = true, const wxColour* fg = NULL, const wxColour* bg = NULL) const;
void SetSourceSurface(cairo_t* cr, int x, int y, const wxColour* fg = NULL, const wxColour* bg = NULL) const;
wxBitmap CreateDisabled() const;
#else
GdkPixmap *GetPixmap() const;
bool HasPixmap() const;
bool HasPixbuf() const;
wxBitmap(GdkPixmap* pixmap);
#endif
GdkPixbuf* GetPixbufNoMask() const;
GdkPixbuf *GetPixbuf() const;
// raw bitmap access support functions

View File

@@ -25,7 +25,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr)
const wxString& name = wxASCII_STR(wxButtonNameStr))
{
Create(parent, id, bitmap, pos, size, style, validator, name);
}
@@ -37,8 +37,11 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
const wxString& name = wxASCII_STR(wxButtonNameStr));
bool CreateCloseButton(wxWindow* parent,
wxWindowID winid,
const wxString& name = wxString());
private:
wxDECLARE_DYNAMIC_CLASS(wxBitmapButton);
};

View File

@@ -37,7 +37,7 @@ public:
const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr)
const wxString& name = wxASCII_STR(wxBitmapComboBoxNameStr))
: wxComboBox(),
wxBitmapComboBoxBase()
{
@@ -55,7 +55,7 @@ public:
const wxArrayString& choices,
long style,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr);
const wxString& name = wxASCII_STR(wxBitmapComboBoxNameStr));
bool Create(wxWindow *parent,
wxWindowID id,
@@ -66,7 +66,7 @@ public:
const wxString choices[],
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr);
const wxString& name = wxASCII_STR(wxBitmapComboBoxNameStr));
bool Create(wxWindow *parent,
wxWindowID id,
@@ -76,7 +76,7 @@ public:
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr);
const wxString& name = wxASCII_STR(wxBitmapComboBoxNameStr));
virtual ~wxBitmapComboBox();

View File

@@ -22,7 +22,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr)
const wxString& name = wxASCII_STR(wxButtonNameStr))
{
Create(parent, id, label, pos, size, style, validator, name);
}
@@ -32,7 +32,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
const wxString& name = wxASCII_STR(wxButtonNameStr));
virtual wxWindow *SetDefault() wxOVERRIDE;
virtual void SetLabel( const wxString &label ) wxOVERRIDE;

View File

@@ -19,7 +19,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAL_SHOW_HOLIDAYS,
const wxString& name = wxCalendarNameStr)
const wxString& name = wxASCII_STR(wxCalendarNameStr))
{
Create(parent, id, date, pos, size, style, name);
}
@@ -30,7 +30,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAL_SHOW_HOLIDAYS,
const wxString& name = wxCalendarNameStr);
const wxString& name = wxASCII_STR(wxCalendarNameStr));
virtual ~wxGtkCalendarCtrl() {}

View File

@@ -22,7 +22,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
const wxString& name = wxASCII_STR(wxCheckBoxNameStr))
{
Create(parent, id, label, pos, size, style, validator, name);
}
@@ -33,13 +33,12 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr );
const wxString& name = wxASCII_STR(wxCheckBoxNameStr) );
void SetValue( bool state ) wxOVERRIDE;
bool GetValue() const wxOVERRIDE;
virtual void SetLabel( const wxString& label ) wxOVERRIDE;
virtual bool Enable( bool enable = true ) wxOVERRIDE;
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
@@ -52,6 +51,8 @@ protected:
virtual void DoApplyWidgetStyle(GtkRcStyle *style) wxOVERRIDE;
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
virtual void DoEnable(bool enable) wxOVERRIDE;
void DoSet3StateValue(wxCheckBoxState state) wxOVERRIDE;
wxCheckBoxState DoGet3StateValue() const wxOVERRIDE;

View File

@@ -25,14 +25,14 @@ public:
const wxString *choices = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
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 = wxListBoxNameStr);
const wxString& name = wxASCII_STR(wxListBoxNameStr));
virtual bool IsChecked(unsigned int index) const wxOVERRIDE;
virtual void Check(unsigned int index, bool check = true) wxOVERRIDE;

View File

@@ -31,7 +31,7 @@ public:
int n = 0, const wxString choices[] = (const wxString *) NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr )
const wxString& name = wxASCII_STR(wxChoiceNameStr) )
{
Init();
Create(parent, id, pos, size, n, choices, style, validator, name);
@@ -42,7 +42,7 @@ public:
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr )
const wxString& name = wxASCII_STR(wxChoiceNameStr) )
{
Init();
Create(parent, id, pos, size, choices, style, validator, name);
@@ -54,14 +54,14 @@ public:
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr );
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 = wxChoiceNameStr );
const wxString& name = wxASCII_STR(wxChoiceNameStr) );
int GetSelection() const wxOVERRIDE;
void SetSelection(int n) wxOVERRIDE;

View File

@@ -53,6 +53,11 @@ public:
// fill data with data on the clipboard (if available)
virtual bool GetData( wxDataObject& data ) wxOVERRIDE;
// flushes the clipboard; that means that the data which is currently on
// clipboard will stay available even after the application exits (possibly
// eating memory), otherwise the clipboard will be emptied on exit
virtual bool Flush() wxOVERRIDE;
// clears wxTheClipboard and the system's clipboard if possible
virtual void Clear() wxOVERRIDE;

View File

@@ -29,7 +29,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxCLRBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxColourPickerWidgetNameStr)
const wxString& name = wxASCII_STR(wxColourPickerWidgetNameStr))
: m_topParent(NULL)
{
Create(parent, id, initial, pos, size, style, validator, name);
@@ -42,7 +42,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxCLRBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxColourPickerWidgetNameStr);
const wxString& name = wxASCII_STR(wxColourPickerWidgetNameStr));
virtual ~wxColourButton();

View File

@@ -27,7 +27,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxCP_DEFAULT_STYLE,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxCollapsiblePaneNameStr)
const wxString& name = wxASCII_STR(wxCollapsiblePaneNameStr))
{
Init();
@@ -41,7 +41,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxCP_DEFAULT_STYLE,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxCollapsiblePaneNameStr);
const wxString& name = wxASCII_STR(wxCollapsiblePaneNameStr));
virtual void Collapse(bool collapse = true) wxOVERRIDE;
virtual bool IsCollapsed() const wxOVERRIDE;

View File

@@ -18,10 +18,10 @@ class WXDLLIMPEXP_CORE wxColourDialog : public wxDialog
public:
wxColourDialog() {}
wxColourDialog(wxWindow *parent,
wxColourData *data = NULL);
const wxColourData *data = NULL);
virtual ~wxColourDialog() {}
bool Create(wxWindow *parent, wxColourData *data = NULL);
bool Create(wxWindow *parent, const wxColourData *data = NULL);
wxColourData &GetColourData() { return m_data; }

View File

@@ -35,7 +35,7 @@ public:
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
const wxString& name = wxASCII_STR(wxComboBoxNameStr))
: wxChoice(), wxTextEntry()
{
Init();
@@ -49,7 +49,7 @@ public:
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
const wxString& name = wxASCII_STR(wxComboBoxNameStr))
: wxChoice(), wxTextEntry()
{
Init();
@@ -64,7 +64,7 @@ public:
int n = 0, const wxString choices[] = (const wxString *) NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
const wxString& name = wxASCII_STR(wxComboBoxNameStr));
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
@@ -72,7 +72,7 @@ public:
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
const wxString& name = wxASCII_STR(wxComboBoxNameStr));
// Set/GetSelection() from wxTextEntry and wxChoice
@@ -128,6 +128,8 @@ public:
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
virtual const wxTextEntry* WXGetTextEntry() const wxOVERRIDE { return this; }
protected:
// From wxWindowGTK:
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
@@ -145,13 +147,16 @@ protected:
virtual GtkEntry *GetEntry() const wxOVERRIDE
{ return m_entry; }
virtual int GTKIMFilterKeypress(GdkEventKey* event) const wxOVERRIDE
{ return GTKEntryIMFilterKeypress(event); }
GtkEntry* m_entry;
private:
// From wxTextEntry:
virtual wxWindow *GetEditableWindow() wxOVERRIDE { return this; }
virtual GtkEditable *GetEditable() const wxOVERRIDE;
virtual void EnableTextChangedEvents(bool enable) wxOVERRIDE;
void Init();

View File

@@ -26,7 +26,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr)
const wxString& name = wxASCII_STR(wxControlNameStr))
{
Create(parent, id, pos, size, style, validator, name);
}
@@ -35,7 +35,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr);
const wxString& name = wxASCII_STR(wxControlNameStr));
virtual wxVisualAttributes GetDefaultAttributes() const wxOVERRIDE;
#ifdef __WXGTK3__
@@ -84,7 +84,7 @@ protected:
wxSize GTKGetPreferredSize(GtkWidget* widget) const;
// Inner margins in a GtkEntry
wxPoint GTKGetEntryMargins(GtkEntry* entry) const;
wxSize GTKGetEntryMargins(GtkEntry* entry) const;
private:
wxDECLARE_DYNAMIC_CLASS(wxControl);

View File

@@ -24,19 +24,12 @@ public:
// we have to provide all the overloads to allow using strings instead of
// data formats (as a lot of existing code does)
wxDataFormat( const wxString& id ) { InitFromString(id); }
#ifndef wxNO_IMPLICIT_WXSTRING_ENCODING
wxDataFormat( const char *id ) { InitFromString(id); }
#endif
wxDataFormat( const wchar_t *id ) { InitFromString(id); }
wxDataFormat( const wxCStrData& id ) { InitFromString(id); }
wxDataFormat& operator=(const wxDataFormat& format)
{
if (&format != this)
{
m_type = format.m_type;
m_format = format.m_format;
}
return *this;
}
wxDataFormat& operator=(NativeFormat format)
{ SetId(format); return *this; }

View File

@@ -112,7 +112,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDataViewCtrlNameStr )
const wxString& name = wxASCII_STR(wxDataViewCtrlNameStr) )
{
Init();
@@ -123,7 +123,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDataViewCtrlNameStr);
const wxString& name = wxASCII_STR(wxDataViewCtrlNameStr));
virtual ~wxDataViewCtrl();
@@ -218,9 +218,10 @@ protected:
virtual void DoSetExpanderColumn() wxOVERRIDE;
virtual void DoSetIndent() wxOVERRIDE;
virtual void DoExpand(const wxDataViewItem& item) wxOVERRIDE;
virtual void DoExpand(const wxDataViewItem& item, bool expandChildren) wxOVERRIDE;
virtual void DoApplyWidgetStyle(GtkRcStyle *style) wxOVERRIDE;
virtual GdkWindow* GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
private:
void Init();

View File

@@ -63,8 +63,13 @@ public:
class wxPaintDCImpl: public wxGTKCairoDCImpl
{
typedef wxGTKCairoDCImpl BaseType;
public:
wxPaintDCImpl(wxPaintDC* owner, wxWindow* window);
virtual void DestroyClippingRegion() wxOVERRIDE;
private:
const wxRegion& m_clip;
wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl);
};
@@ -136,7 +141,7 @@ public:
virtual GdkWindow* GetGDKWindow() const { return NULL; }
virtual void* GetHandle() const wxOVERRIDE { return GetGDKWindow(); }
// base class pure virtuals implemented here
virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE;
virtual void DoGetSizeMM(int* width, int* height) const wxOVERRIDE;

View File

@@ -97,7 +97,7 @@ public:
virtual wxSize GetPPI() const wxOVERRIDE;
virtual int GetDepth() const wxOVERRIDE;
// overrriden here for RTL
// overridden here for RTL
virtual void SetDeviceOrigin( wxCoord x, wxCoord y ) wxOVERRIDE;
virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp ) wxOVERRIDE;

View File

@@ -39,7 +39,7 @@ public:
virtual void DoGetSize( int *width, int *height ) const wxOVERRIDE;
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const wxOVERRIDE;
virtual void* GetHandle() const wxOVERRIDE;
// overridden for wxMemoryDC Impl
virtual void DoSelect(const wxBitmap& bitmap) wxOVERRIDE;

View File

@@ -25,13 +25,13 @@ public:
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString &name = wxDialogNameStr );
const wxString &name = wxASCII_STR(wxDialogNameStr) );
bool Create( wxWindow *parent, wxWindowID id,
const wxString &title,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString &name = wxDialogNameStr );
const wxString &name = wxASCII_STR(wxDialogNameStr) );
virtual ~wxDialog();
virtual bool Show( bool show = true ) wxOVERRIDE;

View File

@@ -19,25 +19,24 @@ public:
wxDirDialog() { }
wxDirDialog(wxWindow *parent,
const wxString& message = wxDirSelectorPromptStr,
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 = wxDirDialogNameStr);
const wxString& name = wxASCII_STR(wxDirDialogNameStr));
bool Create(wxWindow *parent,
const wxString& message = wxDirSelectorPromptStr,
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 = wxDirDialogNameStr);
const wxString& name = wxASCII_STR(wxDirDialogNameStr));
virtual ~wxDirDialog() { }
public: // overrides from wxGenericDirDialog
wxString GetPath() const wxOVERRIDE;
void SetPath(const wxString& path) wxOVERRIDE;
@@ -55,8 +54,6 @@ protected:
private:
wxString m_selectedDirectory;
wxDECLARE_DYNAMIC_CLASS(wxDirDialog);
};

View File

@@ -77,11 +77,11 @@ public:
wxWindowID id,
const wxString& defaultDirectory = wxEmptyString,
const wxString& defaultFilename = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
long style = wxFC_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxFileCtrlNameStr )
const wxString& name = wxASCII_STR(wxFileCtrlNameStr) )
{
Init();
Create( parent, id, defaultDirectory, defaultFilename, wildCard, style, pos, size, name );
@@ -93,11 +93,11 @@ public:
wxWindowID id,
const wxString& defaultDirectory = wxEmptyString,
const wxString& defaultFileName = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
long style = wxFC_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxFileCtrlNameStr );
const wxString& name = wxASCII_STR(wxFileCtrlNameStr) );
virtual void SetWildcard( const wxString& wildCard ) wxOVERRIDE;
virtual void SetFilterIndex( int filterIndex ) wxOVERRIDE;

View File

@@ -21,23 +21,23 @@ public:
wxFileDialog() { }
wxFileDialog(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& message = wxASCII_STR(wxFileSelectorPromptStr),
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxFileDialogNameStr);
const wxString& name = wxASCII_STR(wxFileDialogNameStr));
bool Create(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& message = wxASCII_STR(wxFileSelectorPromptStr),
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxFileDialogNameStr);
const wxString& name = wxASCII_STR(wxFileDialogNameStr));
virtual ~wxFileDialog();
virtual wxString GetPath() const wxOVERRIDE;

View File

@@ -56,15 +56,15 @@ public:
wxFileButton() { Init(); }
wxFileButton(wxWindow *parent,
wxWindowID id,
const wxString& label = wxFilePickerWidgetLabel,
const wxString& label = wxASCII_STR(wxFilePickerWidgetLabel),
const wxString &path = wxEmptyString,
const wxString &message = wxFileSelectorPromptStr,
const wxString &wildcard = wxFileSelectorDefaultWildcardStr,
const wxString &message = wxASCII_STR(wxFileSelectorPromptStr),
const wxString &wildcard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxFILEBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFilePickerWidgetNameStr)
const wxString& name = wxASCII_STR(wxFilePickerWidgetNameStr))
{
Init();
m_pickerStyle = style;
@@ -79,15 +79,15 @@ public: // overrides
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& label = wxFilePickerWidgetLabel,
const wxString& label = wxASCII_STR(wxFilePickerWidgetLabel),
const wxString &path = wxEmptyString,
const wxString &message = wxFileSelectorPromptStr,
const wxString &wildcard = wxFileSelectorDefaultWildcardStr,
const wxString &message = wxASCII_STR(wxFileSelectorPromptStr),
const wxString &wildcard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFilePickerWidgetNameStr);
const wxString& name = wxASCII_STR(wxFilePickerWidgetNameStr));
// event handler for the click
void OnDialogOK(wxCommandEvent &);
@@ -121,14 +121,14 @@ public:
wxDirButton() { Init(); }
wxDirButton(wxWindow *parent,
wxWindowID id,
const wxString& label = wxFilePickerWidgetLabel,
const wxString& label = wxASCII_STR(wxFilePickerWidgetLabel),
const wxString &path = wxEmptyString,
const wxString &message = wxFileSelectorPromptStr,
const wxString &message = wxASCII_STR(wxFileSelectorPromptStr),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDIRBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFilePickerWidgetNameStr)
const wxString& name = wxASCII_STR(wxFilePickerWidgetNameStr))
{
Init();
@@ -145,15 +145,15 @@ public: // overrides
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& label = wxFilePickerWidgetLabel,
const wxString& label = wxASCII_STR(wxFilePickerWidgetLabel),
const wxString &path = wxEmptyString,
const wxString &message = wxFileSelectorPromptStr,
const wxString &wildcard = wxFileSelectorDefaultWildcardStr,
const wxString &message = wxASCII_STR(wxFileSelectorPromptStr),
const wxString &wildcard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFilePickerWidgetNameStr);
const wxString& name = wxASCII_STR(wxFilePickerWidgetNameStr));
// GtkFileChooserButton does not support GTK_FILE_CHOOSER_CREATE_FOLDER

View File

@@ -64,7 +64,7 @@ public:
virtual ~wxFont();
// implement base class pure virtuals
virtual float GetFractionalPointSize() const wxOVERRIDE;
virtual double GetFractionalPointSize() const wxOVERRIDE;
virtual wxFontStyle GetStyle() const wxOVERRIDE;
virtual int GetNumericWeight() const wxOVERRIDE;
virtual wxString GetFaceName() const wxOVERRIDE;
@@ -74,7 +74,7 @@ public:
virtual const wxNativeFontInfo *GetNativeFontInfo() const wxOVERRIDE;
virtual bool IsFixedWidth() const wxOVERRIDE;
virtual void SetFractionalPointSize(float pointSize) wxOVERRIDE;
virtual void SetFractionalPointSize(double pointSize) wxOVERRIDE;
virtual void SetFamily(wxFontFamily family) wxOVERRIDE;
virtual void SetStyle(wxFontStyle style) wxOVERRIDE;
virtual void SetNumericWeight(int weight) wxOVERRIDE;

View File

@@ -29,7 +29,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxFONTBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFontPickerWidgetNameStr)
const wxString& name = wxASCII_STR(wxFontPickerWidgetNameStr))
{
Init();
@@ -43,7 +43,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxFONTBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFontPickerWidgetNameStr);
const wxString& name = wxASCII_STR(wxFontPickerWidgetNameStr));
virtual wxColour GetSelectedColour() const wxOVERRIDE
{ return m_selectedColour; }

View File

@@ -24,7 +24,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr)
const wxString& name = wxASCII_STR(wxFrameNameStr))
{
Init();
@@ -37,7 +37,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
const wxString& name = wxASCII_STR(wxFrameNameStr));
#if wxUSE_STATUSBAR
void SetStatusBar(wxStatusBar *statbar) wxOVERRIDE;

View File

@@ -25,7 +25,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr )
const wxString& name = wxASCII_STR(wxGaugeNameStr) )
{
Init();
@@ -38,7 +38,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr );
const wxString& name = wxASCII_STR(wxGaugeNameStr) );
// implement base class virtual methods
void SetRange(int range) wxOVERRIDE;
@@ -65,8 +65,6 @@ protected:
// set the gauge value to the value of m_gaugePos
void DoSetGauge();
virtual wxSize DoGetBestSize() const wxOVERRIDE;
private:
void Init() { m_rangeMax = m_gaugePos = 0; }

View File

@@ -11,14 +11,23 @@
#ifndef _WX_GLCANVAS_H_
#define _WX_GLCANVAS_H_
#include "wx/unix/glx11.h"
#include "wx/setup.h"
#if wxUSE_GLCANVAS_EGL
#include "wx/unix/glegl.h"
typedef wxGLCanvasEGL wxGLCanvasImpl;
#else
#include "wx/unix/glx11.h"
typedef wxGLCanvasX11 wxGLCanvasImpl;
#endif
//---------------------------------------------------------------------------
// wxGLCanvas
//---------------------------------------------------------------------------
class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasX11
class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasImpl
{
typedef wxGLCanvasImpl BaseType;
public:
wxGLCanvas(wxWindow *parent,
const wxGLAttributes& dispAttrs,
@@ -62,8 +71,8 @@ public:
// implement wxGLCanvasX11 methods
// --------------------------------
virtual Window GetXWindow() const wxOVERRIDE;
virtual unsigned long GetXWindow() const wxOVERRIDE;
void* GetNativeWindow() const;
// deprecated methods
// ------------------
@@ -109,13 +118,11 @@ public:
#endif // WXWIN_COMPATIBILITY_2_8
// implementation from now on
void OnInternalIdle() wxOVERRIDE;
virtual void GTKHandleRealized() wxOVERRIDE;
bool m_exposed;
#ifdef __WXGTK3__
cairo_t* m_cairoPaintContext;
wxSize m_size;
#endif
#if WXWIN_COMPATIBILITY_2_8
wxGLContext *m_sharedContext;
wxGLCanvas *m_sharedContextOf;

View File

@@ -28,7 +28,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHL_DEFAULT_STYLE,
const wxString& name = wxHyperlinkCtrlNameStr);
const wxString& name = wxASCII_STR(wxHyperlinkCtrlNameStr));
virtual ~wxHyperlinkCtrl();
@@ -39,7 +39,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHL_DEFAULT_STYLE,
const wxString& name = wxHyperlinkCtrlNameStr);
const wxString& name = wxASCII_STR(wxHyperlinkCtrlNameStr));
// get/set

View File

@@ -30,7 +30,7 @@ public:
int n = 0, const wxString choices[] = (const wxString *) NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr )
const wxString& name = wxASCII_STR(wxListBoxNameStr) )
{
Init();
Create(parent, id, pos, size, n, choices, style, validator, name);
@@ -41,7 +41,7 @@ public:
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr )
const wxString& name = wxASCII_STR(wxListBoxNameStr) )
{
Init();
Create(parent, id, pos, size, choices, style, validator, name);
@@ -54,14 +54,14 @@ public:
int n = 0, const wxString choices[] = (const wxString *) NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
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 = wxListBoxNameStr);
const wxString& name = wxASCII_STR(wxListBoxNameStr));
virtual unsigned int GetCount() const wxOVERRIDE;
virtual wxString GetString(unsigned int n) const wxOVERRIDE;

View File

@@ -32,7 +32,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr)
const wxString& name = wxASCII_STR(wxFrameNameStr))
{
Init();
@@ -45,7 +45,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr);
const wxString& name = wxASCII_STR(wxFrameNameStr));
// we don't store the active child in m_currentChild unlike the base class
// version so override this method to find it dynamically
@@ -89,7 +89,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr)
const wxString& name = wxASCII_STR(wxFrameNameStr))
{
Init();
@@ -102,7 +102,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
const wxString& name = wxASCII_STR(wxFrameNameStr));
virtual ~wxMDIChildFrame();
@@ -122,6 +122,9 @@ public:
wxMenuBar *m_menuBar;
bool m_justInserted;
protected:
virtual void DoGetPosition(int *x, int *y) const wxOVERRIDE;
private:
void Init();

View File

@@ -28,7 +28,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAPTION | wxRESIZE_BORDER,
const wxString& name = wxFrameNameStr)
const wxString& name = wxASCII_STR(wxFrameNameStr))
{
Create(parent, id, title, pos, size, style, name);
}
@@ -40,7 +40,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAPTION | wxRESIZE_BORDER,
const wxString& name = wxFrameNameStr);
const wxString& name = wxASCII_STR(wxFrameNameStr));
virtual void SetTitle( const wxString &title ) wxOVERRIDE;
@@ -52,9 +52,10 @@ protected:
// implementation
public:
bool m_isDragging;
int m_oldX,m_oldY;
int m_diffX,m_diffY;
#ifndef __WXGTK4__
bool m_isDragMove;
wxSize m_dragOffset;
#endif
wxBitmap m_closeButton;
int m_miniEdge;
int m_miniTitle;

View File

@@ -15,7 +15,7 @@ class WXDLLIMPEXP_CORE wxMessageDialog : public wxMessageDialogBase
{
public:
wxMessageDialog(wxWindow *parent, const wxString& message,
const wxString& caption = wxMessageBoxCaptionStr,
const wxString& caption = wxASCII_STR(wxMessageBoxCaptionStr),
long style = wxOK|wxCENTRE,
const wxPoint& pos = wxDefaultPosition);

View File

@@ -34,14 +34,14 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxNotebookNameStr);
const wxString& name = wxASCII_STR(wxNotebookNameStr));
// Create() function
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxNotebookNameStr);
const wxString& name = wxASCII_STR(wxNotebookNameStr));
// dtor
virtual ~wxNotebook();

View File

@@ -226,7 +226,7 @@ public:
virtual void* GetCairoContext() const wxOVERRIDE;
virtual void* GetHandle() const wxOVERRIDE;
bool CanDrawBitmap() const wxOVERRIDE { return true; }
void Clear() wxOVERRIDE;
void SetFont( const wxFont& font ) wxOVERRIDE;

View File

@@ -68,7 +68,7 @@ private:
// GTK UI guidelines recommend using "symbolic" versions of the icons
// for these buttons, so try them first but fall back to the normal
// ones if symbolic theme is not installed.
wxBitmap bmp = wxArtProvider::GetBitmap(name + "-symbolic", wxART_MENU);
wxBitmap bmp = wxArtProvider::GetBitmap(name + wxASCII_STR("-symbolic"), wxART_MENU);
if ( !bmp.IsOk() )
bmp = wxArtProvider::GetBitmap(name, wxART_MENU);
return bmp;

View File

@@ -0,0 +1,69 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/private/animate.h
// Purpose: Animation classes
// Author: Julian Smart and Guillermo Rodriguez Garcia
// Modified by: Francesco Montorsi
// Created: 13/8/99
// Copyright: (c) Julian Smart and Guillermo Rodriguez Garcia
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_PRIVATE_ANIMATEH__
#define _WX_GTK_PRIVATE_ANIMATEH__
#include "wx/private/animate.h"
typedef struct _GdkPixbufAnimation GdkPixbufAnimation;
typedef struct _GdkPixbufAnimationIter GdkPixbufAnimationIter;
// ----------------------------------------------------------------------------
// wxAnimationGTKImpl
// Unlike the generic wxAnimation object we won't use directly
// wxAnimationDecoders as gdk-pixbuf already provides the concept of decoder and
// will automatically use the available handlers.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxAnimationGTKImpl : public wxAnimationImpl
{
public:
wxAnimationGTKImpl()
: m_pixbuf(NULL) {}
~wxAnimationGTKImpl() { UnRef(); }
virtual bool IsOk() const wxOVERRIDE
{ return m_pixbuf != NULL; }
virtual bool IsCompatibleWith(wxClassInfo* ci) const wxOVERRIDE;
// unfortunately GdkPixbufAnimation does not expose these info:
virtual unsigned int GetFrameCount() const wxOVERRIDE { return 0; }
virtual wxImage GetFrame(unsigned int frame) const wxOVERRIDE;
// we can retrieve the delay for a frame only after building
// a GdkPixbufAnimationIter...
virtual int GetDelay(unsigned int WXUNUSED(frame)) const wxOVERRIDE { return 0; }
virtual wxSize GetSize() const wxOVERRIDE;
virtual bool LoadFile(const wxString &name, wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
virtual bool Load(wxInputStream &stream, wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
// Implementation
public: // used by GTK callbacks
GdkPixbufAnimation *GetPixbuf() const
{ return m_pixbuf; }
void SetPixbuf(GdkPixbufAnimation* p);
protected:
GdkPixbufAnimation *m_pixbuf;
private:
void UnRef();
typedef wxAnimationImpl base_type;
wxDECLARE_NO_COPY_CLASS(wxAnimationGTKImpl);
};
#endif // _WX_GTK_PRIVATE_ANIMATEH__

View File

@@ -95,6 +95,20 @@ static inline gdouble wx_gtk_adjustment_get_upper(GtkAdjustment* adjustment)
}
#define gtk_adjustment_get_upper wx_gtk_adjustment_get_upper
static inline void wx_gtk_adjustment_set_step_increment(GtkAdjustment* adjustment, gdouble step_increment)
{
adjustment->step_increment = step_increment;
gtk_adjustment_changed(adjustment);
}
#define gtk_adjustment_set_step_increment wx_gtk_adjustment_set_step_increment
static inline void wx_gtk_adjustment_set_page_increment(GtkAdjustment* adjustment, gdouble page_increment)
{
adjustment->page_increment = page_increment;
gtk_adjustment_changed(adjustment);
}
#define gtk_adjustment_set_page_increment wx_gtk_adjustment_set_page_increment
static inline void wx_gtk_adjustment_set_page_size(GtkAdjustment* adjustment, gdouble page_size)
{
adjustment->page_size = page_size;

View File

@@ -0,0 +1,33 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/private/image.h
// Author: Paul Cornett
// Copyright: (c) 2020 Paul Cornett
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// Class that can be used in place of GtkImage, to allow drawing of alternate
// bitmaps, such as HiDPI or disabled.
class wxGtkImage: GtkImage
{
public:
struct BitmapProvider
{
virtual ~BitmapProvider() { }
virtual wxBitmap Get() const = 0;
virtual void Set(const wxBitmap&) { }
};
static GType Type();
static GtkWidget* New(BitmapProvider* provider);
static GtkWidget* New(wxWindow* win = NULL);
void Set(const wxBitmap& bitmap);
BitmapProvider* m_provider;
wxDECLARE_NO_COPY_CLASS(wxGtkImage);
wxGtkImage() wxMEMBER_DELETE;
~wxGtkImage() wxMEMBER_DELETE;
};
#define WX_GTK_IMAGE(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, wxGtkImage::Type(), wxGtkImage)

View File

@@ -3,7 +3,7 @@
// Purpose: helper functions for dealing with GTK+ mnemonics
// Author: Vadim Zeitlin
// Created: 2007-11-12
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@@ -3,7 +3,7 @@
// Purpose: wxGtkObject class declaration
// Author: Vadim Zeitlin
// Created: 2008-08-27
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwindows.org>
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@@ -3,7 +3,7 @@
// Purpose: wxGtkString class declaration
// Author: Vadim Zeitlin
// Created: 2006-10-19
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@@ -43,8 +43,8 @@ class wxGtkCollatableString
{
public:
wxGtkCollatableString( const wxString &label, gchar *key )
: m_label(label)
{
m_label = label;
m_key = key;
}

View File

@@ -28,7 +28,9 @@ public:
wxGtkStyleContext& AddTextview(const char* child1 = NULL, const char* child2 = NULL);
wxGtkStyleContext& AddTooltip();
wxGtkStyleContext& AddTreeview();
#if GTK_CHECK_VERSION(3,20,0)
wxGtkStyleContext& AddTreeviewHeaderButton(int pos);
#endif // GTK >= 3.20
wxGtkStyleContext& AddWindow(const char* className2 = NULL);
void Bg(wxColour& color, int state = GTK_STATE_FLAG_NORMAL) const;
void Fg(wxColour& color, int state = GTK_STATE_FLAG_NORMAL) const;

View File

@@ -12,6 +12,7 @@
class wxTLWGeometry : public wxTLWGeometryGeneric
{
typedef wxTLWGeometryGeneric BaseType;
public:
virtual bool Save(const Serializer& ser) const wxOVERRIDE
{
@@ -57,9 +58,6 @@ public:
virtual bool ApplyTo(wxTopLevelWindow* tlw) wxOVERRIDE
{
if ( !wxTLWGeometryGeneric::ApplyTo(tlw) )
return false;
// Don't overwrite the current decoration size if we already have it.
if ( !tlw->m_decorSize.left && !tlw->m_decorSize.right &&
!tlw->m_decorSize.top && !tlw->m_decorSize.bottom )
@@ -67,7 +65,7 @@ public:
tlw->m_decorSize = m_decorSize;
}
return true;
return BaseType::ApplyTo(tlw);
}
private:

View File

@@ -29,7 +29,8 @@ public:
~wxWebKitJavascriptResult()
{
webkit_javascript_result_unref(m_jsresult);
if ( m_jsresult != NULL )
webkit_javascript_result_unref(m_jsresult);
}
operator WebKitJavascriptResult *() const { return m_jsresult; }

View File

@@ -10,9 +10,11 @@
#ifndef _WX_GTK_PRIVATE_WRAPGTK_H_
#define _WX_GTK_PRIVATE_WRAPGTK_H_
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
wxGCC_WARNING_SUPPRESS(parentheses)
#include <gtk/gtk.h>
wxGCC_WARNING_RESTORE(parentheses)
wxGCC_WARNING_RESTORE(deprecated-declarations)
#include "wx/gtk/private/gtk2-compat.h"

View File

@@ -38,7 +38,7 @@ public:
int majorDim = 0,
long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr)
const wxString& name = wxASCII_STR(wxRadioBoxNameStr))
{
Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
}
@@ -52,7 +52,7 @@ public:
int majorDim = 0,
long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr)
const wxString& name = wxASCII_STR(wxRadioBoxNameStr))
{
Create( parent, id, title, pos, size, choices, majorDim, style, val, name );
}
@@ -67,7 +67,7 @@ public:
int majorDim = 0,
long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
const wxString& name = wxASCII_STR(wxRadioBoxNameStr));
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
@@ -77,7 +77,7 @@ public:
int majorDim = 0,
long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
const wxString& name = wxASCII_STR(wxRadioBoxNameStr));
virtual ~wxRadioBox();
@@ -141,6 +141,8 @@ protected:
virtual void DoApplyWidgetStyle(GtkRcStyle *style) wxOVERRIDE;
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
virtual void DoEnable(bool enable) wxOVERRIDE;
virtual bool GTKNeedsToFilterSameWindowFocus() const wxOVERRIDE { return true; }
virtual bool GTKWidgetNeedsMnemonic() const wxOVERRIDE;

View File

@@ -13,7 +13,7 @@
// wxRadioButton
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxRadioButton: public wxControl
class WXDLLIMPEXP_CORE wxRadioButton: public wxRadioButtonBase
{
public:
wxRadioButton() { }
@@ -24,7 +24,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxRadioButtonNameStr )
const wxString& name = wxASCII_STR(wxRadioButtonNameStr) )
{
Create( parent, id, label, pos, size, style, validator, name );
}
@@ -36,12 +36,11 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxRadioButtonNameStr );
const wxString& name = wxASCII_STR(wxRadioButtonNameStr) );
virtual void SetLabel(const wxString& label) wxOVERRIDE;
virtual void SetValue(bool val);
virtual bool GetValue() const;
virtual bool Enable( bool enable = true ) wxOVERRIDE;
virtual void SetValue(bool val) wxOVERRIDE;
virtual bool GetValue() const wxOVERRIDE;
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
@@ -52,6 +51,8 @@ protected:
virtual void DoApplyWidgetStyle(GtkRcStyle *style) wxOVERRIDE;
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
virtual void DoEnable(bool enable) wxOVERRIDE;
private:
typedef wxControl base_type;

View File

@@ -22,7 +22,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxScrollBarNameStr )
const wxString& name = wxASCII_STR(wxScrollBarNameStr) )
{
Create( parent, id, pos, size, style, validator, name );
}
@@ -31,7 +31,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxScrollBarNameStr );
const wxString& name = wxASCII_STR(wxScrollBarNameStr) );
virtual ~wxScrollBar();
int GetThumbPosition() const wxOVERRIDE;
int GetThumbSize() const wxOVERRIDE;

View File

@@ -184,7 +184,7 @@
// Unicode support
// ----------------------------------------------------------------------------
// These settings are obsolete: the library is always built in Unicode mode
// This option is deprecated: the library should be always built in Unicode mode
// now, only set wxUSE_UNICODE to 0 to compile legacy code in ANSI mode if
// absolutely necessary -- updating it is strongly recommended as the ANSI mode
// will disappear completely in future wxWidgets releases.
@@ -192,9 +192,6 @@
#define wxUSE_UNICODE 1
#endif
// wxUSE_WCHAR_T is required by wxWidgets now, don't change.
#define wxUSE_WCHAR_T 1
// ----------------------------------------------------------------------------
// global features
// ----------------------------------------------------------------------------
@@ -392,18 +389,6 @@
// wxWidgets.
#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
// VC++ 4.2 and above allows <iostream> and <iostream.h> but you can't mix
// them. Set this option to 1 to use <iostream.h>, 0 to use <iostream>.
//
// Note that newer compilers (including VC++ 7.1 and later) don't support
// wxUSE_IOSTREAMH == 1 and so <iostream> will be used anyhow.
//
// Default is 0.
//
// Recommended setting: 0, only set to 1 if you use a really old compiler
#define wxUSE_IOSTREAMH 0
// ----------------------------------------------------------------------------
// non GUI features selection
// ----------------------------------------------------------------------------
@@ -822,6 +807,13 @@
#define wxUSE_WEBVIEW_IE 0
#endif
// Use the Edge (Chromium) wxWebView backend (Requires WebView2 SDK)
//
// Default is 0 because WebView2 is not always available, set it to 1 if you do have it.
//
// Recommended setting: 1 when building for Windows with WebView2 SDK
#define wxUSE_WEBVIEW_EDGE 0
// Use the WebKit wxWebView backend
//
// Default is 1 on GTK and OSX
@@ -970,6 +962,14 @@
#define wxUSE_TREECTRL 1 // wxTreeCtrl
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
// Use generic version of wxDataViewCtrl even if a native one is available?
//
// Default is 1.
//
// Recommended setting: 1, but can be set to 0 if your program is affected by
// the native control limitations.
#define wxUSE_NATIVE_DATAVIEWCTRL 1
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
// below either wxStatusBar95 or a generic wxStatusBar will be used.
//
@@ -1177,13 +1177,20 @@
// depends on it)
#define wxUSE_INFOBAR 1
// Use wxMenu, wxMenuBar, wxMenuItem.
// Use wxMenu, wxMenuItem.
//
// Default is 1.
//
// Recommended setting: 1 (can't be disabled under MSW)
#define wxUSE_MENUS 1
// Use wxMenuBar.
//
// Default is 1.
//
// Recommended setting: 1 (can't be disabled under MSW)
#define wxUSE_MENUBAR 1
// Use wxNotificationMessage.
//
// wxNotificationMessage allows to show non-intrusive messages to the user
@@ -1430,6 +1437,13 @@
// otherwise.
#define wxUSE_GLCANVAS 1
// Setting wxUSE_GLCANVAS_EGL to 1 enables OpenGL EGL backend. This will be
// automatically enabled if EGL support is detected.
//
// Default is 0.
//
#define wxUSE_GLCANVAS_EGL 0
// wxRichTextCtrl allows editing of styled text.
//
// Default is 1.
@@ -1610,7 +1624,6 @@
#define wxUSE_THEME_MONO 0
#define wxUSE_THEME_WIN32 0
/* --- end common options --- */
/* --- start MSW options --- */
@@ -1763,6 +1776,13 @@
// Recommended setting: 0, nobody uses .INI files any more
#define wxUSE_INICONF 0
// Set to 1 if you need to include <winsock2.h> over <winsock.h>
//
// Default is 0.
//
// Recommended setting: 0, set to 1 automatically if wxUSE_IPV6 is 1.
#define wxUSE_WINSOCK2 0
// ----------------------------------------------------------------------------
// Generic versions of native controls
// ----------------------------------------------------------------------------

View File

@@ -24,7 +24,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSliderNameStr)
const wxString& name = wxASCII_STR(wxSliderNameStr))
{
Create( parent, id, value, minValue, maxValue,
pos, size, style, validator, name );
@@ -38,7 +38,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSliderNameStr);
const wxString& name = wxASCII_STR(wxSliderNameStr));
// implement the base class pure virtuals
virtual int GetValue() const wxOVERRIDE;
@@ -56,6 +56,10 @@ public:
virtual void SetThumbLength(int lenPixels) wxOVERRIDE;
virtual int GetThumbLength() const wxOVERRIDE;
virtual void ClearTicks() wxOVERRIDE;
virtual void SetTick(int tickPos) wxOVERRIDE;
int GetTickFreq() const wxOVERRIDE;
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
@@ -70,14 +74,25 @@ public:
GtkWidget *m_scale;
protected:
virtual wxSize DoGetBestSize() const wxOVERRIDE;
GtkWidget *m_minLabel,*m_maxLabel;
bool m_blockScrollEvent;
// Note the following member is not used in GTK+2 < 2.16.
int m_tickFreq;
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
// set the slider value unconditionally
void GTKSetValue(int value);
// Platform-specific implementation of SetTickFreq
virtual void DoSetTickFreq(int freq) wxOVERRIDE;
private:
void Init();
wxDECLARE_DYNAMIC_CLASS(wxSlider);
};

View File

@@ -44,8 +44,6 @@ public:
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
virtual bool Enable( bool enable = true ) wxOVERRIDE;
// implementation
int m_pos;
@@ -56,6 +54,8 @@ protected:
virtual wxSize DoGetBestSize() const wxOVERRIDE;
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
virtual void DoEnable(bool enable) wxOVERRIDE;
private:
typedef wxSpinButtonBase base_type;

View File

@@ -68,10 +68,13 @@ protected:
void DoSetRange(double min_val, double max_val);
void DoSetIncrement(double inc);
void GtkDisableEvents() const;
void GtkEnableEvents() const;
void GtkDisableEvents();
void GtkEnableEvents();
// Update the width of the entry field to fit the current range (and also
// base or number of digits depending on the derived class).
virtual void GtkSetEntryWidth() = 0;
virtual wxSize DoGetBestSize() const wxOVERRIDE;
virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen = -1) const wxOVERRIDE;
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
@@ -134,6 +137,9 @@ public:
virtual int GetBase() const wxOVERRIDE { return m_base; }
virtual bool SetBase(int base) wxOVERRIDE;
protected:
virtual void GtkSetEntryWidth() wxOVERRIDE;
private:
// Common part of all ctors.
void Init()
@@ -199,6 +205,9 @@ public:
virtual int GetBase() const wxOVERRIDE { return 10; }
virtual bool SetBase(int WXUNUSED(base)) wxOVERRIDE { return false; }
protected:
virtual void GtkSetEntryWidth() wxOVERRIDE;
wxDECLARE_DYNAMIC_CLASS(wxSpinCtrlDouble);
};

117
include/wx/gtk/srchctrl.h Normal file
View File

@@ -0,0 +1,117 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/srchctrl.h
// Purpose: wxSearchCtrl class - native
// Author: Kettab Ali
// Created: 2019-12-23
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_SEARCHCTRL_H_
#define _WX_GTK_SEARCHCTRL_H_
#if wxUSE_SEARCHCTRL
// ----------------------------------------------------------------------------
// wxSearchCtrl
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSearchCtrl : public wxSearchCtrlBase
{
public:
// creation
// --------
wxSearchCtrl() : wxSearchCtrlBase()
{
Init();
}
wxSearchCtrl(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(wxSearchCtrlNameStr))
: wxSearchCtrlBase()
{
Init();
Create(parent, id, value, pos, size, style, validator, name);
}
virtual ~wxSearchCtrl();
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(wxSearchCtrlNameStr));
#if wxUSE_MENUS
// get/set search button menu
// --------------------------
virtual void SetMenu( wxMenu* menu ) wxOVERRIDE;
virtual wxMenu* GetMenu() wxOVERRIDE;
#endif // wxUSE_MENUS
// get/set search options
// ----------------------
virtual void ShowSearchButton( bool show ) wxOVERRIDE;
virtual bool IsSearchButtonVisible() const wxOVERRIDE;
virtual void ShowCancelButton( bool show ) wxOVERRIDE;
virtual bool IsCancelButtonVisible() const wxOVERRIDE;
virtual void SetDescriptiveText(const wxString& text) wxOVERRIDE;
virtual wxString GetDescriptiveText() const wxOVERRIDE;
virtual void Clear() wxOVERRIDE;
#if wxUSE_MENUS
void PopupSearchMenu();
#endif // wxUSE_MENUS
private:
// From wxTextEntry:
virtual GtkEditable *GetEditable() const wxOVERRIDE;
void Init();
void GTKCreateSearchEntryWidget();
// Event handlers
void OnChar(wxKeyEvent& event);
void OnText(wxCommandEvent& event);
void OnTextEnter(wxCommandEvent& event);
bool HasMenu() const
{
#if wxUSE_MENUS
return m_menu != NULL;
#else // !wxUSE_MENUS
return false;
#endif // wxUSE_MENUS/!wxUSE_MENUS
}
private:
virtual GtkEntry *GetEntry() const wxOVERRIDE
{ return m_entry; }
GtkEntry *m_entry;
#if wxUSE_MENUS
wxMenu *m_menu;
#endif // wxUSE_MENUS
bool m_cancelButtonVisible;
wxDECLARE_DYNAMIC_CLASS(wxSearchCtrl);
wxDECLARE_EVENT_TABLE();
};
#endif // wxUSE_SEARCHCTRL
#endif // _WX_GTK_SEARCHCTRL_H_

View File

@@ -25,14 +25,14 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticBitmapNameStr );
const wxString& name = wxASCII_STR(wxStaticBitmapNameStr));
bool Create( wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticBitmapNameStr);
const wxString& name = wxASCII_STR(wxStaticBitmapNameStr));
virtual void SetIcon(const wxIcon& icon) wxOVERRIDE { SetBitmap( icon ); }
virtual void SetBitmap( const wxBitmap& bitmap ) wxOVERRIDE;

View File

@@ -26,7 +26,7 @@ public:
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxString &name = wxStaticBoxNameStr )
const wxString &name = wxASCII_STR(wxStaticBoxNameStr) )
{
Create( parent, id, label, pos, size, style, name );
}
@@ -37,7 +37,7 @@ public:
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxString &name = wxStaticBoxNameStr )
const wxString &name = wxASCII_STR(wxStaticBoxNameStr) )
{
Create( parent, id, label, pos, size, style, name );
}
@@ -48,7 +48,7 @@ public:
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxString &name = wxStaticBoxNameStr )
const wxString &name = wxASCII_STR(wxStaticBoxNameStr) )
{
return DoCreate( parent, id, &label, NULL, pos, size, style, name );
}
@@ -59,7 +59,7 @@ public:
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxString &name = wxStaticBoxNameStr )
const wxString &name = wxASCII_STR(wxStaticBoxNameStr) )
{
return DoCreate( parent, id, NULL, label, pos, size, style, name );
}

View File

@@ -26,13 +26,13 @@ public:
const wxPoint &pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLI_HORIZONTAL,
const wxString &name = wxStaticLineNameStr);
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 = wxStaticLineNameStr);
const wxString &name = wxASCII_STR(wxStaticLineNameStr));
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);

View File

@@ -23,7 +23,7 @@ public:
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxString &name = wxStaticTextNameStr );
const wxString &name = wxASCII_STR(wxStaticTextNameStr) );
bool Create(wxWindow *parent,
wxWindowID id,
@@ -31,7 +31,7 @@ public:
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxString &name = wxStaticTextNameStr );
const wxString &name = wxASCII_STR(wxStaticTextNameStr) );
void SetLabel( const wxString &label ) wxOVERRIDE;
@@ -49,8 +49,8 @@ protected:
virtual wxSize DoGetBestSize() const wxOVERRIDE;
virtual wxString DoGetLabel() const wxOVERRIDE;
virtual void DoSetLabel(const wxString& str) wxOVERRIDE;
virtual wxString WXGetVisibleLabel() const wxOVERRIDE;
virtual void WXSetVisibleLabel(const wxString& str) wxOVERRIDE;
#if wxUSE_MARKUP
virtual bool DoSetLabelMarkup(const wxString& markup) wxOVERRIDE;
#endif // wxUSE_MARKUP

View File

@@ -27,7 +27,7 @@ public:
const wxSize &size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString &name = wxTextCtrlNameStr);
const wxString &name = wxASCII_STR(wxTextCtrlNameStr));
virtual ~wxTextCtrl();
@@ -38,7 +38,7 @@ public:
const wxSize &size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString &name = wxTextCtrlNameStr);
const wxString &name = wxASCII_STR(wxTextCtrlNameStr));
// implement base class pure virtuals
// ----------------------------------
@@ -95,7 +95,6 @@ public:
// Overridden wxWindow methods
virtual void SetWindowStyleFlag( long style ) wxOVERRIDE;
virtual bool Enable( bool enable = true ) wxOVERRIDE;
// Implementation from now on
void OnDropFiles( wxDropFilesEvent &event );
@@ -143,6 +142,9 @@ public:
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
void GTKOnTextChanged() wxOVERRIDE;
void GTKAfterLayout();
protected:
// overridden wxWindow virtual methods
virtual wxSize DoGetBestSize() const wxOVERRIDE;
@@ -154,6 +156,8 @@ protected:
virtual void DoFreeze() wxOVERRIDE;
virtual void DoThaw() wxOVERRIDE;
virtual void DoEnable(bool enable) wxOVERRIDE;
// Widgets that use the style->base colour for the BG colour should
// override this and return true.
virtual bool UseGTKStyleBase() const wxOVERRIDE { return true; }
@@ -181,7 +185,6 @@ private:
// overridden wxTextEntry virtual methods
virtual GtkEditable *GetEditable() const wxOVERRIDE;
virtual GtkEntry *GetEntry() const wxOVERRIDE;
virtual void EnableTextChangedEvents(bool enable) wxOVERRIDE;
// change the font for everything in this control
void ChangeFontGlobally();
@@ -195,7 +198,7 @@ private:
// returns either m_text or m_buffer depending on whether the control is
// single- or multi-line; convenient for the GTK+ functions which work with
// both
void *GetTextObject() const
void *GetTextObject() const wxOVERRIDE
{
return IsMultiLine() ? static_cast<void *>(m_buffer)
: static_cast<void *>(m_text);
@@ -214,8 +217,9 @@ private:
// a dummy one when frozen
GtkTextBuffer *m_buffer;
GtkTextMark* m_showPositionOnThaw;
GtkTextMark* m_showPositionDefer;
GSList* m_anonymousMarkList;
unsigned m_afterLayoutId;
// For wxTE_AUTO_URL
void OnUrlMouseEvent(wxMouseEvent&);

View File

@@ -3,7 +3,7 @@
// Purpose: wxGTK-specific wxTextEntry implementation
// Author: Vadim Zeitlin
// Created: 2007-09-24
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@@ -15,6 +15,7 @@ typedef struct _GtkEditable GtkEditable;
typedef struct _GtkEntry GtkEntry;
class wxTextAutoCompleteData; // private class used only by wxTextEntry itself
class wxTextCoalesceData; // another private class
// ----------------------------------------------------------------------------
// wxTextEntry: roughly corresponds to GtkEditable
@@ -62,6 +63,16 @@ public:
bool GTKEntryOnInsertText(const char* text);
bool GTKIsUpperCase() const { return m_isUpperCase; }
// Called from "changed" signal handler (or, possibly, slightly later, when
// coalescing several "changed" signals into a single event) for GtkEntry.
//
// By default just generates a wxEVT_TEXT, but overridden to do more things
// in wxTextCtrl.
virtual void GTKOnTextChanged() { SendTextUpdatedEvent(); }
// Helper functions only used internally.
wxTextCoalesceData* GTKGetCoalesceData() const { return m_coalesceData; }
protected:
// This method must be called from the derived class Create() to connect
// the handlers for the clipboard (cut/copy/paste) events.
@@ -70,6 +81,10 @@ protected:
// And this one to connect "insert-text" signal.
void GTKConnectInsertTextSignal(GtkEntry* entry);
// Finally this one connects to the "changed" signal on the object returned
// by GetTextObject().
void GTKConnectChangedSignal();
virtual void DoSetValue(const wxString& value, int flags) wxOVERRIDE;
virtual wxString DoGetValue() const wxOVERRIDE;
@@ -81,11 +96,28 @@ protected:
virtual bool DoAutoCompleteStrings(const wxArrayString& choices) wxOVERRIDE;
virtual bool DoAutoCompleteCustom(wxTextCompleter *completer) wxOVERRIDE;
// Override the base class method to use GtkEntry IM context.
virtual int GTKIMFilterKeypress(GdkEventKey* event) const;
// Call this from the overridden wxWindow::GTKIMFilterKeypress() to use
// GtkEntry IM context.
int GTKEntryIMFilterKeypress(GdkEventKey* event) const;
// If GTKEntryIMFilterKeypress() is not called (as multiline wxTextCtrl
// uses its own IM), call this method instead to still notify wxTextEntry
// about the key press events in the given widget.
void GTKEntryOnKeypress(GtkWidget* widget) const;
static int GTKGetEntryTextLength(GtkEntry* entry);
// Block/unblock the corresponding GTK signal.
//
// Note that we make it protected in wxGTK as it is called from wxComboBox
// currently.
virtual void EnableTextChangedEvents(bool enable) wxOVERRIDE;
// Helper for wxTE_PROCESS_ENTER handling: activates the default button in
// the dialog containing this control if any.
bool ClickDefaultButtonIfPossible();
private:
// implement this to return the associated GtkEntry or another widget
// implementing GtkEditable
@@ -94,6 +126,12 @@ private:
// implement this to return the associated GtkEntry
virtual GtkEntry *GetEntry() const = 0;
// This one exists in order to be overridden by wxTextCtrl which uses
// either GtkEditable or GtkTextBuffer depending on whether it is single-
// or multi-line.
virtual void *GetTextObject() const { return GetEntry(); }
// Various auto-completion-related stuff, only used if any of AutoComplete()
// methods are called.
wxTextAutoCompleteData *m_autoCompleteData;
@@ -101,6 +139,10 @@ private:
// It needs to call our GetEntry() method.
friend class wxTextAutoCompleteData;
// Data used for coalescing "changed" events resulting from a single user
// action.
mutable wxTextCoalesceData* m_coalesceData;
bool m_isUpperCase;
};

View File

@@ -30,7 +30,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
const wxString& name = wxASCII_STR(wxCheckBoxNameStr))
{
Create(parent, id, label, pos, size, style, validator, name);
}
@@ -42,7 +42,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
const wxString& name = wxASCII_STR(wxCheckBoxNameStr));
// Get/set the value
void SetValue(bool state) wxOVERRIDE;
@@ -90,7 +90,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
const wxString& name = wxASCII_STR(wxCheckBoxNameStr))
{
Create(parent, id, label, pos, size, style, validator, name);
}
@@ -102,7 +102,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
const wxString& name = wxASCII_STR(wxCheckBoxNameStr));
// deprecated synonym for SetBitmapLabel()
wxDEPRECATED_INLINE( void SetLabel(const wxBitmap& bitmap),

View File

@@ -25,7 +25,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTB_DEFAULT_STYLE,
const wxString& name = wxToolBarNameStr )
const wxString& name = wxASCII_STR(wxToolBarNameStr) )
{
Init();
@@ -37,7 +37,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTB_DEFAULT_STYLE,
const wxString& name = wxToolBarNameStr );
const wxString& name = wxASCII_STR(wxToolBarNameStr) );
virtual ~wxToolBar();

View File

@@ -27,7 +27,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr)
const wxString& name = wxASCII_STR(wxFrameNameStr))
{
Init();
@@ -40,7 +40,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
const wxString& name = wxASCII_STR(wxFrameNameStr));
virtual ~wxTopLevelWindowGTK();
@@ -74,6 +74,7 @@ public:
virtual void SetLabel(const wxString& label) wxOVERRIDE { SetTitle( label ); }
virtual wxString GetLabel() const wxOVERRIDE { return GetTitle(); }
virtual wxVisualAttributes GetDefaultAttributes() const wxOVERRIDE;
virtual bool SetTransparent(wxByte alpha) wxOVERRIDE;
virtual bool CanSetTransparent() wxOVERRIDE;
@@ -112,11 +113,19 @@ public:
// size of WM decorations
struct DecorSize
{
DecorSize()
{
left =
right =
top =
bottom = 0;
}
int left, right, top, bottom;
};
DecorSize m_decorSize;
// private gtk_timeout_add result for mimicing wxUSER_ATTENTION_INFO and
// private gtk_timeout_add result for mimicking wxUSER_ATTENTION_INFO and
// wxUSER_ATTENTION_ERROR difference, -2 for no hint, -1 for ERROR hint, rest for GtkTimeout handle.
int m_urgency_hint;
// timer for detecting WM with broken _NET_REQUEST_FRAME_EXTENTS handling
@@ -156,6 +165,9 @@ private:
// size hint increments
int m_incWidth, m_incHeight;
// position before it last changed
wxPoint m_lastPos;
// is the frame currently iconized?
bool m_isIconized;

View File

@@ -37,7 +37,7 @@ public:
const wxString& url = wxWebViewDefaultURLStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxWebViewNameStr)
const wxString& name = wxASCII_STR(wxWebViewNameStr))
{
Create(parent, id, url, pos, size, style, name);
}
@@ -47,7 +47,7 @@ public:
const wxString& url = wxWebViewDefaultURLStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxWebViewNameStr) wxOVERRIDE;
const wxString& name = wxASCII_STR(wxWebViewNameStr)) wxOVERRIDE;
virtual ~wxWebViewWebKit();
@@ -83,7 +83,9 @@ public:
wxWebViewZoomType GetZoomType() const wxOVERRIDE;
bool CanSetZoomType(wxWebViewZoomType) const wxOVERRIDE;
virtual wxWebViewZoom GetZoom() const wxOVERRIDE;
virtual float GetZoomFactor() const wxOVERRIDE;
virtual void SetZoom(wxWebViewZoom) wxOVERRIDE;
virtual void SetZoomFactor(float) wxOVERRIDE;
//Clipboard functions
virtual bool CanCut() const wxOVERRIDE;
@@ -160,6 +162,7 @@ private:
#if wxUSE_WEBVIEW_WEBKIT2
bool CanExecuteEditingCommand(const gchar* command) const;
void SetupWebExtensionServer();
GDBusProxy *GetExtensionProxy() const;
bool RunScriptSync(const wxString& javascript, wxString* output = NULL);
#endif
@@ -193,7 +196,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxWebViewNameStr) wxOVERRIDE
const wxString& name = wxASCII_STR(wxWebViewNameStr)) wxOVERRIDE
{ return new wxWebViewWebKit(parent, id, url, pos, size, style, name); }
};

View File

@@ -49,13 +49,13 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
const wxString& name = wxASCII_STR(wxPanelNameStr));
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
const wxString& name = wxASCII_STR(wxPanelNameStr));
virtual ~wxWindowGTK();
// implement base class (pure) virtual methods
@@ -97,6 +97,7 @@ public:
virtual int GetCharHeight() const wxOVERRIDE;
virtual int GetCharWidth() const wxOVERRIDE;
virtual double GetContentScaleFactor() const wxOVERRIDE;
virtual double GetDPIScaleFactor() const wxOVERRIDE;
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh = true ) wxOVERRIDE;