Update Form Designer - Generate Source Code Files - View/Controller File.
@@ -4110,10 +4110,11 @@ class FormDesignerCodeGenerator
cSourceFileName
func Generate oDesigner,cFormFileName
- cSourceFileName = substr(cFormFileName,"rform","rform.ring")
- cClassName = GetFileNameOnlyWithoutPath(substr(cFormFileName,".rform","")) + "View"
+ cSourceFileName = substr(cFormFileName,".rform","View.ring")
+ cFormName = GetFileNameOnlyWithoutPath(substr(cFormFileName,".rform",""))
+ cClassName = cFormName + "View"
# Add the File Header
- cOutput = "# Form/Window - Generated Source Code File " + nl +
+ cOutput = "# Form/Window View - Generated Source Code File " + nl +
"# Generated by the Ring "+version()+" Form Designer" + nl +
"# Date : " + date() + nl +
"# Time : " + time() + nl + nl
@@ -4137,6 +4138,27 @@ class FormDesignerCodeGenerator
# Add the End of file
cOutput += "# End of the Generated Source Code File..."
write(cSourceFileName,cOutput)
+ # Write the Controller Source File
+ cSourceFileName = substr(cFormFileName,".rform","Controller.ring")
+ if fexists(cSourceFileName) { return }
+ cOutput = `# Form/Window Controller - Source Code File
+
+load "#{f1}View.ring"
+
+if IsMainSourceFile() {
+ new qApp {
+ StyleFusion()
+ open_window(:#{f1}Controller)
+ exec()
+ }
+}
+
+class #{f1}controller from windowsControllerParent
+
+ oView = new #{f1}View
+`
+ cOutput = substr(cOutput,"#{f1}",cFormName)
+ write(cSourceFileName,cOutput)
func GetFileNameOnlyWithoutPath cFileName
cFN = cFileName
