Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
83 user(s) are online (63 user(s) are browsing Forums)

Members: 1
Guests: 82

LiveForIt, more...

Support us!

Headlines

 
  Register To Post  

Docky example
Just can't stay away
Just can't stay away


See User information
Does anyone have a (preferably) small, tangible example of how to create and manipulate a simple docky? I am looking at the autodocs, and it is gibberish to me... Call me stupid (or lazy) ;).

I want to implement the QSystemTrayIcon stuff with dockys if possible.

Go to top
Re: Docky example
Just popping in
Just popping in


See User information
The datetime rocky on os4depot includes sources if that helps?

I am also open source writing a docky for perception as well working from the same reference I mentioned

Go to top
Re: Docky example
Amigans Defender
Amigans Defender


See User information
You write a docky just like you'd write a standard Exec library. In your code you must implement certain specifically-named functions like DockyGet(), DockyProcess(), DockySet() etc. The docky manager (AmiDock) calls these functions when it needs to.

See the datetime.docky source code (on os4depot.net) to get started.

One shortage of the current docky system is that AmiDock only provides your docky with a rastport pointer to render data into the dock. You get no window pointer, which makes it impossible to build your docky interface from Intuition gadgets.

The Rear Window blog

AmigaOne X5000 @ 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
Go to top
Re: Docky example
Supreme Council
Supreme Council


See User information
@alfkil

Perhaps you'd be interested to start that project on openamiga?

http://OpenAmiga.org

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: Docky example
Amigans Defender
Amigans Defender


See User information
@alfkil

Ignore everybody else , if you're implementing QSystemTrayIcon then what you need is an "application docky". These are dead easy:
1. Open application.library. Note the interface is called "application" NOT "main".
2. Register your application using RegisterApplication()
3. Get the application.library port through GetApplicationsAttrs
4. Get events from that port in the usual fashion (the messages are detailed in the autodoc)
5. Unregister the application, close the library etc.

Go to top
Re: Docky example
Just can't stay away
Just can't stay away


See User information
Is it possible to create an application docky and then update its content on the fly and how ?

Rock lobster bit me - so I'm here forever
X1000 + AmigaOS 4.1 FE
"Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray
Go to top
Re: Docky example
Amigans Defender
Amigans Defender


See User information
@TSK

Set the icon type to APPICONT_Docky; but you'll need to create a real docky as well then. If it doesn't need to be truly active it is possible just to change the icon's imagery (I think you have to unreg/re-reg to get it to change though, so no good for frequent changes)

Go to top
Re: Docky example
Just can't stay away
Just can't stay away


See User information
@chris

Thanks, bro, that was all the help I needed :).
And thanks also to all the other suggestions.

Go to top
Re: Docky example
Just can't stay away
Just can't stay away


See User information
After looking a bit longer at the issue, several issues spring to mind:

1) Is it possible to add items to the app docky context menu without creating a compoletely new docky class?
2) How are context menus created? I don't see any contextmenu example in the SDK examples, but DOCKYGET_ContextMenu takes en Object * as data. What kind of Object are we talking about?
3) Well, that's mostly it...

Go to top
Re: Docky example
Just can't stay away
Just can't stay away


See User information
@chris

So, I tried RegisterApplication, and after a few attemps (where apparently icon type ProgramIcon doesn't work without identification of the program file path), I managed to get an icon in the AmiDock. BUT when I try UnregisterApplication it hangs, and the appdocky is not removed. What am I missing? Do I need to call UnlockApplicationIcon or smth??

Go to top
Re: Docky example
Amigans Defender
Amigans Defender


See User information
No idea about context menus, there are a few default options you can add (new document, quit, etc), not sure if this has changed since the SDK was last updated - it seems a bit overkill to have to write a full docky for that.

UnregisterApplication should "just work" AFAIR.

Go to top
Re: Docky example
Just popping in
Just popping in


See User information
@alfkil

Context menus are dynamically built in response to DOCKYGET_ContextMenu attribute :

BOOL DockyGet (struct DockyIFace *Selfuint32 msgTypeuint32 *msgData)
{
switch (
msgType)
{
/* ... */

case DOCKYGET_ContextMenu:
{
Object *contextMenu = (Object *)msgData;

Object *item1 PopupMenuItemObject,
        
PMIA_TitleGetString(&liLOCALE_ITEM_PREFS),
        
PMIA_IDPMID_PREFS,
    
PopupMenuItemEnd;

    
Object *item2 PopupMenuItemObject,
        
PMIA_TitleGetString(&liLOCALE_ITEM_SAVEASDEFAULT),
        
PMIA_IDPMID_SAVEASDEFAULT,
    
PopupMenuItemEnd;

    
Object *item3 PopupMenuItemObject,
        
PMIA_TitleGetString(&liLOCALE_ITEM_USEASDEFAULT),
        
PMIA_IDPMID_USEASDEFAULT,
    
PopupMenuItemEnd;

if (
item1 && item2 && item3)
    {
        
IIntuition->IDoMethod(contextMenuOM_ADDMEMBERitem1);
        
IIntuition->IDoMethod(contextMenuOM_ADDMEMBERitem2);
        
IIntuition->IDoMethod(contextMenuOM_ADDMEMBERitem3);
    }

}
break;

/* ... */

}


Edited by centaurz on 2013/1/23 21:35:41
Go to top
Re: Docky example
Just can't stay away
Just can't stay away


See User information
@centaurz

Forgot to state my thankfulness in reply to your explanation. Thank you! :)

Go to top
Re: Docky example
Just popping in
Just popping in


See User information
@alfkil

In case you wondered where that contextMenu pointer came from, I'v just added the missing declaration in the code sample above .

Go to top
Re: Docky example
Just can't stay away
Just can't stay away


See User information
@centaurz

Thanks again, I actually made it work :)

Now another question: Is it possible somehow to change the Icon, when using DOCKYRENDERTYPE_Icon?? I have tried with IApplication->SetApplicationAttrs(..., APPATTR_IconType, myappinfo, TAG_DONE), but it just removes my icon from the dock...

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project