Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Seeing if turing window is top on screen?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Fexter




PostPosted: Tue Mar 20, 2012 10:08 pm   Post subject: Seeing if turing window is top on screen?

What is it you are trying to achieve?
I want to find if my Turing program is on top of the screen, so that I can only have it detecting mouse clicks if I am running the window.


What is the problem you are having?
I have a program that's proceeding after finding a mouse click, thinking it was on the Turing window, even if I have the window minimized and have gone to a different window.


Describe what you have tried to solve this problem
I tried looking for anything that would be capable of doing this, but couldn't find anything.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

Turing:


var curX, curY, curZ : int

procedure waitForButtonDown(var x,y,z : int)

loop

Mouse.Where(x, y, z)
% if Window.IsTop(defWinId) then %
exit when z not= 0

end loop

end waitForButtonDown

loop

waitForButtonDown(curX, curY, curZ)

drawfilloval(curX, curY, 5, 5, black) % This is running even if the window is minimized, so going back to it makes a mess on the screen

end loop



Please specify what version of Turing you are using
I am using Turing 4.1.
Sponsor
Sponsor
Sponsor
sponsor
Dreadnought




PostPosted: Wed Mar 21, 2012 12:25 am   Post subject: Re: Seeing if turing window is top on screen?

What you're looking for is in the windowmodule, the window that is "on top" is called the "active" window. You can check if the Turing window is the active window and you can also set the active window.
Raknarg




PostPosted: Wed Mar 21, 2012 10:24 am   Post subject: RE:Seeing if turing window is top on screen?

Window.GetActive
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: