From 6adaedf0fc6607ee5bb4e86358396e5e07c6649f Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 8 Nov 1999 14:53:39 +0000 Subject: [PATCH] Made various Motif fixes, wxListBox/wxChoice derive from wxControlWithItems, added release.txt git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/generic.rsp | 18 +++----- distrib/msw/makefile.rsp | 13 ++++++ docs/readme.txt | 15 ++++-- docs/release.txt | 34 ++++++++++++++ include/wx/generic/spinctlg.h | 5 +- include/wx/motif/choice.h | 19 +++++++- include/wx/motif/listbox.h | 17 ++++++- samples/controls/controls.cpp | 5 +- samples/html/helpview/helpview.cpp | 9 ++++ samples/printing/printing.cpp | 22 +++++---- samples/printing/printing.h | 20 ++++---- src/common/prntbase.cpp | 21 ++++++--- src/generic/helpwxht.cpp | 4 +- src/makeprog.vc | 2 +- src/motif/choice.cpp | 74 ++++++++++++++++++++++++++++++ src/motif/listbox.cpp | 67 +++++++++++++++++++++++++++ src/motif/menu.cpp | 6 ++- 17 files changed, 298 insertions(+), 53 deletions(-) create mode 100644 docs/release.txt diff --git a/distrib/msw/generic.rsp b/distrib/msw/generic.rsp index 0beb8d0c1b..81e4d3e727 100644 --- a/distrib/msw/generic.rsp +++ b/distrib/msw/generic.rsp @@ -663,6 +663,8 @@ samples/internat/*.bmp samples/internat/*.mo samples/internat/fr/*.mo samples/internat/fr/*.po +samples/internat/de/*.mo +samples/internat/de/*.po samples/checklst/*.cpp samples/checklst/*.h @@ -729,6 +731,10 @@ samples/image/*.bmp samples/image/*.xpm samples/image/*.xbm samples/image/*.png +samples/image/*.pnm +samples/image/*.pcx +samples/image/*.jpg +samples/image/*.gif samples/image/*.ico samples/image/*.txt @@ -1024,15 +1030,3 @@ samples/menu/*.png samples/menu/*.ico samples/menu/*.txt -samples/font/*.cpp -samples/font/*.h -samples/font/makefile* -samples/font/*.rc -samples/font/*.def -samples/font/*.bmp -samples/font/*.xpm -samples/font/*.xbm -samples/font/*.png -samples/font/*.ico -samples/font/*.txt - diff --git a/distrib/msw/makefile.rsp b/distrib/msw/makefile.rsp index 8f8404cd07..187845785b 100644 --- a/distrib/msw/makefile.rsp +++ b/distrib/msw/makefile.rsp @@ -34,6 +34,7 @@ samples/printing/Makefile.in samples/proplist/Makefile.in samples/sashtest/Makefile.in samples/scroll/Makefile.in +samples/scrollsub/Makefile.in samples/splitter/Makefile.in samples/text/Makefile.in samples/thread/Makefile.in @@ -46,6 +47,9 @@ samples/wxpoem/Makefile.in samples/wxsocket/Makefile.in samples/nettest/Makefile.in samples/scrollsub/Makefile.in +samples/font/Makefile.in +samples/menu/Makefile.in +samples/console/Makefile.in utils/glcanvas/motif/Makefile.in utils/Makefile.in utils/wxMMedia2/Makefile.in @@ -76,4 +80,13 @@ samples/resource/Makefile.am samples/richedit/Makefile.am samples/tab/Makefile.am samples/taskbar/Makefile.am +samples/scrollsub/Makefile.am +samples/font/Makefile.am +samples/menu/Makefile.am +samples/drawing/Makefile.am +samples/scroll/Makefile.am +samples/scrollsub/Makefile.am +samples/console/Makefile.am +samples/wizard/Makefile.am +utils/glcanvas/motif/Makefile.am src/msw/Makefile.am diff --git a/docs/readme.txt b/docs/readme.txt index 35b57e4e97..cb0634e350 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -32,13 +32,15 @@ wxWindows 2.1.11 maintenance. - Ability to compile library in console (non-GUI) mode. - Integration of wxHTML widget and help controller into - wxWindows. wxHTML allows HTML viewing and printing. + wxWindows. wxHTML allows HTML viewing and printing (wxGTK + and wxMSW, partial support in wxMotif). - New classes wxChrono, wxDialUpManager, wxFontEnumerator, wxWizard, wxStaticLine, etc. - wxShowTip for showing 'startup tips' to the user. - wxSocket and wxThread classes rewritten. - New, consistent drag and drop API (not wxMotif). -- Better-looking dialogs in wxGTK. +- Better-looking dialogs in wxGTK; native message box used + in wxMotif. - wxSizers reimplemented and used to specify window layout for some generic dialogs. - New, more sophisticated wxGrid class (in beta). The old grid @@ -167,9 +169,16 @@ commercial applications using wxWindows. Documentation ------------- -See docs/changes.txt for a detailed history of changes to wxWindows 2. +See docs/release.txt for some notes about the current release. + +See docs/bugs.txt for a bug list: this file is new and will initially + be edited by hand, later generated from a web-based bug database. + See docs/html/index.htm for an HTML index of the major documents. +See docs/changes.txt for a detailed history of changes to wxWindows 2 + (not up-to-date). + The Windows help files are located in docs/winhelp. The PDF help files are located in docs/pdf. diff --git a/docs/release.txt b/docs/release.txt new file mode 100644 index 0000000000..ab13ab2b65 --- /dev/null +++ b/docs/release.txt @@ -0,0 +1,34 @@ +wxWindows Release Notes +----------------------- + +2.1.11 +====== + +- wxMenu no longer takes a wxFunction argument: either use + event handlers in the menu's host window or set WXWIN_COMPATIBILITY + to 1 in setup.h, and recompile. + +- wxMotif still lags behind other ports but is in much better + shape than the 2.0.1 distribution. + +- Clipboard/drag and drop is still not implemented in wxMotif. + +- The new wxGrid implementation is in beta, but the original + implementation can be restored by setting wxUSE_NEW_GRID + to 0 (in wxMSW) or passing --disable-newgrid to configure + (wxGTK/wxMSW). Pass --enable-newgrid to configure to enable + the new implementation. + +- wxHTML is partially working in wxMotif. The About sample + works, but the others exhibit refresh problems. So light + use of wxHTML is recommended on wxMotif. + +- The wxHTML helpview application crashes on exit if + using VC++ 6 in release mode and loading a large amount of + HTML (such as the wxWindows manual generated using Tex2RTF). + This may be a compiler problem and will be investigated + for 2.1.12. + +- wxHTML printing has spacing problems under Windows, and may not + work fully under Unix. Hopefully this will be resolved for 2.1.12. + diff --git a/include/wx/generic/spinctlg.h b/include/wx/generic/spinctlg.h index 288758c6f0..02d26def7d 100644 --- a/include/wx/generic/spinctlg.h +++ b/include/wx/generic/spinctlg.h @@ -44,11 +44,12 @@ public: int min = 0, int max = 100, int initial = 0, const wxString& name = _T("wxSpinCtrl")) { - SetValue(initial); SetRange(min, max); - return wxTextCtrl::Create(parent, id, value, pos, size, style, + bool val = wxTextCtrl::Create(parent, id, value, pos, size, style, wxDefaultValidator, name); + SetValue(initial); + return value; } // accessors diff --git a/include/wx/motif/choice.h b/include/wx/motif/choice.h index 18f80ca5bd..5171d41fe9 100644 --- a/include/wx/motif/choice.h +++ b/include/wx/motif/choice.h @@ -16,12 +16,12 @@ #pragma interface "choice.h" #endif -#include "wx/control.h" +#include "wx/ctrlsub.h" WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr; // Choice item -class WXDLLEXPORT wxChoice: public wxControl +class WXDLLEXPORT wxChoice: public wxControlWithItems { DECLARE_DYNAMIC_CLASS(wxChoice) @@ -48,6 +48,21 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxChoiceNameStr); + // Virtual functions required by wxControlWithItems. + // They are not all implemented yet :-( + virtual int GetCount() const; + virtual int DoAppend(const wxString& item); + virtual void DoInsertItems(const wxArrayString& items, int pos); + virtual void DoSetItems(const wxArrayString& items, void **clientData); + virtual void DoSetFirstItem(int n); + virtual void DoSetItemClientData(int n, void* clientData); + virtual void* DoGetItemClientData(int n) const; + virtual void DoSetItemClientObject(int n, wxClientData* clientData); + virtual wxClientData* DoGetItemClientObject(int n) const; + virtual void Select(int n); + virtual void SetString(int n, const wxString& s); + + // Original API virtual void Append(const wxString& item); virtual void Delete(int n); virtual void Clear(); diff --git a/include/wx/motif/listbox.h b/include/wx/motif/listbox.h index d7585a547e..6f352ec728 100644 --- a/include/wx/motif/listbox.h +++ b/include/wx/motif/listbox.h @@ -16,7 +16,7 @@ #pragma interface "listbox.h" #endif -#include "wx/control.h" +#include "wx/ctrlsub.h" WXDLLEXPORT_DATA(extern const char*) wxListBoxNameStr; @@ -26,7 +26,7 @@ class WXDLLEXPORT wxArrayInt; WXDLLEXPORT_DATA(extern const char*) wxEmptyString; // List box item -class WXDLLEXPORT wxListBox: public wxControl +class WXDLLEXPORT wxListBox: public wxControlWithItems { DECLARE_DYNAMIC_CLASS(wxListBox) @@ -54,6 +54,19 @@ public: ~wxListBox(); + // Virtual functions required by wxControlWithItems. + // They are not all implemented yet :-( + virtual int GetCount() const; + virtual int DoAppend(const wxString& item); + virtual void DoInsertItems(const wxArrayString& items, int pos); + virtual void DoSetItems(const wxArrayString& items, void **clientData); + virtual void DoSetFirstItem(int n); + virtual void DoSetItemClientData(int n, void* clientData); + virtual void* DoGetItemClientData(int n) const; + virtual void DoSetItemClientObject(int n, wxClientData* clientData); + virtual wxClientData* DoGetItemClientObject(int n) const; + virtual void Select(int n); + virtual void Append(const wxString& item); virtual void Append(const wxString& item, void *clientData); virtual void Set(int n, const wxString* choices, void **clientData = NULL); diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 79ffa750a2..395c4ebc9a 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -221,7 +221,8 @@ bool MyApp::OnInit() frame->SetIcon( wxICON(mondrian) ); - wxMenu *file_menu = new wxMenu("", wxMENU_TEAROFF ); + wxMenu *file_menu = new wxMenu("", wxMENU_TEAROFF); + file_menu->Append(MINIMAL_ABOUT, "&About\tF1"); file_menu->AppendSeparator(); file_menu->Append(MINIMAL_QUIT, "E&xit\tAlt-X", "Quit controls sample"); @@ -476,8 +477,10 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_choiceSorted = new wxChoice( panel, ID_CHOICE_SORTED, wxPoint(10,70), wxSize(120,-1), 5, choices, wxCB_SORT ); +#ifndef __WXMOTIF__ SetControlClientData("choice", m_choice); SetControlClientData("choice", m_choiceSorted); +#endif m_choice->SetSelection(2); m_choice->SetBackgroundColour( "red" ); diff --git a/samples/html/helpview/helpview.cpp b/samples/html/helpview/helpview.cpp index feacd02b99..5992be07a6 100644 --- a/samples/html/helpview/helpview.cpp +++ b/samples/html/helpview/helpview.cpp @@ -25,6 +25,7 @@ #include #include #include +#include // ---------------------------------------------------------------------------- // private classes @@ -56,6 +57,10 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { +#ifdef __WXMOTIF__ + delete wxLog::SetActiveTarget(new wxLogStderr); // So dialog boxes aren't used +#endif + wxInitAllImageHandlers(); wxFileSystem::AddHandler(new wxZipFSHandler); @@ -72,6 +77,10 @@ bool MyApp::OnInit() for (int i = 1; i < argc; i++) help -> AddBook(argv[i]); +#ifdef __WXMOTIF__ + delete wxLog::SetActiveTarget(new wxLogGui); +#endif + help -> DisplayContents(); return TRUE; diff --git a/samples/printing/printing.cpp b/samples/printing/printing.cpp index 2c9a75dde1..04d721a4af 100644 --- a/samples/printing/printing.cpp +++ b/samples/printing/printing.cpp @@ -1,13 +1,13 @@ -/* -* File: printing.cc -* Purpose: Printing demo for wxWindows class library -* Author: Julian Smart -* Created: 1995 -* Updated: -* Copyright: (c) 1995, AIAI, University of Edinburgh -*/ - -/* static const char sccsid[] = "%W% %G%"; */ +///////////////////////////////////////////////////////////////////////////// +// Name: printing.cpp +// Purpose: Printing demo for wxWindows +// Author: Julian Smart +// Modified by: +// Created: 1995 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ #pragma implementation @@ -290,6 +290,8 @@ void MyFrame::OnPrintAbout(wxCommandEvent& WXUNUSED(event)) void MyFrame::Draw(wxDC& dc) { + dc.SetBackground(*wxWHITE_BRUSH); + dc.Clear(); dc.SetFont(* wxGetApp().m_testFont); dc.SetBackgroundMode(wxTRANSPARENT); diff --git a/samples/printing/printing.h b/samples/printing/printing.h index d9df02dfbb..13933bb91f 100644 --- a/samples/printing/printing.h +++ b/samples/printing/printing.h @@ -1,13 +1,13 @@ -/* - * File: printing.h - * Purpose: Printing demo for wxWindows class library - * Author: Julian Smart - * Created: 1995 - * Updated: - * Copyright: (c) 1995, AIAI, University of Edinburgh - */ - -/* sccsid[] = "%W% %G%" */ +///////////////////////////////////////////////////////////////////////////// +// Name: printing.h +// Purpose: Printing demo for wxWindows +// Author: Julian Smart +// Modified by: +// Created: 1995 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ #pragma interface diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp index a71fcb47a7..ce52bc53fd 100644 --- a/src/common/prntbase.cpp +++ b/src/common/prntbase.cpp @@ -384,14 +384,21 @@ void wxPreviewControlBar::CreateButtons() "120%", "150%", "200%" }; - m_zoomControl = new wxChoice(this, wxID_PREVIEW_ZOOM, - wxPoint(x, y), wxSize(100, -1)); - - // Yes, this look stupid, but this is because gcc gives up otherwise. int n = WXSIZEOF(choices); -// Someone is calling methods that do no exist in wxChoice!! So I'll just comment out for VA for now - for ( int i = 0; i < n; i++ ) - m_zoomControl->Append(choices[i]); + + wxString* strings = new wxString[n]; + int i; + for (i = 0; i < n; i++ ) + strings[i] = choices[i]; + + m_zoomControl = new wxChoice(this, wxID_PREVIEW_ZOOM, + wxPoint(x, y), + wxSize(100, -1), + n, + strings + ); + delete[] strings; + SetZoomControl(m_printPreview->GetZoom()); } diff --git a/src/generic/helpwxht.cpp b/src/generic/helpwxht.cpp index b16312f6ab..f4ca7a115e 100644 --- a/src/generic/helpwxht.cpp +++ b/src/generic/helpwxht.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: helpext.cpp -// Purpose: an external help controller for wxWindows +// Name: helpwxht.cpp +// Purpose: A help controller using the wxHTML classes // Author: Karsten Ballueder // Modified by: // Created: 04/01/98 diff --git a/src/makeprog.vc b/src/makeprog.vc index d7c0d79be4..e938d7c78c 100644 --- a/src/makeprog.vc +++ b/src/makeprog.vc @@ -11,7 +11,7 @@ # info # Set WXDIR for your system -WXDIR = j:\dev\wx2\wxWindows +WXDIR = $(WXWIN) WXUSINGDLL=0 diff --git a/src/motif/choice.cpp b/src/motif/choice.cpp index 71981d44d2..1647c35bc1 100644 --- a/src/motif/choice.cpp +++ b/src/motif/choice.cpp @@ -477,3 +477,77 @@ void wxChoice::ChangeForegroundColour() for (i = 0; i < m_noStrings; i++) DoChangeForegroundColour(m_widgetList[i], m_foregroundColour); } + + +// These implement functions needed by wxControlWithItems. +// Unfortunately, they're not all implemented yet. + +int wxChoice::GetCount() const +{ + return Number(); +} + +int wxChoice::DoAppend(const wxString& item) +{ + Append(item); + return GetCount() - 1; +} + +// Just appends, doesn't yet insert +void wxChoice::DoInsertItems(const wxArrayString& items, int WXUNUSED(pos)) +{ + size_t nItems = items.GetCount(); + + for ( size_t n = 0; n < nItems; n++ ) + { + Append( items[n]); + } +} + +void wxChoice::DoSetItems(const wxArrayString& items, void **WXUNUSED(clientData)) +{ + Clear(); + size_t nItems = items.GetCount(); + + for ( size_t n = 0; n < nItems; n++ ) + { + Append(items[n]); + } +} + +void wxChoice::DoSetFirstItem(int WXUNUSED(n)) +{ + wxFAIL_MSG( wxT("wxChoice::DoSetFirstItem not implemented") ); +} + +void wxChoice::DoSetItemClientData(int WXUNUSED(n), void* WXUNUSED(clientData)) +{ + wxFAIL_MSG( wxT("wxChoice::DoSetItemClientData not implemented") ); +} + +void* wxChoice::DoGetItemClientData(int WXUNUSED(n)) const +{ + wxFAIL_MSG( wxT("wxChoice::DoGetItemClientData not implemented") ); + return (void*) NULL; +} + +void wxChoice::DoSetItemClientObject(int WXUNUSED(n), wxClientData* WXUNUSED(clientData)) +{ + wxFAIL_MSG( wxT("wxChoice::DoSetItemClientObject not implemented") ); +} + +wxClientData* wxChoice::DoGetItemClientObject(int WXUNUSED(n)) const +{ + wxFAIL_MSG( wxT("wxChoice::DoGetItemClientObject not implemented") ); + return (wxClientData*) NULL; +} + +void wxChoice::Select(int n) +{ + SetSelection(n); +} + +void wxChoice::SetString(int WXUNUSED(n), const wxString& WXUNUSED(s)) +{ + wxFAIL_MSG( wxT("wxChoice::SetString not implemented") ); +} diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index 25fbfdf546..178a552e38 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -786,4 +786,71 @@ void wxListBox::ChangeForegroundColour() */ } +// These implement functions needed by wxControlWithItems. +// Unfortunately, they're not all implemented yet. +int wxListBox::GetCount() const +{ + return Number(); +} + +int wxListBox::DoAppend(const wxString& item) +{ + Append(item, (void*) NULL); + return GetCount() - 1; +} + +// Just appends, doesn't yet insert +void wxListBox::DoInsertItems(const wxArrayString& items, int WXUNUSED(pos)) +{ + size_t nItems = items.GetCount(); + + for ( size_t n = 0; n < nItems; n++ ) + { + Append( items[n], (void*) NULL); + } +} + +void wxListBox::DoSetItems(const wxArrayString& items, void **clientData) +{ + size_t nItems = items.GetCount(); + wxString* strings = new wxString[nItems]; + + for ( size_t n = 0; n < nItems; n++ ) + { + strings[n] = items[n]; + } + Set(nItems, strings, clientData); + + delete[] strings; +} + +void wxListBox::DoSetFirstItem(int WXUNUSED(n)) +{ + wxFAIL_MSG( wxT("wxListBox::DoSetFirstItem not implemented") ); +} + +void wxListBox::DoSetItemClientData(int n, void* clientData) +{ + SetClientData(n, clientData); +} + +void* wxListBox::DoGetItemClientData(int n) const +{ + return GetClientData(n); +} + +void wxListBox::DoSetItemClientObject(int n, wxClientData* clientData) +{ + DoSetItemClientData(n, (void*) clientData); +} + +wxClientData* wxListBox::DoGetItemClientObject(int n) const +{ + return (wxClientData*) DoGetItemClientData(n); +} + +void wxListBox::Select(int n) +{ + SetSelection(n, TRUE); +} diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp index 7fa4d9f93b..9df03bef8d 100644 --- a/src/motif/menu.cpp +++ b/src/motif/menu.cpp @@ -216,7 +216,8 @@ wxMenuBar::~wxMenuBar() void wxMenuBar::EnableTop(size_t WXUNUSED(pos), bool WXUNUSED(flag)) { - wxFAIL_MSG("TODO"); + // wxFAIL_MSG("TODO"); + wxLogWarning("wxMenuBar::EnableTop not yet implemented."); } void wxMenuBar::SetLabelTop(size_t pos, const wxString& label) @@ -385,6 +386,9 @@ bool wxMenuBar::CreateMenuBar(wxFrame* parent) XtVaSetValues(GetWidget(menu), XmNtearOffModel, XmTEAR_OFF_ENABLED, NULL); + Widget tearOff = XmGetTearOffControl(GetWidget(menu)); + wxDoChangeForegroundColour((Widget) tearOff, m_foregroundColour); + wxDoChangeBackgroundColour((Widget) tearOff, m_backgroundColour, TRUE); #endif } } -- 2.47.2