• Status Assigned
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Application
  • Assigned To
    Admin
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version Development
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Koda
Opened by Chris Haslam - 29.04.2011

FS#223 - Form | OnClose, OnMaximize, OnMinimize in MessageLoop mode

With OnClose, OnMaximize, OnMinimize set to Notify, Koda generated the following code with Generating Options set to MessageLoop mode:

#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=F:\Koda forms for PerfectScript\Pic ed test.kxf
$Form1 = GUICreate("Form1", 623, 449, 192, 114)
$Icon1 = GUICtrlCreateIcon("D:\WINDOWS\system32\freecell.exe", -1, 136, 136, 121, 121)
$Pic1 = GUICtrlCreatePic("D:\WINDOWS\system32\setup.bmp", 392, 120, 177, 169)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
 
While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
 
		Case $Form1
		Case $Form1
		Case $Form1
	EndSwitch
WEnd

The last 3 cases look odd to me.

I would expect in MessageLoop mode:

  • OnClose to default to Notify unless the code which is run by Koda is not the same as that generated
  • As well as $GUI_EVENT_CLOSE, two cases: $GUI_EVENT_MAXIMIZE and $GUI_EVENT_MINIMIZE

I then switched to OnEvent mode and got:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=F:\Koda forms for PerfectScript\Pic ed test.kxf
$Form1 = GUICreate("Form1", 623, 449, 192, 114)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
$Icon1 = GUICtrlCreateIcon("D:\WINDOWS\system32\freecell.exe", -1, 136, 136, 121, 121)
$Pic1 = GUICtrlCreatePic("D:\WINDOWS\system32\setup.bmp", 392, 120, 177, 169)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
 
While 1
	Sleep(100)
WEnd
 
Func Form1Close()
 
EndFunc
Func Form1Maximize()
 
EndFunc
Func Form1Minimize()
 
EndFunc

I don’t see Exit, so it appears that this is not the code that is run by Koda. This is only an observation.

Admin
Admin commented on 04.05.2011 06:41

Hm, yeah, that stupid. This should be "special" event codes, not control id. I feel, code generator should be revised.

Chris Haslam commented on 04.05.2011 13:51

I agree

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing