Esempio n. 1
0
        public AttributeDialog(CharacterHandler handler, Palette palette, Attribute attribute, bool iceColours)
        {
            this.handler = handler;
            Title        = "Select attribute";
            var pos = handler.CharacterDocument.Info.AttributeDialogBounds;

            if (pos != null)
            {
                Bounds = pos.Value;
            }
            else
            {
                ClientSize = handler.CharacterDocument.Info.AttributeDialogSize ?? new Size(260, 260);
            }
#if DESKTOP
            this.Resizable = true;
#endif

            TableLayout layout = new TableLayout(1, 2);

            colours            = new ColourSelection(palette, attribute);
            colours.Size       = new Size(250, 200);
            colours.Selected  += colours_Selected;
            colours.iCEColours = iceColours;
            layout.Add(colours, 0, 0, true, true);

            layout.Add(GenerateButtons(), 0, 1, true, false);

            Content = layout;
        }
Esempio n. 2
0
 Control ColoursControl()
 {
     colours           = new ColourSelection(Handler.CurrentPage.Palette, Handler.DrawAttribute);
     colours.Size      = new Size(250, 220);
     colours.Selected += delegate
     {
         if (colours.HasFocus && characterPanel.Visible)
         {
             // now set character
             charTextBox.Focus();
         }
         else
         {
             Result = true;
             Close();
         }
     };
     colours.Changed += delegate
     {
         charTextBox.SetAttribute(this.Attribute);
     };
     return(colours);
 }