OSDN Git Service

Ring 1.10 以来となる開発環境の日本語ローカライズ版 (評価版) を追加 (ノートパッド、フォームデザイナー、対話型実行環境、ファイルの検索)。
[ring-lang-081/ring.git] / applications / formdesigner / source / controls / qwebview.ring
1 /*
2 **      Project : Form Designer 
3 **      File Purpose :  QWebView Control
4 **      Date : 2017.04.29
5 **      Author :  Mahmoud Fayed <msfclipper@yahoo.com>
6 */
7
8 package formdesigner
9
10 class FormDesigner_QWebView from QLineEdit
11
12         CreateCommonAttributes()
13         CreateMoveResizeCornersAttributes()
14
15         cURL = ""
16
17         cloadProgressEvent  = ""
18         cloadStartedEvent  = ""
19         cselectionChangedEvent  = ""
20         curlChangedEvent  = ""
21
22         func URLValue
23                 return cURL
24
25         func SetURLvalue value
26                 cURL = value
27
28         func SetloadProgressEventCode cValue
29                 cloadProgressEvent  = cValue
30
31         func loadProgressEventCode
32                 return cloadProgressEvent
33
34         func SetloadStartedEventCode cValue
35                 cloadStartedEvent  = cValue
36
37         func loadStartedEventCode
38                 return cloadStartedEvent
39
40         func SetselectionChangedEventCode cValue
41                 cselectionChangedEvent  = cValue
42
43         func selectionChangedEventCode
44                 return cselectionChangedEvent
45
46         func SeturlChangedEventCode cValue
47                 curlChangedEvent  = cValue
48
49         func urlChangedEventCode
50                 return curlChangedEvent
51
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 "
59
60         func DisplayProperties oDesigner
61                 DisplayCommonProperties(oDesigner)
62                 oPropertiesTable = oDesigner.oView.oPropertiesTable
63                 oPropertiesTable.Blocksignals(True)
64                 # Set the Text
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)
71                 # Set the object name
72                         setText(oDesigner.oModel.GetObjectName(self))
73
74         func UpdateProperties oDesigner,nRow,nCol,cValue
75                 UpdateCommonProperties(oDesigner,nRow,nCol,cValue)
76                 if nCol = 1 {
77                         switch nRow {
78                                 case C_AFTERCOMMON
79                                         setURLValue(cValue)
80                                 case C_AFTERCOMMON+1
81                                         setloadProgressEventCode(cValue)
82                                 case C_AFTERCOMMON+2
83                                         setloadStartedEventCode(cValue)
84                                 case C_AFTERCOMMON+3
85                                         setselectionChangedEventCode(cValue)
86                                 case C_AFTERCOMMON+4
87                                         seturlChangedEventCode(cValue)
88                         }
89                 }
90                 # Set the object name
91                         setText(oDesigner.oModel.GetObjectName(self))
92
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()) + '"'
101                 return cOutput
102
103         func GenerateCustomCode oDesigner
104                 cOutput = ""
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())
119                 return cOutput
120
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 ])