Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
f25177f7
Commit
f25177f7
authored
Mar 28, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ filter/sort labels(buttons)
parent
c892fb74
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
49 deletions
+42
-49
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+42
-49
No files found.
cell/view/WorksheetView.js
View file @
f25177f7
...
...
@@ -12647,11 +12647,10 @@
};
WorksheetView
.
prototype
.
af_drawCurrentButton
=
function
(
x1
,
y1
,
props
)
{
//TODO пересмотреть масштабирование!!!
var
isApplyAutoFilter
=
props
.
isSetFilter
;
var
isApplySortState
=
props
.
isSortState
;
var
ws
=
this
;
var
aWs
=
this
.
model
;
var
t
=
this
;
var
width_1px
=
t
.
width_1px
;
...
...
@@ -12660,20 +12659,19 @@
var
width
=
15
*
height_1px
;
var
m_oColor
=
new
CColor
(
120
,
120
,
120
);
var
rowHeight
=
ws
.
rows
[
props
.
row
].
height
;
var
colWidth
=
ws
.
cols
[
props
.
col
].
width
;
var
rowHeight
=
t
.
rows
[
props
.
row
].
height
;
var
colWidth
=
t
.
cols
[
props
.
col
].
width
;
var
scaleIndex
=
1
;
var
scaleFactor
=
ws
.
drawingCtx
.
scaleFactor
;
var
scaleFactor
=
t
.
drawingCtx
.
scaleFactor
;
var
_drawButton
Border
=
function
(
startX
,
startY
,
width
,
height
)
var
_drawButton
Frame
=
function
(
startX
,
startY
,
width
,
height
)
{
ws
.
drawingCtx
.
setFillStyle
(
ws
.
settings
.
cells
.
defaultState
.
background
)
.
setLineWidth
(
1
)
.
setStrokeStyle
(
ws
.
settings
.
cells
.
defaultState
.
border
)
.
fillRect
(
startX
,
startY
,
width
,
height
)
.
strokeRect
(
startX
,
startY
,
width
,
height
);
t
.
drawingCtx
.
setFillStyle
(
t
.
settings
.
cells
.
defaultState
.
background
);
t
.
drawingCtx
.
setLineWidth
(
1
);
t
.
drawingCtx
.
setStrokeStyle
(
t
.
settings
.
cells
.
defaultState
.
border
);
t
.
drawingCtx
.
fillRect
(
startX
,
startY
,
width
,
height
);
t
.
drawingCtx
.
strokeRect
(
startX
,
startY
,
width
,
height
);
};
var
_drawSortArrow
=
function
(
startX
,
startY
,
isDescending
,
heightArrow
)
...
...
@@ -12682,7 +12680,7 @@
//isDescending = true - стрелочка смотрит вниз
//рисуем сверху вниз
var
ctx
=
ws
.
drawingCtx
;
var
ctx
=
t
.
drawingCtx
;
ctx
.
beginPath
();
ctx
.
lineVer
(
startX
,
startY
,
startY
+
heightArrow
);
...
...
@@ -12690,7 +12688,7 @@
if
(
isDescending
)
{
var
r
=
ws
.
drawingCtx
.
_calcRect
(
startX
,
startY
);
var
r
=
t
.
drawingCtx
.
_calcRect
(
startX
,
startY
);
var
x
=
Math
.
round
(
r
.
x
);
var
y
=
Math
.
round
(
r
.
y
);
...
...
@@ -12699,16 +12697,16 @@
var
diffY
=
0
;
for
(
var
i
=
0
;
i
<
height
;
i
++
)
{
ws
.
drawingCtx
.
ctx
.
moveTo
(
x
-
(
i
),
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
ws
.
drawingCtx
.
ctx
.
lineTo
(
x
-
(
i
)
+
1
,
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
t
.
drawingCtx
.
ctx
.
moveTo
(
x
-
(
i
),
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
t
.
drawingCtx
.
ctx
.
lineTo
(
x
-
(
i
)
+
1
,
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
ws
.
drawingCtx
.
ctx
.
moveTo
(
x
+
i
,
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
ws
.
drawingCtx
.
ctx
.
lineTo
(
x
+
i
+
1
,
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
t
.
drawingCtx
.
ctx
.
moveTo
(
x
+
i
,
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
t
.
drawingCtx
.
ctx
.
lineTo
(
x
+
i
+
1
,
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
}
}
else
{
var
r
=
ws
.
drawingCtx
.
_calcRect
(
startX
,
startY
);
var
r
=
t
.
drawingCtx
.
_calcRect
(
startX
,
startY
);
var
x
=
Math
.
round
(
r
.
x
);
var
y
=
Math
.
round
(
r
.
y
);
...
...
@@ -12716,15 +12714,14 @@
var
diffY
=
0
;
for
(
var
i
=
0
;
i
<
height
;
i
++
)
{
ws
.
drawingCtx
.
ctx
.
moveTo
(
x
-
(
i
),
y
+
0.5
+
(
i
)
-
diffY
);
ws
.
drawingCtx
.
ctx
.
lineTo
(
x
-
(
i
)
+
1
,
y
+
0.5
+
(
i
)
-
diffY
);
t
.
drawingCtx
.
ctx
.
moveTo
(
x
-
(
i
),
y
+
0.5
+
(
i
)
-
diffY
);
t
.
drawingCtx
.
ctx
.
lineTo
(
x
-
(
i
)
+
1
,
y
+
0.5
+
(
i
)
-
diffY
);
ws
.
drawingCtx
.
ctx
.
moveTo
(
x
+
i
,
y
+
0.5
+
(
i
)
-
diffY
);
ws
.
drawingCtx
.
ctx
.
lineTo
(
x
+
i
+
1
,
y
+
0.5
+
(
i
)
-
diffY
);
t
.
drawingCtx
.
ctx
.
moveTo
(
x
+
i
,
y
+
0.5
+
(
i
)
-
diffY
);
t
.
drawingCtx
.
ctx
.
lineTo
(
x
+
i
+
1
,
y
+
0.5
+
(
i
)
-
diffY
);
}
}
ctx
.
setLineWidth
(
t
.
width_1px
);
ctx
.
setStrokeStyle
(
m_oColor
);
ctx
.
stroke
();
...
...
@@ -12732,26 +12729,22 @@
var
_drawFilterMark
=
function
(
x
,
y
,
height
)
{
/*var size = 5.25 * scaleIndex;
var halfSize = Math.round((size / 2) / height_1px) * height_1px;
var meanLine = Math.round((size * Math.sqrt(3) / 3) / height_1px) * height_1px;//длина биссектрисы равностороннего треугольника*/
//округляем + смещаем
x
=
Math
.
round
((
x
)
/
width_1px
)
*
width_1px
;
y
=
Math
.
round
((
y
)
/
height_1px
)
*
height_1px
;
var
heightLine
=
Math
.
round
(
height
);
var
heightCleanLine
=
heightLine
-
4
+
1
;
var
heightCleanLine
=
heightLine
-
4
+
2
;
ws
.
drawingCtx
.
beginPath
();
t
.
drawingCtx
.
beginPath
();
ws
.
drawingCtx
.
moveTo
(
x
,
y
);
ws
.
drawingCtx
.
lineTo
(
x
,
y
-
heightCleanLine
);
ws
.
drawingCtx
.
setLineWidth
(
t
.
width_2px
);
ws
.
drawingCtx
.
setStrokeStyle
(
m_oColor
);
ws
.
drawingCtx
.
setStrokeStyle
(
m_oColor
);
ws
.
drawingCtx
.
stroke
();
t
.
drawingCtx
.
moveTo
(
x
,
y
);
t
.
drawingCtx
.
lineTo
(
x
,
y
-
heightCleanLine
);
t
.
drawingCtx
.
setLineWidth
(
t
.
width_2px
);
t
.
drawingCtx
.
setStrokeStyle
(
m_oColor
);
t
.
drawingCtx
.
setStrokeStyle
(
m_oColor
);
t
.
drawingCtx
.
stroke
();
var
r
=
ws
.
drawingCtx
.
_calcRect
(
x
,
y
-
heightLine
);
var
r
=
t
.
drawingCtx
.
_calcRect
(
x
,
y
-
heightLine
);
x
=
Math
.
round
(
r
.
x
)
+
1
;
y
=
Math
.
round
(
r
.
y
)
-
1
;
...
...
@@ -12759,40 +12752,40 @@
var
diffY
=
0
;
for
(
var
i
=
0
;
i
<
heightTriangle
;
i
++
)
{
ws
.
drawingCtx
.
ctx
.
moveTo
(
x
-
(
i
)
-
2
,
y
+
0.5
+
(
heightTriangle
-
i
)
-
diffY
);
ws
.
drawingCtx
.
ctx
.
lineTo
(
x
+
i
,
y
+
0.5
+
(
heightTriangle
-
i
)
-
diffY
);
t
.
drawingCtx
.
ctx
.
moveTo
(
x
-
(
i
)
-
2
,
y
+
0.5
+
(
heightTriangle
-
i
)
-
diffY
);
t
.
drawingCtx
.
ctx
.
lineTo
(
x
+
i
,
y
+
0.5
+
(
heightTriangle
-
i
)
-
diffY
);
}
ws
.
drawingCtx
.
setLineWidth
(
t
.
width_1px
)
ws
.
drawingCtx
.
setStrokeStyle
(
m_oColor
);
ws
.
drawingCtx
.
stroke
();
t
.
drawingCtx
.
setLineWidth
(
t
.
width_1px
)
t
.
drawingCtx
.
setStrokeStyle
(
m_oColor
);
t
.
drawingCtx
.
stroke
();
};
var
_drawFilterDreieck
=
function
(
x
,
y
,
height
)
{
var
r
=
ws
.
drawingCtx
.
_calcRect
(
x
,
y
);
var
r
=
t
.
drawingCtx
.
_calcRect
(
x
,
y
);
x
=
Math
.
round
(
r
.
x
)
+
1
;
y
=
Math
.
round
(
r
.
y
);
ws
.
drawingCtx
.
beginPath
();
t
.
drawingCtx
.
beginPath
();
height
=
Math
.
round
(
height
*
scaleIndex
*
scaleFactor
);
var
diffY
=
Math
.
round
(
height
/
2
);
for
(
var
i
=
0
;
i
<
height
;
i
++
)
{
ws
.
drawingCtx
.
ctx
.
moveTo
(
x
-
(
i
+
1
),
y
+
0.5
+
(
height
-
i
)
-
diffY
);
ws
.
drawingCtx
.
ctx
.
lineTo
(
x
+
i
,
y
+
0.5
+
(
height
-
i
)
-
diffY
);
t
.
drawingCtx
.
ctx
.
moveTo
(
x
-
(
i
+
1
),
y
+
0.5
+
(
height
-
i
)
-
diffY
);
t
.
drawingCtx
.
ctx
.
lineTo
(
x
+
i
,
y
+
0.5
+
(
height
-
i
)
-
diffY
);
}
ws
.
drawingCtx
.
setStrokeStyle
(
m_oColor
);
ws
.
drawingCtx
.
stroke
();
t
.
drawingCtx
.
setStrokeStyle
(
m_oColor
);
t
.
drawingCtx
.
stroke
();
};
//TODO пересмотреть отрисовку кнопок + отрисовку при масштабировании
var
_drawButton
=
function
(
upLeftXButton
,
upLeftYButton
)
{
//квадрат кнопки рисуем
_drawButton
Border
(
upLeftXButton
,
upLeftYButton
,
width
,
height
);
_drawButton
Frame
(
upLeftXButton
,
upLeftYButton
,
width
,
height
);
//координаты центра
var
centerX
=
upLeftXButton
+
(
width
/
2
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment