In all versions of BlackBox, if you try to open a regular textfile using StdCmds.OpenAuxDialog, you get:
TRAP 21 (precondition violated)
HostPorts.Port.SetSize [00000076H]
.h INTEGER -34
.p HostPorts.Port [02A876E0H]
.w INTEGER 638
Try for example: <Ctrl-Q>"StdCmds.OpenAuxDialog('BlackBox_1.7.3-a1_Changes.odc', 'TEST')"
The above-mentioned trap appears twice. Even more, regardless of the trap the file opens correctnly.
Please note that this is not a matter of when is appropriate to use OpenAuxDialog, OpenDoc or other open command variant; the point is that there seems to be an old bug living there.
StdCmds.OpenAuxDialog Trapped
-
- Posts: 263
- Joined: Tue Sep 17, 2013 6:50 am
Re: StdCmds.OpenAuxDialog Trapped
I do agree that the behavior is suboptimal.
The docu should state that the file parameter must be a dialog (Form) document, a text doesn't work properly.
It seems that there is some problem with getting a proper window size if a text document is used as a dialog.
- Josef
The docu should state that the file parameter must be a dialog (Form) document, a text doesn't work properly.
It seems that there is some problem with getting a proper window size if a text document is used as a dialog.
- Josef
Re: StdCmds.OpenAuxDialog Trapped
The bug is in the HostWindows.DocWinHandler: also, the DialogHandler need same fix
Code: Select all
| WinApi.WM_SIZE:
....
Kernel.Try(SizeWin, wnd, lParam MOD 65536, lParam DIV 65536 MOD 65536) (* add MOD 65536 *)
Code: Select all
| WinApi.WM_SIZE:
w := ThisWindow(wnd);
Kernel.Try(SizeWin, wnd, lParam MOD 65536 + w.dw, lParam DIV 65536 MOD 65536 + w.dh)