utils/wxgraph/src/*.def
utils/wxgraph/src/*.rc
-utils/mfutils/src/*.cpp
-utils/mfutils/src/*.h
-utils/mfutils/src/*.rc
-utils/mfutils/src/*.def
-utils/mfutils/src/makefile*
-utils/mfutils/src/*.txt
-utils/mfutils/lib/dummy
-utils/mfutils/src/*.ico
-utils/mfutils/src/*.def
-utils/mfutils/src/*.bmp
-utils/mfutils/src/*.ico
-
utils/rcparser/src/*.cpp
utils/rcparser/src/*.c
utils/rcparser/src/*.h
utils/dialoged/test/*.prj
utils/dialoged/test/*.bmp
-utils/glcanvas/Makefile
-utils/glcanvas/win/*.h
-utils/glcanvas/win/*.cpp
-utils/glcanvas/win/*.def
-utils/glcanvas/win/*.rc
-utils/glcanvas/win/makefile*
-utils/glcanvas/win/*.xbm
-utils/glcanvas/win/*.xpm
-utils/glcanvas/win/*.txt
-utils/glcanvas/win/*.ico
-utils/glcanvas/win/*.bmp
-
-utils/glcanvas/src/*.h
-utils/glcanvas/src/*.cpp
-utils/glcanvas/src/*.def
-utils/glcanvas/src/*.rc
-utils/glcanvas/src/makefile*
-utils/glcanvas/src/*.xbm
-utils/glcanvas/src/*.xpm
-utils/glcanvas/src/*.txt
-utils/glcanvas/src/*.ico
-utils/glcanvas/src/*.bmp
-
-utils/glcanvas/motif/*.h
-utils/glcanvas/motif/*.cpp
-utils/glcanvas/motif/makefile*
-utils/glcanvas/motif/*.txt
-
-utils/glcanvas/samples/cube/*.h
-utils/glcanvas/samples/cube/*.cpp
-utils/glcanvas/samples/cube/*.def
-utils/glcanvas/samples/cube/*.rc
-utils/glcanvas/samples/cube/makefile*
-utils/glcanvas/samples/cube/*.xbm
-utils/glcanvas/samples/cube/*.xpm
-utils/glcanvas/samples/cube/*.txt
-utils/glcanvas/samples/cube/*.ico
-utils/glcanvas/samples/cube/*.bmp
-utils/glcanvas/samples/isosurf/*.h
-utils/glcanvas/samples/isosurf/*.cpp
-utils/glcanvas/samples/isosurf/*.def
-utils/glcanvas/samples/isosurf/*.rc
-utils/glcanvas/samples/isosurf/makefile*
-utils/glcanvas/samples/isosurf/*.xbm
-utils/glcanvas/samples/isosurf/*.xpm
-utils/glcanvas/samples/isosurf/*.txt
-utils/glcanvas/samples/isosurf/*.ico
-utils/glcanvas/samples/isosurf/*.bmp
-utils/glcanvas/samples/isosurf/*.gz
-utils/glcanvas/docs/*.tex
-utils/glcanvas/docs/*.txt
-utils/glcanvas/docs/*.bmp
-utils/glcanvas/docs/*.gif
-
samples/*.txt
samples/makefile*
rem CodeWarrior project files
zip32 -@ %dest\wx200cw.zip < %src\distrib\msw\cw.rsp
+rem OGL 3
zip32 -@ %dest\ogl3.zip < %src\utils\ogl\distrib\ogl.rsp
+rem GLCanvas
+zip32 -@ %dest\glcanvas.zip < %src\distrib\glcanvas.rsp
+
rem Tex2RTF
zip32 -@ %dest\tex2rtf2.zip < %src\distrib\msw\tex2rtf.rsp
<P>
-For further information, please see the <a href="http://web.ukonline.co.uk/julian.smart/wxwin" target=_top>wxWindows Web site</a>,
+For further information, please see the <a href="http://www.wxwindows.org" target=_top>wxWindows Web site</a>,
plus install.txt (per port), todo.txt (per port), and bugs.txt (all ports).
<P>
<h3>Can you compile wxWindows 2 as a DLL?</h3>
-Yes (using the Visual C++ makefile), but be aware that distributing DLLs is a thorny issue
+Yes (using the Visual C++ or Borland C++ makefile), but be aware that distributing DLLs is a thorny issue
and you may be better off compiling statically-linked applications, unless you're
delivering a suite of separate programs, or you're compiling a lot of wxWindows applications
and have limited hard disk space.<P>
wxWindows!
<P>
+<H3>How can I reduce executable size?</H3>
+
+You can compile wxWindows as a DLL (see above, VC++/BC++ only at present). You should also
+compile your programs for release using non-debugging and space-optimisation options.<P>
+
+Statically-linked wxWindows 2 programs are smaller than wxWindows 1.xx programs, because of the way
+wxWindows 2 has been designed to reduce dependencies between classes, and other
+techniques. The linker will not include code from the library that is not (directly or
+indirectly) referenced
+by your application. So for example, the 'minimal' sample is less than 300KB using VC++ 6.<P>
+
+If you want to distribute really small executables, you can
+use <a href="http://www.icl.ndirect.co.uk/petite/" target=_top>Petite</a>
+by Ian Luck. This nifty utility compresses Windows executables by around 50%, so your 500KB executable
+will shrink to a mere 250KB. With this sort of size, there is reduced incentive to
+use DLLs.<P>
+
<H3>Will wxWindows be compatible with MFC?</H3>
Welcome to wxWindows 2.0, the premiere cross-platform C++ framework. This is an index of
the plain text and HTML documentation. Documentation is also available in Acrobat (PDF) and Windows Help,
-from the <a href="http://web.ukonline.co.uk/julian.smart/wxwin">wxWindows Web site</a>.<P>
+from the <a href="http://www.wxwindows.org">wxWindows Web site</a>.<P>
<h3>Installation and release notes</h3>
\helpref{wxObject}{wxobject}
-{\bf WARNING: } the rest of documentation may be out-of-date.
-
\wxheading{Example}
It is very common to iterate on a list as follows:
\begin{verbatim}
...
- wxPoint *point1 = new wxPoint(100, 100);
- wxPoint *point2 = new wxPoint(200, 200);
+ wxWindow *win1 = new wxWindow(...);
+ wxWindow *win2 = new wxWindow(...);
wxList SomeList;
- SomeList.Append(point1);
- SomeList.Append(point2);
+ SomeList.Append(win1);
+ SomeList.Append(win2);
...
wxNode *node = SomeList.GetFirst();
while (node)
{
- wxPoint *point = (wxPoint *)node->Data();
+ wxWindow *win = (wxWindow *)node->Data();
...
node = node->Next();
}
\begin{verbatim}
...
- delete point;
+ delete win;
delete node;
node = SomeList.GetFirst();
...
\wxheading{Derivation}
-\helpref{wxObject}{wxobject}
+None
\wxheading{See also}
\wxheading{Derived from}
-\helpref{wxObject}{wxobject}
+None
\wxheading{See also}
\wxheading{Derivation}
-\helpref{wxObject}{wxobject}
+None
\wxheading{See also}
painting a tiled bitmap, then a slight flicker might be seen unless
X can be persuaded not to repaint the window background by default.
+- wxRadioBox doesn't show up in the controls sample, though it's
+ OK on other dialogs (e.g. printing sample).
+
+- Word wrapping in wxStaticText: how?
+
- wxSpinButton
- Miscellaneous events.
-- Get wxGLCanvas from 1.68 working.
+- wxGLCanvas: cure bad flicker
- Use wxImage to load other formats into wxBitmaps, such as PNG, BMP.
-- Printing dialogs need some tidying.
-
Low Priority
------------
#include "wx/defs.h"
-#ifdef wxUSE_CONFIG
+#if wxUSE_CONFIG
#include "wx/string.h"
#include "wx/object.h"
#include "wx/string.h"
-#ifdef wxUSE_TIMEDATE
+#if wxUSE_TIMEDATE
enum wxdate_format_type {wxMDY, wxDAY, wxMONTH, wxFULL, wxEUROPEAN};
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxImageHandler;
-#ifdef wxUSE_LIBPNG
+#if wxUSE_LIBPNG
class WXDLLEXPORT wxPNGHandler;
#endif
class WXDLLEXPORT wxBMPHandler;
// wxPNGHandler
//-----------------------------------------------------------------------------
-#ifdef wxUSE_LIBPNG
+#if wxUSE_LIBPNG
class WXDLLEXPORT wxPNGHandler: public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxPNGHandler)
void Enable(bool enable);
void Enable(int item, bool enable);
void Show(int item, bool show) ;
- bool Show(bool show) { return wxControl::Show(show); };
+ bool Show(bool show) ;
virtual wxString GetStringSelection() const;
virtual bool SetStringSelection(const wxString& s);
virtual void ChangeForegroundColour();
WXWidget GetTopWidget() const { return m_formWidget; }
WXWidget GetLabelWidget() const { return m_labelWidget; }
+ WXWidget GetFrameWidget() const { return m_frameWidget; }
inline WXWidget* GetRadioButtons() const { return m_radioButtons; }
inline void SetSel(int i) { m_selectedButton = i; }
WXWidget m_formWidget;
WXWidget m_labelWidget;
+ WXWidget m_frameWidget;
WXWidget* m_radioButtons;
wxString* m_radioButtonLabels;
};
#define wxUSE_STREAMS 1
// Use wxStream implementation within wxWindows code
+#define wxUSE_SERIAL 0
+ // Use serialization
+
/*
* Finer detail
*
WXDLLEXPORT wxObject* wxCreateDynamicObject(const char *name);
-#ifdef wxUSE_SERIAL
+#if wxUSE_SERIAL
WXDLLEXPORT wxObject* wxCreateStoredObject( wxInputStream& stream );
#endif
virtual void Dump(ostream& str);
#endif
-#ifdef wxUSE_SERIAL
+#if wxUSE_SERIAL
virtual void StoreObject( wxObjectOutputStream &stream );
virtual void LoadObject( wxObjectInputStream &stream );
#endif
protected:
wxObjectRefData* m_refData;
-#ifdef wxUSE_SERIAL
+#if wxUSE_SERIAL
wxObject_Serialize* m_serialObj;
#endif
};
#define wxUSE_STD_IOSTREAM 1
// Use standard C++ streams if 1. If 0, use wxWin
// streams implementation.
+
+#define wxUSE_SERIAL 0
+ // Use serialization
/*
* Finer detail
*
// -----------------------------------------------------------------------------
// implementation only until the end of file
// -----------------------------------------------------------------------------
-#ifdef wxUSE_THREADS
+#if wxUSE_THREADS
#ifdef __WXMSW__
// unlock GUI if there are threads waiting for and lock it back when
// there are no more of them - should be called periodically by the main
#include "wx/object.h"
-#ifdef wxUSE_TIMEDATE
+#if wxUSE_TIMEDATE
#ifdef __GNUG__
#pragma interface "time.h"
#include "wx/cmndata.h"
#include "wx/intl.h"
#include "wx/valtext.h"
-#ifdef wxUSE_SERIAL
+#if wxUSE_SERIAL
#include "wx/objstrm.h"
#include "wx/serbase.h"
#endif
#include "wx/defs.h"
-#ifdef wxUSE_ZLIB
+#if wxUSE_ZLIB
#include <wx/stream.h>
"is one of my",
"really",
"wonderful",
- "examples.",
+ "examples."
};
#ifdef USE_XPM
// m_notebook->SetBackgroundColour("cadet blue");
wxPanel *panel = (wxPanel*) NULL;
+
panel = new wxPanel(m_notebook);
// panel->SetBackgroundColour("cadet blue");
// panel->SetForegroundColour("blue");
// button->SetForegroundColour( "red" );
m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, "Disable", wxPoint(20,130), wxSize(140,30) );
m_checkbox->SetValue(FALSE);
- m_notebook->AddPage(panel, "wxList", FALSE, Image_List);
+ m_notebook->AddPage(panel, "wxList", TRUE, Image_List);
panel = new wxPanel(m_notebook);
// panel->SetBackgroundColour("cadet blue");
// panel->SetBackgroundColour("cadet blue");
// panel->SetForegroundColour("blue");
(void)new wxStaticBox( panel, -1, "wxGauge and wxSlider", wxPoint(10,10), wxSize(180,130) );
- m_gauge = new wxGauge( panel, -1, 200, wxPoint(18,50), wxSize(155,-1) );
+ m_gauge = new wxGauge( panel, -1, 200, wxPoint(18,50), wxSize(155, 30) );
// m_gauge->SetBackgroundColour("wheat");
m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,-1) );
// m_slider->SetBackgroundColour("wheat");
(void)new wxStaticBox( panel, -1, "Explanation", wxPoint(200,10), wxSize(290,130) );
+#ifdef __WXMOTIF__
+ // No wrapping text in wxStaticText yet :-(
+ (void)new wxStaticText( panel, -1,
+ "Drag the slider!",
+ wxPoint(208,30),
+ wxSize(210, -1)
+ );
+#else
(void)new wxStaticText( panel, -1,
"In order see the gauge (aka progress bar)\n"
"control do something you have to drag the\n"
"\n"
"This is also supposed to demonstrate how\n"
"to use static controls.\n",
- wxPoint(208,25)
-#ifdef __WXMSW__
- ,wxSize(210, 110)
-#endif
+ wxPoint(208,25),
+ wxSize(210, 110)
);
+#endif
m_spintext = new wxTextCtrl( panel, -1, "0", wxPoint(20,160), wxSize(80,-1) );
// m_spintext->SetBackgroundColour("wheat");
m_spinbutton = new wxSpinButton( panel, ID_SPIN, wxPoint(103,159), wxSize(-1,-1) );
void MyFrame::OnPrint(wxCommandEvent& WXUNUSED(event))
{
-#ifdef __WXMSW__
- wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
-#else
- wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-#endif
wxPrinter printer;
MyPrintout printout("My printout");
if (!printer.Print(this, &printout, TRUE))
void MyFrame::OnPrintPreview(wxCommandEvent& WXUNUSED(event))
{
-#ifdef __WXMSW__
- wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
-#else
- wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-#endif
wxPrintData printData;
printData.SetOrientation(orientation);
void MyFrame::OnPrintSetup(wxCommandEvent& WXUNUSED(event))
{
-#ifdef __WXMSW__
- wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
-#else
- wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-#endif
wxPrintData data;
data.SetOrientation(orientation);
-#ifdef __WXMSW__
wxPrintDialog printerDialog(this, & data);
-#else
- wxGenericPrintDialog printerDialog(this, & data);
-#endif
+
printerDialog.GetPrintData().SetSetupDialog(TRUE);
printerDialog.ShowModal();
void MyFrame::OnPageSetup(wxCommandEvent& WXUNUSED(event))
{
-#ifdef __WXMSW__
- wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
-#else
- wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-#endif
wxPageSetupData data;
data.SetOrientation(orientation);
-#ifdef __WXMSW__
wxPageSetupDialog pageSetupDialog(this, & data);
-#else
- wxGenericPageSetupDialog pageSetupDialog(this, & data);
-#endif
pageSetupDialog.ShowModal();
data = pageSetupDialog.GetPageSetupData();
#if defined(__WXMSW__) && wxTEST_POSTSCRIPT_IN_MSW
void MyFrame::OnPrintPS(wxCommandEvent& WXUNUSED(event))
{
- wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-
wxPostScriptPrinter printer;
MyPrintout printout("My printout");
printer.Print(this, &printout, TRUE);
void MyFrame::OnPrintPreviewPS(wxCommandEvent& WXUNUSED(event))
{
- wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-
wxPrintData printData;
printData.SetOrientation(orientation);
void MyFrame::OnPrintSetupPS(wxCommandEvent& WXUNUSED(event))
{
- wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-
wxPrintData data;
data.SetOrientation(orientation);
void MyFrame::OnPageSetupPS(wxCommandEvent& WXUNUSED(event))
{
- wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-
wxPageSetupData data;
data.SetOrientation(orientation);
#include <wx/confbase.h>
-#ifdef wxUSE_CONFIG
+#if wxUSE_CONFIG
#ifdef __BORLANDC__
#pragma hdrstop
#include "wx/setup.h"
-#ifdef wxUSE_TIMEDATE
+#if wxUSE_TIMEDATE
#include "wx/date.h"
#include <wx/intl.h>
#include "wx/debug.h"
#include "wx/log.h"
#include "wx/app.h"
-#ifdef wxUSE_LIBPNG
+#if wxUSE_LIBPNG
#include "../png/png.h"
#endif
#include "wx/filefn.h"
void wxImage::InitStandardHandlers()
{
AddHandler( new wxBMPHandler );
-#ifdef wxUSE_LIBPNG
+#if wxUSE_LIBPNG
AddHandler( new wxPNGHandler );
#endif
}
// wxPNGHandler
//-----------------------------------------------------------------------------
-#ifdef wxUSE_LIBPNG
+#if wxUSE_LIBPNG
#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxPNGHandler,wxImageHandler)
// send it to the normal log destination
wxLogDebug(szBuf);
- #ifdef wxUSE_NOGUI
+ #if wxUSE_NOGUI
Trap();
#else
strcat(szBuf, _("\nDo you want to stop the program?"
{
SetSize(0, 0, 400, 40);
+ /*
#ifdef __WXMSW__
int fontSize = 9;
#else
wxFont buttonFont(fontSize, wxSWISS, wxNORMAL, wxBOLD);
SetFont(buttonFont);
+ */
int buttonWidth = 65;
#ifdef __WXGTK__
int x = 5;
int y = 5;
+
+#ifdef __WXMOTIF__
+ int gap = 15;
+#else
int gap = 5;
+#endif
m_closeButton = new wxButton(this, wxID_PREVIEW_CLOSE, _("Close"),
wxPoint(x, y), wxSize(buttonWidth, buttonHeight));
delete[] choices;
- m_closeButton->SetDefault();
+ // m_closeButton->SetDefault();
}
void wxPreviewControlBar::SetZoomControl(int zoom)
#pragma hdrstop
#endif
-#ifdef wxUSE_SERIAL
+#if wxUSE_SERIAL
// ----------------------------------------------------------------------------
// wxObject_Serialize
#include "wx/setup.h"
-#ifdef wxUSE_TIMEDATE
+#if wxUSE_TIMEDATE
#include "wx/time.h"
#include "wx/date.h"
#include "wx/zstream.h"
-#ifdef wxUSE_ZLIB
+#if wxUSE_ZLIB
#include "wx/utils.h"
#include "wx/intl.h"
#include "wx/defs.h"
-#define WINDOWS_PRINTING (wxTheApp->GetPrintMode() == wxPRINT_WINDOWS)
-
#ifndef WX_PRECOMP
#include "wx/utils.h"
#include "wx/dc.h"
orientationRadioBox->SetSelection(0);
(void) new wxStaticBox(this, wxPRINTID_STATIC, _("Options"), wxPoint(10, 130), wxSize(200,50) );
+
+ int colourXPos = 145;
+
+#ifdef __WXMOTIF__
+ colourXPos = 150;
+#endif
- colourCheckBox = new wxCheckBox(this, wxPRINTID_PRINTCOLOUR, _("Print in colour"), wxPoint(15, 145));
+ colourCheckBox = new wxCheckBox(this, wxPRINTID_PRINTCOLOUR, _("Print in colour"), wxPoint(15, colourXPos));
(void) new wxStaticBox(this, wxPRINTID_STATIC, _("Print spooling"), wxPoint(230, 10), wxSize(200,170) );
if (!val.IsNull() && val != "")
printData.SetPaperName((char *)(const char *)val);
}
+ *wxThePrintSetupData = GetPrintData();
return TRUE;
}
sel = i;
}
- wxChoice *choice = new wxChoice(this, wxPRINTID_PAPERSIZE, wxPoint(*x, *y), wxSize(170, -1), n,
+ int width = 170;
+#ifdef __WXMOTIF__
+ width = 150;
+#endif
+
+ wxChoice *choice = new wxChoice(this, wxPRINTID_PAPERSIZE, wxPoint(*x, *y), wxSize(width, -1), n,
choices);
delete[] choices;
void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event))
{
+ // We no longer query GetPrintMode, so we can eliminate the need
+ // to call SetPrintMode.
+ // This has the limitation that we can't explicitly call the PostScript
+ // print setup dialog from the generic Page Setup dialog under Windows,
+ // but since this choice would only happen when trying to do PostScript
+ // printing under Windows (and only in 16-bit Windows which
+ // doesn't have a Windows-specific page setup dialog) it's worth it.
+
+ wxPrintData data;
+ data.SetSetupDialog(TRUE);
+ wxPrintDialog *printDialog = new wxPrintDialog(this, & data);
+ int ret = printDialog->ShowModal();
+
+ printDialog->Destroy();
+
+#if 0
if (wxTheApp->GetPrintMode() == wxPRINT_POSTSCRIPT)
{
wxGenericPrintSetupDialog *genericPrintSetupDialog =
wxPrintData data;
data.SetSetupDialog(TRUE);
wxPrintDialog printDialog(this, & data);
- printDialog.Show(TRUE);
+ printDialog.ShowModal();
}
#endif
+#endif
+ // 0
}
wxGenericPageSetupDialog::wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data):
int buttonWidth = 75;
int buttonHeight = 25;
int spacing = 5;
+#ifdef __WXMOTIF__
+ spacing = 15;
+#endif
+
int yPos = 5;
int xPos = 5;
xPos = 5;
yPos += 35;
+#ifdef __WXMOTIF__
+ yPos += 10;
+#endif
+
paperTypeChoice = CreatePaperTypeChoice(&xPos, &yPos);
xPos = 5;
yPos += 60;
int staticWidth = 110;
+#ifdef __WXMOTIF__
+ staticWidth += 20;
+#endif
+
int textWidth = 60;
spacing = 10;
}
}
}
+
return TRUE;
}
#endif
#include "wx/checkbox.h"
+#include "wx/utils.h"
#include <Xm/Label.h>
#include <Xm/LabelG.h>
XmNforeground, g_itemColors[wxFORE_INDEX].pixel,
NULL);
+ int selectPixel = wxBLACK->AllocColour(wxGetDisplay());
+
+ // Better to have the checkbox selection in black, or it's
+ // hard to determine what state it is in.
XtVaSetValues ((Widget) m_mainWidget,
- XmNselectColor, g_itemColors[wxSELE_INDEX].pixel,
+ // XmNselectColor, g_itemColors[wxSELE_INDEX].pixel,
+ XmNselectColor, selectPixel,
NULL);
}
m_mainWidget = m_buttonWidget;
XtManageChild ((Widget) m_buttonWidget);
-
+
// New code from Roland Haenel (roland_haenel@ac.cybercity.de)
// Some time ago, I reported a problem with wxChoice-items under
// Linux and Motif 2.0 (they caused sporadic GPFs). Now it seems
#if XmVersion >= 1002
#if XmVersion < 2000
Widget optionLabel = XmOptionLabelGadget ((Widget) m_buttonWidget);
- XtUnmanageChild (optionLabel);
+ // JACS, 24/1/99: this seems to cause a malloc crash later on, e.g.
+ // in controls sample.
+ // XtUnmanageChild (optionLabel);
#endif
#endif
-
+
XtVaSetValues((Widget) m_formWidget, XmNresizePolicy, XmRESIZE_NONE, NULL);
ChangeFont(FALSE);
-
+
AttachWidget (parent, m_buttonWidget, m_formWidget, pos.x, pos.y, size.x, size.y);
ChangeBackgroundColour();
void wxDialog::Fit()
{
+ wxWindow::Fit();
}
// Handle a close event from the window manager
#include <Xm/ToggleBG.h>
#include <Xm/RowColumn.h>
#include <Xm/Form.h>
+#include <Xm/Frame.h>
#include <wx/motif/private.h>
m_majorDim = 0 ;
m_formWidget = (WXWidget) 0;
+ m_frameWidget = (WXWidget) 0;
m_labelWidget = (WXWidget) 0;
m_radioButtons = (WXWidget*) NULL;
m_radioButtonLabels = (wxString*) NULL;
{
m_selectedButton = -1;
m_noItems = n;
+ m_formWidget = (WXWidget) 0;
+ m_frameWidget = (WXWidget) 0;
m_labelWidget = (WXWidget) 0;
m_radioButtons = (WXWidget*) NULL;
m_radioButtonLabels = (wxString*) NULL;
XmStringFree (text);
}
+ Widget frameWidget = XtVaCreateManagedWidget ("frame",
+ xmFrameWidgetClass, formWidget,
+ XmNshadowType, XmSHADOW_IN,
+// XmNmarginHeight, 0,
+// XmNmarginWidth, 0,
+ NULL);
+
+ m_frameWidget = (WXWidget) frameWidget;
+
Arg args[3];
majorDim = (n + majorDim - 1) / majorDim;
XmHORIZONTAL : XmVERTICAL));
XtSetArg (args[1], XmNnumColumns, majorDim);
- Widget radioBoxWidget = XmCreateRadioBox (formWidget, "radioBoxWidget", args, 2);
+ Widget radioBoxWidget = XmCreateRadioBox (frameWidget, "radioBoxWidget", args, 2);
m_mainWidget = (WXWidget) radioBoxWidget;
XmNtopWidget, m_labelWidget ? (Widget) m_labelWidget : formWidget,
XmNbottomAttachment, XmATTACH_FORM,
XmNleftAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
NULL);
// if (style & wxFLAT)
m_windowFont = parent->GetFont();
ChangeFont(FALSE);
+ // XtManageChild((Widget) m_formWidget);
XtManageChild (radioBoxWidget);
SetCanAddEventHandler(TRUE);
XtSetSensitive ((Widget) m_radioButtons[i], (Boolean) enable);
}
+bool wxRadioBox::Show(bool show)
+{
+ // TODO: show/hide all children
+ return wxControl::Show(show);
+}
+
// Show a specific button
void wxRadioBox::Show(int n, bool show)
{
{
wxWindow::ChangeBackgroundColour();
+ DoChangeBackgroundColour((Widget) m_frameWidget, m_backgroundColour);
+
+ int selectPixel = wxBLACK->AllocColour(wxGetDisplay());
+
int i;
for (i = 0; i < m_noItems; i++)
{
WXWidget radioButton = m_radioButtons[i];
DoChangeBackgroundColour(radioButton, m_backgroundColour, TRUE);
+
+ XtVaSetValues ((Widget) radioButton,
+ XmNselectColor, selectPixel,
+ NULL);
}
}
void wxRadioButton::ChangeBackgroundColour()
{
wxWindow::ChangeBackgroundColour();
+
+ // What colour should this be?
+ int selectPixel = wxBLACK->AllocColour(wxGetDisplay());
+
+ XtVaSetValues ((Widget) GetMainWidget(),
+ XmNselectColor, selectPixel,
+ NULL);
}
void wxRadioButton::ChangeForegroundColour()
m_windowStyle = style;
- SetParent(parent);
-
+ if (parent) parent->AddChild(this);
+
m_min = 0;
m_max = 100;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
+
+ // If we get crashes (as per George Tasker's message) with nested modal dialogs,
+ // we should try removing the m_modalShowing test
+
if (m_modalShowing && !::PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE))
// dfgg: NB MUST test m_modalShowing again as the message loop could have triggered
// a Show(FALSE) in the mean time!!!
node=disabledWindows.First();
while(node) {
wxWindow* win = (wxWindow*) node->Data();
- HWND hWnd = (HWND) win->GetHWND();
- if (::IsWindow(hWnd) && (wxModalDialogs.Member(win) || wxModelessWindows.Member(win) ))
- ::EnableWindow(hWnd,TRUE);
+ if (wxModalDialogs.Member(win) || wxModelessWindows.Member(win))
+ {
+ HWND hWnd = (HWND) win->GetHWND();
+ if (::IsWindow(hWnd))
+ ::EnableWindow(hWnd,TRUE);
+ }
node=node->Next();
}
}
#include "wx/defs.h"
-#define WINDOWS_PRINTING (wxTheApp->GetPrintMode() == wxPRINT_WINDOWS)
-
#ifndef WX_PRECOMP
#include "wx/utils.h"
#include "wx/dc.h"
// OnPaint handlers must always create a wxPaintDC.
wxPaintDC dc(this);
+#ifndef __WXMOTIF__
if (!GetContext()) return;
+#endif
SetCurrent();
int width, height;
GetClientSize(& width, & height);
+#ifndef __WXMOTIF__
if (GetContext())
+#endif
{
SetCurrent();
glViewport(0, 0, width, height);
#endif
if(!doubleBuffer
-#ifdef __X__ // JACS
+#ifdef __WXGTK__ // JACS
|| !wxGLCanvas::HaveVisual(gl_attrib)
#endif
)
{
printf("don't have double buffer, disabling\n");
-#ifndef __WXMSW__
+#ifdef __WXGTK__
gl_attrib[9] = None;
#endif
doubleBuffer = GL_FALSE;