PopUp Notifications library.

taximania

Well-Known Member
Licensed User
Longtime User
A new version of this .dll was created using code from several
other users. READ THIS THREAD FIRST.

Then have a read at this thread
http://www.b4x.com/forum/additional-libraries/4139-notification-dll-balloons-notifyicon-etc.html





This dll adds the notification type popup message at the
bottom of the screen, not in the middle like MsgBox.

The difference with this, and a MsgBox, is that this one clears itself
after a pre-defined time without needing to click the 'OK' button.

I've included 2 versions and dll's

PopUp gives you access to all the dll'd properties.

About, as string readonly, me ;-)
Caption, as string caption text
Critical, as bool, Outlines the notification in red
Dispose ?
Icon, as pretty useless function
New1, needed to declare a new one
PopUpTime, as Int, Time the notification shows
Text, as string, message body
ToString, another useless entity
Visible, as bool, shows the notification if True



PopUp2 creates and shows the notification when it is declared as NEW1
eg:
PopUp2.New1(text As String,caption As String, duration as Int32,critical As Boolean)

PopUp2.visible is added automatically and shows the notification.

I left the Dispose method in but I don't think it's needed.

Ha ha ha :cool:
 

Attachments

  • PopUp.zip
    3.3 KB · Views: 225
  • PopUp2.zip
    3 KB · Views: 238
Last edited:

taximania

Well-Known Member
Licensed User
Longtime User
notismiley.gif


Now that's a notification Pop-Up :sign0060:
 

taximania

Well-Known Member
Licensed User
Longtime User
So now i'm stuck. My eventhandler doesn't seem to catch the events.

Edit:
I only want the eventhandler to return a string of events or so.
I'm not asking for a stringparse thing. 1 step at a time for me, cheers.

Example:
The event catcher should make the notification noti.visible=false
It doesn't, hence my, 'eventhandler doesn't seem to catch the events'



I've enclosed my C# Visual Studio Pro project and an example .sbp file.
The 'Check' button should show a message box with the event that
returned from the 'Send' button in the PopUp notification bubble :(

notiname.gif


I've been following tutorials from this site,
Windows Mobile Development Blog Archive Capture and respond to user input to a notification bubble

The site also shows how to add images and coloured text to
a PopUp notification bubble. HTML :)

Agraham :sign0188: :sign0085:
 

Attachments

  • ClassLibrary1.zip
    32.6 KB · Views: 66
  • popup.sbp
    819 bytes · Views: 47
Last edited:

agraham

Expert
Licensed User
Longtime User
My eventhandler doesn't seem to catch the events.
That's because you are not adding it to the Notifier ResponseSubmitted event, nor are you providing the hooks for Basic4ppc to receive an event. Look at the source code for Notification in my ControlsExDevice library to see how to do it.
 

taximania

Well-Known Member
Licensed User
Longtime User
Following on from my post in the 'notify icon' thread,
I'll add the event handlers to this .dll and call it a day :)

I will add the 'Icon Class' too, if that's ok Agraham.

At least I've learnt a bit more C# and usage of Visual Studio ;)
 

taximania

Well-Known Member
Licensed User
Longtime User
That's the important thing.

This may help 'you', Agraham. After all, it's 'your' code I've used in the balloon.dll that's attached to 'THIS' post. It's a pop-up and icon lib.


1: Plain text
notification.Text="Some <a href="&Chr(34)&"text"&Chr(34)&">text</a>" & " here."

Will display 'Some text here' in the bubble.
Note the spaces after Some, and before, here.
If you click on text, the value text will be returned by the call to notification.Response


2: Colour text
notification.Text="<font color=red>Some </font><a href="&Chr(34)&"text"&Chr(34)&">text</a>" & " here."

Will display 'Some text here' in the bubble.
If you click on text, the value text will be returned by the call to notification.Response


3: Colour and size text
notification.Text="<font color=red><font size=8>Some </font></font><a href="&Chr(34)&"text"&Chr(34)&">text</a>" & " here."

Will display 'Some text here' in the bubble.
If you click on text, the value text will be returned by the call to notification.Response

You can wrap <font color=x> with or without <font size=x> round any text apart from the, value text. For each <font> call, you need an ending, </font>


4: You 'CAN' display images and get a notification.Response from it :)
notification.Text="Click the picture <a href=" & Chr(34) & "img" & Chr(34) & "><img src=" & "file:///grin.bmp" & "/></a>"

Will display 'Click the picture
grin.bmp
'
If you click on the image, the value img will be returned by the call to notification.Response


5:
More than 1 image is also supported, but your gonna have to wait . . .
Lesson 2 tomorrow.

Tables, ha ha ha ;)

Add any images to your Device Root Folder.
grin.bmp is included and an .sbp example file, minus the text= bits.
 

Attachments

  • Balloon.zip
    3.4 KB · Views: 87
Last edited:

Cableguy

Expert
Licensed User
Longtime User
I can only say WOW!!!!

This is coming very handy in my next project... when ever i can get my head straight for that..
 

taximania

Well-Known Member
Licensed User
Longtime User
I'm just glad to bring Agraham's work to a 'noticable position'
@Agraham

Here's a taster of the next lesson, I know you hate HTML :sign0137:

noti.Text="<table width 100%><tr><td><font color=red></font> <a href=" & Chr(34) & "On" & Chr(34) & "><img src=" & "file:///on.bmp" & "/></a></td><td><font color=red></font> <a href=" & Chr(34) & "Off" & Chr(34) & "><img src=" & "file:///on.bmp" & "/></a> </td></tr><tr><td><a href=" & Chr(34) & "Grin" & Chr(34) & "><img src=" & "file:///on.bmp" & "/></a> </td><td><a href=" & Chr(34) & "Sq" & Chr(34) & "><img src=" & "file:///on.bmp" & "/></a></td></tr>"

4 images, 4 different responses. :sign0025:
 

Zenerdiode

Active Member
Licensed User
Have I seen this somewhere before...(?)

I have two devices I've been testing this on:

HP iPaq hx4700 WM2003SE
HP iPaq hx2190b WM5.0

Both devices have a 'Notification LED'. With WM2003SE, the balloon is like the speech bubble as attached. You have got to use the .dispose method in Form1_Close - or the icon will remain on the taskbar. You also have to use the .Visible=false property, otherwise the Notification LED will flash forever. :)
The HTML text formatting (size and colour) works on WM2003SE, however, I can't get the images to work.

Everything works as expected on WM5.0
 

Attachments

  • Screen04.JPG
    Screen04.JPG
    9.5 KB · Views: 50

agraham

Expert
Licensed User
Longtime User
Have I seen this somewhere before...(?)
Yes, dzts' NotifyIcon and my ControlsExDevice libraries.

on WM2003SE, however, I can't get the images to work.
They don't. I have found MSDN documentation to that effect. What I haven't found is documentation that images work in WM5.0 and later, although they obviously do. Must be a deliberate enhancement on WM5.0 - there was really no reason for them not to work under WM2003 as the HTML is rendered by the Pocket IE engine - may be it was a bug or an oversight that they documented rather than fixed.
 

schimanski

Well-Known Member
Licensed User
Longtime User
I can use the PopUp-Lib in my own application, but which one I have to use? Balloon or PopUp2?????
The new-method from the PopUp2 is the best, because it is only one line and it is easy to make a PopUp on device and the same msgBox for the desktop. But i don't want the speech-bubble in the tasbar and there is no way to set the NotificationLED off.

With the balloon-lib, i have to init one object for each message?????
 

taximania

Well-Known Member
Licensed User
Longtime User
PopUp and PopUp2 don't let you add your own Icon,
Balloon does, and has the ability to respond to feedback.
A clone of Agraham's controlsexdevice.dll :)

Try this,
after bal.visible=true

B4X:
For a = 1 To bal.InitialDuration
Sleep(1000)
DoEvents
Next 
bal.Visible=False
'bal.dispose  for PopUp2

This halts the process for the time the bubble is visible then clears it,
but allows responses to be handled (with balloon.dll).

My WM2003SE devices screen is broke, so I can't test code with it,
As my signature says, I'm using a WM6 device.
 

schimanski

Well-Known Member
Licensed User
Longtime User
Hello!

Thanks, Taxmania for your samplecode. I use the balloon.dll in my application.

I use a device with Windows Mobile 6, but I'am not able to show an icon in the popup. I have used your sample in html:

PHP:
4: You 'CAN' display images and get a notification.Response from it 
notification.Text="Click the picture <a href=" & Chr(34) & "img" & Chr(34) 
& "><img src=" & "file:///grin.bmp" & "/></a>"

I only get an emty picture in the bubble. Is there another way than in html?
 

schimanski

Well-Known Member
Licensed User
Longtime User
Oh, sorry...:sign0148:

I've got the icon in the application-directory. Now it works...
 
Top