2 ** Project : Form Designer
3 ** File Purpose : QProgressbar Control
5 ** Author : Mahmoud Fayed <msfclipper@yahoo.com>
10 class FormDesigner_QProgressbar from QLineEdit
12 CreateCommonAttributes()
13 CreateMoveResizeCornersAttributes()
22 cvalueChangedEvent = ""
27 func SetOrientationValue nIndex
33 func SetMinimumValue Value
39 func SetMaximumValue Value
45 func SetRangeValue Value
51 func SetValueValue Value
54 func SetvalueChangedEventCode cValue
55 cvalueChangedEvent = cValue
57 func valueChangedEventCode
58 return cvalueChangedEvent
60 func AddObjectProperties oDesigner
61 AddObjectCommonProperties(oDesigner)
62 oDesigner.oView.AddPropertyCombobox(T_FORMDESIGNER_ATTRIBUTE_SETORIENTATION,[T_FORMDESIGNER_ATTRIBUTE_HORIZONTAL,T_FORMDESIGNER_ATTRIBUTE_VERTICAL]) # "Set Orientation" "Horizontal" "Vertical"
63 oDesigner.oView.AddProperty(T_FORMDESIGNER_ATTRIBUTE_SETMINIMUM,False) # "Set Minimum"
64 oDesigner.oView.AddProperty(T_FORMDESIGNER_ATTRIBUTE_SETMAXIMUM,False) # "Set Maximum"
65 oDesigner.oView.AddProperty(T_FORMDESIGNER_ATTRIBUTE_SETRANGE,False) # "Set Range"
66 oDesigner.oView.AddProperty(T_FORMDESIGNER_ATTRIBUTE_SETVALUE,False) # "Set Value"
67 oDesigner.oView.AddProperty(T_FORMDESIGNER_ATTRIBUTE_VALUECHANGEDEVENT,False) # "valueChangedEvent"
69 func DisplayProperties oDesigner
70 DisplayCommonProperties(oDesigner)
71 oPropertiesTable = oDesigner.oView.oPropertiesTable
72 oPropertiesTable.Blocksignals(True)
74 oWidget = oPropertiesTable.cellwidget(C_AFTERCOMMON,1)
75 oCombo = new qCombobox
76 oCombo.pObject = oWidget.pObject
77 oCombo.BlockSignals(True)
78 oCombo.setCurrentIndex(OrientationValue())
79 oCombo.BlockSignals(False)
80 # Minimum, Maximum, Range and Value
81 oPropertiesTable.item(C_AFTERCOMMON+1,1).settext(MinimumValue())
82 oPropertiesTable.item(C_AFTERCOMMON+2,1).settext(MaximumValue())
83 oPropertiesTable.item(C_AFTERCOMMON+3,1).settext(RangeValue())
84 oPropertiesTable.item(C_AFTERCOMMON+4,1).settext(ValueValue())
85 oPropertiesTable.item(C_AFTERCOMMON+5,1).settext(valueChangedEventcode())
86 oPropertiesTable.Blocksignals(False)
88 setText(oDesigner.oModel.GetObjectName(self))
90 func ComboItemAction oDesigner,nRow
91 nOrientationPos = C_AFTERCOMMON
92 if nRow = nOrientationPos { # Orientation
93 oWidget = oDesigner.oView.oPropertiesTable.cellwidget(nOrientationPos,1)
94 oCombo = new qCombobox
95 oCombo.pObject = oWidget.pObject
96 nIndex = oCombo.CurrentIndex()
97 setOrientationValue(nIndex)
100 func UpdateProperties oDesigner,nRow,nCol,cValue
101 UpdateCommonProperties(oDesigner,nRow,nCol,cValue)
105 setMinimumValue(cValue)
107 setMaximumValue(cValue)
109 setRangeValue(cValue)
111 setValueValue(cValue)
113 setvalueChangedEventCode(cValue)
117 # Set the object name
118 setText(oDesigner.oModel.GetObjectName(self))
120 func ObjectDataAsString oDesigner,nTabsCount
121 cOutput = ObjectDataAsString2(oDesigner,nTabsCount)
122 cTabs = std_copy(char(9),nTabsCount)
123 cOutput += "," + nl + cTabs + ' :orientation = ' + OrientationValue()
124 cOutput += "," + nl + cTabs + ' :minimum = "' + oDesigner.PrepareStringForFormFile(MinimumValue()) + '"'
125 cOutput += "," + nl + cTabs + ' :maximum = "' + oDesigner.PrepareStringForFormFile(MaximumValue()) + '"'
126 cOutput += "," + nl + cTabs + ' :range = "' + oDesigner.PrepareStringForFormFile(RangeValue()) + '"'
127 cOutput += "," + nl + cTabs + ' :value = "' + oDesigner.PrepareStringForFormFile(ValueValue()) + '"'
128 cOutput += "," + nl + cTabs + ' :setvalueChangedEvent = "' + oDesigner.PrepareStringForFormFile(valueChangedEventCode()) + '"'
131 func GenerateCustomCode oDesigner
133 cOutput += 'setOrientation(#{f1})' + nl
134 cOutput = substr(cOutput,"#{f1}",""+(OrientationValue()+1))
135 if Minimumvalue() != NULL {
136 cOutput += 'setMinimum(#{f1})' + nl
137 cOutput = substr(cOutput,"#{f1}",""+MinimumValue())
139 if Maximumvalue() != NULL {
140 cOutput += 'setMaximum(#{f1})' + nl
141 cOutput = substr(cOutput,"#{f1}",""+MaximumValue())
143 if Rangevalue() != NULL {
144 cOutput += 'setRange(#{f1})' + nl
145 cOutput = substr(cOutput,"#{f1}",""+RangeValue())
147 if ValueValue() != NULL {
148 cOutput += 'setValue(#{f1})' + nl
149 cOutput = substr(cOutput,"#{f1}",""+ValueValue())
151 cOutput += 'setvalueChangedEvent("#{f1}")' + nl
152 cOutput = PrepareEvent(cOutput,valueChangedEventCode(),"#{f1}")
153 cOutput = substr(cOutput,"#{f1}",valueChangedEventCode())
156 func RestoreProperties oDesigner,Item
157 RestoreCommonProperties(oDesigner,item)
158 itemdata = item[:data]
159 setOrientationValue(0+itemdata[:orientation])
160 setMinimumValue(itemdata[:minimum])
161 setMaximumValue(itemdata[:maximum])
162 setRangeValue(itemdata[:range])
163 setValueValue(itemdata[:value])
164 SetvalueChangedEventCode(itemdata[:setvalueChangedEvent])