notification.dll. balloons,notifyicon etc

Discussion in 'Additional Libraries' started by taximania, Apr 7, 2009.

  1. taximania

    taximania Well-Known Member Licensed User

    I've combined all the bits I've been playing with into 1 dll

    This includes the:
    Balloon/popup message window.
    Modifyable notifyicon.
    Contextmenu.
    Iconlist (used with balloon and notifyicon).

    It might be buggy, but i've not found any yet.
    I'll test it further tomorrow whilst at work :)
    Yes, the taxi trade is that slow :(

    It's strictly a device library, but I have managed to create a dummy
    desktop lib so desktop compiled 'device apps' can be made.

    Most of this is not my work :sign0089:
    :wav:
    Respects to Erel, Dzt and Agraham. And anybody I've forgot to mention.
     

    Attached Files:

  2. Obelix

    Obelix Member Licensed User

    Hi Taximania,

    a greate job, but have you a examle to use the notification (Basic4PPC 6.5)

    thanks
    Obelix
     
  3. taximania

    taximania Well-Known Member Licensed User

  4. taximania

    taximania Well-Known Member Licensed User

    I'm an idiot, an idiot I tell you :BangHead:

    I'd altered the namespace 'name' in the dummy lib :sign0144:

    Here's an example of all 4 classes.
    Notifyicon
    Balloon
    IconList
    ContextMenu

    Attached is notification.zip, which includes:
    notification.dll, for the device.
    notidesktop.dll, dummy for desktop compile.
    on.ico, image used.
    off.ico, image used.
    minimenu4.sbp, source file.
    minimenu4.exe, optimized compiled standalone .exe. Works on my Orbit.
    The .dll and ico's need to be in the apppath directory.

    I'll try to do the .cs files tomorrow evening for merging the dll at compile.

    I'll also comment the source at work tomorrow and post it here.
    It might help you understand my coding :)
     

    Attached Files:

  5. taximania

    taximania Well-Known Member Licensed User

    Hope the explanations below makes my coding a little easier to digest.
    Probably not :cool:


    Code:
    Sub Globals
     
    'Declare the global variables here.
    s=0
    d=
    0
    flag=
    0
    End Sub

    Sub App_Start
    Sip=False
    form1.Show
    hw.New1      
    'hardware
    bal.New1   'balloon
    cm.New1      'contextmenu
    cm.CMAddItem("Form1")
    cm.CMAddItem(
    "About")
    cm.CMAddItem(
    "Exit")
    ni.New1(
    "form1")      'notifyicon
    ni.AddNIContextMenu("form1",cm.Value)
    ni.SetNIMenuXY(
    150,200)
    loadicos            
    'loads icons into iconlist
    ni.AddNIicon(ico.ILitem(0))   'use icon item 0 as default
    End Sub

    Sub ni_Click   'called when notify icon is clicked
    If s = 1 Then   's is initially 0 and set to 1 on the first
    d =1      'click. This sets the timer running with a 750msec tick.
    End If      'On the next click, d is set to 1
    If s = 0 Then
    s =
    1
    timer2.Enabled=
    True
    End If
    End Sub

    Sub Timer2_Tick
    timer2.Enabled=
    False
    If d=1 Then          'if d is 1 here, then a double click happened.
    ni.ShowNIMenu         'show menu
    d=0
    s=
    0
    Else
    altericon         
    'or toggle the icon.
    s=0
    End If

    Sub cm_Click      'called when a contextmenu item is selected
    If cm.CMSelectedIndex=0 Then set
    If cm.CMSelectedIndex=1 Then about
    If cm.CMSelectedIndex=2 Then kill
    End Sub



    Sub set
    form1.Show
    End Sub

    Sub loadicos   'once you have used an icon from an iconlist
    ico.New1      'it's data seems to disappear, so ico.New1 each time.
    FileOpen(c1,AppPath & "\off.ico",cRandom)
    ico.ILaddstream(c1)
    FileClose(c1)
    FileOpen(c1,AppPath & 
    "\on.ico",cRandom)
    ico.ILaddstream(c1)
    FileClose(c1)
    End Sub

    Sub altericon   'toggle the notifyicon icon
    loadicos      'reload the icons as mentioned above
    If flag = 0 Then
    ni.ModifyNIicon(ico.ILitem(
    1))
    flag=
    1
    Else
    ni.ModifyNIicon(ico.ILitem(
    0))
    flag=
    0
    End If
    End Sub



    Sub kill
    ni.Dispose
    ico.Dispose
    hw.Dispose
    AppClose
    End Sub

    Sub about
    bal.BCaption=
    "By me"
    bal.BText=
    "ha ha ha"
    bal.BInitialDuration=
    6   'the balloon disappears after BInitialDuration
    bal.BIcon= ico.ILitem(0)   'the icon and 'Notification' writing 
    bal.BVisible=True                'on the menu bar doesn't
    wa         'call a delay routine
    End Sub

    Sub wa
    For a= 1 To bal.BInitialDuration    'for same duration
    Sleep(1000)
    DoEvents
    Next
    bal.BVisible=
    False   'If this was called any earlier it would override
    End Sub      'BInitialDuration and the bubble would disappear early



    Sub Button2_Click
    hw.ShowTodayScreen
    End Sub


    End Sub
     
    Last edited: Jul 17, 2010
  6. taximania

    taximania Well-Known Member Licensed User

    It came to my attention that the Balloon events,
    BalloonChanged
    ResponseSubmitted
    weren't firing in device 'compiled' apps.
    Attached is device notification.dll, notification.cs and
    a new working Desktop library, NotiDesk.dll.
     

    Attached Files:

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice