Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
0c555c9c
Commit
0c555c9c
authored
Oct 04, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of github.com:Sankore/Sankore-3.1 into claudio-dev
parents
41d46485
ba1a392c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
65 deletions
+113
-65
Sankore_3.1.pro
Sankore_3.1.pro
+1
-1
app.js
.../library/interactivities/Separe phrase.wgt/scripts/app.js
+64
-57
UBGraphicsDelegateFrame.cpp
src/domain/UBGraphicsDelegateFrame.cpp
+38
-5
UBGraphicsDelegateFrame.h
src/domain/UBGraphicsDelegateFrame.h
+3
-0
UBGraphicsStrokesGroup.cpp
src/domain/UBGraphicsStrokesGroup.cpp
+7
-2
No files found.
Sankore_3.1.pro
View file @
0c555c9c
...
...
@@ -11,7 +11,7 @@ CONFIG += debug_and_release \
VERSION_MAJ
=
2
VERSION_MIN
=
00
VERSION_TYPE
=
b
#
a
=
alpha
,
b
=
beta
,
r
=
release
,
other
=>
error
VERSION_PATCH
=
0
8
VERSION_PATCH
=
0
9
VERSION
=
"$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}"
VERSION
=
$$
replace
(
VERSION
,
"\\.r"
,
""
)
...
...
resources/library/interactivities/Separe phrase.wgt/scripts/app.js
View file @
0c555c9c
...
...
@@ -18,6 +18,15 @@ function createElements( phrase )
return
s
;
}
function
createChain
(
phrase
)
{
var
arr
=
phrase
.
split
(
" "
);
var
result
=
""
;
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
result
+=
'<div class="letterCont">'
+
createElements
(
arr
[
i
])
+
'</div>'
;
return
result
;
}
$
(
document
).
ready
(
function
()
{
...
...
@@ -135,9 +144,8 @@ $(document).ready(function()
// store the text
w
.
setData
(
"phrase"
,
phrase
);
// remove all dots (they are to be set during the exercise)
phrase
=
phrase
.
replace
(
/ /g
,
''
);
//
phrase = phrase.replace( / /g, '' );
// create the html
if
(
window
.
sankore
&&
sankore
.
preference
(
"ordSplPhrasesState"
,
""
)
==
"1"
&&
flag
){
...
...
@@ -147,7 +155,7 @@ $(document).ready(function()
flag
=
false
;
}
else
w
.
setViewContent
(
create
Elements
(
phrase
)
);
w
.
setViewContent
(
create
Chain
(
phrase
)
);
// the behaviour
...
...
@@ -241,7 +249,7 @@ $(document).ready(function()
if
(
this
.
className
.
indexOf
(
"fixed"
)
!=
-
1
){
phrase
+=
' '
;
}
else
if
(
this
.
className
.
indexOf
(
"dash"
)
!=
-
1
){
else
if
(
(
this
.
className
.
indexOf
(
"dash"
)
!=
-
1
)
||
(
this
.
className
.
indexOf
(
"letterCont"
)
!=
-
1
)
){
return
;
}
else
{
...
...
@@ -249,7 +257,6 @@ $(document).ready(function()
phrase
+=
ch
;
}
});
//alert(phrase + " | " + this.getData( "phrase" ))
if
(
phrase
==
this
.
getData
(
"phrase"
)
){
this
.
elements
.
containerView
.
addClass
(
"answerRight"
);
}
...
...
@@ -267,58 +274,58 @@ $(document).ready(function()
//changing the style
function
changeStyle
(
val
){
switch
(
val
){
case
"1"
:
$
(
".b_top_left"
).
removeClass
(
"btl_pad"
).
removeClass
(
"without_back"
);
$
(
".b_top_center"
).
removeClass
(
"btc_pad"
).
removeClass
(
"without_back"
);
$
(
".b_top_right"
).
removeClass
(
"btr_pad"
).
removeClass
(
"without_back"
);
$
(
".b_center_left"
).
removeClass
(
"bcl_pad"
).
removeClass
(
"without_back"
);
$
(
".b_center_right"
).
removeClass
(
"bcr_pad"
).
removeClass
(
"without_back"
);
$
(
".b_bottom_right"
).
removeClass
(
"bbr_pad"
).
removeClass
(
"without_back"
);
$
(
".b_bottom_left"
).
removeClass
(
"bbl_pad"
).
removeClass
(
"without_back"
);
$
(
".b_bottom_center"
).
removeClass
(
"bbc_pad"
).
removeClass
(
"without_back"
);
$
(
"#wgt_reload"
).
removeClass
(
"pad_color"
).
removeClass
(
"pad_reload"
);
$
(
"#wgt_help"
).
removeClass
(
"pad_color"
).
removeClass
(
"pad_help"
);
$
(
"#wgt_edit"
).
removeClass
(
"pad_color"
).
removeClass
(
"pad_edit"
);
$
(
"#wgt_name"
).
removeClass
(
"pad_color"
);
$
(
"#wgt_display"
).
addClass
(
"display_wood"
);
$
(
"#style_select option:first"
).
attr
(
'selected'
,
true
);
$
(
"body, html"
).
removeClass
(
"without_radius"
).
addClass
(
"radius_ft"
);
break
;
case
"2"
:
$
(
".b_top_left"
).
addClass
(
"btl_pad"
).
removeClass
(
"without_back"
);
$
(
".b_top_center"
).
addClass
(
"btc_pad"
).
removeClass
(
"without_back"
);
$
(
".b_top_right"
).
addClass
(
"btr_pad"
).
removeClass
(
"without_back"
);
$
(
".b_center_left"
).
addClass
(
"bcl_pad"
).
removeClass
(
"without_back"
);
$
(
".b_center_right"
).
addClass
(
"bcr_pad"
).
removeClass
(
"without_back"
);
$
(
".b_bottom_right"
).
addClass
(
"bbr_pad"
).
removeClass
(
"without_back"
);
$
(
".b_bottom_left"
).
addClass
(
"bbl_pad"
).
removeClass
(
"without_back"
);
$
(
".b_bottom_center"
).
addClass
(
"bbc_pad"
).
removeClass
(
"without_back"
);
$
(
"#wgt_reload"
).
addClass
(
"pad_color"
).
addClass
(
"pad_reload"
);
$
(
"#wgt_help"
).
addClass
(
"pad_color"
).
addClass
(
"pad_help"
);
$
(
"#wgt_edit"
).
addClass
(
"pad_color"
).
addClass
(
"pad_edit"
);
$
(
"#wgt_name"
).
addClass
(
"pad_color"
);
$
(
"#wgt_display"
).
removeClass
(
"display_wood"
);
$
(
"#style_select option:first"
).
next
().
attr
(
'selected'
,
true
);
$
(
"body, html"
).
removeClass
(
"without_radius"
).
removeClass
(
"radius_ft"
);
break
;
case
"3"
:
$
(
".b_top_left"
).
addClass
(
"without_back"
).
removeClass
(
"btl_pad"
);
$
(
".b_top_center"
).
addClass
(
"without_back"
).
removeClass
(
"btc_pad"
);
$
(
".b_top_right"
).
addClass
(
"without_back"
).
removeClass
(
"btr_pad"
);
$
(
".b_center_left"
).
addClass
(
"without_back"
).
removeClass
(
"bcl_pad"
);
$
(
".b_center_right"
).
addClass
(
"without_back"
).
removeClass
(
"bcr_pad"
);
$
(
".b_bottom_right"
).
addClass
(
"without_back"
).
removeClass
(
"bbr_pad"
);
$
(
".b_bottom_left"
).
addClass
(
"without_back"
).
removeClass
(
"bbl_pad"
);
$
(
".b_bottom_center"
).
addClass
(
"without_back"
).
removeClass
(
"bbc_pad"
);
$
(
"#wgt_help"
).
addClass
(
"pad_color"
).
addClass
(
"pad_help"
);
$
(
"#wgt_reload"
).
addClass
(
"pad_color"
).
addClass
(
"pad_reload"
);
$
(
"#wgt_edit"
).
addClass
(
"pad_color"
).
addClass
(
"pad_edit"
);
$
(
"#wgt_name"
).
addClass
(
"pad_color"
);
$
(
"#wgt_display"
).
removeClass
(
"display_wood"
);
$
(
"#style_select option:last"
).
attr
(
'selected'
,
true
);
$
(
"body, html"
).
addClass
(
"without_radius"
).
removeClass
(
"radius_ft"
);
break
;
}
case
"1"
:
$
(
".b_top_left"
).
removeClass
(
"btl_pad"
).
removeClass
(
"without_back"
);
$
(
".b_top_center"
).
removeClass
(
"btc_pad"
).
removeClass
(
"without_back"
);
$
(
".b_top_right"
).
removeClass
(
"btr_pad"
).
removeClass
(
"without_back"
);
$
(
".b_center_left"
).
removeClass
(
"bcl_pad"
).
removeClass
(
"without_back"
);
$
(
".b_center_right"
).
removeClass
(
"bcr_pad"
).
removeClass
(
"without_back"
);
$
(
".b_bottom_right"
).
removeClass
(
"bbr_pad"
).
removeClass
(
"without_back"
);
$
(
".b_bottom_left"
).
removeClass
(
"bbl_pad"
).
removeClass
(
"without_back"
);
$
(
".b_bottom_center"
).
removeClass
(
"bbc_pad"
).
removeClass
(
"without_back"
);
$
(
"#wgt_reload"
).
removeClass
(
"pad_color"
).
removeClass
(
"pad_reload"
);
$
(
"#wgt_help"
).
removeClass
(
"pad_color"
).
removeClass
(
"pad_help"
);
$
(
"#wgt_edit"
).
removeClass
(
"pad_color"
).
removeClass
(
"pad_edit"
);
$
(
"#wgt_name"
).
removeClass
(
"pad_color"
);
$
(
"#wgt_display"
).
addClass
(
"display_wood"
);
$
(
"#style_select option:first"
).
attr
(
'selected'
,
true
);
$
(
"body, html"
).
removeClass
(
"without_radius"
).
addClass
(
"radius_ft"
);
break
;
case
"2"
:
$
(
".b_top_left"
).
addClass
(
"btl_pad"
).
removeClass
(
"without_back"
);
$
(
".b_top_center"
).
addClass
(
"btc_pad"
).
removeClass
(
"without_back"
);
$
(
".b_top_right"
).
addClass
(
"btr_pad"
).
removeClass
(
"without_back"
);
$
(
".b_center_left"
).
addClass
(
"bcl_pad"
).
removeClass
(
"without_back"
);
$
(
".b_center_right"
).
addClass
(
"bcr_pad"
).
removeClass
(
"without_back"
);
$
(
".b_bottom_right"
).
addClass
(
"bbr_pad"
).
removeClass
(
"without_back"
);
$
(
".b_bottom_left"
).
addClass
(
"bbl_pad"
).
removeClass
(
"without_back"
);
$
(
".b_bottom_center"
).
addClass
(
"bbc_pad"
).
removeClass
(
"without_back"
);
$
(
"#wgt_reload"
).
addClass
(
"pad_color"
).
addClass
(
"pad_reload"
);
$
(
"#wgt_help"
).
addClass
(
"pad_color"
).
addClass
(
"pad_help"
);
$
(
"#wgt_edit"
).
addClass
(
"pad_color"
).
addClass
(
"pad_edit"
);
$
(
"#wgt_name"
).
addClass
(
"pad_color"
);
$
(
"#wgt_display"
).
removeClass
(
"display_wood"
);
$
(
"#style_select option:first"
).
next
().
attr
(
'selected'
,
true
);
$
(
"body, html"
).
removeClass
(
"without_radius"
).
removeClass
(
"radius_ft"
);
break
;
case
"3"
:
$
(
".b_top_left"
).
addClass
(
"without_back"
).
removeClass
(
"btl_pad"
);
$
(
".b_top_center"
).
addClass
(
"without_back"
).
removeClass
(
"btc_pad"
);
$
(
".b_top_right"
).
addClass
(
"without_back"
).
removeClass
(
"btr_pad"
);
$
(
".b_center_left"
).
addClass
(
"without_back"
).
removeClass
(
"bcl_pad"
);
$
(
".b_center_right"
).
addClass
(
"without_back"
).
removeClass
(
"bcr_pad"
);
$
(
".b_bottom_right"
).
addClass
(
"without_back"
).
removeClass
(
"bbr_pad"
);
$
(
".b_bottom_left"
).
addClass
(
"without_back"
).
removeClass
(
"bbl_pad"
);
$
(
".b_bottom_center"
).
addClass
(
"without_back"
).
removeClass
(
"bbc_pad"
);
$
(
"#wgt_help"
).
addClass
(
"pad_color"
).
addClass
(
"pad_help"
);
$
(
"#wgt_reload"
).
addClass
(
"pad_color"
).
addClass
(
"pad_reload"
);
$
(
"#wgt_edit"
).
addClass
(
"pad_color"
).
addClass
(
"pad_edit"
);
$
(
"#wgt_name"
).
addClass
(
"pad_color"
);
$
(
"#wgt_display"
).
removeClass
(
"display_wood"
);
$
(
"#style_select option:last"
).
attr
(
'selected'
,
true
);
$
(
"body, html"
).
addClass
(
"without_radius"
).
removeClass
(
"radius_ft"
);
break
;
}
}
});
\ No newline at end of file
src/domain/UBGraphicsDelegateFrame.cpp
View file @
0c555c9c
...
...
@@ -49,6 +49,8 @@ UBGraphicsDelegateFrame::UBGraphicsDelegateFrame(UBGraphicsItemDelegate* pDelega
,
mTotalTranslateX
(
0
)
,
mTotalTranslateY
(
0
)
,
mOperationMode
(
Scaling
)
,
mFlippedX
(
false
)
,
mFlippedY
(
false
)
,
mMirrorX
(
false
)
,
mMirrorY
(
false
)
{
...
...
@@ -379,6 +381,12 @@ QSizeF UBGraphicsDelegateFrame::resizeDelegate(qreal moveX, qreal moveY)
return
incVector
;
}
void
UBGraphicsDelegateFrame
::
scaleByPos
(
qreal
scaleX
,
qreal
scaleY
)
{
}
void
UBGraphicsDelegateFrame
::
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
if
(
None
==
mCurrentTool
)
...
...
@@ -451,6 +459,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
scaleX
=
-
2
*
mFrameWidth
/
width
;
}
else
{
scaleX
=
-
1
;
mFlippedX
=
!
mFlippedX
;
}
}
mScaleX
=
scaleX
;
...
...
@@ -480,6 +489,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
scaleY
=
-
2
*
mFrameWidth
/
width
;
}
else
{
scaleY
=
-
1
;
mFlippedY
=
!
mFlippedY
;
}
}
mScaleY
=
scaleY
;
...
...
@@ -543,15 +553,38 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QPointF
ref
;
// we just detects coordinates of corner before and after scaling and then moves object at diff between them.
if
(
resizingBottomRight
()
&&
mMirrorX
)
if
(
resizingBottomRight
()
&&
(
mMirrorX
||
mMirrorY
)
)
{
mTranslateX
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
x
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
x
();
mTranslateY
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
y
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
y
();
if
(
mFlippedX
&&
!
mMirrorX
&&
mFlippedY
)
// && !mMirrorY)
{
mTranslateX
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
bottomLeft
()).
x
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
bottomLeft
()).
x
();
mTranslateY
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
bottomLeft
()).
y
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
bottomLeft
()).
y
();
}
else
if
((
mFlippedX
||
mMirrorX
)
&&
(
mFlippedY
||
mMirrorY
))
{
mTranslateX
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
x
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
x
();
mTranslateY
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
y
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
y
();
}
else
if
(
mFlippedX
||
mMirrorX
)
{
mTranslateX
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
topRight
()).
x
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
topRight
()).
x
();
mTranslateY
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
topRight
()).
y
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
topRight
()).
y
();
}
else
if
(
mFlippedY
||
mMirrorY
)
{
mTranslateX
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
bottomLeft
()).
x
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
bottomLeft
()).
x
();
mTranslateY
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
bottomLeft
()).
y
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
bottomLeft
()).
y
();
}
else
{
mTranslateX
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
x
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
x
();
mTranslateY
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
y
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
y
();
}
}
else
{
mTranslateX
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
topLeft
()).
x
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
topLeft
()).
x
();
mTranslateY
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
topLeft
()).
y
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
topLeft
()).
y
();
mTranslateX
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
topLeft
()).
x
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
topLeft
()).
x
();
mTranslateY
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
topLeft
()).
y
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
topLeft
()).
y
();
}
}
else
if
(
resizingTop
()
||
resizingLeft
())
...
...
src/domain/UBGraphicsDelegateFrame.h
View file @
0c555c9c
...
...
@@ -40,6 +40,7 @@ class UBGraphicsDelegateFrame: public QGraphicsRectItem, public QObject
QPointF
getFixedPointFromPos
();
QSizeF
getResizeVector
(
qreal
moveX
,
qreal
moveY
);
QSizeF
resizeDelegate
(
qreal
moveX
,
qreal
moveY
);
void
scaleByPos
(
qreal
scaleX
,
qreal
scaleY
);
virtual
void
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
...
...
@@ -124,6 +125,8 @@ class UBGraphicsDelegateFrame: public QGraphicsRectItem, public QObject
OperationMode
mOperationMode
;
QGraphicsItem
*
delegated
();
bool
mFlippedX
;
bool
mFlippedY
;
bool
mMirrorX
;
bool
mMirrorY
;
bool
mResizing
;
...
...
src/domain/UBGraphicsStrokesGroup.cpp
View file @
0c555c9c
...
...
@@ -124,8 +124,13 @@ UBItem* UBGraphicsStrokesGroup::deepCopy() const
UBGraphicsPolygonItem
*
polygon
=
dynamic_cast
<
UBGraphicsPolygonItem
*>
(
child
);
if
(
polygon
){
QGraphicsItem
*
pItem
=
dynamic_cast
<
QGraphicsItem
*>
(
polygon
->
deepCopy
());
copy
->
addToGroup
(
pItem
);
UBGraphicsPolygonItem
*
polygonCopy
=
dynamic_cast
<
UBGraphicsPolygonItem
*>
(
polygon
->
deepCopy
());
if
(
polygonCopy
)
{
QGraphicsItem
*
pItem
=
dynamic_cast
<
QGraphicsItem
*>
(
polygonCopy
);
copy
->
addToGroup
(
pItem
);
polygonCopy
->
setStrokesGroup
(
copy
);
}
}
}
...
...
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