Skip to content

Commit

Permalink
Implemented text boxes and tables, and further editing pages for back…
Browse files Browse the repository at this point in the history
…grounds, borders and margins.

wxRTC functions now operate on the currently focused object, which by default is the whole buffer.
Up to three property commands are now shown on the context menu, depending on
available objects in the current hierarchy.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
  • Loading branch information
JulianSmart committed Jan 14, 2011
1 parent 3625820 commit 603f702
Show file tree
Hide file tree
Showing 42 changed files with 19,275 additions and 3,149 deletions.
110 changes: 110 additions & 0 deletions include/wx/richtext/richtextbackgroundpage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/////////////////////////////////////////////////////////////////////////////
// Name: richtextbackgroundpage.h
// Purpose:
// Author: Julian Smart
// Modified by:
// Created: 13/11/2010 11:17:25
// RCS-ID:
// Copyright: (c) Julian Smart
// Licence:
/////////////////////////////////////////////////////////////////////////////

#ifndef _RICHTEXTBACKGROUNDPAGE_H_
#define _RICHTEXTBACKGROUNDPAGE_H_

/*!
* Includes
*/

#include "wx/richtext/richtextdialogpage.h"

////@begin includes
#include "wx/statline.h"
////@end includes

/*!
* Forward declarations
*/

class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextColourSwatchCtrl;

/*!
* Control identifiers
*/

////@begin control identifiers
#define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_STYLE wxTAB_TRAVERSAL
#define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_TITLE wxEmptyString
#define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_IDNAME ID_RICHTEXTBACKGROUNDPAGE
#define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_SIZE wxSize(400, 300)
#define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_POSITION wxDefaultPosition
////@end control identifiers


/*!
* wxRichTextBackgroundPage class declaration
*/

class WXDLLIMPEXP_RICHTEXT wxRichTextBackgroundPage: public wxRichTextDialogPage
{
DECLARE_DYNAMIC_CLASS( wxRichTextBackgroundPage )
DECLARE_EVENT_TABLE()
DECLARE_HELP_PROVISION()

public:
/// Constructors
wxRichTextBackgroundPage();
wxRichTextBackgroundPage( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_STYLE );

/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_STYLE );

/// Destructor
~wxRichTextBackgroundPage();

/// Initialises member variables
void Init();

/// Creates the controls and sizers
void CreateControls();

/// Gets the attributes from the formatting dialog
wxRichTextAttr* GetAttributes();

/// Data transfer
virtual bool TransferDataToWindow();
virtual bool TransferDataFromWindow();

/// Respond to colour swatch click
void OnColourSwatch(wxCommandEvent& event);

////@begin wxRichTextBackgroundPage event handler declarations

////@end wxRichTextBackgroundPage event handler declarations

////@begin wxRichTextBackgroundPage member function declarations

/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );

/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end wxRichTextBackgroundPage member function declarations

/// Should we show tooltips?
static bool ShowToolTips();

////@begin wxRichTextBackgroundPage member variables
wxCheckBox* m_backgroundColourCheckBox;
wxRichTextColourSwatchCtrl* m_backgroundColourSwatch;
/// Control identifiers
enum {
ID_RICHTEXTBACKGROUNDPAGE = 10845,
ID_RICHTEXT_BACKGROUND_COLOUR_CHECKBOX = 10846,
ID_RICHTEXT_BACKGROUND_COLOUR_SWATCH = 10847
};
////@end wxRichTextBackgroundPage member variables
};

#endif
// _RICHTEXTBACKGROUNDPAGE_H_
251 changes: 251 additions & 0 deletions include/wx/richtext/richtextborderspage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
/////////////////////////////////////////////////////////////////////////////
// Name: richtextborderspage.h
// Purpose:
// Author: Julian Smart
// Modified by:
// Created: 21/10/2010 11:34:24
// RCS-ID:
// Copyright: (c) Julian Smart
// Licence:
/////////////////////////////////////////////////////////////////////////////

#ifndef _RICHTEXTBORDERSPAGE_H_
#define _RICHTEXTBORDERSPAGE_H_


/*!
* Includes
*/

#include "wx/richtext/richtextdialogpage.h"

////@begin includes
#include "wx/notebook.h"
#include "wx/statline.h"
////@end includes

/*!
* Forward declarations
*/

class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextColourSwatchCtrl;
class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextBorderPreviewCtrl;

/*!
* Control identifiers
*/

////@begin control identifiers
#define SYMBOL_WXRICHTEXTBORDERSPAGE_STYLE wxTAB_TRAVERSAL
#define SYMBOL_WXRICHTEXTBORDERSPAGE_TITLE wxEmptyString
#define SYMBOL_WXRICHTEXTBORDERSPAGE_IDNAME ID_RICHTEXTBORDERSPAGE
#define SYMBOL_WXRICHTEXTBORDERSPAGE_SIZE wxSize(400, 300)
#define SYMBOL_WXRICHTEXTBORDERSPAGE_POSITION wxDefaultPosition
////@end control identifiers


/*!
* wxRichTextBordersPage class declaration
*/

class WXDLLIMPEXP_RICHTEXT wxRichTextBordersPage: public wxRichTextDialogPage
{
DECLARE_DYNAMIC_CLASS( wxRichTextBordersPage )
DECLARE_EVENT_TABLE()
DECLARE_HELP_PROVISION()

public:
/// Constructors
wxRichTextBordersPage();
wxRichTextBordersPage( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTBORDERSPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTBORDERSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBORDERSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBORDERSPAGE_STYLE );

/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTBORDERSPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTBORDERSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBORDERSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBORDERSPAGE_STYLE );

/// Destructor
~wxRichTextBordersPage();

/// Initialises member variables
void Init();

/// Creates the controls and sizers
void CreateControls();

/// Gets the attributes from the formatting dialog
wxRichTextAttr* GetAttributes();

/// Data transfer
virtual bool TransferDataToWindow();
virtual bool TransferDataFromWindow();

/// Updates the preview
void OnCommand(wxCommandEvent& event);

/// Fill style combo
virtual void FillStyleComboBox(wxComboBox* styleComboBox);

/// Set the border controls
static void SetBorderValue(wxTextAttrBorder& border, /* wxTextAttrBorder& borderToReset, */ wxTextCtrl* widthValueCtrl, wxComboBox* widthUnitsCtrl, wxCheckBox* checkBox,
wxComboBox* styleCtrl, wxRichTextColourSwatchCtrl* colourCtrl, const wxArrayInt& borderStyles);

/// Get data from the border controls
static void GetBorderValue(wxTextAttrBorder& border, /* wxTextAttrBorder& borderToReset, */ wxTextCtrl* widthValueCtrl, wxComboBox* widthUnitsCtrl, wxCheckBox* checkBox,
wxComboBox* styleCtrl, wxRichTextColourSwatchCtrl* colourCtrl, const wxArrayInt& borderStyles);

////@begin wxRichTextBordersPage event handler declarations

/// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXT_BORDER_LEFT_CHECKBOX
void OnRichtextBorderCheckboxClick( wxCommandEvent& event );

/// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BORDER_LEFT
void OnRichtextBorderLeftUpdate( wxUpdateUIEvent& event );

/// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BORDER_RIGHT
void OnRichtextBorderRightUpdate( wxUpdateUIEvent& event );

/// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BORDER_TOP
void OnRichtextBorderTopUpdate( wxUpdateUIEvent& event );

/// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BORDER_BOTTOM
void OnRichtextBorderBottomUpdate( wxUpdateUIEvent& event );

/// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_OUTLINE_LEFT
void OnRichtextOutlineLeftUpdate( wxUpdateUIEvent& event );

/// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_OUTLINE_RIGHT
void OnRichtextOutlineRightUpdate( wxUpdateUIEvent& event );

/// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_OUTLINE_TOP
void OnRichtextOutlineTopUpdate( wxUpdateUIEvent& event );

/// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_OUTLINE_BOTTOM
void OnRichtextOutlineBottomUpdate( wxUpdateUIEvent& event );

////@end wxRichTextBordersPage event handler declarations

////@begin wxRichTextBordersPage member function declarations

/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );

/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end wxRichTextBordersPage member function declarations

/// Should we show tooltips?
static bool ShowToolTips();

////@begin wxRichTextBordersPage member variables
wxCheckBox* m_leftBorderCheckbox;
wxTextCtrl* m_leftBorderWidth;
wxComboBox* m_leftBorderWidthUnits;
wxComboBox* m_leftBorderStyle;
wxRichTextColourSwatchCtrl* m_leftBorderColour;
wxCheckBox* m_rightBorderCheckbox;
wxTextCtrl* m_rightBorderWidth;
wxComboBox* m_rightBorderWidthUnits;
wxComboBox* m_rightBorderStyle;
wxRichTextColourSwatchCtrl* m_rightBorderColour;
wxCheckBox* m_topBorderCheckbox;
wxTextCtrl* m_topBorderWidth;
wxComboBox* m_topBorderWidthUnits;
wxComboBox* m_topBorderStyle;
wxRichTextColourSwatchCtrl* m_topBorderColour;
wxCheckBox* m_bottomBorderCheckbox;
wxTextCtrl* m_bottomBorderWidth;
wxComboBox* m_bottomBorderWidthUnits;
wxComboBox* m_bottomBorderStyle;
wxRichTextColourSwatchCtrl* m_bottomBorderColour;
wxCheckBox* m_leftOutlineCheckbox;
wxTextCtrl* m_leftOutlineWidth;
wxComboBox* m_leftOutlineWidthUnits;
wxComboBox* m_leftOutlineStyle;
wxRichTextColourSwatchCtrl* m_leftOutlineColour;
wxCheckBox* m_rightOutlineCheckbox;
wxTextCtrl* m_rightOutlineWidth;
wxComboBox* m_rightOutlineWidthUnits;
wxComboBox* m_rightOutlineStyle;
wxRichTextColourSwatchCtrl* m_rightOutlineColour;
wxCheckBox* m_topOutlineCheckbox;
wxTextCtrl* m_topOutlineWidth;
wxComboBox* m_topOutlineWidthUnits;
wxComboBox* m_topOutlineStyle;
wxRichTextColourSwatchCtrl* m_topOutlineColour;
wxCheckBox* m_bottomOutlineCheckbox;
wxTextCtrl* m_bottomOutlineWidth;
wxComboBox* m_bottomOutlineWidthUnits;
wxComboBox* m_bottomOutlineStyle;
wxRichTextColourSwatchCtrl* m_bottomOutlineColour;
wxRichTextBorderPreviewCtrl* m_borderPreviewCtrl;
/// Control identifiers
enum {
ID_RICHTEXTBORDERSPAGE = 10800,
ID_RICHTEXTBORDERSPAGE_NOTEBOOK = 10801,
ID_RICHTEXTBORDERSPAGE_BORDERS = 10802,
ID_RICHTEXT_BORDER_LEFT_CHECKBOX = 10803,
ID_RICHTEXT_BORDER_LEFT = 10804,
ID_RICHTEXT_BORDER_LEFT_UNITS = 10805,
ID_RICHTEXT_BORDER_LEFT_STYLE = 10806,
ID_RICHTEXT_BORDER_LEFT_COLOUR = 10807,
ID_RICHTEXT_BORDER_RIGHT_CHECKBOX = 10808,
ID_RICHTEXT_BORDER_RIGHT = 10809,
ID_RICHTEXT_BORDER_RIGHT_UNITS = 10810,
ID_RICHTEXT_BORDER_RIGHT_STYLE = 10811,
ID_RICHTEXT_BORDER_RIGHT_COLOUR = 10812,
ID_RICHTEXT_BORDER_TOP_CHECKBOX = 10813,
ID_RICHTEXT_BORDER_TOP = 10814,
ID_RICHTEXT_BORDER_TOP_UNITS = 10815,
ID_RICHTEXT_BORDER_TOP_STYLE = 10816,
ID_RICHTEXT_BORDER_TOP_COLOUR = 10817,
ID_RICHTEXT_BORDER_BOTTOM_CHECKBOX = 10818,
ID_RICHTEXT_BORDER_BOTTOM = 10819,
ID_RICHTEXT_BORDER_BOTTOM_UNITS = 10820,
ID_RICHTEXT_BORDER_BOTTOM_STYLE = 10821,
ID_RICHTEXT_BORDER_BOTTOM_COLOUR = 10822,
ID_RICHTEXTBORDERSPAGE_OUTLINE = 10823,
ID_RICHTEXT_OUTLINE_LEFT_CHECKBOX = 10824,
ID_RICHTEXT_OUTLINE_LEFT = 10825,
ID_RICHTEXT_OUTLINE_LEFT_UNITS = 10826,
ID_RICHTEXT_OUTLINE_LEFT_STYLE = 10827,
ID_RICHTEXT_OUTLINE_LEFT_COLOUR = 10828,
ID_RICHTEXT_OUTLINE_RIGHT_CHECKBOX = 10829,
ID_RICHTEXT_OUTLINE_RIGHT = 10830,
ID_RICHTEXT_OUTLINE_RIGHT_UNITS = 10831,
ID_RICHTEXT_OUTLINE_RIGHT_STYLE = 10832,
ID_RICHTEXT_OUTLINE_RIGHT_COLOUR = 10833,
ID_RICHTEXT_OUTLINE_TOP_CHECKBOX = 10834,
ID_RICHTEXT_OUTLINE_TOP = 10835,
ID_RICHTEXT_OUTLINE_TOP_UNITS = 10836,
ID_RICHTEXT_OUTLINE_TOP_STYLE = 10837,
ID_RICHTEXT_OUTLINE_TOP_COLOUR = 10838,
ID_RICHTEXT_OUTLINE_BOTTOM_CHECKBOX = 10839,
ID_RICHTEXT_OUTLINE_BOTTOM = 10840,
ID_RICHTEXT_OUTLINE_BOTTOM_UNITS = 10841,
ID_RICHTEXT_OUTLINE_BOTTOM_STYLE = 10842,
ID_RICHTEXT_OUTLINE_BOTTOM_COLOUR = 10843,
ID_RICHTEXT_BORDER_PREVIEW = 10844
};
////@end wxRichTextBordersPage member variables

wxArrayInt m_borderStyles;
wxArrayString m_borderStyleNames;
bool m_ignoreUpdates;
};

class WXDLLIMPEXP_RICHTEXT wxRichTextBorderPreviewCtrl : public wxWindow
{
public:
wxRichTextBorderPreviewCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = 0);

void SetAttributes(wxRichTextAttr* attr) { m_attributes = attr; }
wxRichTextAttr* GetAttributes() const { return m_attributes; }

private:
wxRichTextAttr* m_attributes;

void OnPaint(wxPaintEvent& event);
DECLARE_EVENT_TABLE()
};

#endif
// _RICHTEXTBORDERSPAGE_H_
Loading

0 comments on commit 603f702

Please sign in to comment.