Home   News   Concept   AMIGA-Compatible   Hardware   Forum   Questions+Answers   Pictures   Contact & Team

Welcome to the Natami / Amiga Forum

This forum is for AMIGA fans interested in the new NATAMI platform.
Please read the forum usage manual.


All TopicsNewsQAFeaturesTalkTEAMLogin to post    Create account
Welcome to the Natami lounge.
Meet new AMIGA friends here and enjoy having a friendly chit chat.

How Many People In the NATAMI Team?page  1 2 3 4 5 6 7 8 
Gone Gahgah
Australia

Posts 224
17 Feb 2010 11:58


At the moment my menu system still relies on Intuition for their handling.  I'm thinking that I will move to taking over most of that handling.

I already bypass the Intuition checkmark by setting the window checkmark to null.image which draws nothing and then draw my own checkmarks.

The reason I did this was that Intuition insists on drawing the checkmarks next to the left edge and I want to be able to have icons down the left instead.  So the checkmark had to be able to move over when there were icons present.

I'm currently thinking on the best way to take over greater control.
Normally intuition won't talk to the menu items until they need to change between selected or unselected or change check status.  When this happens it tells the menu items to draw themselves.

Mind you intuition stupidly, when the check status changes, tells the menu item to redraw itself first then updates the check status before drawing the checkmark.  Unfortunately this means that the information we have at hand may be wrong so when I draw the checkmarks the state I read may or may not be the final state.
It is an unnoticed bug until you try to do what I did.
Anyhow I created a work-a-round at a tiny data cost.

But if I do what I want to do that shouldn't matter anyway.
What I need to do is make intuition constantly talk to the menu items everytime the mouse moves or the user clicks.  I think I can do this by having two menu items that are both toggle checked.  One menu item will be a 1x1 pixel and the other menu item will be the full menu size.  But... this will alternate.  So menu item 1 will be 1x1 pixel under the mouse pointer and menu item 2 will be full menu size.  But when user moves mouse off 1x1 item 1 and over item 2 then  item till will relocate to where mouse is and change to 1x1 pixel and item 1 will then become full menu size at menu (0,0).

It will depend upon whether intuition uses the hittest method on the menu items when they are objects because I will need to know where the mouse is and the draw method doesn't supply that info.

Next thing to go test after I test the automask.image private class.

Gone Gahgah
Australia

Posts 224
17 Feb 2010 12:09


Gone Gahgah wrote:
It worked fine when I loaded it into my menus on the Workbench screen.

Team Chaos Leader wrote:
Does it look every bit as good as as it does when you view the CheckMarkForMenus.iff in Viewtek? (or other pic viewer)

It looks fantastic.  I wish I could show you.
I'm only disappointed it hasn't come through as cleanly for you.
It looks the same as they do in Multiview.
As far as I can tell they look the same colours as they do in your game too.
So I don't know what is wrong.

But I wouldn't worry too much about it.
I think my custom class will be the better solution for your code.

Team Chaos Leader
USA
(Natami Team Member)
Posts 1199
17 Feb 2010 12:16


What is the difference between

BITMAP_SourceFile and BITMAP_SelectSourceFile  ?

Team Chaos Leader
USA
(Natami Team Member)
Posts 1199
17 Feb 2010 12:19


gone gahgah wrote:

Gone Gahgah wrote:
It worked fine when I loaded it into my menus on the Workbench screen.
 

 
Team Chaos Leader wrote:
Does it look every bit as good as as it does when you view the CheckMarkForMenus.iff in Viewtek? (or other pic viewer)
 

  It looks fantastic.  I wish I could show you.
  I'm only disappointed it hasn't come through as cleanly for you.
  It looks the same as they do in Multiview.
  As far as I can tell they look the same colours as they do in your game too.
  So I don't know what is wrong.
 
  But I wouldn't worry too much about it.
  I think my custom class will be the better solution for your code.

I will bet your workbench screen is 16 million colors, eh? :)

Mine might be remapping based upon my 64 color workbench.


Gone Gahgah
Australia

Posts 224
17 Feb 2010 13:28


Team Chaos Leader wrote:
What is the difference between
BITMAP_SourceFile and BITMAP_SelectSourceFile  ?

The first is the normal image and the second is the selected image.  If there is no selected image then the normal one usually defaults.  DrawImageState() can be used to tell the image to draw its selected image (as well as other states) if the image chooses to do so.

Team Chaos Leader wrote:
I will bet your workbench screen is 16 million colors, eh? :)
Mine might be remapping based upon my 64 color workbench.

Only 65536.  That might effect getting the desired colours?
If you use your game screen with the colours already 'obtained' with ObtainPen() then I would have thought it would obtain the correct colours.  But I don't know.

Team Chaos Leader
USA
(Natami Team Member)
Posts 1199
17 Feb 2010 13:34


I don't do any ObtainPen()

Gone Gahgah
Australia

Posts 224
18 Feb 2010 03:23


I've sent you the automask.image class to compile into your code TCL.
It compiles but I haven't tested it.
I apologise for that.

I broke one of my files into multiple files and move all of them into a drawer and in the process somehow lost the Storm project.  I should've backed it first.  So I had to recreate this and now it won't access my custom library code.  I don't know why at this stage but rather than keep you waiting I thought I should send the code over to you.  I hope it does what it is supposed to do.

You will need to put the following define in your code that creates the new object:

#define APPAUTOMASKIA_Image 1000000

I simply plucked the number 1000000 out of the air.

To create the class first you will need to call:

  if(pAutoMaskC = AutoMask_Init(void))

You only need to create the class once.
It can be reused to create multiple objects of that class.
To create an object of that class you will need to call:

  if(pCheckMarkI = NewObject(pAutoMaskC,NULL
  ,AUTOMASKIA_Image,&rCheckMarkI
  ,IA_Width,rCheckMarkI.Width,IA_Height,rCheckMarkI.Height
  ,TAG_END))

where rCheckMarkI is your source Image.

You are then free to set pCheckMarkI as your window's checkmark.

When you are finished with the object call:

  DisposeObject(pCheckMarkI);

When you are finished with the class call:

  FreeClass(pAutoMaskC);

Hopefully my example will make classes and objects a little clearer.

I've never used BltClear(...) or BltBitMap(...) before so hopefully they will work as I hope.  I wasn't sure in BltClear() if I should set the last arg as 0x00 or 0x01 (the later meaning to wait for the blitter to finish clearing).

I hope it works as promised.

Gone Gahgah
Australia

Posts 224
20 Feb 2010 00:06


I've fixed up the code TCL.  It did need some fixing.
I've emailed it as an attachment to you.

You need to do the following in the right places:


#define APPAUTOMASKIA_Image 1000000

Class *AutoMask_Init(void);

  if(pAutoMaskC = AutoMask_Init(void))

  if(pCheckMarkI = NewObject(pAutoMaskC,NULL
    ,AUTOMASKIA_Image,&rCheckMarkI
    ,TAG_END))


and to finish


  DisposeObject(pCheckMarkI);
  FreeClass(pAutoMaskC);

I've removed IA_Width & IA_Height from the tags as these are automatically taken from the Image source, you supply, now.

Gone Gahgah
Australia

Posts 224
20 Feb 2010 00:11


This should satisfy your OS 3.0 users and give you your images as you intended them to be as Reaction is no longer needed and no remapping is done at all by the class.

Where there is &rCheckMarkI above substitute this with the pointer to your old Image structure for the checkmark.

Gone Gahgah
Australia

Posts 224
20 Feb 2010 14:06


Have emailed what should be the final version of the class TCL.
It seems to work fully now.

I could have written it as a public class but then you would have to install it which you don't want the user to have to do.
So instead I've written it as a private class that you would compile directly into your code.

Team Chaos Leader
USA
(Natami Team Member)
Posts 1199
20 Feb 2010 14:36


Can I open it with OpenLibrary() ?
 
Libraries do not need to be "installed".

Datatypes must be "installed", which is one of the reasons I do not like datatypes.


Team Chaos Leader
USA
(Natami Team Member)
Posts 1199
20 Feb 2010 22:38


I tried to cut & paste in ur code just now but my A1200 is not accepting mouse input right now.  I guess she is mad at me for not playing with her enough.  They just don't make 18 year old hardware like they used to :D

Maybe if I let it cool down for 24 hours it might start working?


Gone Gahgah
Australia

Posts 224
21 Feb 2010 01:14


Team Chaos Leader wrote:
I tried to cut & paste in ur code just now but my A1200 is not accepting mouse input right now.  I guess she is mad at me for not playing with her enough.  They just don't make 18 year old hardware like they used to :D
Maybe if I let it cool down for 24 hours it might start working?

Hopefully she will get a niece soon!

Team Chaos Leader wrote:
Can I open it with OpenLibrary()?
Libraries do not need to be "installed".

I didn't realise.  I thought libraries had to be installed.
Thanks for that insight.  I'll go turn it into a library.
Hopefully "libs/automask.image" will do the trick.

Gone Gahgah
Australia

Posts 224
21 Feb 2010 12:30


I've sent you the library version of automask.image now TCL.
I hope your 1200 is okay to try it out.
Just put it in your libs drawer where your game is.

If you want the full library code I can send that to you as well.
It is in SAS/C format which you seem to use.

You now need to do the following in the right places:

#define APPAUTOMASKIA_Image 1000000

struct ClassLibrary *pAutoMaskCL;

  if(pAutoMaskCL = (struct ClassLibrary *)OpenLibrary(
  "libs/automask.image",0))

  Object *pCheckMarkI;

  if(pCheckMarkI = NewObject(NULL,"automask.image"
    // Replace &rCheckMarkI with a pointer to your Image structure.
    ,AUTOMASKIA_Image,&rCheckMarkI
    ,TAG_END))

and to finish

  DisposeObject(pCheckMarkI);

  CloseLibrary((struct Library *)pAutoMaskCL);

Let me know if you want the full library code as well.

Team Chaos Leader
USA
(Natami Team Member)
Posts 1199
21 Feb 2010 12:39


gone gahgah wrote:

  Just put it in your libs drawer where your game is.

You are getting used to the way I do things. Thanx :)
 

  If you want the full library code I can send that to you as well.

Yes I would like to put that into my freezer where it can stay fresh and tasty forever and ever after u have disappeared.

Once this guy FD wrote me an awesome ChunkyFonts.library but he never sent me the source.  A few years later I found some bugs/flaws in his library and I really wanted to fix them.  It would have been ez.  But he lost the source by then.  Now I am stuck with a limited slow library.  grrrr.  So now I always collect source.  We might resurrect it in 2016.


  It is in SAS/C format which you seem to use.

SAS/C rulez 4ever! :D
 



Gone Gahgah
Australia

Posts 224
21 Feb 2010 12:55


LOL.  All done and dusted.

You might want to edit the install file in there.
Don't worry, it's only an IconX install script and it only moves the compiled library to where you want it to go.
It also deletes the temporary files that are created during compile.

I currently have it installing automask.library to "//libs".
Change that to instead go to your libs drawer where your game is.

Gone Gahgah
Australia

Posts 224
22 Feb 2010 14:23


Team Chaos Leader wrote:
Yes I would like to put that into my freezer where it can stay fresh and tasty forever and ever after u have disappeared.

I hope I don't end up disappearing!  I hope that one day I will change computing as we know it.  Separate from this Amiga menu stuff; I have in my head what I believe are solutions to basic problems the computer world has been patching over for years.  So I hope I don't dwindle away.  So watch for me in the year 2050 okay ;)

Back to the menu stuff though.  Let's try to work out the range of things that the app writer will want to make available for menu-nisation.  These include:


1. Opening requesters  (eg. Open..., Format Text...)
2. Performing actions  (eg. Cut, Insert Date)
3. Toggling True/False (eg. Grid?, Table Boundaries?)
4. Selecting Options  (eg. RGB?, CMYK?, HSV?, Left?, Centred?)
5. Selecting Sizes    (eg. Font Size 10, Line Width 0.10cm, Grey 20%)
6. Adding Docks & Bars (eg. + Gallery?, + Rulers?, + Draw Bar?)
7. Addhoc Items        (eg. "RAM:MyLastDoc", "Untitled 1")

Any more suggestions feel free to add.

Gone Gahgah
Australia

Posts 224
23 Feb 2010 13:31


I think that is a fairly comprehensive list hopefully.
There are a couple of tricks to the desired outcome.

One is that you may want to group somethings.
For example you may offer left|centre|right alignment and you may offer top|centre|bottom alignment.  You might want to combine a couple of these into one step eg. top+left alignment.
Another example may be combining bold+italic in one action if you do it a lot.  Or even setting a set font size, style & format in one action.

The other trick is that you want the menu to maintain consistency.
So for example if the user selects bold off while bold+italic is on then this should also go off.  If there is an italic option this should remain as on or true.

The best way to implement the later I think - instead of using a mutual exclude field of limited size - is to actually associate a class object with each function/option/etc.

In this way it should be possible to design methods that will allow whether menu items should be shown as chosen or not.  When the menu is edited and saved then the associations can be worked out by querying the objects and creating chains of exclusions.

It also simplifies the process of supplying functions/options/... to the menu system as you need only create a new object for each function/option/...  Setting the attributes via the usual way it can then be supplied to the menu system.

The other thing this allows is a means for the application to update the options as things change and for the objects to be chained for those which have been selected and the application notified to traverse this selection chain.

Gone Gahgah
Australia

Posts 224
24 Feb 2010 11:06


Although I listed 7 types of menu items in reality mostly they come down to:
  1) actions that don't directly set a value (though values may end up being changed because of)
  2) toggle type values eg. True/False, On/Off
  3) a selection of values eg. 0-256, HSV|RGB|CMYK

The first usually has a fixed form and is usually the easiest to specify.  However the option to have alternate versions based upon situation - such as Undo Resize - will mean that in those instances the class object will need a list of forms that it can be told to be by the app and in the menu editor each of those forms would be able to be given a label per language.

The second can be represented in the menu by checkmarked items (eg. [] bold) or by an 'on' option &/or and 'off' option (bold on, bold off).  Selecting the on/off options would have to alter any [] forms and when the on/off option can't be done - because it already is - it would be ghosted.

The third form can be represented by a radio item, or even as part of a cycle item, to indicate that there are other alternate possible values.  The menu preference user would make a selection of preferred values that they would like for these.

Where the second one becomes part of a combination of options then it would instead become like a radio item.  So for instance a 'bold+italic' no longer just has two forms.  It also has 'bold+!italic', '!bold+italic' and '!bold+!italic'.

There is also another form that you see sometimes these days where you can increase or decrease a value instead of picking a value.  For example, Increase Volume.  So this also needs to be an option for range values.

The best way to implement the selection of values is to have the class object, that is provided by the tool to add a function, also provide the means for picking the value.  Like a little plug-in.

This will then appear as part of the menu editor in a set aside spot when the user is editing a menu item.

Team Chaos Leader
USA
(Natami Team Member)
Posts 1199
24 Feb 2010 11:15


I asked for a better mousetrap and you have designed the BattleStar Galactica. 8D



posts 158page  1 2 3 4 5 6 7 8