public ToggleButton(Vector2f ButtonPosition, ToggleOptions buttonOption)
    {
        OuterShape           = new RectangleShape(new Vector2f(30f, 30f));
        OuterShape.FillColor = OuterShape_FillColor;
        OuterShape.Origin    = new Vector2f(OuterShape.GetLocalBounds().Width / 2f, OuterShape.GetLocalBounds().Height / 2f);
        OuterShape.Position  = ButtonPosition;

        InnerShape           = new RectangleShape(OuterShape.Size / 2f);
        InnerShape.FillColor = OuterShape.FillColor;
        InnerShape.Origin    = new Vector2f(InnerShape.GetLocalBounds().Width / 2f, InnerShape.GetLocalBounds().Height / 2f);
        InnerShape.Position  = OuterShape.Position;

        ToggleOption = buttonOption;

        ToggleButtonList.Add(this);
    }
///<summary>
///Creates a new instance of Toggle
///</summary>
public Toggle(JsString selector, ToggleOptions options)
{
Selector = J(selector);
Selector.toggle(options);
}
Exemple #3
0
        public GenerationOptions(string dir, IEnumerable <Repository> allRepos, Repository repo, ToggleOptions options = null)
        {
            // Set options to default if none
            Options = options ?? new ToggleOptions();

            DirectoryPath   = dir;
            AllRepositories = allRepos;
            Repository      = repo;
            allGeneratables.AddRange(Repository.GetGeneratables());

            // This may contain multiple libraries, so get the first one. Also, hack a string.Empty for xlib.
            LibraryName = repo.Namespace.SharedLibrary?.Split(',') [0] ?? "";

            SymbolTable = new SymbolTable(Statistics, Options.Win64Longs);

            // Register the main repository once without namespace names and once with them.
            SymbolTable.AddTypes(repo.GetSymbols());
            foreach (var repository in allRepos)
            {
                SymbolTable.AddTypes(repository.GetSymbols(), repository);
            }
            SymbolTable.ProcessAliases();
        }