Update Form Designer - FormDesigner_QPushButton Class - Add Property "Button Image".
@@ -2682,6 +2682,7 @@ class FormDesigner_QPushButton from QPushButton
CreateMoveResizeCornersAttributes()
cClickEvent = ""
+ cBtnImage = ""
func SetClickEventCode cValue
cClickEvent = cValue
@@ -2689,9 +2690,16 @@ class FormDesigner_QPushButton from QPushButton
func ClickEventCode
return cClickEvent
+ func BtnImageValue
+ return cBtnImage
+
+ func SetBtnImageValue cValue
+ cBtnImage = cValue
+
func AddObjectProperties oDesigner
AddObjectCommonProperties(oDesigner)
oDesigner.oView.AddProperty("Text",False)
+ oDesigner.oView.AddProperty("Image",True)
oDesigner.oView.AddProperty("Set Click Event",False)
func DisplayProperties oDesigner
@@ -2700,8 +2708,11 @@ class FormDesigner_QPushButton from QPushButton
oPropertiesTable.Blocksignals(True)
# Set the Text
oPropertiesTable.item(C_AFTERCOMMON,1).settext(text())
+ # Set the Button Image
+ oPropertiesTable.item(C_AFTERCOMMON+1,1).settext(BtnImageValue())
+ setBtnImage(self,BtnImageValue())
# Set the Click Event
- oPropertiesTable.item(C_AFTERCOMMON+1,1).settext(clickeventcode())
+ oPropertiesTable.item(C_AFTERCOMMON+2,1).settext(clickeventcode())
oPropertiesTable.Blocksignals(False)
func UpdateProperties oDesigner,nRow,nCol,cValue
@@ -2710,30 +2721,46 @@ class FormDesigner_QPushButton from QPushButton
switch nRow {
case C_AFTERCOMMON
setText(cValue)
- case C_AFTERCOMMON+1 # Click Event
+ case C_AFTERCOMMON+1
+ setBtnImageValue(cValue)
+ setBtnImage(self,cValue)
+ case C_AFTERCOMMON+2 # Click Event
setClickEventCode(cValue)
}
}
+ func DialogButtonAction oDesigner,nRow
+ switch nRow {
+ case C_AFTERCOMMON+1 # Button Image
+ cFile = oDesigner.oGeneral.SelectFile(oDesigner)
+ setBtnImageValue(cFile)
+ DisplayProperties(oDesigner)
+ }
+
func ObjectDataAsString oDesigner,nTabsCount
cOutput = ObjectDataAsString2(oDesigner,nTabsCount)
cTabs = std_copy(char(9),nTabsCount)
cOutput += "," + nl + cTabs + ' :text = "' + Text() + '"'
+ cOutput += "," + nl + cTabs + ' :BtnImage = "' + BtnImageValue() + '"'
cOutput += "," + nl + cTabs + ' :setClickEvent = "' + ClickEventCode() + '"'
return cOutput
func GenerateCustomCode oDesigner
cOutput = 'setText("#{f1}")' + nl
cOutput += 'setClickEvent("#{f2}")' + nl
+ cOutput += 'setBtnImage(#{f3},"#{f4}")' + nl
cOutput = substr(cOutput,"#{f1}",text())
cOutput = PrepareEvent(cOutput,ClickEventCode(),"#{f2}")
cOutput = substr(cOutput,"#{f2}",ClickEventCode())
+ cOutput = substr(cOutput,"#{f3}",oDesigner.oModel.GetObjectName(self))
+ cOutput = substr(cOutput,"#{f4}",BtnImageValue())
return cOutput
func RestoreProperties oDesigner,Item
RestoreCommonProperties(oDesigner,item)
itemdata = item[:data]
setText(itemdata[:text])
+ SetBtnImageValue(itemdata[:BtnImage])
SetClickEventCode(itemdata[:setClickEvent])
class FormDesigner_QLineEdit from QLineEdit
