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
This commit is contained in:
Julian Smart 1999-11-08 14:53:39 +00:00
parent 5e84fc5a82
commit 6adaedf0fc
17 changed files with 298 additions and 53 deletions

View File

@ -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

View File

@ -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

View File

@ -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.

34
docs/release.txt Normal file
View File

@ -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.

View File

@ -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

View File

@ -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();

View File

@ -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);

View File

@ -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" );

View File

@ -25,6 +25,7 @@
#include <wx/image.h>
#include <wx/wxhtml.h>
#include <wx/fs_zip.h>
#include <wx/log.h>
// ----------------------------------------------------------------------------
// 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;

View File

@ -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);

View File

@ -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

View File

@ -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());
}

View File

@ -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

View File

@ -11,7 +11,7 @@
# info
# Set WXDIR for your system
WXDIR = j:\dev\wx2\wxWindows
WXDIR = $(WXWIN)
WXUSINGDLL=0

View File

@ -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") );
}

View File

@ -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);
}

View File

@ -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
}
}