Welcome, Guest. Please login or register.

Author Topic: MUI for the (slightly) advanced  (Read 2450 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
MUI for the (slightly) advanced
« on: September 02, 2003, 09:30:54 PM »
Chapter 1, Menus:

O.k. I did add some menus to my win-object by giving a normal NewMenu-array
to MUI_MakeObject, and they do appear.

I also set different constants to the nm_UserData-field, and that appears as
id = DoMethod(app,MUIM_Application_Input,&signals)

But that not what I want  :-o

I want to connect the menus to my costum class, via MUIM_Notify, prefered in a
way where the Menu-titles would reflect in the Method-ID and the MenuItem
in the next field of that message.

That allready works that way with the speedbar-object, so it should be possible.
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: MUI for the (slightly) advanced
« Reply #1 on: September 02, 2003, 10:39:58 PM »
DoMethod(_win(obj), MUIM_Notify, MUIA_Window_MenuAction, MUIV_EveryTime, obj, 2, MUIM_MySubClass_MenuThingy, MUIV_TriggerValue);

I never used menus this way though. Read MUI_Window.doc/MUIA_Window_MenuAction and you get the idea :-)
My Amigas: A500, Mac Mini and PowerBook
 

Offline KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
Re: MUI for the (slightly) advanced
« Reply #2 on: September 02, 2003, 11:06:49 PM »
#DOH#

Took quite a while till I got that to work.
Seems MUI doesn't like it when some menus have a 0 in the userdata before the
ones I wanted to get running ......

Well thats life ;)


Menus are used that way cos they are mainly used for setting parameters of my
class, and redirecting those that are not back to "app" seemed easier than
sorting them in the main-loop, finding which windows they belong to, and
than notifying my class ....
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
Re: MUI for the (slightly) advanced
« Reply #3 on: September 05, 2003, 03:14:49 AM »
Yeah, it is Kaptein Kronos on his neverending voyage again ;)


PopUps are what we gonna learn in this chapter ....

1st we set our goal:
We want an colorfield-object that pops up an coloradjust-object.
Now I know that there is Poppen, but that gives you an
Pendajust-object something that is simply overkill for
this purpose (and a pain to use).

Here are some snippets:

 a = MUI_NewObject(MUIC_Coloradjust,TAG_DONE);
   c = MUI_NewObject(MUIC_Colorfield,MUIA_InputMode,MUIV_InputMode_Immediate,TAG_DONE);
   b = MUI_NewObject(MUIC_Popobject,
       MUIA_Popstring_Button, PopButton(MUII_PopUp),
    MUIA_Popobject_Object, a,
        TAG_DONE);          



.
.
.
Child, HGroup,
          Child, HSpace(0),
          Child, c,
          Child, b,  
.
.
.

DoMethod(c,MUIM_Notify,MUIA_Pressed,TRUE,  b,1,MUIM_Popstring_Open);



This does work o.k. sofar, but I want to get rid of that popup-button
(the small one with the arrow down), but sofar everything I
tried to make it invisible ended in either a crash, or the whole
popup being lost.
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
Re: MUI for the (slightly) advanced
« Reply #4 on: September 05, 2003, 10:25:31 AM »
*bump*
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else