Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
19
Erster Beitrag:
vor 8 Jahren, 1 Monat
Letzter Beitrag:
vor 8 Jahren, 1 Monat
Beteiligte Autoren:
Frans, DW, Al, BLS, Ola, Piet van Zanten, Jimbo

Clicking on close cross doesn't close the window

Startbeitrag von Frans am 09.08.2009 12:54

Hello to you all,

I have something strange in a window.
Clicking on the right upper cross (closing the window) doesn't work. It executes the code of a button . There is no code for bypassing the normal close cross.
Even stranger: when I put a predefined closing button it reacts as the closing cross.

When I make a button with the code "close()" all works well.

Tracing the window doesn't give any answer for the strange jump.
I also recompiled; repaired the project. I also deleted the cpl directory.
Anybody any idea?

Thanks in advance.

Antworten:

Hello Frans,

You have the button type as cancel.

From the Help Menu:

This button performs the same action as pressing the [Esc] key. The exit code of the current control is not run when clicking this button.

The code of this button is run:

when pressing the [Esc] key if no other control in the window intercepts the ESC key.

when using the [ALT] + [F4] keys

when closing the window by using the cross ([x]).

If two cancel type buttons are in the same window, the code executed is the code of the first cancel type button based on the navigation order of the window.


von DW - am 09.08.2009 13:22
Hello Dennis,

Thank you for your answer.
I wish it was that easy. All the buttons are off the type Normal.
Still struggeling



von Frans - am 09.08.2009 13:27
Frans,

Maybe a button hidden off screen or behind something with no code in it?

von DW - am 09.08.2009 14:04
Hello Dennis,

Thank you for your email.
No, sorry.
The button that is executed depends on the tab that is active in the window.
When I delete the executed button then another button is executed,

Strange..

von Frans - am 09.08.2009 14:12
Frans,

The help says if there is more then 1 button with the "Cancel" Type it will choose the first one in the tab order.

Did you try change the types to Interruption?


von DW - am 09.08.2009 15:33
Hello Dennis,

Thank you for your reply.
I have no buttons off the type Cancel and none off the type Interruption.


von Frans - am 09.08.2009 17:53
Frans,

Don't you hate wasting a Sunday trying figure crap like this out? I was working on a unrelated issue for about 2 weeks now and finally found my answer today.

I am out of ideas but will be interested in what you find out.

Dennis

von DW - am 09.08.2009 18:33
Quote
Frans
Hello to you all,

I have something strange in a window.
Clicking on the right upper cross (closing the window) doesn't work. It executes the code of a button . There is no code for bypassing the normal close cross.
Even stranger: when I put a predefined closing button it reacts as the closing cross.

When I make a button with the code "close()" all works well.

Tracing the window doesn't give any answer for the strange jump.
I also recompiled; repaired the project. I also deleted the cpl directory.
Anybody any idea?

Thanks in advance.

Regards,

Frans


Hi Frans,

I have a rather complex window of an old WD 5.5 SDI application that reacts to clicking the [X] in the upper right corner only when clicked the second time. And yes, the Close() command from a button works each time and immediately. Seems to be a similar phenomenon?

Until now, I did not care much for that 'problem' and let users click the [X] twice if they chose to ignore the [ Close ] button.

But I'll have a look into that tonight, if I can find something - I'll tell you here ..

Kind regards,
Guenter



von Jimbo - am 09.08.2009 18:43
Hello Frans

Is the close button one of your own buttons or is it the Windows system close button inserted by the option in the style editor

If it is the Windows System close button then you may solve the problem by creating a new blank window and then copy and paste controls and code from the old window to the new one.

Regards
Al

von Al - am 10.08.2009 03:03
Hi Frans,

I had the exact same problem. This was due to an error in the code that was not detected by the compiler. I don't remember the exact type of error, it might be a link to a non-existing file- or query item, but I'm not sure. Since recompile or repair does not help, perhaps you can generate the executable and see if a runtime error occurs.

Regards,
Piet



von Piet van Zanten - am 10.08.2009 06:07
Hello Guenter,

Thank you for your answer.
I have something like that to in another application.
The users have to click twice.
Doesn't work with this application.

Thanks anyway.

von Frans - am 10.08.2009 19:46
Hello Dennis,

Yes, I don't like that also. But I think it happens in all programming languages so it is a part of our life.


von Frans - am 10.08.2009 19:48
Hello Piet,

I started to copy all controls etc to a new window.
First it worked well and stoped after I had copied all the controls.
So I think you are right. There must be an undetected error by Windev in one off the controls.
I wil search further.
Thank you for your answer.


von Frans - am 10.08.2009 19:58
Hello Frans

F12 provides quite good info in situations like yours where you are looking for missing controls or trying to get an overview of a window and all its bits and pieces.

Regards
Al

von Al - am 10.08.2009 21:25
Hi all

I have also had the same experience a couple of times: closing a window does not work as documented. And like Piet said, also in my cases the reason has always been in some other, difficult to find code problem in the same window, not related to closing in any way. Takes time, does not help make the development 10 times faster.

regards
Ola

von Ola - am 11.08.2009 08:53
HI Frans,

which graphical templare are u using.

probably you are using a template wirh an artificial title bar-> close button. I would suggest that you have a look at the template itself and investigate the code for the close button.

Björn
ps : sorry Frans, not only that I have a couple of work.. I also have to do some plumbering work in my house.


von BLS - am 11.08.2009 09:43

Solved but WHY?

Hello to you all,

I solved the problem. There where 6 buttons which caused the problem (not closing the window). I remember that I copied the 5 from without one. And made smaal changes to the code.

Solution:
Made 6 new buttons and copied the code off the old buttons into the new one.
Now all works fine.

Why?
I don't now what was the matter with the old buttons. I copied all the code etc from one to the other. There must be some hidden error in the old buttons.

Tanks ffor all the reply.


von Frans - am 13.08.2009 14:14
Thanks All,

Nice tip.

von Frans - am 13.08.2009 14:17
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.