Click Here
home features news forums classifieds faqs links search
6155 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
22 crawler(s) on-line.
 95 guest(s) on-line.
 0 member(s) on-line.



You are an anonymous user.
Register Now!

/  Forum Index
   /  Amiga Development
      /  Reaction gadget question
Register To Post

PosterThread
thinkchip 
Reaction gadget question
Posted on 19-May-2013 12:46:15
#1 ]
Super Member
Joined: 26-Mar-2004
Posts: 1185
From: Salt Lake City, Utah, USA

I'm busy working on a Reaction-based UAE congifuration editor. I have a question for the developer community: How do you find out what font is used for gadgets? I need that to compute the size of buttons, list boxes, just about everything.

_________________
X5000 / microA1(OS4.1 FE U2) / CodeBench / Imagine / Blender
Lightwave 2019 / Microsoft Visual C++

 Status: Offline
Profile     Report this post  
thomas 
Re: Reaction gadget question
Posted on 19-May-2013 13:23:46
#2 ]
Super Member
Joined: 28-May-2003
Posts: 1155
From: Germany

@thinkchip

Quote:
I need that to compute the size of buttons, list boxes, just about everything.


No, you don't. ReAction does this for you.

_________________
Email: thomas-rapp@web.de
Home: thomas-rapp.homepage.t-online.de

 Status: Offline
Profile     Report this post  
broadblues 
Re: Reaction gadget question
Posted on 19-May-2013 13:43:00
#3 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4456
From: Portsmouth England

@thinkchip

As Thomas said ReAction / BOOPSI calculates these thngs for you, so what are you doing that makes you think you needto do it 'by hand'?

_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
thinkchip 
Re: Reaction gadget question
Posted on 19-May-2013 14:09:42
#4 ]
Super Member
Joined: 26-Mar-2004
Posts: 1185
From: Salt Lake City, Utah, USA

@broadblues

I'd like some control over the format of my window. Anyway, it's just a question. I'm not trying to make a bomb or something.

_________________
X5000 / microA1(OS4.1 FE U2) / CodeBench / Imagine / Blender
Lightwave 2019 / Microsoft Visual C++

 Status: Offline
Profile     Report this post  
Trixie 
Re: Reaction gadget question
Posted on 19-May-2013 14:29:25
#5 ]
Amiga Developer Team
Joined: 1-Sep-2003
Posts: 2119
From: Czech Republic

@thinkchip

Quote:
I'd like some control over the format of my window.

I think that once your gadgets become part of a layout, the size and position attribute tags that you OM_SET will be ignored, and all dimensions will be supplied by the controlling layout instead.

_________________
The Rear Window blog

AmigaOne X5000/020 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition

 Status: Offline
Profile     Report this post  
broadblues 
Re: Reaction gadget question
Posted on 19-May-2013 14:39:21
#6 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4456
From: Portsmouth England

@thinkchip

Quote:

I'd like some control over the format of my window.


You have alot of control over the window format / layout allready, perhapsgive us an example of what you are trying to do and we can advise on how to acheive it. It's not always obvious, and complex layouts often require nested layout gadgets.

Quote:

Anyway, it's just a question. I'm not trying to make a bomb or something.


Ofcourse, my question is to find out what you are wanting to do, so as to explain how to acheive it better.

_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
thomas 
Re: Reaction gadget question
Posted on 19-May-2013 14:45:46
#7 ]
Super Member
Joined: 28-May-2003
Posts: 1155
From: Germany

@thinkchip

Quote:

thinkchip wrote:
@broadblues

I'd like some control over the format of my window. Anyway, it's just a question. I'm not trying to make a bomb or something.



You can set the size of the window with WA_Width and WA_Height. Everything else should be done with CHILD_WeightedWidth, CHILD_WeightedHeight and CHILD_WeightMinimun.

I don't think there is a legal way to find out the font used for ReAction elements. And like already mentioned, there is no way to set the absolute size of a GUI element anyway.

_________________
Email: thomas-rapp@web.de
Home: thomas-rapp.homepage.t-online.de

 Status: Offline
Profile     Report this post  
broadblues 
Re: Reaction gadget question
Posted on 19-May-2013 14:45:59
#8 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4456
From: Portsmouth England

@Trixie

Quote:


I think that once your gadgets become part of a layout, the size and position attribute tags that you OM_SET will be ignored, and all dimensions will be supplied by the controlling layout instead.



Usually yes, but in special circumstances you can use


LAYOUT_NoLayout (BOOL) (V45)
Do not layout the children. All children must have valid
coordinates. Cannot be used with weight bars.

Defaults to FALSE.

Applicability is (OM_NEW, OM_SET, OM_GET)


But you should have agood reason to do so.

IIRC I used it in my SnakeEyes.py ProAction example, to aheive the correct layout of the displayed image (couldn't get the aspect ration right otherwise).

Last edited by broadblues on 19-May-2013 at 02:46 PM.

_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
thinkchip 
Re: Reaction gadget question
Posted on 20-May-2013 3:34:19
#9 ]
Super Member
Joined: 26-Mar-2004
Posts: 1185
From: Salt Lake City, Utah, USA

@broadblues

I have a list browser that will be used to select the main program functions, there are about twenty of them. It looks like it will do what I need. But I don't want it to change size when you resize the window and it has to all be visible all the time. (I know somebody won't be happy if they can't resize the window.)

If you do something like this, the size of the list box can't change.

LayoutObject,
LAYOUT_AddChild, ListBrowserObject,
(list browser definition)
End,
CHILD_MaxWidth, xsize,
CHILD_MinWidth, xsize,
CHILD_MaxHeight, ysize,
CHILD_MinHeight, ysize,
(more stuff)

If you know the font you can calculate the size of the box you need in pixels. That would be xsize and ysize. I don't think it matters if the other stuff moves around and changes size.

Last edited by thinkchip on 20-May-2013 at 03:40 AM.

_________________
X5000 / microA1(OS4.1 FE U2) / CodeBench / Imagine / Blender
Lightwave 2019 / Microsoft Visual C++

 Status: Offline
Profile     Report this post  
Xenic 
Re: Reaction gadget question
Posted on 20-May-2013 16:50:56
#10 ]
Super Member
Joined: 2-Feb-2004
Posts: 1246
From: Pennsylvania, USA

@thinkchip
Maybe something like:

result = GetGUIAttrs(NULL, myDrawInfo, GUIA_GadgetTextAttr, &myTextAttr, TAG_END);

would be useful?

_________________
X1000 with 2GB memory & OS4.1FE

 Status: Offline
Profile     Report this post  
broadblues 
Re: Reaction gadget question
Posted on 20-May-2013 20:45:08
#11 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4456
From: Portsmouth England

@thinkchip

CHILD_WeightedWidth,0,

should take care of that. Without you needing to calculate anything yourself.

Possibly in combination with CHILD_NominalSize,TRUE,

Last edited by broadblues on 20-May-2013 at 08:45 PM.

_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
broadblues 
Re: Reaction gadget question
Posted on 20-May-2013 20:48:54
#12 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4456
From: Portsmouth England

@broadblues

BTW if you must use

CHILD_MinWidth,width,
CHILD_MAxWidth,width,

dont.

Instead, do


CHILD_MinWidth,width,
CHILD_WeightedWidth,0,

same effect but more efficient.

_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
thinkchip 
Re: Reaction gadget question
Posted on 27-May-2013 19:24:52
#13 ]
Super Member
Joined: 26-Mar-2004
Posts: 1185
From: Salt Lake City, Utah, USA

@thinkchip

Another question: If you do a "DisposeObject(*object)" on a window object, does it automatically dispose of layout objects and gadget objects that are attached to it? If it does, it would save me a lot of bother.

_________________
X5000 / microA1(OS4.1 FE U2) / CodeBench / Imagine / Blender
Lightwave 2019 / Microsoft Visual C++

 Status: Offline
Profile     Report this post  
broadblues 
Re: Reaction gadget question
Posted on 27-May-2013 19:58:41
#14 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4456
From: Portsmouth England

@thinkchip
Quote:

Another question: If you do a "DisposeObject(*object)" on a window object, does it automatically dispose of layout objects and gadget objects that are attached to it? If it does, it would save me a lot of bother.


Yes it does. Strictly speaking it disposes of the top level layout gadget, then that gadget disposes of any children it has, and so on.

In special cases you can mark child objects to be *not* disposed off, with the CHILD_NoDispose (think I got the name right) tag.

_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
thinkchip 
Re: Reaction gadget question
Posted on 30-May-2013 17:52:41
#15 ]
Super Member
Joined: 26-Mar-2004
Posts: 1185
From: Salt Lake City, Utah, USA

@thread

Another question related to the last one:

You can change the layout of the window by doing this:

result = IIntuition->SetAttrs(objects[OID_WINDOW], WINDOW_Layout, newlayoutobject, TAG_END);

Does it do a "dispose object" on the old layout object (along with all of the attached stuff)? Is this a good way to do it?


_________________
X5000 / microA1(OS4.1 FE U2) / CodeBench / Imagine / Blender
Lightwave 2019 / Microsoft Visual C++

 Status: Offline
Profile     Report this post  
broadblues 
Re: Reaction gadget question
Posted on 30-May-2013 22:57:39
#16 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4456
From: Portsmouth England

@thinkchip

Quote:

You can change the layout of the window by doing this:

result = IIntuition->SetAttrs(objects[OID_WINDOW], WINDOW_Layout, newlayoutobject, TAG_END);

Does it do a "dispose object" on the old layout object (along with all of the attached stuff)? Is this a good way to do it?


I don't know if it does or not. The autodocs don;t say that it does, so intialy I would assume it doesn't.

You could always test this by creating a window, adding alayout, removing it, then disposing of the layout. If it's been disposed of allready it will crash pretty quickly!

However I wouldn't use that approach, the safer way to modify window contants (whilst the window is open) is add a containing top level layout, then use the methods LM_ADDCHILD, LM_MODIFYCHILD LM_REMOVECHILD etc to safely add or replace your actual dynamic layouts.

Also consider page.gadget

To give more specific advice, I'd need nmore details on why you want to swap window layouts, and how you want it to work. Is it create pages?


Last edited by broadblues on 30-May-2013 at 10:58 PM.

_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
thinkchip 
Re: Reaction gadget question
Posted on 11-Jun-2013 10:42:03
#17 ]
Super Member
Joined: 26-Mar-2004
Posts: 1185
From: Salt Lake City, Utah, USA

@thread

I need a Reaction slider gadget to control the E-UAE floppy emulation speed (among other things). Next to it I want a text field that shows the current setting as you slide the gadget back and forth. According to my research, you need a hook for this. There are facets of this that aren't really obvious. I wonder if somebody could point me to a programming example.

Regarding the previous discussion: I haven't been able to get the Reaction gadget font. Like somebody said, it might not be possible. However, there are other ways to do what I wanted to do.

Last edited by thinkchip on 11-Jun-2013 at 10:46 AM.

_________________
X5000 / microA1(OS4.1 FE U2) / CodeBench / Imagine / Blender
Lightwave 2019 / Microsoft Visual C++

 Status: Offline
Profile     Report this post  
Trixie 
Re: Reaction gadget question
Posted on 11-Jun-2013 11:03:42
#18 ]
Amiga Developer Team
Joined: 1-Sep-2003
Posts: 2119
From: Czech Republic

@thinkchip

Quote:
I need a Reaction slider gadget to control the E-UAE floppy emulation speed (among other things). Next to it I want a text field that shows the current setting as you slide the gadget back and forth. According to my research, you need a hook for this.

No, you normally don't need a hook for that. You need to specify SLIDER_LevelFormat with a C-style formatting string, and SLIDER_LevelMaxLen with the maximum length (in characters) of the displayed value (the default is 3). For example, to display an integer value next to the slider you'd specify

SLIDER_LevelFormat, "%ld",

in your slider gadget definition. If you want to display a numeric value together with a unit, you can also do that through the formatting string:

SLIDER_LevelFormat, "%ld sec.",

Displaying string values is also possible:

SLIDER_LevelFormat, "%s",

but as the slider only works with integer values, you'll need to setup a hook to convert the number into the string.

Last edited by Trixie on 11-Jun-2013 at 11:25 AM.
Last edited by Trixie on 11-Jun-2013 at 11:08 AM.

_________________
The Rear Window blog

AmigaOne X5000/020 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition

 Status: Offline
Profile     Report this post  
thinkchip 
Re: Reaction gadget question
Posted on 1-Jul-2013 14:08:33
#19 ]
Super Member
Joined: 26-Mar-2004
Posts: 1185
From: Salt Lake City, Utah, USA

@thread

This is a question involving program performance. When my UAE configuration editor EasyUAE is running, the computer slows down like EasyUAE is busy doing something. Does IDoMethod(object, WM_HANDLEINPUT, mess) stop and wait or does it skip by if there isn't a message? Any idea why the code below would gobble CPU cycles and how it could be improved?

while(!endit)
{
result = IIntuition->IDoMethod(objects[OID_WINDOW], WM_HANDLEINPUT, &messg);
gadid = result & WMHI_GADGETMASK;
result &= WMHI_CLASSMASK;
if(result == WMHI_CLOSEWINDOW)
{
endit = TRUE;
}
else if(result == WMHI_GADGETUP)
{
if(gadid >= FLP_CHECK1 && gadid = HD_LIST && gadid

_________________
X5000 / microA1(OS4.1 FE U2) / CodeBench / Imagine / Blender
Lightwave 2019 / Microsoft Visual C++

 Status: Offline
Profile     Report this post  
thomas 
Re: Reaction gadget question
Posted on 1-Jul-2013 14:56:52
#20 ]
Super Member
Joined: 28-May-2003
Posts: 1155
From: Germany

@thinkchip

Quote:
Does IDoMethod(object, WM_HANDLEINPUT, mess) stop and wait or does it skip by if there isn't a message?



WM_HANDLEINPUT returns immediately if there is nothing to do. You have to Wait() for the signals returned by GetAttr(WINDOW_SigMask).

_________________
Email: thomas-rapp@web.de
Home: thomas-rapp.homepage.t-online.de

 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