Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Applets

The following figure shows the MIF editor Applet tab:

The CIF example shown below contains the primitives required for the Applet Information and Graphics sections of the Applet tab:

--Applet Information
-- resources base id; every applet needs its own resources base id
include “AEECLSID_EMAILAPP.bid”  -- needed for AEECLSID_EMAILAPP
include “AEEAFlags.h”     -- needed for AEE_AFLAG_XXX
include “AEEPLPrivs.bid”  -- needed for AEEPRIVID_PLXXXX
local EMAILAPP_resbaseid = 20  -- define Applet base resource id
 
-- Applet Class 
Applet {
   appletid       = AEECLSID_EMAILAPP, -- Class ID
   resbaseid      = EMAILAPP_resbaseid,  -- Applet base resource id
   applethostid   = 0, -- Host ID (under Notification, Flags, Settings…)
   flags          = AEE_AFLAG_TOOL, -- Applet Type;  Flags (under
                                        -- Notification, Flags, Settings…)
   privs          = {AEEPRIVID_PLFile, AEEPRIVID_PLNetwork },
                     -- See the "Privileges" section
}
-- Applet Name
ModRsc {
   id    = EMAILAPP_resbaseid + 0, -- IDR_NAME_OFFSET,
   type  = RESTYPE_ENCSTRING,     
   data  = EncStringRscData(AEE_ENC_UNICODE, "EMAILAPP")
                            -- String Encoding Format and Name
}

--Graphics Information
-- Applet Icon
ModRsc {
   id    = EMAILAPP_resbaseid + 3, -- IDR_THUMB_OFFSET,
   type  = RESTYPE_MIMETYPED,
   data  = ImageRscData("image/bmp", BytesOfFile("c_MyApp_ico_small.bmp"))
                         -- MIME Type and Small 
}
ModRsc {
   id    = EMAILAPP_resbaseid + 1, -- IDR_ICON_OFFSET,
   type  = RESTYPE_MIMETYPED,
   data  = ImageRscData("image/bmp", BytesOfFile("c_MyApp_ico_medium.bmp"))
                         -- MIME Type and Medium
}
ModRsc {
   id    = EMAILAPP_resbaseid + 2, -- IDR_IMAGE_OFFSET ,
   type  = RESTYPE_MIMETYPED,
   data  = ImageRscData("image/bmp", BytesOfFile("c_MyApp_ico_large.bmp"))
                         -- MIME Type and Large
}

The following dialog displays when you click Notifications, Flags, Settings... in the Applet Information area of the Applet tab.

The CIF example below shows the primitives required for the Display settings area of the Advanced Applet Information dialog:

-- Flags, Host ID are specified in the Applet primitive shown above
-- Display Settings

ModRsc {
    id    = EMAILAPP_resbaseid + 6, -- IDR_ENVIRONMENT_OFFSET
    type  = RESTYPE_ENCSTRING,
    data  =EncStringRscData(AEE_ENC_UNICODE ,
            "display1=w:*,h:70,c:18,a:0&display2=w:40,h:*,c:*"), 
    -- display1 = display 1
    -- w = Width (* = Max)
    -- h = Height (* = Max)
    -- c = Color Depth (* = Max)
    -- a = Annunciator (1 = yes; 0 = no)
}

--Notification (System or Custom)
Notifier {
    clstype =AEECLSID_SHELL, -- Notifier
    clsnotify = AEECLSID_EMAILAPP, -- the class ID of the applet to receive
                                   -- the notification
    mask =NMASK_SHELL_INIT,  -- MASK
}