#define wxTEXT_ATTR_LINE_SPACING 0x00002000
#define wxTEXT_ATTR_CHARACTER_STYLE_NAME 0x00004000
#define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME 0x00008000
-#define wxTEXT_ATTR_BULLET_STYLE 0x00010000
-#define wxTEXT_ATTR_BULLET_NUMBER 0x00020000
-#define wxTEXT_ATTR_BULLET_SYMBOL 0x00040000
-#define wxTEXT_ATTR_LIST_STYLE_NAME 0x00080000
+#define wxTEXT_ATTR_LIST_STYLE_NAME 0x00010000
+#define wxTEXT_ATTR_BULLET_STYLE 0x00020000
+#define wxTEXT_ATTR_BULLET_NUMBER 0x00040000
+#define wxTEXT_ATTR_BULLET_SYMBOL 0x00080000
+#define wxTEXT_ATTR_BULLET_NAME 0x00100000
/*!
* Styles for wxTextAttrEx::SetBulletStyle
#define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x0040
#define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x0080
#define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x0100
+#define wxTEXT_ATTR_BULLET_STYLE_STANDARD 0x0200
/*!
* Line spacing values
void SetBulletStyle(int style) { m_bulletStyle = style; SetFlags(GetFlags() | wxTEXT_ATTR_BULLET_STYLE); }
void SetBulletNumber(int n) { m_bulletNumber = n; SetFlags(GetFlags() | wxTEXT_ATTR_BULLET_NUMBER); }
void SetBulletSymbol(wxChar symbol) { m_bulletSymbol = symbol; SetFlags(GetFlags() | wxTEXT_ATTR_BULLET_SYMBOL); }
+ void SetBulletName(const wxString& name) { m_bulletName = name; SetFlags(GetFlags() | wxTEXT_ATTR_BULLET_NAME); }
void SetBulletFont(const wxString& bulletFont) { m_bulletFont = bulletFont; }
const wxString& GetCharacterStyleName() const { return m_characterStyleName; }
int GetBulletStyle() const { return m_bulletStyle; }
int GetBulletNumber() const { return m_bulletNumber; }
wxChar GetBulletSymbol() const { return m_bulletSymbol; }
+ const wxString& GetBulletName() const { return m_bulletName; }
const wxString& GetBulletFont() const { return m_bulletFont; }
bool HasWeight() const { return (GetFlags() & wxTEXT_ATTR_FONT_WEIGHT) != 0; }
bool HasBulletStyle() const { return HasFlag(wxTEXT_ATTR_BULLET_STYLE); }
bool HasBulletNumber() const { return HasFlag(wxTEXT_ATTR_BULLET_NUMBER); }
bool HasBulletSymbol() const { return HasFlag(wxTEXT_ATTR_BULLET_SYMBOL); }
+ bool HasBulletName() const { return HasFlag(wxTEXT_ATTR_BULLET_NAME); }
// Is this a character style?
bool IsCharacterStyle() const { return (0 != (GetFlags() & (wxTEXT_ATTR_FONT | wxTEXT_ATTR_BACKGROUND_COLOUR | wxTEXT_ATTR_TEXT_COLOUR))); }
bool IsParagraphStyle() const { return (0 != (GetFlags() & (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|
wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|wxTEXT_ATTR_LINE_SPACING|
- wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER))); }
+ wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_NAME))); }
// returns false if we have any attributes set, true otherwise
bool IsDefault() const
!HasTabs() && !HasLeftIndent() && !HasRightIndent() &&
!HasParagraphSpacingAfter() && !HasParagraphSpacingBefore() && !HasLineSpacing() &&
!HasCharacterStyleName() && !HasParagraphStyleName() && !HasListStyleName() &&
- !HasBulletNumber() && !HasBulletStyle() && !HasBulletSymbol();
+ !HasBulletNumber() && !HasBulletStyle() && !HasBulletSymbol() && !HasBulletName();
}
// return the attribute having the valid font and colours: it uses the
int m_bulletNumber;
wxChar m_bulletSymbol;
wxString m_bulletFont;
+ wxString m_bulletName;
// Character style
wxString m_characterStyleName;
void SetBulletNumber(int n) { m_bulletNumber = n; m_flags |= wxTEXT_ATTR_BULLET_NUMBER; }
void SetBulletSymbol(wxChar symbol) { m_bulletSymbol = symbol; m_flags |= wxTEXT_ATTR_BULLET_NUMBER; }
void SetBulletFont(const wxString& bulletFont) { m_bulletFont = bulletFont; }
+ void SetBulletName(const wxString& name) { m_bulletName = name; }
const wxColour& GetTextColour() const { return m_colText; }
const wxColour& GetBackgroundColour() const { return m_colBack; }
int GetBulletNumber() const { return m_bulletNumber; }
wxChar GetBulletSymbol() const { return m_bulletSymbol; }
const wxString& GetBulletFont() const { return m_bulletFont; }
+ const wxString& GetBulletName() const { return m_bulletName; }
// accessors
bool HasTextColour() const { return m_colText.Ok() && HasFlag(wxTEXT_ATTR_TEXT_COLOUR) ; }
bool HasBulletStyle() const { return (m_flags & wxTEXT_ATTR_BULLET_STYLE) != 0; }
bool HasBulletNumber() const { return (m_flags & wxTEXT_ATTR_BULLET_NUMBER) != 0; }
bool HasBulletSymbol() const { return (m_flags & wxTEXT_ATTR_BULLET_SYMBOL) != 0; }
+ bool HasBulletName() const { return (m_flags & wxTEXT_ATTR_BULLET_NAME) != 0; }
bool HasFlag(long flag) const { return (m_flags & flag) != 0; }
bool IsCharacterStyle() const { return (0 != (GetFlags() & (wxTEXT_ATTR_FONT | wxTEXT_ATTR_BACKGROUND_COLOUR | wxTEXT_ATTR_TEXT_COLOUR))); }
bool IsParagraphStyle() const { return (0 != (GetFlags() & (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|
wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|wxTEXT_ATTR_LINE_SPACING|
- wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER))); }
+ wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_NAME))); }
// returns false if we have any attributes set, true otherwise
bool IsDefault() const
!HasTabs() && !HasLeftIndent() && !HasRightIndent() &&
!HasParagraphSpacingAfter() && !HasParagraphSpacingBefore() && !HasLineSpacing() &&
!HasCharacterStyleName() && !HasParagraphStyleName() && !HasListStyleName() &&
- !HasBulletNumber() && !HasBulletStyle() && !HasBulletSymbol();
+ !HasBulletNumber() && !HasBulletStyle() && !HasBulletSymbol() && !HasBulletName();
}
// return the attribute having the valid font and colours: it uses the
int m_bulletNumber;
wxChar m_bulletSymbol;
wxString m_bulletFont;
+ wxString m_bulletName;
// Character styles
wxColour m_colText,
#define wxTEXT_ATTR_PARAGRAPH (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|\
wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|wxTEXT_ATTR_LINE_SPACING|\
- wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_SYMBOL|wxTEXT_ATTR_PARAGRAPH_STYLE_NAME|wxTEXT_ATTR_LIST_STYLE_NAME)
+ wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_SYMBOL|wxTEXT_ATTR_BULLET_NAME|\
+ wxTEXT_ATTR_PARAGRAPH_STYLE_NAME|wxTEXT_ATTR_LIST_STYLE_NAME)
#define wxTEXT_ATTR_ALL (wxTEXT_ATTR_CHARACTER|wxTEXT_ATTR_PARAGRAPH)
/// End symbol bullet
bool EndSymbolBullet() { return EndStyle(); }
+ /// Begin standard bullet
+ bool BeginStandardBullet(const wxString& bulletName, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_STANDARD);
+
+ /// End standard bullet
+ bool EndStandardBullet() { return EndStyle(); }
+
/// Begin named character style
bool BeginCharacterStyle(const wxString& characterStyle);
/// End named character style
bool EndParagraphStyle() { return EndStyle(); }
+ /// Begin named list style
+ bool BeginListStyle(const wxString& listStyle, int level = 1, int number = 1);
+
+ /// End named character style
+ bool EndListStyle() { return EndStyle(); }
+
// Implementation
/// Copy
*/
////@begin includes
-#include "wx/statline.h"
#include "wx/spinctrl.h"
+#include "wx/statline.h"
////@end includes
/*!
/// Update for number-related controls
void OnNumberUpdate( wxUpdateUIEvent& event );
+ /// Update for standard bullet-related controls
+ void OnStandardBulletUpdate( wxUpdateUIEvent& event );
+
////@begin wxRichTextBulletsPage event handler declarations
/// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
void OnStylelistboxSelected( wxCommandEvent& event );
+ /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
+ void OnPeriodctrlClick( wxCommandEvent& event );
+
+ /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
+ void OnPeriodctrlUpdate( wxUpdateUIEvent& event );
+
+ /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
+ void OnParenthesesctrlClick( wxCommandEvent& event );
+
+ /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
+ void OnParenthesesctrlUpdate( wxUpdateUIEvent& event );
+
+ /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
+ void OnNumberstaticUpdate( wxUpdateUIEvent& event );
+
+ /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
+ void OnNumberctrlUpdated( wxSpinEvent& event );
+
+ /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
+ void OnNumberctrlUp( wxSpinEvent& event );
+
+ /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
+ void OnNumberctrlDown( wxSpinEvent& event );
+
+ /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
+ void OnNumberctrlTextUpdated( wxCommandEvent& event );
+
+ /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
+ void OnNumberctrlUpdate( wxUpdateUIEvent& event );
+
/// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
void OnSymbolstaticUpdate( wxUpdateUIEvent& event );
/// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent& event );
- /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
- void OnNumberstaticUpdate( wxUpdateUIEvent& event );
+ /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMESTATIC
+ void OnNamestaticUpdate( wxUpdateUIEvent& event );
- /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
- void OnNumberctrlUpdated( wxSpinEvent& event );
+ /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
+ void OnNamectrlSelected( wxCommandEvent& event );
- /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
- void OnNumberctrlUp( wxSpinEvent& event );
-
- /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
- void OnNumberctrlDown( wxSpinEvent& event );
-
- /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
- void OnNumberctrlTextUpdated( wxCommandEvent& event );
-
- /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
- void OnNumberctrlUpdate( wxUpdateUIEvent& event );
-
- /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
- void OnParenthesesctrlClick( wxCommandEvent& event );
-
- /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
- void OnParenthesesctrlUpdate( wxUpdateUIEvent& event );
-
- /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
- void OnPeriodctrlClick( wxCommandEvent& event );
+ /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
+ void OnNamectrlUpdated( wxCommandEvent& event );
- /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
- void OnPeriodctrlUpdate( wxUpdateUIEvent& event );
+ /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
+ void OnNamectrlUIUpdate( wxUpdateUIEvent& event );
////@end wxRichTextBulletsPage event handler declarations
////@begin wxRichTextBulletsPage member variables
wxListBox* m_styleListBox;
+ wxCheckBox* m_periodCtrl;
+ wxCheckBox* m_parenthesesCtrl;
+ wxSpinCtrl* m_numberCtrl;
wxComboBox* m_symbolCtrl;
wxComboBox* m_symbolFontCtrl;
- wxSpinCtrl* m_numberCtrl;
- wxCheckBox* m_parenthesesCtrl;
- wxCheckBox* m_periodCtrl;
+ wxComboBox* m_bulletNameCtrl;
wxRichTextCtrl* m_previewCtrl;
/// Control identifiers
enum {
ID_RICHTEXTBULLETSPAGE = 10300,
ID_RICHTEXTBULLETSPAGE_STYLELISTBOX = 10305,
+ ID_RICHTEXTBULLETSPAGE_PERIODCTRL = 10313,
+ ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL = 10311,
+ ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC = 10302,
+ ID_RICHTEXTBULLETSPAGE_NUMBERCTRL = 10310,
ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC = 10301,
ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL = 10307,
ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL = 10308,
ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL = 10309,
- ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC = 10302,
- ID_RICHTEXTBULLETSPAGE_NUMBERCTRL = 10310,
- ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL = 10311,
- ID_RICHTEXTBULLETSPAGE_PERIODCTRL = 10313,
+ ID_RICHTEXTBULLETSPAGE_NAMESTATIC = 10303,
+ ID_RICHTEXTBULLETSPAGE_NAMECTRL = 10304,
ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL = 10314
};
////@end wxRichTextBulletsPage member variables
/// End symbol bullet
bool EndSymbolBullet() { return GetBuffer().EndSymbolBullet(); }
+ /// Begin standard bullet
+ bool BeginStandardBullet(const wxString& bulletName, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_STANDARD)
+ { return GetBuffer().BeginStandardBullet(bulletName, leftIndent, leftSubIndent, bulletStyle); }
+
+ /// End standard bullet
+ bool EndStandardBullet() { return GetBuffer().EndStandardBullet(); }
+
/// Begin named character style
bool BeginCharacterStyle(const wxString& characterStyle) { return GetBuffer().BeginCharacterStyle(characterStyle); }
/// End named character style
bool EndParagraphStyle() { return GetBuffer().EndParagraphStyle(); }
+ /// Begin named list style
+ bool BeginListStyle(const wxString& listStyle, int level = 1, int number = 1) { return GetBuffer().BeginListStyle(listStyle, level, number); }
+
+ /// End named character style
+ bool EndListStyle() { return GetBuffer().EndListStyle(); }
+
/// Sets the default style to the style under the cursor
bool SetDefaultStyleToCursorStyle();
/// Update for number-related controls
void OnNumberUpdate( wxUpdateUIEvent& event );
+ /// Update for standard bullet-related controls
+ void OnStandardBulletUpdate( wxUpdateUIEvent& event );
+
/// Just transfer to the window
void DoTransferDataToWindow();
/// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX
void OnStylelistboxSelected( wxCommandEvent& event );
+ /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
+ void OnPeriodctrlClick( wxCommandEvent& event );
+
+ /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
+ void OnPeriodctrlUpdate( wxUpdateUIEvent& event );
+
+ /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
+ void OnParenthesesctrlClick( wxCommandEvent& event );
+
+ /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
+ void OnParenthesesctrlUpdate( wxUpdateUIEvent& event );
+
/// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC
void OnSymbolstaticUpdate( wxUpdateUIEvent& event );
/// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent& event );
- /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
- void OnParenthesesctrlClick( wxCommandEvent& event );
+ /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC
+ void OnNamestaticUpdate( wxUpdateUIEvent& event );
- /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
- void OnParenthesesctrlUpdate( wxUpdateUIEvent& event );
+ /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
+ void OnNamectrlSelected( wxCommandEvent& event );
- /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
- void OnPeriodctrlClick( wxCommandEvent& event );
+ /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
+ void OnNamectrlUpdated( wxCommandEvent& event );
- /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
- void OnPeriodctrlUpdate( wxUpdateUIEvent& event );
+ /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
+ void OnNamectrlUIUpdate( wxUpdateUIEvent& event );
/// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT
void OnRichtextliststylepageAlignleftSelected( wxCommandEvent& event );
////@begin wxRichTextListStylePage member variables
wxSpinCtrl* m_levelCtrl;
wxListBox* m_styleListBox;
+ wxCheckBox* m_periodCtrl;
+ wxCheckBox* m_parenthesesCtrl;
wxComboBox* m_symbolCtrl;
wxComboBox* m_symbolFontCtrl;
- wxCheckBox* m_parenthesesCtrl;
- wxCheckBox* m_periodCtrl;
+ wxComboBox* m_bulletNameCtrl;
wxRadioButton* m_alignmentLeft;
wxRadioButton* m_alignmentRight;
wxRadioButton* m_alignmentJustified;
ID_RICHTEXTLISTSTYLEPAGE_NOTEBOOK = 10618,
ID_RICHTEXTLISTSTYLEPAGE_BULLETS = 10619,
ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX = 10620,
+ ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL = 10627,
+ ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL = 10626,
ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC = 10621,
ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL = 10622,
ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL = 10623,
ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL = 10625,
- ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL = 10626,
- ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL = 10627,
+ ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC = 10600,
+ ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL = 10601,
ID_RICHTEXTLISTSTYLEPAGE_SPACING = 10628,
ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT = 10629,
ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT = 10630,
}
}
+ if (style.HasBulletName() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_BULLET_NAME))
+ {
+ if (currentStyle.HasBulletName())
+ {
+ if (currentStyle.HasBulletName() != style.HasBulletName())
+ {
+ // Clash of style - mark as such
+ multipleStyleAttributes |= wxTEXT_ATTR_BULLET_NAME;
+ currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_BULLET_NAME);
+ }
+ }
+ else
+ {
+ currentStyle.SetBulletName(style.GetBulletName());
+ }
+ }
+
return true;
}
{
// TODO
}
+ else if (attr.GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_STANDARD)
+ {
+ wxTextAttrEx bulletAttr(GetCombinedAttributes());
+ if (bulletAttr.GetTextColour().Ok())
+ {
+ dc.SetPen(wxPen(bulletAttr.GetTextColour()));
+ dc.SetBrush(wxBrush(bulletAttr.GetTextColour()));
+ }
+ else
+ {
+ dc.SetPen(*wxBLACK_PEN);
+ dc.SetBrush(*wxBLACK_BRUSH);
+ }
+
+ wxFont font;
+ if (bulletAttr.GetFont().Ok())
+ font = bulletAttr.GetFont();
+ else
+ font = (*wxNORMAL_FONT);
+
+ dc.SetFont(font);
+
+ // Get line height from first line, if any
+ wxRichTextLine* line = m_cachedLines.GetFirst() ? (wxRichTextLine* ) m_cachedLines.GetFirst()->GetData() : (wxRichTextLine*) NULL;
+
+ wxPoint linePos;
+ int lineHeight wxDUMMY_INITIALIZE(0);
+ if (line)
+ {
+ lineHeight = line->GetSize().y;
+ linePos = line->GetPosition() + GetPosition();
+ }
+ else
+ {
+ lineHeight = dc.GetCharHeight();
+ linePos = GetPosition();
+ linePos.y += spaceBeforePara;
+ }
+
+ int charHeight = dc.GetCharHeight();
+
+ int bulletWidth = wxMax(2, (charHeight/3 + 1));
+ int bulletHeight = bulletWidth;
+
+ int x = GetPosition().x + leftIndent;
+ int y = linePos.y + (lineHeight - charHeight/2) - bulletHeight/2;
+
+ if (bulletAttr.GetBulletName() == wxT("standard/square"))
+ {
+ dc.DrawRectangle(x, y, bulletWidth, bulletHeight);
+ }
+ else // "standard/round", and catch-all
+ {
+ dc.DrawEllipse(x, y, bulletWidth, bulletHeight);
+ }
+ }
else
{
wxString bulletText = GetBulletText();
bool wxRichTextBuffer::BeginNumberedBullet(int bulletNumber, int leftIndent, int leftSubIndent, int bulletStyle)
{
wxTextAttrEx attr;
- attr.SetFlags(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_LEFT_INDENT);
+ attr.SetFlags(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_LEFT_INDENT);
attr.SetBulletStyle(bulletStyle);
attr.SetBulletNumber(bulletNumber);
attr.SetLeftIndent(leftIndent, leftSubIndent);
bool wxRichTextBuffer::BeginSymbolBullet(wxChar symbol, int leftIndent, int leftSubIndent, int bulletStyle)
{
wxTextAttrEx attr;
- attr.SetFlags(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_SYMBOL|wxTEXT_ATTR_LEFT_INDENT);
+ attr.SetFlags(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_LEFT_INDENT);
attr.SetBulletStyle(bulletStyle);
attr.SetLeftIndent(leftIndent, leftSubIndent);
attr.SetBulletSymbol(symbol);
return BeginStyle(attr);
}
+/// Begin standard bullet
+bool wxRichTextBuffer::BeginStandardBullet(const wxString& bulletName, int leftIndent, int leftSubIndent, int bulletStyle)
+{
+ wxTextAttrEx attr;
+ attr.SetFlags(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_LEFT_INDENT);
+ attr.SetBulletStyle(bulletStyle);
+ attr.SetLeftIndent(leftIndent, leftSubIndent);
+ attr.SetBulletName(bulletName);
+
+ return BeginStyle(attr);
+}
+
/// Begin named character style
bool wxRichTextBuffer::BeginCharacterStyle(const wxString& characterStyle)
{
return false;
}
+/// Begin named list style
+bool wxRichTextBuffer::BeginListStyle(const wxString& listStyle, int level, int number)
+{
+ if (GetStyleSheet())
+ {
+ wxRichTextListStyleDefinition* def = GetStyleSheet()->FindListStyle(listStyle);
+ if (def)
+ {
+ wxTextAttrEx attr(def->GetCombinedStyleForLevel(level));
+
+ attr.SetBulletNumber(number);
+
+ return BeginStyle(attr);
+ }
+ }
+ return false;
+}
+
/// Adds a handler to the end
void wxRichTextBuffer::AddHandler(wxRichTextFileHandler *handler)
{
attr1.GetBulletStyle() == attr2.GetBulletStyle() &&
attr1.GetBulletNumber() == attr2.GetBulletNumber() &&
attr1.GetBulletSymbol() == attr2.GetBulletSymbol() &&
+ attr1.GetBulletName() == attr2.GetBulletName() &&
attr1.GetBulletFont() == attr2.GetBulletFont() &&
attr1.GetCharacterStyleName() == attr2.GetCharacterStyleName() &&
attr1.GetParagraphStyleName() == attr2.GetParagraphStyleName() &&
return false;
if ((flags & wxTEXT_ATTR_BULLET_SYMBOL) &&
- (attr1.GetBulletSymbol() != attr2.GetBulletSymbol()))
+ (attr1.GetBulletSymbol() != attr2.GetBulletSymbol()) &&
+ (attr1.GetBulletFont() != attr2.GetBulletFont()))
return false;
- if ((flags & wxTEXT_ATTR_BULLET_SYMBOL) &&
- (attr1.GetBulletFont() != attr2.GetBulletFont()))
+ if ((flags & wxTEXT_ATTR_BULLET_NAME) &&
+ (attr1.GetBulletName() != attr2.GetBulletName()))
return false;
if ((flags & wxTEXT_ATTR_TABS) &&
return false;
if ((flags & wxTEXT_ATTR_BULLET_SYMBOL) &&
- (attr1.GetBulletSymbol() != attr2.GetBulletSymbol()))
+ (attr1.GetBulletSymbol() != attr2.GetBulletSymbol()) &&
+ (attr1.GetBulletFont() != attr2.GetBulletFont()))
return false;
- if ((flags & wxTEXT_ATTR_BULLET_SYMBOL) &&
- (attr1.GetBulletFont() != attr2.GetBulletFont()))
+ if ((flags & wxTEXT_ATTR_BULLET_NAME) &&
+ (attr1.GetBulletName() != attr2.GetBulletName()))
return false;
if ((flags & wxTEXT_ATTR_TABS) &&
destStyle.SetListStyleName(style.GetListStyleName());
if (style.HasBulletStyle())
- {
destStyle.SetBulletStyle(style.GetBulletStyle());
+
+ if (style.HasBulletSymbol())
+ {
destStyle.SetBulletSymbol(style.GetBulletSymbol());
destStyle.SetBulletFont(style.GetBulletFont());
}
+ if (style.HasBulletName())
+ destStyle.SetBulletName(style.GetBulletName());
+
if (style.HasBulletNumber())
destStyle.SetBulletNumber(style.GetBulletNumber());
destStyle.SetBulletNumber(style.GetBulletNumber());
}
+ if (style.HasBulletName())
+ {
+ if (!(compareWith && compareWith->HasBulletName() && compareWith->GetBulletName() == style.GetBulletName()))
+ destStyle.SetBulletName(style.GetBulletName());
+ }
+
return true;
}
m_bulletNumber = attr.m_bulletNumber;
m_bulletSymbol = attr.m_bulletSymbol;
m_bulletFont = attr.m_bulletFont;
+ m_bulletName = attr.m_bulletName;
}
// operators
m_bulletStyle = attr.GetBulletStyle();
m_bulletNumber = attr.GetBulletNumber();
m_bulletSymbol = attr.GetBulletSymbol();
+ m_bulletName = attr.GetBulletName();
m_bulletFont = attr.GetBulletFont();
if (attr.GetFont().Ok())
GetBulletSymbol() == attr.GetBulletSymbol() &&
GetBulletNumber() == attr.GetBulletNumber() &&
GetBulletFont() == attr.GetBulletFont() &&
+ GetBulletName() == attr.GetBulletName() &&
m_fontSize == attr.m_fontSize &&
m_fontStyle == attr.m_fontStyle &&
attr.SetBulletStyle(m_bulletStyle);
attr.SetBulletNumber(m_bulletNumber);
attr.SetBulletSymbol(m_bulletSymbol);
+ attr.SetBulletName(m_bulletName);
attr.SetBulletFont(m_bulletFont);
attr.SetCharacterStyleName(m_characterStyleName);
attr.SetParagraphStyleName(m_paragraphStyleName);
if (attr.HasBulletNumber())
newAttr.SetBulletNumber(attr.GetBulletNumber());
+ if (attr.HasBulletName())
+ newAttr.SetBulletName(attr.GetBulletName());
+
if (attr.HasBulletSymbol())
{
newAttr.SetBulletSymbol(attr.GetBulletSymbol());
m_bulletStyle = attr.m_bulletStyle;
m_bulletNumber = attr.m_bulletNumber;
m_bulletSymbol = attr.m_bulletSymbol;
+ m_bulletName = attr.m_bulletName;
m_bulletFont = attr.m_bulletFont;
}
m_lineSpacing = 0;
m_bulletStyle = wxTEXT_ATTR_BULLET_STYLE_NONE;
m_bulletNumber = 0;
- m_bulletSymbol = 0;
m_bulletSymbol = wxT('*');
}
m_bulletNumber = attr.m_bulletNumber;
m_bulletSymbol = attr.m_bulletSymbol;
m_bulletFont = attr.m_bulletFont;
+ m_bulletName = attr.m_bulletName;
}
// Assignment from a wxTextAttr object.
GetBulletStyle() == attr.GetBulletStyle() &&
GetBulletNumber() == attr.GetBulletNumber() &&
GetBulletSymbol() == attr.GetBulletSymbol() &&
+ GetBulletName() == attr.GetBulletName() &&
GetBulletFont() == attr.GetBulletFont() &&
GetCharacterStyleName() == attr.GetCharacterStyleName() &&
GetParagraphStyleName() == attr.GetParagraphStyleName() &&
if (attr.HasBulletNumber())
newAttr.SetBulletNumber(attr.GetBulletNumber());
+ if (attr.HasBulletName())
+ newAttr.SetBulletName(attr.GetBulletName());
+
if (attr.HasBulletSymbol())
{
newAttr.SetBulletSymbol(attr.GetBulletSymbol());
////@begin wxRichTextBulletsPage event table entries
EVT_LISTBOX( ID_RICHTEXTBULLETSPAGE_STYLELISTBOX, wxRichTextBulletsPage::OnStylelistboxSelected )
+ EVT_CHECKBOX( ID_RICHTEXTBULLETSPAGE_PERIODCTRL, wxRichTextBulletsPage::OnPeriodctrlClick )
+ EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_PERIODCTRL, wxRichTextBulletsPage::OnPeriodctrlUpdate )
+
+ EVT_CHECKBOX( ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL, wxRichTextBulletsPage::OnParenthesesctrlClick )
+ EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL, wxRichTextBulletsPage::OnParenthesesctrlUpdate )
+
+ EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC, wxRichTextBulletsPage::OnNumberstaticUpdate )
+
+ EVT_SPINCTRL( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlUpdated )
+ EVT_SPIN_UP( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlUp )
+ EVT_SPIN_DOWN( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlDown )
+ EVT_TEXT( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlTextUpdated )
+ EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlUpdate )
+
EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, wxRichTextBulletsPage::OnSymbolstaticUpdate )
EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, wxRichTextBulletsPage::OnSymbolctrlSelected )
EVT_TEXT( ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, wxRichTextBulletsPage::OnSymbolfontctrlUpdated )
EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, wxRichTextBulletsPage::OnSymbolfontctrlUIUpdate )
- EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC, wxRichTextBulletsPage::OnNumberstaticUpdate )
+ EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NAMESTATIC, wxRichTextBulletsPage::OnNamestaticUpdate )
- EVT_SPINCTRL( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlUpdated )
- EVT_SPIN_UP( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlUp )
- EVT_SPIN_DOWN( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlDown )
- EVT_TEXT( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlTextUpdated )
- EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlUpdate )
-
- EVT_CHECKBOX( ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL, wxRichTextBulletsPage::OnParenthesesctrlClick )
- EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL, wxRichTextBulletsPage::OnParenthesesctrlUpdate )
-
- EVT_CHECKBOX( ID_RICHTEXTBULLETSPAGE_PERIODCTRL, wxRichTextBulletsPage::OnPeriodctrlClick )
- EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_PERIODCTRL, wxRichTextBulletsPage::OnPeriodctrlUpdate )
+ EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_NAMECTRL, wxRichTextBulletsPage::OnNamectrlSelected )
+ EVT_TEXT( ID_RICHTEXTBULLETSPAGE_NAMECTRL, wxRichTextBulletsPage::OnNamectrlUpdated )
+ EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NAMECTRL, wxRichTextBulletsPage::OnNamectrlUIUpdate )
////@end wxRichTextBulletsPage event table entries
////@begin wxRichTextBulletsPage member initialisation
m_styleListBox = NULL;
+ m_periodCtrl = NULL;
+ m_parenthesesCtrl = NULL;
+ m_numberCtrl = NULL;
m_symbolCtrl = NULL;
m_symbolFontCtrl = NULL;
- m_numberCtrl = NULL;
- m_parenthesesCtrl = NULL;
- m_periodCtrl = NULL;
+ m_bulletNameCtrl = NULL;
m_previewCtrl = NULL;
////@end wxRichTextBulletsPage member initialisation
}
itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxString* m_styleListBoxStrings = NULL;
- m_styleListBox = new wxListBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_STYLELISTBOX, wxDefaultPosition, wxDefaultSize, 0, m_styleListBoxStrings, wxLB_SINGLE );
+ m_styleListBox = new wxListBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_STYLELISTBOX, wxDefaultPosition, wxSize(-1, 130), 0, m_styleListBoxStrings, wxLB_SINGLE );
m_styleListBox->SetHelpText(_("The available bullet styles."));
if (ShowToolTips())
m_styleListBox->SetToolTip(_("The available bullet styles."));
- itemBoxSizer5->Add(m_styleListBox, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+ itemBoxSizer5->Add(m_styleListBox, 1, wxGROW|wxALL, 5);
+
+ wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
+ itemBoxSizer5->Add(itemBoxSizer8, 0, wxGROW, 5);
+
+ m_periodCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_PERIODCTRL, _("Peri&od"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_periodCtrl->SetValue(false);
+ m_periodCtrl->SetHelpText(_("Check to add a period after the bullet."));
+ if (ShowToolTips())
+ m_periodCtrl->SetToolTip(_("Check to add a period after the bullet."));
+ itemBoxSizer8->Add(m_periodCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+
+ m_parenthesesCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL, _("&Parentheses"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_parenthesesCtrl->SetValue(false);
+ m_parenthesesCtrl->SetHelpText(_("Check to enclose the bullet in parentheses."));
+ if (ShowToolTips())
+ m_parenthesesCtrl->SetToolTip(_("Check to enclose the bullet in parentheses."));
+ itemBoxSizer8->Add(m_parenthesesCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+
+ itemBoxSizer5->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5);
+
+ wxStaticText* itemStaticText12 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC, _("&Number:"), wxDefaultPosition, wxDefaultSize, 0 );
+ itemBoxSizer5->Add(itemStaticText12, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
+
+ m_numberCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, _T("0"), wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 0, 100000, 0 );
+ m_numberCtrl->SetHelpText(_("The list item number."));
+ if (ShowToolTips())
+ m_numberCtrl->SetToolTip(_("The list item number."));
+ itemBoxSizer5->Add(m_numberCtrl, 0, wxGROW|wxALL, 5);
itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
- wxStaticLine* itemStaticLine9 = new wxStaticLine( itemPanel1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
- itemBoxSizer4->Add(itemStaticLine9, 0, wxGROW|wxALL, 5);
+ wxStaticLine* itemStaticLine15 = new wxStaticLine( itemPanel1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
+ itemBoxSizer4->Add(itemStaticLine15, 0, wxGROW|wxLEFT|wxRIGHT, 5);
itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
- wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
- itemBoxSizer4->Add(itemBoxSizer11, 0, wxGROW, 5);
+ wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxVERTICAL);
+ itemBoxSizer4->Add(itemBoxSizer17, 0, wxGROW, 5);
- wxStaticText* itemStaticText12 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, _("&Symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer11->Add(itemStaticText12, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
+ wxStaticText* itemStaticText18 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, _("&Symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
+ itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
- wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxHORIZONTAL);
- itemBoxSizer11->Add(itemBoxSizer13, 0, wxGROW, 5);
+ wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxHORIZONTAL);
+ itemBoxSizer17->Add(itemBoxSizer19, 0, wxGROW, 5);
wxString* m_symbolCtrlStrings = NULL;
- m_symbolCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, wxEmptyString, wxDefaultPosition, wxSize(60, -1), 0, m_symbolCtrlStrings, wxCB_DROPDOWN );
+ m_symbolCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, _T(""), wxDefaultPosition, wxSize(60, -1), 0, m_symbolCtrlStrings, wxCB_DROPDOWN );
m_symbolCtrl->SetHelpText(_("The bullet character."));
if (ShowToolTips())
m_symbolCtrl->SetToolTip(_("The bullet character."));
- itemBoxSizer13->Add(m_symbolCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5);
+ itemBoxSizer19->Add(m_symbolCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5);
- wxButton* itemButton15 = new wxButton( itemPanel1, ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL, _("Ch&oose..."), wxDefaultPosition, wxDefaultSize, 0 );
- itemButton15->SetHelpText(_("Click to browse for a symbol."));
+ wxButton* itemButton21 = new wxButton( itemPanel1, ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL, _("Ch&oose..."), wxDefaultPosition, wxDefaultSize, 0 );
+ itemButton21->SetHelpText(_("Click to browse for a symbol."));
if (ShowToolTips())
- itemButton15->SetToolTip(_("Click to browse for a symbol."));
- itemBoxSizer13->Add(itemButton15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+ itemButton21->SetToolTip(_("Click to browse for a symbol."));
+ itemBoxSizer19->Add(itemButton21, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
- itemBoxSizer11->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+ itemBoxSizer17->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5);
- wxStaticText* itemStaticText17 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, _("Symbol &font:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer11->Add(itemStaticText17, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
+ wxStaticText* itemStaticText23 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, _("Symbol &font:"), wxDefaultPosition, wxDefaultSize, 0 );
+ itemBoxSizer17->Add(itemStaticText23, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxString* m_symbolFontCtrlStrings = NULL;
- m_symbolFontCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, m_symbolFontCtrlStrings, wxCB_DROPDOWN );
+ m_symbolFontCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_symbolFontCtrlStrings, wxCB_DROPDOWN );
m_symbolFontCtrl->SetHelpText(_("Available fonts."));
if (ShowToolTips())
m_symbolFontCtrl->SetToolTip(_("Available fonts."));
- itemBoxSizer11->Add(m_symbolFontCtrl, 0, wxGROW|wxALL, 5);
-
- itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
-
- wxStaticLine* itemStaticLine20 = new wxStaticLine( itemPanel1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
- itemBoxSizer4->Add(itemStaticLine20, 0, wxGROW|wxALL, 5);
-
- itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
-
- wxBoxSizer* itemBoxSizer22 = new wxBoxSizer(wxVERTICAL);
- itemBoxSizer4->Add(itemBoxSizer22, 0, wxGROW, 5);
+ itemBoxSizer17->Add(m_symbolFontCtrl, 0, wxGROW|wxALL, 5);
- wxStaticText* itemStaticText23 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC, _("&Number:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer22->Add(itemStaticText23, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
+ itemBoxSizer17->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
- m_numberCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, _T("0"), wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 0, 100000, 0 );
- m_numberCtrl->SetHelpText(_("The list item number."));
- if (ShowToolTips())
- m_numberCtrl->SetToolTip(_("The list item number."));
- itemBoxSizer22->Add(m_numberCtrl, 0, wxGROW|wxALL, 5);
+ wxStaticText* itemStaticText26 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NAMESTATIC, _("S&tandard bullet name:"), wxDefaultPosition, wxDefaultSize, 0 );
+ itemBoxSizer17->Add(itemStaticText26, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
- itemBoxSizer22->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
-
- m_parenthesesCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL, _("&Parentheses"), wxDefaultPosition, wxDefaultSize, 0 );
- m_parenthesesCtrl->SetValue(false);
- m_parenthesesCtrl->SetHelpText(_("Check to enclose the bullet in parentheses."));
+ wxString* m_bulletNameCtrlStrings = NULL;
+ m_bulletNameCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_NAMECTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_bulletNameCtrlStrings, wxCB_DROPDOWN );
+ m_bulletNameCtrl->SetHelpText(_("A standard bullet name."));
if (ShowToolTips())
- m_parenthesesCtrl->SetToolTip(_("Check to enclose the bullet in parentheses."));
- itemBoxSizer22->Add(m_parenthesesCtrl, 0, wxALIGN_LEFT|wxALL, 5);
-
- m_periodCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_PERIODCTRL, _("Peri&od"), wxDefaultPosition, wxDefaultSize, 0 );
- m_periodCtrl->SetValue(false);
- m_periodCtrl->SetHelpText(_("Check to add a period after the bullet."));
- if (ShowToolTips())
- m_periodCtrl->SetToolTip(_("Check to add a period after the bullet."));
- itemBoxSizer22->Add(m_periodCtrl, 0, wxALIGN_LEFT|wxALL, 5);
+ m_bulletNameCtrl->SetToolTip(_("A standard bullet name."));
+ itemBoxSizer17->Add(m_bulletNameCtrl, 0, wxGROW|wxALL, 5);
itemBoxSizer3->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_styleListBox->Append(_("Lower case roman numerals"));
m_styleListBox->Append(_("Symbol"));
m_styleListBox->Append(_("Bitmap"));
+ m_styleListBox->Append(_("Standard"));
m_symbolCtrl->Append(_("*"));
m_symbolCtrl->Append(_("-"));
m_symbolCtrl->Append(_(">"));
m_symbolCtrl->Append(_("+"));
m_symbolCtrl->Append(_("~"));
+
+ m_bulletNameCtrl->Append(_("standard/round"));
+ m_bulletNameCtrl->Append(_("standard/square"));
wxArrayString facenames = wxRichTextCtrl::GetAvailableFontNames();
facenames.Sort();
bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_SYMBOL;
else if (index == 7)
bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_BITMAP;
+ else if (index == 8)
+ {
+ bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_STANDARD;
+ attr->SetBulletName(m_bulletNameCtrl->GetValue());
+ }
if (m_parenthesesCtrl->GetValue())
bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_PARENTHESES;
if (attr->HasBulletStyle())
{
+ m_hasBulletStyle = true;
int index = -1;
if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ARABIC)
index = 1;
index = 6;
else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_BITMAP)
index = 7;
+ else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_STANDARD)
+ index = 8;
m_styleListBox->SetSelection(index);
if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PARENTHESES)
m_periodCtrl->SetValue(false);
}
else
+ {
+ m_hasBulletStyle = false;
m_styleListBox->SetSelection(-1);
+ }
if (attr->HasBulletSymbol())
{
else
m_numberCtrl->SetValue(0);
+ if (attr->HasBulletName())
+ m_bulletNameCtrl->SetValue(attr->GetBulletName());
+ else
+ m_bulletNameCtrl->SetValue(wxEmptyString);
+
UpdatePreview();
m_dontUpdate = false;
TransferDataFromWindow();
wxTextAttrEx attr(*GetAttributes());
attr.SetFlags(attr.GetFlags() &
- (wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_SYMBOL|
+ (wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_SYMBOL|wxTEXT_ATTR_BULLET_NAME|
wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|
wxTEXT_ATTR_LINE_SPACING));
void wxRichTextBulletsPage::OnNumberUpdate( wxUpdateUIEvent& event )
{
int sel = m_styleListBox->GetSelection();
- event.Enable( m_hasBulletStyle && (sel != 6 && sel != 7 && sel != 0));
+ event.Enable( m_hasBulletStyle && (sel != 6 && sel != 7 && sel != 8 && sel != 0));
}
+/// Update for standard bullet-related controls
+void wxRichTextBulletsPage::OnStandardBulletUpdate( wxUpdateUIEvent& event )
+{
+ int sel = m_styleListBox->GetSelection();
+ event.Enable( sel == 8 );
+}
+
+
/*!
* wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
*/
OnNumberUpdate(event);
}
+/*!
+ * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMESTATIC
+ */
+
+void wxRichTextBulletsPage::OnNamestaticUpdate( wxUpdateUIEvent& event )
+{
+ OnStandardBulletUpdate(event);
+}
+
+
+/*!
+ * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
+ */
+
+void wxRichTextBulletsPage::OnNamectrlSelected( wxCommandEvent& WXUNUSED(event) )
+{
+ if (m_dontUpdate)
+ return;
+ UpdatePreview();
+}
+
+/*!
+ * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
+ */
+
+void wxRichTextBulletsPage::OnNamectrlUpdated( wxCommandEvent& WXUNUSED(event) )
+{
+ if (m_dontUpdate)
+ return;
+ UpdatePreview();
+}
+
+/*!
+ * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
+ */
+
+void wxRichTextBulletsPage::OnNamectrlUIUpdate( wxUpdateUIEvent& event )
+{
+ OnStandardBulletUpdate(event);
+}
+
#endif // wxUSE_RICHTEXT
EVT_LISTBOX( ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX, wxRichTextListStylePage::OnStylelistboxSelected )
+ EVT_CHECKBOX( ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL, wxRichTextListStylePage::OnPeriodctrlClick )
+ EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL, wxRichTextListStylePage::OnPeriodctrlUpdate )
+
+ EVT_CHECKBOX( ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL, wxRichTextListStylePage::OnParenthesesctrlClick )
+ EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL, wxRichTextListStylePage::OnParenthesesctrlUpdate )
+
EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC, wxRichTextListStylePage::OnSymbolstaticUpdate )
EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, wxRichTextListStylePage::OnSymbolctrlSelected )
EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, wxRichTextListStylePage::OnSymbolfontctrlUpdated )
EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, wxRichTextListStylePage::OnSymbolfontctrlUIUpdate )
- EVT_CHECKBOX( ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL, wxRichTextListStylePage::OnParenthesesctrlClick )
- EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL, wxRichTextListStylePage::OnParenthesesctrlUpdate )
+ EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC, wxRichTextListStylePage::OnNamestaticUpdate )
- EVT_CHECKBOX( ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL, wxRichTextListStylePage::OnPeriodctrlClick )
- EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL, wxRichTextListStylePage::OnPeriodctrlUpdate )
+ EVT_COMBOBOX( ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, wxRichTextListStylePage::OnNamectrlSelected )
+ EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, wxRichTextListStylePage::OnNamectrlUpdated )
+ EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, wxRichTextListStylePage::OnNamectrlUIUpdate )
EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT, wxRichTextListStylePage::OnRichtextliststylepageAlignleftSelected )
////@begin wxRichTextListStylePage member initialisation
m_levelCtrl = NULL;
m_styleListBox = NULL;
+ m_periodCtrl = NULL;
+ m_parenthesesCtrl = NULL;
m_symbolCtrl = NULL;
m_symbolFontCtrl = NULL;
- m_parenthesesCtrl = NULL;
- m_periodCtrl = NULL;
+ m_bulletNameCtrl = NULL;
m_alignmentLeft = NULL;
m_alignmentRight = NULL;
m_alignmentJustified = NULL;
m_previewCtrl = NULL;
////@end wxRichTextListStylePage member initialisation
}
+
/*!
* Control creation for wxRichTextListStylePage
*/
itemButton8->SetToolTip(_("Click to choose the font for this level."));
itemBoxSizer4->Add(itemButton8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
- wxNotebook* itemNotebook9 = new wxNotebook( itemPanel1, ID_RICHTEXTLISTSTYLEPAGE_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxBK_TOP );
+ wxNotebook* itemNotebook9 = new wxNotebook( itemPanel1, ID_RICHTEXTLISTSTYLEPAGE_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxNB_TOP );
wxPanel* itemPanel10 = new wxPanel( itemNotebook9, ID_RICHTEXTLISTSTYLEPAGE_BULLETS, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer13->Add(itemStaticText14, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxString* m_styleListBoxStrings = NULL;
- m_styleListBox = new wxListBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX, wxDefaultPosition, wxDefaultSize, 0, m_styleListBoxStrings, wxLB_SINGLE );
+ m_styleListBox = new wxListBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX, wxDefaultPosition, wxSize(-1, 130), 0, m_styleListBoxStrings, wxLB_SINGLE );
m_styleListBox->SetHelpText(_("The available bullet styles."));
if (ShowToolTips())
m_styleListBox->SetToolTip(_("The available bullet styles."));
- itemBoxSizer13->Add(m_styleListBox, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+ itemBoxSizer13->Add(m_styleListBox, 1, wxGROW|wxALL, 5);
+
+ wxBoxSizer* itemBoxSizer16 = new wxBoxSizer(wxHORIZONTAL);
+ itemBoxSizer13->Add(itemBoxSizer16, 0, wxGROW, 5);
+ m_periodCtrl = new wxCheckBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL, _("Peri&od"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_periodCtrl->SetValue(false);
+ m_periodCtrl->SetHelpText(_("Check to add a period after the bullet."));
+ if (ShowToolTips())
+ m_periodCtrl->SetToolTip(_("Check to add a period after the bullet."));
+ itemBoxSizer16->Add(m_periodCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+
+ m_parenthesesCtrl = new wxCheckBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL, _("&Parentheses"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_parenthesesCtrl->SetValue(false);
+ m_parenthesesCtrl->SetHelpText(_("Check to enclose the bullet in parentheses."));
+ if (ShowToolTips())
+ m_parenthesesCtrl->SetToolTip(_("Check to enclose the bullet in parentheses."));
+ itemBoxSizer16->Add(m_parenthesesCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemBoxSizer12->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
- wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
- itemBoxSizer12->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
+ wxStaticLine* itemStaticLine20 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
+ itemBoxSizer12->Add(itemStaticLine20, 0, wxGROW|wxALL, 5);
itemBoxSizer12->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
- wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxVERTICAL);
- itemBoxSizer12->Add(itemBoxSizer19, 0, wxGROW, 5);
- wxStaticText* itemStaticText20 = new wxStaticText( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC, _("&Symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer19->Add(itemStaticText20, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
+ wxBoxSizer* itemBoxSizer22 = new wxBoxSizer(wxVERTICAL);
+ itemBoxSizer12->Add(itemBoxSizer22, 0, wxGROW, 5);
+ wxStaticText* itemStaticText23 = new wxStaticText( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC, _("&Symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
+ itemBoxSizer22->Add(itemStaticText23, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
- wxBoxSizer* itemBoxSizer21 = new wxBoxSizer(wxHORIZONTAL);
- itemBoxSizer19->Add(itemBoxSizer21, 0, wxGROW, 5);
+ wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxHORIZONTAL);
+ itemBoxSizer22->Add(itemBoxSizer24, 0, wxGROW, 5);
wxString* m_symbolCtrlStrings = NULL;
- m_symbolCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, wxEmptyString, wxDefaultPosition, wxSize(60, -1), 0, m_symbolCtrlStrings, wxCB_DROPDOWN );
+ m_symbolCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, _T(""), wxDefaultPosition, wxSize(60, -1), 0, m_symbolCtrlStrings, wxCB_DROPDOWN );
m_symbolCtrl->SetHelpText(_("The bullet character."));
if (ShowToolTips())
m_symbolCtrl->SetToolTip(_("The bullet character."));
- itemBoxSizer21->Add(m_symbolCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5);
+ itemBoxSizer24->Add(m_symbolCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5);
- wxButton* itemButton23 = new wxButton( itemPanel10, ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL, _("Ch&oose..."), wxDefaultPosition, wxDefaultSize, 0 );
- itemButton23->SetHelpText(_("Click to browse for a symbol."));
+ wxButton* itemButton26 = new wxButton( itemPanel10, ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL, _("Ch&oose..."), wxDefaultPosition, wxDefaultSize, 0 );
+ itemButton26->SetHelpText(_("Click to browse for a symbol."));
if (ShowToolTips())
- itemButton23->SetToolTip(_("Click to browse for a symbol."));
- itemBoxSizer21->Add(itemButton23, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+ itemButton26->SetToolTip(_("Click to browse for a symbol."));
+ itemBoxSizer24->Add(itemButton26, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
- itemBoxSizer19->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+ itemBoxSizer22->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5);
- wxStaticText* itemStaticText25 = new wxStaticText( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC, _("Symbol &font:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer19->Add(itemStaticText25, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
+ wxStaticText* itemStaticText28 = new wxStaticText( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC, _("Symbol &font:"), wxDefaultPosition, wxDefaultSize, 0 );
+ itemBoxSizer22->Add(itemStaticText28, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxString* m_symbolFontCtrlStrings = NULL;
- m_symbolFontCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, m_symbolFontCtrlStrings, wxCB_DROPDOWN );
+ m_symbolFontCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_symbolFontCtrlStrings, wxCB_DROPDOWN );
if (ShowToolTips())
m_symbolFontCtrl->SetToolTip(_("Available fonts."));
- itemBoxSizer19->Add(m_symbolFontCtrl, 0, wxGROW|wxALL, 5);
-
- itemBoxSizer12->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
+ itemBoxSizer22->Add(m_symbolFontCtrl, 0, wxGROW|wxALL, 5);
- wxStaticLine* itemStaticLine28 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
- itemBoxSizer12->Add(itemStaticLine28, 0, wxGROW|wxALL, 5);
+ itemBoxSizer22->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL, 5);
- itemBoxSizer12->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
+ wxStaticText* itemStaticText31 = new wxStaticText( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC, _("S&tandard bullet name:"), wxDefaultPosition, wxDefaultSize, 0 );
+ itemBoxSizer22->Add(itemStaticText31, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
- wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
- itemBoxSizer12->Add(itemBoxSizer30, 0, wxALIGN_TOP|wxRIGHT|wxTOP|wxBOTTOM, 5);
- m_parenthesesCtrl = new wxCheckBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL, _("&Parentheses"), wxDefaultPosition, wxDefaultSize, 0 );
- m_parenthesesCtrl->SetValue(false);
- m_parenthesesCtrl->SetHelpText(_("Check to enclose the bullet in parentheses."));
- if (ShowToolTips())
- m_parenthesesCtrl->SetToolTip(_("Check to enclose the bullet in parentheses."));
- itemBoxSizer30->Add(m_parenthesesCtrl, 0, wxALIGN_LEFT|wxALL, 5);
-
- m_periodCtrl = new wxCheckBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL, _("Peri&od"), wxDefaultPosition, wxDefaultSize, 0 );
- m_periodCtrl->SetValue(false);
- m_periodCtrl->SetHelpText(_("Check to add a period after the bullet."));
+ wxString* m_bulletNameCtrlStrings = NULL;
+ m_bulletNameCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_bulletNameCtrlStrings, wxCB_DROPDOWN );
+ m_bulletNameCtrl->SetHelpText(_("A standard bullet name."));
if (ShowToolTips())
- m_periodCtrl->SetToolTip(_("Check to add a period after the bullet."));
- itemBoxSizer30->Add(m_periodCtrl, 0, wxALIGN_LEFT|wxALL, 5);
+ m_bulletNameCtrl->SetToolTip(_("A standard bullet name."));
+ itemBoxSizer22->Add(m_bulletNameCtrl, 0, wxGROW|wxALL, 5);
itemNotebook9->AddPage(itemPanel10, _("Bullet style"));
wxBoxSizer* itemBoxSizer55 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer53->Add(itemBoxSizer55, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- m_indentLeft = new wxTextCtrl( itemPanel33, ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
+ m_indentLeft = new wxTextCtrl( itemPanel33, ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_indentLeft->SetHelpText(_("The left indent."));
if (ShowToolTips())
m_indentLeft->SetToolTip(_("The left indent."));
wxBoxSizer* itemBoxSizer58 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer53->Add(itemBoxSizer58, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- m_indentLeftFirst = new wxTextCtrl( itemPanel33, ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
+ m_indentLeftFirst = new wxTextCtrl( itemPanel33, ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_indentLeftFirst->SetHelpText(_("The first line indent."));
if (ShowToolTips())
m_indentLeftFirst->SetToolTip(_("The first line indent."));
wxBoxSizer* itemBoxSizer61 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer53->Add(itemBoxSizer61, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- m_indentRight = new wxTextCtrl( itemPanel33, ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
+ m_indentRight = new wxTextCtrl( itemPanel33, ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_indentRight->SetHelpText(_("The right indent."));
if (ShowToolTips())
m_indentRight->SetToolTip(_("The right indent."));
wxBoxSizer* itemBoxSizer72 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer70->Add(itemBoxSizer72, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- m_spacingBefore = new wxTextCtrl( itemPanel33, ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
+ m_spacingBefore = new wxTextCtrl( itemPanel33, ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_spacingBefore->SetHelpText(_("The spacing before the paragraph."));
if (ShowToolTips())
m_spacingBefore->SetToolTip(_("The spacing before the paragraph."));
wxBoxSizer* itemBoxSizer75 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer70->Add(itemBoxSizer75, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- m_spacingAfter = new wxTextCtrl( itemPanel33, ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
+ m_spacingAfter = new wxTextCtrl( itemPanel33, ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_spacingAfter->SetHelpText(_("The spacing after the paragraph."));
if (ShowToolTips())
m_spacingAfter->SetToolTip(_("The spacing after the paragraph."));
m_styleListBox->Append(_("Lower case roman numerals"));
m_styleListBox->Append(_("Symbol"));
m_styleListBox->Append(_("Bitmap"));
+ m_styleListBox->Append(_("Standard"));
m_symbolCtrl->Append(_("*"));
m_symbolCtrl->Append(_("-"));
m_symbolCtrl->Append(_("+"));
m_symbolCtrl->Append(_("~"));
+ m_bulletNameCtrl->Append(_("standard/round"));
+ m_bulletNameCtrl->Append(_("standard/square"));
+
wxArrayString facenames = wxRichTextCtrl::GetAvailableFontNames();
facenames.Sort();
bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_SYMBOL;
else if (index == 7)
bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_BITMAP;
+ else if (index == 8)
+ {
+ bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_STANDARD;
+ attr->SetBulletName(m_bulletNameCtrl->GetValue());
+ }
if (m_parenthesesCtrl->GetValue())
bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_PARENTHESES;
index = 6;
else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_BITMAP)
index = 7;
+ else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_STANDARD)
+ index = 8;
m_styleListBox->SetSelection(index);
if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PARENTHESES)
else
m_symbolCtrl->SetValue(wxEmptyString);
+ if (attr->HasBulletName())
+ m_bulletNameCtrl->SetValue(attr->GetBulletName());
+ else
+ m_bulletNameCtrl->SetValue(wxEmptyString);
+
m_dontUpdate = false;
}
* wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
*/
-void wxRichTextListStylePage::OnLevelTextUpdated( wxCommandEvent& event )
+void wxRichTextListStylePage::OnLevelTextUpdated( wxCommandEvent& WXUNUSED(event) )
{
// Can cause problems
#if 0
void wxRichTextListStylePage::OnNumberUpdate( wxUpdateUIEvent& event )
{
int sel = m_styleListBox->GetSelection();
- event.Enable((sel != 6 && sel != 7 && sel != 0));
+ event.Enable((sel != 6 && sel != 7 && sel != 8 && sel != 0));
+}
+
+/// Update for standard bullet-related controls
+void wxRichTextListStylePage::OnStandardBulletUpdate( wxUpdateUIEvent& event )
+{
+ int sel = m_styleListBox->GetSelection();
+ event.Enable( sel == 8 );
}
/*!
TransferAndPreview();
}
}
+/*!
+ * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC
+ */
+
+void wxRichTextListStylePage::OnNamestaticUpdate( wxUpdateUIEvent& event )
+{
+ OnStandardBulletUpdate(event);
+}
+
+/*!
+ * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
+ */
+
+void wxRichTextListStylePage::OnNamectrlSelected( wxCommandEvent& WXUNUSED(event) )
+{
+ TransferAndPreview();
+}
+
+/*!
+ * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
+ */
+
+void wxRichTextListStylePage::OnNamectrlUpdated( wxCommandEvent& WXUNUSED(event) )
+{
+ TransferAndPreview();
+}
+
+/*!
+ * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
+ */
+
+void wxRichTextListStylePage::OnNamectrlUIUpdate( wxUpdateUIEvent& event )
+{
+ OnStandardBulletUpdate(event);
+}
}
if (!attr.GetCharacterStyleName().empty())
- str << wxT(" charactertyle=\"") << wxString(attr.GetCharacterStyleName()) << wxT("\"");
+ str << wxT(" characterstyle=\"") << wxString(attr.GetCharacterStyleName()) << wxT("\"");
if (isPara)
{
str << wxT(" bulletfont=\"") << attr.GetBulletFont() << wxT("\"");
}
+ if (attr.HasBulletName())
+ str << wxT(" bulletname=\"") << attr.GetBulletName() << wxT("\"");
+
if (!attr.GetParagraphStyleName().empty())
str << wxT(" parstyle=\"") << wxString(attr.GetParagraphStyleName()) << wxT("\"");
+ if (!attr.GetListStyleName().empty())
+ str << wxT(" liststyle=\"") << wxString(attr.GetListStyleName()) << wxT("\"");
+
if (attr.HasTabs())
{
str << wxT(" tabs=\"");
if (!value.empty())
attr.SetBulletFont(value);
+ value = node->GetPropVal(wxT("bulletname"), wxEmptyString);
+ if (!value.empty())
+ attr.SetBulletName(value);
+
value = node->GetPropVal(wxT("parstyle"), wxEmptyString);
if (!value.empty())
attr.SetParagraphStyleName(value);
+ value = node->GetPropVal(wxT("liststyle"), wxEmptyString);
+ if (!value.empty())
+ attr.SetListStyleName(value);
+
value = node->GetPropVal(wxT("tabs"), wxEmptyString);
if (!value.empty())
{