' http://www.blackbeltcoder.com/Articles/strings/implementing-word-wrap-in-email-messages
' txtL = SBText.WordWrap(txtL, wL/8)
txtL = tab+ "Always rrremember" +lf+lf
txtL = txtL+ " Formatted text to show in" +lf+ " opened Expander Control:" +lf
txtL = txtL+ " The voluminous expansion" +lf+ " of the subterrestric tuber" +lf
txtL = txtL+ " plants stands in indirect" +lf+ " proportional relationship" +lf
txtL = txtL+ " to the intellect of the" +lf+ " agronomist." +lf+lf
txtL = txtL+ " anon. 815 a.d. (free trans.)"
txtR = tab+tab+ "So what .." +lf+lf
txtR = txtR+ " Who works hard," +lf+tab+ "makes a lot of mistakes." +lf
txtR = txtR+ " Those who work little," +lf+tab+ "makes few mistakes." +lf
txtR = txtR+ " Who does not work," +lf+tab+ "does not make mistakes." +lf
txtR = txtR+ " Who does not make mistakes," +lf+tab+ "is conveyed!!" +lf+lf
txtR = txtR+tab+ "General proverb (auto trans.)"
' continue = "True"
While "True" ' continue
If clicked Then
clicked = ""
If isOpen Then
Controls.SetSize(shpRight, wR,hHead)
'Shapes.SetText(shpSign, "+")
isOpen = ""
Else
Controls.SetSize(shpRight, wR,hFull)
'Shapes.SetText(shpSign, "–")
isOpen = "True"
EndIf
sign = -sign
Shapes.SetText(shpSign, swapSign[sign])
RotateCaret()
EndIf
Program.Delay(10)
EndWhile
' ////////// EVENTs \\\\\\\\\\
Sub OnMouseDown ' & checks MousePosition
mx = GraphicsWindow.MouseX
my = GraphicsWindow.MouseY
If (mx > xL) And (mx < xL+wL) And (my > y) And (my < y+hHead) Then
clicked = "True" ' shpLeft
EndIf
If (mx > xR) And (mx < xR+wR) And (my > y) And (my < y+hHead) Then
clicked = "True" ' shpRight
EndIf
EndSub
Sub OnKeyDown
lastKey = GraphicsWindow.LastKey
If lastKey = "Escape" Then
Program.End()
ElseIf lastKey = "Return" Then
OnMouseDown() ' checks MousePosition
EndIf
EndSub
' ////////// SUBs \\\\\\\\\\
Sub BuildGUI
GraphicsWindow.Title = "Open|Close Expander by MouseClick or {Return} key with cursor over title and ............."
GraphicsWindow.BackgroundColor = "Peru"
GraphicsWindow.BrushColor = "Black" ' FontColor in Expander
'' Expander field right (immediately)
shpRight = Shapes.AddText(txtR)
Shapes.Move(shpRight, xR,y)
LDShapes.BrushColour(shpRight, "NavajoWhite")