notification.dll. balloons,notifyicon etc

taximania

Well-Known Member
Licensed User
Longtime 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.
 

Attachments

  • notification.zip
    8.4 KB · Views: 88

Obelix

Member
Licensed User
Hi Taximania,

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

thanks
Obelix
 

taximania

Well-Known Member
Licensed User
Longtime User

taximania

Well-Known Member
Licensed User
Longtime 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 :)
 

Attachments

  • notification.zip
    30.9 KB · Views: 51

taximania

Well-Known Member
Licensed User
Longtime User
Hope the explanations below makes my coding a little easier to digest.
Probably not :cool:


B4X:
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:

taximania

Well-Known Member
Licensed User
Longtime 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.
 

Attachments

  • Notification.zip
    11.4 KB · Views: 27
Top