Exemplo n.º 1
0
 public SizesSet(SizesSet parent, int parentIndex, params SizesSetMember[] m)
 {
     if (m.Length != 10) throw new ArgumentException();
     members = m;
     this.parent = parent;
     if (parent != null) ((SizeSubmenuEntry)parent[parentIndex]).SubMenu = this;
 }
Exemplo n.º 2
0
 public SizesSet(SizesSet parent, int parentIndex, params SizesSetMember[] m)
 {
     if (m.Length != 10)
     {
         throw new ArgumentException();
     }
     members     = m;
     this.parent = parent;
     if (parent != null)
     {
         ((SizeSubmenuEntry)parent[parentIndex]).SubMenu = this;
     }
 }
Exemplo n.º 3
0
        private void select(SizeEntry sizeEntry)
        {
            if (widthValue == null)
            {
                widthValue = sizeEntry;
                currentSet = defaultSet;
                vc.Invalidate();
                return;
            }
            SizeEntry heightValue = sizeEntry;

            vc.DoResize(12, widthValue.From, heightValue.From, widthValue.To - widthValue.From, heightValue.To - heightValue.From, true);
        }
Exemplo n.º 4
0
                                                           new SizeEntry(8, 12)); // 9


        static XYSizesViewState()
        {
            // fourths submenu
            new SizesSet(defaultSet, 4,
                         new SizeEntry(0, 12), // 0
                         new SizeEntry(0, 3),  // 1
                         new SizeEntry(0, 6),
                         new SizeEntry(0, 9),
                         new SizeEntry(3, 6),
                         new SizeEntry(3, 9), // 5
                         new SizeEntry(6, 9),
                         new SizeEntry(3, 12),
                         new SizeEntry(6, 12),
                         new SizeEntry(9, 12)); // 9

            //sixths submenu
            SizesSet sixths = new SizesSet(defaultSet, 6,
                                           new SizeEntry(0, 12), // 0
                                           new SizeEntry(0, 2),  // 1
                                           new SizeEntry(2, 4),
                                           new SizeEntry(4, 6),
                                           new SizeSubmenuEntry("More left-biased sizes"),
                                           new SizeEntry(2, 10), // 5
                                           new SizeSubmenuEntry("More right-biased sizes"),
                                           new SizeEntry(6, 8),
                                           new SizeEntry(8, 10),
                                           new SizeEntry(10, 12)); // 9

            new SizesSet(sixths, 4,
                         new SizeEntry(0, 12),  // 0
                         new SizeEntry(0, 4),   // 1
                         new SizeEntry(0, 6),   // 2
                         new SizeEntry(0, 8),   // 3
                         new SizeEntry(0, 10),  // 4
                         new SizeEntry(2, 6),   // 5
                         new SizeEntry(2, 8),   // 6
                         new SizeEntry(2, 10),  // 7
                         new SizeEntry(2, 12),  // 8
                         new SizeEntry(4, 8));  // 9
            new SizesSet(sixths, 6,
                         new SizeEntry(0, 12),  // 0
                         new SizeEntry(4, 8),   // 1
                         new SizeEntry(0, 10),  // 2
                         new SizeEntry(2, 10),  // 3
                         new SizeEntry(4, 10),  // 4
                         new SizeEntry(6, 10),  // 5
                         new SizeEntry(2, 12),  // 6
                         new SizeEntry(4, 12),  // 7
                         new SizeEntry(6, 12),  // 8
                         new SizeEntry(8, 12)); // 9
        }
Exemplo n.º 5
0
        internal override void KeyPress(KeyPressEventArgs e)
        {
            if (e.KeyChar >= '0' && e.KeyChar <= '9')
            {
                SizesSetMember ssm = currentSet[e.KeyChar - '0'];
                if (ssm is SizeSubmenuEntry)
                {
                    SizeSubmenuEntry sse = (SizeSubmenuEntry)ssm;
                    currentSet = sse.SubMenu;
                    vc.Invalidate();
                }
                else
                {
                    SizeEntry se = (SizeEntry)ssm;
                    select(se);
                }
            }
            else
            {
                switch (e.KeyChar)
                {
                case ',':
                case '.':
                    select(new SizeEntry(-1, -1));
                    break;

                case '-':
                case '\b':
                    currentSet = currentSet.Parent;
                    if (currentSet == null)
                    {
                        if (widthValue != null)
                        {
                            widthValue = null;
                            currentSet = defaultSet;
                        }
                        else
                        {
                            vc.NextState = ViewState.START;
                        }
                    }
                    vc.Invalidate();
                    break;
                }
            }
        }
Exemplo n.º 6
0
 internal override void  restart()
 {
     widthValue = null;
     currentSet = defaultSet;
 }
Exemplo n.º 7
0
 public SizeSubmenuEntry(string t)
 {
     subMenu = null;
     title   = t;
 }
Exemplo n.º 8
0
 private void select(SizeEntry sizeEntry)
 {
     if (widthValue == null)
     {
         widthValue = sizeEntry;
         currentSet = defaultSet;
         vc.Invalidate();
         return;
     }
     SizeEntry heightValue = sizeEntry;
     vc.DoResize(12, widthValue.From, heightValue.From, widthValue.To - widthValue.From, heightValue.To - heightValue.From, true);
 }
Exemplo n.º 9
0
 internal override void restart()
 {
     widthValue = null;
     currentSet = defaultSet;
 }
Exemplo n.º 10
0
        internal override void KeyPress(KeyPressEventArgs e)
        {
            if (e.KeyChar >= '0' && e.KeyChar <= '9')
            {
                SizesSetMember ssm = currentSet[e.KeyChar - '0'];
                if (ssm is SizeSubmenuEntry)
                {
                    SizeSubmenuEntry sse = (SizeSubmenuEntry)ssm;
                    currentSet = sse.SubMenu;
                    vc.Invalidate();
                }
                else
                {
                    SizeEntry se = (SizeEntry)ssm;
                    select(se);
                }

            }
            else
            {
                switch (e.KeyChar)
                {
                    case ',':
                    case '.':
                        select(new SizeEntry(-1, -1));
                        break;
                    case '-':
                    case '\b':
                        currentSet = currentSet.Parent;
                        if (currentSet == null)
                        {
                            if (widthValue != null)
                            {
                                widthValue = null;
                                currentSet = defaultSet;
                            }
                            else
                            {
                                vc.NextState = ViewState.START;
                            }
                        }
                        vc.Invalidate();
                        break;
                }
            }
        }
Exemplo n.º 11
0
        static XYSizesViewState()
        {
            // fourths submenu
            new SizesSet(defaultSet, 4,
                new SizeEntry(0, 12), // 0
                new SizeEntry(0, 3), // 1
                new SizeEntry(0, 6),
                new SizeEntry(0, 9),
                new SizeEntry(3, 6),
                new SizeEntry(3, 9), // 5
                new SizeEntry(6, 9),
                new SizeEntry(3, 12),
                new SizeEntry(6, 12),
                new SizeEntry(9, 12)); // 9

            //sixths submenu
            SizesSet sixths = new SizesSet(defaultSet, 6,
                new SizeEntry(0, 12), // 0
                new SizeEntry(0, 2),  // 1
                new SizeEntry(2,4),
                new SizeEntry(4,6),
                new SizeSubmenuEntry("More left-biased sizes"),
                new SizeEntry(2, 10), // 5
                new SizeSubmenuEntry("More right-biased sizes"),
                new SizeEntry(6,8),
                new SizeEntry(8,10),
                new SizeEntry(10, 12)); // 9

            new SizesSet(sixths, 4,
                new SizeEntry(0, 12), // 0
                new SizeEntry(0, 4),  // 1
                new SizeEntry(0, 6),  // 2
                new SizeEntry(0, 8),  // 3
                new SizeEntry(0, 10), // 4
                new SizeEntry(2, 6),  // 5
                new SizeEntry(2, 8),  // 6
                new SizeEntry(2, 10), // 7
                new SizeEntry(2, 12), // 8
                new SizeEntry(4, 8)); // 9
            new SizesSet(sixths, 6,
                new SizeEntry(0, 12), // 0
                new SizeEntry(4, 8),  // 1
                new SizeEntry(0, 10), // 2
                new SizeEntry(2, 10), // 3
                new SizeEntry(4, 10), // 4
                new SizeEntry(6, 10), // 5
                new SizeEntry(2, 12), // 6
                new SizeEntry(4, 12), // 7
                new SizeEntry(6, 12), // 8
                new SizeEntry(8, 12));// 9
        }
Exemplo n.º 12
0
 public SizeSubmenuEntry(string t)
 {
     subMenu = null;
     title = t;
 }