Commit d7e63930 authored by Julia Radzhabova's avatar Julia Radzhabova

[PE][SSE] Shape/TextArt Settings: add stroke-line type.

parent 8384f21f
...@@ -108,6 +108,14 @@ ...@@ -108,6 +108,14 @@
</div> </div>
</td> </td>
</tr> </tr>
<tr>
<td class="padding-small">
<div style="display:inline-block;width:100px;vertical-align: middle;">
<label class="input-label" style=""><%= scope.strType %></label>
<div id="shape-combo-border-type" style="width: 93px;"></div>
</div>
</td>
</tr>
<tr class="shape-only"> <tr class="shape-only">
<td class="padding-small"></td> <td class="padding-small"></td>
</tr> </tr>
......
...@@ -123,6 +123,14 @@ ...@@ -123,6 +123,14 @@
</div> </div>
</td> </td>
</tr> </tr>
<tr>
<td class="padding-small">
<div style="display:inline-block;width:100px;vertical-align: middle;">
<label class="input-label" style=""><%= scope.strType %></label>
<div id="textart-combo-border-type" style="width: 93px;"></div>
</div>
</td>
</tr>
<tr> <tr>
<td class="padding-small"> <td class="padding-small">
<div class="separator horizontal"></div> <div class="separator horizontal"></div>
......
...@@ -88,6 +88,7 @@ define([ ...@@ -88,6 +88,7 @@ define([
StrokeType: Asc.c_oAscStrokeType.STROKE_COLOR, StrokeType: Asc.c_oAscStrokeType.STROKE_COLOR,
StrokeWidth: this._pt2mm(1), StrokeWidth: this._pt2mm(1),
StrokeColor: '000000', StrokeColor: '000000',
StrokeBorderType: Asc.c_oDashType.solid,
FGColor: '000000', FGColor: '000000',
BGColor: 'ffffff', BGColor: 'ffffff',
GradColor: '000000', GradColor: '000000',
...@@ -113,6 +114,7 @@ define([ ...@@ -113,6 +114,7 @@ define([
this.BorderColor = {Value: 1, Color: 'transparent'}; // value=1 - цвет определен - прозрачный или другой, value=0 - цвет не определен, рисуем прозрачным this.BorderColor = {Value: 1, Color: 'transparent'}; // value=1 - цвет определен - прозрачный или другой, value=0 - цвет не определен, рисуем прозрачным
this.BorderSize = 0; this.BorderSize = 0;
this.BorderType = Asc.c_oDashType.solid;
this.textureNames = [this.txtCanvas, this.txtCarton, this.txtDarkFabric, this.txtGrain, this.txtGranite, this.txtGreyPaper, this.textureNames = [this.txtCanvas, this.txtCarton, this.txtDarkFabric, this.txtGrain, this.txtGranite, this.txtGreyPaper,
this.txtKnit, this.txtLeather, this.txtBrownPaper, this.txtPapyrus, this.txtWood]; this.txtKnit, this.txtLeather, this.txtBrownPaper, this.txtPapyrus, this.txtWood];
...@@ -534,6 +536,16 @@ define([ ...@@ -534,6 +536,16 @@ define([
$(this.el).on('click', '#shape-border-color-new', _.bind(this.addNewColor, this, this.colorsBorder, this.btnBorderColor)); $(this.el).on('click', '#shape-border-color-new', _.bind(this.addNewColor, this, this.colorsBorder, this.btnBorderColor));
this.lockedControls.push(this.btnBorderColor); this.lockedControls.push(this.btnBorderColor);
this.cmbBorderType = new Common.UI.ComboBorderType({
el: $('#shape-combo-border-type'),
style: "width: 93px;",
menuStyle: 'min-width: 93px;'
}).on('selected', _.bind(this.onBorderTypeSelect, this))
.on('combo:blur', _.bind(this.onComboBlur, this, false));
this.BorderType = Asc.c_oDashType.solid;
this.cmbBorderType.setValue(this.BorderType);
this.lockedControls.push(this.cmbBorderType);
this.btnChangeShape = new Common.UI.Button({ this.btnChangeShape = new Common.UI.Button({
cls: 'btn-icon-default', cls: 'btn-icon-default',
iconCls: 'btn-change-shape', iconCls: 'btn-change-shape',
...@@ -968,6 +980,7 @@ define([ ...@@ -968,6 +980,7 @@ define([
stroke.put_color(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29})); stroke.put_color(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29}));
else if (this._state.StrokeType == Asc.c_oAscStrokeType.STROKE_NONE || this._state.StrokeType === null) else if (this._state.StrokeType == Asc.c_oAscStrokeType.STROKE_NONE || this._state.StrokeType === null)
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(this.BorderColor.Color))); stroke.put_color(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(this.BorderColor.Color)));
stroke.asc_putPrstDash(this.BorderType);
stroke.put_width(this._pt2mm(this.BorderSize)); stroke.put_width(this._pt2mm(this.BorderSize));
} }
props.put_stroke(stroke); props.put_stroke(stroke);
...@@ -1004,6 +1017,25 @@ define([ ...@@ -1004,6 +1017,25 @@ define([
this.applyBorderSize(record.value); this.applyBorderSize(record.value);
}, },
onBorderTypeSelect: function(combo, record) {
this.BorderType = record.value;
if (this.api && !this._noApply) {
var props = new Asc.asc_CShapeProperty();
var stroke = new Asc.asc_CStroke();
if (this.BorderSize<0.01) {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_NONE);
} else {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(this.BorderColor.Color));
stroke.put_width(this._pt2mm(this.BorderSize));
stroke.asc_putPrstDash(this.BorderType);
}
props.put_stroke(stroke);
this.api.ShapeApply(props);
}
this.fireEvent('editcomplete', this);
},
onColorsBorderSelect: function(picker, color) { onColorsBorderSelect: function(picker, color) {
this.btnBorderColor.setColor(color); this.btnBorderColor.setColor(color);
this.BorderColor = {Value: 1, Color: color}; this.BorderColor = {Value: 1, Color: color};
...@@ -1016,6 +1048,7 @@ define([ ...@@ -1016,6 +1048,7 @@ define([
stroke.put_type( Asc.c_oAscStrokeType.STROKE_COLOR); stroke.put_type( Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(this.BorderColor.Color)); stroke.put_color(Common.Utils.ThemeColor.getRgbColor(this.BorderColor.Color));
stroke.put_width(this._pt2mm(this.BorderSize)); stroke.put_width(this._pt2mm(this.BorderSize));
stroke.asc_putPrstDash(this.BorderType);
} }
props.put_stroke(stroke); props.put_stroke(stroke);
this.api.ShapeApply(props); this.api.ShapeApply(props);
...@@ -1298,8 +1331,9 @@ define([ ...@@ -1298,8 +1331,9 @@ define([
} }
// border colors // border colors
var stroke = props.get_stroke(); var stroke = props.get_stroke(),
var strokeType = stroke.get_type(); strokeType = stroke.get_type(),
borderType;
if (stroke) { if (stroke) {
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) { if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
...@@ -1316,6 +1350,7 @@ define([ ...@@ -1316,6 +1350,7 @@ define([
} else { } else {
this.BorderColor = {Value: 1, Color: 'transparent'}; this.BorderColor = {Value: 1, Color: 'transparent'};
} }
borderType = stroke.asc_getPrstDash();
} else { // no stroke } else { // no stroke
strokeType = null; strokeType = null;
this.BorderColor = {Value: 0, Color: 'transparent'}; this.BorderColor = {Value: 0, Color: 'transparent'};
...@@ -1378,6 +1413,11 @@ define([ ...@@ -1378,6 +1413,11 @@ define([
this._state.StrokeType = strokeType; this._state.StrokeType = strokeType;
} }
if (this._state.StrokeBorderType !== borderType) {
this.BorderType = this._state.StrokeBorderType = borderType;
this.cmbBorderType.setValue(borderType);
}
// pattern colors // pattern colors
type1 = typeof(this.FGColor.Color); type1 = typeof(this.FGColor.Color);
type2 = typeof(this._state.FGColor); type2 = typeof(this._state.FGColor);
...@@ -1680,6 +1720,7 @@ define([ ...@@ -1680,6 +1720,7 @@ define([
textDirection: 'Direction', textDirection: 'Direction',
textStyle: 'Style', textStyle: 'Style',
textGradient: 'Gradient', textGradient: 'Gradient',
textBorderSizeErr: 'The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.' textBorderSizeErr: 'The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.',
strType: 'Type'
}, PE.Views.ShapeSettings || {})); }, PE.Views.ShapeSettings || {}));
}); });
...@@ -87,6 +87,7 @@ define([ ...@@ -87,6 +87,7 @@ define([
StrokeType: Asc.c_oAscStrokeType.STROKE_COLOR, StrokeType: Asc.c_oAscStrokeType.STROKE_COLOR,
StrokeWidth: this._pt2mm(1), StrokeWidth: this._pt2mm(1),
StrokeColor: '000000', StrokeColor: '000000',
StrokeBorderType: Asc.c_oDashType.solid,
FGColor: '000000', FGColor: '000000',
BGColor: 'ffffff', BGColor: 'ffffff',
GradColor: '000000', GradColor: '000000',
...@@ -110,6 +111,7 @@ define([ ...@@ -110,6 +111,7 @@ define([
this.BorderColor = {Value: 1, Color: 'transparent'}; // value=1 - цвет определен - прозрачный или другой, value=0 - цвет не определен, рисуем прозрачным this.BorderColor = {Value: 1, Color: 'transparent'}; // value=1 - цвет определен - прозрачный или другой, value=0 - цвет не определен, рисуем прозрачным
this.BorderSize = 0; this.BorderSize = 0;
this.BorderType = Asc.c_oDashType.solid;
this.textureNames = [this.txtCanvas, this.txtCarton, this.txtDarkFabric, this.txtGrain, this.txtGranite, this.txtGreyPaper, this.textureNames = [this.txtCanvas, this.txtCarton, this.txtDarkFabric, this.txtGrain, this.txtGranite, this.txtGreyPaper,
this.txtKnit, this.txtLeather, this.txtBrownPaper, this.txtPapyrus, this.txtWood]; this.txtKnit, this.txtLeather, this.txtBrownPaper, this.txtPapyrus, this.txtWood];
...@@ -549,6 +551,16 @@ define([ ...@@ -549,6 +551,16 @@ define([
this.btnBorderColor.setColor('000000'); this.btnBorderColor.setColor('000000');
$(this.el).on('click', '#textart-border-color-new', _.bind(this.addNewColor, this, this.colorsBorder, this.btnBorderColor)); $(this.el).on('click', '#textart-border-color-new', _.bind(this.addNewColor, this, this.colorsBorder, this.btnBorderColor));
this.cmbBorderType = new Common.UI.ComboBorderType({
el: $('#textart-combo-border-type'),
style: "width: 93px;",
menuStyle: 'min-width: 93px;'
}).on('selected', _.bind(this.onBorderTypeSelect, this))
.on('combo:blur', _.bind(this.onComboBlur, this, false));
this.BorderType = Asc.c_oDashType.solid;
this.cmbBorderType.setValue(this.BorderType);
this.lockedControls.push(this.cmbBorderType);
this.cmbTransform = new Common.UI.ComboDataView({ this.cmbTransform = new Common.UI.ComboDataView({
itemWidth: 50, itemWidth: 50,
itemHeight: 50, itemHeight: 50,
...@@ -997,6 +1009,7 @@ define([ ...@@ -997,6 +1009,7 @@ define([
stroke.put_color(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29})); stroke.put_color(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29}));
else if (this._state.StrokeType == Asc.c_oAscStrokeType.STROKE_NONE || this._state.StrokeType === null) else if (this._state.StrokeType == Asc.c_oAscStrokeType.STROKE_NONE || this._state.StrokeType === null)
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(this.BorderColor.Color))); stroke.put_color(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(this.BorderColor.Color)));
stroke.asc_putPrstDash(this.BorderType);
stroke.put_width(this._pt2mm(this.BorderSize)); stroke.put_width(this._pt2mm(this.BorderSize));
} }
props.asc_putLine(stroke); props.asc_putLine(stroke);
...@@ -1034,6 +1047,26 @@ define([ ...@@ -1034,6 +1047,26 @@ define([
this.applyBorderSize(record.value); this.applyBorderSize(record.value);
}, },
onBorderTypeSelect: function(combo, record) {
this.BorderType = record.value;
if (this.api && !this._noApply) {
var props = new Asc.asc_TextArtProperties();
var stroke = new Asc.asc_CStroke();
if (this.BorderSize<0.01) {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_NONE);
} else {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(this.BorderColor.Color));
stroke.put_width(this._pt2mm(this.BorderSize));
stroke.asc_putPrstDash(this.BorderType);
}
props.asc_putLine(stroke);
this.shapeprops.put_TextArtProperties(props);
this.api.ShapeApply(this.shapeprops);
}
this.fireEvent('editcomplete', this);
},
onColorsBorderSelect: function(picker, color) { onColorsBorderSelect: function(picker, color) {
this.btnBorderColor.setColor(color); this.btnBorderColor.setColor(color);
this.BorderColor = {Value: 1, Color: color}; this.BorderColor = {Value: 1, Color: color};
...@@ -1046,6 +1079,7 @@ define([ ...@@ -1046,6 +1079,7 @@ define([
stroke.put_type( Asc.c_oAscStrokeType.STROKE_COLOR); stroke.put_type( Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(this.BorderColor.Color)); stroke.put_color(Common.Utils.ThemeColor.getRgbColor(this.BorderColor.Color));
stroke.put_width(this._pt2mm(this.BorderSize)); stroke.put_width(this._pt2mm(this.BorderSize));
stroke.asc_putPrstDash(this.BorderType);
} }
props.asc_putLine(stroke); props.asc_putLine(stroke);
this.shapeprops.put_TextArtProperties(props); this.shapeprops.put_TextArtProperties(props);
...@@ -1299,7 +1333,8 @@ define([ ...@@ -1299,7 +1333,8 @@ define([
// border colors // border colors
var stroke = shapeprops.asc_getLine(), var stroke = shapeprops.asc_getLine(),
strokeType = (stroke) ? stroke.get_type() : null; strokeType = (stroke) ? stroke.get_type() : null,
borderType;
if (stroke) { if (stroke) {
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) { if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
...@@ -1316,6 +1351,7 @@ define([ ...@@ -1316,6 +1351,7 @@ define([
} else { } else {
this.BorderColor = {Value: 1, Color: 'transparent'}; this.BorderColor = {Value: 1, Color: 'transparent'};
} }
borderType = stroke.asc_getPrstDash();
} else { // no stroke } else { // no stroke
this.BorderColor = {Value: 0, Color: 'transparent'}; this.BorderColor = {Value: 0, Color: 'transparent'};
} }
...@@ -1377,6 +1413,11 @@ define([ ...@@ -1377,6 +1413,11 @@ define([
this._state.StrokeType = strokeType; this._state.StrokeType = strokeType;
} }
if (this._state.StrokeBorderType !== borderType) {
this.BorderType = this._state.StrokeBorderType = borderType;
this.cmbBorderType.setValue(borderType);
}
// pattern colors // pattern colors
type1 = typeof(this.FGColor.Color); type1 = typeof(this.FGColor.Color);
type2 = typeof(this._state.FGColor); type2 = typeof(this._state.FGColor);
...@@ -1683,6 +1724,7 @@ define([ ...@@ -1683,6 +1724,7 @@ define([
textGradient: 'Gradient', textGradient: 'Gradient',
textBorderSizeErr: 'The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.', textBorderSizeErr: 'The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.',
textTransform: 'Transform', textTransform: 'Transform',
textTemplate: 'Template' textTemplate: 'Template',
strType: 'Type'
}, PE.Views.TextArtSettings || {})); }, PE.Views.TextArtSettings || {}));
}); });
...@@ -474,6 +474,7 @@ ...@@ -474,6 +474,7 @@
"PE.Views.ShapeSettings.strSize": "Size", "PE.Views.ShapeSettings.strSize": "Size",
"PE.Views.ShapeSettings.strStroke": "Stroke", "PE.Views.ShapeSettings.strStroke": "Stroke",
"PE.Views.ShapeSettings.strTransparency": "Opacity", "PE.Views.ShapeSettings.strTransparency": "Opacity",
"PE.Views.ShapeSettings.strType": "Type",
"PE.Views.ShapeSettings.textAdvanced": "Show advanced settings", "PE.Views.ShapeSettings.textAdvanced": "Show advanced settings",
"PE.Views.ShapeSettings.textBorderSizeErr": "The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.", "PE.Views.ShapeSettings.textBorderSizeErr": "The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.",
"PE.Views.ShapeSettings.textColor": "Color Fill", "PE.Views.ShapeSettings.textColor": "Color Fill",
...@@ -712,6 +713,7 @@ ...@@ -712,6 +713,7 @@
"PE.Views.TextArtSettings.strSize": "Size", "PE.Views.TextArtSettings.strSize": "Size",
"PE.Views.TextArtSettings.strStroke": "Stroke", "PE.Views.TextArtSettings.strStroke": "Stroke",
"PE.Views.TextArtSettings.strTransparency": "Opacity", "PE.Views.TextArtSettings.strTransparency": "Opacity",
"PE.Views.TextArtSettings.strType": "Type",
"PE.Views.TextArtSettings.textBorderSizeErr": "The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.", "PE.Views.TextArtSettings.textBorderSizeErr": "The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.",
"PE.Views.TextArtSettings.textColor": "Color Fill", "PE.Views.TextArtSettings.textColor": "Color Fill",
"PE.Views.TextArtSettings.textDirection": "Direction", "PE.Views.TextArtSettings.textDirection": "Direction",
......
...@@ -108,6 +108,14 @@ ...@@ -108,6 +108,14 @@
</div> </div>
</td> </td>
</tr> </tr>
<tr>
<td class="padding-small">
<div style="display:inline-block;width:100px;vertical-align: middle;">
<label class="input-label" style=""><%= scope.strType %></label>
<div id="shape-combo-border-type" style="width: 93px;"></div>
</div>
</td>
</tr>
<tr class="shape-only"> <tr class="shape-only">
<td class="padding-small"></td> <td class="padding-small"></td>
</tr> </tr>
......
...@@ -123,6 +123,14 @@ ...@@ -123,6 +123,14 @@
</div> </div>
</td> </td>
</tr> </tr>
<tr>
<td class="padding-small">
<div style="display:inline-block;width:100px;vertical-align: middle;">
<label class="input-label" style=""><%= scope.strType %></label>
<div id="textart-combo-border-type" style="width: 93px;"></div>
</div>
</td>
</tr>
<tr> <tr>
<td class="padding-small"> <td class="padding-small">
<div class="separator horizontal"></div> <div class="separator horizontal"></div>
......
...@@ -89,6 +89,7 @@ define([ ...@@ -89,6 +89,7 @@ define([
StrokeType: Asc.c_oAscStrokeType.STROKE_COLOR, StrokeType: Asc.c_oAscStrokeType.STROKE_COLOR,
StrokeWidth: this._pt2mm(1), StrokeWidth: this._pt2mm(1),
StrokeColor: '000000', StrokeColor: '000000',
StrokeBorderType: Asc.c_oDashType.solid,
FGColor: '000000', FGColor: '000000',
BGColor: 'ffffff', BGColor: 'ffffff',
GradColor: '000000', GradColor: '000000',
...@@ -114,6 +115,7 @@ define([ ...@@ -114,6 +115,7 @@ define([
this.BorderColor = {Value: 1, Color: 'transparent'}; // value=1 - цвет определен - прозрачный или другой, value=0 - цвет не определен, рисуем прозрачным this.BorderColor = {Value: 1, Color: 'transparent'}; // value=1 - цвет определен - прозрачный или другой, value=0 - цвет не определен, рисуем прозрачным
this.BorderSize = 0; this.BorderSize = 0;
this.BorderType = Asc.c_oDashType.solid;
this.textureNames = [this.txtCanvas, this.txtCarton, this.txtDarkFabric, this.txtGrain, this.txtGranite, this.txtGreyPaper, this.textureNames = [this.txtCanvas, this.txtCarton, this.txtDarkFabric, this.txtGrain, this.txtGranite, this.txtGreyPaper,
this.txtKnit, this.txtLeather, this.txtBrownPaper, this.txtPapyrus, this.txtWood]; this.txtKnit, this.txtLeather, this.txtBrownPaper, this.txtPapyrus, this.txtWood];
...@@ -535,6 +537,16 @@ define([ ...@@ -535,6 +537,16 @@ define([
$(this.el).on('click', '#shape-border-color-new', _.bind(this.addNewColor, this, this.colorsBorder, this.btnBorderColor)); $(this.el).on('click', '#shape-border-color-new', _.bind(this.addNewColor, this, this.colorsBorder, this.btnBorderColor));
this.lockedControls.push(this.btnBorderColor); this.lockedControls.push(this.btnBorderColor);
this.cmbBorderType = new Common.UI.ComboBorderType({
el: $('#shape-combo-border-type'),
style: "width: 93px;",
menuStyle: 'min-width: 93px;'
}).on('selected', _.bind(this.onBorderTypeSelect, this))
.on('combo:blur', _.bind(this.onComboBlur, this, false));
this.BorderType = Asc.c_oDashType.solid;
this.cmbBorderType.setValue(this.BorderType);
this.lockedControls.push(this.cmbBorderType);
this.btnChangeShape = new Common.UI.Button({ this.btnChangeShape = new Common.UI.Button({
cls: 'btn-icon-default', cls: 'btn-icon-default',
iconCls: 'btn-change-shape', iconCls: 'btn-change-shape',
...@@ -984,6 +996,7 @@ define([ ...@@ -984,6 +996,7 @@ define([
stroke.asc_putColor(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29})); stroke.asc_putColor(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29}));
else if (this._state.StrokeType == Asc.c_oAscStrokeType.STROKE_NONE || this._state.StrokeType === null) else if (this._state.StrokeType == Asc.c_oAscStrokeType.STROKE_NONE || this._state.StrokeType === null)
stroke.asc_putColor(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(this.BorderColor.Color))); stroke.asc_putColor(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(this.BorderColor.Color)));
stroke.asc_putPrstDash(this.BorderType);
stroke.asc_putWidth(this._pt2mm(this.BorderSize)); stroke.asc_putWidth(this._pt2mm(this.BorderSize));
} }
props.asc_putStroke(stroke); props.asc_putStroke(stroke);
...@@ -1021,6 +1034,26 @@ define([ ...@@ -1021,6 +1034,26 @@ define([
this.applyBorderSize(record.value); this.applyBorderSize(record.value);
}, },
onBorderTypeSelect: function(combo, record) {
this.BorderType = record.value;
if (this.api && !this._noApply) {
var props = new Asc.asc_CShapeProperty();
var stroke = new Asc.asc_CStroke();
if (this.BorderSize<0.01) {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_NONE);
} else {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(this.BorderColor.Color));
stroke.put_width(this._pt2mm(this.BorderSize));
stroke.asc_putPrstDash(this.BorderType);
}
props.put_stroke(stroke);
this.imgprops.asc_putShapeProperties(props);
this.api.asc_setGraphicObjectProps(this.imgprops);
}
this.fireEvent('editcomplete', this);
},
onColorsBorderSelect: function(picker, color) { onColorsBorderSelect: function(picker, color) {
this.btnBorderColor.setColor(color); this.btnBorderColor.setColor(color);
this.BorderColor = {Value: 1, Color: color}; this.BorderColor = {Value: 1, Color: color};
...@@ -1033,6 +1066,7 @@ define([ ...@@ -1033,6 +1066,7 @@ define([
stroke.asc_putType( Asc.c_oAscStrokeType.STROKE_COLOR); stroke.asc_putType( Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.asc_putColor(Common.Utils.ThemeColor.getRgbColor(this.BorderColor.Color)); stroke.asc_putColor(Common.Utils.ThemeColor.getRgbColor(this.BorderColor.Color));
stroke.asc_putWidth(this._pt2mm(this.BorderSize)); stroke.asc_putWidth(this._pt2mm(this.BorderSize));
stroke.asc_putPrstDash(this.BorderType);
} }
props.asc_putStroke(stroke); props.asc_putStroke(stroke);
this.imgprops.asc_putShapeProperties(props); this.imgprops.asc_putShapeProperties(props);
...@@ -1321,8 +1355,9 @@ define([ ...@@ -1321,8 +1355,9 @@ define([
} }
// border colors // border colors
var stroke = shapeprops.asc_getStroke(); var stroke = shapeprops.asc_getStroke(),
var strokeType = stroke.asc_getType(); strokeType = stroke.asc_getType(),
borderType;
if (stroke) { if (stroke) {
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) { if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
...@@ -1339,6 +1374,7 @@ define([ ...@@ -1339,6 +1374,7 @@ define([
} else { } else {
this.BorderColor = {Value: 1, Color: 'transparent'}; this.BorderColor = {Value: 1, Color: 'transparent'};
} }
borderType = stroke.asc_getPrstDash();
} else { // no stroke } else { // no stroke
strokeType = null; strokeType = null;
this.BorderColor = {Value: 0, Color: 'transparent'}; this.BorderColor = {Value: 0, Color: 'transparent'};
...@@ -1401,6 +1437,11 @@ define([ ...@@ -1401,6 +1437,11 @@ define([
this._state.StrokeType = strokeType; this._state.StrokeType = strokeType;
} }
if (this._state.StrokeBorderType !== borderType) {
this.BorderType = this._state.StrokeBorderType = borderType;
this.cmbBorderType.setValue(borderType);
}
// pattern colors // pattern colors
type1 = typeof(this.FGColor.Color); type1 = typeof(this.FGColor.Color);
type2 = typeof(this._state.FGColor); type2 = typeof(this._state.FGColor);
...@@ -1704,6 +1745,7 @@ define([ ...@@ -1704,6 +1745,7 @@ define([
textDirection: 'Direction', textDirection: 'Direction',
textStyle: 'Style', textStyle: 'Style',
textGradient: 'Gradient', textGradient: 'Gradient',
textBorderSizeErr: 'The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.' textBorderSizeErr: 'The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.',
strType: 'Type'
}, SSE.Views.ShapeSettings || {})); }, SSE.Views.ShapeSettings || {}));
}); });
...@@ -88,6 +88,7 @@ define([ ...@@ -88,6 +88,7 @@ define([
StrokeType: Asc.c_oAscStrokeType.STROKE_COLOR, StrokeType: Asc.c_oAscStrokeType.STROKE_COLOR,
StrokeWidth: this._pt2mm(1), StrokeWidth: this._pt2mm(1),
StrokeColor: '000000', StrokeColor: '000000',
StrokeBorderType: Asc.c_oDashType.solid,
FGColor: '000000', FGColor: '000000',
BGColor: 'ffffff', BGColor: 'ffffff',
GradColor: '000000', GradColor: '000000',
...@@ -111,6 +112,7 @@ define([ ...@@ -111,6 +112,7 @@ define([
this.BorderColor = {Value: 1, Color: 'transparent'}; // value=1 - цвет определен - прозрачный или другой, value=0 - цвет не определен, рисуем прозрачным this.BorderColor = {Value: 1, Color: 'transparent'}; // value=1 - цвет определен - прозрачный или другой, value=0 - цвет не определен, рисуем прозрачным
this.BorderSize = 0; this.BorderSize = 0;
this.BorderType = Asc.c_oDashType.solid;
this.textureNames = [this.txtCanvas, this.txtCarton, this.txtDarkFabric, this.txtGrain, this.txtGranite, this.txtGreyPaper, this.textureNames = [this.txtCanvas, this.txtCarton, this.txtDarkFabric, this.txtGrain, this.txtGranite, this.txtGreyPaper,
this.txtKnit, this.txtLeather, this.txtBrownPaper, this.txtPapyrus, this.txtWood]; this.txtKnit, this.txtLeather, this.txtBrownPaper, this.txtPapyrus, this.txtWood];
...@@ -550,6 +552,16 @@ define([ ...@@ -550,6 +552,16 @@ define([
this.btnBorderColor.setColor('000000'); this.btnBorderColor.setColor('000000');
$(this.el).on('click', '#textart-border-color-new', _.bind(this.addNewColor, this, this.colorsBorder, this.btnBorderColor)); $(this.el).on('click', '#textart-border-color-new', _.bind(this.addNewColor, this, this.colorsBorder, this.btnBorderColor));
this.cmbBorderType = new Common.UI.ComboBorderType({
el: $('#textart-combo-border-type'),
style: "width: 93px;",
menuStyle: 'min-width: 93px;'
}).on('selected', _.bind(this.onBorderTypeSelect, this))
.on('combo:blur', _.bind(this.onComboBlur, this, false));
this.BorderType = Asc.c_oDashType.solid;
this.cmbBorderType.setValue(this.BorderType);
this.lockedControls.push(this.cmbBorderType);
this.cmbTransform = new Common.UI.ComboDataView({ this.cmbTransform = new Common.UI.ComboDataView({
itemWidth: 50, itemWidth: 50,
itemHeight: 50, itemHeight: 50,
...@@ -998,6 +1010,7 @@ define([ ...@@ -998,6 +1010,7 @@ define([
stroke.asc_putColor(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29})); stroke.asc_putColor(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29}));
else if (this._state.StrokeType == Asc.c_oAscStrokeType.STROKE_NONE || this._state.StrokeType === null) else if (this._state.StrokeType == Asc.c_oAscStrokeType.STROKE_NONE || this._state.StrokeType === null)
stroke.asc_putColor(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(this.BorderColor.Color))); stroke.asc_putColor(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(this.BorderColor.Color)));
stroke.asc_putPrstDash(this.BorderType);
stroke.asc_putWidth(this._pt2mm(this.BorderSize)); stroke.asc_putWidth(this._pt2mm(this.BorderSize));
} }
props.asc_putLine(stroke); props.asc_putLine(stroke);
...@@ -1035,6 +1048,26 @@ define([ ...@@ -1035,6 +1048,26 @@ define([
this.applyBorderSize(record.value); this.applyBorderSize(record.value);
}, },
onBorderTypeSelect: function(combo, record) {
this.BorderType = record.value;
if (this.api && !this._noApply) {
var props = new Asc.asc_TextArtProperties();
var stroke = new Asc.asc_CStroke();
if (this.BorderSize<0.01) {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_NONE);
} else {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(this.BorderColor.Color));
stroke.put_width(this._pt2mm(this.BorderSize));
stroke.asc_putPrstDash(this.BorderType);
}
props.asc_putLine(stroke);
this.shapeprops.put_TextArtProperties(props);
this.api.asc_setGraphicObjectProps(this.imgprops);
}
this.fireEvent('editcomplete', this);
},
onColorsBorderSelect: function(picker, color) { onColorsBorderSelect: function(picker, color) {
this.btnBorderColor.setColor(color); this.btnBorderColor.setColor(color);
this.BorderColor = {Value: 1, Color: color}; this.BorderColor = {Value: 1, Color: color};
...@@ -1047,6 +1080,7 @@ define([ ...@@ -1047,6 +1080,7 @@ define([
stroke.asc_putType( Asc.c_oAscStrokeType.STROKE_COLOR); stroke.asc_putType( Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.asc_putColor(Common.Utils.ThemeColor.getRgbColor(this.BorderColor.Color)); stroke.asc_putColor(Common.Utils.ThemeColor.getRgbColor(this.BorderColor.Color));
stroke.asc_putWidth(this._pt2mm(this.BorderSize)); stroke.asc_putWidth(this._pt2mm(this.BorderSize));
stroke.asc_putPrstDash(this.BorderType);
} }
props.asc_putLine(stroke); props.asc_putLine(stroke);
this.shapeprops.put_TextArtProperties(props); this.shapeprops.put_TextArtProperties(props);
...@@ -1303,7 +1337,8 @@ define([ ...@@ -1303,7 +1337,8 @@ define([
// border colors // border colors
var stroke = shapeprops.asc_getLine(), var stroke = shapeprops.asc_getLine(),
strokeType = (stroke) ? stroke.asc_getType() : null; strokeType = (stroke) ? stroke.asc_getType() : null,
borderType;
if (stroke) { if (stroke) {
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) { if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
...@@ -1320,6 +1355,7 @@ define([ ...@@ -1320,6 +1355,7 @@ define([
} else { } else {
this.BorderColor = {Value: 1, Color: 'transparent'}; this.BorderColor = {Value: 1, Color: 'transparent'};
} }
borderType = stroke.asc_getPrstDash();
} else { // no stroke } else { // no stroke
this.BorderColor = {Value: 0, Color: 'transparent'}; this.BorderColor = {Value: 0, Color: 'transparent'};
} }
...@@ -1381,6 +1417,11 @@ define([ ...@@ -1381,6 +1417,11 @@ define([
this._state.StrokeType = strokeType; this._state.StrokeType = strokeType;
} }
if (this._state.StrokeBorderType !== borderType) {
this.BorderType = this._state.StrokeBorderType = borderType;
this.cmbBorderType.setValue(borderType);
}
// pattern colors // pattern colors
type1 = typeof(this.FGColor.Color); type1 = typeof(this.FGColor.Color);
type2 = typeof(this._state.FGColor); type2 = typeof(this._state.FGColor);
...@@ -1688,6 +1729,7 @@ define([ ...@@ -1688,6 +1729,7 @@ define([
textGradient: 'Gradient', textGradient: 'Gradient',
textBorderSizeErr: 'The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.', textBorderSizeErr: 'The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.',
textTransform: 'Transform', textTransform: 'Transform',
textTemplate: 'Template' textTemplate: 'Template',
strType: 'Type'
}, SSE.Views.TextArtSettings || {})); }, SSE.Views.TextArtSettings || {}));
}); });
...@@ -773,6 +773,7 @@ ...@@ -773,6 +773,7 @@
"SSE.Views.ShapeSettings.strSize": "Size", "SSE.Views.ShapeSettings.strSize": "Size",
"SSE.Views.ShapeSettings.strStroke": "Stroke", "SSE.Views.ShapeSettings.strStroke": "Stroke",
"SSE.Views.ShapeSettings.strTransparency": "Opacity", "SSE.Views.ShapeSettings.strTransparency": "Opacity",
"SSE.Views.ShapeSettings.strType": "Type",
"SSE.Views.ShapeSettings.textAdvanced": "Show advanced settings", "SSE.Views.ShapeSettings.textAdvanced": "Show advanced settings",
"SSE.Views.ShapeSettings.textBorderSizeErr": "The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.", "SSE.Views.ShapeSettings.textBorderSizeErr": "The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.",
"SSE.Views.ShapeSettings.textColor": "Color Fill", "SSE.Views.ShapeSettings.textColor": "Color Fill",
...@@ -917,6 +918,7 @@ ...@@ -917,6 +918,7 @@
"SSE.Views.TextArtSettings.strSize": "Size", "SSE.Views.TextArtSettings.strSize": "Size",
"SSE.Views.TextArtSettings.strStroke": "Stroke", "SSE.Views.TextArtSettings.strStroke": "Stroke",
"SSE.Views.TextArtSettings.strTransparency": "Opacity", "SSE.Views.TextArtSettings.strTransparency": "Opacity",
"SSE.Views.TextArtSettings.strType": "Type",
"SSE.Views.TextArtSettings.textBorderSizeErr": "The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.", "SSE.Views.TextArtSettings.textBorderSizeErr": "The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.",
"SSE.Views.TextArtSettings.textColor": "Color Fill", "SSE.Views.TextArtSettings.textColor": "Color Fill",
"SSE.Views.TextArtSettings.textDirection": "Direction", "SSE.Views.TextArtSettings.textDirection": "Direction",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment