Lars
Many thanks for the perfect solution. I have never used the window menu
handlers before. Now I see how useful they are. Thanks for your
guidance.
Barrie
On Nov 27, 2004, at 1:28 PM, Lars Jensen wrote:
In response to a menu "Print..." selection the program needs to know
what to
print...
The conventional way to do this is: within each window that can be
printed,
add a menu handler for the Print menu item. (Make sure "AutoEnable" is
set
for this menu item.)
Iterating throught the windows is also possible, but there are
gotchas, such
as dialogs or floating windows that you might not know about. It would
look
something like this:
dim i as integer
for i = 0 to WindowCount-1
if Window(i) isA Window1 then
PrintMyWindow1 Window1(Window(i)) // cast to a Window1
exit // stop looping
elseif Window(1) isA Window2 then
PrintMyWindow2 Window2(Window(i)) // cast to a Window2
exit // stop looping
...
end if
next
Avoiding all this messiness is a good reason to go with the menu
handler in
each window.
lj
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|