How to close all windows that open with command "open" except the first window?

Hi,

I build an application with login and users manager.
After validate login, the user can open different windows (opensheet &
open).
My problem appears when this user use my logoff :
    I can easly close all sheets but I can�t close the window that open with
the command "open(...)".

Are there a command (or other) to obtain the open window?

Maybe that do I must work with a window�s array?

What do you think?
All solutions are welcome!

Thanx in advance

Chris M.


0
chris
12/18/2000 7:38:53 PM
sybase.powerbuilder.pfc 6437 articles. 1 followers. Follow

5 Replies
955 Views

Similar Articles

[PageSpeed] 10
Get it on Google Play
Get it on Apple App Store

Generally speaking, the parent of windows opened with Open() is the MDI 
frame, so if you are allowing the user to logoff without closing the MDI 
frame then you will need to keep track of which windows are opened this 
way.

One way to do this is to create a window manager that has a function on it 
to open windows.  You also then keep track of the window variables 
themselves as the windows are opened.  You can keep track in an array of 
type window.  You can then create close() and/or closeall() functions that 
close particular windows or all windows that were opened using the Open() 
function.

HTH,

steve
[TeamSybase]
0
katz_s
12/19/2000 3:03:53 PM
Hi,

in my MDI-application I have a button "Close all" within the menu toolbar.
The code is as follows:

integer i
window lw_tmp[]

i    = 1
lw_tmp[i]  = This.GetFirstSheet ()

DO WHILE IsValid( lw_tmp[i] )
 lw_tmp[i+1] = This.GetNextSheet( lw_tmp[i] )
 i ++
LOOP

FOR i = 1 TO UpperBound( lw_tmp )
 IF ISValid( lw_tmp[i] ) THEN
  close( lw_tmp[i] )
 END IF
NEXT

That works for me.

Bjoern
katz_s@banet.net schrieb in Nachricht
<9A816F78B087F3AE0052C0F2852569BA.00708C9C852569B9@webforums>...
>Generally speaking, the parent of windows opened with Open() is the MDI
>frame, so if you are allowing the user to logoff without closing the MDI
>frame then you will need to keep track of which windows are opened this
>way.
>
>One way to do this is to create a window manager that has a function on it
>to open windows.  You also then keep track of the window variables
>themselves as the windows are opened.  You can keep track in an array of
>type window.  You can then create close() and/or closeall() functions that
>close particular windows or all windows that were opened using the Open()
>function.
>
>HTH,
>
>steve
>[TeamSybase]


0
Bjoern
12/21/2000 9:13:45 AM
<<integer i
window lw_tmp[]

i    = 1
lw_tmp[i]  = This.GetFirstSheet ()

DO WHILE IsValid( lw_tmp[i] )
 lw_tmp[i+1] = This.GetNextSheet( lw_tmp[i] )
 i ++
LOOP

FOR i = 1 TO UpperBound( lw_tmp )
 IF ISValid( lw_tmp[i] ) THEN
  close( lw_tmp[i] )
 END IF
NEXT
>>

That will work for MDI sheets opened with OpenSheet(), but NOT for child or 
popup windows opened with Open().

BTW, for your code, you should not need to create the window array.  You 
could just do this:

window lwin
window lwin_temp

lwin = this.GetFirstSheet()

do while IsValid (lwin)
  lwin_temp = lwin
  Close (lwin)
  lwin = this.GetNextSheet (lwin_temp)
loop

Regards,

steve
[TeamSybase]
0
katz_s
12/22/2000 2:36:20 PM
You are absolutely right. It works for OpenSheet - "windows" only.
The problem with your suggestion, Steve, not to use the window
array is, that with the Close-statement the lwin_temp variable gets
unvalid also. lwin_temp is a pointer to lwin!

Regards
Bjoern

katz_s@banet.net schrieb in Nachricht
>BTW, for your code, you should not need to create the window array.  You
>could just do this:
>
>window lwin
>window lwin_temp
>
>lwin = this.GetFirstSheet()
>
>do while IsValid (lwin)
>  lwin_temp = lwin
>  Close (lwin)
>  lwin = this.GetNextSheet (lwin_temp)
>loop
>
>Regards,
>
>steve
>[TeamSybase]


0
Bjoern
1/4/2001 3:23:35 PM
You are absolutely right. It works for OpenSheet - "windows" only.

Your suggestion, Steve, not to use the window array, works fine,
if the Close statment is carried out AFTER the NextSheet has been assigned
to lwin_temp
and the Close-statement has to be carried out on lwin_temp.
Otherwise the lwin_temp variable gets unvalid also. lwin_temp is a pointer
to lwin!

Regards
Bjoern
>BTW, for your code, you should not need to create the window array.  You
>could just do this:
>
>window lwin
>window lwin_temp
>
>lwin = this.GetFirstSheet()
>
>do while IsValid (lwin)
>    lwin_temp = lwin
      lwin = this.GetNextSheet (lwin_temp) // modified
      Close (lwin_temp)                                 // modified
>loop
>
>Regards,
>
>steve
>[TeamSybase]


0
Bjoern
1/4/2001 3:41:40 PM
Reply:

Similar Artilces:

superreview requested: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 225294] close blank window
Marria Nazif <marria@gmail.com> has asked Darin Fisher (Google) <darin@meer.net> for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 225294: close blank window https://bugzilla.mozilla.org/attachment.cgi?id=225294&action=edit ------- Additional Comments from Marria Nazif <marria@gmail.com> This is a first try at closing the window after the external app handler has done its work. This se...

superreview cancelled: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 225294] close blank window
Marria Nazif <marria@gmail.com> has cancelled Marria Nazif <marria@gmail.com>'s request for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 225294: close blank window https://bugzilla.mozilla.org/attachment.cgi?id=225294&action=edit ...

"Open", "Open in new window", "Open in new tab" are greyed-out after drag&drop operation
Name: Dmitriy Email: dadotivanovathotmaildotcom Product: Firefox Release Candidate Summary: "Open", "Open in new window", "Open in new tab" are greyed-out after drag&drop operation Comments: Steps to Reproduce: 1. Drag&drop a bookmark from the Bookmarks Menu or Bookmarks Toolbar to the Tab bar. 2. Right-click on any bookmark (from the same folder, if darged from Menu, or from the visible part of Bookmarks Toolbar) Result: "Open", "Open in new window", "Open in new tab" are greyed-out Browser Details: Moz...

superreview granted: [Bug 348183] scenario where clicking cancel in the "closing window with <n> tabs open" prompt closes the window, instead of keeping it open : [Attachment 233097] alternative, low
Brian Ryner <bryner@gmail.com> has granted Seth Spitzer [:ss] <sspitzer@mozilla.com>'s request for superreview: Bug 348183: scenario where clicking cancel in the "closing window with <n> tabs open" prompt closes the window, instead of keeping it open https://bugzilla.mozilla.org/show_bug.cgi?id=348183 Attachment 233097: alternative, low-risk patch until everything is sorted out https://bugzilla.mozilla.org/attachment.cgi?id=233097&action=edit ...

superreview requested: [Bug 348183] scenario where clicking cancel in the "closing window with <n> tabs open" prompt closes the window, instead of keeing it open : [Attachment 233097] low risk patch u
Seth Spitzer [:ss] <sspitzer@mozilla.com> has asked Brian Ryner <bryner@gmail.com> for superreview: Bug 348183: scenario where clicking cancel in the "closing window with <n> tabs open" prompt closes the window, instead of keeing it open https://bugzilla.mozilla.org/show_bug.cgi?id=348183 Attachment 233097: low risk patch until everything is sorted out https://bugzilla.mozilla.org/attachment.cgi?id=233097&action=edit ------- Additional Comments from Seth Spitzer [:ss] <sspitzer@mozilla.com> I'm still nervous about changing nsGlobalWindow.cp...

Bug 241972 new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins
Bug 241972 new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins This bug is filed against Firefox but aren't all these files under core? <https://bugzilla.mozilla.org/attachment.cgi?id=227973&action=view> DocShell, WebNavigation, WindowWatcher, etc. Will this patch be picked up by SeaMonkey trunk? Phil -- Philip Chee <philip@aleytys.pc.my>, <philip.chee@gmail.com> http://flashblock.mozdev.org/ http://xsidebar.mozdev.org Guard us from the she-wolf and the wolf, and guard ...

Problem with opening new window "window.Open" using javascript
I am trying to open new window when press a button "btnPrint" using: Response.Write("<script language='javascript'> window.open('CouponReport.aspx', 'window', 'HEIGHT=600,WIDTH=820,top=50,left=50,toolbar=yes,scrollbars=yes,resizable=yes'); </script>"); but when the new window opened the current page do a post back action and the current page format change like the following: before window open: after window opened: So, how i can a void the post back action.  <script language='javascript'> funct...

"Close all opened windows" entry in "File" menu
Name: NB Product: Firefox Release Candidate Summary: "Close all opened windows" entry in "File" menu Comments: Would be nice to have an entry "Close all opened windows" in the "File" menu. Moreover this would be useful when the "Startup" configuration is "Show my windows and tabs from last time", in order to have the same behaviour of "Restore session" after a crash. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0 From URL: http://hendrix.mozilla.org/ ...

superreview cancelled: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 226289] pass state in the channel
Marria Nazif <marria@gmail.com> has cancelled Marria Nazif <marria@gmail.com>'s request for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 226289: pass state in the channel https://bugzilla.mozilla.org/attachment.cgi?id=226289&action=edit ...

superreview requested: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 227973] tweaks in response to reviews
Marria Nazif <marria@gmail.com> has asked Darin Fisher (Google) <darin@meer.net> for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 227973: tweaks in response to reviews https://bugzilla.mozilla.org/attachment.cgi?id=227973&action=edit ------- Additional Comments from Marria Nazif <marria@gmail.com> (In reply to comment #60) > (From update of attachment 227564 [edit]) > So this w...

superreview requested: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 226289] pass state in the channel
Marria Nazif <marria@gmail.com> has asked Darin Fisher (Google) <darin@meer.net> for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 226289: pass state in the channel https://bugzilla.mozilla.org/attachment.cgi?id=226289&action=edit ------- Additional Comments from Marria Nazif <marria@gmail.com> This is another idea I had - we can pass state on the channel which indicates whether a new ...

superreview cancelled: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 227973] tweaks in response to reviews
Marria Nazif <marria@gmail.com> has cancelled Marria Nazif <marria@gmail.com>'s request for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 227973: tweaks in response to reviews https://bugzilla.mozilla.org/attachment.cgi?id=227973&action=edit ------- Additional Comments from Marria Nazif <marria@gmail.com> Actually, I'm going to go ahead and check this in on the trunk, since thes...

superreview requested: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 225651] check that session history is
Marria Nazif <marria@gmail.com> has asked Darin Fisher (Google) <darin@meer.net> for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 225651: check that session history is empty https://bugzilla.mozilla.org/attachment.cgi?id=225651&action=edit ...

superreview requested: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 226606] store state in channel, works
Marria Nazif <marria@gmail.com> has asked Darin Fisher (Google) <darin@meer.net> for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 226606: store state in channel, works for target= as well as window.open https://bugzilla.mozilla.org/attachment.cgi?id=226606&action=edit ------- Additional Comments from Marria Nazif <marria@gmail.com> This is a second iteration on the patch that stores s...

Web resources about - How to close all windows that open with command "open" except the first window? - sybase.powerbuilder.pfc

Resources last updated: 12/24/2015 1:23:39 AM