Article View: comp.sys.amiga.tech
Article #6985Re: Large WB & Requesters
From: Jean-Michel Forgeas
Date: Sat, 24 Nov 1990 15:22
Date: Sat, 24 Nov 1990 15:22
104 lines
4905 bytes
4905 bytes
In article <487005@neabbs.UUCP>, RONALD VAN EIJCK writes:
> My only problem is that if Intuition gives me a requester or if I open
> a tool (prefs etc.) that these open in the top left part of my WB. and since
> [...]
> My question is: Is it possible to open these window's relative to the position
> of the WB that I am looking at ?
-Do a SetFunction on OpenWindow(), OpenWindowTag(), ...
-Test if the window opens outsize your looking area
-If not replace it inside!
To know your looking area you can take help from this piece of code.
You can use this code into your programs (commercial or not) but I do
not give you the right to have money from this only code. I am the
only person who may send this listing to a magazin, a net, or write it
into a book.
I hope that future applications (even WBench :) will be user-friendly
enough so that they will not open outside the looking area.
Yes, there is too many things to take care with the new system, or that
we have to do ourself (be careful with the WBench font height, that does
often bad things with applications menus).
#include <exec/types.h>
#include <intuition/intuition.h>
#include <intuition/screens.h>
#include <graphics/displayinfo.h>
ULONG GetBoxFromScreen( LScreen, Box, all, OverScan )
struct Screen *LScreen;
struct IBox *Box;
ULONG all, OverScan;
{
ULONG vpmid;
struct DimensionInfo di;
struct Rectangle *rect;
Box->Left = Box->Top = 0;
if ((vpmid = GetVPModeID( &LScreen->ViewPort )) != INVALID_ID)
{
if (all)
{ Box->Width = LScreen->Width; Box->Height = LScreen->Height; }
else{
GetDisplayInfoData( 0, &di, sizeof(struct DimensionInfo), DTAG_DIMS, vpmid );
switch (OverScan)
{
case OSCAN_TEXT: rect = &di.TxtOScan; break;
case OSCAN_STANDARD: rect = &di.StdOScan; break;
case OSCAN_MAX: rect = &di.MaxOScan; break;
case OSCAN_VIDEO: rect = &di.VideoOScan; break;
default: rect = &di.Nominal; break;
}
Box->Width = rect->MaxX - rect->MinX + 1;
Box->Height = rect->MaxY - rect->MinY + 1;
Box->Left = LScreen->LeftEdge < 0 ? -LScreen->LeftEdge : 0;
Box->Top = LScreen->TopEdge < 0 ? -LScreen->TopEdge : 0;
}
}
return( vpmid );
}
extern ULONG IntuitionBase, GfxBase;
void main()
{
struct Screen *ls;
ULONG vpmid;
struct IBox Box;
if (IntuitionBase = OpenLibrary( "intuition.library", 36 ))
{
if (GfxBase = OpenLibrary( "graphics.library", 36 ))
{
if (ls = LockPubScreen( "Workbench" ))
{
printf("BarHeight=%ld\n",ls->BarHeight);
if ((vpmid = GetBoxFromScreen( ls, &Box, 0, 0 ) ) == INVALID_ID)
printf("INVALID_ID\n");
else{
printf("nominal: l=%ld, t=%ld, w=%ld, h=%ld\n", Box.Left, Box.Top, Box.Width, Box.Height );
GetBoxFromScreen( ls, &Box, 0, OSCAN_TEXT );
printf("ostext: l=%ld, t=%ld, w=%ld, h=%ld\n", Box.Left, Box.Top, Box.Width, Box.Height );
GetBoxFromScreen( ls, &Box, 0, OSCAN_STANDARD );
printf("osstd: l=%ld, t=%ld, w=%ld, h=%ld\n", Box.Left, Box.Top, Box.Width, Box.Height );
GetBoxFromScreen( ls, &Box, 0, OSCAN_VIDEO );
printf("osvideo: l=%ld, t=%ld, w=%ld, h=%ld\n", Box.Left, Box.Top, Box.Width, Box.Height );
GetBoxFromScreen( ls, &Box, 0, OSCAN_MAX );
printf("osmax: l=%ld, t=%ld, w=%ld, h=%ld\n", Box.Left, Box.Top, Box.Width, Box.Height );
GetBoxFromScreen( ls, &Box, 1, 0 );
printf("all: l=%ld, t=%ld, w=%ld, h=%ld\n", Box.Left, Box.Top, Box.Width, Box.Height );
}
UnlockPubScreen( 0, ls );
}
CloseLibrary( GfxBase );
}
CloseLibrary( IntuitionBase );
}
exit(0);
}
--
\___/
Jean-Michel Forgeas \-/
cbmvax!cbmehq!cbmfra!swinjm!forgeas | The Software Winery
-^-
And, where is the universe ?
Technical Details
Message-ID:
<1842513e.ARN02387@swinjm.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cbmvax!cbmehq!cbmfra!swinjm!forgeasReferences:
<487005@neabbs.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cbmvax!cbmehq!cbmfra!swinjm!forgeas From: forgeas@swinjm.UUCP (Jean-Michel Forgeas) Newsgroups: comp.sys.amiga.tech Subject: Re: Large WB & Requesters Message-ID: <1842513e.ARN02387@swinjm.UUCP> Date: 24 Nov 90 15:22:38 GMT References: <487005@neabbs.UUCP> Reply-To: forgeas@swinjm.UUCP (Jean-Michel Forgeas) Followup-To: comp.sys.amiga.tech Organization: The Software Winery Lines: 104