move Freeze() and Thaw() to wxWindowBase to ensure that they behave consistently (i.e. recursively, as described in the docs) in all ports; removed different duplications of freeze count from derived classes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -68,6 +68,10 @@ Changes in behaviour not resulting in compilation errors, please read this!
|
|||||||
sizes of the sizer items to be in the same proportion as the items
|
sizes of the sizer items to be in the same proportion as the items
|
||||||
proportions to return to the old behaviour.
|
proportions to return to the old behaviour.
|
||||||
|
|
||||||
|
- wxWindow::Freeze/Thaw() are not virtual any more, if you overrode them in
|
||||||
|
your code you need to override DoFreeze/Thaw() instead now.
|
||||||
|
|
||||||
|
|
||||||
Changes in behaviour which may result in compilation errors
|
Changes in behaviour which may result in compilation errors
|
||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
|
|
||||||
@@ -128,7 +132,7 @@ Changes in behaviour which may result in compilation errors
|
|||||||
|
|
||||||
- Removed global GetLine() function from wx/protocol/protocol.h, use
|
- Removed global GetLine() function from wx/protocol/protocol.h, use
|
||||||
wxProtocol::ReadLine() instead.
|
wxProtocol::ReadLine() instead.
|
||||||
|
|
||||||
- wxVariant no longer derives from wxObject. wxVariantData also no longer
|
- wxVariant no longer derives from wxObject. wxVariantData also no longer
|
||||||
derives from wxObject; instead of using wxDynamicCast with wxVariantData you
|
derives from wxObject; instead of using wxDynamicCast with wxVariantData you
|
||||||
can use the macro wxDynamicCastVariantData with the same arguments.
|
can use the macro wxDynamicCastVariantData with the same arguments.
|
||||||
|
|||||||
@@ -728,7 +728,8 @@ subwindows.
|
|||||||
Freezes the window or, in other words, prevents any updates from taking place
|
Freezes the window or, in other words, prevents any updates from taking place
|
||||||
on screen, the window is not redrawn at all. \helpref{Thaw}{wxwindowthaw} must
|
on screen, the window is not redrawn at all. \helpref{Thaw}{wxwindowthaw} must
|
||||||
be called to reenable window redrawing. Calls to these two functions may be
|
be called to reenable window redrawing. Calls to these two functions may be
|
||||||
nested.
|
nested but to ensure that the window is properly repainted again, you must thaw
|
||||||
|
it exactly as many times as you froze it.
|
||||||
|
|
||||||
This method is useful for visual appearance optimization (for example, it
|
This method is useful for visual appearance optimization (for example, it
|
||||||
is a good idea to use it before doing many large text insertions in a row into
|
is a good idea to use it before doing many large text insertions in a row into
|
||||||
|
|||||||
@@ -75,9 +75,6 @@ public:
|
|||||||
virtual void Refresh(bool eraseBackground = true,
|
virtual void Refresh(bool eraseBackground = true,
|
||||||
const wxRect *rect = (const wxRect *) NULL);
|
const wxRect *rect = (const wxRect *) NULL);
|
||||||
virtual void Update();
|
virtual void Update();
|
||||||
virtual void Freeze();
|
|
||||||
virtual void Thaw();
|
|
||||||
virtual bool IsFrozen() const { return m_frozenness > 0; }
|
|
||||||
|
|
||||||
virtual bool SetCursor(const wxCursor &cursor);
|
virtual bool SetCursor(const wxCursor &cursor);
|
||||||
virtual bool SetFont(const wxFont &font) { m_font = font; return true; }
|
virtual bool SetFont(const wxFont &font) { m_font = font; return true; }
|
||||||
@@ -128,6 +125,8 @@ protected:
|
|||||||
virtual void DoCaptureMouse();
|
virtual void DoCaptureMouse();
|
||||||
virtual void DoReleaseMouse();
|
virtual void DoReleaseMouse();
|
||||||
|
|
||||||
|
virtual void DoThaw();
|
||||||
|
|
||||||
// move the window to the specified location and resize it: this is called
|
// move the window to the specified location and resize it: this is called
|
||||||
// from both DoSetSize() and DoSetClientSize() and would usually just call
|
// from both DoSetSize() and DoSetClientSize() and would usually just call
|
||||||
// ::MoveWindow() except for composite controls which will want to arrange
|
// ::MoveWindow() except for composite controls which will want to arrange
|
||||||
@@ -183,9 +182,6 @@ private:
|
|||||||
// don't access it directly)
|
// don't access it directly)
|
||||||
wxRect m_rect;
|
wxRect m_rect;
|
||||||
|
|
||||||
// number of calls to Freeze() minus number of calls to Thaw()
|
|
||||||
unsigned m_frozenness;
|
|
||||||
|
|
||||||
// overlays for this window (or NULL if it doesn't have any)
|
// overlays for this window (or NULL if it doesn't have any)
|
||||||
wxDfbOverlaysList *m_overlays;
|
wxDfbOverlaysList *m_overlays;
|
||||||
|
|
||||||
|
|||||||
@@ -174,9 +174,6 @@ public:
|
|||||||
virtual void Refresh(bool eraseBackground = true,
|
virtual void Refresh(bool eraseBackground = true,
|
||||||
const wxRect *rect = NULL);
|
const wxRect *rect = NULL);
|
||||||
|
|
||||||
virtual void Freeze();
|
|
||||||
virtual void Thaw();
|
|
||||||
|
|
||||||
virtual bool SetBackgroundColour( const wxColour &colour );
|
virtual bool SetBackgroundColour( const wxColour &colour );
|
||||||
virtual bool SetForegroundColour( const wxColour &colour );
|
virtual bool SetForegroundColour( const wxColour &colour );
|
||||||
virtual wxColour GetBackgroundColour() const;
|
virtual wxColour GetBackgroundColour() const;
|
||||||
@@ -218,6 +215,9 @@ protected:
|
|||||||
|
|
||||||
virtual wxSize DoGetBestSize() const;
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
|
virtual void DoFreeze();
|
||||||
|
virtual void DoThaw();
|
||||||
|
|
||||||
// return the text for the given column of the given item
|
// return the text for the given column of the given item
|
||||||
virtual wxString OnGetItemText(long item, long column) const;
|
virtual wxString OnGetItemText(long item, long column) const;
|
||||||
|
|
||||||
|
|||||||
@@ -197,8 +197,6 @@ public:
|
|||||||
virtual bool SetBackgroundColour(const wxColour& colour);
|
virtual bool SetBackgroundColour(const wxColour& colour);
|
||||||
virtual bool SetForegroundColour(const wxColour& colour);
|
virtual bool SetForegroundColour(const wxColour& colour);
|
||||||
|
|
||||||
virtual void Freeze();
|
|
||||||
virtual void Thaw();
|
|
||||||
virtual void Refresh(bool eraseBackground = true, const wxRect *rect = NULL);
|
virtual void Refresh(bool eraseBackground = true, const wxRect *rect = NULL);
|
||||||
|
|
||||||
virtual bool SetFont( const wxFont &font );
|
virtual bool SetFont( const wxFont &font );
|
||||||
@@ -253,7 +251,6 @@ protected:
|
|||||||
bool m_lastOnSame; // last click on the same item as prev
|
bool m_lastOnSame; // last click on the same item as prev
|
||||||
wxImageList *m_imageListButtons;
|
wxImageList *m_imageListButtons;
|
||||||
|
|
||||||
int m_freezeCount;
|
|
||||||
int m_dragCount;
|
int m_dragCount;
|
||||||
wxPoint m_dragStart;
|
wxPoint m_dragStart;
|
||||||
wxGenericTreeItem *m_dropTarget;
|
wxGenericTreeItem *m_dropTarget;
|
||||||
@@ -273,6 +270,9 @@ protected:
|
|||||||
// the common part of all ctors
|
// the common part of all ctors
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
|
// overridden wxWindow methods
|
||||||
|
virtual void DoThaw();
|
||||||
|
|
||||||
// misc helpers
|
// misc helpers
|
||||||
void SendDeleteEvent(wxGenericTreeItem *itemBeingDeleted);
|
void SendDeleteEvent(wxGenericTreeItem *itemBeingDeleted);
|
||||||
|
|
||||||
|
|||||||
@@ -121,11 +121,6 @@ public:
|
|||||||
|
|
||||||
void SetUpdateFont(bool WXUNUSED(update)) { }
|
void SetUpdateFont(bool WXUNUSED(update)) { }
|
||||||
|
|
||||||
// GTK+ textctrl is so dumb that you need to freeze/thaw it manually to
|
|
||||||
// avoid horrible flicker/scrolling back and forth
|
|
||||||
virtual void Freeze();
|
|
||||||
virtual void Thaw();
|
|
||||||
|
|
||||||
// implementation only from now on
|
// implementation only from now on
|
||||||
|
|
||||||
// tell the control to ignore next text changed signal
|
// tell the control to ignore next text changed signal
|
||||||
@@ -148,9 +143,6 @@ public:
|
|||||||
static wxVisualAttributes
|
static wxVisualAttributes
|
||||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||||
|
|
||||||
// has the control been frozen by Freeze()?
|
|
||||||
bool IsFrozen() const { return m_freezeCount > 0; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// wxGTK-specific: called recursively by Enable,
|
// wxGTK-specific: called recursively by Enable,
|
||||||
// to give widgets an oppprtunity to correct their colours after they
|
// to give widgets an oppprtunity to correct their colours after they
|
||||||
@@ -162,6 +154,9 @@ protected:
|
|||||||
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
|
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||||
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
|
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
|
||||||
|
|
||||||
|
virtual void DoFreeze();
|
||||||
|
virtual void DoThaw();
|
||||||
|
|
||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
@@ -217,8 +212,6 @@ private:
|
|||||||
// a dummy one when frozen
|
// a dummy one when frozen
|
||||||
GtkTextBuffer *m_buffer;
|
GtkTextBuffer *m_buffer;
|
||||||
|
|
||||||
// number of calls to Freeze() minus number of calls to Thaw()
|
|
||||||
unsigned m_freezeCount;
|
|
||||||
GtkTextMark* m_showPositionOnThaw;
|
GtkTextMark* m_showPositionOnThaw;
|
||||||
|
|
||||||
// For wxTE_AUTO_URL
|
// For wxTE_AUTO_URL
|
||||||
|
|||||||
@@ -139,11 +139,6 @@ public:
|
|||||||
|
|
||||||
void SetModified() { m_modified = true; }
|
void SetModified() { m_modified = true; }
|
||||||
|
|
||||||
// GTK+ textctrl is so dumb that you need to freeze/thaw it manually to
|
|
||||||
// avoid horrible flicker/scrolling back and forth
|
|
||||||
virtual void Freeze();
|
|
||||||
virtual void Thaw();
|
|
||||||
|
|
||||||
// textctrl specific scrolling
|
// textctrl specific scrolling
|
||||||
virtual bool ScrollLines(int lines);
|
virtual bool ScrollLines(int lines);
|
||||||
virtual bool ScrollPages(int pages);
|
virtual bool ScrollPages(int pages);
|
||||||
@@ -170,6 +165,10 @@ protected:
|
|||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
|
// overridden wxWindow methods
|
||||||
|
virtual void DoFreeze();
|
||||||
|
virtual void DoThaw();
|
||||||
|
|
||||||
// get the vertical adjustment, if any, NULL otherwise
|
// get the vertical adjustment, if any, NULL otherwise
|
||||||
GtkAdjustment *GetVAdj() const;
|
GtkAdjustment *GetVAdj() const;
|
||||||
|
|
||||||
|
|||||||
@@ -62,9 +62,6 @@ public:
|
|||||||
|
|
||||||
virtual void Refresh( bool eraseBackground = true,
|
virtual void Refresh( bool eraseBackground = true,
|
||||||
const wxRect *rect = NULL );
|
const wxRect *rect = NULL );
|
||||||
virtual void Freeze();
|
|
||||||
virtual void Thaw();
|
|
||||||
virtual bool IsFrozen() const;
|
|
||||||
|
|
||||||
virtual void Update() ;
|
virtual void Update() ;
|
||||||
virtual void ClearBackground();
|
virtual void ClearBackground();
|
||||||
@@ -86,6 +83,9 @@ protected:
|
|||||||
virtual void DoEnable( bool enable );
|
virtual void DoEnable( bool enable );
|
||||||
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
||||||
|
|
||||||
|
virtual void DoFreeze();
|
||||||
|
virtual void DoThaw();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
||||||
int range, bool refresh = true );
|
int range, bool refresh = true );
|
||||||
@@ -262,9 +262,6 @@ protected:
|
|||||||
// For controls like radio buttons which are genuinely composite
|
// For controls like radio buttons which are genuinely composite
|
||||||
wxList m_subControls;
|
wxList m_subControls;
|
||||||
|
|
||||||
// number of calls to Freeze() minus number of calls to Thaw()
|
|
||||||
unsigned int m_frozenness;
|
|
||||||
|
|
||||||
// the peer object, allowing for cleaner API support
|
// the peer object, allowing for cleaner API support
|
||||||
wxMacControl * m_peer ;
|
wxMacControl * m_peer ;
|
||||||
|
|
||||||
|
|||||||
@@ -68,8 +68,6 @@ public:
|
|||||||
virtual void Refresh(bool eraseBackground = true,
|
virtual void Refresh(bool eraseBackground = true,
|
||||||
const wxRect *rect = (const wxRect *) NULL);
|
const wxRect *rect = (const wxRect *) NULL);
|
||||||
virtual void Update();
|
virtual void Update();
|
||||||
virtual void Freeze();
|
|
||||||
virtual void Thaw();
|
|
||||||
|
|
||||||
virtual bool SetCursor(const wxCursor &cursor);
|
virtual bool SetCursor(const wxCursor &cursor);
|
||||||
virtual bool SetFont(const wxFont &font) { m_font = font; return true; }
|
virtual bool SetFont(const wxFont &font) { m_font = font; return true; }
|
||||||
@@ -100,11 +98,14 @@ public:
|
|||||||
void OnInternalIdle();
|
void OnInternalIdle();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void DoFreeze();
|
||||||
|
virtual void DoThaw();
|
||||||
|
|
||||||
|
|
||||||
// the window handle
|
// the window handle
|
||||||
struct window_t *m_wnd;
|
struct window_t *m_wnd;
|
||||||
// whether there should be wxEraseEvent before wxPaintEvent or not
|
// whether there should be wxEraseEvent before wxPaintEvent or not
|
||||||
// (see wxWindow::Refresh)
|
// (see wxWindow::Refresh)
|
||||||
bool m_frozen:1;
|
|
||||||
bool m_refreshAfterThaw:1;
|
bool m_refreshAfterThaw:1;
|
||||||
int m_eraseBackground;
|
int m_eraseBackground;
|
||||||
|
|
||||||
|
|||||||
@@ -75,10 +75,6 @@ public:
|
|||||||
virtual bool SetTransparent(wxByte alpha);
|
virtual bool SetTransparent(wxByte alpha);
|
||||||
virtual bool CanSetTransparent();
|
virtual bool CanSetTransparent();
|
||||||
|
|
||||||
//Top level windows have different freeze semantics on Windows
|
|
||||||
virtual void Freeze();
|
|
||||||
virtual void Thaw();
|
|
||||||
|
|
||||||
virtual void AddChild( wxWindowBase *child );
|
virtual void AddChild( wxWindowBase *child );
|
||||||
|
|
||||||
|
|
||||||
@@ -142,6 +138,10 @@ protected:
|
|||||||
virtual void DoGetSize(int *width, int *height) const;
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
#endif // __WXWINCE__
|
#endif // __WXWINCE__
|
||||||
|
|
||||||
|
// Top level windows have different freeze semantics on Windows
|
||||||
|
virtual void DoFreeze();
|
||||||
|
virtual void DoThaw();
|
||||||
|
|
||||||
// helper of SetIcons(): calls gets the icon with the size specified by the
|
// helper of SetIcons(): calls gets the icon with the size specified by the
|
||||||
// given system metrics (SM_C{X|Y}[SM]ICON) from the bundle and sets it
|
// given system metrics (SM_C{X|Y}[SM]ICON) from the bundle and sets it
|
||||||
// using WM_SETICON with the specified wParam (ICOM_SMALL or ICON_BIG)
|
// using WM_SETICON with the specified wParam (ICOM_SMALL or ICON_BIG)
|
||||||
|
|||||||
@@ -83,9 +83,6 @@ public:
|
|||||||
virtual void Refresh( bool eraseBackground = true,
|
virtual void Refresh( bool eraseBackground = true,
|
||||||
const wxRect *rect = (const wxRect *) NULL );
|
const wxRect *rect = (const wxRect *) NULL );
|
||||||
virtual void Update();
|
virtual void Update();
|
||||||
virtual void Freeze();
|
|
||||||
virtual void Thaw();
|
|
||||||
virtual bool IsFrozen() const { return m_frozenness > 0; }
|
|
||||||
|
|
||||||
virtual void SetWindowStyleFlag(long style);
|
virtual void SetWindowStyleFlag(long style);
|
||||||
virtual void SetExtraStyle(long exStyle);
|
virtual void SetExtraStyle(long exStyle);
|
||||||
@@ -503,6 +500,9 @@ protected:
|
|||||||
|
|
||||||
virtual void DoEnable(bool enable);
|
virtual void DoEnable(bool enable);
|
||||||
|
|
||||||
|
virtual void DoFreeze();
|
||||||
|
virtual void DoThaw();
|
||||||
|
|
||||||
// this simply moves/resizes the given HWND which is supposed to be our
|
// this simply moves/resizes the given HWND which is supposed to be our
|
||||||
// sibling (this is useful for controls which are composite at MSW level
|
// sibling (this is useful for controls which are composite at MSW level
|
||||||
// and for which DoMoveWindow() is not enough)
|
// and for which DoMoveWindow() is not enough)
|
||||||
@@ -555,8 +555,6 @@ private:
|
|||||||
bool HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
bool HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// current defer window position operation handle (may be NULL)
|
// current defer window position operation handle (may be NULL)
|
||||||
WXHANDLE m_hDWP;
|
WXHANDLE m_hDWP;
|
||||||
|
|
||||||
@@ -567,10 +565,6 @@ protected:
|
|||||||
wxPoint m_pendingPosition;
|
wxPoint m_pendingPosition;
|
||||||
wxSize m_pendingSize;
|
wxSize m_pendingSize;
|
||||||
|
|
||||||
// number of calls to Freeze() minus number of calls to Thaw()
|
|
||||||
// protected so that wxTopLevelWindowMSW can access it
|
|
||||||
unsigned int m_frozenness;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef __POCKETPC__
|
#ifdef __POCKETPC__
|
||||||
bool m_contextMenuEnabled;
|
bool m_contextMenuEnabled;
|
||||||
|
|||||||
@@ -92,9 +92,7 @@ public:
|
|||||||
virtual void Refresh( bool bEraseBackground = true
|
virtual void Refresh( bool bEraseBackground = true
|
||||||
,const wxRect* pRect = (const wxRect *)NULL
|
,const wxRect* pRect = (const wxRect *)NULL
|
||||||
);
|
);
|
||||||
virtual void Freeze(void);
|
|
||||||
virtual void Update(void);
|
virtual void Update(void);
|
||||||
virtual void Thaw(void);
|
|
||||||
virtual void SetWindowStyleFlag(long lStyle);
|
virtual void SetWindowStyleFlag(long lStyle);
|
||||||
virtual bool SetCursor(const wxCursor& rCursor);
|
virtual bool SetCursor(const wxCursor& rCursor);
|
||||||
virtual bool SetFont(const wxFont& rFont);
|
virtual bool SetFont(const wxFont& rFont);
|
||||||
@@ -416,6 +414,9 @@ public:
|
|||||||
PSWP GetSwp(void) {return &m_vWinSwp;}
|
PSWP GetSwp(void) {return &m_vWinSwp;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void DoFreeze(void);
|
||||||
|
virtual void DoThaw(void);
|
||||||
|
|
||||||
// PM can't create some MSW styles natively but can perform these after
|
// PM can't create some MSW styles natively but can perform these after
|
||||||
// creation by sending messages
|
// creation by sending messages
|
||||||
typedef enum extra_flags { kFrameToolWindow = 0x0001
|
typedef enum extra_flags { kFrameToolWindow = 0x0001
|
||||||
|
|||||||
@@ -73,8 +73,6 @@ public:
|
|||||||
virtual void Refresh( bool eraseBackground = true,
|
virtual void Refresh( bool eraseBackground = true,
|
||||||
const wxRect *rect = NULL );
|
const wxRect *rect = NULL );
|
||||||
virtual void Update();
|
virtual void Update();
|
||||||
virtual void Freeze();
|
|
||||||
virtual void Thaw();
|
|
||||||
|
|
||||||
virtual bool SetCursor( const wxCursor &cursor );
|
virtual bool SetCursor( const wxCursor &cursor );
|
||||||
virtual bool SetFont( const wxFont &font );
|
virtual bool SetFont( const wxFont &font );
|
||||||
@@ -271,9 +269,6 @@ private:
|
|||||||
bool HandleMoving(wxRect& rect);
|
bool HandleMoving(wxRect& rect);
|
||||||
bool HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags);
|
bool HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags);
|
||||||
|
|
||||||
// number of calls to Freeze() minus number of calls to Thaw()
|
|
||||||
unsigned int m_frozenness;
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxWindowPalm)
|
DECLARE_DYNAMIC_CLASS(wxWindowPalm)
|
||||||
DECLARE_NO_COPY_CLASS(wxWindowPalm)
|
DECLARE_NO_COPY_CLASS(wxWindowPalm)
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
|||||||
@@ -263,15 +263,6 @@ public:
|
|||||||
virtual void SelectAll();
|
virtual void SelectAll();
|
||||||
virtual void SetEditable(bool editable);
|
virtual void SetEditable(bool editable);
|
||||||
|
|
||||||
/// Call Freeze to prevent refresh
|
|
||||||
virtual void Freeze();
|
|
||||||
|
|
||||||
/// Call Thaw to refresh
|
|
||||||
virtual void Thaw();
|
|
||||||
|
|
||||||
/// Call Thaw to refresh
|
|
||||||
virtual bool IsFrozen() const { return m_freezeCount > 0; }
|
|
||||||
|
|
||||||
virtual bool HasSelection() const;
|
virtual bool HasSelection() const;
|
||||||
|
|
||||||
///// Functionality specific to wxRichTextCtrl
|
///// Functionality specific to wxRichTextCtrl
|
||||||
@@ -772,13 +763,11 @@ protected:
|
|||||||
|
|
||||||
virtual void DoSetValue(const wxString& value, int flags = 0);
|
virtual void DoSetValue(const wxString& value, int flags = 0);
|
||||||
|
|
||||||
|
virtual void DoThaw();
|
||||||
|
|
||||||
|
|
||||||
// Data members
|
// Data members
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/// Allows nested Freeze/Thaw
|
|
||||||
int m_freezeCount;
|
|
||||||
|
|
||||||
#if wxRICHTEXT_BUFFERED_PAINTING
|
#if wxRICHTEXT_BUFFERED_PAINTING
|
||||||
/// Buffer bitmap
|
/// Buffer bitmap
|
||||||
wxBitmap m_bufferBitmap;
|
wxBitmap m_bufferBitmap;
|
||||||
|
|||||||
@@ -858,13 +858,19 @@ public:
|
|||||||
virtual void ClearBackground();
|
virtual void ClearBackground();
|
||||||
|
|
||||||
// freeze the window: don't redraw it until it is thawed
|
// freeze the window: don't redraw it until it is thawed
|
||||||
virtual void Freeze() { }
|
void Freeze() { if ( !m_freezeCount++ ) DoFreeze(); }
|
||||||
|
|
||||||
// thaw the window: redraw it after it had been frozen
|
// thaw the window: redraw it after it had been frozen
|
||||||
virtual void Thaw() { }
|
void Thaw()
|
||||||
|
{
|
||||||
|
wxASSERT_MSG( m_freezeCount, "Thaw() without matching Freeze()" );
|
||||||
|
|
||||||
|
if ( !--m_freezeCount )
|
||||||
|
DoThaw();
|
||||||
|
}
|
||||||
|
|
||||||
// return true if window had been frozen and not unthawed yet
|
// return true if window had been frozen and not unthawed yet
|
||||||
virtual bool IsFrozen() const { return false; }
|
bool IsFrozen() const { return m_freezeCount != 0; }
|
||||||
|
|
||||||
// adjust DC for drawing on this window
|
// adjust DC for drawing on this window
|
||||||
virtual void PrepareDC( wxDC & WXUNUSED(dc) ) { }
|
virtual void PrepareDC( wxDC & WXUNUSED(dc) ) { }
|
||||||
@@ -1563,6 +1569,12 @@ protected:
|
|||||||
// implements the window variants
|
// implements the window variants
|
||||||
virtual void DoSetWindowVariant( wxWindowVariant variant ) ;
|
virtual void DoSetWindowVariant( wxWindowVariant variant ) ;
|
||||||
|
|
||||||
|
|
||||||
|
// really freeze/thaw the window (should have port-specific implementation)
|
||||||
|
virtual void DoFreeze() { }
|
||||||
|
virtual void DoThaw() { }
|
||||||
|
|
||||||
|
|
||||||
// Must be called when mouse capture is lost to send
|
// Must be called when mouse capture is lost to send
|
||||||
// wxMouseCaptureLostEvent to windows on capture stack.
|
// wxMouseCaptureLostEvent to windows on capture stack.
|
||||||
static void NotifyCaptureLost();
|
static void NotifyCaptureLost();
|
||||||
@@ -1583,11 +1595,19 @@ private:
|
|||||||
|
|
||||||
// the stack of windows which have captured the mouse
|
// the stack of windows which have captured the mouse
|
||||||
static struct WXDLLIMPEXP_FWD_CORE wxWindowNext *ms_winCaptureNext;
|
static struct WXDLLIMPEXP_FWD_CORE wxWindowNext *ms_winCaptureNext;
|
||||||
|
|
||||||
// the window that currently has mouse capture
|
// the window that currently has mouse capture
|
||||||
static wxWindow *ms_winCaptureCurrent;
|
static wxWindow *ms_winCaptureCurrent;
|
||||||
|
|
||||||
// indicates if execution is inside CaptureMouse/ReleaseMouse
|
// indicates if execution is inside CaptureMouse/ReleaseMouse
|
||||||
static bool ms_winCaptureChanging;
|
static bool ms_winCaptureChanging;
|
||||||
|
|
||||||
|
|
||||||
|
// number of Freeze() calls minus the number of Thaw() calls: we're frozen
|
||||||
|
// (i.e. not being updated) if it is positive
|
||||||
|
unsigned int m_freezeCount;
|
||||||
|
|
||||||
|
|
||||||
DECLARE_ABSTRACT_CLASS(wxWindowBase)
|
DECLARE_ABSTRACT_CLASS(wxWindowBase)
|
||||||
DECLARE_NO_COPY_CLASS(wxWindowBase)
|
DECLARE_NO_COPY_CLASS(wxWindowBase)
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
|||||||
@@ -205,9 +205,6 @@ public:
|
|||||||
|
|
||||||
void SetModified() { m_modified = true; }
|
void SetModified() { m_modified = true; }
|
||||||
|
|
||||||
virtual void Freeze();
|
|
||||||
virtual void Thaw();
|
|
||||||
|
|
||||||
// textctrl specific scrolling
|
// textctrl specific scrolling
|
||||||
virtual bool ScrollLines(int lines);
|
virtual bool ScrollLines(int lines);
|
||||||
virtual bool ScrollPages(int pages);
|
virtual bool ScrollPages(int pages);
|
||||||
|
|||||||
@@ -212,6 +212,8 @@ wxWindowBase::wxWindowBase()
|
|||||||
|
|
||||||
// VZ: this one shouldn't exist...
|
// VZ: this one shouldn't exist...
|
||||||
m_isBeingDeleted = false;
|
m_isBeingDeleted = false;
|
||||||
|
|
||||||
|
m_freezeCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// common part of window creation process
|
// common part of window creation process
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ END_EVENT_TABLE()
|
|||||||
void wxWindowDFB::Init()
|
void wxWindowDFB::Init()
|
||||||
{
|
{
|
||||||
m_isShown = true;
|
m_isShown = true;
|
||||||
m_frozenness = 0;
|
|
||||||
m_tlw = NULL;
|
m_tlw = NULL;
|
||||||
m_overlays = NULL;
|
m_overlays = NULL;
|
||||||
}
|
}
|
||||||
@@ -638,20 +637,10 @@ void wxWindowDFB::Update()
|
|||||||
GetParent()->Update();
|
GetParent()->Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDFB::Freeze()
|
void wxWindowDFB::DoThaw()
|
||||||
{
|
{
|
||||||
m_frozenness++;
|
if ( IsShown() )
|
||||||
}
|
DoRefreshWindow();
|
||||||
|
|
||||||
void wxWindowDFB::Thaw()
|
|
||||||
{
|
|
||||||
wxASSERT_MSG( IsFrozen(), "Thaw() without matching Freeze()" );
|
|
||||||
|
|
||||||
if ( --m_frozenness == 0 )
|
|
||||||
{
|
|
||||||
if ( IsShown() )
|
|
||||||
DoRefreshWindow();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDFB::PaintWindow(const wxRect& rect)
|
void wxWindowDFB::PaintWindow(const wxRect& rect)
|
||||||
@@ -1080,7 +1069,7 @@ wxWindow* wxFindWindowAtPointer(wxPoint& pt)
|
|||||||
return wxFindWindowAtPoint(pt = wxGetMousePosition());
|
return wxFindWindowAtPoint(pt = wxGetMousePosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
|
wxWindow* wxFindWindowAtPoint(const wxPoint& WXUNUSED(pt))
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( "wxFindWindowAtPoint not implemented" );
|
wxFAIL_MSG( "wxFindWindowAtPoint not implemented" );
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -600,9 +600,9 @@ public:
|
|||||||
SetFocusIgnoringChildren();
|
SetFocusIgnoringChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
// suspend/resume redrawing the control
|
// we don't draw anything while we're frozen so we must refresh ourselves
|
||||||
void Freeze();
|
// when we're thawed to make sure the changes are displayed correctly
|
||||||
void Thaw();
|
virtual void DoThaw() { Refresh(); }
|
||||||
|
|
||||||
void OnRenameTimer();
|
void OnRenameTimer();
|
||||||
bool OnRenameAccept(size_t itemEdit, const wxString& value);
|
bool OnRenameAccept(size_t itemEdit, const wxString& value);
|
||||||
@@ -850,9 +850,6 @@ private:
|
|||||||
wxBrush *m_highlightBrush,
|
wxBrush *m_highlightBrush,
|
||||||
*m_highlightUnfocusedBrush;
|
*m_highlightUnfocusedBrush;
|
||||||
|
|
||||||
// if this is > 0, the control is frozen and doesn't redraw itself
|
|
||||||
size_t m_freezeCount;
|
|
||||||
|
|
||||||
// wrapper around the text control currently used for in place editing or
|
// wrapper around the text control currently used for in place editing or
|
||||||
// NULL if no item is being edited
|
// NULL if no item is being edited
|
||||||
wxListTextCtrlWrapper *m_textctrlWrapper;
|
wxListTextCtrlWrapper *m_textctrlWrapper;
|
||||||
@@ -2283,8 +2280,6 @@ void wxListMainWindow::Init()
|
|||||||
m_lineLastClicked =
|
m_lineLastClicked =
|
||||||
m_lineSelectSingleOnUp =
|
m_lineSelectSingleOnUp =
|
||||||
m_lineBeforeLastClicked = (size_t)-1;
|
m_lineBeforeLastClicked = (size_t)-1;
|
||||||
|
|
||||||
m_freezeCount = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxListMainWindow::wxListMainWindow()
|
wxListMainWindow::wxListMainWindow()
|
||||||
@@ -2703,32 +2698,23 @@ void wxListMainWindow::RefreshSelected()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxListMainWindow::Freeze()
|
|
||||||
{
|
|
||||||
m_freezeCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxListMainWindow::Thaw()
|
|
||||||
{
|
|
||||||
wxCHECK_RET( m_freezeCount > 0, _T("thawing unfrozen list control?") );
|
|
||||||
|
|
||||||
if ( --m_freezeCount == 0 )
|
|
||||||
Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
// Note: a wxPaintDC must be constructed even if no drawing is
|
// Note: a wxPaintDC must be constructed even if no drawing is
|
||||||
// done (a Windows requirement).
|
// done (a Windows requirement).
|
||||||
wxPaintDC dc( this );
|
wxPaintDC dc( this );
|
||||||
|
|
||||||
if ( IsEmpty() || m_freezeCount )
|
if ( IsEmpty() || IsFrozen() )
|
||||||
|
{
|
||||||
// nothing to draw or not the moment to draw it
|
// nothing to draw or not the moment to draw it
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( m_dirty )
|
if ( m_dirty )
|
||||||
|
{
|
||||||
// delay the repainting until we calculate all the items positions
|
// delay the repainting until we calculate all the items positions
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PrepareDC( dc );
|
PrepareDC( dc );
|
||||||
|
|
||||||
@@ -5920,12 +5906,12 @@ void wxGenericListCtrl::Refresh(bool eraseBackground, const wxRect *rect)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericListCtrl::Freeze()
|
void wxGenericListCtrl::DoFreeze()
|
||||||
{
|
{
|
||||||
m_mainWin->Freeze();
|
m_mainWin->Freeze();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericListCtrl::Thaw()
|
void wxGenericListCtrl::DoThaw()
|
||||||
{
|
{
|
||||||
m_mainWin->Thaw();
|
m_mainWin->Thaw();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -782,7 +782,6 @@ void wxGenericTreeCtrl::Init()
|
|||||||
m_textCtrl = NULL;
|
m_textCtrl = NULL;
|
||||||
|
|
||||||
m_renameTimer = NULL;
|
m_renameTimer = NULL;
|
||||||
m_freezeCount = 0;
|
|
||||||
|
|
||||||
m_findTimer = NULL;
|
m_findTimer = NULL;
|
||||||
|
|
||||||
@@ -1646,7 +1645,7 @@ void wxGenericTreeCtrl::Expand(const wxTreeItemId& itemId)
|
|||||||
}
|
}
|
||||||
|
|
||||||
item->Expand();
|
item->Expand();
|
||||||
if ( !m_freezeCount )
|
if ( !IsFrozen() )
|
||||||
{
|
{
|
||||||
CalculatePositions();
|
CalculatePositions();
|
||||||
|
|
||||||
@@ -3517,13 +3516,13 @@ void wxGenericTreeCtrl::CalculatePositions()
|
|||||||
|
|
||||||
void wxGenericTreeCtrl::Refresh(bool eraseBackground, const wxRect *rect)
|
void wxGenericTreeCtrl::Refresh(bool eraseBackground, const wxRect *rect)
|
||||||
{
|
{
|
||||||
if ( !m_freezeCount )
|
if ( !IsFrozen() )
|
||||||
wxTreeCtrlBase::Refresh(eraseBackground, rect);
|
wxTreeCtrlBase::Refresh(eraseBackground, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericTreeCtrl::RefreshSubtree(wxGenericTreeItem *item)
|
void wxGenericTreeCtrl::RefreshSubtree(wxGenericTreeItem *item)
|
||||||
{
|
{
|
||||||
if (m_dirty || m_freezeCount)
|
if (m_dirty || IsFrozen() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxSize client = GetClientSize();
|
wxSize client = GetClientSize();
|
||||||
@@ -3540,7 +3539,7 @@ void wxGenericTreeCtrl::RefreshSubtree(wxGenericTreeItem *item)
|
|||||||
|
|
||||||
void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item )
|
void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item )
|
||||||
{
|
{
|
||||||
if (m_dirty || m_freezeCount)
|
if (m_dirty || IsFrozen() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxRect rect;
|
wxRect rect;
|
||||||
@@ -3553,7 +3552,7 @@ void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item )
|
|||||||
|
|
||||||
void wxGenericTreeCtrl::RefreshSelected()
|
void wxGenericTreeCtrl::RefreshSelected()
|
||||||
{
|
{
|
||||||
if (m_freezeCount)
|
if (IsFrozen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: this is awfully inefficient, we should keep the list of all
|
// TODO: this is awfully inefficient, we should keep the list of all
|
||||||
@@ -3564,7 +3563,7 @@ void wxGenericTreeCtrl::RefreshSelected()
|
|||||||
|
|
||||||
void wxGenericTreeCtrl::RefreshSelectedUnder(wxGenericTreeItem *item)
|
void wxGenericTreeCtrl::RefreshSelectedUnder(wxGenericTreeItem *item)
|
||||||
{
|
{
|
||||||
if (m_freezeCount)
|
if (IsFrozen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( item->IsSelected() )
|
if ( item->IsSelected() )
|
||||||
@@ -3578,22 +3577,12 @@ void wxGenericTreeCtrl::RefreshSelectedUnder(wxGenericTreeItem *item)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericTreeCtrl::Freeze()
|
void wxGenericTreeCtrl::DoThaw()
|
||||||
{
|
{
|
||||||
m_freezeCount++;
|
if ( m_dirty )
|
||||||
}
|
DoDirtyProcessing();
|
||||||
|
else
|
||||||
void wxGenericTreeCtrl::Thaw()
|
Refresh();
|
||||||
{
|
|
||||||
wxCHECK_RET( m_freezeCount > 0, _T("thawing unfrozen tree control?") );
|
|
||||||
|
|
||||||
if ( --m_freezeCount == 0 )
|
|
||||||
{
|
|
||||||
if ( m_dirty )
|
|
||||||
DoDirtyProcessing();
|
|
||||||
else
|
|
||||||
Refresh();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -3654,7 +3643,7 @@ wxGenericTreeCtrl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
|
|||||||
|
|
||||||
void wxGenericTreeCtrl::DoDirtyProcessing()
|
void wxGenericTreeCtrl::DoDirtyProcessing()
|
||||||
{
|
{
|
||||||
if (m_freezeCount)
|
if (IsFrozen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_dirty = false;
|
m_dirty = false;
|
||||||
|
|||||||
@@ -614,7 +614,6 @@ void wxTextCtrl::Init()
|
|||||||
SetUpdateFont(false);
|
SetUpdateFont(false);
|
||||||
|
|
||||||
m_text = NULL;
|
m_text = NULL;
|
||||||
m_freezeCount = 0;
|
|
||||||
m_showPositionOnThaw = NULL;
|
m_showPositionOnThaw = NULL;
|
||||||
m_gdkHandCursor = NULL;
|
m_gdkHandCursor = NULL;
|
||||||
m_gdkXTermCursor = NULL;
|
m_gdkXTermCursor = NULL;
|
||||||
@@ -1719,58 +1718,50 @@ wxSize wxTextCtrl::DoGetBestSize() const
|
|||||||
// freeze/thaw
|
// freeze/thaw
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxTextCtrl::Freeze()
|
void wxTextCtrl::DoFreeze()
|
||||||
{
|
{
|
||||||
wxCHECK_RET(m_text != NULL, wxT("invalid text ctrl"));
|
wxCHECK_RET(m_text != NULL, wxT("invalid text ctrl"));
|
||||||
|
|
||||||
if ( HasFlag(wxTE_MULTILINE) )
|
if ( HasFlag(wxTE_MULTILINE) )
|
||||||
{
|
{
|
||||||
if (m_freezeCount++ == 0)
|
// freeze textview updates and remove buffer
|
||||||
{
|
g_signal_connect (m_text, "expose_event",
|
||||||
// freeze textview updates and remove buffer
|
G_CALLBACK (gtk_text_exposed_callback), this);
|
||||||
g_signal_connect (m_text, "expose_event",
|
g_signal_connect (m_widget, "expose_event",
|
||||||
G_CALLBACK (gtk_text_exposed_callback), this);
|
G_CALLBACK (gtk_text_exposed_callback), this);
|
||||||
g_signal_connect (m_widget, "expose_event",
|
gtk_widget_set_sensitive(m_widget, false);
|
||||||
G_CALLBACK (gtk_text_exposed_callback), this);
|
g_object_ref(m_buffer);
|
||||||
gtk_widget_set_sensitive(m_widget, false);
|
GtkTextBuffer* buf_new = gtk_text_buffer_new(NULL);
|
||||||
g_object_ref(m_buffer);
|
GtkTextMark* mark = GTK_TEXT_VIEW(m_text)->first_para_mark;
|
||||||
GtkTextBuffer* buf_new = gtk_text_buffer_new(NULL);
|
gtk_text_view_set_buffer(GTK_TEXT_VIEW(m_text), buf_new);
|
||||||
GtkTextMark* mark = GTK_TEXT_VIEW(m_text)->first_para_mark;
|
// gtk_text_view_set_buffer adds its own reference
|
||||||
gtk_text_view_set_buffer(GTK_TEXT_VIEW(m_text), buf_new);
|
g_object_unref(buf_new);
|
||||||
// gtk_text_view_set_buffer adds its own reference
|
// This mark should be deleted when the buffer is changed,
|
||||||
g_object_unref(buf_new);
|
// but it's not (in GTK+ up to at least 2.10.6).
|
||||||
// This mark should be deleted when the buffer is changed,
|
// Otherwise these anonymous marks start to build up in the buffer,
|
||||||
// but it's not (in GTK+ up to at least 2.10.6).
|
// and Freeze takes longer and longer each time it is called.
|
||||||
// Otherwise these anonymous marks start to build up in the buffer,
|
if (GTK_IS_TEXT_MARK(mark) && !gtk_text_mark_get_deleted(mark))
|
||||||
// and Freeze takes longer and longer each time it is called.
|
gtk_text_buffer_delete_mark(m_buffer, mark);
|
||||||
if (GTK_IS_TEXT_MARK(mark) && !gtk_text_mark_get_deleted(mark))
|
|
||||||
gtk_text_buffer_delete_mark(m_buffer, mark);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTextCtrl::Thaw()
|
void wxTextCtrl::DoThaw()
|
||||||
{
|
{
|
||||||
if ( HasFlag(wxTE_MULTILINE) )
|
if ( HasFlag(wxTE_MULTILINE) )
|
||||||
{
|
{
|
||||||
wxCHECK_RET(m_freezeCount != 0, _T("Thaw() without matching Freeze()"));
|
// Reattach buffer and thaw textview updates
|
||||||
|
gtk_text_view_set_buffer(GTK_TEXT_VIEW(m_text), m_buffer);
|
||||||
if (--m_freezeCount == 0)
|
g_object_unref(m_buffer);
|
||||||
|
gtk_widget_set_sensitive(m_widget, true);
|
||||||
|
g_signal_handlers_disconnect_by_func (m_widget,
|
||||||
|
(gpointer) gtk_text_exposed_callback, this);
|
||||||
|
g_signal_handlers_disconnect_by_func (m_text,
|
||||||
|
(gpointer) gtk_text_exposed_callback, this);
|
||||||
|
if (m_showPositionOnThaw != NULL)
|
||||||
{
|
{
|
||||||
// Reattach buffer and thaw textview updates
|
gtk_text_view_scroll_mark_onscreen(
|
||||||
gtk_text_view_set_buffer(GTK_TEXT_VIEW(m_text), m_buffer);
|
GTK_TEXT_VIEW(m_text), m_showPositionOnThaw);
|
||||||
g_object_unref(m_buffer);
|
m_showPositionOnThaw = NULL;
|
||||||
gtk_widget_set_sensitive(m_widget, true);
|
|
||||||
g_signal_handlers_disconnect_by_func (m_widget,
|
|
||||||
(gpointer) gtk_text_exposed_callback, this);
|
|
||||||
g_signal_handlers_disconnect_by_func (m_text,
|
|
||||||
(gpointer) gtk_text_exposed_callback, this);
|
|
||||||
if (m_showPositionOnThaw != NULL)
|
|
||||||
{
|
|
||||||
gtk_text_view_scroll_mark_onscreen(
|
|
||||||
GTK_TEXT_VIEW(m_text), m_showPositionOnThaw);
|
|
||||||
m_showPositionOnThaw = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1290,7 +1290,7 @@ wxSize wxTextCtrl::DoGetBestSize() const
|
|||||||
// freeze/thaw
|
// freeze/thaw
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxTextCtrl::Freeze()
|
void wxTextCtrl::DoFreeze()
|
||||||
{
|
{
|
||||||
if ( HasFlag(wxTE_MULTILINE) )
|
if ( HasFlag(wxTE_MULTILINE) )
|
||||||
{
|
{
|
||||||
@@ -1298,7 +1298,7 @@ void wxTextCtrl::Freeze()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTextCtrl::Thaw()
|
void wxTextCtrl::DoThaw()
|
||||||
{
|
{
|
||||||
if ( HasFlag(wxTE_MULTILINE) )
|
if ( HasFlag(wxTE_MULTILINE) )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -865,7 +865,6 @@ wxWindowMac::wxWindowMac(wxWindowMac *parent,
|
|||||||
void wxWindowMac::Init()
|
void wxWindowMac::Init()
|
||||||
{
|
{
|
||||||
m_peer = NULL ;
|
m_peer = NULL ;
|
||||||
m_frozenness = 0 ;
|
|
||||||
m_macAlpha = 255 ;
|
m_macAlpha = 255 ;
|
||||||
m_cgContextRef = NULL ;
|
m_cgContextRef = NULL ;
|
||||||
|
|
||||||
@@ -2091,38 +2090,25 @@ void wxWindowMac::Refresh(bool WXUNUSED(eraseBack), const wxRect *rect)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMac::Freeze()
|
void wxWindowMac::DoFreeze()
|
||||||
{
|
{
|
||||||
#if TARGET_API_MAC_OSX
|
#if TARGET_API_MAC_OSX
|
||||||
if ( !m_frozenness++ )
|
if ( m_peer && m_peer->Ok() )
|
||||||
{
|
m_peer->SetDrawingEnabled( false ) ;
|
||||||
if ( m_peer && m_peer->Ok() )
|
|
||||||
m_peer->SetDrawingEnabled( false ) ;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMac::Thaw()
|
void wxWindowMac::DoThaw()
|
||||||
{
|
{
|
||||||
#if TARGET_API_MAC_OSX
|
#if TARGET_API_MAC_OSX
|
||||||
wxASSERT_MSG( m_frozenness > 0, wxT("Thaw() without matching Freeze()") );
|
if ( m_peer && m_peer->Ok() )
|
||||||
|
|
||||||
if ( !--m_frozenness )
|
|
||||||
{
|
{
|
||||||
if ( m_peer && m_peer->Ok() )
|
m_peer->SetDrawingEnabled( true ) ;
|
||||||
{
|
m_peer->InvalidateWithChildren() ;
|
||||||
m_peer->SetDrawingEnabled( true ) ;
|
|
||||||
m_peer->InvalidateWithChildren() ;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowMac::IsFrozen() const
|
|
||||||
{
|
|
||||||
return m_frozenness != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxWindowMac *wxGetActiveWindow()
|
wxWindowMac *wxGetActiveWindow()
|
||||||
{
|
{
|
||||||
// actually this is a windows-only concept
|
// actually this is a windows-only concept
|
||||||
|
|||||||
@@ -550,7 +550,6 @@ void wxWindowMGL::Init()
|
|||||||
// mgl specific:
|
// mgl specific:
|
||||||
m_wnd = NULL;
|
m_wnd = NULL;
|
||||||
m_isShown = true;
|
m_isShown = true;
|
||||||
m_frozen = false;
|
|
||||||
m_paintMGLDC = NULL;
|
m_paintMGLDC = NULL;
|
||||||
m_eraseBackground = -1;
|
m_eraseBackground = -1;
|
||||||
}
|
}
|
||||||
@@ -1119,26 +1118,24 @@ void wxWindowMGL::Refresh(bool eraseBack, const wxRect *rect)
|
|||||||
|
|
||||||
void wxWindowMGL::Update()
|
void wxWindowMGL::Update()
|
||||||
{
|
{
|
||||||
if ( !m_frozen )
|
if ( !IsFrozen() )
|
||||||
MGL_wmUpdateDC(g_winMng);
|
MGL_wmUpdateDC(g_winMng);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMGL::Freeze()
|
void wxWindowMGL::DoFreeze()
|
||||||
{
|
{
|
||||||
m_frozen = true;
|
|
||||||
m_refreshAfterThaw = false;
|
m_refreshAfterThaw = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMGL::Thaw()
|
void wxWindowMGL::DoThaw()
|
||||||
{
|
{
|
||||||
m_frozen = false;
|
|
||||||
if ( m_refreshAfterThaw )
|
if ( m_refreshAfterThaw )
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMGL::HandlePaint(MGLDevCtx *dc)
|
void wxWindowMGL::HandlePaint(MGLDevCtx *dc)
|
||||||
{
|
{
|
||||||
if ( m_frozen )
|
if ( IsFrozen() )
|
||||||
{
|
{
|
||||||
// Don't paint anything if the window is frozen.
|
// Don't paint anything if the window is frozen.
|
||||||
m_refreshAfterThaw = true;
|
m_refreshAfterThaw = true;
|
||||||
|
|||||||
@@ -1172,55 +1172,50 @@ bool wxTopLevelWindowMSW::CanSetTransparent()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wxTopLevelWindowMSW::Freeze()
|
void wxTopLevelWindowMSW::DoFreeze()
|
||||||
{
|
{
|
||||||
if ( !m_frozenness++) {
|
if ( IsShown() )
|
||||||
if (IsShown()) {
|
|
||||||
for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
|
|
||||||
node;
|
|
||||||
node = node->GetNext() )
|
|
||||||
{
|
|
||||||
wxWindow *child = node->GetData();
|
|
||||||
if ( child->IsTopLevel() )
|
|
||||||
continue;
|
|
||||||
else
|
|
||||||
child->Freeze();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxTopLevelWindowMSW::Thaw()
|
|
||||||
{
|
|
||||||
wxASSERT_MSG( m_frozenness > 0, _T("Thaw() without matching Freeze()") );
|
|
||||||
if ( --m_frozenness == 0 )
|
|
||||||
{
|
{
|
||||||
if ( IsShown() ) {
|
for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
|
||||||
for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
|
node;
|
||||||
node;
|
node = node->GetNext() )
|
||||||
node = node->GetNext() )
|
{
|
||||||
{
|
wxWindow *child = node->GetData();
|
||||||
wxWindow *child = node->GetData();
|
if ( child->IsTopLevel() )
|
||||||
if ( child->IsTopLevel() )
|
continue;
|
||||||
continue;
|
|
||||||
else
|
|
||||||
child->Thaw();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void wxTopLevelWindowMSW::AddChild(wxWindowBase *child )
|
|
||||||
{
|
|
||||||
//adding a child while frozen will assert when thawn,
|
|
||||||
// so freeze it
|
|
||||||
if (child && !child->IsTopLevel() && IsFrozen()) {
|
|
||||||
//need to match our current freeze level
|
|
||||||
for (unsigned int ii=0;ii< m_frozenness;ii++) {
|
|
||||||
child->Freeze();
|
child->Freeze();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxTopLevelWindowMSW::DoThaw()
|
||||||
|
{
|
||||||
|
if ( IsShown() )
|
||||||
|
{
|
||||||
|
for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
|
||||||
|
node;
|
||||||
|
node = node->GetNext() )
|
||||||
|
{
|
||||||
|
wxWindow *child = node->GetData();
|
||||||
|
if ( child->IsTopLevel() )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
child->Thaw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wxTopLevelWindowMSW::AddChild(wxWindowBase *child)
|
||||||
|
{
|
||||||
|
// adding a child while frozen will assert when thawn, so freeze it as if
|
||||||
|
// it had been already present when we were frozen
|
||||||
|
if ( child && !child->IsTopLevel() && IsFrozen() )
|
||||||
|
{
|
||||||
|
child->Freeze();
|
||||||
|
}
|
||||||
|
|
||||||
wxTopLevelWindowBase::AddChild(child);
|
wxTopLevelWindowBase::AddChild(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -524,8 +524,6 @@ void wxWindowMSW::Init()
|
|||||||
m_mouseInWindow = false;
|
m_mouseInWindow = false;
|
||||||
m_lastKeydownProcessed = false;
|
m_lastKeydownProcessed = false;
|
||||||
|
|
||||||
m_frozenness = 0;
|
|
||||||
|
|
||||||
m_hWnd = 0;
|
m_hWnd = 0;
|
||||||
m_hDWP = 0;
|
m_hDWP = 0;
|
||||||
|
|
||||||
@@ -1606,29 +1604,21 @@ static inline void SendSetRedraw(HWND hwnd, bool on)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMSW::Freeze()
|
void wxWindowMSW::DoFreeze()
|
||||||
{
|
{
|
||||||
if ( !m_frozenness++ )
|
if ( IsShown() )
|
||||||
{
|
SendSetRedraw(GetHwnd(), false);
|
||||||
if ( IsShown() )
|
|
||||||
SendSetRedraw(GetHwnd(), false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMSW::Thaw()
|
void wxWindowMSW::DoThaw()
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( m_frozenness > 0, _T("Thaw() without matching Freeze()") );
|
if ( IsShown() )
|
||||||
|
|
||||||
if ( --m_frozenness == 0 )
|
|
||||||
{
|
{
|
||||||
if ( IsShown() )
|
SendSetRedraw(GetHwnd(), true);
|
||||||
{
|
|
||||||
SendSetRedraw(GetHwnd(), true);
|
|
||||||
|
|
||||||
// we need to refresh everything or otherwise the invalidated area
|
// we need to refresh everything or otherwise the invalidated area
|
||||||
// is not going to be repainted
|
// is not going to be repainted
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1109,12 +1109,12 @@ void wxWindowOS2::Update()
|
|||||||
::WinUpdateWindow(GetHwnd());
|
::WinUpdateWindow(GetHwnd());
|
||||||
} // end of wxWindowOS2::Update
|
} // end of wxWindowOS2::Update
|
||||||
|
|
||||||
void wxWindowOS2::Freeze()
|
void wxWindowOS2::DoFreeze()
|
||||||
{
|
{
|
||||||
::WinSendMsg(GetHwnd(), WM_VRNDISABLED, (MPARAM)0, (MPARAM)0);
|
::WinSendMsg(GetHwnd(), WM_VRNDISABLED, (MPARAM)0, (MPARAM)0);
|
||||||
} // end of wxWindowOS2::Freeze
|
} // end of wxWindowOS2::Freeze
|
||||||
|
|
||||||
void wxWindowOS2::Thaw()
|
void wxWindowOS2::DoThaw()
|
||||||
{
|
{
|
||||||
::WinSendMsg(GetHwnd(), WM_VRNENABLED, (MPARAM)TRUE, (MPARAM)0);
|
::WinSendMsg(GetHwnd(), WM_VRNENABLED, (MPARAM)TRUE, (MPARAM)0);
|
||||||
|
|
||||||
|
|||||||
@@ -432,14 +432,6 @@ bool wxWindowPalm::Reparent(wxWindowBase *parent)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowPalm::Freeze()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxWindowPalm::Thaw()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxWindowPalm::Refresh(bool eraseBack, const wxRect *rect)
|
void wxWindowPalm::Refresh(bool eraseBack, const wxRect *rect)
|
||||||
{
|
{
|
||||||
WinHandle handle = (WinHandle)GetHWND();
|
WinHandle handle = (WinHandle)GetHWND();
|
||||||
|
|||||||
@@ -201,7 +201,6 @@ wxRichTextCtrl::~wxRichTextCtrl()
|
|||||||
/// Member initialisation
|
/// Member initialisation
|
||||||
void wxRichTextCtrl::Init()
|
void wxRichTextCtrl::Init()
|
||||||
{
|
{
|
||||||
m_freezeCount = 0;
|
|
||||||
m_contextMenu = NULL;
|
m_contextMenu = NULL;
|
||||||
m_caret = NULL;
|
m_caret = NULL;
|
||||||
m_caretPosition = -1;
|
m_caretPosition = -1;
|
||||||
@@ -217,25 +216,13 @@ void wxRichTextCtrl::Init()
|
|||||||
m_caretPositionForDefaultStyle = -2;
|
m_caretPositionForDefaultStyle = -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Call Freeze to prevent refresh
|
void wxRichTextCtrl::DoThaw()
|
||||||
void wxRichTextCtrl::Freeze()
|
|
||||||
{
|
{
|
||||||
m_freezeCount ++;
|
if (GetBuffer().GetDirty())
|
||||||
}
|
LayoutContent();
|
||||||
|
else
|
||||||
/// Call Thaw to refresh
|
SetupScrollbars();
|
||||||
void wxRichTextCtrl::Thaw()
|
Refresh(false);
|
||||||
{
|
|
||||||
m_freezeCount --;
|
|
||||||
|
|
||||||
if (m_freezeCount == 0)
|
|
||||||
{
|
|
||||||
if (GetBuffer().GetDirty())
|
|
||||||
LayoutContent();
|
|
||||||
else
|
|
||||||
SetupScrollbars();
|
|
||||||
Refresh(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Clear all text
|
/// Clear all text
|
||||||
@@ -248,7 +235,7 @@ void wxRichTextCtrl::Clear()
|
|||||||
m_caretAtLineStart = false;
|
m_caretAtLineStart = false;
|
||||||
m_selectionRange.SetRange(-2, -2);
|
m_selectionRange.SetRange(-2, -2);
|
||||||
|
|
||||||
if (m_freezeCount == 0)
|
if (!IsFrozen())
|
||||||
{
|
{
|
||||||
LayoutContent();
|
LayoutContent();
|
||||||
Refresh(false);
|
Refresh(false);
|
||||||
@@ -269,11 +256,12 @@ void wxRichTextCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
#else
|
#else
|
||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
#endif
|
#endif
|
||||||
PrepareDC(dc);
|
|
||||||
|
|
||||||
if (m_freezeCount > 0)
|
if (IsFrozen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
PrepareDC(dc);
|
||||||
|
|
||||||
dc.SetFont(GetFont());
|
dc.SetFont(GetFont());
|
||||||
|
|
||||||
// Paint the background
|
// Paint the background
|
||||||
@@ -1789,7 +1777,7 @@ void wxRichTextCtrl::OnScroll(wxScrollWinEvent& event)
|
|||||||
/// Set up scrollbars, e.g. after a resize
|
/// Set up scrollbars, e.g. after a resize
|
||||||
void wxRichTextCtrl::SetupScrollbars(bool atTop)
|
void wxRichTextCtrl::SetupScrollbars(bool atTop)
|
||||||
{
|
{
|
||||||
if (m_freezeCount)
|
if (IsFrozen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (GetBuffer().IsEmpty())
|
if (GetBuffer().IsEmpty())
|
||||||
|
|||||||
@@ -2375,18 +2375,6 @@ wxSize wxTextCtrl::DoGetBestSize() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// freeze/thaw
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void wxTextCtrl::Freeze()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxTextCtrl::Thaw()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxTextCtrl::OnSetFocus( wxFocusEvent& event )
|
void wxTextCtrl::OnSetFocus( wxFocusEvent& event )
|
||||||
{
|
{
|
||||||
// To hide or show caret, as appropriate
|
// To hide or show caret, as appropriate
|
||||||
|
|||||||
Reference in New Issue
Block a user