Use wxScrollWinEvent instead of wxScrollEvent in

wxWindow and wxScrolledWindow. This breaks all ports!
  Added Layout() call to wxSplitter.
  wxDialog at least tries to set its position before its
    shown.
  wxGTK now emits char/key events as wxMSW does.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2491 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-05-17 19:17:28 +00:00
parent 9111db6802
commit c5b42c871b
11 changed files with 605 additions and 451 deletions

View File

@@ -1308,6 +1308,7 @@ protected:
typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&);
typedef void (wxEvtHandler::*wxCommandEventFunction)(wxCommandEvent&);
typedef void (wxEvtHandler::*wxScrollEventFunction)(wxScrollEvent&);
typedef void (wxEvtHandler::*wxScrollWinEventFunction)(wxScrollWinEvent&);
typedef void (wxEvtHandler::*wxSizeEventFunction)(wxSizeEvent&);
typedef void (wxEvtHandler::*wxMoveEventFunction)(wxMoveEvent&);
typedef void (wxEvtHandler::*wxPaintEventFunction)(wxPaintEvent&);
@@ -1421,7 +1422,25 @@ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
#define EVT_COMMAND(id, event, fn) { event, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
#define EVT_COMMAND_RANGE(id1, id2, event, fn) { event, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
// Scrolling
// Scrolling from wxWindow (sent to wxScrolledWindow)
#define EVT_SCROLLWIN(func) \
{ wxEVT_SCROLLWIN_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
{ wxEVT_SCROLLWIN_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
{ wxEVT_SCROLLWIN_LINEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
{ wxEVT_SCROLLWIN_LINEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
{ wxEVT_SCROLLWIN_PAGEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
{ wxEVT_SCROLLWIN_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
{ wxEVT_SCROLLWIN_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
#define EVT_SCROLLWIN_TOP(func) { wxEVT_SCROLLWIN_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
#define EVT_SCROLLWIN_BOTTOM(func) { wxEVT_SCROLLWIN_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
#define EVT_SCROLLWIN_LINEUP(func) { wxEVT_SCROLLWIN_LINEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
#define EVT_SCROLLWIN_LINEDOWN(func) { wxEVT_SCROLLWIN_LINEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
#define EVT_SCROLLWIN_PAGEUP(func) { wxEVT_SCROLLWIN_PAGEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
#define EVT_SCROLLWIN_PAGEDOWN(func) { wxEVT_SCROLLWIN_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
#define EVT_SCROLLWIN_THUMBTRACK(func) { wxEVT_SCROLLWIN_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
// Scrolling from wxSlider and wxScrollBar
#define EVT_SCROLL(func) \
{ wxEVT_SCROLL_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
{ wxEVT_SCROLL_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
@@ -1439,7 +1458,7 @@ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
#define EVT_SCROLL_PAGEDOWN(func) { wxEVT_SCROLL_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
#define EVT_SCROLL_THUMBTRACK(func) { wxEVT_SCROLL_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
// Scrolling, with an id
// Scrolling from wxSlider and wxScrollBar, with an id
#define EVT_COMMAND_SCROLL(id, func) \
{ wxEVT_SCROLL_TOP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
{ wxEVT_SCROLL_BOTTOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\

View File

@@ -25,7 +25,7 @@ class WXDLLEXPORT wxScrolledWindow: public wxWindow
DECLARE_ABSTRACT_CLASS(wxScrolledWindow)
public:
wxScrolledWindow(void);
wxScrolledWindow();
inline wxScrolledWindow(wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
@@ -35,7 +35,7 @@ public:
Create(parent, id, pos, size, style, name);
}
inline ~wxScrolledWindow(void) {}
~wxScrolledWindow() {}
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
@@ -94,7 +94,7 @@ public:
// Adjust the scrollbars
virtual void AdjustScrollbars(void);
void OnScroll(wxScrollEvent& event);
void OnScroll(wxScrollWinEvent& event);
void OnSize(wxSizeEvent& event);
void OnPaint(wxPaintEvent& event);
@@ -106,14 +106,11 @@ public:
virtual void PrepareDC(wxDC& dc);
public:
////////////////////////////////////////////////////////////////////////
//// IMPLEMENTATION
// IMPLEMENTATION
// Calculate scroll increment
virtual int CalcScrollInc(wxScrollEvent& event);
virtual int CalcScrollInc(wxScrollWinEvent& event);
////////////////////////////////////////////////////////////////////////
//// PROTECTED DATA
protected:
int m_xScrollPixelsPerLine;
int m_yScrollPixelsPerLine;
@@ -131,8 +128,5 @@ protected:
DECLARE_EVENT_TABLE()
};
////////////////////////////////////////////////////////////////////////
//// INLINES
#endif
// __SCROLWINH_G__

View File

@@ -113,9 +113,6 @@ public:
virtual WXWidget GetHandle() const { return m_widget; }
// wxWindows callbacks
void OnKeyDown( wxKeyEvent &event );
// also sets the global flag
void SetScrolling(bool scroll);
@@ -235,7 +232,6 @@ public:
private:
DECLARE_NO_COPY_CLASS(wxWindow);
DECLARE_EVENT_TABLE()
};
#endif // __GTKWINDOWH__

View File

@@ -113,9 +113,6 @@ public:
virtual WXWidget GetHandle() const { return m_widget; }
// wxWindows callbacks
void OnKeyDown( wxKeyEvent &event );
// also sets the global flag
void SetScrolling(bool scroll);
@@ -235,7 +232,6 @@ public:
private:
DECLARE_NO_COPY_CLASS(wxWindow);
DECLARE_EVENT_TABLE()
};
#endif // __GTKWINDOWH__