Update Form Designer - Support Spaces in Form File Name when generating classes code.
@@ -15,6 +15,9 @@ class FormDesignerCodeGenerator
cSourceFileName = substr(cFormFileName,".rform","View.ring")
cFormName = GetFileNameOnlyWithoutPath(substr(cFormFileName,".rform",""))
cClassName = cFormName + "View"
+ cClassName = substr(cClassName," ","_")
+ cClassName2 = cFormName + "Controller"
+ cClassName2 = substr(cClassName2," ","_")
# Add the File Header
cOutput = "# Form/Window View - Generated Source Code File " + nl +
"# Generated by the Ring "+version()+" Form Designer" + nl +
@@ -51,16 +54,18 @@ load "#{f1}View.ring"
if IsMainSourceFile() {
new qApp {
StyleFusion()
- open_window(:#{f1}Controller)
+ open_window(:#{f2})
exec()
}
}
-class #{f1}controller from windowsControllerParent
+class #{f2} from windowsControllerParent
- oView = new #{f1}View
+ oView = new #{f3}
`
cOutput = substr(cOutput,"#{f1}",cFormName)
+ cOutput = substr(cOutput,"#{f2}",cClassName2)
+ cOutput = substr(cOutput,"#{f3}",cClassName)
write(cSourceFileName,cOutput)
func GetFileNameOnlyWithoutPath cFileName
