Click Here
home features news forums classifieds faqs links search
6071 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
9 crawler(s) on-line.
 141 guest(s) on-line.
 0 member(s) on-line.



You are an anonymous user.
Register Now!
 matthey:  14 mins ago
 Hammer:  28 mins ago
 billt:  1 hr 17 mins ago
 Rob:  2 hrs 17 mins ago
 amigakit:  2 hrs 28 mins ago
 DiscreetFX:  2 hrs 46 mins ago
 Matt3k:  3 hrs 1 min ago
 OlafS25:  3 hrs 12 mins ago
 RobertB:  4 hrs 52 mins ago
 A1200:  4 hrs 59 mins ago

/  Forum Index
   /  Amiga Development
      /  Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Register To Post

PosterThread
Vanhapolle 
Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 7:34:42
#1 ]
Regular Member
Joined: 22-Sep-2014
Posts: 372
From: Unknown

which is best way get mouse cordinates for one speffic window. way where 0,0 is top point of window way where area which is in window borders first point in left and top is 0,0. and way where code or operating system cares different border sizes itself. is related doing "Painting" window. or is this way for AmigaOS4.1 what which cares such a thing:
http://wiki.amigaos.net/wiki/Intuition_Mouse

 Status: Offline
Profile     Report this post  
Vanhapolle 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 7:40:25
#2 ]
Regular Member
Joined: 22-Sep-2014
Posts: 372
From: Unknown

Thing what is i need seems GZZ mouse coordinates what i get how? if i understand correctly. But now must think how i can read such values only when window what i want this info is active i think there is maybe intuimessage which tells window is active ? at least older amigaoses if quickly look have such thing. and then window isactive i read coordinates when all is fine... only thing is this kind mousecordinates available?

Last edited by Vanhapolle on 19-Dec-2014 at 07:59 AM.

 Status: Offline
Profile     Report this post  
jacadcaps 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 8:01:28
#3 ]
Regular Member
Joined: 20-Nov-2007
Posts: 203
From: Canada

@Vanhapolle

GimmeZeroZero changes how the window is handled in terms of drawing - and I will always recommend against using it. To get 0,0 based coords, simply substract window->Left/Top edges from the coords you get in the IDCMP.

 Status: Offline
Profile     Report this post  
jacadcaps 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 8:03:45
#4 ]
Regular Member
Joined: 20-Nov-2007
Posts: 203
From: Canada

@Vanhapolle

Well... are you trying to obtain infos about a window that you do not control?

If not, yes, there's IDCMP_ACTIVEWINDOW or so.

Perhaps if you've explained what you're trying to achieve, it'd be easier to help you.

 Status: Offline
Profile     Report this post  
Vanhapolle 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 8:13:27
#5 ]
Regular Member
Joined: 22-Sep-2014
Posts: 372
From: Unknown

@jacadcaps

you mean window->Left i subtract such value form x coordinate and window->Top foem y coordinate?
and there window is stuff what window opening functions gives me when window is opened ? fine if wokrs this way.

Last edited by Vanhapolle on 19-Dec-2014 at 08:13 AM.

 Status: Offline
Profile     Report this post  
Vanhapolle 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 8:17:40
#6 ]
Regular Member
Joined: 22-Sep-2014
Posts: 372
From: Unknown

@jacadcaps

If i understand you correctly my one my program window when is active i want coordinates for just this window is going painting window of graphics program.
Other windows are fpr example selecting brush etc.

 Status: Offline
Profile     Report this post  
itix 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 10:01:51
#7 ]
Elite Member
Joined: 22-Dec-2004
Posts: 3398
From: Freedom world

@Vanhapolle

It would be lot easier if you were not using such low level APIs.

_________________
Amiga Developer
Amiga 500, Efika, Mac Mini and PowerBook

 Status: Offline
Profile     Report this post  
jacadcaps 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 10:08:45
#8 ]
Regular Member
Joined: 20-Nov-2007
Posts: 203
From: Canada

@Vanhapolle

First of all, if you use default window open options, each window has its own UserPort, so when a IDCMP arrives you know the window by the port - there's also a window pointer in the IntuiMessage itself so you can use that and figure out if your window is active by checking for the WLFG_ACTIVE or so flag in window->Flags field.

 Status: Offline
Profile     Report this post  
Vanhapolle 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 10:29:54
#9 ]
Regular Member
Joined: 22-Sep-2014
Posts: 372
From: Unknown

@itix

How you then solve window in MOS where i have bitmap which i can update after opening window? and get mouse place which i can use to paint tools whicjh modify this bitmap. And i say MOS becouse i understading you mainly know current MOS coding.
ps. btw very likely my project is going AOS4.1 becouse i dont have maybe skills maintain all platforms and some tools work poorer (Photogenics 1.2a at least yester day worked oddly i look soon again) wtih MOS3.7 than MOS1.4.5 which i also need.:(
ps. my project is still trying need these old Photoenics form software what i need. But verylikely i cannot remove all points use of it.

Last edited by Vanhapolle on 19-Dec-2014 at 10:32 AM.

 Status: Offline
Profile     Report this post  
itix 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 10:46:41
#10 ]
Elite Member
Joined: 22-Dec-2004
Posts: 3398
From: Freedom world

@Vanhapolle

If you use low leve API then you just substract window LeftEdge/TopEdge and bitmap drawing location from mouse coordinates. But Jaca already explained this stuff to you and he knows Intuition better than anyone else here.

In MUI it is easier but since you are not using it I am not going to explain it.

Last edited by itix on 19-Dec-2014 at 10:47 AM.
Last edited by itix on 19-Dec-2014 at 10:46 AM.

_________________
Amiga Developer
Amiga 500, Efika, Mac Mini and PowerBook

 Status: Offline
Profile     Report this post  
Vanhapolle 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 11:09:17
#11 ]
Regular Member
Joined: 22-Sep-2014
Posts: 372
From: Unknown

@itix

Who knows what i going use? i am not sure yet. When i have time and AmigaOS4.1 i can compare is Reaction or MUI easier for me.
ps. MOS native coding is thing what i maybe also test soon. and to Mos i bet i going use MUI.

 Status: Offline
Profile     Report this post  
Vanhapolle 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 11:15:31
#12 ]
Regular Member
Joined: 22-Sep-2014
Posts: 372
From: Unknown

Even is hard get info how MUI differens different platforms. and what else often important (all differencies is hard know) differencies are than memory allocation.

 Status: Offline
Profile     Report this post  
broadblues 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 11:36:34
#13 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4446
From: Portsmouth England

@Vanhapolle

Get them from the Window structure. Then adjust the coordinates by the offset of the gadget you are drawing into.

You need to transpose those coordinates in to "project space" too if you support and scrolling or zooing in your image processing program.

Don't use a GMMIZEROZERO window unl;ess you got a very good reason.

_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
Vanhapolle 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 12:31:17
#14 ]
Regular Member
Joined: 22-Sep-2014
Posts: 372
From: Unknown

Is VERY hard wait AmigaOS4.1 Final edition.
ps. of course i can code classic AmigaOS and Morphos but becouse they work so different way i think coding them not help learn AOS4.1 coding not at least things what i now want mainly check. At least when Reaction coding is different and i understanded even mui have differencies beetween all these systems.
And what i quickly looked MOS MUI docs bitmap/image classes are unsuitable for this special use. hard describe better. Maybe reaction Image element works.

Last edited by Vanhapolle on 19-Dec-2014 at 12:42 PM.

 Status: Offline
Profile     Report this post  
itix 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 12:55:33
#15 ]
Elite Member
Joined: 22-Dec-2004
Posts: 3398
From: Freedom world

@Vanhapolle

MUI bitmap and image classes are meant to display images but are not designed for use for image drawing. You need a custom class for that where you render graphics to display area using your own code.

_________________
Amiga Developer
Amiga 500, Efika, Mac Mini and PowerBook

 Status: Offline
Profile     Report this post  
Robert 
Re: Mouse coordinates (again AmigaOS3.0-3.9,AmigaOS4.1 ,and MorphOS)
Posted on 19-Dec-2014 15:00:30
#16 ]
Cult Member
Joined: 10-Mar-2003
Posts: 879
From: Glasgow

@Vanhapolle

Quote:
Is VERY hard wait AmigaOS4.1 Final edition.


Well, in light of today's announcement, hopefully not *too* much longer now.

I'm hoping to take more of a dabble in Amiga programming when I get 4.1 too.
I tried to get into it with 4.0 but found the tools/resources available quite limited and my interest petered out.

The resources for 4.1 seem a bit more comprehensive so I'll take another look and see if I can learn something.

_________________
Robert
--
A1XE G4, OS4.1. Peg1 G3, MOS 1.4.
Abel Soul - Check out our tunes on Spotify

 Status: Offline
Profile     Report this post  

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle