Page 5 of 5 FirstFirst 12345
Results 41 to 48 of 48

Thread: Coders! Streetdeck needs more Digitalmods!

  1. #41
    StreetDeck Skinning Master 06TC_OWNER's Avatar
    Join Date
    Mar 2006
    Location
    Fort Collins
    Posts
    363
    So I didn't get the getNextPanel() function to work, but I do have a solution for R.A.D.

    First, create a dictionary object in your class:

    Code:
            private StreetDeck.StreetDeckApp sa;
            private StreetDeck.ScriptModule sm;
            private Dictionary<String, StreetDeck.Panel> pnlDict = new Dictionary<string,StreetDeck.Panel>();
    Next, add this function to your class:

    Code:
            public void CreatePanel(StreetDeck.enumCreatePanelType type, string caption, string name)
            {                                   
                pnlDict.Add(name, (StreetDeck.Panel)sm.CreatePanel(type, "", name, 50, 50, 50, 50));
                pnlDict[name].Enabled = true;
                pnlDict[name].Caption = caption;            
            }
    Next, create your buttons/panels etc like this:

    Code:
                sa = (StreetDeck.StreetDeckApp)Application;
                sm = sa.CreateModule("digimodName");
    
                this.CreatePanel(StreetDeck.enumCreatePanelType.eCPTButton, "", "btnNightMinUp");
                this.CreatePanel(StreetDeck.enumCreatePanelType.eCPTButton, "", "btnNightMinDn");
                this.CreatePanel(StreetDeck.enumCreatePanelType.eCPTDynamicLabel, cvtTime(times[ETIMES.STARTHOUR], times[ETIMES.STARTMINUTES]), "stHour");
    Then you can access these items like this:

    Code:
                pnlDict["stHour"].Caption = cvtTime(times[ETIMES.STARTHOUR], times[ETIMES.STARTMINUTES]);
                pnlDict["endHour"].Caption = cvtTime(times[ETIMES.ENDHOUR], times[ETIMES.ENDMINUTES]);
    where the key to this is 'pnlDict["somename"]'

    As far as the skinning is concerned, everything will be stacked on top of itself, so this is where you go into the IDE and move/rearrange/set classes of all the items.

    I believe this is probably the best practice (or at least the best I could come up with) for rapidly developing SD digimods.

  2. #42
    Low Bitrate
    Join Date
    Sep 2005
    Location
    Sweden (South)
    Posts
    111
    Quote Originally Posted by 06TC_OWNER View Post
    So I didn't get the getNextPanel() function to work, but I do have a solution for R.A.D.
    Thus NO CHANGE. Creating your own panels from c# has always been possible but there is no chance getting existing panels. How is it that God_of_CPU has got this working but no one else??

    As far as skinning goes, I havn't been able to skin panels created via c#. All properties set in the IDE are lost...

    Like creating a dynamic label and have it scroll the text by choosing the "playing media title" type. (is not available via c# and must be set in the IDE)..

    If the getNextPanel() function would work, things would be truly wonderful!!!! Chuck, please..?

  3. #43
    StreetDeck Skinning Master 06TC_OWNER's Avatar
    Join Date
    Mar 2006
    Location
    Fort Collins
    Posts
    363
    In order for your properties set in the IDE to be saved you must go to project, save project while having your project selected (otherwise these settings will be lost). This does work as you can see from my project. As far as the getNextPanel() is concerned, ya, that would be great, but based on this explanation (for most projects) should not be necessary.

    getPanelByOrdinal() or getPanelByName("") would be even cooler if we could get one of those functions implemented.

    getNextPanel() destroys the properties of each item it selects, so right now, unless I am missing something, I would say it is useless.

  4. #44
    StreetDeck Skinning Master 06TC_OWNER's Avatar
    Join Date
    Mar 2006
    Location
    Fort Collins
    Posts
    363
    To further this discussion, I would also point out (even though this doesn't negate the plus side of having a getNextPanel() function) that in C#, your GUI, whether created from Visual Studio or not, creates similar code behind the scenes that you can change the properties of from the VS Designer, so this method I have shown of creating the GUI via C# then changing the properties in the IDE holds to the same methodology of C# application development.

  5. #45
    Low Bitrate
    Join Date
    Sep 2005
    Location
    Sweden (South)
    Posts
    111
    But this is not entirely true.

    Try creating a Dynamic Label in the IDE and a Dynamic Label fron c#. Compare their properties in the IDE and you will see that they do NOT have the same set of properties.

    from c#, a Label and a Dynamic Label is exactly the same..

    I'm sure that you are right that there are some properties that can be set and saved in the IDE for c# panels, but it is not true for all properties..

    I have created all the panels that I need to access fro c# in c# and all the buttons that are "static" are created in the IDE. This is the only mix we can use until the getNextPanel() (or equal function) is properly working..

    Your code works also and is more or less the same thing I'm doing. What I want to avoid is creating panels from c# altogether.

    Nice to have someone else also trying to get the API working properly. I've added a BUG report for the getNextPanel function.

  6. #46
    StreetDeck Skinning Master 06TC_OWNER's Avatar
    Join Date
    Mar 2006
    Location
    Fort Collins
    Posts
    363
    I had never actually tried the label/dynamic label, but if we get a function to access existing panels, that would be great to have... Perhaps the next revision will come out with something that allows us greater access to existing elements (I still think that a getPanelByName("") would be the most efficient, but getNextPanel() could be useful as well.

  7. #47
    Low Bitrate
    Join Date
    Sep 2005
    Location
    Sweden (South)
    Posts
    111
    I agree that a getPanelByName("") would be the best one. The you woldn't even have to go get all panels to get the one you want.

  8. #48
    Low Bitrate
    Join Date
    Aug 2007
    Posts
    63
    I would be writing way more mods if I could keep the dev environment from crashing right and left... using 1.1.1.0 and the dev envionment crashes enough to make me just stop working on it.

Page 5 of 5 FirstFirst 12345

Similar Threads

  1. StreetDeck DigitalMods (Addins)
    By vocresults in forum Wiki Discussion Threads
    Replies: 3
    Last Post: 11-20-2007, 05:36 PM
  2. StreetDeck F.A.Q.s
    By RedGTiVR6 in forum StreetDeck
    Replies: 0
    Last Post: 04-16-2007, 11:55 AM
  3. Streetdeck!
    By TheLlama in forum Off Topic
    Replies: 37
    Last Post: 11-08-2006, 05:39 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
  •