-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.3i
mQBtAzNbtlwAAAEDAOsilyHKFPvoEV0ZCb2jIiGChE1W1PNmR23qFeKA/qrwrWuU
uY7dkgRf+RetV8OT0G9wJCZE1eZt5LqLVhI5oOTd2w2cOBHz+HguVHNJ/sPQ5x6q
aC6heD2iT7dQ0YfMsQAFEbQdVmlydHVhbCBDb3dib3kgdmljdGhjQGlibS5uZXSJ
AHUDBRAzW7Zdok+3UNGHzLEBAd7nAv9A5HmpaHmX/ccQTZEALe3olMvMR5nw5+Y7
6kBHlWxFCVMbbXL+KPiuc0sa+pfoLJZpyDtPXPS+X4sgdneb6JIoL7kD1PIBamAE
nDay87lcUgHv36M0f03xomNNV6H+DEU=
=X+2D
-----END PGP PUBLIC KEY BLOCK-----
Virtual Cowboy wrote:
>2) How can I get the width of the default font which is set in my window
> in pixels ?
Read the font structure for the average width, but usually you check the
string length before you print it with f.ex. TextLength() in
graphics.library. This is more useful with proportional fonts. You could
also use the TextExtent() function for more complex usage.
>3) How can I let this Zzz... bubble (Busy-pointer)... Is there a special
> function, which loads the default pointer from ENV... or do I have to
> load it 4 myself ?
You can use the intuition.library function SetWindowPointer()
(snipped and shortened autodoc reference follows)
NAME
SetWindowPointer -- Varargs stub for SetWindowPointerA(). (V39)
SYNOPSIS
SetWindowPointer( window, taglist )
A0 A1
FUNCTION
Allows you to set the pointer image associated with the
specified window. Whenever the window is the active one,
the pointer image will change to the window's version.
If the window is the active one when this routine is
called, the change takes place immediately.
TAGS
WA_Pointer (APTR) - The pointer you wish to associate with
your window. If NULL, you are requesting the Preferences
default pointer. Custom pointers should be allocated
by performing a NewObject() on "pointerclass".
(See <intuition/pointerclass.h>). Defaults to NULL.
WA_BusyPointer (BOOL) - Set to TRUE to request the Preferences
busy-pointer. If FALSE, your pointer will be as requested
by WA_Pointer. Defaults to FALSE.
WA_PointerDelay (BOOL) - Set to TRUE to defer changing your
pointer for a brief instant. This is typically used
along with setting the busy pointer, especially when
the application knows it may be busy for a very short
while. If the application clears the pointer or sets
another pointer before the delay expires, the pending
pointer change is cancelled. This reduces short
flashes of the busy pointer.
You use it like this:
LibBase intuition ;move.l IntBase(pc),a6
move.l WinB(pc),a0 ;ptr. to your window
lea PointerTags(pc),a1 ;ptr. to taglist
Call SetWindowPointer ;call function
[...]
PointerTags
dc.l WA_BusyPointer,-1
dc.l WA_PointerDelay,-1
dc.l 0,0
---
Kenny mailto:ke...@bgnett.no ''"\./"`` http://www.bgnett.no/~kenny/
- Developer/Digital Surface | (opinions by me are my own!)
---
Hi there... I'm only answering the first question, since Kenny was faster
than me with the second and third, and nothing must be added...
>Hi... I've got some questions to Intuition and asm...
>1) How can I activate a gadget via Software (make a Bool-Gadget be pressed, not
> the same as ActivateGadget()... Really press it... But not with the mouse...)
Without "higher magic"... no way. However, depends a bit about which type of
gadgets you're talking:
i) Toggle gadgets: They can be turned on by hand: Remove the gadget from the
list, set the activation flag by hand (see intuition/intuition.h for the
definition of the flag, as I forgot the name), add it to the list and refresh
the gadget(s).
Toggle gadgets should be implemented with two alternative images,
as all other implementations might cause some trouble with the refresh. See the
RKRMs library volume for more caveats...
ii) Boolean gadgets without any toggle: Well, unless you want to do some
REAL magic, no way. You have to add some special code to your program to
simulate a gadget press. This shouldn't be too hard for a standard intuition
GUI implementation. If there is ABSOLUTELY no other way, here's a not-so-quick-
but-still-dirty way to do it: Open the input.device and send the required
input events to move the mouse over the button, pressing the button and
releasing again. This might be VERY confusing to the user, so I would say
this is the absolutely LAST possibility one should consider...
I would still suggest something like the following: If, say, you want to
activate the gadget with a special key, write:
i) a routine that handles the gadget down event.
ii) parse the IDCMPMessage you got from intuition. If it's GadgetUp with the
right ID, call your routine I mentioned above.
iii) If it's IDCMP_RawKey and the key fits, call the routine as well.
This is the LEGAL way to implement this sort of stuff.
Greetings,
Thomas
______________don't_cut_here,_it_could_damage_your_terminal____________________
_______ _____ _____
/ / / / / / / EMAIL: th...@einstein.math.tu-berlin.de
/ /____/ / / /____/
/ / / / / / \ http://www.math.tu-berlin.de/~thor/thor/index.html
/ / / /____/ / /
_______________________________________________________________________________
You need a dirty hack for that. Cause a fake input event. If you
don't know exactly what I mean, keep your hands off that. Otherwise
read the RKRM's chapter about input.device.
> 2) How can I get the width of the default font which is set in my window in
> pixels ?
In C:
width=window->IFont->tf_XSize
In asm:
move.l windowptr,a0
move.l IFont(a0),a0
move.w tf_XSize(a0),d0
This works for fonts with a fixed width only, of course. This is not
the system default font, it's the default window font, AFAIK used for the title
bar, menus etc. Another font structure can be found in the window's RastPort:
In C:
window->RPort->Font->tf_XSize
In asm:
move.l windowptr,a0
move.l RPort(a0),a0
move.l Font(a0),a0
move.w tf_XSize(a0),d0
Don't forget to include the proper .i files.
> 3) How can I let this Zzz... bubble (Busy-pointer)... Is there a special
> function, which loads the default pointer from ENV... or do I have to load
> it
> 4 myself ?
The Zzz pointer is owned by Workbench. It cannot be accessed legally
by other programs, so you have to create your own one with
SetWindowPointer(). This function can only be used in conjunction
with a window BTW, i.e. the pointer only has the desired shape when
the window you define a custom mouse pointer for is active.
Greetings
--
Christian Wasner (CRISI/PHANTASM)
Christia...@hamburg.netsurf.de
Q: How do I get the X11 sources ?
A: Post DPaint2 into comp.sys.amiga.misc.
: You need a dirty hack for that.
Not neccesarily true - BOOPSI gadgets can be told to draw themselves, in
selected state, or unselected state. If they're yours, that is....
--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac |My opinions aren't those of Aberdeen |Amiga -
ky...@4u.net ky...@hotmail.com |University or AUCC, thankfully.***** |always!
--
Random sig of the day:
BONUS: Present this .sig at Tesco for a 15% discount.
>: You need a dirty hack for that.
> Not neccesarily true - BOOPSI gadgets can be told to draw themselves, in
> selected state, or unselected state. If they're yours, that is....
I don't think that changing the look of the gadget is the problem
(which is trivial). The problem is emulating a mouse click, so that
the computer thinks the LMB was pressed. This needs a dirty hack like
causing a fake input event.