From 88150e6073673c304d285906e0d718374a5abe93 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 28 Dec 1998 21:32:10 +0000 Subject: [PATCH] Fixes to wxMotif scrolling and colours (wxTreeCtrl/wxListCtrl now seem to work well, ta-ra!); fixes to thread.cpp since constants were changed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1275 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/cw.rsp | 2 +- distrib/msw/vc.rsp | 4 +- distrib/msw/zipdist.bat | 2 + docs/motif/changes.txt | 12 +- docs/motif/todo.txt | 46 +------ include/wx/motif/window.h | 18 +++ include/wx/string.h | 2 + src/common/socket.cpp | 22 +--- src/generic/scrolwin.cpp | 21 +--- src/make_cw.mcp | Bin 96680 -> 96680 bytes src/motif/dialog.cpp | 3 +- src/motif/thread.cpp | 16 +-- src/motif/window.cpp | 255 +++++++++++++++++++++++++------------- src/stubs/thread.cpp | 16 +-- 14 files changed, 239 insertions(+), 180 deletions(-) diff --git a/distrib/msw/cw.rsp b/distrib/msw/cw.rsp index c04d82f724..db34f13bbe 100644 --- a/distrib/msw/cw.rsp +++ b/distrib/msw/cw.rsp @@ -42,7 +42,7 @@ samples/mfc/make_cw.mcp samples/minimal/make_cw.mcp -samples/minimal/make_cw.mcp +samples/minifram/make_cw.mcp samples/nativdlg/make_cw.mcp diff --git a/distrib/msw/vc.rsp b/distrib/msw/vc.rsp index e06f706c04..630b084712 100644 --- a/distrib/msw/vc.rsp +++ b/distrib/msw/vc.rsp @@ -64,8 +64,8 @@ samples/mfc/MfcVC.dsw samples/minimal/MinimalVC.dsp samples/minimal/MinimalVC.dsw -samples/minimal/MiniframVC.dsp -samples/minimal/MiniframVC.dsw +samples/minifram/MiniframVC.dsp +samples/minifram/MiniframVC.dsw samples/nativdlg/NativdlgVC.dsp samples/nativdlg/NativdlgVC.dsw diff --git a/distrib/msw/zipdist.bat b/distrib/msw/zipdist.bat index d345f552a7..d8c4e4deda 100755 --- a/distrib/msw/zipdist.bat +++ b/distrib/msw/zipdist.bat @@ -14,6 +14,7 @@ erase %dest\wx200*.zip cd %src echo Zipping... + zip32 -@ %dest\wx200gen.zip < %src\distrib\msw\generic.rsp zip32 -@ %dest\wx200msw.zip < %src\distrib\msw\msw.rsp zip32 -@ %dest\wx200gtk.zip < %src\distrib\msw\gtk.rsp @@ -28,6 +29,7 @@ zip32 -@ %dest\wx200wrd.zip < %src\distrib\msw\wx_word.rsp rem VC++ project files zip32 -@ %dest\wx200vc.zip < %src\distrib\msw\vc.rsp + rem CodeWarrior project files zip32 -@ %dest\wx200cw.zip < %src\distrib\msw\cw.rsp diff --git a/docs/motif/changes.txt b/docs/motif/changes.txt index 0ea2595216..3c9df41c3f 100644 --- a/docs/motif/changes.txt +++ b/docs/motif/changes.txt @@ -89,4 +89,14 @@ More recently: - Fixed a bug in wxStaticBox. - Controls sample runs, though wxRadioBox doesn't appear and the notebook flickers for a while. -- Cured wxTreeCtrl bug: now works pretty well! \ No newline at end of file +- Cured wxTreeCtrl bug: now works pretty well! + +28/12/98 +-------- + +- Cured scrolling problem: scrollbars now show/hide themselves + without (permanently) resizing the window. +- Removed some commented-out lines in wxScrolledWindow::AdjustScrollbars + that disabled scrollbar paging. +- Set background colour of drawing area in wxWindow, so e.g. wxListCtrl + colours correctly. \ No newline at end of file diff --git a/docs/motif/todo.txt b/docs/motif/todo.txt index ee35bec834..63254e2da6 100644 --- a/docs/motif/todo.txt +++ b/docs/motif/todo.txt @@ -1,7 +1,7 @@ wxMotif TODO ------------ -Updated: 12/11/98 +Updated: 28/12/98 -------------------------------o------------------------- @@ -40,33 +40,10 @@ High Priority - wxSpinButton -- Tidy dialogs such as the colour and font selectors. - -- Use generic wxTreeCtrl, wxListCtrl: debug and enhance these. - We're close to having these working: mostly scrolling to work out. - -- Find out why modal dialogs give a grab warning. - -- wxSystemSettings. Eventually, should have control panel-like utility - to change colours/fonts but meanwhile should maybe read them - from a file. - -- wxThread (hopefully, similar to wxGTK) - -- wxGrid: scrollbars don't hide; problem with cell selection. - -- MDI: seems to be broken for a more complex application I'm testing. - Frame decorations don't draw properly, and a child window doesn't - process events properly. So probably we should have an alternative - implementation that uses tabs, a la wxGTK. The system menu could - be implemented using a pop-up menu that applies to the currently - active window. - -- Controls in a wxToolBar don't work. Probably due to form layout - problems; the workaround is to use a separate panel for controls. - - Miscellaneous events. +- Thread classes (copy wxGTK's). + - Write makefiles for all samples and utilities. - Create some samples for testing. @@ -75,14 +52,11 @@ Low Priority ------------ - Better makefile system that can put objects in different dirs. - Use wxGTK config system? It's really complex to debug and - doesn't offer a way of compiling apps outside the wxWin - hierarchy. - Extra wxBitmap formats: PNG, BMP. Could use old wxWin 1.68 wxImage code (derived from XV) for BMP/GIF but it's very bloated. However, when implemented as extra bitmap handlers, the code won't be linked - unless needed. + unless needed. Update: see if wxImage can handle these formats. - Print/preview framework in print.cpp (see wxGTK). @@ -107,10 +81,6 @@ Low Priority - add the driver code to src/motif/helphtml.cpp (a frame, toolbar, history list). -- Optimize screen refresh for non-native widgets, e.g. wxWindow - created with Create(), using technique in flicker patch for 1.68 - (see JACS for latest patch). - - Copy and paste, drag and drop. Use a standard X drag and drop standard - see http://www.cco.caltech.edu/~jafl/xdnd/ or use Motif drag and drop as described here: @@ -130,19 +100,11 @@ Low Priority - Reimplement combobox using Lesstif's widget (avoiding GPL'ed widget currently used). -- Write generic wxDirDialog (directory selector) - -- Use native Motif dialogs for wxMessageBox - - Miscellaneous classes e.g. wxJoystick (identical to GTK's one for Linux) - Blit scaling -- Could eventually alter the MDI widgets to be more Windows-like - -- currently it's half-hearted (menus are on children, whereas - they should replace the main parent frame menu). - - Get ODBC classes and sample working. - Work out why wxTextCtrl doesn't work as a stream buffer under diff --git a/include/wx/motif/window.h b/include/wx/motif/window.h index f4a6a05f4c..daa7e42b93 100644 --- a/include/wx/motif/window.h +++ b/include/wx/motif/window.h @@ -275,6 +275,10 @@ public: virtual void SetScrollbar(int orient, int pos, int thumbVisible, int range, bool refresh = TRUE); + // Helper functions for Motif + void CreateScrollbar(int orientation); + void DestroyScrollbar(int orientation); + virtual void SetScrollPos(int orient, int pos, bool refresh = TRUE); virtual int GetScrollPos(int orient) const; virtual int GetScrollRange(int orient) const; @@ -686,5 +690,19 @@ wxWindow* WXDLLEXPORT wxGetActiveWindow(); WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows; +// A little class to switch off size optimization while an instance of the object +// exists +class WXDLLEXPORT wxNoOptimize: public wxObject +{ +public: + wxNoOptimize(); + ~wxNoOptimize(); + + static bool CanOptimize(); + +protected: + static int m_count; +}; + #endif // _WX_WINDOW_H_ diff --git a/include/wx/string.h b/include/wx/string.h index ea62d6781b..f9f731380f 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -73,6 +73,8 @@ */ // --------------------------------------------------------------------------- +WXDLLEXPORT_DATA(extern const char*) wxEmptyString; + /// checks whether the passed in pointer is NULL and if the string is empty inline bool WXDLLEXPORT IsEmpty(const char *p) { return !p || !*p; } diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 7faaef5d31..277e3e01ba 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -469,22 +469,13 @@ void wxSocketBase::Discard() bool wxSocketBase::GetPeer(wxSockAddress& addr_man) const { struct sockaddr my_addr; -#ifdef __WXMSW__ int len_addr = sizeof(my_addr); -#else - size_t len_addr = sizeof(my_addr); -#endif if (m_fd < 0) return FALSE; if (getpeername(m_fd, (struct sockaddr *)&my_addr, -#ifdef __WXMSW__ - &len_addr) -#else - (socklen_t *)&len_addr) -#endif - < 0) + &len_addr) < 0) return FALSE; addr_man.Disassemble(&my_addr, len_addr); @@ -494,22 +485,13 @@ bool wxSocketBase::GetPeer(wxSockAddress& addr_man) const bool wxSocketBase::GetLocal(wxSockAddress& addr_man) const { struct sockaddr my_addr; -#ifdef __WXMSW__ int len_addr = sizeof(my_addr); -#else - size_t len_addr = sizeof(my_addr); -#endif if (m_fd < 0) return FALSE; if (getsockname(m_fd, (struct sockaddr *)&my_addr, -#ifdef __WXMSW__ - &len_addr) -#else - (socklen_t *)&len_addr) -#endif - < 0) + &len_addr) < 0) return FALSE; diff --git a/src/generic/scrolwin.cpp b/src/generic/scrolwin.cpp index 4b99809f81..4bb0b3a77c 100644 --- a/src/generic/scrolwin.cpp +++ b/src/generic/scrolwin.cpp @@ -121,7 +121,6 @@ void wxScrolledWindow::OnScroll(wxScrollEvent& event) int nScrollInc = CalcScrollInc(event); if (nScrollInc == 0) return; - // TODO: should we store the scroll position here as well as in wxWindow? if (orient == wxHORIZONTAL) { int newPos = m_xScrollPosition + nScrollInc; @@ -133,19 +132,6 @@ void wxScrolledWindow::OnScroll(wxScrollEvent& event) SetScrollPos(wxVERTICAL, newPos, TRUE ); } -/* - // TODO We need to multiply the ScrollWindow amount by the scaling - // factor, but how do we know what this is in wxWin 2.0??? - float scaleX = 1.0; - float scaleY = 1.0; - - if ( this->IsKindOf(CLASSINFO(wxCanvas)) ) - { - wxDC* dc = ((wxCanvas *)this)->GetDC(); - dc->GetUserScale(&scaleX, &scaleY); - } -*/ - if (orient == wxHORIZONTAL) { m_xScrollPosition += nScrollInc; @@ -234,6 +220,7 @@ int wxScrolledWindow::CalcScrollInc(wxScrollEvent& event) break; } } + if (orient == wxHORIZONTAL) { if (m_xScrollPixelsPerLine > 0) { @@ -295,7 +282,8 @@ void wxScrolledWindow::AdjustScrollbars(void) m_xScrollPosition = wxMax( 0, m_xScrollPosition ); SetScrollbar(wxHORIZONTAL, m_xScrollPosition, noPagePositions, m_xScrollLines); -// SetScrollPageSize(wxHORIZONTAL, noPagePositions); + // The amount by which we scroll when paging + SetScrollPageSize(wxHORIZONTAL, noPagePositions); } else { @@ -316,7 +304,8 @@ void wxScrolledWindow::AdjustScrollbars(void) m_yScrollPosition = wxMax( 0, m_yScrollPosition ); SetScrollbar(wxVERTICAL, m_yScrollPosition, noPagePositions, m_yScrollLines); -// SetScrollPageSize(wxVERTICAL, noPagePositions); + // The amount by which we scroll when paging + SetScrollPageSize(wxVERTICAL, noPagePositions); } else { diff --git a/src/make_cw.mcp b/src/make_cw.mcp index d4a10e5ef138f0984082d50137b9a3dd83e64c0e..66a5ba2c46d54d753d8112a2aa14407742b33e60 100644 GIT binary patch delta 2245 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 range) thumbVisible = range; - XtVaSetValues(scrollBar, - XmNvalue, pos, - XmNminimum, 0, - XmNmaximum, range, - XmNsliderSize, thumbVisible, - NULL); + // Save the old state to see if it changed + WXWidget oldScrollBar = ((orient == wxHORIZONTAL) ? m_hScrollBar : m_vScrollBar ); if (orient == wxHORIZONTAL) - m_scrollPosX = pos; - else - m_scrollPosY = pos; - - // See notes below. If the scrollbars didn't leave a ghost presence, - // this would be OK. -#if 0 - if (range == thumbVisible) { - XtUnmanageChild(scrollBar); - if (orient == wxHORIZONTAL) - XtVaSetValues((Widget) m_scrolledWindow, - XmNhorizontalScrollBar, (Widget) 0, - NULL); + if (thumbVisible == range) + { + if (m_hScrollBar) + DestroyScrollbar(wxHORIZONTAL); + } else - XtVaSetValues((Widget) m_scrolledWindow, - XmNverticalScrollBar, (Widget) 0, - NULL); + { + if (!m_hScrollBar) + CreateScrollbar(wxHORIZONTAL); + } } - else + if (orient == wxVERTICAL) { - XtManageChild(scrollBar); - if (orient == wxHORIZONTAL) - XtVaSetValues((Widget) m_scrolledWindow, - XmNhorizontalScrollBar, (Widget) m_hScrollBar, - NULL); + if (thumbVisible == range) + { + if (m_vScrollBar) + DestroyScrollbar(wxVERTICAL); + } else - XtVaSetValues((Widget) m_scrolledWindow, - XmNverticalScrollBar, (Widget) m_vScrollBar, - NULL); + { + if (!m_vScrollBar) + CreateScrollbar(wxVERTICAL); + } } -#else - // Either both scrollbars are on, or they are off, - // otherwise you get a gap where one scrollbar - // isn't shown. TODO: try to eliminate this problem. - if ((GetScrollThumb(wxHORIZONTAL) >= GetScrollRange(wxHORIZONTAL)) && - (GetScrollThumb(wxVERTICAL) >= GetScrollRange(wxVERTICAL))) + WXWidget newScrollBar = ((orient == wxHORIZONTAL) ? m_hScrollBar : m_vScrollBar ); + + if (oldScrollBar != newScrollBar) { - if (m_hScrollBar) - XtUnmanageChild((Widget) m_hScrollBar); - if (m_vScrollBar) - XtUnmanageChild((Widget) m_vScrollBar); - XtVaSetValues((Widget) m_scrolledWindow, - XmNhorizontalScrollBar, (Widget) 0, - XmNverticalScrollBar, (Widget) 0, - NULL); - // XmScrolledWindowSetAreas((Widget) m_scrolledWindow, - // (Widget) 0, (Widget) 0, (Widget) m_drawingArea); + // This is important! Without it, scrollbars misbehave + // badly. + XtUnrealizeWidget((Widget) m_scrolledWindow); + XmScrolledWindowSetAreas ((Widget) m_scrolledWindow, (Widget) m_hScrollBar, (Widget) m_vScrollBar, (Widget) m_drawingArea); + XtRealizeWidget((Widget) m_scrolledWindow); + XtManageChild((Widget) m_scrolledWindow); } + + if (newScrollBar) + XtVaSetValues((Widget) newScrollBar, + XmNvalue, pos, + XmNminimum, 0, + XmNmaximum, range, + XmNsliderSize, thumbVisible, + NULL); + + if (orient == wxHORIZONTAL) + m_scrollPosX = pos; else - { - if (m_hScrollBar) - XtManageChild((Widget) m_hScrollBar); - if (m_vScrollBar) - XtManageChild((Widget) m_vScrollBar); - XtVaSetValues((Widget) m_scrolledWindow, - XmNhorizontalScrollBar, (Widget) m_hScrollBar, - XmNverticalScrollBar, (Widget) m_vScrollBar, - NULL); - // XmScrolledWindowSetAreas((Widget) m_scrolledWindow, - // (Widget) m_hScrollBar, (Widget) m_vScrollBar, (Widget) m_drawingArea); - } -#endif + m_scrollPosY = pos; + + int newW, newH; + GetSize(& newW, & newH); + + // Adjusting scrollbars can resize the canvas accidentally + if (newW != oldW || newH != oldH) + SetSize(-1, -1, oldW, oldH); } // Does a physical scroll @@ -2644,6 +2702,11 @@ void wxWindow::CanvasSetSize (int x, int y, int w, int h, int sizeFlags) else if (w == oldW && h == oldH) useOldSize = TRUE; + if (!wxNoOptimize::CanOptimize()) + { + useOldSize = FALSE; useOldPos = FALSE; + } + if (useOldPos && useOldSize) return; @@ -2704,7 +2767,7 @@ void wxWindow::CanvasSetSize (int x, int y, int w, int h, int sizeFlags) w -= (spacing + wsbar); - XtVaSetValues ((Widget) m_drawingArea, XmNwidth, w, NULL); + // XtVaSetValues ((Widget) m_drawingArea, XmNwidth, w, NULL); } if (h > -1) { @@ -2735,7 +2798,8 @@ void wxWindow::CanvasSetSize (int x, int y, int w, int h, int sizeFlags) h -= (spacing + wsbar); - XtVaSetValues ((Widget) m_drawingArea, XmNheight, h, NULL); + // XtVaSetValues ((Widget) m_drawingArea, XmNheight, h, NULL); + } } @@ -3202,12 +3266,16 @@ void wxWindow::ChangeBackgroundColour() { if (GetMainWidget()) DoChangeBackgroundColour(GetMainWidget(), m_backgroundColour); + if (m_scrolledWindow && (GetMainWidget() != m_scrolledWindow)) + DoChangeBackgroundColour(m_scrolledWindow, m_backgroundColour); } void wxWindow::ChangeForegroundColour() { if (GetMainWidget()) DoChangeForegroundColour(GetMainWidget(), m_foregroundColour); + if (m_scrolledWindow && (GetMainWidget() != m_scrolledWindow)) + DoChangeForegroundColour(m_scrolledWindow, m_foregroundColour); } // Change a widget's foreground and background colours. @@ -3370,3 +3438,24 @@ bool wxWindow::ProcessAccelerator(wxKeyEvent& event) return FALSE; } +/* + * wxNoOptimize: switch off size optimization + */ + +int wxNoOptimize::m_count = 0; + +wxNoOptimize::wxNoOptimize() +{ + m_count ++; +} + +wxNoOptimize::~wxNoOptimize() +{ + m_count --; +} + +bool wxNoOptimize::CanOptimize() +{ + return (m_count == 0); +} + diff --git a/src/stubs/thread.cpp b/src/stubs/thread.cpp index ca3833153a..e12b45e63b 100644 --- a/src/stubs/thread.cpp +++ b/src/stubs/thread.cpp @@ -57,14 +57,14 @@ wxMutexError wxMutex::Lock() { // TODO m_locked++; - return MUTEX_NO_ERROR; + return wxMUTEX_NO_ERROR; } wxMutexError wxMutex::TryLock() { // TODO m_locked++; - return MUTEX_NO_ERROR; + return wxMUTEX_NO_ERROR; } wxMutexError wxMutex::Unlock() @@ -73,7 +73,7 @@ wxMutexError wxMutex::Unlock() m_locked--; // TODO - return MUTEX_NO_ERROR; + return wxMUTEX_NO_ERROR; } class wxConditionInternal { @@ -134,25 +134,25 @@ public: wxThreadError wxThread::Create() { // TODO - return THREAD_NO_ERROR; + return wxTHREAD_NO_ERROR; } wxThreadError wxThread::Destroy() { // TODO - return THREAD_NO_ERROR; + return wxTHREAD_NO_ERROR; } wxThreadError wxThread::Pause() { // TODO - return THREAD_NO_ERROR; + return wxTHREAD_NO_ERROR; } wxThreadError wxThread::Resume() { // TODO - return THREAD_NO_ERROR; + return wxTHREAD_NO_ERROR; } void wxThread::Exit(void *status) @@ -193,11 +193,13 @@ unsigned long wxThread::GetID() const return 0; } +/* wxThread *wxThread::GetThreadFromID(unsigned long id) { // TODO return NULL; } +*/ bool wxThread::IsAlive() const { -- 2.47.2