From 4130b487dcbd6f7f8cbc3e724ddf752b3817559c Mon Sep 17 00:00:00 2001
From: Robert Roebling <robert@roebling.de>
Date: Sat, 21 Aug 1999 13:54:32 +0000
Subject: [PATCH]   Doc corrections,   Made colour dialog look slightly nicer, 
  Removed generic file dialog from wxMotif

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 Makefile.in                    | 12 +++---
 distrib/msw/tmake/filelist.txt |  2 +-
 distrib/msw/tmake/unx.t        | 10 ++---
 docs/latex/wx/boxsizer.tex     |  4 +-
 docs/latex/wx/manual.tex       |  2 +-
 docs/latex/wx/sbsizer.tex      |  5 ++-
 docs/latex/wx/sizer.tex        | 17 +++++++-
 docs/latex/wx/tstream.tex      | 26 ++++++------
 docs/latex/wx/txtstrm.tex      |  2 +-
 docs/latex/wx/window.tex       | 19 ++++++---
 src/generic/colrdlgg.cpp       | 75 ++++++++++++++++++++--------------
 11 files changed, 106 insertions(+), 68 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 9fc1ad78b7..46948321e2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,5 +1,5 @@
 #
-# This file was automatically generated by tmake at 20:22, 1999/08/20
+# This file was automatically generated by tmake at 13:41, 1999/08/21
 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T!
 
 #
@@ -1782,18 +1782,18 @@ HEADERS = $(@GUIHEADERS@) $(HTML_HEADERS) $(UNIX_HEADERS) $(PROTOCOL_HEADERS) \
 all:    $(OBJECTS) @WX_TARGET_LIBRARY@ @WX_CREATE_LINKS@
 
 @WX_LIBRARY_NAME_STATIC@:  $(OBJECTS)
-	$(INSTALL) -d ./lib
+	@$(INSTALL) -d ./lib
 	$(AR) $(AROPTIONS) ./lib/$@ $(OBJECTS)
 	$(RANLIB) ./lib/$@
 
 @WX_LIBRARY_NAME_SHARED@:  $(OBJECTS)
-	$(INSTALL) -d ./lib
+	@$(INSTALL) -d ./lib
 	$(SHARED_LD) ./lib/$@ $(OBJECTS) $(EXTRALIBS)
 	
 CREATE_LINKS:  ./lib/@WX_TARGET_LIBRARY@
-	$(RM) ./lib/@WX_LIBRARY_LINK1@
-	$(RM) ./lib/@WX_LIBRARY_LINK2@
-	$(RM) ./lib/@WX_LIBRARY_LINK3@
+	@$(RM) ./lib/@WX_LIBRARY_LINK1@
+	@$(RM) ./lib/@WX_LIBRARY_LINK2@
+	@$(RM) ./lib/@WX_LIBRARY_LINK3@
 	$(LN_S) @WX_TARGET_LIBRARY@ ./lib/@WX_LIBRARY_LINK1@
 	$(LN_S) @WX_TARGET_LIBRARY@ ./lib/@WX_LIBRARY_LINK2@
 	$(LN_S) @WX_TARGET_LIBRARY@ ./lib/@WX_LIBRARY_LINK3@
diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt
index 53b4f3c232..67f9efafc5 100644
--- a/distrib/msw/tmake/filelist.txt
+++ b/distrib/msw/tmake/filelist.txt
@@ -58,7 +58,7 @@ colrdlgg.cpp	G	G
 dcpsg.cpp	G	U
 dirdlgg.cpp	G	16
 fontdlgg.cpp	G	G
-filedlgg.cpp	G	U
+filedlgg.cpp	G	U,X
 gridg.cpp	G
 helphtml.cpp	G	G
 helpwxht.cpp	G	G
diff --git a/distrib/msw/tmake/unx.t b/distrib/msw/tmake/unx.t
index 5180132c5f..0e0fc8624a 100644
--- a/distrib/msw/tmake/unx.t
+++ b/distrib/msw/tmake/unx.t
@@ -483,18 +483,18 @@ HEADERS = $(@GUIHEADERS@) $(HTML_HEADERS) $(UNIX_HEADERS) $(PROTOCOL_HEADERS) \
 all:    $(OBJECTS) @WX_TARGET_LIBRARY@ @WX_CREATE_LINKS@
 
 @WX_LIBRARY_NAME_STATIC@:  $(OBJECTS)
-	$(INSTALL) -d ./lib
+	@$(INSTALL) -d ./lib
 	$(AR) $(AROPTIONS) ./lib/$@ $(OBJECTS)
 	$(RANLIB) ./lib/$@
 
 @WX_LIBRARY_NAME_SHARED@:  $(OBJECTS)
-	$(INSTALL) -d ./lib
+	@$(INSTALL) -d ./lib
 	$(SHARED_LD) ./lib/$@ $(OBJECTS) $(EXTRALIBS)
 	
 CREATE_LINKS:  ./lib/@WX_TARGET_LIBRARY@
-	$(RM) ./lib/@WX_LIBRARY_LINK1@
-	$(RM) ./lib/@WX_LIBRARY_LINK2@
-	$(RM) ./lib/@WX_LIBRARY_LINK3@
+	@$(RM) ./lib/@WX_LIBRARY_LINK1@
+	@$(RM) ./lib/@WX_LIBRARY_LINK2@
+	@$(RM) ./lib/@WX_LIBRARY_LINK3@
 	$(LN_S) @WX_TARGET_LIBRARY@ ./lib/@WX_LIBRARY_LINK1@
 	$(LN_S) @WX_TARGET_LIBRARY@ ./lib/@WX_LIBRARY_LINK2@
 	$(LN_S) @WX_TARGET_LIBRARY@ ./lib/@WX_LIBRARY_LINK3@
diff --git a/docs/latex/wx/boxsizer.tex b/docs/latex/wx/boxsizer.tex
index 74c73000bd..ff1d69bec3 100644
--- a/docs/latex/wx/boxsizer.tex
+++ b/docs/latex/wx/boxsizer.tex
@@ -85,9 +85,7 @@ MyDialog::MyDialog(wxFrame *parent, wxWindowID id, const wxString &title ) :
 \wxheading{Derived from}
 
 \helpref{wxSizer}{wxsizer}
-
-\latexignore{\rtfignore{\wxheading{Members}}}
-
+\helpref{wxObject}{wxobject}
 
 \membersection{wxBoxSizer::wxBoxSizer}\label{wxboxsizerwxboxsizer}
 
diff --git a/docs/latex/wx/manual.tex b/docs/latex/wx/manual.tex
index 1a718b141a..6a992091c3 100644
--- a/docs/latex/wx/manual.tex
+++ b/docs/latex/wx/manual.tex
@@ -30,7 +30,7 @@
 %\winhelponly{\\$$\image{1cm;0cm}{wxwin.wmf}$$}
 }}
 \winhelpignore{\author{Julian Smart, Robert Roebling, Vadim Zeitlin et al}
-\date{August 6th 1999}
+\date{August 25th 1999}
 }
 \makeindex
 \begin{document}
diff --git a/docs/latex/wx/sbsizer.tex b/docs/latex/wx/sbsizer.tex
index ef37faf75c..814f0f0be2 100644
--- a/docs/latex/wx/sbsizer.tex
+++ b/docs/latex/wx/sbsizer.tex
@@ -1,7 +1,8 @@
 \section{\class{wxStaticBoxSizer}}\label{wxstaticboxsizer}
 
-wxStaticBoxSizer is a sizer derived from wxBoxSizer. It is useful for
-layouts which make use of static boxes in connection with sizers.
+wxStaticBoxSizer is a sizer derived from wxBoxSizer but adds a static
+box around the sizer. Note that this static box has to be created 
+separately.
 
 See also \helpref{wxSizer}{wxsizer}, \helpref{wxStaticBox}{wxstaticbox} and
   \helpref{wxBoxSizer}{wxboxsizer}.
diff --git a/docs/latex/wx/sizer.tex b/docs/latex/wx/sizer.tex
index f61f411290..81ed5dd73c 100644
--- a/docs/latex/wx/sizer.tex
+++ b/docs/latex/wx/sizer.tex
@@ -54,6 +54,21 @@ have no meaning in the wxSizer class itself, but as there currently is only one
 deriving directly from wxSizer and this class does not override these methods, the meaning
 of the paramters is described here:
 
+\docparam{window}{The window to be added to the sizer. Its initial size (either set explicitly by the
+user or calculated internally when using wxDefaultSize) is interpreted as the minimal and in many
+cases also the initial size. This is particularly useful in connection with \helpref{SetSizeHint}{wxsizersetsizehints}. }
+
+\docparam{sizer}{The (child-)sizer to be added to the sizer. This allows placing a child sizer in a
+sizer and thus to create hierarchies of sizers (typically a vertical box as the top sizer and several
+horizontal boxes on the level beneath).}
+
+\docparam{width and height}{The dimension of a spacer to be added to the sizer. Adding spacers to sizers
+gives more flexilibilty in the design of dialogs; imagine for example a vertical box with two buttons at the
+bottom of a dialog: you might want to insert a space between the two buttons and make that space stretchable
+using the {\it option} flag and the result will be that the left button will be aligned with the left
+side of the dialog and the right button with the right side - the space in between will shrink and grow with
+the dialog.}
+
 \membersection{wxSizer::Prepend}\label{wxsizerprepend}
 
 \func{void}{Prepend}{\param{wxWindow* }{window}, \param{int }{option = 0}, \param{int }{flag = 0}, \param{int }{border = 0}}
@@ -63,7 +78,7 @@ of the paramters is described here:
 \func{void}{Prepend}{\param{int }{width}, \param{int }{height}, \param{int }{option = 0}, \param{int }{flag = 0}, \param{int }{border = 0}}
 
 Same as \helpref{wxSizer::Add}{wxsizeradd}, but prepends the items to the beginning of the
-list of items (windows, subsizers or spaces) own by this sizer.
+list of items (windows, subsizers or spaces) owned by this sizer.
 
 \membersection{wxSizer::Remove}\label{wxsizerremove}
 
diff --git a/docs/latex/wx/tstream.tex b/docs/latex/wx/tstream.tex
index ec0ac9c432..5709db71d8 100644
--- a/docs/latex/wx/tstream.tex
+++ b/docs/latex/wx/tstream.tex
@@ -8,12 +8,14 @@ Classes: \helpref{wxStreamBase}{wxstreambase},
 
 \wxheading{Purpose of wxStream}
 
-We went into troubles with c++ std streams on some platform:
+We went into troubles with C++ std streams on several platforms:
 they react quite well in most cases, but in multi-threaded case, for example,
-they have a LOT of problems.
+they have many problems. Some Borland Compilers refuse to work at all
+with them and using iostreams on Linux makes writing programs, that are
+binary compatible across different Linux distributions, impossible.
 
-Then, wxStreams have been built in wxWindows because an application should compile
-and run on all supported platforms and we don't want users depend on release
+Therefore, wxStreams have been added to wxWindows because an application should 
+compile and run on all supported platforms and we don't want users depend on release
 X.XX of libg++ or some other compiler to run the program.
 
 wxStreams is divided in two main parts:
@@ -55,29 +57,29 @@ code:
  ...
  // The constructor initializes the stream buffer and open the file descriptor
  // associated to the name of the file.
- wxFileInputStream in\_stream("the\_file\_to\_be\_read");
+ wxFileInputStream in_stream("the_file_to_be_read");
 
- // Ok, read some bytes ... nb\_datas is expressed in bytes.
- in\_stream.Read(data, nb\_datas);
- if (in\_stream.LastError() != wxStream\_NOERROR) {
+ // Ok, read some bytes ... nb_datas is expressed in bytes.
+ in_stream.Read(data, nb_datas);
+ if (in_stream.LastError() != wxStream_NOERROR) {
    // Oh oh, something bad happens.
    // For a complete list, look into the documentation at wxStreamBase.
  }
 
  // You can also inline all like this.
- if (in\_stream.Read(data, nb\_datas).LastError() != wxStream\_NOERROR) {
+ if (in_stream.Read(data, nb_datas).LastError() != wxStream_NOERROR) {
    // Do something.
  }
 
  // You can also get the last number of bytes REALLY put into the buffer.
- size\_t really\_read = in\_stream.LastRead();
+ size_t really_read = in_stream.LastRead();
 
  // Ok, moves to the beginning of the stream. SeekI returns the last position 
  // in the stream counted from the beginning.
- off\_t old_position = in\_stream.SeekI(0, wxFromBeginning);
+ off_t old_position = in_stream.SeekI(0, wxFromBeginning);
  
  // What is my current position ?
- off\_t position = in\_stream.TellI();
+ off_t position = in_stream.TellI();
 
  // wxFileInputStream will close the file descriptor on the destruction.
 \end{verbatim}
diff --git a/docs/latex/wx/txtstrm.tex b/docs/latex/wx/txtstrm.tex
index b162cee031..a2e4e54136 100644
--- a/docs/latex/wx/txtstrm.tex
+++ b/docs/latex/wx/txtstrm.tex
@@ -96,7 +96,7 @@ For example:
   wxFileOutputStream output( "mytext.txt" );
   wxTextOutputStream text( output );
 
-  output << "This is a text line\n";
+  output << "This is a text line" << endl;
   output << 1234;
   output << 1.23456;
 \end{verbatim}
diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex
index 1cadad6ded..d877e1cf84 100644
--- a/docs/latex/wx/window.tex
+++ b/docs/latex/wx/window.tex
@@ -1,8 +1,15 @@
 \section{\class{wxWindow}}\label{wxwindow}
 
-wxWindow is the base class for all windows.  Any
-children of the window will be deleted automatically by the destructor
-before the window itself is deleted.
+wxWindow is the base class for all windows. Any children of the window will be deleted 
+automatically by the destructor before the window itself is deleted.
+
+Please note that we documented a number of handler functions (OnChar(), OnMouse() etc.) in this 
+help text. These must not be called by a user program and are documented only for illustration. 
+On several platforms, only a few of these handlers are actually written (they are not always
+needed) and if you are uncertain on how to add a certain behaviour to a window class, intercept
+the respective event as usual and call \helpref{wxEvent::Skip}{wxeventskip} so that the native
+platform can implement its native behaviour or just ignore the event if nothing needs to be
+done.
 
 \wxheading{Derived from}
 
@@ -16,7 +23,7 @@ before the window itself is deleted.
 \wxheading{Window styles}
 
 The following styles can apply to all windows, although they will not always make sense for a particular
-window class.
+window class or on all platforms.
 
 \twocolwidtha{5cm}%
 \begin{twocollist}\itemsep=0pt
@@ -38,7 +45,7 @@ this style}
 \twocolitem{\windowstyle{wxNO\_FULLREPAINT\_ON\_RESIZE}}{Disables repainting
 the window completely when its size is changed - you will have to repaint the
 new window area manually if you use style. Currently only has effect for
-wxMSW.}
+Windows.}
 \twocolitem{\windowstyle{wxVSCROLL}}{Use this style to enable a vertical scrollbar. (Still used?) }
 \twocolitem{\windowstyle{wxHSCROLL}}{Use this style to enable a horizontal scrollbar. (Still used?) }
 \twocolitem{\windowstyle{wxCLIP\_CHILDREN}}{Use this style to eliminate flicker caused by the background being
@@ -792,7 +799,7 @@ Returns TRUE if the window is enabled for input, FALSE otherwise.
 
 Returns TRUE if the given point or rectange area has been exposed since the
 last repaint. Call this in an paint event handler to optimize redrawing by
-only redrawing those area, which have been exposed.
+only redrawing those areas, which have been exposed.
 
 \membersection{wxWindow::IsRetained}\label{wxwindowisretained}
 
diff --git a/src/generic/colrdlgg.cpp b/src/generic/colrdlgg.cpp
index d99432194e..1e137f0743 100644
--- a/src/generic/colrdlgg.cpp
+++ b/src/generic/colrdlgg.cpp
@@ -32,6 +32,11 @@
 #include "wx/layout.h"
 #include "wx/dcclient.h"
 #include "wx/slider.h"
+#include "wx/sizer.h"
+#endif
+
+#if wxUSE_STATLINE
+    #include "wx/statline.h"
 #endif
 
 #include "wx/generic/colrdlgg.h"
@@ -111,7 +116,7 @@ static wxString wxColourDialogNames[NUM_COLS]={_T("ORANGE"),
             _T("WHITE")
             };
 
-wxGenericColourDialog::wxGenericColourDialog(void)
+wxGenericColourDialog::wxGenericColourDialog()
 {
   dialogParent = NULL;
   whichKind = 1;
@@ -126,7 +131,7 @@ wxGenericColourDialog::wxGenericColourDialog(wxWindow *parent, wxColourData *dat
   Create(parent, data);
 }
 
-wxGenericColourDialog::~wxGenericColourDialog(void)
+wxGenericColourDialog::~wxGenericColourDialog()
 {
 }
 
@@ -149,7 +154,7 @@ bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data)
   return TRUE;
 }
 
-int wxGenericColourDialog::ShowModal(void)
+int wxGenericColourDialog::ShowModal()
 {
   return wxDialog::ShowModal();
 }
@@ -196,7 +201,7 @@ void wxGenericColourDialog::OnPaint(wxPaintEvent& event)
   PaintHighlight(dc, TRUE);
 }
 
-void wxGenericColourDialog::CalculateMeasurements(void)
+void wxGenericColourDialog::CalculateMeasurements()
 {
   smallRectangleSize.x = 18;
   smallRectangleSize.y = 14;
@@ -226,40 +231,50 @@ void wxGenericColourDialog::CalculateMeasurements(void)
   buttonY = customColoursRect.y + customColoursRect.height + 10;
 }
 
-void wxGenericColourDialog::CreateWidgets(void)
+void wxGenericColourDialog::CreateWidgets()
 {
-  wxBeginBusyCursor();
-
-  wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(okButtonX, buttonY), wxSize(75,-1) );
-  int bw, bh;
-  okButton->GetSize(&bw, &bh);
+    wxBeginBusyCursor();
 
-  (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(okButtonX + bw + 20, buttonY), wxSize(75,-1));
-  (void) new wxButton(this, wxID_ADD_CUSTOM, _("Add to custom colours"),
-     wxPoint(customButtonX, buttonY));
-
-  int sliderX = singleCustomColourRect.x + singleCustomColourRect.width + sectionSpacing;
-#ifdef __X__
-  int sliderSpacing = 75;
-  int sliderHeight = 160;
+    int sliderX = singleCustomColourRect.x + singleCustomColourRect.width + sectionSpacing;
+#if defined(__WXMOTIF__)
+    int sliderSpacing = 65;
+    int sliderHeight = 160;
 #else
-  int sliderSpacing = 45;
-  int sliderHeight = 160;
+    int sliderSpacing = 45;
+    int sliderHeight = 160;
+#endif
+
+    redSlider = new wxSlider(this, wxID_RED_SLIDER, 0, 0, 255,
+        wxPoint(sliderX, 10), wxSize(-1, sliderHeight), wxVERTICAL|wxSL_LABELS);
+    greenSlider = new wxSlider(this, wxID_GREEN_SLIDER, 0, 0, 255,
+        wxPoint(sliderX + sliderSpacing, 10), wxSize(-1, sliderHeight), wxVERTICAL|wxSL_LABELS);
+    blueSlider = new wxSlider(this, wxID_BLUE_SLIDER, 0, 0, 255,
+        wxPoint(sliderX + 2*sliderSpacing, 10), wxSize(-1, sliderHeight), wxVERTICAL|wxSL_LABELS);
+
+    wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
+
+    // 1) space for explicitly layouted controls
+    topsizer->Add( sliderX + 3*sliderSpacing, sliderHeight+25 );
+    
+#if wxUSE_STATLINE
+    // 2) static line
+    topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
 #endif
 
-  redSlider = new wxSlider(this, wxID_RED_SLIDER, 0, 0, 255,
-   wxPoint(sliderX, 10), wxSize(-1, sliderHeight), wxVERTICAL|wxSL_LABELS);
-  greenSlider = new wxSlider(this, wxID_GREEN_SLIDER, 0, 0, 255,
-   wxPoint(sliderX + sliderSpacing, 10), wxSize(-1, sliderHeight), wxVERTICAL|wxSL_LABELS);
-  blueSlider = new wxSlider(this, wxID_BLUE_SLIDER, 0, 0, 255,
-   wxPoint(sliderX + 2*sliderSpacing, 10), wxSize(-1, sliderHeight), wxVERTICAL|wxSL_LABELS);
+    // 3) buttons
+    wxSizer *buttonsizer = CreateButtonSizer( wxOK|wxCANCEL );
+    buttonsizer->Add( new wxButton(this, wxID_ADD_CUSTOM, _("Add to custom colours") ), 0, wxLEFT|wxRIGHT, 10 );
+    topsizer->Add( buttonsizer, 0, wxCENTRE | wxALL, 10 );
 
-  SetClientSize(sliderX + 3*sliderSpacing, buttonY + bh + 20);
-  okButton->SetDefault();
+    SetAutoLayout( TRUE );
+    SetSizer( topsizer );
+    
+    topsizer->SetSizeHints( this );
+    topsizer->Fit( this );
 
-  Centre(wxBOTH);
+    Centre( wxBOTH );
 
-  wxEndBusyCursor();
+    wxEndBusyCursor();
 }
 
 void wxGenericColourDialog::InitializeColours(void)
-- 
2.47.2

