+2005-11-30 Peter Dennis Bartok <pbartok@novell.com>
+
+ * TextControl.cs:
+ - No longer artificially moves text 2 pixels down (now that we have
+ borders this is no longer needed)
+ - Added calcs for left, hanging and right indent
+
2005-11-23 Mike Kestner <mkestner@novell.com>
* Menu.cs: mark MenuChanged internal, since it's not exposed by MS.
internal HorizontalAlignment alignment; // Alignment of the line
internal int align_shift; // Pixel shift caused by the alignment
internal bool soft_break; // Tag is 'broken soft' and continuation from previous line
+ internal int indent; // Left indent for the first line
+ internal int hanging_indent; // Hanging indent (left indent for all but the first line)
+ internal int right_indent; // Right indent for all lines
// Stuff that's important for the tree
#endregion // Constructors
#region Internal Properties
+ internal int Indent {
+ get {
+ return indent;
+ }
+
+ set {
+ indent = value;
+ recalc = true;
+ }
+ }
+
+ internal int HangingIndent {
+ get {
+ return hanging_indent;
+ }
+
+ set {
+ hanging_indent = value;
+ recalc = true;
+ }
+ }
+
+ internal int RightIndent {
+ get {
+ return right_indent;
+ }
+
+ set {
+ right_indent = value;
+ recalc = true;
+ }
+ }
+
+
internal int Height {
get {
return height;
this.ascent = 0; // Reset the ascent for the line
tag.shift = 0;
tag.width = 0;
- widths[0] = 0;
+
+ if (this.soft_break) {
+ widths[0] = hanging_indent;
+ } else {
+ widths[0] = indent;
+ }
+
this.recalc = false;
retval = false;
wrapped = false;
if (tag.previous != null) {
tag.X = tag.previous.X;
} else {
- tag.X = 0;
+ tag.X = (int)widths[pos];
}
tag = tag.next;
tag.width = 0;
}
if (doc.wrap) {
- if ((widths[pos] + w) + 27 > doc.viewport_width) {
+ if ((widths[pos] + w) + 27 > (doc.viewport_width - this.right_indent)) {
pos = wrap_pos;
tag.width = wrap_width;
doc.Split(this, tag, pos, true);
// Update our horizontal starting pixel position
if (tag.previous == null) {
- tag.X = 0;
+ tag.X = (int)widths[0];
} else {
tag.X = tag.previous.X + (int)tag.previous.width;
}
selection_end.tag = selection_end.line.tags;
viewport_x = 0;
- viewport_y = -2;
+ viewport_y = 0;
crlf_size = 2;
DeleteChar,
DeleteChars,
CursorMove,
+ Mark,
}
internal class Action {