Add options to an AppDocky?

7 posts / 0 new
Last post
jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 5 days ago
Joined: 2013-05-30 00:53
Add options to an AppDocky?

Hi how do I use 'DOCKYGET_ContextMenu' to add a couple of options (alas AmiUpdate) to my program, allready used 'RegisterApp...' using applicaciotn.library and it shows my program in AmiDock with only one option 'Quit', and I would like to add 'Option1' and 'Option2' to such context menu.

AOs4 wiki (http://wiki.amigaos.net/index.php/The_Docks_and_Dockies) shows some code, but still don't know where/how to put/add such code. Must I first "link" (like in app_lib/TestApp.c 'DummyDocky.c') my programm to my AppDocky or what?

TIA

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 5 days ago
Joined: 2013-05-30 00:53
Ok did some tests, but I

Ok did some tests, but I don't know where

  1. ..Object *item1 = PopupMenuItemObject, ..

'PopupMenuItemObject' comes from, can someone enlight me?

Is there a way to add items to AppDock's contextmenu (not a Docky)? :-/

TIA

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

alfkil
alfkil's picture
Offline
Last seen: 3 months 3 days ago
Joined: 2011-05-10 22:02
Take a look at

Take a look at this:

http://sourceforge.net/p/qtamigaosnative/code/132/tree/trunk/src/gui/util/qsystemtrayicon_amiga.cpp?format=raw

Basically what you have to do is create a library interface that implements the functions mentioned in the docky.library autodoc. Then AmiDock will call these functions when appropriate. You are probably mostly interested in these items:

DOCKYGET_RenderMode
DOCKYGET_Icon
DOCKYGET_ContextMenu

DOCKYSET_ContextMenuResult

As you can see, it is a lot of code for a simple menu (even when you sort away all the redundant Qt code), which is just the way things are. If in doubt, ask! :)

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 5 days ago
Joined: 2013-05-30 00:53
Whooouh :-O THX will take a

Whooouh :-O THX will take a look at your code. An post here results :-)

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 5 days ago
Joined: 2013-05-30 00:53
THX now at least I get an

THX now at least I get an ITEM1 in the contextmenu!!! :-=

_docky_DockyGet()

  1. ...
  2. case DOCKYGET_ContextMenu:
  3. {
  4. Object *contextMenu = (Object *)msgData;
  5.  
  6. Printf("DOCKYGET_ContextMenu\n");
  7. Object *item1 = NewObject(NULL, "popupmenuitem.class",
  8. PMIA_Title, (ULONG)"ITEM1",
  9. PMIA_ID, 1,
  10. TAG_END);
  11.  
  12. IDoMethod(contextMenu, OM_ADDMEMBER, item1);
  13. }
  14. break;
  15. ...

_docky_DockySet()

  1. ...
  2. case DOCKYSET_ContextMenuResult:
  3. {
  4. Object *o = (Object *)msgData;
  5. uint32 answer = 0;
  6.  
  7. Printf("DOCKYSET_ContextMenuResult ");
  8. if(o) GetAttr(PMIA_ID, o, (uint32 *)&answer);
  9.  
  10. switch(answer)
  11. {
  12. case 1: Printf("ITEM1 selected\n");
  13. break;
  14. default:
  15. break;
  16. }
  17.  
  18. }
  19. break;
  20. ...

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 5 days ago
Joined: 2013-05-30 00:53
Hi. Now I have contextmenu

Hi. Now I have contextmenu with some items :-)

But how to "interconnect" the DOCKY (seems it's a separated task/process) with my main (mixer) program/task/process?

Via Messages and Ports? (http://wiki.amigaos.net/index.php/Exec_Messages_and_Ports)

Does amidock/docky has some in-built function for such purpose?

My main problem now, from the AppDocky it works for rising/lowering/muting volume without problem, but to UNICONIFY mixer, it tries to create a new mixer instace, instead of uniconifying the already existing.
Or maybe is some bad/missing code inside mixer? (I think this is the culprit)

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 5 days ago
Joined: 2013-05-30 00:53
Eup, replying to myself, all

Eup, replying to myself, all problems solved.
THX to all!!!!
Expect soon a new Mixer release.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

Log in or register to post comments