Author |
Topic: pressing ESC aborts the program (Read 1532 times) |
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: pressing ESC aborts the program
« Reply #18 on: Sep 16th, 2016, 09:28am » |
|
I would like to remind that problem occurs then single-line edit has focus in ordinary window. So that problem with multiline edit likely different thing.
Yes I tried trapclose workaround and it worked all few times I tried.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: pressing ESC aborts the program
« Reply #19 on: Sep 16th, 2016, 10:48am » |
|
on Sep 16th, 2016, 09:28am, tsh73 wrote:| I would like to remind that problem occurs then single-line edit has focus in ordinary window. So that problem with multiline edit likely different thing. |
|
No, in both LB 4 and LBB a single-line TEXTBOX is a multiline edit control. You can confirm that using this code:
Code: textbox #w.tb, 10, 10, 200, 25
open "Textbox style test" for window as #w
htb = hwnd(#w.tb)
calldll #user32, "GetWindowLongA", htb as ulong, _
_GWL_STYLE as long, style as long
print dechex$(style)
wait You will see that in both LB 4 and LBB the following value is printed in the mainwin:
Style Code: The 4 in the least-significant digit position indicates that it is a multiline edit control (ES_MULTILINE = 4), despite the fact that it has only one line!
It is clearly the case that the Edit Control bug (which I have now found many references to, including at the PowerBASIC forum) is the reason for the observed behavior.
Richard.
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: pressing ESC aborts the program
« Reply #20 on: Sep 16th, 2016, 11:00am » |
|
Quote:| No, in both LB 4 and LBB a single-line TEXTBOX is a multiline edit control. |
|
Err... I remember reading something about LB TEXTBOX allows multiline. I did not expected single line control use "multiline edit control".
I wonder why LBB uses multiline edit for singleline TEXTBOX?
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: pressing ESC aborts the program
« Reply #21 on: Sep 16th, 2016, 11:47am » |
|
on Sep 16th, 2016, 10:48am, Richard Russell wrote:| No, in both LB 4 and LBB a single-line TEXTBOX is a multiline edit control. |
|
Here's an even more direct demonstration. In the program below I explicitly create a single-line edit control by clearing the ES_MULTILINE bit using stylebits; in this case pressing Esc does not close the window:
Code: textbox #w.tb, 10, 10, 200, 25
stylebits #w.tb, 0, _ES_MULTILINE, 0, 0
open "Textbox style test" for window as #w
wait Quote:| I wonder why LBB uses multiline edit for singleline TEXTBOX? |
|
Because LB 4 does!! It's necessary for compatibility (there are LB programs which depend on it).
Richard.
|
|
|
|
metro
New Member
member is offline


Posts: 8
|
 |
Re: pressing ESC aborts the program
« Reply #22 on: Sep 16th, 2016, 2:09pm » |
|
I have tinkered with two of my programs to get them to run in LBB both have Richards work around and am happy to say... "all good."
Each program is used daily and handle the many times I accidentally press ESC twice when closing a dialog to drop back to the main window.
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: pressing ESC aborts the program
« Reply #23 on: Sep 19th, 2016, 07:52am » |
|
Hello Richard If Quote:| No, in both LB 4 and LBB a single-line TEXTBOX is a multiline edit control. |
|
what is TEXTEDITOR control?
(after all, window closes only then focus is on TEXTBOX)
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: pressing ESC aborts the program
« Reply #24 on: Sep 19th, 2016, 1:50pm » |
|
on Sep 19th, 2016, 07:52am, tsh73 wrote:| what is TEXTEDITOR control? |
|
That's an Edit Control too, but I'm not sure what the stylebits settings are offhand (I'm away from home at the moment).
Richard.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: pressing ESC aborts the program
« Reply #25 on: Sep 19th, 2016, 6:45pm » |
|
on Sep 19th, 2016, 1:50pm, Richard Russell wrote:| That's an Edit Control too |
|
I can confirm that it's a superclassed (not subclassed) multiline Edit Control. So it has a different class name (LBBEDIT) and extended functionality - which it needs for compatibility with LB's custom TEXTEDITOR control - but is based on a standard Edit Control.
Richard.
|
|
Logged
|
|
|
|
|