Commit 2c978c1c authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

- Добавлен labelFont для серии

- Исправлен баг с селектом чарта, если нет изменений
- Добавлена возможность смены фонтов чарта(тестовый пример)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47485 954022d7-b5bf-4e40-9824-e11837661b57
parent c3640978
......@@ -1677,6 +1677,7 @@ function asc_CChartSeria() {
this.Marker = { Size: null, Symbol: null };
this.OutlineColor = null;
this.FormatCode = "";
this.LabelFont = new asc_CChartFont();
this.Properties = {
ValFormula: 0,
......@@ -1687,7 +1688,8 @@ function asc_CChartSeria() {
MarkerSize: 5,
MarkerSymbol: 6,
OutlineColor: 7,
FormatCode: 8
FormatCode: 8,
LabelFont: 9
};
}
......@@ -1734,6 +1736,7 @@ asc_CChartSeria.prototype = {
case this.Properties.MarkerSymbol: return this.Marker.Symbol; break;
case this.Properties.OutlineColor: return this.OutlineColor; break;
case this.Properties.FormatCode: return this.FormatCode; break;
case this.Properties.LabelFont: return this.LabelFont; break;
}
},
......@@ -1748,6 +1751,7 @@ asc_CChartSeria.prototype = {
case this.Properties.MarkerSymbol: this.Marker.Symbol = value; break;
case this.Properties.OutlineColor: this.OutlineColor = value; break;
case this.Properties.FormatCode: this.FormatCode = value; break;
case this.Properties.LabelFont: this.LabelFont = value; break;
}
}
}
......
......@@ -75,7 +75,7 @@
<script type="text/javascript" src="model/AdvancedOptions.js"></script>
<script type="text/javascript" src="model/History.js"></script>
<script type="text/javascript" src="model/UndoRedo.js"></script>
<script type="text/javascript" src="view/scroll.js"></script>
<script type="text/javascript" src="view/StringRender.js"></script>
<script type="text/javascript" src="view/CellTextRender.js"></script>
......@@ -1591,6 +1591,23 @@
</li>
</ul>
</td>
<td class="cp toolbarSep" style="vertical-align: top; width: 15px;min-width:15px;">
<div class="sepMenu ToolbarIconOut" style="position: absolute; background: url('menu/img/sep.png') repeat-y scroll 0pt 0pt transparent; margin-top: -7px; height: 65px; margin-left: 6px;"></div>
</td>
<td>
<ul class="noListStyle">
<li class="ToolbarIconOut selectableIcon" title="Set fixed area">
<div id="td_set_fixed_area" class="iconToolbar">
<img class="ToolbarIcon FixedArea" src="menu/img/spacer.gif"/>
</div>
</li>
<li class="ToolbarIconOut selectableIcon" title="Clean fixed area">
<div id="td_clean_fixed_area" class="iconToolbar">
<img class="ToolbarIcon FixedAreaClean" src="menu/img/spacer.gif"/>
</div>
</li>
</ul>
</td>
<td class="cp toolbarSep" style="vertical-align: top; width: 15px;min-width:15px;">
<div class="sepMenu ToolbarIconOut" style="position: absolute; background: url('menu/img/sep.png') repeat-y scroll 0pt 0pt transparent; margin-top: -7px; height: 65px; margin-left: 6px;"></div>
</td>
......@@ -2041,6 +2058,14 @@
</td></tr>
</table>
</div>
<div id='chartFontSelector' style='font-size: 12px;'>
<input type='text' style='margin-left: 10px;' id='fontName' value='Calibri'>
<input type='text' style='margin-left: 10px;' id='fontSize' value='10'>
<input type='text' style='margin-left: 10px;' id='fontColor' value='Black'>
<input type='checkbox' id='fontBold' checked style='margin-left: 10px;'>Bold<br>
<input type='checkbox' id='fontItalic' checked style='margin-left: 10px;'>Italic<br>
<input type='checkbox' id='fontUnderline' checked style='margin-left: 10px;'>Underline<br>
</div>
<div id='drawingObjectsMenu'>
<div id='imageSelector' style='font-size: 12px; visibility: hidden;'>
<input type='text' id='imageSelectorUrl' style='width: 340px; margin: 10px;'/>
......@@ -2085,11 +2110,11 @@
</fieldset>
<fieldset id="titlesField">
<legend>Titles</legend>
<input type='text' style='margin-left: 10px;' id='chartTitle' value='Diagramm'><br>
<input type='text' style='margin-left: 10px;' id='chartTitle' value='Diagramm'><img class="menuChartFont" id="chartTitleFont" src="menu/img/chartFont.png"/><br>
<span style='margin-left: 10px;'>X axis title</span>
<input type='text' style='margin-left: 10px;' id='xAxisTitle' value='X axis'><br>
<input type='text' style='margin-left: 10px;' id='xAxisTitle' value='X axis'><img class="menuChartFont" id="chartAxisXFont" src="menu/img/chartFont.png"/><br>
<span style='margin-left: 10px;'>Y axis title</span>
<input type='text' style='margin-left: 10px;' id='yAxisTitle' value='Y axis'><br>
<input type='text' style='margin-left: 10px;' id='yAxisTitle' value='Y axis'><img class="menuChartFont" id="chartAxisYFont" src="menu/img/chartFont.png"/><br>
<input type='checkbox' id='valueShow' style='margin-left: 10px;'>Show values
<input type='checkbox' id='borderShow' style='margin-left: 10px;'>Show border<br>
</fieldset>
......
......@@ -659,7 +659,11 @@
function addClassIconPress(a){
a.addClass("iconPressed");
}
$("#td_sort_desc,#td_sort_asc,#td_text_wrap, #td_redo, #td_undo, #td_bold, #td_italic, #td_underline, #td_print, #td_copy, #td_paste,#td_cut, #td_ta_center, #td_ta_right, #td_ta_left, #td_ta_justify, #td_mergeCells, #td_recalc, #td_insert_chart, #td_insert_image_url, #td_insert_image_file, #td_drawing_object_layer, #td_add_cell_comment, #td_add_document_comment, #td_add_hyperlink, #td_auto_filter, #td_auto_filter_local").click(function(){
$("#td_sort_desc,#td_sort_asc,#td_text_wrap, #td_redo, #td_undo, #td_bold, #td_italic, #td_underline, \
#td_print, #td_copy, #td_paste,#td_cut, #td_ta_center, #td_ta_right, #td_ta_left, #td_ta_justify, \
#td_mergeCells, #td_recalc, #td_insert_chart, #td_insert_image_url, #td_insert_image_file, #td_drawing_object_layer, \
#td_add_cell_comment, #td_add_document_comment, #td_add_hyperlink, #td_auto_filter, #td_auto_filter_local, \
#td_set_fixed_area, #td_clean_fixed_area").click(function(){
switch (this.id){
case "td_bold":{
if ($(this).hasClass("iconPressed")){
......@@ -862,6 +866,12 @@
showAddFilterDialog();
break;
}
case "td_set_fixed_area":{
break;
}
case "td_clean_fixed_area":{
break;
}
}
});
$(".selectable").bind("mouseover", function() {if ($(this).hasClass("noselectable")) return; $(this).addClass("iconHover"); });
......@@ -1568,7 +1578,7 @@
function showDrawingLayerDialog() {
BuildDrawingObjectLayerMenu();
$("#drawingObjectsLayerMenu").dialog({ autoOpen: false, closeOnEscape: false, height: 'auto', width: 400,
$("#drawingObjectsLayerMenu").dialog({ autoOpen: false, closeOnEscape: true, height: 'auto', width: 400,
resizable: false, modal: true, title: "Drawing layer", draggable: true,
open: function() {
},
......@@ -2047,6 +2057,7 @@
});
addFilterDialog.dialog("open");
}
// Charts
function showChartDialog() {
var chart = api.asc_getChartObject();
......@@ -2062,15 +2073,24 @@
chartForm.find("#titlesField").show();
chartForm.find("#legendField").show();
chartForm.find("#typeField").show();
function setTitleFont() { showChartFontDialog(chart.asc_getHeader().asc_getFont()) }
function setAxisXFont() { showChartFontDialog(chart.asc_getXAxis().asc_getTitleFont()) }
function setAxisYFont() { showChartFontDialog(chart.asc_getYAxis().asc_getTitleFont()) }
api.asc_setSelectDialogRangeMode(true);
chartForm.css("visibility", "visible");
chartForm.dialog({ autoOpen: false, closeOnEscape: false, height: 'auto', width: 400,
chartForm.dialog({ autoOpen: false, closeOnEscape: true, height: 'auto', width: 400,
resizable: false, modal: true, title: "Chart properties", draggable: true,
open: function() {
if (!bIsUpdateChartProperties)
return;
// chart font binding
chartForm.find("#chartTitleFont").bind("click", setTitleFont);
chartForm.find("#chartAxisXFont").bind("click", setAxisXFont);
chartForm.find("#chartAxisYFont").bind("click", setAxisYFont);
bIsUpdateChartProperties = false;
api.asc_enableKeyEvents(false);
......@@ -2120,9 +2140,7 @@
click: function() {
var chartForm = $("#chartSelector");
var chart = api.asc_getChartObject();
var isSelected = (chart.type != null) && (chart.type != "");
var range = chart.asc_getRange();
if ( !api.asc_checkChartInterval(chartForm.find("#chartType").val(),chartForm.find("#chartSubType").val(),chartForm.find("#chartRange").val(),chartForm.find("#dataRows").is(":checked")) )
......@@ -2194,12 +2212,67 @@
if (!bIsReopenDialog)
api.asc_setSelectDialogRangeMode(false);
api.asc_enableKeyEvents(true);
// chart font unbinding
chartForm.find("#chartTitleFont").unbind("click", setTitleFont);
chartForm.find("#chartAxisXFont").unbind("click", setAxisXFont);
chartForm.find("#chartAxisYFont").unbind("click", setAxisYFont);
},
create: function() {
}
});
chartForm.dialog("open");
}
function showChartFontDialog(fontObject) {
var chartFontForm = $("#chartFontSelector");
chartFontForm.css("visibility", "visible");
chartFontForm.dialog({ autoOpen: false, closeOnEscape: true, height: 'auto', width: 190,
resizable: false, modal: true, title: "Chart font", draggable: true,
open: function() {
chartFontForm.find("#fontName").val(fontObject.asc_getName());
chartFontForm.find("#fontSize").val(fontObject.asc_getSize());
chartFontForm.find("#fontColor").val(fontObject.asc_getColor());
chartFontForm.find("#fontBold").attr("checked", fontObject.asc_getBold() == 1);
chartFontForm.find("#fontItalic").attr("checked", fontObject.asc_getItalic() == 1);
chartFontForm.find("#fontUnderline").attr("checked", fontObject.asc_getUnderline() == 1);
},
buttons: [
{
text: "Ok",
click: function() {
fontObject.asc_setName( chartFontForm.find("#fontName").val() );
fontObject.asc_setSize( parseInt(chartFontForm.find("#fontSize").val()) );
fontObject.asc_setColor( chartFontForm.find("#fontColor").val() );
fontObject.asc_setBold(chartFontForm.find("#fontBold").is(":checked") ? 1 : 0);
fontObject.asc_setItalic(chartFontForm.find("#fontItalic").is(":checked") ? 1 : 0);
fontObject.asc_setUnderline(chartFontForm.find("#fontUnderline").is(":checked") ? 1: 0);
$(this).dialog("close");
}
},
{
text: "Cancel",
click: function() {
$(this).dialog("close");
}
}
],
close: function() {
if (!bIsReopenDialog)
api.asc_setSelectDialogRangeMode(false);
api.asc_enableKeyEvents(true);
},
create: function() {
}
});
chartFontForm.dialog("open");
}
// Images
function showImageUrlDialog() {
......
......@@ -303,6 +303,17 @@
height: 16px;
width: 16px;
}
.FixedArea
{
background: url(../img/Table_Merge.png) no-repeat scroll 0 0 transparent;
}
.FixedAreaClean
{
background: url(../img/Table_MergeDisable.png) no-repeat scroll 0 0 transparent;
}
.ToolbarIconAsc {
background: url(../img/toolbar-btns.png) no-repeat scroll 0 0 transparent;
width: 20px;
......@@ -969,4 +980,8 @@ input, textarea {outline:none;}
position: fixed;
cursor: pointer;
background-position: 0px 0px;
}
.menuChartFont {
cursor: pointer;
}
\ No newline at end of file
......@@ -1878,7 +1878,7 @@
}
//draw auto filters
this.autoFilters.drawAutoF(this);
this.objectRender.showDrawingObjects(true, null/*printOptions*/, true/*bUpdateCharts*/);
this.objectRender.showDrawingObjects(false, null/*printOptions*/, true/*bUpdateCharts*/);
this.cellCommentator.drawCommentCells(false);
return this;
......@@ -3486,6 +3486,8 @@
t.objectRender.clearUndoRedoDrawingObject();
t.overlayCtx.ctx.globalAlpha = 1;
if ( objectId )
t.objectRender.selectDrawingObject(t.objectRender.getSelectedDrawingObjectIndex());
},
......
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