2 ** Project : Form Designer
3 ** File Purpose : QHyperLink Control
5 ** Author : Mahmoud Fayed <msfclipper@yahoo.com>
10 class FormDesigner_QHyperLink from QLabel
12 CreateCommonAttributes()
13 CreateMoveResizeCornersAttributes()
15 cLink = "http://www.ring-lang.net"
16 cText = "Ring Language Website"
21 func SetLinkValue cValue
27 func SetTextValue cValue
29 cOutput = '<a href="#{f1}">#{f2}</a>'
30 cOutput = substr(cOutput,"#{f1}",LinkValue())
31 cOutput = substr(cOutput,"#{f2}",TextValue())
34 func AddObjectProperties oDesigner
35 AddObjectCommonProperties(oDesigner)
36 oDesigner.oView.AddProperty(T_FORMDESIGNER_ATTRIBUTE_LINK,False) # "Link"
37 oDesigner.oView.AddProperty(T_FORMDESIGNER_ATTRIBUTE_TEXT,False) # "Text"
39 func DisplayProperties oDesigner
40 DisplayCommonProperties(oDesigner)
41 oPropertiesTable = oDesigner.oView.oPropertiesTable
42 oPropertiesTable.Blocksignals(True)
44 oPropertiesTable.item(C_AFTERCOMMON,1).settext(LinkValue())
46 oPropertiesTable.item(C_AFTERCOMMON+1,1).settext(TextValue())
47 oPropertiesTable.Blocksignals(False)
50 func UpdateProperties oDesigner,nRow,nCol,cValue
51 UpdateCommonProperties(oDesigner,nRow,nCol,cValue)
55 case C_AFTERCOMMON + 1
59 func ObjectDataAsString oDesigner,nTabsCount
60 cOutput = ObjectDataAsString2(oDesigner,nTabsCount)
61 cTabs = std_copy(char(9),nTabsCount)
62 cOutput += "," + nl + cTabs + ' :Link = "' + oDesigner.PrepareStringForFormFile(LinkValue()) + '"'
63 cOutput += "," + nl + cTabs + ' :Text = "' + oDesigner.PrepareStringForFormFile(TextValue()) + '"'
66 func GenerateCustomCode oDesigner
67 cOutput = `setText('<a href="#{f1}">#{f2}</a>')` + nl
68 cOutput = substr(cOutput,"#{f1}",oDesigner.PrepareStringForFormFile(LinkValue()))
69 cOutput = substr(cOutput,"#{f2}",TextValue())
72 func RestoreProperties oDesigner,Item
73 RestoreCommonProperties(oDesigner,item)
74 itemdata = item[:data]
75 setLinkValue(itemdata[:Link])
76 setTextValue(itemdata[:Text])