VW Problem (raise previous window) 
Author Message
 VW Problem (raise previous window)

Help guys,

This should be easy but the answer evades me.  I have several VW
applications running in wave (but I believe the solution will probably
work
for screen based apps).  I want to raise (activate, whatever you want to
call it) the application that was active before the current application.

Normally a close of the current application would activate the last
application (making it visible to the user) but I don't want to close
the current
application.  This behavior would be almost the same as pressing
shift-alt-tab once in windows.  However, the code to pull this off
alludes me.
Does anybody know the answer?

By the way, it doesn't have to work with dialogs.

Thanks,

Chris Lopeman
Object Link Inc.

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 VW Problem (raise previous window)

Quote:

> Help guys,

> This should be easy but the answer evades me.  I have several VW
> applications running in wave (but I believe the solution will probably
> work
> for screen based apps).  I want to raise (activate, whatever you want to
> call it) the application that was active before the current application.

> Normally a close of the current application would activate the last
> application (making it visible to the user) but I don't want to close
> the current
> application.  This behavior would be almost the same as pressing
> shift-alt-tab once in windows.  However, the code to pull this off
> alludes me.
> Does anybody know the answer?

> By the way, it doesn't have to work with dialogs.

> Thanks,

> Chris Lopeman
> Object Link Inc.

ScheduledControllers is the instance of ControlManager that keeps a record
of all open applications. ScheduledControllers scheduledControllers returns
a copy of the OrderedCollection used to hold the sequence of controllers of
each applications' top-level window.  So you can search through
ScheduledControllers scheduledControllers and find the index of your
application's controller.  The previous application's controller will be at
the previous index.

From an ApplicationModel use self builder window controller to get to the
top-level controller.  Browse senders of scheduledControllers to see some
analogous uses; e.g. VisualLauncher class>>#checkInstalledComponents and
ApplicationModel class>>#checkUnloadOfApplicationsDefinedBy:
_______________,,,^..^,,,____________________________
Eliot Miranda              Smalltalk - Scene not herd



Wed, 18 Jun 1902 08:00:00 GMT  
 VW Problem (raise previous window)

Quote:

>Help guys,
>This should be easy but the answer evades me.  I have several VW
>applications running in wave (but I believe the solution will probably
>work
>for screen based apps).  I want to raise (activate, whatever you want to
>call it) the application that was active before the current application.

I suggest exploring the class ControlManager. An instance of this class
is ScheduledControllers which references the controllers for all your
windows. Methods of interest:

scheduledControllers - ordered collection of scheduled controllers
updateControllerOrder - orders controllers by stacking order of their
views.
promote:aController - mal aController the first scheduled controller

etc

- Malcolm



Wed, 18 Jun 1902 08:00:00 GMT  
 VW Problem (raise previous window)


Wed, 18 Jun 1902 08:00:00 GMT  
 VW Problem (raise previous window)
Well guys,

It turns out that I had already looked at the places you suggested.  I
had programmed what I thought would work and tested it using regular
apps; it did nothing but I decided to run it in Wave and it worked
great.  I now know that there will be differences between the wave code
and
the window code.  The updateControllerOrder method means nothing in wave
(it simply returns).  Adding this method to the ControlManager
does what I wanted in wave.

raisePrevious

    self modalWindowChain isEmpty and: [self scheduledControllers size >
1])
    ifTrue: [(self scheduledControllers at: 2) view raise]

I typed so please forgive any syntax errors.

I would prefer to keep regular and web programming as compatiable as
possible.  But I have not figured out how to do this with window based
apps.  There are two problems.

First, I cannot find any methods that will activate a window.  When I
press a button on one window and have that button attempt to activate
another window (give focus to another window) it does nothing.  I have
tried raise (doesn't even bring it forward) and becomeActive and map
and some others.  The best I could do was expand and that only does
something if it is minimized (even here the window is not activate its
just in
front).

Second, as far as I can tell the order of the controllers in
SchedulesControllers is based on the order they are opened, not the
order in which
they were last activatated.  The first controller is not the activate
controller.  And while I can use activateController to to get the
current
controller and locate it in scheduledControllers, the one before or
after it is not necesarilly the previously active one.

It seems quite obvious that there is a way to accomplish this because
when the window is closed the previously active window is actiavted.  I
went pretty deep into the code and could not find where this is being
done.  And I now believe that VW has nothing to do with it.  I think VW
just closes the window and the OS picks the window to make activate.  If
it is a VW window then VW activates that window.  If its not a VW
window then VW doesn't have an activte window.  This may mean that VW
does not track the order of actvated windows and therefore cannot
accomplish what I am trying to do.

A solution for this problem would be nice but I doubt there is one.

Thanks,

Chris Lopeman
Object Link Inc.

Sent via Deja.com http://www.deja.com/
Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Window Raise ("raise") problem

2. Raise command and toplevel windows problem

3. raising toplevel window over the root window

4. VM crashes VW 3.1b and VW 3.1c, Windows 2000, Oracle 8.1.7.0

5. VW: Out of Memory Problem on Windows NT

6. VW/GS Remote SharedPageCache and Windows 2000 Advanced Server problem

7. VW starting problem on Windows nearly solved

8. serious problems with VW on Windows platform

9. VW 2.5.2a child window problem

10. VW/OW Windows version asImage problem(s)

11. VW : Dialog window size problem

12. Image fromUser problem (PP VW 1.0 on Windows 3.1)

 

 
Powered by phpBB® Forum Software