From: Włodzimierz Skiba Date: Mon, 9 Oct 2006 10:26:18 +0000 (+0000) Subject: Warnings, build errors, headers, licence, prefered api and non-PCH support cleaning... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b68603d5359cdfa4a79fc1798d87959d5a578f51 Warnings, build errors, headers, licence, prefered api and non-PCH support cleaning of fresh richtext code. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41795 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/richtext/richtextbulletspage.h b/include/wx/richtext/richtextbulletspage.h index 53aa6664be..0b5a9939a4 100644 --- a/include/wx/richtext/richtextbulletspage.h +++ b/include/wx/richtext/richtextbulletspage.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: richtextbulletspage.h +// Name: wx/richtext/richtextbulletspage.h // Purpose: // Author: Julian Smart // Modified by: // Created: 10/4/2006 10:32:31 AM -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTBULLETSPAGE_H_ @@ -42,14 +42,6 @@ class wxRichTextCtrl; #define SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION wxDefaultPosition ////@end control identifiers -/*! - * Compatibility - */ - -#ifndef wxCLOSE_BOX -#define wxCLOSE_BOX 0x1000 -#endif - /*! * wxRichTextBulletsPage class declaration */ diff --git a/include/wx/richtext/richtextfontpage.h b/include/wx/richtext/richtextfontpage.h index ba1c0d7f02..6e820690f6 100644 --- a/include/wx/richtext/richtextfontpage.h +++ b/include/wx/richtext/richtextfontpage.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richeditfontpage.h +// Name: wx/richtext/richeditfontpage.h // Purpose: Font page for wxRichTextFormattingDialog // Author: Julian Smart // Modified by: diff --git a/include/wx/richtext/richtextformatdlg.h b/include/wx/richtext/richtextformatdlg.h index 2fb9680281..70b7cbe195 100644 --- a/include/wx/richtext/richtextformatdlg.h +++ b/include/wx/richtext/richtextformatdlg.h @@ -205,7 +205,6 @@ public: wxRichTextColourSwatchCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); ~wxRichTextColourSwatchCtrl(); - void OnPaint(wxPaintEvent& event); void OnMouseEvent(wxMouseEvent& event); void SetColour(const wxColour& colour) { m_colour = colour; SetBackgroundColour(m_colour); } @@ -278,4 +277,3 @@ private: #endif // _WX_RICHTEXTFORMATDLG_H_ - diff --git a/include/wx/richtext/richtextindentspage.h b/include/wx/richtext/richtextindentspage.h index eb61c598d0..046b5f34d8 100644 --- a/include/wx/richtext/richtextindentspage.h +++ b/include/wx/richtext/richtextindentspage.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: richtextindentspage.h +// Name: wx/richtext/richtextindentspage.h // Purpose: // Author: Julian Smart // Modified by: // Created: 10/3/2006 2:28:21 PM -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTINDENTSPAGE_H_ @@ -40,14 +40,6 @@ class wxRichTextCtrl; #define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_POSITION wxDefaultPosition ////@end control identifiers -/*! - * Compatibility - */ - -#ifndef wxCLOSE_BOX -#define wxCLOSE_BOX 0x1000 -#endif - /*! * wxRichTextIndentsSpacingPage class declaration */ diff --git a/include/wx/richtext/richtextstylepage.h b/include/wx/richtext/richtextstylepage.h index 76db0aa241..8dd7b793ba 100644 --- a/include/wx/richtext/richtextstylepage.h +++ b/include/wx/richtext/richtextstylepage.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: richtextstylepage.h +// Name: wx/richtext/richtextstylepage.h // Purpose: // Author: Julian Smart // Modified by: // Created: 10/5/2006 11:34:55 AM -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTSTYLEPAGE_H_ @@ -38,14 +38,6 @@ #define SYMBOL_WXRICHTEXTSTYLEPAGE_POSITION wxDefaultPosition ////@end control identifiers -/*! - * Compatibility - */ - -#ifndef wxCLOSE_BOX -#define wxCLOSE_BOX 0x1000 -#endif - /*! * wxRichTextStylePage class declaration */ diff --git a/include/wx/richtext/richtextsymboldlg.h b/include/wx/richtext/richtextsymboldlg.h index e9d5b7ff31..3588885f0c 100644 --- a/include/wx/richtext/richtextsymboldlg.h +++ b/include/wx/richtext/richtextsymboldlg.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: richtextsymboldlg.h -// Purpose: +// Name: wx/richtext/richtextsymboldlg.h +// Purpose: // Author: Julian Smart -// Modified by: +// Modified by: // Created: 10/5/2006 3:11:58 PM -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTSYMBOLDLG_H_ @@ -30,12 +30,6 @@ class WXDLLIMPEXP_CORE wxStaticText; class WXDLLIMPEXP_CORE wxTextCtrl; ////@end forward declarations -#ifndef __UNICODE__ -#if wxUSE_UNICODE -#define __UNICODE__ -#endif -#endif - /*! * Symbols */ @@ -51,7 +45,7 @@ class WXDLLIMPEXP_CORE wxTextCtrl; */ class WXDLLIMPEXP_RICHTEXT wxSymbolPickerDialog: public wxDialog -{ +{ DECLARE_DYNAMIC_CLASS( wxSymbolPickerDialog ) DECLARE_EVENT_TABLE() @@ -70,28 +64,28 @@ public: /// Creates the controls and sizers void CreateControls(); - + /// Update the display void UpdateSymbolDisplay(bool updateSymbolList = true, bool showAtSubset = true); /// Respond to symbol selection void OnSymbolSelected( wxCommandEvent& event ); - + /// Set Unicode mode void SetUnicodeMode(bool unicodeMode); - + /// Show at the current subset selection void ShowAtSubset(); - + /// Get the selected symbol character int GetSymbolChar() const; /// Is there a selection? bool HasSelection() const { return !m_symbol.IsEmpty(); } - + /// Specifying normal text? bool UseNormalFont() const { return m_fontName.IsEmpty(); } - + /// Data transfer virtual bool TransferDataToWindow(); @@ -110,12 +104,16 @@ public: void OnFromUnicodeSelected( wxCommandEvent& event ); #endif -#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXOS2__) || defined(__WXMGL__) || defined(__WXMOTIF__) || defined(__WXCOCOA__) || defined(__WXX11__) || defined(__WXPALMOS__) - /// wxEVT_UPDATE_UI event handler for wxID_OK - void OnOkUpdate( wxUpdateUIEvent& event ); +#if defined(__WXMSW__) || \ + defined(__WXMAC__) || \ + defined(__WXGTK__) || \ + defined(__WXPM__) || \ + defined(__WXMGL__) || \ + defined(__WXMOTIF__) || \ + defined(__WXCOCOA__) || \ + defined(__WXX11__) || \ + defined(__WXPALMOS__) -#endif -#if defined(__WXMAC__) /// wxEVT_UPDATE_UI event handler for wxID_OK void OnOkUpdate( wxUpdateUIEvent& event ); @@ -178,7 +176,7 @@ public: /*! * The scrolling symbol list. */ - + class WXDLLIMPEXP_RICHTEXT wxSymbolListCtrl : public wxVScrolledWindow { public: @@ -221,7 +219,7 @@ public: // set the current font virtual bool SetFont(const wxFont& font); - + // set Unicode/ASCII mode void SetUnicodeMode(bool unicodeMode); @@ -246,7 +244,7 @@ public: // set the selection to the specified item, if it is wxNOT_FOUND the // selection is unset void SetSelection(int selection); - + // make this item visible void EnsureVisible(int item); @@ -257,7 +255,7 @@ public: // by default both margins are 0 void SetMargins(const wxPoint& pt); void SetMargins(wxCoord x, wxCoord y) { SetMargins(wxPoint(x, y)); } - + // set the cell size void SetCellSize(const wxSize& sz) { m_cellSize = sz; } const wxSize& GetCellSize() const { return m_cellSize; } @@ -272,19 +270,19 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - + // Get min/max symbol values int GetMinSymbolValue() const { return m_minSymbolValue; } int GetMaxSymbolValue() const { return m_maxSymbolValue; } - + // Respond to size change void OnSize(wxSizeEvent& event); protected: - // draws a line of symbols + // draws a line of symbols virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const; - + // gets the line height virtual wxCoord OnGetLineHeight(size_t line) const; @@ -317,13 +315,13 @@ protected: // common part of keyboard and mouse handling processing code void DoHandleItemClick(int item, int flags); - + // calculate line number from symbol value int SymbolValueToLineNumber(int item); - + // initialise control from current min/max values void SetupCtrl(bool scrollToSelection = true); - + // hit testing int HitTest(const wxPoint& pt); @@ -339,19 +337,19 @@ private: // double buffer wxBitmap* m_doubleBuffer; - + // cell size wxSize m_cellSize; - + // minimum and maximum symbol value int m_minSymbolValue; // minimum and maximum symbol value int m_maxSymbolValue; - + // number of items per line int m_symbolsPerLine; - + // Unicode/ASCII mode bool m_unicodeMode; diff --git a/include/wx/richtext/richtexttabspage.h b/include/wx/richtext/richtexttabspage.h index b3fa7c4608..9c5eecc6dd 100644 --- a/include/wx/richtext/richtexttabspage.h +++ b/include/wx/richtext/richtexttabspage.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: richtexttabspage.h +// Name: wx/richtext/richtexttabspage.h // Purpose: // Author: Julian Smart // Modified by: // Created: 10/4/2006 8:03:20 AM -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTTABSPAGE_H_ @@ -38,14 +38,6 @@ #define SYMBOL_WXRICHTEXTTABSPAGE_POSITION wxDefaultPosition ////@end control identifiers -/*! - * Compatibility - */ - -#ifndef wxCLOSE_BOX -#define wxCLOSE_BOX 0x1000 -#endif - /*! * wxRichTextTabsPage class declaration */ diff --git a/src/richtext/richtextbulletspage.cpp b/src/richtext/richtextbulletspage.cpp index 740ad086c3..632fd213ec 100644 --- a/src/richtext/richtextbulletspage.cpp +++ b/src/richtext/richtextbulletspage.cpp @@ -1,24 +1,31 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: richtextbulletspage.cpp +// Name: src/richtext/richtextbulletspage.cpp // Purpose: // Author: Julian Smart // Modified by: // Created: 10/4/2006 10:32:31 AM -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -////@begin includes -////@end includes +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_RICHTEXT + +#include "wx/richtext/richtextbulletspage.h" + +#ifndef WX_PRECOMP +#endif -#include "../../include/wx/richtext/richtextbulletspage.h" #include "wx/richtext/richtextsymboldlg.h" #include "wx/fontenum.h" -////@begin XPM images -////@end XPM images - /*! * wxRichTextBulletsPage type definition */ @@ -166,7 +173,14 @@ void wxRichTextBulletsPage::CreateControls() itemBoxSizer11->Add(itemBoxSizer13, 0, wxGROW, 5); wxString* m_symbolCtrlStrings = NULL; - m_symbolCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, _T(""), wxDefaultPosition, wxSize(60, -1), 0, m_symbolCtrlStrings, wxCB_DROPDOWN ); + m_symbolCtrl = new wxComboBox( itemPanel1, + ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, + wxEmptyString, + wxDefaultPosition, + wxSize(60, wxDefaultCoord), + 0, + m_symbolCtrlStrings, + wxCB_DROPDOWN ); itemBoxSizer13->Add(m_symbolCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5); wxButton* itemButton15 = new wxButton( itemPanel1, ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL, _("Ch&oose..."), wxDefaultPosition, wxDefaultSize, 0 ); @@ -178,7 +192,14 @@ void wxRichTextBulletsPage::CreateControls() itemBoxSizer11->Add(itemStaticText17, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); wxString* m_symbolFontCtrlStrings = NULL; - m_symbolFontCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_symbolFontCtrlStrings, wxCB_DROPDOWN ); + m_symbolFontCtrl = new wxComboBox( itemPanel1, + ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, + wxEmptyString, + wxDefaultPosition, + wxDefaultSize, + 0, + m_symbolFontCtrlStrings, + wxCB_DROPDOWN ); itemBoxSizer11->Add(m_symbolFontCtrl, 0, wxGROW|wxALL, 5); itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); @@ -194,7 +215,7 @@ void wxRichTextBulletsPage::CreateControls() wxStaticText* itemStaticText23 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC, _("&Number:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer22->Add(itemStaticText23, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - m_numberCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, _T("0"), wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 0, 100000, 0 ); + m_numberCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, _T("0"), wxDefaultPosition, wxSize(50, wxDefaultCoord), wxSP_ARROW_KEYS, 0, 100000, 0 ); itemBoxSizer22->Add(m_numberCtrl, 0, wxGROW|wxALL, 5); itemBoxSizer22->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); @@ -283,7 +304,7 @@ bool wxRichTextBulletsPage::TransferDataFromWindow() if (m_hasBulletSymbol) { wxChar c(wxT('*')); - if (m_symbolCtrl->GetValue().Length() > 0) + if (m_symbolCtrl->GetValue().length() > 0) c = m_symbolCtrl->GetValue()[0]; attr->SetBulletSymbol(c); attr->SetBulletFont(m_symbolFontCtrl->GetValue()); @@ -688,4 +709,4 @@ void wxRichTextBulletsPage::OnNumberstaticUpdate( wxUpdateUIEvent& event ) OnNumberUpdate(event); } - +#endif // wxUSE_RICHTEXT diff --git a/src/richtext/richtextindentspage.cpp b/src/richtext/richtextindentspage.cpp index 4630a94fe0..39910835fe 100644 --- a/src/richtext/richtextindentspage.cpp +++ b/src/richtext/richtextindentspage.cpp @@ -1,21 +1,27 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: richtextindentspage.cpp +// Name: src/richtext/richtextindentspage.cpp // Purpose: // Author: Julian Smart // Modified by: // Created: 10/3/2006 2:28:21 PM -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -////@begin includes -////@end includes +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" -#include "../../include/wx/richtext/richtextindentspage.h" +#ifdef __BORLANDC__ + #pragma hdrstop +#endif -////@begin XPM images -////@end XPM images +#if wxUSE_RICHTEXT + +#include "wx/richtext/richtextindentspage.h" + +#ifndef WX_PRECOMP +#endif /*! * wxRichTextIndentsSpacingPage type definition @@ -194,7 +200,12 @@ void wxRichTextIndentsSpacingPage::CreateControls() wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer22->Add(itemBoxSizer24, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_indentLeft = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_indentLeft = new wxTextCtrl( itemPanel1, + ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT, + wxEmptyString, + wxDefaultPosition, + wxSize(50, wxDefaultCoord), + 0 ); itemBoxSizer24->Add(m_indentLeft, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticText* itemStaticText26 = new wxStaticText( itemPanel1, wxID_STATIC, _("Left (&first line):"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -203,7 +214,12 @@ void wxRichTextIndentsSpacingPage::CreateControls() wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer22->Add(itemBoxSizer27, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_indentLeftFirst = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_indentLeftFirst = new wxTextCtrl( itemPanel1, + ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST, + wxEmptyString, + wxDefaultPosition, + wxSize(50, wxDefaultCoord), + 0 ); itemBoxSizer27->Add(m_indentLeftFirst, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticText* itemStaticText29 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -212,7 +228,12 @@ void wxRichTextIndentsSpacingPage::CreateControls() wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer22->Add(itemBoxSizer30, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_indentRight = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_indentRight = new wxTextCtrl( itemPanel1, + ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT, + wxEmptyString, + wxDefaultPosition, + wxSize(50, wxDefaultCoord), + 0 ); itemBoxSizer30->Add(m_indentRight, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); @@ -242,7 +263,12 @@ void wxRichTextIndentsSpacingPage::CreateControls() wxBoxSizer* itemBoxSizer41 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer39->Add(itemBoxSizer41, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_spacingBefore = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_spacingBefore = new wxTextCtrl( itemPanel1, + ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE, + wxEmptyString, + wxDefaultPosition, + wxSize(50, wxDefaultCoord), + 0 ); itemBoxSizer41->Add(m_spacingBefore, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticText* itemStaticText43 = new wxStaticText( itemPanel1, wxID_STATIC, _("After a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -251,7 +277,12 @@ void wxRichTextIndentsSpacingPage::CreateControls() wxBoxSizer* itemBoxSizer44 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer39->Add(itemBoxSizer44, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_spacingAfter = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_spacingAfter = new wxTextCtrl( itemPanel1, + ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER, + wxEmptyString, + wxDefaultPosition, + wxSize(50, wxDefaultCoord), + 0 ); itemBoxSizer44->Add(m_spacingAfter, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticText* itemStaticText46 = new wxStaticText( itemPanel1, wxID_STATIC, _("Line spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -343,7 +374,7 @@ bool wxRichTextIndentsSpacingPage::TransferDataFromWindow() wxString leftIndent(m_indentLeft->GetValue()); wxString leftFirstIndent(m_indentLeftFirst->GetValue()); - if (!leftIndent.IsEmpty()) + if (!leftIndent.empty()) { int visualLeftIndent = wxAtoi(leftIndent); int visualLeftFirstIndent = wxAtoi(leftFirstIndent); @@ -356,19 +387,19 @@ bool wxRichTextIndentsSpacingPage::TransferDataFromWindow() attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_LEFT_INDENT)); wxString rightIndent(m_indentRight->GetValue()); - if (!rightIndent.IsEmpty()) + if (!rightIndent.empty()) attr->SetRightIndent(wxAtoi(rightIndent)); else attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_RIGHT_INDENT)); wxString spacingAfter(m_spacingAfter->GetValue()); - if (!spacingAfter.IsEmpty()) + if (!spacingAfter.empty()) attr->SetParagraphSpacingAfter(wxAtoi(spacingAfter)); else attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_PARA_SPACING_AFTER)); wxString spacingBefore(m_spacingBefore->GetValue()); - if (!spacingBefore.IsEmpty()) + if (!spacingBefore.empty()) attr->SetParagraphSpacingBefore(wxAtoi(spacingBefore)); else attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_PARA_SPACING_BEFORE)); @@ -635,4 +666,4 @@ void wxRichTextIndentsSpacingPage::OnSpacingLineSelected( wxCommandEvent& WXUNUS UpdatePreview(); } - +#endif // wxUSE_RICHTEXT diff --git a/src/richtext/richtextstylepage.cpp b/src/richtext/richtextstylepage.cpp index 2003459e9e..ab55e26708 100644 --- a/src/richtext/richtextstylepage.cpp +++ b/src/richtext/richtextstylepage.cpp @@ -1,21 +1,27 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: richtextstylepage.cpp +// Name: src/richtext/richtextstylepage.cpp // Purpose: // Author: Julian Smart // Modified by: // Created: 10/5/2006 11:34:55 AM -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -////@begin includes -////@end includes +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" -#include "../../include/wx/richtext/richtextstylepage.h" +#ifdef __BORLANDC__ + #pragma hdrstop +#endif -////@begin XPM images -////@end XPM images +#if wxUSE_RICHTEXT + +#include "wx/richtext/richtextstylepage.h" + +#ifndef WX_PRECOMP +#endif /*! * wxRichTextStylePage type definition @@ -107,21 +113,40 @@ void wxRichTextStylePage::CreateControls() wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Style:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - m_styleName = new wxTextCtrl( itemPanel1, ID_RICHTEXTSTYLEPAGE_STYLE_NAME, _T(""), wxDefaultPosition, wxSize(300, -1), 0 ); + m_styleName = new wxTextCtrl( itemPanel1, + ID_RICHTEXTSTYLEPAGE_STYLE_NAME, + wxEmptyString, + wxDefaultPosition, + wxSize(300, wxDefaultCoord), + 0 ); itemBoxSizer5->Add(m_styleName, 0, wxGROW|wxALL, 5); wxStaticText* itemStaticText8 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Based on:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer5->Add(itemStaticText8, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); wxString* m_basedOnStrings = NULL; - m_basedOn = new wxComboBox( itemPanel1, ID_RICHTEXTSTYLEPAGE_BASED_ON, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_basedOnStrings, wxCB_DROPDOWN ); + m_basedOn = new wxComboBox( itemPanel1, + ID_RICHTEXTSTYLEPAGE_BASED_ON, + wxEmptyString, + wxDefaultPosition, + wxDefaultSize, + 0, + m_basedOnStrings, + wxCB_DROPDOWN ); itemBoxSizer5->Add(m_basedOn, 0, wxGROW|wxALL, 5); wxStaticText* itemStaticText10 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Next style:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer5->Add(itemStaticText10, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); wxString* m_nextStyleStrings = NULL; - m_nextStyle = new wxComboBox( itemPanel1, ID_RICHTEXTSTYLEPAGE_NEXT_STYLE, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_nextStyleStrings, wxCB_DROPDOWN ); + m_nextStyle = new wxComboBox( itemPanel1, + ID_RICHTEXTSTYLEPAGE_NEXT_STYLE, + wxEmptyString, + wxDefaultPosition, + wxDefaultSize, + 0, + m_nextStyleStrings, + wxCB_DROPDOWN ); itemBoxSizer5->Add(m_nextStyle, 0, wxGROW|wxALL, 5); itemBoxSizer3->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); @@ -253,3 +278,5 @@ void wxRichTextStylePage::OnNextStyleUpdate( wxUpdateUIEvent& event ) wxRichTextStyleDefinition* def = wxRichTextFormattingDialog::GetDialogStyleDefinition(this); event.Enable(def->IsKindOf(CLASSINFO(wxRichTextParagraphStyleDefinition))); } + +#endif // wxUSE_RICHTEXT diff --git a/src/richtext/richtextsymboldlg.cpp b/src/richtext/richtextsymboldlg.cpp index 7f53ddd320..e3318fd4a9 100644 --- a/src/richtext/richtextsymboldlg.cpp +++ b/src/richtext/richtextsymboldlg.cpp @@ -1,19 +1,19 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: richtextsymboldlg.cpp +// Name: src/richtext/richtextsymboldlg.cpp // Purpose: // Author: Julian Smart // Modified by: // Created: 10/5/2006 3:11:58 PM -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #if wxUSE_RICHTEXT @@ -21,18 +21,17 @@ #include "wx/richtext/richtextsymboldlg.h" #ifndef WX_PRECOMP -#include "wx/wx.h" + #include "wx/sizer.h" + #include "wx/stattext.h" + #include "wx/combobox.h" + #include "wx/button.h" + #include "wx/settings.h" + #include "wx/icon.h" + #include "wx/listbox.h" #endif -////@begin includes -////@end includes - #include "wx/fontenum.h" #include "wx/dcbuffer.h" -#include "wx/settings.h" - -////@begin XPM images -////@end XPM images /* Microsoft Unicode subset numbering */ @@ -397,7 +396,14 @@ void wxSymbolPickerDialog::CreateControls() itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); wxString* m_fontCtrlStrings = NULL; - m_fontCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_FONT, _T(""), wxDefaultPosition, wxSize(240, -1), 0, m_fontCtrlStrings, wxCB_READONLY ); + m_fontCtrl = new wxComboBox( itemDialog1, + ID_SYMBOLPICKERDIALOG_FONT, + wxEmptyString, + wxDefaultPosition, + wxSize(240, wxDefaultCoord), + 0, + m_fontCtrlStrings, + wxCB_READONLY ); itemBoxSizer5->Add(m_fontCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); itemBoxSizer5->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); @@ -410,7 +416,14 @@ void wxSymbolPickerDialog::CreateControls() #if defined(__UNICODE__) wxString* m_subsetCtrlStrings = NULL; - m_subsetCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_SUBSET, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_subsetCtrlStrings, wxCB_READONLY ); + m_subsetCtrl = new wxComboBox( itemDialog1, + ID_SYMBOLPICKERDIALOG_SUBSET, + wxEmptyString, + wxDefaultPosition, + wxDefaultSize, + 0, + m_subsetCtrlStrings, + wxCB_READONLY ); m_subsetCtrl->SetHelpText(_("Shows a Unicode subset.")); if (ShowToolTips()) m_subsetCtrl->SetToolTip(_("Shows a Unicode subset.")); @@ -424,7 +437,7 @@ void wxSymbolPickerDialog::CreateControls() wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer3->Add(itemBoxSizer12, 0, wxGROW, 5); - m_symbolStaticCtrl = new wxStaticText( itemDialog1, wxID_STATIC, _("xxxx"), wxDefaultPosition, wxSize(40, -1), wxALIGN_CENTRE ); + m_symbolStaticCtrl = new wxStaticText( itemDialog1, wxID_STATIC, _("xxxx"), wxDefaultPosition, wxSize(40, wxDefaultCoord), wxALIGN_CENTRE ); itemBoxSizer12->Add(m_symbolStaticCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); itemBoxSizer12->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); @@ -432,7 +445,12 @@ void wxSymbolPickerDialog::CreateControls() wxStaticText* itemStaticText15 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Character code:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer12->Add(itemStaticText15, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - m_characterCodeCtrl = new wxTextCtrl( itemDialog1, ID_SYMBOLPICKERDIALOG_CHARACTERCODE, _T(""), wxDefaultPosition, wxSize(140, -1), wxTE_READONLY|wxTE_CENTRE ); + m_characterCodeCtrl = new wxTextCtrl( itemDialog1, + ID_SYMBOLPICKERDIALOG_CHARACTERCODE, + wxEmptyString, + wxDefaultPosition, + wxSize(140, wxDefaultCoord), + wxTE_READONLY|wxTE_CENTRE ); itemBoxSizer12->Add(m_characterCodeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); itemBoxSizer12->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); @@ -514,7 +532,7 @@ bool wxSymbolPickerDialog::TransferDataToWindow() m_fontCtrl->Append(faceNames); } - if (m_fontName.IsEmpty()) + if (m_fontName.empty()) m_fontCtrl->SetSelection(0); else { @@ -524,7 +542,7 @@ bool wxSymbolPickerDialog::TransferDataToWindow() m_fontCtrl->SetSelection(0); } - if (!m_symbol.IsEmpty()) + if (!m_symbol.empty()) { int sel = (int) m_symbol[0]; m_symbolsCtrl->SetSelection(sel); @@ -554,12 +572,12 @@ void wxSymbolPickerDialog::UpdateSymbolDisplay(bool updateSymbolList, bool showA { wxFont font; wxString fontNameToUse; - if (m_fontName.IsEmpty()) + if (m_fontName.empty()) fontNameToUse = m_normalTextFontName; else fontNameToUse = m_fontName; - if (!fontNameToUse.IsEmpty()) + if (!fontNameToUse.empty()) { font = wxFont(14, wxDEFAULT, wxNORMAL, wxNORMAL, false, fontNameToUse); } @@ -571,7 +589,7 @@ void wxSymbolPickerDialog::UpdateSymbolDisplay(bool updateSymbolList, bool showA m_symbolsCtrl->SetFont(font); } - if (!m_symbol.IsEmpty()) + if (!m_symbol.empty()) { m_symbolStaticCtrl->SetFont(font); m_symbolStaticCtrl->SetLabel(m_symbol); @@ -624,7 +642,7 @@ void wxSymbolPickerDialog::OnSymbolSelected( wxCommandEvent& event ) return; int sel = event.GetSelection(); - if (sel == -1) + if (sel == wxNOT_FOUND) m_symbol = wxEmptyString; else { @@ -702,7 +720,7 @@ void wxSymbolPickerDialog::SetUnicodeMode(bool unicodeMode) /// Get the selected symbol character int wxSymbolPickerDialog::GetSymbolChar() const { - if (m_symbol.IsEmpty()) + if (m_symbol.empty()) return -1; else return (int) m_symbol[0]; diff --git a/src/richtext/richtexttabspage.cpp b/src/richtext/richtexttabspage.cpp index 3d03a74a3b..f26a8dde2b 100644 --- a/src/richtext/richtexttabspage.cpp +++ b/src/richtext/richtexttabspage.cpp @@ -1,21 +1,27 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: richtexttabspage.cpp +// Name: src/richtext/richtexttabspage.cpp // Purpose: // Author: Julian Smart // Modified by: // Created: 10/4/2006 8:03:20 AM -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -////@begin includes -////@end includes +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" -#include "../../include/wx/richtext/richtexttabspage.h" +#ifdef __BORLANDC__ + #pragma hdrstop +#endif -////@begin XPM images -////@end XPM images +#if wxUSE_RICHTEXT + +#include "wx/richtext/richtexttabspage.h" + +#ifndef WX_PRECOMP +#endif /*! * wxRichTextTabsPage type definition @@ -117,7 +123,12 @@ void wxRichTextTabsPage::CreateControls() wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Position (tenths of a mm):"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - m_tabEditCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTTABSPAGE_TABEDIT, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); + m_tabEditCtrl = new wxTextCtrl( itemPanel1, + ID_RICHTEXTTABSPAGE_TABEDIT, + wxEmptyString, + wxDefaultPosition, + wxDefaultSize, + 0 ); itemBoxSizer5->Add(m_tabEditCtrl, 0, wxGROW|wxALL, 5); wxString* m_tabListCtrlStrings = NULL; @@ -129,7 +140,12 @@ void wxRichTextTabsPage::CreateControls() wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL); itemBoxSizer4->Add(itemBoxSizer10, 0, wxGROW, 5); - wxStaticText* itemStaticText11 = new wxStaticText( itemPanel1, wxID_STATIC, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText* itemStaticText11 = new wxStaticText( itemPanel1, + wxID_STATIC, + wxEmptyString, + wxDefaultPosition, + wxDefaultSize, + 0 ); itemBoxSizer10->Add(itemStaticText11, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxADJUST_MINSIZE, 5); wxButton* itemButton12 = new wxButton( itemPanel1, ID_RICHTEXTTABSPAGE_NEW_TAB, _("&New"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -263,7 +279,7 @@ wxIcon wxRichTextTabsPage::GetIconResource( const wxString& name ) void wxRichTextTabsPage::OnNewTabClick( wxCommandEvent& WXUNUSED(event) ) { wxString str = m_tabEditCtrl->GetValue(); - if (!str.IsEmpty() && str.IsNumber()) + if (!str.empty() && str.IsNumber()) { wxString s(wxString::Format(wxT("%d"), wxAtoi(str))); @@ -283,7 +299,7 @@ void wxRichTextTabsPage::OnNewTabUpdate( wxUpdateUIEvent& event ) // This may be a bit expensive - consider updating New button when text // changes in edit control wxString str = m_tabEditCtrl->GetValue(); - if (!str.IsEmpty() && str.IsNumber()) + if (!str.empty() && str.IsNumber()) { wxString s(wxString::Format(wxT("%d"), wxAtoi(str))); event.Enable(m_tabListCtrl->FindString(s) == wxNOT_FOUND); @@ -345,6 +361,8 @@ void wxRichTextTabsPage::OnDeleteAllTabsUpdate( wxUpdateUIEvent& event ) void wxRichTextTabsPage::OnTablistSelected( wxCommandEvent& WXUNUSED(event) ) { wxString str = m_tabListCtrl->GetStringSelection(); - if (!str.IsEmpty()) + if (!str.empty()) m_tabEditCtrl->SetValue(str); } + +#endif // wxUSE_RICHTEXT