diff --git a/build/aclocal/visibility.m4 b/build/aclocal/visibility.m4 index 52c97f9c8e..05f9b80dec 100644 --- a/build/aclocal/visibility.m4 +++ b/build/aclocal/visibility.m4 @@ -49,6 +49,11 @@ AC_DEFUN([WX_VISIBILITY], error this platform has no visibility; #endif + /* at the time of Xcode 4.1 / Clang 3, Clang++ still didn't have the bugs sorted out: */ + #if defined(__clang__) + clang compiler is still broken w.r.t. visibility; + #endif + extern __attribute__((__visibility__("hidden"))) int hiddenvar; extern __attribute__((__visibility__("default"))) int exportedvar; extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); diff --git a/configure b/configure index c79bdc5bb4..f602dbf16b 100755 --- a/configure +++ b/configure @@ -35001,6 +35001,11 @@ cat >>conftest.$ac_ext <<_ACEOF error this platform has no visibility; #endif + /* at the time of Xcode 4.1 / Clang 3, Clang++ still didn't have the bugs sorted out: */ + #if defined(__clang__) + clang compiler is still broken w.r.t. visibility; + #endif + extern __attribute__((__visibility__("hidden"))) int hiddenvar; extern __attribute__((__visibility__("default"))) int exportedvar; extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); diff --git a/docs/changes.txt b/docs/changes.txt index a0ca39762d..51b18681d4 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -440,10 +440,13 @@ Major new features in this release All: - Fix parsing of negated long options in wxCmdLineParser (roed_bis). +- Fix crash in wxArray::insert() overload taking iterator range (wsu). All (GUI): - Added documented, public wxNavigationEnabled<> class. +- Added wxTextCtrl::PositionToCoords() (Navaneeth). +- Added support for wxHELP button to wxMessageDialog. - Support float, double and file name values in wxGenericValidator (troelsk). - Fix keyboard navigation in wxGrid with hidden columns (ivan_14_32). - Add wxDataViewEvent::IsEditCancelled() (Allonii). @@ -453,6 +456,10 @@ All (GUI): OSX: - Implement wxRegion::Equal() (Dr.Acula). +- Implement wxFileType::GetOpenCommand(). +- wxGetOsVersion() now returns more sensible version numbers, e.g. 10 and 6 + for OS X 10.6. +- Added wxApp::MacOpenFiles and deprecated wxApp::MacOpenFile. GTK: @@ -461,6 +468,7 @@ GTK: MSW: - Added wxGCDC(wxEnhMetaFileDC) ctor (Marcin Wojdyr). +- Added wxTopLevelWindow::MSWGetSystemMenu(). 2.9.2: (released 2011-07-05) diff --git a/include/wx/affinematrix2d.h b/include/wx/affinematrix2d.h index dfd4969614..cb94be4da1 100644 --- a/include/wx/affinematrix2d.h +++ b/include/wx/affinematrix2d.h @@ -10,6 +10,10 @@ #ifndef _WX_AFFINEMATRIX2D_H_ #define _WX_AFFINEMATRIX2D_H_ +#include "wx/defs.h" + +#if wxUSE_GEOMETRY + #include "wx/affinematrix2dbase.h" // A simple implementation of wxAffineMatrix2DBase interface done entirely in @@ -42,4 +46,6 @@ private: wxDouble m_11, m_12, m_21, m_22, m_tx, m_ty; }; +#endif // wxUSE_GEOMETRY + #endif // _WX_AFFINEMATRIX2D_H_ diff --git a/include/wx/affinematrix2dbase.h b/include/wx/affinematrix2dbase.h index 9a70402e53..30b3256500 100644 --- a/include/wx/affinematrix2dbase.h +++ b/include/wx/affinematrix2dbase.h @@ -11,6 +11,9 @@ #define _WX_AFFINEMATRIX2DBASE_H_ #include "wx/defs.h" + +#if wxUSE_GEOMETRY + #include "wx/geometry.h" struct wxMatrix2D @@ -37,7 +40,7 @@ class WXDLLIMPEXP_CORE wxAffineMatrix2DBase public: wxAffineMatrix2DBase() {} virtual ~wxAffineMatrix2DBase() {} - + // sets the matrix to the respective values virtual void Set(const wxMatrix2D& mat2D, const wxPoint2DDouble& tr) = 0; @@ -119,4 +122,6 @@ protected: wxPoint2DDouble DoTransformDistance(const wxPoint2DDouble& p) const = 0; }; +#endif // wxUSE_GEOMETRY + #endif // _WX_AFFINEMATRIX2DBASE_H_ diff --git a/include/wx/containr.h b/include/wx/containr.h index 7cb13e8fc1..29dba36d6b 100644 --- a/include/wx/containr.h +++ b/include/wx/containr.h @@ -14,6 +14,11 @@ #include "wx/defs.h" +#ifndef wxHAS_NATIVE_TAB_TRAVERSAL + // We need wxEVT_XXX declarations in this case. + #include "wx/event.h" +#endif + class WXDLLIMPEXP_FWD_CORE wxWindow; class WXDLLIMPEXP_FWD_CORE wxWindowBase; @@ -116,9 +121,6 @@ protected: #else // !wxHAS_NATIVE_TAB_TRAVERSAL -class WXDLLIMPEXP_FWD_CORE wxFocusEvent; -class WXDLLIMPEXP_FWD_CORE wxNavigationKeyEvent; - // ---------------------------------------------------------------------------- // wxControlContainer for TAB navigation implemented in wx itself // ---------------------------------------------------------------------------- @@ -166,13 +168,13 @@ public: m_container.SetContainerWindow(this); #ifndef wxHAS_NATIVE_TAB_TRAVERSAL - Connect(wxEVT_NAVIGATION_KEY, + BaseWindowClass::Connect(wxEVT_NAVIGATION_KEY, wxNavigationKeyEventHandler(wxNavigationEnabled::OnNavigationKey)); - Connect(wxEVT_SET_FOCUS, + BaseWindowClass::Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(wxNavigationEnabled::OnFocus)); - Connect(wxEVT_CHILD_FOCUS, + BaseWindowClass::Connect(wxEVT_CHILD_FOCUS, wxChildFocusEventHandler(wxNavigationEnabled::OnChildFocus)); #endif // !wxHAS_NATIVE_TAB_TRAVERSAL } diff --git a/include/wx/ctrlsub.h b/include/wx/ctrlsub.h index 82a98dfdfb..76f8353220 100644 --- a/include/wx/ctrlsub.h +++ b/include/wx/ctrlsub.h @@ -395,41 +395,48 @@ private: wxClientDataType m_clientDataItemsType; }; -// this macro must (unfortunately) be used in any class deriving from both -// wxItemContainer and wxControl because otherwise there is ambiguity when -// calling GetClientXXX() functions -- the compiler can't choose between the -// two versions -#define wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST \ - void SetClientData(void *data) \ - { wxEvtHandler::SetClientData(data); } \ - void *GetClientData() const \ - { return wxEvtHandler::GetClientData(); } \ - void SetClientObject(wxClientData *data) \ - { wxEvtHandler::SetClientObject(data); } \ - wxClientData *GetClientObject() const \ - { return wxEvtHandler::GetClientObject(); } \ - void SetClientData(unsigned int n, void* clientData) \ - { wxItemContainer::SetClientData(n, clientData); } \ - void* GetClientData(unsigned int n) const \ - { return wxItemContainer::GetClientData(n); } \ - void SetClientObject(unsigned int n, wxClientData* clientData) \ - { wxItemContainer::SetClientObject(n, clientData); } \ - wxClientData* GetClientObject(unsigned int n) const \ - { return wxItemContainer::GetClientObject(n); } +// Inheriting directly from a wxWindow-derived class and wxItemContainer +// unfortunately introduces an ambiguity for all GetClientXXX() methods as they +// are inherited twice: the "global" versions from wxWindow and the per-item +// versions taking the index from wxItemContainer. +// +// So we need to explicitly resolve them and this helper template class is +// provided to do it. To use it, simply inherit from wxWindowWithItems instead of Window and Container interface directly. +template +class wxWindowWithItems : public W, public C +{ +public: + typedef W BaseWindowClass; + typedef C BaseContainerInterface; -class WXDLLIMPEXP_CORE wxControlWithItemsBase : public wxControl, - public wxItemContainer + wxWindowWithItems() { } + + void SetClientData(void *data) + { BaseWindowClass::SetClientData(data); } + void *GetClientData() const + { return BaseWindowClass::GetClientData(); } + void SetClientObject(wxClientData *data) + { BaseWindowClass::SetClientObject(data); } + wxClientData *GetClientObject() const + { return BaseWindowClass::GetClientObject(); } + + void SetClientData(unsigned int n, void* clientData) + { wxItemContainer::SetClientData(n, clientData); } + void* GetClientData(unsigned int n) const + { return wxItemContainer::GetClientData(n); } + void SetClientObject(unsigned int n, wxClientData* clientData) + { wxItemContainer::SetClientObject(n, clientData); } + wxClientData* GetClientObject(unsigned int n) const + { return wxItemContainer::GetClientObject(n); } +}; + +class WXDLLIMPEXP_CORE wxControlWithItemsBase : + public wxWindowWithItems { public: wxControlWithItemsBase() { } - // we have to redefine these functions here to avoid ambiguities in classes - // deriving from us which would arise otherwise because both base classses - // have the methods with the same names - hopefully, a smart compiler can - // optimize away these simple inline wrappers so we don't suffer much from - // this - wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST - // usually the controls like list/combo boxes have their own background // colour virtual bool ShouldInheritColours() const { return false; } diff --git a/include/wx/dataview.h b/include/wx/dataview.h index be3ce240a8..87bfcf12e2 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -81,10 +81,11 @@ extern WXDLLIMPEXP_DATA_ADV(const char) wxDataViewCtrlNameStr[]; class WXDLLIMPEXP_ADV wxDataViewItem { public: - wxDataViewItem( void* id = NULL ) - { m_id = id; } - wxDataViewItem( const wxDataViewItem &item ) - { m_id = item.m_id; } + wxDataViewItem() : m_id(NULL) {} + wxDataViewItem(const wxDataViewItem &item) : m_id(item.m_id) {} + + wxEXPLICIT wxDataViewItem(void* id) : m_id(id) {} + bool IsOk() const { return m_id != NULL; } void* GetID() const { return m_id; } operator const void* () const { return m_id; } diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index f56f2a5ffc..6e728635de 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -190,14 +190,6 @@ public: virtual void StartEditor( const wxDataViewItem & item, unsigned int column ); protected: - virtual int GetSelections( wxArrayInt & sel ) const; - virtual void SetSelections( const wxArrayInt & sel ); - virtual void Select( int row ); - virtual void Unselect( int row ); - virtual bool IsSelected( int row ) const; - virtual void SelectRange( int from, int to ); - virtual void UnselectRange( int from, int to ); - virtual void EnsureVisible( int row, int column ); virtual wxDataViewItem GetItemByRow( unsigned int row ) const; diff --git a/include/wx/generic/msgdlgg.h b/include/wx/generic/msgdlgg.h index f6583bd351..21db4aa32b 100644 --- a/include/wx/generic/msgdlgg.h +++ b/include/wx/generic/msgdlgg.h @@ -32,6 +32,7 @@ protected: void OnYes(wxCommandEvent& event); void OnNo(wxCommandEvent& event); + void OnHelp(wxCommandEvent& event); void OnCancel(wxCommandEvent& event); // can be overridden to provide more contents to the dialog diff --git a/include/wx/gtk/msgdlg.h b/include/wx/gtk/msgdlg.h index daab4caac9..8c0a7b095c 100644 --- a/include/wx/gtk/msgdlg.h +++ b/include/wx/gtk/msgdlg.h @@ -40,6 +40,7 @@ private: virtual wxString GetDefaultNoLabel() const; virtual wxString GetDefaultOKLabel() const; virtual wxString GetDefaultCancelLabel() const; + virtual wxString GetDefaultHelpLabel() const; // create the real GTK+ dialog: this is done from ShowModal() to allow // changing the message between constructing the dialog and showing it diff --git a/include/wx/gtk/textctrl.h b/include/wx/gtk/textctrl.h index 9db822c90b..336a5cfa2e 100644 --- a/include/wx/gtk/textctrl.h +++ b/include/wx/gtk/textctrl.h @@ -167,6 +167,8 @@ protected: virtual void DoSetValue(const wxString &value, int flags = 0); + virtual wxPoint DoPositionToCoords(long pos) const; + // wrappers hiding the differences between functions doing the same thing // for GtkTextView and GtkEntry (all of them use current window style to // set the given characteristic) diff --git a/include/wx/gtk1/combobox.h b/include/wx/gtk1/combobox.h index 1d4149e3a8..77d2502cac 100644 --- a/include/wx/gtk1/combobox.h +++ b/include/wx/gtk1/combobox.h @@ -34,7 +34,8 @@ extern WXDLLIMPEXP_BASE const wxChar* wxEmptyString; // wxComboBox //----------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxComboBox : public wxControl, public wxComboBoxBase +class WXDLLIMPEXP_CORE wxComboBox : + public wxWindowWithItems { public: inline wxComboBox() {} @@ -154,8 +155,6 @@ public: bool IsOwnGtkWindow( GdkWindow *window ); void DoApplyWidgetStyle(GtkRcStyle *style); - wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST - static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); diff --git a/include/wx/htmllbox.h b/include/wx/htmllbox.h index f610b8383f..1a941159dd 100644 --- a/include/wx/htmllbox.h +++ b/include/wx/htmllbox.h @@ -196,8 +196,8 @@ private: #define wxHLB_DEFAULT_STYLE wxBORDER_SUNKEN #define wxHLB_MULTIPLE wxLB_MULTIPLE -class WXDLLIMPEXP_HTML wxSimpleHtmlListBox : public wxHtmlListBox, - public wxItemContainer +class WXDLLIMPEXP_HTML wxSimpleHtmlListBox : + public wxWindowWithItems { DECLARE_ABSTRACT_CLASS(wxSimpleHtmlListBox) public: @@ -254,9 +254,6 @@ public: int GetSelection() const { return wxVListBox::GetSelection(); } - // see ctrlsub.h for more info about this: - wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST - // accessing strings // ----------------- diff --git a/include/wx/longlong.h b/include/wx/longlong.h index 7c76d5f677..19c580110e 100644 --- a/include/wx/longlong.h +++ b/include/wx/longlong.h @@ -1097,15 +1097,15 @@ WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &st namespace std { -template<> class numeric_limits - : public numeric_limits -{ -}; - -template<> class numeric_limits - : public numeric_limits -{ -}; +#ifdef __clang__ + // libstdc++ (used by Clang) uses struct for numeric_limits; unlike gcc, clang + // warns about this + template<> struct numeric_limits : public numeric_limits {}; + template<> struct numeric_limits : public numeric_limits {}; +#else + template<> class numeric_limits : public numeric_limits {}; + template<> class numeric_limits : public numeric_limits {}; +#endif } // namespace std diff --git a/include/wx/mdi.h b/include/wx/mdi.h index 37f0fa5208..6425de2253 100644 --- a/include/wx/mdi.h +++ b/include/wx/mdi.h @@ -176,6 +176,11 @@ public: // level windows too virtual bool IsTopLevel() const { return false; } + // In all ports keyboard navigation must stop at MDI child frame level and + // can't cross its boundary. Indicate this by overriding this function to + // return true. + virtual bool IsTopNavigationDomain() const { return true; } + protected: wxMDIParentFrame *m_mdiParent; }; diff --git a/include/wx/msgdlg.h b/include/wx/msgdlg.h index ca96fc7ff9..c3e8d9af4f 100644 --- a/include/wx/msgdlg.h +++ b/include/wx/msgdlg.h @@ -177,10 +177,16 @@ public: return true; } + virtual bool SetHelpLabel(const ButtonLabel& help) + { + DoSetCustomLabel(m_help, help); + return true; + } + // test if any custom labels were set bool HasCustomLabels() const { - return !(m_ok.empty() && m_cancel.empty() && + return !(m_ok.empty() && m_cancel.empty() && m_help.empty() && m_yes.empty() && m_no.empty()); } @@ -195,6 +201,8 @@ public: { return m_ok.empty() ? GetDefaultOKLabel() : m_ok; } wxString GetCancelLabel() const { return m_cancel.empty() ? GetDefaultCancelLabel() : m_cancel; } + wxString GetHelpLabel() const + { return m_help.empty() ? GetDefaultHelpLabel() : m_help; } // based on message dialog style, returns exactly one of: wxICON_NONE, // wxICON_ERROR, wxICON_WARNING, wxICON_QUESTION, wxICON_INFORMATION @@ -250,6 +258,7 @@ protected: const wxString& GetCustomYesLabel() const { return m_yes; } const wxString& GetCustomNoLabel() const { return m_no; } const wxString& GetCustomOKLabel() const { return m_ok; } + const wxString& GetCustomHelpLabel() const { return m_help; } const wxString& GetCustomCancelLabel() const { return m_cancel; } private: @@ -259,13 +268,15 @@ private: virtual wxString GetDefaultNoLabel() const { return wxGetTranslation("No"); } virtual wxString GetDefaultOKLabel() const { return wxGetTranslation("OK"); } virtual wxString GetDefaultCancelLabel() const { return wxGetTranslation("Cancel"); } + virtual wxString GetDefaultHelpLabel() const { return wxGetTranslation("Help"); } // labels for the buttons, initially empty meaning that the defaults should // be used, use GetYes/No/OK/CancelLabel() to access them wxString m_yes, m_no, m_ok, - m_cancel; + m_cancel, + m_help; wxDECLARE_NO_COPY_CLASS(wxMessageDialogBase); }; diff --git a/include/wx/msw/menu.h b/include/wx/msw/menu.h index 4c5e95f5ad..3ea8404309 100644 --- a/include/wx/msw/menu.h +++ b/include/wx/msw/menu.h @@ -61,6 +61,14 @@ public: virtual void SetTitle(const wxString& title); + // MSW-only methods + // ---------------- + + // Create a new menu from the given native HMENU. Takes ownership of the + // menu handle and will delete it when this object is destroyed. + static wxMenu *MSWNewFromHMENU(WXHMENU hMenu) { return new wxMenu(hMenu); } + + // implementation only from now on // ------------------------------- @@ -120,7 +128,14 @@ protected: virtual wxMenuItem* DoRemove(wxMenuItem *item); private: - // common part of all ctors + // This constructor is private, use MSWNewFromHMENU() to use it. + wxMenu(WXHMENU hMenu); + + // Common part of all ctors, it doesn't create a new HMENU. + void InitNoCreate(); + + // Common part of all ctors except of the one above taking a native menu + // handler: calls InitNoCreate() and also creates a new menu. void Init(); // common part of Append/Insert (behaves as Append is pos == (size_t)-1) diff --git a/include/wx/msw/printdlg.h b/include/wx/msw/printdlg.h index 754e212f9f..bcca2b91e9 100644 --- a/include/wx/msw/printdlg.h +++ b/include/wx/msw/printdlg.h @@ -20,6 +20,7 @@ #include "wx/printdlg.h" class WXDLLIMPEXP_FWD_CORE wxDC; +class WinPrinter; //---------------------------------------------------------------------------- // wxWindowsPrintNativeData @@ -37,6 +38,7 @@ public: virtual bool Ok() const { return IsOk(); } virtual bool IsOk() const; + void InitializeDevMode(const wxString &printerName = wxEmptyString, WinPrinter* printer = NULL); void* GetDevMode() const { return m_devMode; } void SetDevMode(void* data) { m_devMode = data; } void* GetDevNames() const { return m_devNames; } diff --git a/include/wx/msw/private/msgdlg.h b/include/wx/msw/private/msgdlg.h index 5df01fc10d..45db8702e7 100644 --- a/include/wx/msw/private/msgdlg.h +++ b/include/wx/msw/private/msgdlg.h @@ -30,8 +30,10 @@ namespace wxMSWMessageDialog class wxMSWTaskDialogConfig { public: + enum { MAX_BUTTONS = 4 }; + wxMSWTaskDialogConfig() - : buttons(new TASKDIALOG_BUTTON[3]), + : buttons(new TASKDIALOG_BUTTON[MAX_BUTTONS]), parent(NULL), iconId(0), style(0), @@ -53,6 +55,7 @@ namespace wxMSWMessageDialog wxString btnNoLabel; wxString btnOKLabel; wxString btnCancelLabel; + wxString btnHelpLabel; // Will create a task dialog with it's paremeters for it's creation // stored in the provided TASKDIALOGCONFIG parameter. diff --git a/include/wx/msw/textctrl.h b/include/wx/msw/textctrl.h index 888ea4c76b..f8fdf1f1a8 100644 --- a/include/wx/msw/textctrl.h +++ b/include/wx/msw/textctrl.h @@ -198,6 +198,8 @@ protected: virtual void DoSetValue(const wxString &value, int flags = 0); + virtual wxPoint DoPositionToCoords(long pos) const; + // return true if this control has a user-set limit on amount of text (i.e. // the limit is due to a previous call to SetMaxLength() and not built in) bool HasSpaceLimit(unsigned int *len) const; diff --git a/include/wx/msw/toplevel.h b/include/wx/msw/toplevel.h index 52905cc32a..39756b355b 100644 --- a/include/wx/msw/toplevel.h +++ b/include/wx/msw/toplevel.h @@ -77,6 +77,19 @@ public: virtual bool CanSetTransparent(); + // MSW-specific methods + // -------------------- + + // Return the menu representing the "system" menu of the window. You can + // call wxMenu::AppendWhatever() methods on it but removing items from it + // is in general not a good idea. + // + // The pointer returned by this method belongs to the window and will be + // deleted when the window itself is, do not delete it yourself. May return + // NULL if getting the system menu failed. + wxMenu *MSWGetSystemMenu() const; + + // implementation from now on // -------------------------- @@ -214,6 +227,10 @@ private: void* m_activateInfo; #endif + // The system menu: initially NULL but can be set (once) by + // MSWGetSystemMenu(). Owned by this window. + wxMenu *m_menuSystem; + DECLARE_EVENT_TABLE() wxDECLARE_NO_COPY_CLASS(wxTopLevelWindowMSW); }; diff --git a/include/wx/odcombo.h b/include/wx/odcombo.h index 4879c2bbfc..26415e8d24 100644 --- a/include/wx/odcombo.h +++ b/include/wx/odcombo.h @@ -233,15 +233,15 @@ private: // the wxComboCtrl. // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_ADV wxOwnerDrawnComboBox : public wxComboCtrl, - public wxItemContainer +class WXDLLIMPEXP_ADV wxOwnerDrawnComboBox : + public wxWindowWithItems { //friend class wxComboPopupWindow; friend class wxVListBoxComboPopup; public: // ctors and such - wxOwnerDrawnComboBox() : wxComboCtrl() { Init(); } + wxOwnerDrawnComboBox() { Init(); } wxOwnerDrawnComboBox(wxWindow *parent, wxWindowID id, @@ -253,7 +253,6 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr) - : wxComboCtrl() { Init(); @@ -339,8 +338,6 @@ public: virtual bool IsSorted() const { return HasFlag(wxCB_SORT); } - wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST - protected: virtual void DoClear(); virtual void DoDeleteOneItem(unsigned int n); diff --git a/include/wx/osx/app.h b/include/wx/osx/app.h index 47315c6b62..011d0dd021 100644 --- a/include/wx/osx/app.h +++ b/include/wx/osx/app.h @@ -122,7 +122,10 @@ public: virtual short MacHandleAEQuit(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ; virtual short MacHandleAERApp(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ; #endif - // in response of an open-document apple event + // in response of an openFiles message with Cocoa and an + // open-document apple event with Carbon + virtual void MacOpenFiles(const wxArrayString &fileNames) ; + // called by MacOpenFiles for each file. virtual void MacOpenFile(const wxString &fileName) ; // in response of a get-url apple event virtual void MacOpenURL(const wxString &url) ; diff --git a/include/wx/osx/combobox.h b/include/wx/osx/combobox.h index 8d875edd34..e814474732 100644 --- a/include/wx/osx/combobox.h +++ b/include/wx/osx/combobox.h @@ -26,12 +26,13 @@ class wxComboWidgetImpl; // Combobox item class WXDLLIMPEXP_CORE wxComboBox : + public wxWindowWithItems< #if wxOSX_USE_CARBON - public wxNavigationEnabled, + wxNavigationEnabled, #else - public wxControl, + wxControl, #endif - public wxComboBoxBase + wxComboBoxBase> { DECLARE_DYNAMIC_CLASS(wxComboBox) @@ -144,10 +145,6 @@ class WXDLLIMPEXP_CORE wxComboBox : virtual bool OSXHandleClicked( double timestampsec ); -#if wxOSX_USE_CARBON - wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST -#endif - #if wxOSX_USE_COCOA wxComboWidgetImpl* GetComboPeer() const; #endif diff --git a/include/wx/osx/core/mimetype.h b/include/wx/osx/core/mimetype.h index 3fc642ee99..f0758e7df4 100644 --- a/include/wx/osx/core/mimetype.h +++ b/include/wx/osx/core/mimetype.h @@ -56,6 +56,7 @@ private: bool GetMimeTypes(const wxString& uti, wxArrayString& mimeTypes); bool GetIcon(const wxString& uti, wxIconLocation *iconLoc); bool GetDescription(const wxString& uti, wxString *desc); + bool GetApplication(const wxString& uti, wxString *command); // Structure to represent file types typedef struct FileTypeData @@ -63,6 +64,7 @@ private: wxArrayString extensions; wxArrayString mimeTypes; wxIconLocation iconLoc; + wxString application; wxString description; } FileTypeInfo; @@ -95,9 +97,9 @@ public: bool GetMimeTypes(wxArrayString& mimeTypes) const ; bool GetIcon(wxIconLocation *iconLoc) const ; bool GetDescription(wxString *desc) const ; + bool GetOpenCommand(wxString *openCmd, const wxFileType::MessageParameters& params) const; // These functions are only stubs on Mac OS X - bool GetOpenCommand(wxString *openCmd, const wxFileType::MessageParameters& params) const; bool GetPrintCommand(wxString *printCmd, const wxFileType::MessageParameters& params) const; size_t GetAllCommands(wxArrayString *verbs, wxArrayString *commands, const wxFileType::MessageParameters& params) const; bool SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt = TRUE); diff --git a/include/wx/osx/msgdlg.h b/include/wx/osx/msgdlg.h index cad3de35b7..9c3d38067d 100644 --- a/include/wx/osx/msgdlg.h +++ b/include/wx/osx/msgdlg.h @@ -43,7 +43,7 @@ protected: void* ConstructNSAlert(); #endif - int m_buttonId[3]; + int m_buttonId[4]; int m_buttonCount; #if wxOSX_USE_COCOA diff --git a/include/wx/richtext/richtextfontpage.h b/include/wx/richtext/richtextfontpage.h index 9123be10ea..4a0d851626 100644 --- a/include/wx/richtext/richtextfontpage.h +++ b/include/wx/richtext/richtextfontpage.h @@ -134,7 +134,9 @@ public: wxComboBox* m_styleCtrl; wxComboBox* m_weightCtrl; wxComboBox* m_underliningCtrl; + wxCheckBox* m_textColourLabel; wxRichTextColourSwatchCtrl* m_colourCtrl; + wxCheckBox* m_bgColourLabel; wxRichTextColourSwatchCtrl* m_bgColourCtrl; wxCheckBox* m_strikethroughCtrl; wxCheckBox* m_capitalsCtrl; @@ -151,7 +153,9 @@ public: ID_RICHTEXTFONTPAGE_STYLECTRL = 10007, ID_RICHTEXTFONTPAGE_WEIGHTCTRL = 10004, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL = 10008, + ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL = 10015, ID_RICHTEXTFONTPAGE_COLOURCTRL = 10009, + ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL = 10016, ID_RICHTEXTFONTPAGE_BGCOLOURCTRL = 10014, ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL = 10010, ID_RICHTEXTFONTPAGE_CAPSCTRL = 10011, diff --git a/include/wx/richtext/richtextindentspage.h b/include/wx/richtext/richtextindentspage.h index 0e734dea80..eaebc469a4 100644 --- a/include/wx/richtext/richtextindentspage.h +++ b/include/wx/richtext/richtextindentspage.h @@ -141,6 +141,7 @@ public: wxTextCtrl* m_spacingBefore; wxTextCtrl* m_spacingAfter; wxComboBox* m_spacingLine; + wxCheckBox* m_pageBreakCtrl; wxRichTextCtrl* m_previewCtrl; /// Control identifiers enum { @@ -157,6 +158,7 @@ public: ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE = 10114, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER = 10116, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE = 10115, + ID_RICHTEXTINDENTSSPACINGPAGE_PAGEBREAK = 10106, ID_RICHTEXTINDENTSSPACINGPAGE_PREVIEW_CTRL = 10109 }; ////@end wxRichTextIndentsSpacingPage member variables diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index f26cb8aa10..d412a3dc43 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -574,6 +574,11 @@ public: virtual long XYToPosition(long x, long y) const = 0; virtual bool PositionToXY(long pos, long *x, long *y) const = 0; + // translate the given position (which is just an index in the text control) + // to client coordinates + wxPoint PositionToCoords(long pos) const; + + virtual void ShowPosition(long pos) = 0; // find the character at position given in pixels @@ -592,6 +597,13 @@ protected: virtual bool DoLoadFile(const wxString& file, int fileType); virtual bool DoSaveFile(const wxString& file, int fileType); + // Return true if the given position is valid, i.e. positive and less than + // the last position. + virtual bool IsValidPosition(long pos) const = 0; + + // Default stub implementation of PositionToCoords() always returns + // wxDefaultPosition. + virtual wxPoint DoPositionToCoords(long pos) const; // the name of the last file loaded with LoadFile() which will be used by // SaveFile() by default @@ -625,6 +637,12 @@ public: wxTextEntryBase::SetValue(value); } +protected: + virtual bool IsValidPosition(long pos) const + { + return pos >= 0 && pos <= GetLastPosition(); + } + private: wxDECLARE_NO_COPY_CLASS(wxTextCtrlIface); }; @@ -723,6 +741,12 @@ protected: virtual bool DoLoadFile(const wxString& file, int fileType); virtual bool DoSaveFile(const wxString& file, int fileType); + // Another wxTextAreaBase override. + virtual bool IsValidPosition(long pos) const + { + return pos >= 0 && pos <= GetLastPosition(); + } + // implement the wxTextEntry pure virtual method virtual wxWindow *GetEditableWindow() { return this; } diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h index bf8123e5ab..28a56fe596 100644 --- a/include/wx/toplevel.h +++ b/include/wx/toplevel.h @@ -282,6 +282,7 @@ public: // override some base class virtuals virtual bool Destroy(); virtual bool IsTopLevel() const { return true; } + virtual bool IsTopNavigationDomain() const { return true; } virtual bool IsVisible() const { return IsShown(); } // event handlers diff --git a/include/wx/univ/combobox.h b/include/wx/univ/combobox.h index 93b3128633..04343ac4fe 100644 --- a/include/wx/univ/combobox.h +++ b/include/wx/univ/combobox.h @@ -34,7 +34,8 @@ class WXDLLIMPEXP_FWD_CORE wxListBox; // NB: Normally we'd like wxComboBox to inherit from wxComboBoxBase, but here // we can't really do that since both wxComboBoxBase and wxComboCtrl inherit // from wxTextCtrl. -class WXDLLIMPEXP_CORE wxComboBox : public wxComboCtrl, public wxItemContainer +class WXDLLIMPEXP_CORE wxComboBox : + public wxWindowWithItems { public: // ctors and such @@ -141,8 +142,6 @@ public: virtual int GetSelection() const; virtual wxString GetStringSelection() const; - wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST - // we have our own input handler and our own actions // (but wxComboCtrl already handled Popup/Dismiss) /* diff --git a/include/wx/window.h b/include/wx/window.h index 07f1f084bb..31ffe5332b 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -1422,6 +1422,15 @@ public: virtual wxWindow *GetMainWindowOfCompositeControl() { return (wxWindow*)this; } + // If this function returns true, keyboard navigation events shouldn't + // escape from it. A typical example of such "navigation domain" is a top + // level window because pressing TAB in one of them must not transfer focus + // to a different top level window. But it's not limited to them, e.g. MDI + // children frames are not top level windows (and their IsTopLevel() + // returns false) but still are self-contained navigation domains as well. + virtual bool IsTopNavigationDomain() const { return false; } + + protected: // helper for the derived class Create() methods: the first overload, with // validator parameter, should be used for child windows while the second diff --git a/include/wx/wxcrt.h b/include/wx/wxcrt.h index 2c5dd24b50..2dc22cd2a2 100644 --- a/include/wx/wxcrt.h +++ b/include/wx/wxcrt.h @@ -467,7 +467,7 @@ WX_STRCMP_FUNC(wxStricmp, wxCRT_StricmpA, wxCRT_StricmpW, wxStricmp_String) // forward-declare the template and implement it below WX_STRCMP_FUNC. OTOH, // this fails to compile with VC6, so don't do it for VC. It also causes // problems with GCC visibility in newer GCC versions. -#if !(defined(__VISUALC__) || wxCHECK_GCC_VERSION(3,5)) || defined(__clang__) +#if !(defined(__VISUALC__) || (wxCHECK_GCC_VERSION(3,5) && !wxCHECK_GCC_VERSION(4,7))) || defined(__clang__) #define wxNEEDS_DECL_BEFORE_TEMPLATE #endif diff --git a/interface/wx/animate.h b/interface/wx/animate.h index 5b4e5b5cde..19716e2c99 100644 --- a/interface/wx/animate.h +++ b/interface/wx/animate.h @@ -228,11 +228,17 @@ public: /** Returns the i-th frame as a wxImage. + + This method is not implemented in the native wxGTK implementation of + this class and always returns an invalid image there. */ virtual wxImage GetFrame(unsigned int i) const; /** Returns the number of frames for this animation. + + This method is not implemented in the native wxGTK implementation of + this class and always returns 0 there. */ virtual unsigned int GetFrameCount() const; diff --git a/interface/wx/app.h b/interface/wx/app.h index f3530be291..d5badd57d1 100644 --- a/interface/wx/app.h +++ b/interface/wx/app.h @@ -569,7 +569,7 @@ public: Under Windows and Linux/Unix, you should parse the command line arguments and check for files to be opened when starting your - application. Under OS X, you need to override MacOpenFile() + application. Under OS X, you need to override MacOpenFiles() since command line arguments are used differently there. You may use the wxCmdLineParser to parse command line arguments. @@ -802,16 +802,35 @@ public: */ virtual void MacNewFile(); + /** + Called in response of an openFiles message with Cocoa, or an + "open-document" Apple event with Carbon. + + You need to override this method in order to open one or more document + files after the user double clicked on it or if the files and/or + folders were dropped on either the application in the dock or the + application icon in Finder. + + By default this method calls MacOpenFile for each file/folder. + + @onlyfor{wxosx} + + @since 2.9.3 + */ + virtual void MacOpenFiles(const wxArrayString& fileNames); + /** Called in response of an "open-document" Apple event. - You need to override this method in order to open a document file after the - user double clicked on it or if the document file was dropped on either the - running application or the application icon in Finder. + @deprecated + This function is kept mostly for backwards compatibility. Please + override wxApp::MacOpenFiles method instead in any new code. @onlyfor{wxosx} */ - virtual void MacOpenFile(const wxString& fileName); + wxDEPRECATED_BUT_USED_INTERNALLY( + virtual void MacOpenFile(const wxString& fileName) + ); /** Called in response of a "get-url" Apple event. diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index 8779ef96f9..9c24be7d76 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -421,7 +421,7 @@ public: unsigned int col) const; /** - Returns the number of items (i.e. rows) in the list. + Returns the number of items (or rows) in the list. */ unsigned int GetCount() const; @@ -614,8 +614,9 @@ public: /** Constructor. */ - wxDataViewItem(void* id = NULL); + wxDataViewItem(); wxDataViewItem(const wxDataViewItem& item); + explicit wxDataViewItem(void* id); //@} /** diff --git a/interface/wx/msgdlg.h b/interface/wx/msgdlg.h index 0448b04366..70aba8cca1 100644 --- a/interface/wx/msgdlg.h +++ b/interface/wx/msgdlg.h @@ -22,6 +22,12 @@ Puts Yes and No buttons in the message box. It is recommended to always use @c wxCANCEL with this style as otherwise the message box won't have a close button under wxMSW and the user will be forced to answer it. + @style{wxHELP} + Puts a Help button to the message box. This button can have special + appearance or be specially positioned if its label is not changed from + the default one. Notice that using this button is not supported when + showing a message box from non-main thread in wxOSX/Cocoa and it is not + supported in wxOSX/Carbon at all. @since 2.9.3. @style{wxNO_DEFAULT} Makes the "No" button default, can only be used with @c wxYES_NO. @style{wxCANCEL_DEFAULT} @@ -116,6 +122,19 @@ public: */ virtual void SetExtendedMessage(const wxString& extendedMessage); + /** + Sets the label for the Help button. + + Please see the remarks in SetYesNoLabels() documentation. + + Notice that changing the label of the help button resets its special + status (if any, this depends on the platform) and it will be treated + just like another button in this case. + + @since 2.9.3 + */ + virtual bool SetHelpLabel(const ButtonLabel& help); + /** Sets the message shown by the dialog. @@ -190,7 +209,8 @@ public: virtual bool SetYesNoLabels(const ButtonLabel& yes, const ButtonLabel& no); /** - Shows the dialog, returning one of wxID_OK, wxID_CANCEL, wxID_YES, wxID_NO. + Shows the dialog, returning one of wxID_OK, wxID_CANCEL, wxID_YES, + wxID_NO or wxID_HELP. Notice that this method returns the identifier of the button which was clicked unlike wxMessageBox() function. @@ -215,9 +235,9 @@ public: extended text and custom labels for the message box buttons, are not provided by this function but only by wxMessageDialog. - The return value is one of: @c wxYES, @c wxNO, @c wxCANCEL or @c wxOK - (notice that this return value is @b different from the return value of - wxMessageDialog::ShowModal()). + The return value is one of: @c wxYES, @c wxNO, @c wxCANCEL, @c wxOK or @c + wxHELP (notice that this return value is @b different from the return value + of wxMessageDialog::ShowModal()). For example: @code diff --git a/interface/wx/stdpaths.h b/interface/wx/stdpaths.h index 4d25136413..b4f577662f 100644 --- a/interface/wx/stdpaths.h +++ b/interface/wx/stdpaths.h @@ -12,6 +12,13 @@ wxStandardPaths returns the standard locations in the file system and should be used by applications to find their data files in a portable way. + Note that you must not create objects of class wxStandardPaths directly, + but use the global standard paths object returned by wxStandardPaths::Get() + (which can be of a type derived from wxStandardPaths and not of exactly + this type) and call the methods you need on it. The object returned by + Get() may be customized by overriding wxAppTraits::GetStandardPaths() + methods. + In the description of the methods below, the example return values are given for the Unix, Windows and Mac OS X systems, however please note that these are just the examples and the actual values may differ. For example, under Windows: @@ -42,10 +49,6 @@ This class is MT-safe: its methods may be called concurrently from different threads without additional locking. - Note that you don't allocate an instance of class wxStandardPaths, but retrieve the - global standard paths object using @c wxStandardPaths::Get on which you call the - desired methods. - @library{wxbase} @category{file} diff --git a/interface/wx/textctrl.h b/interface/wx/textctrl.h index 746954eca8..c17e10f917 100644 --- a/interface/wx/textctrl.h +++ b/interface/wx/textctrl.h @@ -220,11 +220,6 @@ public: bool Apply(const wxTextAttr& style, const wxTextAttr* compareWith = NULL); - /** - Creates a font from the font attributes. - */ - wxFont CreateFont() const; - /** Copies all defined/valid properties from overlay to current object. */ @@ -1197,19 +1192,15 @@ public: /** Returns the number of lines in the text control buffer. + The returned number is the number of logical lines, i.e. just the count + of the number of newline characters in the control + 1, for wxGTK and + wxOSX/Cocoa ports while it is the number of physical lines, i.e. the + count of lines actually shown in the control, in wxMSW and wxOSX/Carbon. + Because of this discrepancy, it is not recommended to use this function. + @remarks Note that even empty text controls have one line (where the insertion point is), so GetNumberOfLines() never returns 0. - For wxGTK using GTK+ 1.2.x and earlier, the number of lines in a - multi-line text control is calculated by actually counting newline - characters in the buffer, i.e. this function returns the number of - logical lines and doesn't depend on whether any of them are wrapped. - For all the other platforms, the number of physical lines in the - control is returned. - Also note that you may wish to avoid using functions that work with - line numbers if you are working with controls that contain large - amounts of text as this function has O(N) complexity for N being - the number of lines. */ virtual int GetNumberOfLines() const; @@ -1348,6 +1339,28 @@ public: */ virtual bool PositionToXY(long pos, long* x, long* y) const; + /** + Converts given text position to client coordinates in pixels. + + This function allows to find where is the character at the given + position displayed in the text control. + + @onlyfor{wxmsw,wxgtk}. Additionally, wxGTK only implements this method + for multiline controls and ::wxDefaultPosition is always returned for + the single line ones. + + @param pos + Text position in 0 to GetLastPosition() range (inclusive). + @return + On success returns a wxPoint which contains client coordinates for + the given position in pixels, otherwise returns ::wxDefaultPosition. + + @since 2.9.3 + + @see XYToPosition(), PositionToXY() + */ + wxPoint PositionToCoords(long pos) const; + /** Saves the contents of the control in a text file. diff --git a/interface/wx/toplevel.h b/interface/wx/toplevel.h index 55be716a7d..32e09f7e6f 100644 --- a/interface/wx/toplevel.h +++ b/interface/wx/toplevel.h @@ -262,6 +262,33 @@ public: */ virtual void Maximize(bool maximize = true); + /** + MSW-specific function for accessing the system menu. + + Returns a wxMenu pointer representing the system menu of the window + under MSW. The returned wxMenu may be used, if non-@c NULL, to add + extra items to the system menu. The usual @c wxEVT_COMMAND_MENU_SELECTED + events (that can be processed using @c EVT_MENU event table macro) will + then be generated for them. All the other wxMenu methods may be used as + well but notice that they won't allow you to access any standard system + menu items (e.g. they can't be deleted or modified in any way + currently). + + Notice that because of the native system limitations the identifiers of + the items added to the system menu must be multiples of 16, otherwise + no events will be generated for them. + + The returned pointer must @em not be deleted, it is owned by the window + and will be only deleted when the window itself is destroyed. + + This function is not available in the other ports by design, any + occurrences of it in the portable code must be guarded by @code #ifdef + __WXMSW__ @endcode preprocessor guards. + + @since 2.9.3 + */ + wxMenu *MSWGetSystemMenu() const; + /** Use a system-dependent way to attract users attention to the window when it is in background. diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 335cc16ca2..eeeecdac1f 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -648,6 +648,24 @@ MyFrame::MyFrame(const wxString& title) // covers our entire client area to avoid jarring colour jumps SetOwnBackgroundColour(m_canvas->GetBackgroundColour()); #endif // wxUSE_INFOBAR + +#ifdef __WXMSW__ + // Test MSW-specific function allowing to access the "system" menu. + wxMenu * const menu = MSWGetSystemMenu(); + if ( menu ) + { + menu->AppendSeparator(); + + // The ids of the menu commands in MSW system menu must be multiple of + // 16 so we can't use DIALOGS_ABOUTDLG_SIMPLE here because it might not + // satisfy this condition and need to define and connect a separate id. + static const int DIALOGS_SYSTEM_ABOUT = 0x4010; + + menu->Append(DIALOGS_SYSTEM_ABOUT, "&About..."); + Connect(DIALOGS_SYSTEM_ABOUT, wxEVT_COMMAND_MENU_SELECTED, + wxCommandEventHandler(MyFrame::ShowSimpleAboutDialog)); + } +#endif // __WXMSW__ } MyFrame::~MyFrame() @@ -2669,6 +2687,7 @@ const TestMessageBoxDialog::BtnInfo TestMessageBoxDialog::ms_btnInfo[] = { wxNO, "&No" }, { wxOK, "&Ok" }, { wxCANCEL, "&Cancel" }, + { wxHELP, "&Help" }, }; BEGIN_EVENT_TABLE(TestMessageBoxDialog, wxDialog) @@ -2889,6 +2908,11 @@ void TestMessageBoxDialog::PrepareMessageDialog(wxMessageDialogBase &dlg) dlg.SetOKLabel(m_labels[Btn_Ok]->GetValue()); } } + + if ( style & wxHELP ) + { + dlg.SetHelpLabel(m_labels[Btn_Help]->GetValue()); + } } void TestMessageBoxDialog::OnApply(wxCommandEvent& WXUNUSED(event)) @@ -2896,7 +2920,34 @@ void TestMessageBoxDialog::OnApply(wxCommandEvent& WXUNUSED(event)) wxMessageDialog dlg(this, GetMessage(), "Test Message Box", GetStyle()); PrepareMessageDialog(dlg); - dlg.ShowModal(); + wxString btnName; + switch ( dlg.ShowModal() ) + { + case wxID_OK: + btnName = "OK"; + break; + + case wxID_CANCEL: + // Avoid the extra message box if the dialog was cancelled. + return; + + case wxID_YES: + btnName = "Yes"; + break; + + case wxID_NO: + btnName = "No"; + break; + + case wxID_HELP: + btnName = "Help"; + break; + + default: + btnName = "Unknown"; + } + + wxLogMessage("Dialog was closed with the \"%s\" button.", btnName); } void TestMessageBoxDialog::OnClose(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/dialogs/dialogs.h b/samples/dialogs/dialogs.h index fbad49919a..61dd0f85aa 100644 --- a/samples/dialogs/dialogs.h +++ b/samples/dialogs/dialogs.h @@ -228,6 +228,7 @@ private: Btn_No, Btn_Ok, Btn_Cancel, + Btn_Help, Btn_Max }; diff --git a/samples/html/helpview/helpview.cpp b/samples/html/helpview/helpview.cpp index f0fba2d056..6f62d33763 100644 --- a/samples/html/helpview/helpview.cpp +++ b/samples/html/helpview/helpview.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: printing.cpp +// Name: helpview.cpp // Purpose: wxHtml sample: help browser // Author: ? // Modified by: diff --git a/samples/mediaplayer/mediaplayer.cpp b/samples/mediaplayer/mediaplayer.cpp index 1ca1da55f6..1d1698363e 100644 --- a/samples/mediaplayer/mediaplayer.cpp +++ b/samples/mediaplayer/mediaplayer.cpp @@ -143,7 +143,7 @@ class wxMediaPlayerApp : public wxApp { public: #ifdef __WXMAC__ - virtual void MacOpenFile(const wxString & fileName ); + virtual void MacOpenFiles(const wxArrayString & fileNames ); #endif virtual bool OnInit(); @@ -463,10 +463,10 @@ bool wxMediaPlayerApp::OnInit() #ifdef __WXMAC__ -void wxMediaPlayerApp::MacOpenFile(const wxString & fileName ) +void wxMediaPlayerApp::MacOpenFiles(const wxArrayString & fileNames ) { - // Called when a user drags a file over our app - m_frame->DoOpenFile(fileName, true /* new page */); + // Called when a user drags files over our app + m_frame->DoOpenFile(fileNames[0], true /* new page */); } #endif // __WXMAC__ diff --git a/samples/text/text.cpp b/samples/text/text.cpp index 6c3ddf400a..d25968ce9e 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -128,6 +128,7 @@ public: void DoSelectText(); void DoMoveToEndOfText(); void DoMoveToEndOfEntry(); + void DoGetWindowCoordinates(); // return true if currently text control has any selection bool HasSelection() const @@ -217,6 +218,10 @@ public: void OnMoveToEndOfText( wxCommandEvent& WXUNUSED(event) ) { m_panel->DoMoveToEndOfText(); } + + void OnGetWindowCoordinates( wxCommandEvent& WXUNUSED(event) ) + { m_panel->DoGetWindowCoordinates(); } + void OnMoveToEndOfEntry( wxCommandEvent& WXUNUSED(event) ) { m_panel->DoMoveToEndOfEntry(); } @@ -415,6 +420,7 @@ enum TEXT_ADD_FREEZE, TEXT_ADD_LINE, TEXT_MOVE_ENDTEXT, + TEXT_GET_WINDOW_COORD, TEXT_MOVE_ENDENTRY, TEXT_SET_EDITABLE, TEXT_SET_ENABLED, @@ -513,6 +519,7 @@ bool MyApp::OnInit() menuText->Append(TEXT_LINE_UP, wxT("Scroll text one line up")); menuText->Append(TEXT_PAGE_DOWN, wxT("Scroll text one page down")); menuText->Append(TEXT_PAGE_UP, wxT("Scroll text one page up")); + menuText->Append(TEXT_GET_WINDOW_COORD, wxT("Get window coordinates")); menuText->AppendSeparator(); menuText->Append(TEXT_GET_LINE, wxT("Get the text of a line of the tabbed multiline")); menuText->Append(TEXT_GET_LINELENGTH, wxT("Get the length of a line of the tabbed multiline")); @@ -1318,6 +1325,18 @@ void MyPanel::DoMoveToEndOfText() m_multitext->SetFocus(); } +void MyPanel::DoGetWindowCoordinates() +{ + wxTextCtrl * const text = GetFocusedText(); + + const wxPoint pt0 = text->PositionToCoords(0); + const wxPoint ptCur = text->PositionToCoords(text->GetInsertionPoint()); + *m_log << "Current position coordinates: " + "(" << ptCur.x << ", " << ptCur.y << "), " + "first position coordinates: " + "(" << pt0.x << ", " << pt0.y << ")\n"; +} + void MyPanel::DoMoveToEndOfEntry() { m_text->SetInsertionPointEnd(); @@ -1380,6 +1399,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(TEXT_ADD_FREEZE, MyFrame::OnAddTextFreeze) EVT_MENU(TEXT_ADD_LINE, MyFrame::OnAddTextLine) EVT_MENU(TEXT_MOVE_ENDTEXT, MyFrame::OnMoveToEndOfText) + EVT_MENU(TEXT_GET_WINDOW_COORD, MyFrame::OnGetWindowCoordinates) EVT_MENU(TEXT_MOVE_ENDENTRY, MyFrame::OnMoveToEndOfEntry) EVT_MENU(TEXT_SET_EDITABLE, MyFrame::OnSetEditable) diff --git a/src/common/accelcmn.cpp b/src/common/accelcmn.cpp index 4d05f3de4d..f52fc05de3 100644 --- a/src/common/accelcmn.cpp +++ b/src/common/accelcmn.cpp @@ -307,7 +307,7 @@ wxString wxAcceleratorEntry::ToString() const int flags = GetFlags(); if ( flags & wxACCEL_ALT ) text += _("Alt+"); - if ( flags & wxACCEL_CTRL ) + if ( flags & (wxACCEL_CTRL | wxACCEL_CMD) ) text += _("Ctrl+"); if ( flags & wxACCEL_SHIFT ) text += _("Shift+"); diff --git a/src/common/affinematrix2d.cpp b/src/common/affinematrix2d.cpp index 977f6834ad..b4605d4e53 100644 --- a/src/common/affinematrix2d.cpp +++ b/src/common/affinematrix2d.cpp @@ -13,6 +13,8 @@ #pragma hdrstop #endif +#if wxUSE_GEOMETRY + #include "wx/affinematrix2d.h" #include "wx/math.h" @@ -177,3 +179,5 @@ bool wxAffineMatrix2D::IsIdentity() const m_21 == 0 && m_22 == 1 && m_tx == 0 && m_ty == 0; } + +#endif // wxUSE_GEOMETRY diff --git a/src/common/containr.cpp b/src/common/containr.cpp index 29756da696..2fda844c96 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -472,18 +472,21 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event ) // looping inside this panel (normally, the focus will go to // the next/previous item after this panel in the parent // panel). - wxWindow *focussed_child_of_parent = m_winParent; + wxWindow *focusedParent = m_winParent; while ( parent ) { - // we don't want to tab into a different dialog or frame - if ( focussed_child_of_parent->IsTopLevel() ) + // We don't want to tab into a different dialog or frame or + // even an MDI child frame, so test for this explicitly + // (and in particular don't just use IsTopLevel() which + // would return false in the latter case). + if ( focusedParent->IsTopNavigationDomain() ) break; - event.SetCurrentFocus( focussed_child_of_parent ); + event.SetCurrentFocus( focusedParent ); if ( parent->GetEventHandler()->ProcessEvent( event ) ) return; - focussed_child_of_parent = parent; + focusedParent = parent; parent = parent->GetParent(); } diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 611d3b1d5a..c5540283fc 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -387,7 +387,7 @@ wxDataViewIndexListModel::wxDataViewIndexListModel( unsigned int initial_size ) // build initial index unsigned int i; for (i = 1; i < initial_size+1; i++) - m_hash.Add( wxUIntToPtr(i) ); + m_hash.Add( wxDataViewItem(wxUIntToPtr(i)) ); m_nextFreeID = initial_size + 1; } @@ -403,7 +403,7 @@ void wxDataViewIndexListModel::Reset( unsigned int new_size ) // build initial index unsigned int i; for (i = 1; i < new_size+1; i++) - m_hash.Add( wxUIntToPtr(i) ); + m_hash.Add( wxDataViewItem(wxUIntToPtr(i)) ); m_nextFreeID = new_size + 1; @@ -417,8 +417,8 @@ void wxDataViewIndexListModel::RowPrepended() unsigned int id = m_nextFreeID; m_nextFreeID++; - m_hash.Insert( wxUIntToPtr(id), 0 ); wxDataViewItem item( wxUIntToPtr(id) ); + m_hash.Insert( item, 0 ); ItemAdded( wxDataViewItem(0), item ); } @@ -430,8 +430,8 @@ void wxDataViewIndexListModel::RowInserted( unsigned int before ) unsigned int id = m_nextFreeID; m_nextFreeID++; - m_hash.Insert( wxUIntToPtr(id), before ); wxDataViewItem item( wxUIntToPtr(id) ); + m_hash.Insert( item, before ); ItemAdded( wxDataViewItem(0), item ); } @@ -440,8 +440,8 @@ void wxDataViewIndexListModel::RowAppended() unsigned int id = m_nextFreeID; m_nextFreeID++; - m_hash.Add( wxUIntToPtr(id) ); wxDataViewItem item( wxUIntToPtr(id) ); + m_hash.Add( item ); ItemAdded( wxDataViewItem(0), item ); } @@ -490,7 +490,7 @@ unsigned int wxDataViewIndexListModel::GetRow( const wxDataViewItem &item ) cons return wxPtrToUInt(item.GetID())-1; // assert for not found - return (unsigned int) m_hash.Index( item.GetID() ); + return (unsigned int) m_hash.Index( item ); } wxDataViewItem wxDataViewIndexListModel::GetItem( unsigned int row ) const @@ -2005,7 +2005,7 @@ wxDataViewItem wxDataViewTreeStore::GetNthChild( const wxDataViewItem& parent, u wxDataViewTreeStoreNodeList::compatibility_iterator node = parent_node->GetChildren().Item( pos ); if (node) - return node->GetData(); + return wxDataViewItem(node->GetData()); return wxDataViewItem(0); } @@ -2111,7 +2111,7 @@ void wxDataViewTreeStore::DeleteChildren( const wxDataViewItem& item ) void wxDataViewTreeStore::DeleteAllItems() { - DeleteChildren(m_root); + DeleteChildren(wxDataViewItem(m_root)); } void diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index d1e8ddea76..a8b4420651 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -35,6 +35,7 @@ #ifndef WX_PRECOMP #include "wx/math.h" #include "wx/module.h" + #include "wx/window.h" #endif #ifdef __WXMSW__ diff --git a/src/common/dynarray.cpp b/src/common/dynarray.cpp index 86a106d556..8d62ca6b06 100644 --- a/src/common/dynarray.cpp +++ b/src/common/dynarray.cpp @@ -358,6 +358,9 @@ void name::insert(iterator it, const_iterator first, const_iterator last) \ return; \ Grow(nInsert); \ \ + /* old iterator could have been invalidated by Grow(). */ \ + it = begin() + nIndex; \ + \ memmove(&m_pItems[nIndex + nInsert], &m_pItems[nIndex], \ (m_nCount - nIndex)*sizeof(T)); \ for (size_t i = 0; i < nInsert; ++i, ++it, ++first) \ diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 64803df7a4..36a9dc1090 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -1297,17 +1297,31 @@ wxSocketEventFlags wxSocketImpl::Select(wxSocketEventFlags flags, exceptfds; // always want to know about errors if ( flags & wxSOCKET_INPUT_FLAG ) - { preadfds = &readfds; + + if ( flags & wxSOCKET_OUTPUT_FLAG ) + pwritefds = &writefds; + + // When using non-blocking connect() the client socket becomes connected + // (successfully or not) when it becomes writable but when using + // non-blocking accept() the server socket becomes connected when it + // becomes readable. + if ( flags & wxSOCKET_CONNECTION_FLAG ) + { + if ( m_server ) + preadfds = &readfds; + else + pwritefds = &writefds; + } + + if ( preadfds ) + { wxFD_ZERO(preadfds); wxFD_SET(m_fd, preadfds); } - // when using non-blocking connect() the socket becomes connected - // (successfully or not) when it becomes writable - if ( flags & (wxSOCKET_OUTPUT_FLAG | wxSOCKET_CONNECTION_FLAG) ) + if ( pwritefds ) { - pwritefds = &writefds; wxFD_ZERO(pwritefds); wxFD_SET(m_fd, pwritefds); } diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index 96f70e5d47..9e04aedcaa 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -1084,6 +1084,19 @@ wxTextAreaBase::HitTest(const wxPoint& WXUNUSED(pt), long * WXUNUSED(pos)) const return wxTE_HT_UNKNOWN; } +wxPoint wxTextAreaBase::PositionToCoords(long pos) const +{ + wxCHECK_MSG( IsValidPosition(pos), wxDefaultPosition, + wxS("Position argument out of range.") ); + + return DoPositionToCoords(pos); +} + +wxPoint wxTextAreaBase::DoPositionToCoords(long WXUNUSED(pos)) const +{ + return wxDefaultPosition; +} + #else // !wxUSE_TEXTCTRL // define this one even if !wxUSE_TEXTCTRL because it is also used by other diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 6e9a224e9d..4ff8dade7a 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -1361,6 +1361,8 @@ int wxMessageBox(const wxString& message, const wxString& caption, long style, return wxNO; case wxID_CANCEL: return wxCANCEL; + case wxID_HELP: + return wxHELP; } wxFAIL_MSG( wxT("unexpected return code from wxMessageDialog") ); diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index bdc389ad66..ea10aece55 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -388,6 +388,21 @@ public: } } + // returns node corresponding to 'item' if its in m_nodes or NULL otherwise + wxDataViewTreeNode *FindItemAsNode(const wxDataViewItem& item) const + { + for ( wxDataViewTreeNodes::const_iterator i = m_nodes.begin(); + i != m_nodes.end(); + ++i ) + { + if( (*i)->GetItem() == item ) + return *i; + } + + return NULL; + } + + private: wxDataViewTreeNode *m_parent; wxDataViewTreeNodes m_nodes; @@ -406,7 +421,7 @@ int LINKAGEMODE wxGenericTreeModelNodeCmp( wxDataViewTreeNode ** node1, int LINKAGEMODE wxGenericTreeModelItemCmp( void ** id1, void ** id2) { - return g_model->Compare( *id1, *id2, g_column, g_asending ); + return g_model->Compare( wxDataViewItem(*id1), wxDataViewItem(*id2), g_column, g_asending ); } @@ -414,10 +429,7 @@ int LINKAGEMODE wxGenericTreeModelItemCmp( void ** id1, void ** id2) // wxDataViewMainWindow //----------------------------------------------------------------------------- -WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_SIZE_T(unsigned int, wxDataViewSelection, - WXDLLIMPEXP_ADV); -WX_DECLARE_LIST(wxDataViewItem, ItemList); -WX_DEFINE_LIST(ItemList) +WX_DEFINE_SORTED_ARRAY_SIZE_T(unsigned int, wxDataViewSelection); class wxDataViewMainWindow: public wxWindow { @@ -2009,70 +2021,112 @@ bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent, (wxDataViewVirtualListModel*) GetOwner()->GetModel(); m_count = list_model->GetCount(); - if( m_currentRow > GetRowCount() ) - m_currentRow = m_count - 1; - - // TODO: why empty the entire selection? - m_selection.Empty(); - - UpdateDisplay(); - - return true; - } - - wxDataViewTreeNode * node = FindNode(parent); - - // Notice that it is possible that the item being deleted is not in the - // tree at all, for example we could be deleting a never shown (because - // collapsed) item in a tree model. So it's not an error if we don't know - // about this item, just return without doing anything then. - if ( !node || node->GetChildren().Index(item.GetID()) == wxNOT_FOUND ) - return false; - - int sub = -1; - node->GetChildren().Remove( item.GetID() ); - // Manipolate selection - if( m_selection.GetCount() > 1 ) - { - m_selection.Empty(); - } - bool isContainer = false; - wxDataViewTreeNodes nds = node->GetNodes(); - for (size_t i = 0; i < nds.GetCount(); i ++) - { - if (nds[i]->GetItem() == item) + if ( !m_selection.empty() ) { - isContainer = true; - break; - } - } - if( isContainer ) - { - wxDataViewTreeNode * n = NULL; - wxDataViewTreeNodes nodes = node->GetNodes(); - int len = nodes.GetCount(); - for( int i = 0; i < len; i ++) - { - if( nodes[i]->GetItem() == item ) + const int row = GetRowByItem(item); + + const size_t selCount = m_selection.size(); + for ( size_t i = 0; i < selCount; i++ ) { - n = nodes[i]; + if ( m_selection[i] > (unsigned)row ) + m_selection[i]--; + } + + int itemRow = m_selection.Index(row); + if ( itemRow != wxNOT_FOUND ) + m_selection.RemoveAt(itemRow); + } + + } + else // general case + { + wxDataViewTreeNode * node = FindNode(parent); + int itemPosInNode = node ? node->GetChildren().Index(item.GetID()) : wxNOT_FOUND; + + // Notice that it is possible that the item being deleted is not in the + // tree at all, for example we could be deleting a never shown (because + // collapsed) item in a tree model. So it's not an error if we don't know + // about this item, just return without doing anything then. + if ( !node || itemPosInNode == wxNOT_FOUND ) + return false; + + bool isContainer = false; + wxDataViewTreeNode *itemNode = NULL; + + const wxDataViewTreeNodes nds = node->GetNodes(); + for (size_t i = 0; i < nds.GetCount(); i ++) + { + if (nds[i]->GetItem() == item) + { + isContainer = true; + itemNode = nds[i]; break; } } - wxCHECK_MSG( n != NULL, false, "item not found" ); + // Delete the item from wxDataViewTreeNode representation: + int itemsDeleted = 1; + node->GetChildren().Remove( item.GetID() ); - node->GetNodes().Remove( n ); - sub -= n->GetSubTreeCount(); - ::DestroyTreeHelper(n); + if( isContainer ) + { + wxDataViewTreeNode *n = node->FindItemAsNode(item); + + wxCHECK_MSG( n != NULL, false, "item not found" ); + + node->GetNodes().Remove( n ); + itemsDeleted += n->GetSubTreeCount(); + ::DestroyTreeHelper(n); + } + + // Make the row number invalid and get a new valid one when user call GetRowCount + m_count = -1; + node->ChangeSubTreeCount(-itemsDeleted); + + // Update selection by removing 'item' and its entire children tree from the selection. + if ( !m_selection.empty() ) + { + // we can't call GetRowByItem() on 'item', as it's already deleted, so compute it from + // the parent ('node') and position in its list of children + int itemRow; + if ( itemPosInNode == 0 ) + { + // 1st child, row number is that of the parent node + 1 + itemRow = GetRowByItem(node->GetItem()) + 1; + } + else + { + // row number is that of the sibling above 'item' + its subtree if any + 1 + const wxDataViewItem sibling = wxDataViewItem(node->GetChildren()[itemPosInNode - 1]); + const wxDataViewTreeNode *siblingNode = node->FindItemAsNode(sibling); + + itemRow = GetRowByItem(sibling); + if ( siblingNode ) + itemRow += siblingNode->GetSubTreeCount(); + itemRow += 1; + } + + wxDataViewSelection newsel(wxDataViewSelectionCmp); + + for ( wxDataViewSelection::const_iterator i = m_selection.begin(); + i != m_selection.end(); + ++i ) + { + const int s = *i; + if ( s < itemRow ) + newsel.push_back(s); + else if ( s >= itemRow + itemsDeleted ) + newsel.push_back(s - itemsDeleted); + // else: deleted item, remove from selection + } + + m_selection = newsel; + } } - // Make the row number invalid and get a new valid one when user call GetRowCount - m_count = -1; - node->ChangeSubTreeCount(sub); // Change the current row to the last row if the current exceed the max row number if( m_currentRow > GetRowCount() ) - m_currentRow = m_count - 1; + ChangeCurrentRow(m_count - 1); UpdateDisplay(); @@ -2710,7 +2764,7 @@ public: if( node->GetNodes().GetCount() == 0) { int index = static_cast(row) - current - 1; - ret = node->GetChildren().Item( index ); + ret = wxDataViewItem(node->GetChildren().Item( index )); return DoJob::OK; } return DoJob::CONT; @@ -4436,13 +4490,22 @@ int wxDataViewCtrl::GetSelections( wxDataViewItemArray & sel ) const { sel.Empty(); wxDataViewSelection selection = m_clientArea->GetSelections(); - int len = selection.GetCount(); - for( int i = 0; i < len; i ++) + + const size_t len = selection.size(); + for ( size_t i = 0; i < len; i++ ) { - unsigned int row = selection[i]; - sel.Add( m_clientArea->GetItemByRow( row ) ); + wxDataViewItem item = m_clientArea->GetItemByRow(selection[i]); + if ( item.IsOk() ) + { + sel.Add(item); + } + else + { + wxFAIL_MSG( "invalid item in selection - bad internal state" ); + } } - return len; + + return sel.size(); } void wxDataViewCtrl::SetSelections( const wxDataViewItemArray & sel ) @@ -4506,73 +4569,6 @@ bool wxDataViewCtrl::IsSelected( const wxDataViewItem & item ) const return false; } -// Selection code with row number as parameter -int wxDataViewCtrl::GetSelections( wxArrayInt & sel ) const -{ - sel.Empty(); - wxDataViewSelection selection = m_clientArea->GetSelections(); - int len = selection.GetCount(); - for( int i = 0; i < len; i ++) - { - unsigned int row = selection[i]; - sel.Add( row ); - } - return len; -} - -void wxDataViewCtrl::SetSelections( const wxArrayInt & sel ) -{ - wxDataViewSelection selection(wxDataViewSelectionCmp); - int len = sel.GetCount(); - for( int i = 0; i < len; i ++ ) - { - int row = sel[i]; - if( row >= 0 ) - selection.Add( static_cast(row) ); - } - m_clientArea->SetSelections( selection ); -} - -void wxDataViewCtrl::Select( int row ) -{ - if( row >= 0 ) - { - if (m_clientArea->IsSingleSel()) - m_clientArea->SelectAllRows(false); - m_clientArea->SelectRow( row, true ); - } -} - -void wxDataViewCtrl::Unselect( int row ) -{ - if( row >= 0 ) - m_clientArea->SelectRow(row, false); -} - -bool wxDataViewCtrl::IsSelected( int row ) const -{ - if( row >= 0 ) - return m_clientArea->IsRowSelected(row); - return false; -} - -void wxDataViewCtrl::SelectRange( int from, int to ) -{ - wxArrayInt sel; - for( int i = from; i < to; i ++ ) - sel.Add( i ); - m_clientArea->Select(sel); -} - -void wxDataViewCtrl::UnselectRange( int from, int to ) -{ - wxDataViewSelection sel = m_clientArea->GetSelections(); - for( int i = from; i < to; i ++ ) - if( sel.Index( i ) != wxNOT_FOUND ) - sel.Remove( i ); - m_clientArea->SetSelections(sel); -} - void wxDataViewCtrl::SelectAll() { m_clientArea->SelectAllRows(true); diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index bcf799a00b..09354910b6 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -4027,7 +4027,7 @@ void wxListMainWindow::InsertItem( wxListItem &item ) wxListLineData *line = new wxListLineData(this); line->SetItem( item.m_col, item ); - if ( item.m_mask & wxLIST_MASK_IMAGE ) + if ( item.m_mask & wxLIST_MASK_IMAGE && item.GetImage() != -1) { // Reset the buffered height if it's not big enough for the new image. if (m_small_image_list) @@ -4866,7 +4866,9 @@ long wxGenericListCtrl::InsertItem( long index, const wxString &label, int image wxListItem info; info.m_text = label; info.m_image = imageIndex; - info.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE; + info.m_mask = wxLIST_MASK_TEXT; + if (imageIndex > -1) + info.m_mask |= wxLIST_MASK_IMAGE; info.m_itemId = index; return InsertItem( info ); } diff --git a/src/generic/msgdlgg.cpp b/src/generic/msgdlgg.cpp index 3fd78a7269..c3dd7a8067 100644 --- a/src/generic/msgdlgg.cpp +++ b/src/generic/msgdlgg.cpp @@ -74,6 +74,7 @@ protected: BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog) EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes) EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo) + EVT_BUTTON(wxID_HELP, wxGenericMessageDialog::OnHelp) EVT_BUTTON(wxID_CANCEL, wxGenericMessageDialog::OnCancel) END_EVENT_TABLE() @@ -133,6 +134,13 @@ wxSizer *wxGenericMessageDialog::CreateMsgDlgButtonSizer() btnDef = yes; } + if ( m_dialogStyle & wxHELP ) + { + wxButton * const + help = new wxButton(this, wxID_HELP, GetCustomHelpLabel()); + sizerStd->AddButton(help); + } + if ( btnDef ) { btnDef->SetDefault(); @@ -148,7 +156,7 @@ wxSizer *wxGenericMessageDialog::CreateMsgDlgButtonSizer() // Use standard labels for all buttons return CreateSeparatedButtonSizer ( - m_dialogStyle & (wxOK | wxCANCEL | wxYES_NO | + m_dialogStyle & (wxOK | wxCANCEL | wxHELP | wxYES_NO | wxNO_DEFAULT | wxCANCEL_DEFAULT) ); } @@ -242,6 +250,11 @@ void wxGenericMessageDialog::OnNo(wxCommandEvent& WXUNUSED(event)) EndModal( wxID_NO ); } +void wxGenericMessageDialog::OnHelp(wxCommandEvent& WXUNUSED(event)) +{ + EndModal( wxID_HELP ); +} + void wxGenericMessageDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) { // Allow cancellation via ESC/Close button except if diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index 06ca2e58a5..6425dd145d 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -902,7 +902,6 @@ wxOwnerDrawnComboBox::wxOwnerDrawnComboBox(wxWindow *parent, long style, const wxValidator& validator, const wxString& name) - : wxComboCtrl() { Init(); diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index e27c908000..ee2ea2b686 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -300,7 +300,7 @@ private: static int LINKAGEMODE wxGtkTreeModelChildCmp( void** id1, void** id2 ) { - int ret = gs_internal->GetDataViewModel()->Compare( *id1, *id2, + int ret = gs_internal->GetDataViewModel()->Compare( wxDataViewItem(*id1), wxDataViewItem(*id2), gs_internal->GetSortColumn(), (gs_internal->GetSortOrder() == GTK_SORT_ASCENDING) ); return ret; @@ -3334,7 +3334,7 @@ int wxGtkTreeModelChildWithPosCmp( const void* data1, const void* data2, const v static int LINKAGEMODE wxGtkTreeModelChildPtrCmp( void*** data1, void*** data2 ) { - return gs_internal->GetDataViewModel()->Compare( **data1, **data2, + return gs_internal->GetDataViewModel()->Compare( wxDataViewItem(**data1), wxDataViewItem(**data2), gs_internal->GetSortColumn(), (gs_internal->GetSortOrder() == GTK_SORT_ASCENDING) ); } diff --git a/src/gtk/msgdlg.cpp b/src/gtk/msgdlg.cpp index d459602f0b..2b47ac27ef 100644 --- a/src/gtk/msgdlg.cpp +++ b/src/gtk/msgdlg.cpp @@ -74,6 +74,11 @@ wxString wxMessageDialog::GetDefaultCancelLabel() const return GTK_STOCK_CANCEL; } +wxString wxMessageDialog::GetDefaultHelpLabel() const +{ + return GTK_STOCK_HELP; +} + void wxMessageDialog::DoSetCustomLabel(wxString& var, const ButtonLabel& label) { int stockId = label.GetStockId(); @@ -135,16 +140,21 @@ void wxMessageDialog::GTKCreateMsgDialog() // when using custom labels, we have to add all the buttons ourselves if ( !HasCustomLabels() ) { - if ( m_dialogStyle & wxYES_NO ) + // "Help" button is not supported by predefined combinations so we + // always need to create the buttons manually when it's used. + if ( !(m_dialogStyle & wxHELP) ) { - if ( !(m_dialogStyle & wxCANCEL) ) - buttons = GTK_BUTTONS_YES_NO; - //else: no standard GTK_BUTTONS_YES_NO_CANCEL so leave as NONE - } - else if ( m_dialogStyle & wxOK ) - { - buttons = m_dialogStyle & wxCANCEL ? GTK_BUTTONS_OK_CANCEL - : GTK_BUTTONS_OK; + if ( m_dialogStyle & wxYES_NO ) + { + if ( !(m_dialogStyle & wxCANCEL) ) + buttons = GTK_BUTTONS_YES_NO; + //else: no standard GTK_BUTTONS_YES_NO_CANCEL so leave as NONE + } + else if ( m_dialogStyle & wxOK ) + { + buttons = m_dialogStyle & wxCANCEL ? GTK_BUTTONS_OK_CANCEL + : GTK_BUTTONS_OK; + } } } @@ -211,9 +221,16 @@ void wxMessageDialog::GTKCreateMsgDialog() const bool addButtons = buttons == GTK_BUTTONS_NONE; #endif // wxUSE_LIBHILDON/!wxUSE_LIBHILDON - if ( m_dialogStyle & wxYES_NO ) // Yes/No or Yes/No/Cancel dialog + + if ( addButtons ) { - if ( addButtons ) + if ( m_dialogStyle & wxHELP ) + { + gtk_dialog_add_button(dlg, wxGTK_CONV(GetHelpLabel()), + GTK_RESPONSE_HELP); + } + + if ( m_dialogStyle & wxYES_NO ) // Yes/No or Yes/No/Cancel dialog { // Add the buttons in the correct order which is, according to // http://library.gnome.org/devel/hig-book/stable/windows-alert.html.en @@ -233,32 +250,29 @@ void wxMessageDialog::GTKCreateMsgDialog() gtk_dialog_add_button(dlg, wxGTK_CONV(GetYesLabel()), GTK_RESPONSE_YES); } - - // it'd probably be harmless to call gtk_dialog_set_default_response() - // twice but why do it if we're going to change the default below - // anyhow - if ( !(m_dialogStyle & wxCANCEL_DEFAULT) ) + else // Ok or Ok/Cancel dialog { - gtk_dialog_set_default_response(dlg, - m_dialogStyle & wxNO_DEFAULT - ? GTK_RESPONSE_NO - : GTK_RESPONSE_YES); - } - } - else if ( addButtons ) // Ok or Ok/Cancel dialog - { - gtk_dialog_add_button(dlg, wxGTK_CONV(GetOKLabel()), GTK_RESPONSE_OK); - if ( m_dialogStyle & wxCANCEL ) - { - gtk_dialog_add_button(dlg, wxGTK_CONV(GetCancelLabel()), - GTK_RESPONSE_CANCEL); + gtk_dialog_add_button(dlg, wxGTK_CONV(GetOKLabel()), GTK_RESPONSE_OK); + if ( m_dialogStyle & wxCANCEL ) + { + gtk_dialog_add_button(dlg, wxGTK_CONV(GetCancelLabel()), + GTK_RESPONSE_CANCEL); + } } } + gint defaultButton; if ( m_dialogStyle & wxCANCEL_DEFAULT ) - { - gtk_dialog_set_default_response(dlg, GTK_RESPONSE_CANCEL); - } + defaultButton = GTK_RESPONSE_CANCEL; + else if ( m_dialogStyle & wxNO_DEFAULT ) + defaultButton = GTK_RESPONSE_NO; + else if ( m_dialogStyle & wxYES_NO ) + defaultButton = GTK_RESPONSE_YES; + else // No need to change the default value, whatever it is. + defaultButton = GTK_RESPONSE_NONE; + + if ( defaultButton != GTK_RESPONSE_NONE ) + gtk_dialog_set_default_response(dlg, defaultButton); } int wxMessageDialog::ShowModal() @@ -302,6 +316,8 @@ int wxMessageDialog::ShowModal() return wxID_YES; case GTK_RESPONSE_NO: return wxID_NO; + case GTK_RESPONSE_HELP: + return wxID_HELP; } } diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index ee0c631afc..ae9f03cd16 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1218,6 +1218,37 @@ int wxTextCtrl::GetLineLength(long lineNo) const } } +wxPoint wxTextCtrl::DoPositionToCoords(long pos) const +{ + if ( !IsMultiLine() ) + { + // Single line text entry (GtkTextEntry) doesn't have support for + // getting the coordinates for the given offset. Perhaps we could + // find them ourselves by using GetTextExtent() but for now just leave + // it unimplemented, this function is more useful for multiline + // controls anyhow. + return wxDefaultPosition; + } + + // Window coordinates for the given position is calculated by getting + // the buffer coordinates and converting them to window coordinates. + GtkTextView *textview = GTK_TEXT_VIEW(m_text); + + GtkTextIter iter; + gtk_text_buffer_get_iter_at_offset(m_buffer, &iter, pos); + + GdkRectangle bufferCoords; + gtk_text_view_get_iter_location(textview, &iter, &bufferCoords); + + gint winCoordX = 0, + winCoordY = 0; + gtk_text_view_buffer_to_window_coords(textview, GTK_TEXT_WINDOW_WIDGET, + bufferCoords.x, bufferCoords.y, + &winCoordX, &winCoordY); + + return wxPoint(winCoordX, winCoordY); +} + int wxTextCtrl::GetNumberOfLines() const { if ( IsMultiLine() ) diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index c1c7df147c..0bc8226142 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -1906,7 +1906,7 @@ void wxGDIPlusRenderer::Unload() if ( m_gditoken ) { GdiplusShutdown(m_gditoken); - m_gditoken = NULL; + m_gditoken = 0; } m_loaded = -1; // next Load() will try again } diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 9d49a3be10..1e1c9a722c 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -1727,7 +1727,9 @@ long wxListCtrl::InsertItem(long index, const wxString& label, int imageIndex) wxListItem info; info.m_image = imageIndex; info.m_text = label; - info.m_mask = wxLIST_MASK_IMAGE | wxLIST_MASK_TEXT; + info.m_mask = wxLIST_MASK_TEXT; + if (imageIndex > -1) + info.m_mask |= wxLIST_MASK_IMAGE; info.m_itemId = index; return InsertItem(info); } diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index c1accd90e2..fe8b4a51dd 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -260,7 +260,7 @@ inline bool IsGreaterThanStdSize(const wxBitmap& bmp) // --------------------------------------------------------------------------- // Construct a menu with optional title (then use append) -void wxMenu::Init() +void wxMenu::InitNoCreate() { m_radioData = NULL; m_doBreak = false; @@ -270,6 +270,11 @@ void wxMenu::Init() m_maxBitmapWidth = 0; m_maxAccelWidth = -1; #endif // wxUSE_OWNER_DRAWN +} + +void wxMenu::Init() +{ + InitNoCreate(); // create the menu m_hMenu = (WXHMENU)CreatePopupMenu(); @@ -287,6 +292,24 @@ void wxMenu::Init() } } +wxMenu::wxMenu(WXHMENU hMenu) +{ + InitNoCreate(); + + m_hMenu = hMenu; + + // Ensure that our internal idea of how many items we have corresponds to + // the real number of items in the menu. + // + // We could also retrieve the real labels of the items here but it doesn't + // seem to be worth the trouble. + const int numExistingItems = ::GetMenuItemCount(m_hMenu); + for ( int n = 0; n < numExistingItems; n++ ) + { + wxMenuBase::DoAppend(wxMenuItem::New(this, wxID_SEPARATOR)); + } +} + // The wxWindow destructor will take care of deleting the submenus. wxMenu::~wxMenu() { diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index 7c786e5141..b0118ae243 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -511,6 +511,11 @@ int wxMessageDialog::ShowMessageBox() } } + if ( wxStyle & wxHELP ) + { + msStyle |= MB_HELP; + } + // set the icon style switch ( GetEffectiveIcon() ) { @@ -630,7 +635,7 @@ void wxMessageDialog::DoCentre(int dir) #ifdef wxHAS_MSW_TASKDIALOG wxMSWTaskDialogConfig::wxMSWTaskDialogConfig(const wxMessageDialogBase& dlg) - : buttons(new TASKDIALOG_BUTTON[3]) + : buttons(new TASKDIALOG_BUTTON[MAX_BUTTONS]) { parent = dlg.GetParentForModalDialog(); caption = dlg.GetCaption(); @@ -665,6 +670,7 @@ wxMSWTaskDialogConfig::wxMSWTaskDialogConfig(const wxMessageDialogBase& dlg) btnNoLabel = dlg.GetNoLabel(); btnOKLabel = dlg.GetOKLabel(); btnCancelLabel = dlg.GetCancelLabel(); + btnHelpLabel = dlg.GetHelpLabel(); } void wxMSWTaskDialogConfig::MSWCommonTaskDialogInit(TASKDIALOGCONFIG &tdc) @@ -755,6 +761,15 @@ void wxMSWTaskDialogConfig::MSWCommonTaskDialogInit(TASKDIALOGCONFIG &tdc) AddTaskDialogButton(tdc, IDCANCEL, TDCBF_CANCEL_BUTTON, btnOKLabel); } } + + if ( style & wxHELP ) + { + // There is no support for "Help" button in the task dialog, it can + // only show "Retry" or "Close" ones. + useCustomLabels = true; + + AddTaskDialogButton(tdc, IDHELP, 0 /* not used */, btnHelpLabel); + } } void wxMSWTaskDialogConfig::AddTaskDialogButton(TASKDIALOGCONFIG &tdc, @@ -770,6 +785,10 @@ void wxMSWTaskDialogConfig::AddTaskDialogButton(TASKDIALOGCONFIG &tdc, tdBtn.nButtonID = btnCustomId; tdBtn.pszButtonText = customLabel.wx_str(); tdc.cButtons++; + + // We should never have more than 4 buttons currently as this is the + // maximal number of buttons supported by the message dialog. + wxASSERT_MSG( tdc.cButtons <= MAX_BUTTONS, wxT("Too many buttons") ); } else { @@ -839,6 +858,9 @@ int wxMSWMessageDialog::MSWTranslateReturnCode(int msAns) case IDNO: ans = wxID_NO; break; + case IDHELP: + ans = wxID_HELP; + break; } return ans; diff --git a/src/msw/printdlg.cpp b/src/msw/printdlg.cpp index 205009999b..fac6fdf743 100644 --- a/src/msw/printdlg.cpp +++ b/src/msw/printdlg.cpp @@ -192,6 +192,9 @@ bool wxWindowsPrintNativeData::IsOk() const bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data ) { + if ( !m_devMode ) + InitializeDevMode(); + if ( !m_devMode ) return false; @@ -383,20 +386,21 @@ bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data ) return true; } -bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data ) +void wxWindowsPrintNativeData::InitializeDevMode(const wxString& printerName, WinPrinter* printer) { - HGLOBAL hDevMode = static_cast(m_devMode); - WinPrinter printer; - LPTSTR szPrinterName = (LPTSTR)data.GetPrinterName().wx_str(); + if (m_devMode) + return; + + LPTSTR szPrinterName = (LPTSTR)printerName.wx_str(); // From MSDN: How To Modify Printer Settings with the DocumentProperties() Function // The purpose of this is to fill the DEVMODE with privdata from printer driver. // If we have a printer name and OpenPrinter sucessfully returns // this replaces the PrintDlg function which creates the DEVMODE filled only with data from default printer. - if ( !m_devMode && !data.GetPrinterName().IsEmpty() ) + if ( !m_devMode && !printerName.IsEmpty() ) { // Open printer - if ( printer.Open( data.GetPrinterName() ) == TRUE ) + if ( printer && printer->Open( printerName ) == TRUE ) { DWORD dwNeeded, dwRet; @@ -424,12 +428,11 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data ) { // If failure, cleanup GlobalFree( tempDevMode ); - printer.Close(); + printer->Close(); } else { - hDevMode = tempDevMode; - m_devMode = hDevMode; + m_devMode = tempDevMode; tempDevMode = NULL; } } @@ -471,8 +474,7 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data ) } else { - hDevMode = pd.hDevMode; - m_devMode = hDevMode; + m_devMode = pd.hDevMode; pd.hDevMode = NULL; // We'll create a new DEVNAMEs structure below. @@ -487,6 +489,18 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data ) } } +} + +bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data ) +{ + WinPrinter printer; + LPTSTR szPrinterName = (LPTSTR)data.GetPrinterName().wx_str(); + + if (!m_devMode) + InitializeDevMode(data.GetPrinterName(), &printer); + + HGLOBAL hDevMode = static_cast(m_devMode); + if ( hDevMode ) { GlobalPtrLock lockDevMode(hDevMode); diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 3cf85ba094..850ea6ee93 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -1489,6 +1489,93 @@ wxTextCtrl::HitTest(const wxPoint& pt, long *posOut) const return rc; } +wxPoint wxTextCtrl::DoPositionToCoords(long pos) const +{ + // FIXME: This code is broken for rich edit version 2.0 as it uses the same + // API as plain edit i.e. the coordinates are returned directly instead of + // filling the POINT passed as WPARAM with them but we can't distinguish + // between 2.0 and 3.0 unfortunately (see also the use of EM_POSFROMCHAR + // above). +#if wxUSE_RICHEDIT + if ( IsRich() ) + { + POINT pt; + LRESULT rc = ::SendMessage(GetHwnd(), EM_POSFROMCHAR, (WPARAM)&pt, pos); + if ( rc != -1 ) + return wxPoint(pt.x, pt.y); + } + else +#endif // wxUSE_RICHEDIT + { + LRESULT rc = ::SendMessage(GetHwnd(), EM_POSFROMCHAR, pos, 0); + if ( rc == -1 ) + { + // Finding coordinates for the last position of the control fails + // in plain EDIT control, try to compensate for it by finding it + // ourselves from the position of the previous character. + if ( pos < GetLastPosition() ) + { + // It's not the expected correctable failure case so just fail. + return wxDefaultPosition; + } + + if ( pos == 0 ) + { + // We're being asked the coordinates of the first (and last and + // only) position in an empty control. There is no way to get + // it directly with EM_POSFROMCHAR but EM_GETMARGINS returns + // the correct value for at least the horizontal offset. + rc = ::SendMessage(GetHwnd(), EM_GETMARGINS, 0, 0); + + // Text control seems to effectively add 1 to margin. + return wxPoint(LOWORD(rc) + 1, 1); + } + + // We do have a previous character, try to get its coordinates. + rc = ::SendMessage(GetHwnd(), EM_POSFROMCHAR, pos - 1, 0); + if ( rc == -1 ) + { + // If getting coordinates of the previous character failed as + // well, just give up. + return wxDefaultPosition; + } + + wxString prevChar = GetRange(pos - 1, pos); + wxSize prevCharSize = GetTextExtent(prevChar); + + if ( prevChar == wxT("\n" )) + { + // 'pos' is at the beginning of a new line so its X coordinate + // should be the same as X coordinate of the first character of + // any other line while its Y coordinate will be approximately + // (but we can't compute it exactly...) one character height + // more than that of the previous character. + LRESULT coords0 = ::SendMessage(GetHwnd(), EM_POSFROMCHAR, 0, 0); + if ( coords0 == -1 ) + return wxDefaultPosition; + + rc = MAKELPARAM(LOWORD(coords0), HIWORD(rc) + prevCharSize.y); + } + else + { + // Simple case: previous character is in the same line so this + // one is just after it. + rc += MAKELPARAM(prevCharSize.x, 0); + } + } + + // Notice that {LO,HI}WORD macros return WORDs, i.e. unsigned shorts, + // while we want to have signed values here (the y coordinate of any + // position above the first currently visible line is negative, for + // example), hence the need for casts. + return wxPoint(static_cast(LOWORD(rc)), + static_cast(HIWORD(rc))); + } + + return wxDefaultPosition; +} + + // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 5b271f01a2..9e068789c8 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -141,6 +141,8 @@ void wxTopLevelWindowMSW::Init() m_activateInfo = (void*) info; #endif + + m_menuSystem = NULL; } WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const @@ -326,9 +328,9 @@ WXLRESULT wxTopLevelWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WX WXLRESULT rc = 0; bool processed = false; -#if defined(__SMARTPHONE__) || defined(__POCKETPC__) switch ( message ) { +#if defined(__SMARTPHONE__) || defined(__POCKETPC__) case WM_ACTIVATE: { SHACTIVATEINFO* info = (SHACTIVATEINFO*) m_activateInfo; @@ -355,8 +357,32 @@ WXLRESULT wxTopLevelWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WX } break; } +#endif // __SMARTPHONE__ || __POCKETPC__ + + case WM_SYSCOMMAND: + // We may need to generate events for the items added to the system + // menu if it had been created (and presumably modified). + if ( m_menuSystem ) + { + // From MSDN: + // + // ... the four low-order bits of the wParam parameter are + // used internally by the system. To obtain the correct + // result when testing the value of wParam, an application + // must combine the value 0xFFF0 with the wParam value by + // using the bitwise AND operator. + unsigned id = wParam & 0xfff0; + + // SC_SIZE is the first of the system-defined commands and we + // leave those to DefWindowProc(). + if ( id < SC_SIZE ) + { + if ( m_menuSystem->MSWCommand(0 /* unused anyhow */, id) ) + processed = true; + } + } + break; } -#endif if ( !processed ) rc = wxTopLevelWindowBase::MSWWindowProc(message, wParam, lParam); @@ -413,25 +439,26 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate, } #endif // !__WXWINCE__ +#if !defined(__WXWINCE__) || defined(__WINCE_STANDARDSDK__) // move the dialog to its initial position without forcing repainting int x, y, w, h; (void)MSWGetCreateWindowCoords(pos, size, x, y, w, h); if ( x == (int)CW_USEDEFAULT ) { - // centre it on the screen - what else can we do? - wxSize sizeDpy = wxGetDisplaySize(); - - x = (sizeDpy.x - w) / 2; - y = (sizeDpy.y - h) / 2; + // Let the system position the window, just set its size. + ::SetWindowPos(GetHwnd(), 0, + 0, 0, w, h, + SWP_NOMOVE | SWP_NOZORDER); } - -#if !defined(__WXWINCE__) || defined(__WINCE_STANDARDSDK__) - if ( !::MoveWindow(GetHwnd(), x, y, w, h, FALSE) ) + else // Move the window to the desired location and set its size too. { - wxLogLastError(wxT("MoveWindow")); + if ( !::MoveWindow(GetHwnd(), x, y, w, h, FALSE) ) + { + wxLogLastError(wxT("MoveWindow")); + } } -#endif +#endif // !__WXWINCE__ if ( !title.empty() ) { @@ -578,6 +605,8 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent, wxTopLevelWindowMSW::~wxTopLevelWindowMSW() { + delete m_menuSystem; + SendDestroyEvent(); #if defined(__SMARTPHONE__) || defined(__POCKETPC__) @@ -608,7 +637,13 @@ void wxTopLevelWindowMSW::DoShowWindow(int nShowCmd) { ::ShowWindow(GetHwnd(), nShowCmd); - m_iconized = nShowCmd == SW_MINIMIZE; + // Hiding the window doesn't change its iconized state. + if ( nShowCmd != SW_HIDE ) + { + // Otherwise restoring, maximizing or showing the window normally also + // makes it not iconized and only minimizing it does make it iconized. + m_iconized = nShowCmd == SW_MINIMIZE; + } } void wxTopLevelWindowMSW::ShowWithoutActivating() @@ -737,6 +772,13 @@ bool wxTopLevelWindowMSW::IsMaximized() const void wxTopLevelWindowMSW::Iconize(bool iconize) { + if ( iconize == m_iconized ) + { + // Do nothing, in particular don't restore non-iconized windows when + // Iconize(false) is called as this would wrongly un-maximize them. + return; + } + if ( IsShown() ) { // change the window state immediately @@ -1219,6 +1261,39 @@ void wxTopLevelWindowMSW::RequestUserAttention(int flags) } } +wxMenu *wxTopLevelWindowMSW::MSWGetSystemMenu() const +{ + if ( !m_menuSystem ) + { + HMENU hmenu = ::GetSystemMenu(GetHwnd(), FALSE); + if ( !hmenu ) + { + wxLogLastError(wxT("GetSystemMenu()")); + return NULL; + } + + wxTopLevelWindowMSW * const + self = const_cast(this); + + self->m_menuSystem = wxMenu::MSWNewFromHMENU(hmenu); + + // We need to somehow associate this menu with this window to ensure + // that we get events from it. A natural idea would be to pretend that + // it's attached to our menu bar but this wouldn't work if we don't + // have any menu bar which is a common case for applications using + // custom items in the system menu (they mostly do it exactly because + // they don't have any other menus). + // + // So reuse the invoking window pointer instead, this is not exactly + // correct but doesn't seem to have any serious drawbacks. + m_menuSystem->SetInvokingWindow(self); + } + + return m_menuSystem; +} + +// ---------------------------------------------------------------------------- +// Transparency support // --------------------------------------------------------------------------- bool wxTopLevelWindowMSW::SetTransparent(wxByte alpha) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 7535e4efeb..5e2e43a438 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -881,7 +881,7 @@ bool wxWindowMSW::SetCursor(const wxCursor& cursor) return false; } - const wxWindow* win = wxFindWindowAtPoint(wxPoint(pt.x, pt.y)); + const wxWindowMSW* win = wxFindWindowAtPoint(wxPoint(pt.x, pt.y)); if ( !win ) win = this; diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index cf1e53b104..722f9cc2f8 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -130,7 +130,7 @@ pascal OSErr AEHandleGURL( const AppleEvent *event , AppleEvent *reply , SRefCon } -// AEODoc Calls MacOpenFile on each of the files passed +// AEODoc Calls MacOpenFiles with all of the files passed short wxApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply)) { @@ -158,6 +158,7 @@ short wxApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply)) wxString fName ; FSRef theRef ; + wxArrayString fileNames; for (i = 1; i <= itemsInList; i++) { AEGetNthPtr( @@ -165,9 +166,11 @@ short wxApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply)) (Ptr)&theRef, sizeof(theRef), &actualSize); fName = wxMacFSRefToPath( &theRef ) ; - MacOpenFile(fName); + fileNames.Add(fName); } + MacOpenFiles(fileNames); + return noErr; } @@ -274,6 +277,16 @@ short wxApp::MacHandleAERApp(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNU // Support Routines linking the Mac...File Calls to the Document Manager //---------------------------------------------------------------------- +void wxApp::MacOpenFiles(const wxArrayString & fileNames ) +{ + size_t i; + const size_t fileCount = fileNames.GetCount(); + for (i = 0; i < fileCount; i++) + { + MacOpenFile(fileNames[i]); + } +} + void wxApp::MacOpenFile(const wxString & fileName ) { #if wxUSE_DOC_VIEW_ARCHITECTURE diff --git a/src/osx/cocoa/msgdlg.mm b/src/osx/cocoa/msgdlg.mm index ad44f55600..445a097caa 100644 --- a/src/osx/cocoa/msgdlg.mm +++ b/src/osx/cocoa/msgdlg.mm @@ -138,6 +138,8 @@ int wxMessageDialog::ShowModal() } } + wxASSERT_MSG( !(style & wxHELP), "wxHELP not supported in non-GUI thread" ); + CFOptionFlags exitButton; OSStatus err = CFUserNotificationDisplayAlert( 0, alertType, NULL, NULL, NULL, cfTitle, cfText, @@ -285,5 +287,15 @@ void* wxMessageDialog::ConstructNSAlert() } } + + if ( style & wxHELP ) + { + wxCFStringRef cfHelpString( GetHelpLabel(), GetFont().GetEncoding() ); + [alert addButtonWithTitle:cfHelpString.AsNSString()]; + m_buttonId[ m_buttonCount++ ] = wxID_HELP; + } + + wxASSERT_MSG( m_buttonCount <= WXSIZEOF(m_buttonId), "Too many buttons" ); + return alert; } diff --git a/src/osx/cocoa/textctrl.mm b/src/osx/cocoa/textctrl.mm index b5913b841b..f22f8de86e 100644 --- a/src/osx/cocoa/textctrl.mm +++ b/src/osx/cocoa/textctrl.mm @@ -57,11 +57,18 @@ - (void)setSelectable:(BOOL)flag; @end +// An object of this class is created before the text is modified +// programmatically and destroyed as soon as this is done. It does several +// things, like ensuring that the control is editable to allow setting its text +// at all and eating any unwanted focus loss events from textDidEndEditing: +// which don't really correspond to focus change. class wxMacEditHelper { public : wxMacEditHelper( NSView* textView ) { + m_viewPreviouslyEdited = ms_viewCurrentlyEdited; + ms_viewCurrentlyEdited = m_textView = textView; m_formerEditable = YES; if ( textView ) @@ -79,14 +86,27 @@ public : [m_textView setEditable:m_formerEditable]; [m_textView setSelectable:m_formerSelectable]; } + + ms_viewCurrentlyEdited = m_viewPreviouslyEdited; } + // Returns the last view we were instantiated for or NULL. + static NSView *GetCurrentlyEditedView() { return ms_viewCurrentlyEdited; } + protected : BOOL m_formerEditable ; BOOL m_formerSelectable; NSView* m_textView; + + // The original value of ms_viewCurrentlyEdited when this object was + // created. + NSView* m_viewPreviouslyEdited; + + static NSView* ms_viewCurrentlyEdited; } ; +NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil; + @implementation wxNSSecureTextField + (void)initialize @@ -222,6 +242,15 @@ protected : - (void)textDidEndEditing:(NSNotification *)aNotification { wxUnusedVar(aNotification); + + if ( self == wxMacEditHelper::GetCurrentlyEditedView() ) + { + // This notification is generated as the result of calling our own + // wxTextCtrl method (e.g. WriteText()) and doesn't correspond to any + // real focus loss event so skip generating it. + return; + } + wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if ( impl ) { diff --git a/src/osx/cocoa/utils.mm b/src/osx/cocoa/utils.mm index c7879d0e6b..cb71db77a3 100644 --- a/src/osx/cocoa/utils.mm +++ b/src/osx/cocoa/utils.mm @@ -55,12 +55,18 @@ void wxBell() wxUnusedVar(application); } -- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename +- (void)application:(NSApplication *)sender openFiles:(NSArray *)fileNames { wxUnusedVar(sender); - wxCFStringRef cf(wxCFRetain(filename)); - wxTheApp->MacOpenFile(cf.AsString()) ; - return YES; + wxArrayString fileList; + size_t i; + const size_t count = [fileNames count]; + for (i = 0; i < count; i++) + { + fileList.Add( wxCFStringRef::AsString([fileNames objectAtIndex:i]) ); + } + + wxTheApp->MacOpenFiles(fileList); } - (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index b859eba7cb..ec4381d4c0 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -368,7 +368,16 @@ void wxWidgetCocoaImpl::SetupKeyEvent(wxKeyEvent &wxevent , NSEvent * nsEvent, N } #if wxUSE_UNICODE - wxevent.m_uniChar = aunichar; + // OS X generates events with key codes in Unicode private use area for + // unprintable symbols such as cursor arrows (WXK_UP is mapped to U+F700) + // and function keys (WXK_F2 is U+F705). We don't want to use them as the + // result of wxKeyEvent::GetUnicodeKey() however as it's supposed to return + // WXK_NONE for "non characters" so explicitly exclude them. + // + // We only exclude the private use area inside the Basic Multilingual Plane + // as key codes beyond it don't seem to be currently used. + if ( !(aunichar >= 0xe000 && aunichar < 0xf900) ) + wxevent.m_uniChar = aunichar; #endif wxevent.m_keyCode = keyval; diff --git a/src/osx/combobox_osx.cpp b/src/osx/combobox_osx.cpp index 1f3190f085..fe9f812f75 100644 --- a/src/osx/combobox_osx.cpp +++ b/src/osx/combobox_osx.cpp @@ -25,10 +25,6 @@ wxComboBox::~wxComboBox() { } -void wxComboBox::Init() -{ -} - bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, diff --git a/src/osx/core/mimetype.cpp b/src/osx/core/mimetype.cpp index c2661e22b0..4910f30ad4 100644 --- a/src/osx/core/mimetype.cpp +++ b/src/osx/core/mimetype.cpp @@ -447,7 +447,11 @@ void wxMimeTypesManagerImpl::LoadDisplayDataForUti(const wxString& uti) if( !bundle ) return; - // Get a all the document type data in this bundle + // Also get the open command while we have the bundle + wxCFStringRef cfsAppPath(CFURLCopyFileSystemPath(appUrl, kCFURLPOSIXPathStyle)); + m_utiMap[ uti ].application = cfsAppPath.AsString(); + + // Get all the document type data in this bundle CFTypeRef docTypeData; docTypeData = CFBundleGetValueForInfoDictionaryKey( bundle, docTypesKey ); @@ -587,6 +591,19 @@ bool wxMimeTypesManagerImpl::GetDescription(const wxString& uti, wxString *desc) return true; } +bool wxMimeTypesManagerImpl::GetApplication(const wxString& uti, wxString *command) +{ + const UtiMap::const_iterator itr = m_utiMap.find( uti ); + + if( itr == m_utiMap.end() ) + { + command->clear(); + return false; + } + + *command = itr->second.application; + return true; +} ///////////////////////////////////////////////////////////////////////////// // The remaining functionality has not yet been implemented for OS X @@ -626,9 +643,36 @@ bool wxFileTypeImpl::GetDescription(wxString *desc) const return m_manager->GetDescription( m_uti, desc ); } -bool wxFileTypeImpl::GetOpenCommand(wxString *WXUNUSED(openCmd), const wxFileType::MessageParameters& WXUNUSED(params)) const +namespace { - return false; + +// Helper function for GetOpenCommand(): returns the string surrounded by +// (singly) quotes if it contains spaces. +wxString QuoteIfNecessary(const wxString& path) +{ + wxString result(path); + + if ( path.find(' ') != wxString::npos ) + { + result.insert(0, "'"); + result.append("'"); + } + + return result; +} + +} // anonymous namespace + +bool wxFileTypeImpl::GetOpenCommand(wxString *openCmd, const wxFileType::MessageParameters& params) const +{ + wxString application; + if ( !m_manager->GetApplication(m_uti, &application) ) + return false; + + *openCmd << QuoteIfNecessary(application) + << ' ' << QuoteIfNecessary(params.GetFileName()); + + return true; } bool wxFileTypeImpl::GetPrintCommand(wxString *WXUNUSED(printCmd), const wxFileType::MessageParameters& WXUNUSED(params)) const diff --git a/src/osx/core/utilsexc_base.cpp b/src/osx/core/utilsexc_base.cpp index e1a8a61e0d..84f8a0e3a3 100644 --- a/src/osx/core/utilsexc_base.cpp +++ b/src/osx/core/utilsexc_base.cpp @@ -77,6 +77,19 @@ long UMAGetSystemVersion() // our OS version is the same in non GUI and GUI cases wxOperatingSystemId wxGetOsVersion(int *majorVsn, int *minorVsn) { + // This returns 10 and 6 for OS X 10.6, consistent with behaviour on + // other platforms. + SInt32 maj, min; + Gestalt(gestaltSystemVersionMajor, &maj); + Gestalt(gestaltSystemVersionMinor, &min); + + if ( majorVsn != NULL ) + *majorVsn = maj; + + if ( minorVsn != NULL ) + *minorVsn = min; + +#if 0 SInt32 theSystem; Gestalt(gestaltSystemVersion, &theSystem); @@ -85,7 +98,7 @@ wxOperatingSystemId wxGetOsVersion(int *majorVsn, int *minorVsn) if ( minorVsn != NULL ) *minorVsn = (theSystem & 0xFF); - +#endif return wxOS_MAC_OSX_DARWIN; } diff --git a/src/osx/textctrl_osx.cpp b/src/osx/textctrl_osx.cpp index 0af4f04bcc..8c2f1d83da 100644 --- a/src/osx/textctrl_osx.cpp +++ b/src/osx/textctrl_osx.cpp @@ -775,9 +775,10 @@ int wxTextWidgetImpl::GetLineLength(long lineNo) const count = 0; for (size_t j = i; j < content.length(); j++) { - count++; if (content[j] == '\n') return count; + + count++; } return count; diff --git a/src/richtext/richtextdialogs.pjd b/src/richtext/richtextdialogs.pjd index 82b5a5ff9e..804c0fa721 100644 --- a/src/richtext/richtextdialogs.pjd +++ b/src/richtext/richtextdialogs.pjd @@ -306,14 +306,6 @@ "wbBoxSizerProxy" "Vertical" "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 0 0 0 @@ -1442,36 +1434,30 @@ 0 "<Any platform>" - "wxStaticText: wxID_STATIC" + "wxCheckBox: ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL" "dialog-control-document" "" - "statictext" + "checkbox" 0 1 0 0 - "2/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 + "wbCheckBoxProxy" + "wxEVT_COMMAND_CHECKBOX_CLICKED|OnUnderliningCtrlSelected|NONE||wxRichTextFontPage" + "ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL" + 10015 "" - "wxStaticText" - "wxStaticText" + "wxCheckBox" + "wxCheckBox" 1 0 "" "" - "" + "m_textColourLabel" "&Colour:" - -1 + 0 "" "" - "" - "" - "" - 0 - 1 - "<Any platform>" "" "" "" @@ -1479,17 +1465,16 @@ "" "" "" - 0 + "" + "" + "" + 0 + 1 + "<Any platform>" 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 + 0 + 0 + 0 0 0 0 @@ -1498,7 +1483,7 @@ -1 -1 -1 - "Left" + "Centre" "Centre" 0 5 @@ -1609,35 +1594,30 @@ 0 "<Any platform>" - "wxStaticText: wxID_STATIC" + "wxCheckBox: ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL" "dialog-control-document" "" - "statictext" + "checkbox" 0 1 0 0 - "wbStaticTextProxy" - "wxID_STATIC" - 5105 + "wbCheckBoxProxy" + "wxEVT_COMMAND_CHECKBOX_CLICKED|OnUnderliningCtrlSelected|NONE||wxRichTextFontPage" + "ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL" + 10016 "" - "wxStaticText" - "wxStaticText" + "wxCheckBox" + "wxCheckBox" 1 0 "" "" - "" + "m_bgColourLabel" "&Bg colour:" - -1 + 0 "" "" - "" - "" - "" - 0 - 1 - "<Any platform>" "" "" "" @@ -1645,17 +1625,16 @@ "" "" "" - 0 + "" + "" + "" + 0 + 1 + "<Any platform>" 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 + 0 + 0 + 0 0 0 0 @@ -1664,7 +1643,7 @@ -1 -1 -1 - "Left" + "Centre" "Centre" 0 5 @@ -2229,6 +2208,14 @@ "wbBoxSizerProxy" "Vertical" "" + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 0 0 0 @@ -3067,7 +3054,6 @@ 1 0 0 - "3/10/2006" "wbStaticTextProxy" "wxID_STATIC" 5105 @@ -3130,115 +3116,87 @@ "" - "wxBoxSizer H" + "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT" "dialog-control-document" "" - "sizer" + "textctrl" 0 1 0 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" + "wbTextCtrlProxy" + "wxEVT_COMMAND_TEXT_UPDATED|OnIndentLeftUpdated" + "ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT" + 10103 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_indentLeft" + "" + 0 + "The left indent." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 50 + -1 "Expand" "Centre" 0 5 - 0 - 0 - 0 - 0 + 1 + 1 + 1 + 1 0 0 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnIndentLeftUpdated" - "ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT" - 10103 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_indentLeft" - "" - 0 - "The left indent." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - + "" + "" "wxStaticText: wxID_STATIC" @@ -3249,7 +3207,6 @@ 1 0 0 - "3/10/2006" "wbStaticTextProxy" "wxID_STATIC" 5105 @@ -3312,115 +3269,87 @@ "" - "wxBoxSizer H" + "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST" "dialog-control-document" "" - "sizer" + "textctrl" 0 1 0 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" + "wbTextCtrlProxy" + "wxEVT_COMMAND_TEXT_UPDATED|OnIndentLeftFirstUpdated" + "ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST" + 10104 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_indentLeftFirst" + "" + 0 + "The first line indent." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 50 + -1 "Expand" "Centre" 0 5 - 0 - 0 - 0 - 0 + 1 + 1 + 1 + 1 0 0 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnIndentLeftFirstUpdated" - "ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST" - 10104 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_indentLeftFirst" - "" - 0 - "The first line indent." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - + "" + "" "wxStaticText: wxID_STATIC" @@ -3431,7 +3360,6 @@ 1 0 0 - "3/10/2006" "wbStaticTextProxy" "wxID_STATIC" 5105 @@ -3494,115 +3422,87 @@ "" - "wxBoxSizer H" + "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT" "dialog-control-document" "" - "sizer" + "textctrl" 0 1 0 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" + "wbTextCtrlProxy" + "wxEVT_COMMAND_TEXT_UPDATED|OnIndentRightUpdated" + "ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT" + 10113 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_indentRight" + "" + 0 + "The right indent." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 50 + -1 "Expand" "Centre" 0 5 - 0 - 0 - 0 - 0 + 1 + 1 + 1 + 1 0 0 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnIndentRightUpdated" - "ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT" - 10113 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_indentRight" - "" - 0 - "The right indent." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - + "" + "" "wxStaticText: wxID_STATIC" @@ -3697,8 +3597,8 @@ "" "" "m_outlineLevelCtrl" - "Normal|1|2|3|4|5|6|7|8|9" - "Normal" + "(none)|1|2|3|4|5|6|7|8|9|10" + "(none)" "The outline level." "" "" @@ -3725,11 +3625,11 @@ "" -1 -1 - 90 + 85 -1 "Expand" "Centre" - 1 + 0 5 1 1 @@ -4010,7 +3910,7 @@ 0 "3/10/2006" "wbFlexGridSizerProxy" - "1" + "" "" 2 30 @@ -4038,7 +3938,6 @@ 1 0 0 - "3/10/2006" "wbStaticTextProxy" "wxID_STATIC" 5105 @@ -4101,115 +4000,87 @@ "" - "wxBoxSizer H" + "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE" "dialog-control-document" "" - "sizer" + "textctrl" 0 1 0 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" + "wbTextCtrlProxy" + "wxEVT_COMMAND_TEXT_UPDATED|OnSpacingBeforeUpdated" + "ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE" + 10114 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_spacingBefore" + "" + 0 + "The spacing before the paragraph." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 50 + -1 "Expand" "Centre" 0 5 - 0 - 0 - 0 - 0 + 1 + 1 + 1 + 1 0 0 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnSpacingBeforeUpdated" - "ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE" - 10114 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_spacingBefore" - "" - 0 - "The spacing before the paragraph." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - + "" + "" "wxStaticText: wxID_STATIC" @@ -4220,7 +4091,6 @@ 1 0 0 - "3/10/2006" "wbStaticTextProxy" "wxID_STATIC" 5105 @@ -4283,115 +4153,87 @@ "" - "wxBoxSizer H" + "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER" "dialog-control-document" "" - "sizer" + "textctrl" 0 1 0 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" + "wbTextCtrlProxy" + "wxEVT_COMMAND_TEXT_UPDATED|OnSpacingAfterUpdated" + "ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER" + 10116 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_spacingAfter" + "" + 0 + "" + "The spacing after the paragraph." + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 50 + -1 "Expand" "Centre" - 1 + 0 5 - 0 - 0 - 0 - 0 + 1 + 1 + 1 + 1 0 0 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnSpacingAfterUpdated" - "ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER" - 10116 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_spacingAfter" - "" - 0 - "" - "The spacing after the paragraph." - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - + "" + "" "wxStaticText: wxID_STATIC" @@ -4465,99 +4307,135 @@ "" - "wxBoxSizer H" + "wxComboBox: ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE" "dialog-control-document" "" - "sizer" + "combobox" 0 1 0 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" + "wbComboBoxProxy" + "wxEVT_COMMAND_COMBOBOX_SELECTED|OnSpacingLineSelected|||wxRichTextIndentsSpacingPage" + "ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE" + 10115 + "" + "wxComboBox" + "wxComboBox" + 1 + 0 + "" + "" + "m_spacingLine" + "(none)|Single|1.1|1.2|1.3|1.4|1.5|1.6|1.7|1.8|1.9|2" + "(none)" + "The line spacing." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 85 + -1 "Expand" "Centre" 0 5 - 0 - 0 - 0 - 0 + 1 + 1 + 1 + 1 0 0 0 - "<Any platform>" - - "wxComboBox: ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnSpacingLineSelected" - "ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE" - 10115 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_spacingLine" - "Single|1.1|1.2|1.3|1.4|1.5|1.6|1.7|1.8|1.9|2" - "Single" - "The line spacing." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 90 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - + "" + "" + + "wxCheckBox: ID_RICHTEXTINDENTSSPACINGPAGE_PAGEBREAK" + "dialog-control-document" + "" + "checkbox" + 0 + 1 + 0 + 0 + "wbCheckBoxProxy" + "ID_RICHTEXTINDENTSSPACINGPAGE_PAGEBREAK" + 10106 + "" + "wxCheckBox" + "wxCheckBox" + 1 + 0 + "" + "" + "m_pageBreakCtrl" + "&Page Break" + 0 + "Inserts a page break before the paragraph." + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + -1 + -1 + "Left" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "" + "" + @@ -10554,6 +10432,14 @@ "wbBoxSizerProxy" "Vertical" "" + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 0 0 0 @@ -13222,7 +13108,6 @@ 1 0 0 - "18/10/2006" "wbStaticTextProxy" "wxID_STATIC" 5105 @@ -13285,115 +13170,87 @@ "" - "wxBoxSizer H" + "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT" "dialog-control-document" "" - "sizer" + "textctrl" 0 1 0 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" + "wbTextCtrlProxy" + "wxEVT_COMMAND_TEXT_UPDATED|OnIndentLeftUpdated" + "ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT" + 10634 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_indentLeft" + "" + 0 + "The left indent." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 50 + -1 + "Expand" "Centre" 0 5 - 0 - 0 - 0 - 0 + 1 + 1 + 1 + 1 0 0 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnIndentLeftUpdated" - "ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT" - 10634 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_indentLeft" - "" - 0 - "The left indent." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - + "" + "" "wxStaticText: wxID_STATIC" @@ -13404,7 +13261,6 @@ 1 0 0 - "18/10/2006" "wbStaticTextProxy" "wxID_STATIC" 5105 @@ -13467,115 +13323,87 @@ "" - "wxBoxSizer H" + "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE" "dialog-control-document" "" - "sizer" + "textctrl" 0 1 0 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" + "wbTextCtrlProxy" + "wxEVT_COMMAND_TEXT_UPDATED|OnIndentFirstLineUpdated" + "ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE" + 10635 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_indentLeftFirst" + "" + 0 + "The first line indent." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 50 + -1 + "Expand" "Centre" 0 5 - 0 - 0 - 0 - 0 + 1 + 1 + 1 + 1 0 0 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnIndentFirstLineUpdated" - "ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE" - 10635 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_indentLeftFirst" - "" - 0 - "The first line indent." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - + "" + "" "wxStaticText: wxID_STATIC" @@ -13649,115 +13477,87 @@ "" - "wxBoxSizer H" + "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT" "dialog-control-document" "" - "sizer" + "textctrl" 0 1 0 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" + "wbTextCtrlProxy" + "wxEVT_COMMAND_TEXT_UPDATED|OnIndentRightUpdated" + "ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT" + 10636 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_indentRight" + "" + 0 + "The right indent." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 50 + -1 + "Expand" "Centre" 0 5 - 0 - 0 - 0 - 0 + 1 + 1 + 1 + 1 0 0 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnIndentRightUpdated" - "ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT" - 10636 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_indentRight" - "" - 0 - "The right indent." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - + "" + "" @@ -14056,7 +13856,6 @@ 1 0 0 - "18/10/2006" "wbStaticTextProxy" "wxID_STATIC" 5105 @@ -14119,115 +13918,87 @@ "" - "wxBoxSizer H" + "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE" "dialog-control-document" "" - "sizer" + "textctrl" 0 1 0 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" + "wbTextCtrlProxy" + "wxEVT_COMMAND_TEXT_UPDATED|OnSpacingBeforeUpdated" + "ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE" + 10637 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_spacingBefore" + "" + 0 + "The spacing before the paragraph." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 50 + -1 + "Expand" "Centre" 0 5 - 0 - 0 - 0 - 0 + 1 + 1 + 1 + 1 0 0 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnSpacingBeforeUpdated" - "ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE" - 10637 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_spacingBefore" - "" - 0 - "The spacing before the paragraph." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - + "" + "" "wxStaticText: wxID_STATIC" @@ -14238,7 +14009,6 @@ 1 0 0 - "18/10/2006" "wbStaticTextProxy" "wxID_STATIC" 5105 @@ -14301,115 +14071,87 @@ "" - "wxBoxSizer H" + "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER" "dialog-control-document" "" - "sizer" + "textctrl" 0 1 0 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" + "wbTextCtrlProxy" + "wxEVT_COMMAND_TEXT_UPDATED|OnSpacingAfterUpdated" + "ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER" + 10638 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_spacingAfter" + "" + 0 + "The spacing after the paragraph." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 50 + -1 + "Expand" "Centre" 0 5 - 0 - 0 - 0 - 0 + 1 + 1 + 1 + 1 0 0 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnSpacingAfterUpdated" - "ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER" - 10638 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_spacingAfter" - "" - 0 - "The spacing after the paragraph." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - + "" + "" "wxStaticText: wxID_STATIC" @@ -14483,96 +14225,69 @@ "" - "wxBoxSizer H" + "wxComboBox: ID_RICHTEXTLISTSTYLEPAGE_LINESPACING" "dialog-control-document" "" - "sizer" + "combobox" 0 1 0 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" + "wbComboBoxProxy" + "wxEVT_COMMAND_COMBOBOX_SELECTED|OnLineSpacingSelected" + "ID_RICHTEXTLISTSTYLEPAGE_LINESPACING" + 10639 + "" + "wxComboBox" + "wxComboBox" + 1 + 0 + "" + "" + "m_spacingLine" + "(none)|Single|1.1|1.2|1.3|1.4|1.5|1.6|1.7|1.8|1.9|2" + "(none)" + "The line spacing." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 85 + -1 + "Expand" "Centre" 0 5 - 0 - 0 - 0 - 0 + 1 + 1 + 1 + 1 0 0 0 - "<Any platform>" - - "wxComboBox: ID_RICHTEXTLISTSTYLEPAGE_LINESPACING" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnLineSpacingSelected" - "ID_RICHTEXTLISTSTYLEPAGE_LINESPACING" - 10639 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_spacingLine" - "Single|1.5|2" - "Single" - "The line spacing." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - + "" + "" @@ -14851,6 +14566,14 @@ "wbBoxSizerProxy" "Vertical" "" + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 0 0 0 diff --git a/src/richtext/richtextfontpage.cpp b/src/richtext/richtextfontpage.cpp index 61f4bf5145..d8bfa690bb 100644 --- a/src/richtext/richtextfontpage.cpp +++ b/src/richtext/richtextfontpage.cpp @@ -39,6 +39,10 @@ BEGIN_EVENT_TABLE( wxRichTextFontPage, wxRichTextDialogPage ) EVT_COMBOBOX( ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, wxRichTextFontPage::OnUnderliningCtrlSelected ) + EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL, wxRichTextFontPage::OnUnderliningCtrlSelected ) + + EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL, wxRichTextFontPage::OnUnderliningCtrlSelected ) + EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL, wxRichTextFontPage::OnStrikethroughctrlClick ) EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_CAPSCTRL, wxRichTextFontPage::OnCapsctrlClick ) @@ -85,7 +89,9 @@ void wxRichTextFontPage::Init() m_styleCtrl = NULL; m_weightCtrl = NULL; m_underliningCtrl = NULL; + m_textColourLabel = NULL; m_colourCtrl = NULL; + m_bgColourLabel = NULL; m_bgColourCtrl = NULL; m_strikethroughCtrl = NULL; m_capitalsCtrl = NULL; @@ -216,8 +222,9 @@ void wxRichTextFontPage::CreateControls() wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxVERTICAL); itemBoxSizer13->Add(itemBoxSizer24, 0, wxGROW, 5); - wxStaticText* itemStaticText25 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Colour:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer24->Add(itemStaticText25, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); + m_textColourLabel = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL, _("&Colour:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textColourLabel->SetValue(false); + itemBoxSizer24->Add(m_textColourLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5); m_colourCtrl = new wxRichTextColourSwatchCtrl( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_COLOURCTRL, wxDefaultPosition, wxSize(40, 20), 0 ); m_colourCtrl->SetHelpText(_("Click to change the text colour.")); @@ -228,8 +235,9 @@ void wxRichTextFontPage::CreateControls() wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxVERTICAL); itemBoxSizer13->Add(itemBoxSizer27, 0, wxGROW, 5); - wxStaticText* itemStaticText28 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Bg colour:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer27->Add(itemStaticText28, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); + m_bgColourLabel = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL, _("&Bg colour:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_bgColourLabel->SetValue(false); + itemBoxSizer27->Add(m_bgColourLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5); m_bgColourCtrl = new wxRichTextColourSwatchCtrl( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_BGCOLOURCTRL, wxDefaultPosition, wxSize(40, 20), 0 ); m_bgColourCtrl->SetHelpText(_("Click to change the text background colour.")); @@ -280,12 +288,15 @@ void wxRichTextFontPage::CreateControls() m_faceListBox->UpdateFonts(); + m_styleCtrl->Append(_("(none)")); m_styleCtrl->Append(_("Regular")); m_styleCtrl->Append(_("Italic")); + m_weightCtrl->Append(_("(none)")); m_weightCtrl->Append(_("Regular")); m_weightCtrl->Append(_("Bold")); + m_underliningCtrl->Append(_("(none)")); m_underliningCtrl->Append(_("Not underlined")); m_underliningCtrl->Append(_("Underlined")); @@ -327,10 +338,10 @@ bool wxRichTextFontPage::TransferDataFromWindow() else attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_FONT_SIZE)); - if (m_styleCtrl->GetSelection() != wxNOT_FOUND) + if (m_styleCtrl->GetSelection() != wxNOT_FOUND && m_styleCtrl->GetSelection() != 0) { wxFontStyle style; - if (m_styleCtrl->GetStringSelection() == _("Italic")) + if (m_styleCtrl->GetSelection() == 2) style = wxFONTSTYLE_ITALIC; else style = wxFONTSTYLE_NORMAL; @@ -340,10 +351,10 @@ bool wxRichTextFontPage::TransferDataFromWindow() else attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_FONT_ITALIC)); - if (m_weightCtrl->GetSelection() != wxNOT_FOUND) + if (m_weightCtrl->GetSelection() != wxNOT_FOUND && m_weightCtrl->GetSelection() != 0) { wxFontWeight weight; - if (m_weightCtrl->GetStringSelection() == _("Bold")) + if (m_weightCtrl->GetSelection() == 2) weight = wxFONTWEIGHT_BOLD; else weight = wxFONTWEIGHT_NORMAL; @@ -353,10 +364,10 @@ bool wxRichTextFontPage::TransferDataFromWindow() else attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_FONT_WEIGHT)); - if (m_underliningCtrl->GetSelection() != wxNOT_FOUND) + if (m_underliningCtrl->GetSelection() != wxNOT_FOUND && m_underliningCtrl->GetSelection() != 0) { bool underlined; - if (m_underliningCtrl->GetStringSelection() == _("Underlined")) + if (m_underliningCtrl->GetSelection() == 2) underlined = true; else underlined = false; @@ -366,14 +377,14 @@ bool wxRichTextFontPage::TransferDataFromWindow() else attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_FONT_UNDERLINE)); - if (m_colourPresent) + if (m_textColourLabel->GetValue()) { attr->SetTextColour(m_colourCtrl->GetColour()); } else attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_TEXT_COLOUR)); - if (m_bgColourPresent) + if (m_bgColourLabel->GetValue()) { attr->SetBackgroundColour(m_bgColourCtrl->GetColour()); } @@ -456,50 +467,62 @@ bool wxRichTextFontPage::TransferDataToWindow() if (attr->HasFontWeight()) { if (attr->GetFontWeight() == wxBOLD) - m_weightCtrl->SetSelection(1); + m_weightCtrl->SetSelection(2); else - m_weightCtrl->SetSelection(0); + m_weightCtrl->SetSelection(1); } else { - m_weightCtrl->SetSelection(wxNOT_FOUND); + m_weightCtrl->SetSelection(0); } if (attr->HasFontItalic()) { if (attr->GetFontStyle() == wxITALIC) - m_styleCtrl->SetSelection(1); + m_styleCtrl->SetSelection(2); else - m_styleCtrl->SetSelection(0); + m_styleCtrl->SetSelection(1); } else { - m_styleCtrl->SetSelection(wxNOT_FOUND); + m_styleCtrl->SetSelection(0); } if (attr->HasFontUnderlined()) { if (attr->GetFontUnderlined()) - m_underliningCtrl->SetSelection(1); + m_underliningCtrl->SetSelection(2); else - m_underliningCtrl->SetSelection(0); + m_underliningCtrl->SetSelection(1); } else { - m_underliningCtrl->SetSelection(wxNOT_FOUND); + m_underliningCtrl->SetSelection(0); } if (attr->HasTextColour()) { m_colourCtrl->SetColour(attr->GetTextColour()); + m_textColourLabel->SetValue(true); m_colourPresent = true; } + else + { + m_colourCtrl->SetColour(*wxBLACK); + m_textColourLabel->SetValue(false); + } if (attr->HasBackgroundColour()) { m_bgColourCtrl->SetColour(attr->GetBackgroundColour()); + m_bgColourLabel->SetValue(true); m_bgColourPresent = true; } + else + { + m_bgColourCtrl->SetColour(*wxWHITE); + m_bgColourLabel->SetValue(false); + } if (attr->HasTextEffects()) { @@ -572,11 +595,30 @@ void wxRichTextFontPage::UpdatePreview() { wxRichTextAttr attr; - if (m_colourPresent) - m_previewCtrl->SetForegroundColour(m_colourCtrl->GetBackgroundColour()); + if (m_textColourLabel->GetValue()) + m_previewCtrl->SetForegroundColour(m_colourCtrl->GetColour()); + else + { + m_previewCtrl->SetForegroundColour(*wxBLACK); + if (!(m_colourCtrl->GetColour() == *wxBLACK)) + { + m_colourCtrl->SetColour(*wxBLACK); + m_colourCtrl->Refresh(); + } + } - if (m_bgColourPresent) - m_previewCtrl->SetBackgroundColour(m_bgColourCtrl->GetBackgroundColour()); + if (m_bgColourLabel->GetValue()) + m_previewCtrl->SetBackgroundColour(m_bgColourCtrl->GetColour()); + else + { + m_previewCtrl->SetBackgroundColour(*wxWHITE); + + if (!(m_bgColourCtrl->GetColour() == *wxWHITE)) + { + m_bgColourCtrl->SetColour(*wxWHITE); + m_bgColourCtrl->Refresh(); + } + } if (m_faceListBox->GetSelection() != wxNOT_FOUND) { @@ -592,10 +634,10 @@ void wxRichTextFontPage::UpdatePreview() attr.SetFontSize(sz); } - if (m_styleCtrl->GetSelection() != wxNOT_FOUND) + if (m_styleCtrl->GetSelection() != wxNOT_FOUND && m_styleCtrl->GetSelection() != 0) { wxFontStyle style; - if (m_styleCtrl->GetStringSelection() == _("Italic")) + if (m_styleCtrl->GetSelection() == 2) style = wxFONTSTYLE_ITALIC; else style = wxFONTSTYLE_NORMAL; @@ -603,10 +645,10 @@ void wxRichTextFontPage::UpdatePreview() attr.SetFontStyle(style); } - if (m_weightCtrl->GetSelection() != wxNOT_FOUND) + if (m_weightCtrl->GetSelection() != wxNOT_FOUND && m_weightCtrl->GetSelection() != 0) { wxFontWeight weight; - if (m_weightCtrl->GetStringSelection() == _("Bold")) + if (m_weightCtrl->GetSelection() == 2) weight = wxFONTWEIGHT_BOLD; else weight = wxFONTWEIGHT_NORMAL; @@ -614,10 +656,10 @@ void wxRichTextFontPage::UpdatePreview() attr.SetFontWeight(weight); } - if (m_underliningCtrl->GetSelection() != wxNOT_FOUND) + if (m_underliningCtrl->GetSelection() != wxNOT_FOUND && m_underliningCtrl->GetSelection() != 0) { bool underlined; - if (m_underliningCtrl->GetStringSelection() == _("Underlined")) + if (m_underliningCtrl->GetSelection() == 2) underlined = true; else underlined = false; @@ -740,11 +782,15 @@ void wxRichTextFontPage::OnSizeTextCtrlUpdated( wxCommandEvent& WXUNUSED(event) void wxRichTextFontPage::OnSizeListBoxSelected( wxCommandEvent& event ) { + bool oldDontUpdate = m_dontUpdate; m_dontUpdate = true; m_sizeTextCtrl->SetValue(event.GetString()); - m_dontUpdate = false; + m_dontUpdate = oldDontUpdate; + + if (m_dontUpdate) + return; UpdatePreview(); } @@ -755,11 +801,15 @@ void wxRichTextFontPage::OnSizeListBoxSelected( wxCommandEvent& event ) void wxRichTextFontPage::OnFaceListBoxSelected( wxCommandEvent& WXUNUSED(event) ) { + bool oldDontUpdate = m_dontUpdate; m_dontUpdate = true; m_faceTextCtrl->SetValue(m_faceListBox->GetFaceName(m_faceListBox->GetSelection())); - m_dontUpdate = false; + m_dontUpdate = oldDontUpdate; + + if (m_dontUpdate) + return; UpdatePreview(); } @@ -770,6 +820,9 @@ void wxRichTextFontPage::OnFaceListBoxSelected( wxCommandEvent& WXUNUSED(event) void wxRichTextFontPage::OnStyleCtrlSelected( wxCommandEvent& WXUNUSED(event) ) { + if (m_dontUpdate) + return; + UpdatePreview(); } @@ -780,6 +833,9 @@ void wxRichTextFontPage::OnStyleCtrlSelected( wxCommandEvent& WXUNUSED(event) ) void wxRichTextFontPage::OnUnderliningCtrlSelected( wxCommandEvent& WXUNUSED(event) ) { + if (m_dontUpdate) + return; + UpdatePreview(); } @@ -790,6 +846,9 @@ void wxRichTextFontPage::OnUnderliningCtrlSelected( wxCommandEvent& WXUNUSED(eve void wxRichTextFontPage::OnWeightCtrlSelected( wxCommandEvent& WXUNUSED(event) ) { + if (m_dontUpdate) + return; + UpdatePreview(); } @@ -800,6 +859,19 @@ void wxRichTextFontPage::OnColourClicked( wxCommandEvent& event ) else if (event.GetId() == m_bgColourCtrl->GetId()) m_bgColourPresent = true; + m_dontUpdate = true; + + if (event.GetId() == m_colourCtrl->GetId()) + { + m_textColourLabel->SetValue(true); + } + else if (event.GetId() == m_bgColourCtrl->GetId()) + { + m_bgColourLabel->SetValue(true); + } + + m_dontUpdate = false; + UpdatePreview(); } /*! @@ -808,6 +880,9 @@ void wxRichTextFontPage::OnColourClicked( wxCommandEvent& event ) void wxRichTextFontPage::OnStrikethroughctrlClick( wxCommandEvent& WXUNUSED(event) ) { + if (m_dontUpdate) + return; + UpdatePreview(); } @@ -817,6 +892,9 @@ void wxRichTextFontPage::OnStrikethroughctrlClick( wxCommandEvent& WXUNUSED(even void wxRichTextFontPage::OnCapsctrlClick( wxCommandEvent& WXUNUSED(event) ) { + if (m_dontUpdate) + return; + UpdatePreview(); } @@ -826,6 +904,9 @@ void wxRichTextFontPage::OnCapsctrlClick( wxCommandEvent& WXUNUSED(event) ) void wxRichTextFontPage::OnRichtextfontpageSuperscriptClick( wxCommandEvent& WXUNUSED(event) ) { + if (m_dontUpdate) + return; + if ( m_superscriptCtrl->Get3StateValue() == wxCHK_CHECKED) m_subscriptCtrl->Set3StateValue( wxCHK_UNCHECKED ); @@ -838,6 +919,9 @@ void wxRichTextFontPage::OnRichtextfontpageSuperscriptClick( wxCommandEvent& WXU void wxRichTextFontPage::OnRichtextfontpageSubscriptClick( wxCommandEvent& WXUNUSED(event) ) { + if (m_dontUpdate) + return; + if ( m_subscriptCtrl->Get3StateValue() == wxCHK_CHECKED) m_superscriptCtrl->Set3StateValue( wxCHK_UNCHECKED ); diff --git a/src/richtext/richtextindentspage.cpp b/src/richtext/richtextindentspage.cpp index f73bb16211..604476ae3e 100644 --- a/src/richtext/richtextindentspage.cpp +++ b/src/richtext/richtextindentspage.cpp @@ -92,6 +92,7 @@ void wxRichTextIndentsSpacingPage::Init() m_spacingBefore = NULL; m_spacingAfter = NULL; m_spacingLine = NULL; + m_pageBreakCtrl = NULL; m_previewCtrl = NULL; ////@end wxRichTextIndentsSpacingPage member initialisation @@ -207,44 +208,35 @@ void wxRichTextIndentsSpacingPage::CreateControls() wxStaticText* itemStaticText23 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Left:"), wxDefaultPosition, wxDefaultSize, 0 ); itemFlexGridSizer22->Add(itemStaticText23, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer22->Add(itemBoxSizer24, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); - m_indentLeft = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); m_indentLeft->SetHelpText(_("The left indent.")); if (wxRichTextIndentsSpacingPage::ShowToolTips()) m_indentLeft->SetToolTip(_("The left indent.")); - itemBoxSizer24->Add(m_indentLeft, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemFlexGridSizer22->Add(m_indentLeft, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxStaticText* itemStaticText26 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Left (&first line):"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer22->Add(itemStaticText26, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer22->Add(itemBoxSizer27, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); + wxStaticText* itemStaticText25 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Left (&first line):"), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer22->Add(itemStaticText25, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); m_indentLeftFirst = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); m_indentLeftFirst->SetHelpText(_("The first line indent.")); if (wxRichTextIndentsSpacingPage::ShowToolTips()) m_indentLeftFirst->SetToolTip(_("The first line indent.")); - itemBoxSizer27->Add(m_indentLeftFirst, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemFlexGridSizer22->Add(m_indentLeftFirst, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxStaticText* itemStaticText29 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer22->Add(itemStaticText29, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer22->Add(itemBoxSizer30, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); + wxStaticText* itemStaticText27 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer22->Add(itemStaticText27, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); m_indentRight = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); m_indentRight->SetHelpText(_("The right indent.")); if (wxRichTextIndentsSpacingPage::ShowToolTips()) m_indentRight->SetToolTip(_("The right indent.")); - itemBoxSizer30->Add(m_indentRight, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemFlexGridSizer22->Add(m_indentRight, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxStaticText* itemStaticText32 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Outline level:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer22->Add(itemStaticText32, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxStaticText* itemStaticText29 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Outline level:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer22->Add(itemStaticText29, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); wxArrayString m_outlineLevelCtrlStrings; - m_outlineLevelCtrlStrings.Add(_("Normal")); + m_outlineLevelCtrlStrings.Add(_("(none)")); m_outlineLevelCtrlStrings.Add(_("1")); m_outlineLevelCtrlStrings.Add(_("2")); m_outlineLevelCtrlStrings.Add(_("3")); @@ -254,65 +246,57 @@ void wxRichTextIndentsSpacingPage::CreateControls() m_outlineLevelCtrlStrings.Add(_("7")); m_outlineLevelCtrlStrings.Add(_("8")); m_outlineLevelCtrlStrings.Add(_("9")); - m_outlineLevelCtrl = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_OUTLINELEVEL, _("Normal"), wxDefaultPosition, wxSize(90, -1), m_outlineLevelCtrlStrings, wxCB_READONLY ); - m_outlineLevelCtrl->SetStringSelection(_("Normal")); + m_outlineLevelCtrlStrings.Add(_("10")); + m_outlineLevelCtrl = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_OUTLINELEVEL, _("(none)"), wxDefaultPosition, wxSize(85, -1), m_outlineLevelCtrlStrings, wxCB_READONLY ); + m_outlineLevelCtrl->SetStringSelection(_("(none)")); m_outlineLevelCtrl->SetHelpText(_("The outline level.")); if (wxRichTextIndentsSpacingPage::ShowToolTips()) m_outlineLevelCtrl->SetToolTip(_("The outline level.")); - itemFlexGridSizer22->Add(m_outlineLevelCtrl, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemFlexGridSizer22->Add(m_outlineLevelCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - wxStaticLine* itemStaticLine35 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - itemBoxSizer4->Add(itemStaticLine35, 0, wxGROW|wxTOP|wxBOTTOM, 5); + wxStaticLine* itemStaticLine32 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + itemBoxSizer4->Add(itemStaticLine32, 0, wxGROW|wxTOP|wxBOTTOM, 5); itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - wxBoxSizer* itemBoxSizer37 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer4->Add(itemBoxSizer37, 0, wxGROW, 5); + wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL); + itemBoxSizer4->Add(itemBoxSizer34, 0, wxGROW, 5); - wxStaticText* itemStaticText38 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Spacing (tenths of a mm)"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer37->Add(itemStaticText38, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); + wxStaticText* itemStaticText35 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Spacing (tenths of a mm)"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer34->Add(itemStaticText35, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); - wxBoxSizer* itemBoxSizer39 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer37->Add(itemBoxSizer39, 0, wxALIGN_LEFT|wxALL, 5); + wxBoxSizer* itemBoxSizer36 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer34->Add(itemBoxSizer36, 0, wxALIGN_LEFT|wxALL, 5); - itemBoxSizer39->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5); + itemBoxSizer36->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5); - wxFlexGridSizer* itemFlexGridSizer41 = new wxFlexGridSizer(30, 2, 0, 0); - itemFlexGridSizer41->AddGrowableCol(1); - itemBoxSizer39->Add(itemFlexGridSizer41, 0, wxALIGN_CENTER_VERTICAL, 5); + wxFlexGridSizer* itemFlexGridSizer38 = new wxFlexGridSizer(30, 2, 0, 0); + itemBoxSizer36->Add(itemFlexGridSizer38, 0, wxALIGN_CENTER_VERTICAL, 5); - wxStaticText* itemStaticText42 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Before a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer41->Add(itemStaticText42, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxBoxSizer* itemBoxSizer43 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer41->Add(itemBoxSizer43, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); + wxStaticText* itemStaticText39 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Before a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer38->Add(itemStaticText39, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); m_spacingBefore = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); m_spacingBefore->SetHelpText(_("The spacing before the paragraph.")); if (wxRichTextIndentsSpacingPage::ShowToolTips()) m_spacingBefore->SetToolTip(_("The spacing before the paragraph.")); - itemBoxSizer43->Add(m_spacingBefore, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemFlexGridSizer38->Add(m_spacingBefore, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxStaticText* itemStaticText45 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&After a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer41->Add(itemStaticText45, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxBoxSizer* itemBoxSizer46 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer41->Add(itemBoxSizer46, 1, wxGROW|wxALIGN_CENTER_VERTICAL, 5); + wxStaticText* itemStaticText41 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&After a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer38->Add(itemStaticText41, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); m_spacingAfter = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); if (wxRichTextIndentsSpacingPage::ShowToolTips()) m_spacingAfter->SetToolTip(_("The spacing after the paragraph.")); - itemBoxSizer46->Add(m_spacingAfter, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemFlexGridSizer38->Add(m_spacingAfter, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxStaticText* itemStaticText48 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("L&ine spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer41->Add(itemStaticText48, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxBoxSizer* itemBoxSizer49 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer41->Add(itemBoxSizer49, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); + wxStaticText* itemStaticText43 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("L&ine spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer38->Add(itemStaticText43, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); wxArrayString m_spacingLineStrings; + m_spacingLineStrings.Add(_("(none)")); m_spacingLineStrings.Add(_("Single")); m_spacingLineStrings.Add(_("1.1")); m_spacingLineStrings.Add(_("1.2")); @@ -324,12 +308,19 @@ void wxRichTextIndentsSpacingPage::CreateControls() m_spacingLineStrings.Add(_("1.8")); m_spacingLineStrings.Add(_("1.9")); m_spacingLineStrings.Add(_("2")); - m_spacingLine = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE, _("Single"), wxDefaultPosition, wxSize(90, -1), m_spacingLineStrings, wxCB_READONLY ); - m_spacingLine->SetStringSelection(_("Single")); + m_spacingLine = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE, _("(none)"), wxDefaultPosition, wxSize(85, -1), m_spacingLineStrings, wxCB_READONLY ); + m_spacingLine->SetStringSelection(_("(none)")); m_spacingLine->SetHelpText(_("The line spacing.")); if (wxRichTextIndentsSpacingPage::ShowToolTips()) m_spacingLine->SetToolTip(_("The line spacing.")); - itemBoxSizer49->Add(m_spacingLine, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemFlexGridSizer38->Add(m_spacingLine, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); + + m_pageBreakCtrl = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_PAGEBREAK, _("&Page Break"), wxDefaultPosition, wxDefaultSize, 0 ); + m_pageBreakCtrl->SetValue(false); + m_pageBreakCtrl->SetHelpText(_("Inserts a page break before the paragraph.")); + if (wxRichTextIndentsSpacingPage::ShowToolTips()) + m_pageBreakCtrl->SetToolTip(_("Inserts a page break before the paragraph.")); + itemBoxSizer34->Add(m_pageBreakCtrl, 0, wxALIGN_LEFT|wxALL, 5); itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5); @@ -448,9 +439,9 @@ bool wxRichTextIndentsSpacingPage::TransferDataFromWindow() else attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_PARA_SPACING_BEFORE)); - int spacingIndex = m_spacingLine->GetSelection(); + int spacingIndex = m_spacingLine->GetSelection() - 1; int lineSpacing = 0; - if (spacingIndex != -1) + if (spacingIndex > -1) lineSpacing = 10 + spacingIndex; if (lineSpacing == 0) @@ -459,8 +450,15 @@ bool wxRichTextIndentsSpacingPage::TransferDataFromWindow() attr->SetLineSpacing(lineSpacing); int outlineLevel = m_outlineLevelCtrl->GetSelection(); - if (outlineLevel != wxNOT_FOUND) - attr->SetOutlineLevel(outlineLevel); + if (outlineLevel == wxNOT_FOUND || outlineLevel == 0) + { + attr->SetOutlineLevel(-1); + attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_OUTLINE_LEVEL)); + } + else + attr->SetOutlineLevel(outlineLevel-1); + + attr->SetPageBreak(m_pageBreakCtrl->GetValue()); return true; } @@ -536,14 +534,14 @@ bool wxRichTextIndentsSpacingPage::TransferDataToWindow() int lineSpacing = attr->GetLineSpacing(); if (lineSpacing >= 10 && lineSpacing <= 20) - index = lineSpacing - 10; + index = (lineSpacing - 10) + 1; else - index = -1; + index = 0; m_spacingLine->SetSelection(index); } else - m_spacingLine->SetSelection(-1); + m_spacingLine->SetSelection(0); if (attr->HasOutlineLevel()) { @@ -553,10 +551,12 @@ bool wxRichTextIndentsSpacingPage::TransferDataToWindow() if (outlineLevel > 9) outlineLevel = 9; - m_outlineLevelCtrl->SetSelection(outlineLevel); + m_outlineLevelCtrl->SetSelection(outlineLevel+1); } else - m_outlineLevelCtrl->SetSelection(-1); + m_outlineLevelCtrl->SetSelection(0); + + m_pageBreakCtrl->SetValue(attr->HasPageBreak()); UpdatePreview(); diff --git a/src/richtext/richtextliststylepage.cpp b/src/richtext/richtextliststylepage.cpp index ec7a360cde..9f7710fe82 100644 --- a/src/richtext/richtextliststylepage.cpp +++ b/src/richtext/richtextliststylepage.cpp @@ -382,91 +382,88 @@ void wxRichTextListStylePage::CreateControls() wxStaticText* itemStaticText58 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Left:"), wxDefaultPosition, wxDefaultSize, 0 ); itemFlexGridSizer57->Add(itemStaticText58, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxBoxSizer* itemBoxSizer59 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer57->Add(itemBoxSizer59, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); m_indentLeft = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); m_indentLeft->SetHelpText(_("The left indent.")); if (wxRichTextListStylePage::ShowToolTips()) m_indentLeft->SetToolTip(_("The left indent.")); - itemBoxSizer59->Add(m_indentLeft, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemFlexGridSizer57->Add(m_indentLeft, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxStaticText* itemStaticText61 = new wxStaticText( itemPanel37, wxID_STATIC, _("Left (&first line):"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer57->Add(itemStaticText61, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxStaticText* itemStaticText60 = new wxStaticText( itemPanel37, wxID_STATIC, _("Left (&first line):"), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer57->Add(itemStaticText60, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxBoxSizer* itemBoxSizer62 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer57->Add(itemBoxSizer62, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); m_indentLeftFirst = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); m_indentLeftFirst->SetHelpText(_("The first line indent.")); if (wxRichTextListStylePage::ShowToolTips()) m_indentLeftFirst->SetToolTip(_("The first line indent.")); - itemBoxSizer62->Add(m_indentLeftFirst, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemFlexGridSizer57->Add(m_indentLeftFirst, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxStaticText* itemStaticText64 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer57->Add(itemStaticText64, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxStaticText* itemStaticText62 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer57->Add(itemStaticText62, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxBoxSizer* itemBoxSizer65 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer57->Add(itemBoxSizer65, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); m_indentRight = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); m_indentRight->SetHelpText(_("The right indent.")); if (wxRichTextListStylePage::ShowToolTips()) m_indentRight->SetToolTip(_("The right indent.")); - itemBoxSizer65->Add(m_indentRight, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemFlexGridSizer57->Add(m_indentRight, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); itemBoxSizer39->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - wxStaticLine* itemStaticLine68 = new wxStaticLine( itemPanel37, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - itemBoxSizer39->Add(itemStaticLine68, 0, wxGROW|wxTOP|wxBOTTOM, 5); + wxStaticLine* itemStaticLine65 = new wxStaticLine( itemPanel37, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + itemBoxSizer39->Add(itemStaticLine65, 0, wxGROW|wxTOP|wxBOTTOM, 5); itemBoxSizer39->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - wxBoxSizer* itemBoxSizer70 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer39->Add(itemBoxSizer70, 0, wxGROW, 5); - wxStaticText* itemStaticText71 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Spacing (tenths of a mm)"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer70->Add(itemStaticText71, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); + wxBoxSizer* itemBoxSizer67 = new wxBoxSizer(wxVERTICAL); + itemBoxSizer39->Add(itemBoxSizer67, 0, wxGROW, 5); + wxStaticText* itemStaticText68 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Spacing (tenths of a mm)"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer67->Add(itemStaticText68, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); - wxBoxSizer* itemBoxSizer72 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer70->Add(itemBoxSizer72, 0, wxALIGN_LEFT|wxALL, 5); - itemBoxSizer72->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5); + wxBoxSizer* itemBoxSizer69 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer67->Add(itemBoxSizer69, 0, wxALIGN_LEFT|wxALL, 5); + itemBoxSizer69->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5); - wxFlexGridSizer* itemFlexGridSizer74 = new wxFlexGridSizer(0, 2, 0, 0); - itemBoxSizer72->Add(itemFlexGridSizer74, 0, wxALIGN_CENTER_VERTICAL, 5); - wxStaticText* itemStaticText75 = new wxStaticText( itemPanel37, wxID_STATIC, _("Before a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer74->Add(itemStaticText75, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxFlexGridSizer* itemFlexGridSizer71 = new wxFlexGridSizer(0, 2, 0, 0); + itemBoxSizer69->Add(itemFlexGridSizer71, 0, wxALIGN_CENTER_VERTICAL, 5); + wxStaticText* itemStaticText72 = new wxStaticText( itemPanel37, wxID_STATIC, _("Before a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer71->Add(itemStaticText72, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxBoxSizer* itemBoxSizer76 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer74->Add(itemBoxSizer76, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); m_spacingBefore = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); m_spacingBefore->SetHelpText(_("The spacing before the paragraph.")); if (wxRichTextListStylePage::ShowToolTips()) m_spacingBefore->SetToolTip(_("The spacing before the paragraph.")); - itemBoxSizer76->Add(m_spacingBefore, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemFlexGridSizer71->Add(m_spacingBefore, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxStaticText* itemStaticText78 = new wxStaticText( itemPanel37, wxID_STATIC, _("After a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer74->Add(itemStaticText78, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxStaticText* itemStaticText74 = new wxStaticText( itemPanel37, wxID_STATIC, _("After a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer71->Add(itemStaticText74, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxBoxSizer* itemBoxSizer79 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer74->Add(itemBoxSizer79, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); m_spacingAfter = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); m_spacingAfter->SetHelpText(_("The spacing after the paragraph.")); if (wxRichTextListStylePage::ShowToolTips()) m_spacingAfter->SetToolTip(_("The spacing after the paragraph.")); - itemBoxSizer79->Add(m_spacingAfter, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemFlexGridSizer71->Add(m_spacingAfter, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxStaticText* itemStaticText81 = new wxStaticText( itemPanel37, wxID_STATIC, _("Line spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer74->Add(itemStaticText81, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxStaticText* itemStaticText76 = new wxStaticText( itemPanel37, wxID_STATIC, _("Line spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer71->Add(itemStaticText76, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxBoxSizer* itemBoxSizer82 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer74->Add(itemBoxSizer82, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); wxArrayString m_spacingLineStrings; + m_spacingLineStrings.Add(_("(none)")); m_spacingLineStrings.Add(_("Single")); + m_spacingLineStrings.Add(_("1.1")); + m_spacingLineStrings.Add(_("1.2")); + m_spacingLineStrings.Add(_("1.3")); + m_spacingLineStrings.Add(_("1.4")); m_spacingLineStrings.Add(_("1.5")); + m_spacingLineStrings.Add(_("1.6")); + m_spacingLineStrings.Add(_("1.7")); + m_spacingLineStrings.Add(_("1.8")); + m_spacingLineStrings.Add(_("1.9")); m_spacingLineStrings.Add(_("2")); - m_spacingLine = new wxComboBox( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_LINESPACING, _("Single"), wxDefaultPosition, wxDefaultSize, m_spacingLineStrings, wxCB_READONLY ); - m_spacingLine->SetStringSelection(_("Single")); + m_spacingLine = new wxComboBox( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_LINESPACING, _("(none)"), wxDefaultPosition, wxSize(85, -1), m_spacingLineStrings, wxCB_READONLY ); + m_spacingLine->SetStringSelection(_("(none)")); m_spacingLine->SetHelpText(_("The line spacing.")); if (wxRichTextListStylePage::ShowToolTips()) m_spacingLine->SetToolTip(_("The line spacing.")); - itemBoxSizer82->Add(m_spacingLine, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemFlexGridSizer71->Add(m_spacingLine, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); itemNotebook9->AddPage(itemPanel37, _("Spacing")); @@ -631,14 +628,10 @@ bool wxRichTextListStylePage::TransferDataFromWindow() else attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_PARA_SPACING_BEFORE)); - int spacingIndex = m_spacingLine->GetSelection(); + int spacingIndex = m_spacingLine->GetSelection() - 1; int lineSpacing = 0; - if (spacingIndex == 0) - lineSpacing = 10; - else if (spacingIndex == 1) - lineSpacing = 15; - else if (spacingIndex == 2) - lineSpacing = 20; + if (spacingIndex > -1) + lineSpacing = 10 + spacingIndex; if (lineSpacing == 0) attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_LINE_SPACING)); @@ -785,19 +778,15 @@ void wxRichTextListStylePage::DoTransferDataToWindow() int index = 0; int lineSpacing = attr->GetLineSpacing(); - if (lineSpacing == 10) - index = 0; - else if (lineSpacing == 15) - index = 1; - else if (lineSpacing == 20) - index = 2; + if (lineSpacing >= 10 && lineSpacing <= 20) + index = (lineSpacing - 10) + 1; else - index = -1; + index = 0; m_spacingLine->SetSelection(index); } else - m_spacingLine->SetSelection(-1); + m_spacingLine->SetSelection(0); /// BULLETS if (attr->HasBulletStyle()) diff --git a/tests/Makefile.in b/tests/Makefile.in index 61c235eaee..26ae782b00 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -46,7 +46,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 2.9 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib TEST_CXXFLAGS = $(__test_PCH_INC) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ @@ -166,6 +166,7 @@ TEST_GUI_OBJECTS = \ test_gui_choicebooktest.o \ test_gui_choicetest.o \ test_gui_comboboxtest.o \ + test_gui_dataviewctrltest.o \ test_gui_datepickerctrltest.o \ test_gui_frametest.o \ test_gui_gaugetest.o \ @@ -732,6 +733,9 @@ test_gui_choicetest.o: $(srcdir)/controls/choicetest.cpp $(TEST_GUI_ODEP) test_gui_comboboxtest.o: $(srcdir)/controls/comboboxtest.cpp $(TEST_GUI_ODEP) $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/comboboxtest.cpp +test_gui_dataviewctrltest.o: $(srcdir)/controls/dataviewctrltest.cpp $(TEST_GUI_ODEP) + $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/dataviewctrltest.cpp + test_gui_datepickerctrltest.o: $(srcdir)/controls/datepickerctrltest.cpp $(TEST_GUI_ODEP) $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/datepickerctrltest.cpp diff --git a/tests/controls/dataviewctrltest.cpp b/tests/controls/dataviewctrltest.cpp new file mode 100644 index 0000000000..60d1a38270 --- /dev/null +++ b/tests/controls/dataviewctrltest.cpp @@ -0,0 +1,140 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: tests/controls/treectrltest.cpp +// Purpose: wxDataViewCtrl unit test +// Author: Vaclav Slavik +// Created: 2011-08-08 +// RCS-ID: $Id$ +// Copyright: (c) 2011 Vaclav Slavik +/////////////////////////////////////////////////////////////////////////////// + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +#include "testprec.h" + +#if wxUSE_DATAVIEWCTRL + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/app.h" +#include "wx/dataview.h" + +#include "testableframe.h" + +// ---------------------------------------------------------------------------- +// test class +// ---------------------------------------------------------------------------- + +class DataViewCtrlTestCase : public CppUnit::TestCase +{ +public: + DataViewCtrlTestCase() { } + + virtual void setUp(); + virtual void tearDown(); + +private: + CPPUNIT_TEST_SUITE( DataViewCtrlTestCase ); + CPPUNIT_TEST( DeleteSelected ); + CPPUNIT_TEST( DeleteNotSelected ); + CPPUNIT_TEST_SUITE_END(); + + void DeleteSelected(); + void DeleteNotSelected(); + + // the dataview control itself + wxDataViewTreeCtrl *m_dvc; + + // and some of its items + wxDataViewItem m_root, + m_child1, + m_child2, + m_grandchild; + + DECLARE_NO_COPY_CLASS(DataViewCtrlTestCase) +}; + +// register in the unnamed registry so that these tests are run by default +CPPUNIT_TEST_SUITE_REGISTRATION( DataViewCtrlTestCase ); + +// also include in its own registry so that these tests can be run alone +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( DataViewCtrlTestCase, "DataViewCtrlTestCase" ); + +// ---------------------------------------------------------------------------- +// test initialization +// ---------------------------------------------------------------------------- + +void DataViewCtrlTestCase::setUp() +{ + m_dvc = new wxDataViewTreeCtrl(wxTheApp->GetTopWindow(), + wxID_ANY, + wxDefaultPosition, + wxSize(400, 200), + wxDV_MULTIPLE); + + m_root = m_dvc->AppendContainer(wxDataViewItem(), "The root"); + m_child1 = m_dvc->AppendContainer(m_root, "child1"); + m_grandchild = m_dvc->AppendItem(m_child1, "grandchild"); + m_child2 = m_dvc->AppendItem(m_root, "child2"); + + m_dvc->SetSize(400, 200); + m_dvc->ExpandAncestors(m_root); + m_dvc->Refresh(); + m_dvc->Update(); +} + +void DataViewCtrlTestCase::tearDown() +{ + delete m_dvc; + m_dvc = NULL; + + m_root = + m_child1 = + m_child2 = + m_grandchild = wxDataViewItem(); +} + +// ---------------------------------------------------------------------------- +// the tests themselves +// ---------------------------------------------------------------------------- + +void DataViewCtrlTestCase::DeleteSelected() +{ + wxDataViewItemArray sel; + sel.push_back(m_child1); + sel.push_back(m_grandchild); + sel.push_back(m_child2); + m_dvc->SetSelections(sel); + + // delete a selected item + m_dvc->DeleteItem(m_child1); + + m_dvc->GetSelections(sel); + + // m_child1 and its children should be removed from the selection now + CPPUNIT_ASSERT( sel.size() == 1 ); + CPPUNIT_ASSERT( sel[0] == m_child2 ); +} + +void DataViewCtrlTestCase::DeleteNotSelected() +{ + wxDataViewItemArray sel; + sel.push_back(m_child1); + sel.push_back(m_grandchild); + m_dvc->SetSelections(sel); + + // delete unselected item + m_dvc->DeleteItem(m_child2); + + m_dvc->GetSelections(sel); + + // m_child1 and its children should be removed from the selection now + CPPUNIT_ASSERT( sel.size() == 2 ); + CPPUNIT_ASSERT( sel[0] == m_child1 ); + CPPUNIT_ASSERT( sel[1] == m_grandchild ); +} + +#endif //wxUSE_TREECTRL diff --git a/tests/controls/textctrltest.cpp b/tests/controls/textctrltest.cpp index 24213ce94f..1c001d3ac2 100644 --- a/tests/controls/textctrltest.cpp +++ b/tests/controls/textctrltest.cpp @@ -59,6 +59,9 @@ private: CPPUNIT_TEST( Style ); CPPUNIT_TEST( Lines ); CPPUNIT_TEST( LogTextCtrl ); + CPPUNIT_TEST( PositionToCoords ); + CPPUNIT_TEST( PositionToCoordsRich ); + CPPUNIT_TEST( PositionToCoordsRich2 ); CPPUNIT_TEST_SUITE_END(); void MultiLineReplace(); @@ -71,6 +74,11 @@ private: void Style(); void Lines(); void LogTextCtrl(); + void PositionToCoords(); + void PositionToCoordsRich(); + void PositionToCoordsRich2(); + + void DoPositionToCoordsTestWithStyle(long style); wxTextCtrl *m_text; @@ -380,7 +388,6 @@ void TextCtrlTestCase::Style() void TextCtrlTestCase::Lines() { -#ifndef __WXOSX__ delete m_text; m_text = new wxTextCtrl(wxTheApp->GetTopWindow(), wxID_ANY, "", wxDefaultPosition, wxSize(400, 200), wxTE_MULTILINE | wxTE_DONTWRAP); @@ -399,6 +406,17 @@ void TextCtrlTestCase::Lines() CPPUNIT_ASSERT_EQUAL(5, m_text->GetNumberOfLines()); CPPUNIT_ASSERT_EQUAL(0, m_text->GetLineLength(3)); CPPUNIT_ASSERT_EQUAL("", m_text->GetLineText(3)); + + // Verify that wrapped lines count as 2 lines. + // + // This currently doesn't work neither in wxGTK nor wxOSX/Cocoa, see + // #12366, where GetNumberOfLines() always returns the number of logical, + // not physical, lines. + m_text->AppendText("\n" + wxString(50, '1') + ' ' + wxString(50, '2')); +#if defined(__WXGTK__) || defined(__WXOSX_COCOA__) + CPPUNIT_ASSERT_EQUAL(6, m_text->GetNumberOfLines()); +#else + CPPUNIT_ASSERT_EQUAL(7, m_text->GetNumberOfLines()); #endif } @@ -422,4 +440,98 @@ void TextCtrlTestCase::LogTextCtrl() CPPUNIT_ASSERT(!m_text->IsEmpty()); } +void TextCtrlTestCase::PositionToCoords() +{ + DoPositionToCoordsTestWithStyle(0); +} + +void TextCtrlTestCase::PositionToCoordsRich() +{ + DoPositionToCoordsTestWithStyle(wxTE_RICH); +} + +void TextCtrlTestCase::PositionToCoordsRich2() +{ + DoPositionToCoordsTestWithStyle(wxTE_RICH2); +} + +void TextCtrlTestCase::DoPositionToCoordsTestWithStyle(long style) +{ + static const int TEXT_HEIGHT = 200; + + delete m_text; + m_text = new wxTextCtrl(wxTheApp->GetTopWindow(), wxID_ANY, "", + wxDefaultPosition, wxSize(400, TEXT_HEIGHT), + wxTE_MULTILINE | style); + + // Asking for invalid index should fail. + WX_ASSERT_FAILS_WITH_ASSERT( m_text->PositionToCoords(1) ); + + // Getting position shouldn't return wxDefaultPosition except if the method + // is not implemented at all in the current port. + const wxPoint pos0 = m_text->PositionToCoords(0); + if ( pos0 == wxDefaultPosition ) + { +#if defined(__WXMSW__) || defined(__WXGTK20__) + CPPUNIT_FAIL( "PositionToCoords() unexpectedly failed." ); +#endif + return; + } + + CPPUNIT_ASSERT(pos0.x >= 0); + CPPUNIT_ASSERT(pos0.y >= 0); + + + m_text->SetValue("Hello"); + wxYield(); // Let GTK layout the control correctly. + + // Position of non-first character should be positive. + const long posHello4 = m_text->PositionToCoords(4).x; + CPPUNIT_ASSERT( posHello4 > 0 ); + + // Asking for position beyond the last character should succeed and return + // reasonable result. + CPPUNIT_ASSERT( m_text->PositionToCoords(5).x > posHello4 ); + + // But asking for the next position should fail. + WX_ASSERT_FAILS_WITH_ASSERT( m_text->PositionToCoords(6) ); + + // Test getting the coordinates of the last character when it is in the + // beginning of a new line to exercise MSW code which has specific logic + // for it. + m_text->AppendText("\n"); + const wxPoint posLast = m_text->PositionToCoords(m_text->GetLastPosition()); + CPPUNIT_ASSERT_EQUAL( pos0.x, posLast.x ); + CPPUNIT_ASSERT( posLast.y > 0 ); + + + // Add enough contents to the control to make sure it has a scrollbar. + m_text->SetValue("First line" + wxString(50, '\n') + "Last line"); + m_text->SetInsertionPoint(0); + wxYield(); // Let GTK layout the control correctly. + + // This shouldn't change anything for the first position coordinates. + CPPUNIT_ASSERT_EQUAL( pos0, m_text->PositionToCoords(0) ); + + // And the last one must be beyond the window boundary and so not be + // visible -- but getting its coordinate should still work. + CPPUNIT_ASSERT + ( + m_text->PositionToCoords(m_text->GetLastPosition()).y > TEXT_HEIGHT + ); + + + // Now make it scroll to the end and check that the first position now has + // negative offset as its above the visible part of the window while the + // last position is in its bounds. + m_text->SetInsertionPointEnd(); + + CPPUNIT_ASSERT( m_text->PositionToCoords(0).y < 0 ); + CPPUNIT_ASSERT + ( + m_text->PositionToCoords(m_text->GetInsertionPoint()).y <= TEXT_HEIGHT + ); +} + + #endif //wxUSE_TEXTCTRL diff --git a/tests/makefile.bcc b/tests/makefile.bcc index 4dc8feebdb..812e939fae 100644 --- a/tests/makefile.bcc +++ b/tests/makefile.bcc @@ -151,6 +151,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_choicebooktest.obj \ $(OBJS)\test_gui_choicetest.obj \ $(OBJS)\test_gui_comboboxtest.obj \ + $(OBJS)\test_gui_dataviewctrltest.obj \ $(OBJS)\test_gui_datepickerctrltest.obj \ $(OBJS)\test_gui_frametest.obj \ $(OBJS)\test_gui_gaugetest.obj \ @@ -780,6 +781,9 @@ $(OBJS)\test_gui_choicetest.obj: .\controls\choicetest.cpp $(OBJS)\test_gui_comboboxtest.obj: .\controls\comboboxtest.cpp $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\comboboxtest.cpp +$(OBJS)\test_gui_dataviewctrltest.obj: .\controls\dataviewctrltest.cpp + $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\dataviewctrltest.cpp + $(OBJS)\test_gui_datepickerctrltest.obj: .\controls\datepickerctrltest.cpp $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\datepickerctrltest.cpp diff --git a/tests/makefile.gcc b/tests/makefile.gcc index 48f4061311..49ea23cddd 100644 --- a/tests/makefile.gcc +++ b/tests/makefile.gcc @@ -144,6 +144,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_choicebooktest.o \ $(OBJS)\test_gui_choicetest.o \ $(OBJS)\test_gui_comboboxtest.o \ + $(OBJS)\test_gui_dataviewctrltest.o \ $(OBJS)\test_gui_datepickerctrltest.o \ $(OBJS)\test_gui_frametest.o \ $(OBJS)\test_gui_gaugetest.o \ @@ -761,6 +762,9 @@ $(OBJS)\test_gui_choicetest.o: ./controls/choicetest.cpp $(OBJS)\test_gui_comboboxtest.o: ./controls/comboboxtest.cpp $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\test_gui_dataviewctrltest.o: ./controls/dataviewctrltest.cpp + $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\test_gui_datepickerctrltest.o: ./controls/datepickerctrltest.cpp $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< diff --git a/tests/makefile.vc b/tests/makefile.vc index c32d4fa9dd..91f4734924 100644 --- a/tests/makefile.vc +++ b/tests/makefile.vc @@ -146,6 +146,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_choicebooktest.obj \ $(OBJS)\test_gui_choicetest.obj \ $(OBJS)\test_gui_comboboxtest.obj \ + $(OBJS)\test_gui_dataviewctrltest.obj \ $(OBJS)\test_gui_datepickerctrltest.obj \ $(OBJS)\test_gui_frametest.obj \ $(OBJS)\test_gui_gaugetest.obj \ @@ -906,6 +907,9 @@ $(OBJS)\test_gui_choicetest.obj: .\controls\choicetest.cpp $(OBJS)\test_gui_comboboxtest.obj: .\controls\comboboxtest.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\comboboxtest.cpp +$(OBJS)\test_gui_dataviewctrltest.obj: .\controls\dataviewctrltest.cpp + $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\dataviewctrltest.cpp + $(OBJS)\test_gui_datepickerctrltest.obj: .\controls\datepickerctrltest.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\datepickerctrltest.cpp diff --git a/tests/makefile.wat b/tests/makefile.wat index 25630d784d..e566570d79 100644 --- a/tests/makefile.wat +++ b/tests/makefile.wat @@ -390,6 +390,7 @@ TEST_GUI_OBJECTS = & $(OBJS)\test_gui_choicebooktest.obj & $(OBJS)\test_gui_choicetest.obj & $(OBJS)\test_gui_comboboxtest.obj & + $(OBJS)\test_gui_dataviewctrltest.obj & $(OBJS)\test_gui_datepickerctrltest.obj & $(OBJS)\test_gui_frametest.obj & $(OBJS)\test_gui_gaugetest.obj & @@ -820,6 +821,9 @@ $(OBJS)\test_gui_choicetest.obj : .AUTODEPEND .\controls\choicetest.cpp $(OBJS)\test_gui_comboboxtest.obj : .AUTODEPEND .\controls\comboboxtest.cpp $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $< +$(OBJS)\test_gui_dataviewctrltest.obj : .AUTODEPEND .\controls\dataviewctrltest.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $< + $(OBJS)\test_gui_datepickerctrltest.obj : .AUTODEPEND .\controls\datepickerctrltest.cpp $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $< diff --git a/tests/test.bkl b/tests/test.bkl index e6d35ee6fd..dd678d1a8a 100644 --- a/tests/test.bkl +++ b/tests/test.bkl @@ -147,6 +147,7 @@ controls/choicebooktest.cpp controls/choicetest.cpp controls/comboboxtest.cpp + controls/dataviewctrltest.cpp controls/datepickerctrltest.cpp controls/frametest.cpp controls/gaugetest.cpp diff --git a/tests/test_test_gui.dsp b/tests/test_test_gui.dsp index c4f64ae8bd..cd06b3663e 100644 --- a/tests/test_test_gui.dsp +++ b/tests/test_test_gui.dsp @@ -307,6 +307,10 @@ SOURCE=.\config\config.cpp # End Source File # Begin Source File +SOURCE=.\controls\dataviewctrltest.cpp +# End Source File +# Begin Source File + SOURCE=.\controls\datepickerctrltest.cpp # End Source File # Begin Source File diff --git a/tests/test_vc7_test_gui.vcproj b/tests/test_vc7_test_gui.vcproj index b598f0dcb6..7bffd2876b 100644 --- a/tests/test_vc7_test_gui.vcproj +++ b/tests/test_vc7_test_gui.vcproj @@ -619,6 +619,9 @@ + + diff --git a/tests/test_vc8_test_gui.vcproj b/tests/test_vc8_test_gui.vcproj index e9e80d2a0f..bdcc44289b 100644 --- a/tests/test_vc8_test_gui.vcproj +++ b/tests/test_vc8_test_gui.vcproj @@ -899,6 +899,10 @@ RelativePath=".\config\config.cpp" > + + diff --git a/tests/test_vc9_test_gui.vcproj b/tests/test_vc9_test_gui.vcproj index 8680942bca..9648dbf89f 100644 --- a/tests/test_vc9_test_gui.vcproj +++ b/tests/test_vc9_test_gui.vcproj @@ -871,6 +871,10 @@ RelativePath=".\config\config.cpp" > + + diff --git a/utils/helpview/src/helpview.cpp b/utils/helpview/src/helpview.cpp index c774b628fa..ecd2a732f0 100644 --- a/utils/helpview/src/helpview.cpp +++ b/utils/helpview/src/helpview.cpp @@ -279,10 +279,10 @@ bool hvApp::OpenBook(wxHtmlHelpController* controller) #ifdef __WXMAC__ /// Respond to Apple Event for opening a document -void hvApp::MacOpenFile(const wxString& filename) +void hvApp::MacOpenFiles(const wxArrayString& fileNames) { wxBusyCursor bcur; - wxFileName fileName(filename); + wxFileName fileName(fileNames[0]); m_helpController->AddBook(fileName); m_helpController->DisplayContents(); } diff --git a/utils/helpview/src/helpview.h b/utils/helpview/src/helpview.h index 2d020e78cb..7b30b795f5 100644 --- a/utils/helpview/src/helpview.h +++ b/utils/helpview/src/helpview.h @@ -36,7 +36,7 @@ public: #ifdef __WXMAC__ /// Respond to Apple Event for opening a document - virtual void MacOpenFile(const wxString& filename); + virtual void MacOpenFiles(const wxArrayString& fileNames); #endif /// Prompt the user for a book to open