Ejemplo n.º 1
0
        void OnToolRadioButtonChecked(object sender, CheckEventArgs e)
        {
            if (!e.IsChecked)
                return;

            if (CurrentTool != null)
            {
                CurrentTool.Reset();
                RemoveWidget(CurrentTool);
            }

            String toolName = ((RadioButton.Item)sender).Name;

            CurrentTool = Tools[toolName];

            ToolConfigurableBox.SetCurrentConfiguration(toolName);

            AddWidget(CurrentTool, false, false);
        }
Ejemplo n.º 2
0
        void AddTool(Tool tool)
        {
            tool.SetMapBox(MapBox);

            Tools.Add(tool.Name, tool);

            ToolRadioButton.AddButton(tool.IconTexture, OnToolRadioButtonChecked, LabeledWidget.EMode.Right, tool.Name);
        }
Ejemplo n.º 3
0
 void MapHandler_Closed(Widget sender, CloseEventArgs e)
 {
     Closed -= new CloseEventHandler(MapHandler_Closed);
     CurrentTool = TmpCurrentTool;
     ToolMainBox.Seal(false);
 }
Ejemplo n.º 4
0
        public override void Open(OpeningInfo openingInfo = null)
        {
            base.Open(openingInfo);

            if (openingInfo == null)
                return;

            if (!openingInfo.IsValid(1))
                return;

            String mode = openingInfo.GetArg<String>("Mode");

            switch (mode)
            {
                case "PointCreatorMode":

                    ToolMainBox.Seal();
                    Closed += new CloseEventHandler(MapHandler_Closed);
                    TmpCurrentTool = CurrentTool;
                    CurrentTool = null;

                    break;
            }
        }