Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
95 user(s) are online (80 user(s) are browsing Forums)

Members: 1
Guests: 94

VooDoo, more...

Support us!

Headlines

 
  Register To Post  

Finding window postition
Home away from home
Home away from home


See User information
How do you find the postion of the window? From my main window, when i am about to open a new one, i need to find the postion of it, so i can place the new one in front of it. But how? And is it possible to lock the main window, so it can't be moved until the new one has been closed?


X5000
Go to top
Re: Finding window postition
Home away from home
Home away from home


See User information

Quote:

How do you find the postion of the window? From my main window, when i am about to open a new one, i need to find the postion of it, so i can place the new one in front of it. But how?


For a Reaction Window.

IIntuition->GetAttrs(skprj->sp_SW.sw_Window,    WA_Width,&width,
                                                           
WA_Height,&height,
                                                           
WA_Left,&left,
                                                           
WA_Top,&top,
                                                
TAG_DONE);


Also for Reaction windows checkout the WINDOW_Position, WPOS_CENTERWINDOW flag

Fot a plain intuition window use

GetWindowAttrs() instead, same tags

Quote:

And is it possible to lock the main window, so it can't be moved until the new one has been closed?


Not so sure about that one, many of the attribues that affect window arranging can only be set an window open / NewWindow time, so this may not be possible. Depending on your context your might set your new window to a Stay Top window. But only do that if you have agood reason.










Go to top
Re: Finding window postition
Just can't stay away
Just can't stay away


See User information
Quote:
Antique wrote:
And is it possible to lock the main window, so it can't be moved until the new one has been closed?
You may be able to prove me wrong, but I doubt it: There is no reason whatsoever that I can think of that will justify forcing such a position-lock on your user. All windows should always be free to be placed like the user wants, not like the programmer thinks the user wants.

It can be quite reasonable to deactivate your main window (so it won't process any input) while your new window is active, and it may even sometimes be a good idea to make your new window a stay-on-top window to make sure it is always visible as long as it is active. But there is no reason why the user shouldn't be able to move either window to one or the other side as she wishes, in order to be able to see content in the main window e.g. for reference while inputting in the new window, or just because she wants to (even if you, the programmer, has not foreseen the reason why she wants to).

So basically: forget it. There are good reasons why it is not an option in AmigaOS.

Best regards,

Niels

Go to top
Re: Finding window postition
Just popping in
Just popping in


See User information
@nbache

I completely agree with everything you say. Forcing UI control like that is a quick way to get your program uninstalled. The position of windows should be under the control of the user. It is their Workbench after all, not the developer's ... however there is a way to prevent moving the window. Just don't provide a drag bar, though that would be in place for the window's entire duration.

Go to top
Re: Finding window postition
Just popping in
Just popping in


See User information
@Antique

Are you trying to do a requester similar to the way it's done on MacOS X where the requester might not fit entirely in the parent window?

Go to top
Re: Finding window postition
Home away from home
Home away from home


See User information
@Steady
Actually such a window without a dragbar can still be moved by pressing LAmiga Ctrl and left click/ drag with the mouse.

@Antique

Some deeper hints as to your ultimate goal would help us give you better advice.


Go to top
Re: Finding window postition
Home away from home
Home away from home


See User information
@broadblues

I ended up using WINDOW_Position, WPOS_CENTERMOUSE.
I'm letting the user click on a picutre, and then i size it up. Butbefore the user can then do anything more on main window. He has to close the newly opened window. This has been the reason for my little porblem. And since he has to click on the picture, i can just open it below the pointer. I will let the user be able to move the main window. But it has been disabled until picture has been closed again. Hope this gives any meaning at all

X5000
Go to top
Re: Finding window postition
Just popping in
Just popping in


See User information
@broadblues

Oh, I didn't realise that ... handy.

Go to top
Re: Finding window postition
Just can't stay away
Just can't stay away


See User information
@broadblues

It doesn't matter which amiga key you use they both work.

Amiga user since 1985
AOS4, A-EON, IBrowse & Alinea Betatester

Ps. I hate the new amigans website. <shudder>
Go to top
Re: Finding window postition
Home away from home
Home away from home


See User information
@Severin

Oh yeah, never noticed that.


Go to top
Re: Finding window postition
Not too shy to talk
Not too shy to talk


See User information

@Antique:

You could close the picture window when the user moves the mouse out of the window boundaries. Then he does not need to click on the picture to close it.



Go to top
Re: Finding window postition
Home away from home
Home away from home


See User information
@thomas

That is an option yes. I will ask some betatesters what they think about it.

X5000
Go to top
Re: Finding window postition
Quite a regular
Quite a regular


See User information
@Antique

Instead of locking the main window (like windoze does which drives me crazy on a daily basis! ) you can make the popup window follow the main window by listening to some window move signals on the main window and then perform a MoveWindow(?) on the popup to make it follow.

Software developer for Amiga OS3 and OS4.
Develops for OnyxSoft and the Amiga using E and C and occasionally C++
Go to top
Re: Finding window postition
Just can't stay away
Just can't stay away


See User information
But still, I don't see any reason why the two windows cannot be moved independently.

Antique did already earlier agree to this and was planning to allow the main window to be moved, but to let it be disabled (and ghosted, I hope?) until the child window is closed. This, I believe, is the correct and user-friendly decision.

Best regards,

Niels

Go to top
Re: Finding window postition
Home away from home
Home away from home


See User information
What i now have done is that the newly window can not be moved. The main window can be moved but is disabled until the new window is closed. Seems like the best way i think.

X5000
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 2 ( 0 members and 2 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project