PopUp Notifications library.

Discussion in 'Additional Libraries' started by taximania, Feb 6, 2009.

  1. taximania

    taximania Well-Known Member Licensed 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.basic4ppc.com/forum/addi...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:
     

    Attached Files:

    Last edited: Jun 21, 2010
  2. Mr_Gee

    Mr_Gee Active Member Licensed User

    Cool!
    thanks a bunch :)
     
  3. taximania

    taximania Well-Known Member Licensed User

    [​IMG]

    Now that's a notification Pop-Up :sign0060:
     
  4. specci48

    specci48 Well-Known Member Licensed User

    Wouldn't it be easier to buy just some glasses??? :D
     
  5. taximania

    taximania Well-Known Member Licensed 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 :(

    [​IMG]

    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:
     

    Attached Files:

    Last edited: Feb 8, 2009
  6. agraham

    agraham Expert Licensed User

    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.
     
  7. taximania

    taximania Well-Known Member Licensed 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 ;)
     
  8. agraham

    agraham Expert Licensed User

    Feel free! (as long as she lets you :))

    That's the important thing.
     
  9. taximania

    taximania Well-Known Member Licensed User

    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 [​IMG]'
    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.
     

    Attached Files:

    Last edited: Feb 10, 2009
  10. Cableguy

    Cableguy Expert Licensed 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..
     
  11. taximania

    taximania Well-Known Member Licensed 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:
     
  12. Zenerdiode

    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
     

    Attached Files:

  13. agraham

    agraham Expert Licensed User

    Yes, dzts' NotifyIcon and my ControlsExDevice libraries.

    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.
     
  14. schimanski

    schimanski Well-Known Member Licensed 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?????
     
  15. taximania

    taximania Well-Known Member Licensed 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

    Code:
    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.
     
  16. schimanski

    schimanski Well-Known Member Licensed 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:
    4You '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?
     
  17. taximania

    taximania Well-Known Member Licensed User

    Is the image in the 'root directory of your device', I couldn't get an image
    to show from any other place or directory ?
     
  18. schimanski

    schimanski Well-Known Member Licensed User

    Oh, sorry...:sign0148:

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

    taximania Well-Known Member Licensed User

    Good :sign0060:
     
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