Search

Main Menu

Login
Username:

Password:

Remember me?
Anonymous

Lost Password?

Register now!

Creating Collapsible/Expandable Configs

NOTE: To skip this tutorial and play with the final result, you can get the final configs from here.

A lot of people have asked how to create configs that can expand and collapse when you click on part of it. In the past this had to be done using 3rd party tools such as Alderaic's Start & Stop script. However, more recent versions of Samurize have comprehensive commandline options that allow you to achieve the same thing with a lot less hassle.

This tutorial will show you how to create a simple config that has a button that allows you to expand/collapse it using Meter Linkage.

First off, I have created a simple little config that shows a bunch of useful stuff (uptime, memory usage, the date etc.). Hopefully if you are familiar with Samurize this shouldn't be rocket science. I saved it as Samurize\Configs\SampleExpandCollapse\Expanded.ini.

Expanded Config


Now let's say we want to make this config collapse down so that the box is a smaller and only the "System Information" text is visible. We have to create this config ourselves. To do this I just made a copy of the Expanded.ini file from before, resized it and saved it as Samurize\Configs\SampleExpandCollapse\Collapsed.ini.

Collapsed Config


Ok, we've got our expanded and collapsed configs. Now, next we need to create a "button" that, when clicked, switches from the expanded config to the collapsed config and vice-versa.

  • First I add a "button" image (in this case, a small upward-pointing arrow, to indicate that the config will collapse upwards) to the expanded config by adding an Image DrawObject from the Edit Graphics tab.

  • Next we need to place a blank Text Meter on top of the "button" image with Meter Linkage enabled to trigger the button press. The Link Meter To: field for the meter should contain:

    client.exe i=SampleExpandCollapse c=SampleExpandCollapse/Collapsed.ini reload

    What does this do, I hear you ask? Well, it's using Samurize's commandline options to load the collapsed config we made when we click on the meter. The c=SampleExpandCollapse/Collapsed.ini is specifying the config file to load, the i=SampleExpandCollapse is specifying the instance of Samurize that should load the config (I'll explain this later), and the reload tells Samurize to load the new config.


You will end up with something like this.

Expanded Config with Button


Now we do the same thing with the collapsed config. Add a "button" image (this time I used a downwards-pointing arrow) as before and the blank Text Meter with Meter Linkage enabled as before. However, this time the Link Meter To: field should contain:

client.exe i=SampleExpandCollapse c=SampleExpandCollapse/Expanded.ini reload

As this time we want to load the Expanded config when the button is pressed. Also note the i=SampleExpandCollapse is the same as before - we want the same Samurize client to load the expanded config as the one that loaded the collapsed config (bear with me, it will become clear very soon!)

Collapsed Config with Button


Now our configs are complete. Let's try them out!

Remember the i=SampleExpandCollapse I kept mentioning before? This is where it comes into play. You need to launch the SampleExpandCollapse instance of the Samurize client by either:

  • using the i=SampleExpandCollapse commandline option on a shortcut (see the FAQs on how to do this)

  • using the InstanceManager program included with Samurize 1.55+ to launch a SampleExpandCollapse client instance (you can access it throught the File menu in the Config Editor or the Samurize Start Menu folder)


Then right-click on the client's tray icon and select the SampleExpandCollapse/Expanded.ini config we created earlier.

Now try clicking on the up arrow - the client should switch to the collapsed config. Then when you click on the down arrow in the collapsed config, the client should switch to the expanded config. Success!

Action Shot!


Of course this is a very simple example; you can do more advanced things than this using Samurize's command line options (check out the Samurize Help File, Appendix -> Command Line Options Section).

NOTE: If the linking doesn't work, make sure the Meter Linkage commands are correct, and check the FAQs about cases where meter linkage may not work.
[ Back to Samurize Tutorials | Printer Friendly Page]
Come On, Get Samurized!