Custom Default Layout

42 views
Skip to first unread message

vorp

unread,
Nov 19, 2014, 5:19:56 PM11/19/14
to authoring-to...@googlegroups.com
Is there any system in ATF to accommodate a custom default layout when using the WindowLayoutService component?
Basically, I've got several tabs for groupings of parameters and would like there to be a default layout of tabs presented to all new users of the tool before they've started creating their own.

Thanks for any suggestions.

-Len

Ron AtSony

unread,
Nov 19, 2014, 6:01:58 PM11/19/14
to vorp, authoring-to...@googlegroups.com
Hi Len,

Good question. The key file is DefaultSettings.xml. I did a search, hoping to find documentation about this (I couldn't) but I did see that I basically answered this question here and had forgotten about it!

If you want to set the default arrangement of Controls that a user of your tool first starts with, you can create a DefaultSettings.xml file. See SettingsService.DefaultSettingsPath. So, you could manually (with a mouse) set up the GUI like you want, then copy the AppSettings.xml file and rename it to DefaultSettings.xml file, which you would include with your app. The user's own settings (AppSettings.xml) will take precedence over whatever is in DefaultSettings.xml. There may be settings in AppSettings.xml that you don't want in DefaultSettings.xml, so you might have to clean up DefaultSettings.xml with a text editor.
 
There's also the WindowsLayoutService which allows you to create and save named Windows layouts. You could include a couple of pre-defined layouts with your app. Guerrilla Games' CoreText Editor uses this component, to allow their users to switch between a timeline view and a circuit layout view. The layouts and associated commands appear in View -> Layouts.

I'll give some more details about this. The default layout and any other setting that is registered with the SettingsService is determined as follows:
1. AppSettings.xml file is searched for in a directory like this: C:\Users\rlittle\AppData\Roaming\CircuitEditor\3.0
If this file is found, the settings in it are highest priority.

2. Otherwise, DefaultSettings.xml is used to determine a setting's value. This file is by default in the same directory as your app's executable.

3. If the setting isn't in either of those files, the default value of the C# property is used.


Here are those properties in SettingsServiceBase:

        /// <summary>
        /// Gets or sets the file path where default settings data can be found; default data is used
        /// when no persisted settings data can be found</summary>
        /// <remarks>Path is initialized to Application.StartupPath\DefaultSettings.xml</remarks>
        public string DefaultSettingsPath

        /// <summary>
        /// Gets or sets the file path where settings data should be persisted</summary>
        /// <remarks>Path is initialized to Environment.SpecialFolder.ApplicationData\Application.ProductName\Version\AppSettings.xml</remarks>
        public string SettingsPath

--Ron


--
You received this message because you are subscribed to the Google Groups "Authoring Tools Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to authoring-tools-fr...@googlegroups.com.
Visit this group at http://groups.google.com/group/authoring-tools-framework.
For more options, visit https://groups.google.com/d/optout.

vorp

unread,
Nov 19, 2014, 8:17:24 PM11/19/14
to authoring-to...@googlegroups.com
Excellent! Thanks Ron!
Reply all
Reply to author
Forward
0 new messages