Results 1 to 2 of 2

Thread: Question About Dynamic Overlay Text

  1. #1
    Newbie
    Join Date
    Sep 2006
    Posts
    3

    Question Question About Dynamic Overlay Text

    I want to develop a program that can send a popup message to the driver while driving. The kind of thing that says "You have an appointment at 3:00pm".

    I thought I would do this by designing the popup as an overlay (UserOverlay0), and then getting that overlay to display from the external app.

    Now I know you can get an external application to display that overlay using the API function (eFunctionOverlay0).

    What would be the best approach to changing that text from an external application? I want the actual text to the driver to change based on what I need to say to him.

    I'm sorry if I am not explaining myself clearly. If you need more clarification in order to answer, please reply and I'll try to elaborate.

  2. #2
    Raw Wave god_of_cpu's Avatar
    Join Date
    Jan 2004
    Location
    SilverSpring Maryland
    Posts
    2,960
    You shouldn't use any of the user overlays. These exclusivly used for skinning. If you want to add functionality to StreetDeck, you should create a new script project, then create a new scripted overlay. In that scripted overlay, you will have to have a COM object or some other means of communicating with your external app from the script.

    To do this.
    1. Create a COM object that communicates with your external application

    2. Create a global variable in the overlay script to store the object instance.

    3. Load the COM object in the OnCreate event of the overlay and store it in the global instance.

    4a) Either do the event hack I posted in the COM object example to send events to loaded COM object to the scripting engine.

    OR

    4b) Create a timer that will go off every second or so and poll your COM object for changed data.

    5. Create labels or whatever controls you want using the toolbox to show the changed data on your overlay and update it when your data changes. You can hide or show the overlay itself using the hide or show methods of the overlay

    i.e.
    Code:
    Dim g_oCOMObject
    
    '*******************************************************************************
    'Overlay_OnCreate
    'DESC: event OnCreate - Called after the panel is created, return FALSE if there was a problem creating the panel
    '*******************************************************************************
    Function Overlay_OnCreate()
    	Set g_oCOMObject = CreateObject("COMObject.MyObject")
    	Overlay.SetTimer 1, 1000
    End Function
    
    '*******************************************************************************
    'Overlay_OnTimer
    'DESC: event OnTimer - Sent when an application timer elapses
    '*******************************************************************************
    Function Overlay_OnTimer(nIDTimer)
               iNewValue = g_oCOMObject.GetDataValue
    
               lblValue.Caption = iNewValue
    
               if iNewValue = 10 then
                       Overlay.Show TRUE
               else
                       Overlay.Hide
               End if
    End Function
    StreetDeck.com Developer (I am Chuck)
    Get StreetDeck at http://www.streetdeck.com
    The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

Similar Threads

  1. Replies: 2
    Last Post: 05-02-2006, 05:15 PM
  2. Paint And Polish Question
    By gboy in forum Fabrication
    Replies: 8
    Last Post: 08-13-2005, 07:22 PM
  3. Complete Newbie Question.
    By DomesticImport in forum Newbie
    Replies: 15
    Last Post: 07-07-2005, 06:24 PM
  4. FM Card Question....
    By Superbike1k in forum Car Audio
    Replies: 1
    Last Post: 05-16-2005, 09:03 AM
  5. lcd power question
    By jrbless in forum LCD/Display
    Replies: 1
    Last Post: 04-07-2002, 12:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •