public MainWindow()
 {
     InitializeComponent();
     controlCreators= new Dictionary<string, ControlCreator>();
     controlCreators.Add("ValueBox",CreateValueBox);
     controlCreators.Add("TextBox", CreateTextBox);
     sheet  = new CharacterSheet();
 }
Exemple #2
0
        public ValueBox(CharacterSheet sheet, Canvas panel, Point location)
            : base(sheet,panel,location)
        {
            ID = sheet.GetFreeTempID();

            sheet.Boxes.Add(this);
            Formula = "0";
            sheet.Formulas.Add(ID, Formula);
            ChangeText(Formula);

            ContextMenu.Items.Add(GenerateMenuItem("Change ID", ID_Click));
        }
Exemple #3
0
        public ChangeableBox(CharacterSheet sheet, Canvas panel, Point location)
        {
            X = 0;
            Y = 0;
            FontFamily = new FontFamily("Arial");
            FontSize = 16;
            isSizeChangeable = true;
            CanMove = true;
            SetSize(25, 15);
            Panel = panel;
            Move((int)location.X, (int)location.Y);
            panel.Children.Add(this);
            ParentSheet = sheet;
            ContextMenu = new ContextMenu();
            ContextMenu.Items.Add(GenerateMenuItem("Edit font", Font_Click));
            ContextMenu.Items.Add(GenerateMenuItem("Clone", Clone_Click));

            ContextMenu.Items.Add(GenerateMenuItem("Lockdown Size", Size_Click, true, Size_UnClick));
            ContextMenu.Items.Add(GenerateMenuItem("Lockdown Move", Move_Click, true, Move_UnClick));
        }