sync SVN r18224
This commit is contained in:
@@ -674,6 +674,172 @@ DEFINE CLASS sfsplitterh AS sfsplitter OF "sfsplitter.vcx"
|
||||
|
||||
ENDDEFINE
|
||||
|
||||
DEFINE CLASS sfsplitterh_panou AS sfsplitterh OF "sfsplitter.vcx"
|
||||
*< CLASSDATA: Baseclass="control" Timestamp="" Scale="Pixels" Uniqueid="" />
|
||||
|
||||
*<DefinedPropArrayMethod>
|
||||
*m: aliniazaobject1 && Lipeste Object 1 de splitter dupa Resize-ul lui Object 1
|
||||
*m: legaobject1 && Leaga Resize-ul lui Object 1 de aliniazaobject1 (repetarea nu dubleaza legatura)
|
||||
*m: mouseenter && Coloreaza splitterul la mouse over
|
||||
*m: mouseleave && Readuce culoarea de dinainte de mouse over
|
||||
*m: restoreposition && Restores the splitter position saved in the ini file (once)
|
||||
*m: saveposition && Saves the splitter position in the ini file if it was changed
|
||||
*p: cinicheie && Ini key for the saved position (empty = no persistence)
|
||||
*p: cinisectiune && Ini section for the saved position (empty = no persistence)
|
||||
*p: lhover && .T. cat timp splitterul e colorat la mouse over
|
||||
*p: lrestaurat && .T. after RestorePosition() ran
|
||||
*p: nbackcolorvechi && BackColor de dinainte de mouse over
|
||||
*p: nbackstylevechi && BackStyle de dinainte de mouse over
|
||||
*</DefinedPropArrayMethod>
|
||||
|
||||
*<PropValue>
|
||||
BackColor = 200,215,230
|
||||
BackStyle = 1
|
||||
cinicheie =
|
||||
cinisectiune =
|
||||
lhover = .F.
|
||||
lrestaurat = .F.
|
||||
Name = "sfsplitterh_panou"
|
||||
nbackcolorvechi = 0
|
||||
nbackstylevechi = 0
|
||||
gripper.Gripperdot1.Name = "Gripperdot1"
|
||||
gripper.Gripperdot1.ShapeDark.Name = "ShapeDark"
|
||||
gripper.Gripperdot1.ShapeLight.Name = "ShapeLight"
|
||||
gripper.Gripperdot1.ShapeMiddle.Name = "ShapeMiddle"
|
||||
gripper.Gripperdot2.Name = "Gripperdot2"
|
||||
gripper.Gripperdot2.ShapeDark.Name = "ShapeDark"
|
||||
gripper.Gripperdot2.ShapeLight.Name = "ShapeLight"
|
||||
gripper.Gripperdot2.ShapeMiddle.Name = "ShapeMiddle"
|
||||
gripper.Gripperdot3.Name = "Gripperdot3"
|
||||
gripper.Gripperdot3.ShapeDark.Name = "ShapeDark"
|
||||
gripper.Gripperdot3.ShapeLight.Name = "ShapeLight"
|
||||
gripper.Gripperdot3.ShapeMiddle.Name = "ShapeMiddle"
|
||||
gripper.Gripperdot4.Name = "Gripperdot4"
|
||||
gripper.Gripperdot4.ShapeDark.Name = "ShapeDark"
|
||||
gripper.Gripperdot4.ShapeLight.Name = "ShapeLight"
|
||||
gripper.Gripperdot4.ShapeMiddle.Name = "ShapeMiddle"
|
||||
gripper.Gripperdot5.Name = "Gripperdot5"
|
||||
gripper.Gripperdot5.ShapeDark.Name = "ShapeDark"
|
||||
gripper.Gripperdot5.ShapeLight.Name = "ShapeLight"
|
||||
gripper.Gripperdot5.ShapeMiddle.Name = "ShapeMiddle"
|
||||
gripper.Name = "gripper"
|
||||
*</PropValue>
|
||||
|
||||
PROCEDURE aliniazaobject1 && Lipeste Object 1 de splitter dupa Resize-ul lui Object 1
|
||||
Local lcObj1, loObj1
|
||||
lcObj1 = This.cObject1Name
|
||||
loObj1 = This.Parent.&lcObj1
|
||||
If m.loObj1.Left + m.loObj1.Width # This.Left
|
||||
m.loObj1.Width = Max(This.Left - m.loObj1.Left, 1)
|
||||
Endif
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE Init
|
||||
DoDefault()
|
||||
This.LegaObject1()
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE legaobject1 && Leaga Resize-ul lui Object 1 de aliniazaobject1 (repetarea nu dubleaza legatura)
|
||||
Local lcObj1, loObj1
|
||||
lcObj1 = This.cObject1Name
|
||||
If Pemstatus(This.Parent, m.lcObj1, 5)
|
||||
loObj1 = This.Parent.&lcObj1
|
||||
BindEvent(m.loObj1, 'Resize', This, 'aliniazaobject1', 1)
|
||||
Endif
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE MouseEnter && Coloreaza splitterul la mouse over
|
||||
LPARAMETERS nButton, nShift, nXCoord, nYCoord
|
||||
DoDefault(m.nButton, m.nShift, m.nXCoord, m.nYCoord)
|
||||
If !This.lHover
|
||||
This.nBackColorVechi = This.BackColor
|
||||
This.nBackStyleVechi = This.BackStyle
|
||||
This.lHover = .T.
|
||||
This.BackStyle = 1
|
||||
This.BackColor = RGB(0,120,215)
|
||||
Endif
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE MouseLeave && Readuce culoarea de dinainte de mouse over
|
||||
LPARAMETERS nButton, nShift, nXCoord, nYCoord
|
||||
Local loObj
|
||||
DoDefault(m.nButton, m.nShift, m.nXCoord, m.nYCoord)
|
||||
* mouse-ul a intrat pe gripper (copil al splitterului): ramane colorat
|
||||
loObj = Sys(1270)
|
||||
Try
|
||||
Do While Vartype(m.loObj) = 'O'
|
||||
If Compobj(m.loObj.Parent, This)
|
||||
Return
|
||||
Endif
|
||||
loObj = m.loObj.Parent
|
||||
Enddo
|
||||
Catch
|
||||
Endtry
|
||||
If This.lHover
|
||||
This.lHover = .F.
|
||||
This.BackColor = This.nBackColorVechi
|
||||
This.BackStyle = This.nBackStyleVechi
|
||||
Endif
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE movesplittertoposition
|
||||
LPARAMETERS tnPosition
|
||||
Local lnDelta, lnPrag, lnAnchor, loCtl, loObj1, loObj2, lcObj1, lcObj2
|
||||
lcObj1 = This.cObject1Name
|
||||
lcObj2 = This.cObject2Name
|
||||
loObj1 = This.Parent.&lcObj1
|
||||
loObj2 = This.Parent.&lcObj2
|
||||
tnPosition = Max(m.tnPosition, m.loObj1.Left + This.nObject1MinSize)
|
||||
tnPosition = Min(m.tnPosition, This.Left + m.loObj2.Width - This.nObject2MinSize)
|
||||
lnDelta = m.tnPosition - This.Left
|
||||
If m.lnDelta = 0
|
||||
m.loObj1.Width = m.tnPosition - m.loObj1.Left
|
||||
Return
|
||||
Endif
|
||||
lnPrag = This.Left + This.Width
|
||||
For Each loCtl In This.Parent.Objects
|
||||
If Pemstatus(m.loCtl, 'Anchor', 5) And m.loCtl.Left >= m.lnPrag
|
||||
lnAnchor = m.loCtl.Anchor
|
||||
m.loCtl.Anchor = 0
|
||||
If m.loCtl.Name == m.loObj2.Name
|
||||
m.loCtl.Move(m.loCtl.Left + m.lnDelta, m.loCtl.Top, m.loCtl.Width - m.lnDelta, m.loCtl.Height)
|
||||
Else
|
||||
m.loCtl.Left = m.loCtl.Left + m.lnDelta
|
||||
Endif
|
||||
m.loCtl.Anchor = m.lnAnchor
|
||||
Endif
|
||||
Endfor
|
||||
* splitterul si Object 1 se muta direct, fara a atinge Anchor (altfel tragerea pierde mouse-ul); Object 1 se dimensioneaza din pozitie
|
||||
This.Left = m.tnPosition
|
||||
m.loObj1.Width = m.tnPosition - m.loObj1.Left
|
||||
This.SplitterMoved()
|
||||
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE restoreposition && Restores the splitter position saved in the ini file (once)
|
||||
Local lnPoz
|
||||
This.LegaObject1()
|
||||
If This.lRestaurat Or Empty(This.cIniSectiune) Or Empty(This.cIniCheie)
|
||||
Return
|
||||
Endif
|
||||
This.lRestaurat = .T.
|
||||
lnPoz = Val(Nvl(getini(m.gcGeneralIniFile, This.cIniSectiune, This.cIniCheie), ''))
|
||||
If m.lnPoz > 0
|
||||
This.MoveSplitterToPosition(m.lnPoz)
|
||||
Endif
|
||||
This.Tag = Transform(This.Left)
|
||||
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE saveposition && Saves the splitter position in the ini file if it was changed
|
||||
If This.lRestaurat And Transform(This.Left) != This.Tag
|
||||
setini(m.gcGeneralIniFile, This.cIniSectiune, This.cIniCheie, Transform(This.Left))
|
||||
Endif
|
||||
|
||||
ENDPROC
|
||||
|
||||
ENDDEFINE
|
||||
|
||||
DEFINE CLASS sfsplitterv AS sfsplitter OF "sfsplitter.vcx"
|
||||
*< CLASSDATA: Baseclass="control" Timestamp="" Scale="Pixels" Uniqueid="" />
|
||||
|
||||
@@ -706,26 +872,26 @@ DEFINE CLASS sfsplitterv AS sfsplitter OF "sfsplitter.vcx"
|
||||
gripper.Name = "gripper"
|
||||
*</PropValue>
|
||||
|
||||
PROCEDURE getobject1size && Gets the size for Object 1
|
||||
PROCEDURE getobject1size
|
||||
lparameters toObject
|
||||
return toObject.Top + This.nObject1MinSize
|
||||
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE getobject2size && Gets the size for Object 2
|
||||
PROCEDURE getobject2size
|
||||
lparameters toObject
|
||||
return toObject.Top + toObject.Height - This.nObject2MinSize - This.Height
|
||||
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE getposition && Returns the new position: X for a horizontal splitter and Y for a vertical splitter
|
||||
PROCEDURE getposition
|
||||
lparameters tnXCoord, ;
|
||||
tnYCoord
|
||||
return tnYCoord + This.Top - Objtoclient(this,1)
|
||||
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE moveobject1 && Moves Object 1 to the new position
|
||||
PROCEDURE moveobject1
|
||||
lparameters toObject
|
||||
with toObject
|
||||
.Move(.Left, .Top, .Width, This.Top - .Top)
|
||||
@@ -733,7 +899,7 @@ DEFINE CLASS sfsplitterv AS sfsplitter OF "sfsplitter.vcx"
|
||||
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE moveobject2 && Moves Object 2 to the new position
|
||||
PROCEDURE moveobject2
|
||||
lparameters toObject
|
||||
with toObject
|
||||
.Move(.Left, This.Top + This.Height, .Width, max(.Height + .Top - This.Top - ;
|
||||
@@ -742,10 +908,176 @@ DEFINE CLASS sfsplitterv AS sfsplitter OF "sfsplitter.vcx"
|
||||
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE setposition && Sets the new position for the splitter
|
||||
PROCEDURE setposition
|
||||
lparameters tnPosition
|
||||
This.Top = tnPosition
|
||||
|
||||
ENDPROC
|
||||
|
||||
ENDDEFINE
|
||||
|
||||
DEFINE CLASS sfsplitterv_panou AS sfsplitterv OF "sfsplitter.vcx"
|
||||
*< CLASSDATA: Baseclass="control" Timestamp="" Scale="Pixels" Uniqueid="" />
|
||||
|
||||
*<DefinedPropArrayMethod>
|
||||
*m: aliniazaobject1 && Lipeste Object 1 de splitter dupa Resize-ul lui Object 1
|
||||
*m: legaobject1 && Leaga Resize-ul lui Object 1 de aliniazaobject1 (repetarea nu dubleaza legatura)
|
||||
*m: mouseenter && Coloreaza splitterul la mouse over
|
||||
*m: mouseleave && Readuce culoarea de dinainte de mouse over
|
||||
*m: restoreposition && Restores the splitter position saved in the ini file (once)
|
||||
*m: saveposition && Saves the splitter position in the ini file if it was changed
|
||||
*p: cinicheie && Ini key for the saved position (empty = no persistence)
|
||||
*p: cinisectiune && Ini section for the saved position (empty = no persistence)
|
||||
*p: lhover && .T. cat timp splitterul e colorat la mouse over
|
||||
*p: lrestaurat && .T. after RestorePosition() ran
|
||||
*p: nbackcolorvechi && BackColor de dinainte de mouse over
|
||||
*p: nbackstylevechi && BackStyle de dinainte de mouse over
|
||||
*</DefinedPropArrayMethod>
|
||||
|
||||
*<PropValue>
|
||||
BackColor = 200,215,230
|
||||
BackStyle = 1
|
||||
cinicheie =
|
||||
cinisectiune =
|
||||
lhover = .F.
|
||||
lrestaurat = .F.
|
||||
Name = "sfsplitterv_panou"
|
||||
nbackcolorvechi = 0
|
||||
nbackstylevechi = 0
|
||||
gripper.Gripperdot1.Name = "Gripperdot1"
|
||||
gripper.Gripperdot1.ShapeDark.Name = "ShapeDark"
|
||||
gripper.Gripperdot1.ShapeLight.Name = "ShapeLight"
|
||||
gripper.Gripperdot1.ShapeMiddle.Name = "ShapeMiddle"
|
||||
gripper.Gripperdot2.Name = "Gripperdot2"
|
||||
gripper.Gripperdot2.ShapeDark.Name = "ShapeDark"
|
||||
gripper.Gripperdot2.ShapeLight.Name = "ShapeLight"
|
||||
gripper.Gripperdot2.ShapeMiddle.Name = "ShapeMiddle"
|
||||
gripper.Gripperdot3.Name = "Gripperdot3"
|
||||
gripper.Gripperdot3.ShapeDark.Name = "ShapeDark"
|
||||
gripper.Gripperdot3.ShapeLight.Name = "ShapeLight"
|
||||
gripper.Gripperdot3.ShapeMiddle.Name = "ShapeMiddle"
|
||||
gripper.Gripperdot4.Name = "Gripperdot4"
|
||||
gripper.Gripperdot4.ShapeDark.Name = "ShapeDark"
|
||||
gripper.Gripperdot4.ShapeLight.Name = "ShapeLight"
|
||||
gripper.Gripperdot4.ShapeMiddle.Name = "ShapeMiddle"
|
||||
gripper.Gripperdot5.Name = "Gripperdot5"
|
||||
gripper.Gripperdot5.ShapeDark.Name = "ShapeDark"
|
||||
gripper.Gripperdot5.ShapeLight.Name = "ShapeLight"
|
||||
gripper.Gripperdot5.ShapeMiddle.Name = "ShapeMiddle"
|
||||
gripper.Name = "gripper"
|
||||
*</PropValue>
|
||||
|
||||
PROCEDURE aliniazaobject1 && Lipeste Object 1 de splitter dupa Resize-ul lui Object 1
|
||||
Local lcObj1, loObj1
|
||||
lcObj1 = This.cObject1Name
|
||||
loObj1 = This.Parent.&lcObj1
|
||||
If m.loObj1.Top + m.loObj1.Height # This.Top
|
||||
m.loObj1.Height = Max(This.Top - m.loObj1.Top, 1)
|
||||
Endif
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE Init
|
||||
DoDefault()
|
||||
This.LegaObject1()
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE legaobject1 && Leaga Resize-ul lui Object 1 de aliniazaobject1 (repetarea nu dubleaza legatura)
|
||||
Local lcObj1, loObj1
|
||||
lcObj1 = This.cObject1Name
|
||||
If Pemstatus(This.Parent, m.lcObj1, 5)
|
||||
loObj1 = This.Parent.&lcObj1
|
||||
BindEvent(m.loObj1, 'Resize', This, 'aliniazaobject1', 1)
|
||||
Endif
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE MouseEnter && Coloreaza splitterul la mouse over
|
||||
LPARAMETERS nButton, nShift, nXCoord, nYCoord
|
||||
DoDefault(m.nButton, m.nShift, m.nXCoord, m.nYCoord)
|
||||
If !This.lHover
|
||||
This.nBackColorVechi = This.BackColor
|
||||
This.nBackStyleVechi = This.BackStyle
|
||||
This.lHover = .T.
|
||||
This.BackStyle = 1
|
||||
This.BackColor = RGB(0,120,215)
|
||||
Endif
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE MouseLeave && Readuce culoarea de dinainte de mouse over
|
||||
LPARAMETERS nButton, nShift, nXCoord, nYCoord
|
||||
Local loObj
|
||||
DoDefault(m.nButton, m.nShift, m.nXCoord, m.nYCoord)
|
||||
* mouse-ul a intrat pe gripper (copil al splitterului): ramane colorat
|
||||
loObj = Sys(1270)
|
||||
Try
|
||||
Do While Vartype(m.loObj) = 'O'
|
||||
If Compobj(m.loObj.Parent, This)
|
||||
Return
|
||||
Endif
|
||||
loObj = m.loObj.Parent
|
||||
Enddo
|
||||
Catch
|
||||
Endtry
|
||||
If This.lHover
|
||||
This.lHover = .F.
|
||||
This.BackColor = This.nBackColorVechi
|
||||
This.BackStyle = This.nBackStyleVechi
|
||||
Endif
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE movesplittertoposition
|
||||
LPARAMETERS tnPosition
|
||||
Local lnDelta, lnPrag, lnAnchor, loCtl, loObj1, loObj2, lcObj1, lcObj2
|
||||
lcObj1 = This.cObject1Name
|
||||
lcObj2 = This.cObject2Name
|
||||
loObj1 = This.Parent.&lcObj1
|
||||
loObj2 = This.Parent.&lcObj2
|
||||
tnPosition = Max(m.tnPosition, m.loObj1.Top + This.nObject1MinSize)
|
||||
tnPosition = Min(m.tnPosition, This.Top + m.loObj2.Height - This.nObject2MinSize)
|
||||
lnDelta = m.tnPosition - This.Top
|
||||
If m.lnDelta = 0
|
||||
m.loObj1.Height = m.tnPosition - m.loObj1.Top
|
||||
Return
|
||||
Endif
|
||||
lnPrag = This.Top + This.Height
|
||||
For Each loCtl In This.Parent.Objects
|
||||
If Pemstatus(m.loCtl, 'Anchor', 5) And m.loCtl.Top >= m.lnPrag
|
||||
lnAnchor = m.loCtl.Anchor
|
||||
m.loCtl.Anchor = 0
|
||||
If m.loCtl.Name == m.loObj2.Name
|
||||
m.loCtl.Move(m.loCtl.Left, m.loCtl.Top + m.lnDelta, m.loCtl.Width, m.loCtl.Height - m.lnDelta)
|
||||
Else
|
||||
m.loCtl.Top = m.loCtl.Top + m.lnDelta
|
||||
Endif
|
||||
m.loCtl.Anchor = m.lnAnchor
|
||||
Endif
|
||||
Endfor
|
||||
* splitterul si Object 1 se muta direct, fara a atinge Anchor (altfel tragerea pierde mouse-ul); Object 1 se dimensioneaza din pozitie
|
||||
This.Top = m.tnPosition
|
||||
m.loObj1.Height = m.tnPosition - m.loObj1.Top
|
||||
This.SplitterMoved()
|
||||
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE restoreposition && Restores the splitter position saved in the ini file (once)
|
||||
Local lnPoz
|
||||
This.LegaObject1()
|
||||
If This.lRestaurat Or Empty(This.cIniSectiune) Or Empty(This.cIniCheie)
|
||||
Return
|
||||
Endif
|
||||
This.lRestaurat = .T.
|
||||
lnPoz = Val(Nvl(getini(m.gcGeneralIniFile, This.cIniSectiune, This.cIniCheie), ''))
|
||||
If m.lnPoz > 0
|
||||
This.MoveSplitterToPosition(m.lnPoz)
|
||||
Endif
|
||||
This.Tag = Transform(This.Top)
|
||||
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE saveposition && Saves the splitter position in the ini file if it was changed
|
||||
If This.lRestaurat And Transform(This.Top) != This.Tag
|
||||
setini(m.gcGeneralIniFile, This.cIniSectiune, This.cIniCheie, Transform(This.Top))
|
||||
Endif
|
||||
|
||||
ENDPROC
|
||||
|
||||
ENDDEFINE
|
||||
|
||||
Reference in New Issue
Block a user