2 ** Project : Form Designer
3 ** File Purpose : QWebView Control
5 ** Author : Mahmoud Fayed <msfclipper@yahoo.com>
10 class FormDesigner_QWebView from QLineEdit
12 CreateCommonAttributes()
13 CreateMoveResizeCornersAttributes()
17 cloadProgressEvent = ""
18 cloadStartedEvent = ""
19 cselectionChangedEvent = ""
25 func SetURLvalue value
28 func SetloadProgressEventCode cValue
29 cloadProgressEvent = cValue
31 func loadProgressEventCode
32 return cloadProgressEvent
34 func SetloadStartedEventCode cValue
35 cloadStartedEvent = cValue
37 func loadStartedEventCode
38 return cloadStartedEvent
40 func SetselectionChangedEventCode cValue
41 cselectionChangedEvent = cValue
43 func selectionChangedEventCode
44 return cselectionChangedEvent
46 func SeturlChangedEventCode cValue
47 curlChangedEvent = cValue
49 func urlChangedEventCode
50 return curlChangedEvent
52 func AddObjectProperties oDesigner
53 AddObjectCommonProperties(oDesigner)
54 oDesigner.oView.AddProperty(T_FORMDESIGNER_ATTRIBUTE_URL,False) # "URL"
55 oDesigner.oView.AddProperty(T_FORMDESIGNER_ATTRIBUTE_LOADPROGRESSEVENT,False) # "loadProgressEvent "
56 oDesigner.oView.AddProperty(T_FORMDESIGNER_ATTRIBUTE_LOADSTARTEDEVENT,False) # "loadStartedEvent "
57 oDesigner.oView.AddProperty(T_FORMDESIGNER_ATTRIBUTE_SELECTIONCHANGEDEVENT,False) # "selectionChangedEvent "
58 oDesigner.oView.AddProperty(T_FORMDESIGNER_ATTRIBUTE_URLCHANGEDEVENT,False) # "urlChangedEvent "
60 func DisplayProperties oDesigner
61 DisplayCommonProperties(oDesigner)
62 oPropertiesTable = oDesigner.oView.oPropertiesTable
63 oPropertiesTable.Blocksignals(True)
65 oPropertiesTable.item(C_AFTERCOMMON,1).settext(URLValue())
66 oPropertiesTable.item(C_AFTERCOMMON+1,1).settext(loadProgressEventcode())
67 oPropertiesTable.item(C_AFTERCOMMON+2,1).settext(loadStartedEventcode())
68 oPropertiesTable.item(C_AFTERCOMMON+3,1).settext(selectionChangedEventcode())
69 oPropertiesTable.item(C_AFTERCOMMON+4,1).settext(urlChangedEventcode())
70 oPropertiesTable.Blocksignals(False)
72 setText(oDesigner.oModel.GetObjectName(self))
74 func UpdateProperties oDesigner,nRow,nCol,cValue
75 UpdateCommonProperties(oDesigner,nRow,nCol,cValue)
81 setloadProgressEventCode(cValue)
83 setloadStartedEventCode(cValue)
85 setselectionChangedEventCode(cValue)
87 seturlChangedEventCode(cValue)
91 setText(oDesigner.oModel.GetObjectName(self))
93 func ObjectDataAsString oDesigner,nTabsCount
94 cOutput = ObjectDataAsString2(oDesigner,nTabsCount)
95 cTabs = std_copy(char(9),nTabsCount)
96 cOutput += "," + nl + cTabs + ' :URL = "' + oDesigner.PrepareStringForFormFile(URLValue()) + '"'
97 cOutput += "," + nl + cTabs + ' :setloadProgressEvent = "' + oDesigner.PrepareStringForFormFile(loadProgressEventCode()) + '"'
98 cOutput += "," + nl + cTabs + ' :setloadStartedEvent = "' + oDesigner.PrepareStringForFormFile(loadStartedEventCode()) + '"'
99 cOutput += "," + nl + cTabs + ' :setselectionChangedEvent = "' + oDesigner.PrepareStringForFormFile(selectionChangedEventCode()) + '"'
100 cOutput += "," + nl + cTabs + ' :seturlChangedEvent = "' + oDesigner.PrepareStringForFormFile(urlChangedEventCode()) + '"'
103 func GenerateCustomCode oDesigner
105 cOutput += 'loadpage(new qURL("#{f1}"))' + nl
106 cOutput = substr(cOutput,"#{f1}",oDesigner.PrepareStringForFormFile(URLValue()))
107 cOutput += 'setloadProgressEvent ("#{f1}")' + nl
108 cOutput = PrepareEvent(cOutput,loadProgressEventCode(),"#{f1}")
109 cOutput = substr(cOutput,"#{f1}",loadProgressEventCode())
110 cOutput += 'setloadStartedEvent ("#{f1}")' + nl
111 cOutput = PrepareEvent(cOutput,loadStartedEventCode(),"#{f1}")
112 cOutput = substr(cOutput,"#{f1}",loadStartedEventCode())
113 cOutput += 'setselectionChangedEvent ("#{f1}")' + nl
114 cOutput = PrepareEvent(cOutput,selectionChangedEventCode(),"#{f1}")
115 cOutput = substr(cOutput,"#{f1}",selectionChangedEventCode())
116 cOutput += 'seturlChangedEvent ("#{f1}")' + nl
117 cOutput = PrepareEvent(cOutput,urlChangedEventCode(),"#{f1}")
118 cOutput = substr(cOutput,"#{f1}",urlChangedEventCode())
121 func RestoreProperties oDesigner,Item
122 RestoreCommonProperties(oDesigner,item)
123 itemdata = item[:data]
124 setURLValue(itemdata[:URL])
125 SetloadProgressEventCode(itemdata[:setloadProgressEvent ])
126 SetloadStartedEventCode(itemdata[:setloadStartedEvent ])
127 SetselectionChangedEventCode(itemdata[:setselectionChangedEvent ])
128 SeturlChangedEventCode(itemdata[:seturlChangedEvent ])