Jump to content
LaunchBox Community Forums

Recommended Posts

Grila's Custom BigBox Controls

View File

A few custom controls to add extra functionality to BigBox themes. Read the documentation included in the download.

1.thumb.png.da0e76b2878056738b46fee7e501f22e.png2.thumb.png.ea3918afaa8e5dd669b063aaebf0e2f3.png

Install:
Place GrilaBBControlsPlugin.dll and SlimDX.dll in either LaunchBox\Plugins or the plugins folder of a specific theme


Initialize:
Open a new or existing BigBox theme in Visual Studio and add a reference to the project. Browse to the directory you copied the files to in the first step and select GrilaBBControlsPlugin.dll.


Define:
In any views you wish to utilize the controls, add the plugin to the namespace.
Ex. xmlns:g="clr-namespace:GrilaBBControlsPlugin;assembly=GrilaBBControlsPlugin"


Use:
Use like any other element by prefixing the namespace defined in the previous step (a quick selection box should appear after typing the namespace prefix) and select the desired control.


Customize:
There are exposed properties for most of the controls that allow the user to customize their appearance as they wish. Below is a list of all available properties that can be changed:


GrilaTime – a more customizable version of the built-in time control:
•    Any normal TextBlock options like foreground, font family, font style, etc.
•    GrilaTimeFormat is a string defining the DateTime format. Default is set to “h:mm tt” for 12 hour time with AM/PM indicators and no date. Set this however you wish to get the info you want. Good examples of DateTime formats can be found here: https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx


GrilaPowerStatus – shows device power status, battery charge status, and battery level
•    GrilaBatteryBorderColor – the color of the battery outline (default Black)
•    GrilaBatteryBorderThickness – the width of the battery outline (default 15)
•    GrilaBatteryCornerRadius – the radius of the battery corners (default 5)
•    GrilaBatteryProgressForeground – the color of the battery level progress bar (default Lime)
•    GrilaBatteryProgressBackground – the background color of the battery level progress bar (default #111111)
•    GrilaBatteryProgressMargin – the margin between the battery outline and the battery level progress bar (default 0)
•    GrilaChargeIconForeground – the color of the charging symbol when the battery is charging (default BatteryOutlineBorderColor)
•    GrilaPlugIconForeground – the color of the plug symbol when the device has no battery (desktop system) (default BatteryOutlineBorderColor)


GrilaControllerStatus – shows the connection state and battery level (if wireless) for up to 4 xinput controllers
•    GrilaControllerColor – the color of the controller(s) (default Black)
•    GrilaControllerLightOnColor – the color of the charge level indicator lights when on (default Lime)
•    GrilaControllerLightOffColor – the color of the charge level indicator lights when off (default Black)
 


 

  • Like 9

Share this post


Link to post
Share on other sites

Hi.

I'm interesting in using the GrilaControllerStatus plugin.

But I don't know how to edit themes. Is this implemented in any existing theme?

  • Like 1

Share this post


Link to post
Share on other sites

I can but it's not a quick change. All the elements in my control pack are pure XAML, no png or jpg. The reason I went this route was so they could scale up and down indefinitely, without losing quality. Give me a few days and I'll see if I can get it added.

Sent from my Pixel XL using Tapatalk

Share this post


Link to post
Share on other sites

Oh thank you. Lastly, I got everything to work except the controller icons part. I keep getting errors with the slimdx.dll for some reason. Anything else I need to add to use this portion?

Share this post


Link to post
Share on other sites

Is the .dll unblocked? Windows 7 and higher are notorious for blocking downloaded .dll files. If you already unblocked it, maybe go here and download the runtime for your pc. https://slimdx.org/download.php

Other than that I'm not sure...everything works correctly on my side.

  • Like 1

Share this post


Link to post
Share on other sites

It's probably the slimdx runtime. I've never seen this runtime before so I doubt it's installed on my pc.

Share this post


Link to post
Share on other sites

There are different slimdx libs for 32 and 64 bit. Could that be the problem? Are you running at 32 or 64 bit.

Share this post


Link to post
Share on other sites

64bit. Of course I downloaded the 64bit one from the link he just gave me. Haven't tried it again yet though. I will eventually once I figure out where I want to place them on the theme xD

Share this post


Link to post
Share on other sites

On that note, if you're debugging a control that uses slimdx, the lib probably needs to be 32 bit because VS debugger runs in 32 bit. I ran into this problem when using slimdx within AO Bigbox Customs. I made my library load either the 32 or 64 bit version of slimdx, based on the current runtime environment; that solved the problem and also allows my library to work for 32 and 64 bit.

This is because slimdx is not truly managed and relies on native 32 and 64 bit libs. You can read about this in the slimdx forums, should come up in a quick Google search. It cannot really support the target "Any" option in .NET. I'm pretty certain about this but @Grila please correct me if I'm wrong.

Share this post


Link to post
Share on other sites

Hey all,

I hope I won’t cause any issues asking this off topic question, but what is the theme used in the background (can’t find it in the downloads section)? Looks pretty nice..! 

Share this post


Link to post
Share on other sites
4 minutes ago, Exequiel3k said:

Hey all,

I hope I won’t cause any issues asking this off topic question, but what is the theme used in the background (can’t find it in the downloads section)? Looks pretty nice..! 

I am not sure if that is actually a released theme or not. It doesn't look familiar to me at least as one of his released themes. He is always tinkering with themes so it might just be a quick mockup to demonstrate the custom controls he made. Only @Grila would be able to answer that for you.

Share this post


Link to post
Share on other sites
Just now, Grila said:

@neil9000 is correct, that was just a quick theme I made to showcase the plugin controls.

Thank's @Grila, i thought that was the case, but i have been wrong many many times, so thank's for clearing that up.

Does look nice though ;) 

Share this post


Link to post
Share on other sites

@Grila  nice job!! you saved me a lot of time developing a battery status class :-)  2 questions for you....  1) Did you take out GrilaPlugIconForeground ? because I cannot for the life of me get it to work, XAML just sees it as a unrecognized argument.   I use my theme on my desktop and GPD Win 10 and its perfect for the GPD but I don't wish to see the battery status on my desktop.            2) Does your battery class utilize the Battery Aggregate function? (takes into consideration more than 1 battery)

Like I said, this is awesome!

 

Share this post


Link to post
Share on other sites
19 minutes ago, y2guru said:

@Grila  nice job!! you saved me a lot of time developing a battery status class :-)  2 questions for you....  1) Did you take out GrilaPlugIconForeground ? because I cannot for the life of me get it to work, XAML just sees it as a unrecognized argument.   I use my theme on my desktop and GPD Win 10 and its perfect for the GPD but I don't wish to see the battery status on my desktop.            2) Does your battery class utilize the Battery Aggregate function? (takes into consideration more than 1 battery)

Like I said, this is awesome!

 

1. I just checked and it's there. The plug icon shows when BatteryChargeStatus.NoSystemBattery is returned. If you want I can make you a custom version that hides the plug for systems that don't have a battery. That will have to wait until Monday at least since my dev files are on my work computer and I don't go to the office on Fridays. 

2. The control utilizes the SystemInformation.PowerStatus class (https://msdn.microsoft.com/en-us/library/system.windows.forms.powerstatus(v=vs.110).aspx). I don't think it has aggregate support, but I may be wrong. I think the UWP class has the aggregate support.

Edited by Grila
wrong link

Share this post


Link to post
Share on other sites

1.  you are awesome if you could make that change, otherwise I can just clone my view and remove the battery.. either way is cool, I wouldn't go out of the way for me :-)

2. I was just curious as I had an example stored away ready for me to code this weekend, but I stumbled on your post and saw that you had already developed and uploaded a dll :-)

why re-invent the wheel !

 

figured I would attach my work in progress as I am after all using your .dll !  and a modified Critical Zone - Blue Box, @CriticalCid @eatkinola - yes guys I've still been working on my theme! and it has been driving my wife nuts.image1.thumb.jpeg.f765cd386cdce06ff861f4745974b5d3.jpeg

 

 

 

image2.jpeg

  • Like 1

Share this post


Link to post
Share on other sites

@Grila I have another idea and it relates to the coverflow:flowcontrol spacing property, please send me a direct message and i'll explain in more detail.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×