Пример #1
0
        public SpritesetForm(ProjectMainForm parent, Spriteset ss)
        {
            m_parent = parent;
            m_ss     = ss;

            InitializeComponent();

            MdiParent       = parent;
            FormBorderStyle = FormBorderStyle.FixedToolWindow;
            StartPosition   = FormStartPosition.Manual;
            Visible         = false;
            ControlBox      = false;

            if (m_ss.IsBackground)
            {
                Text = "Tileset '" + ss.Name + "'";
            }
            else
            {
                Text = "Spriteset '" + ss.Name + "'";
            }

            cbPalette.Items.Add(ss.Palette.Name);
            cbPalette.SelectedIndex = 0;
        }
Пример #2
0
        public MapForm(ProjectMainForm parent, Map m, Spriteset ss, Sprite s)
        {
            m_parent = parent;

            m_ss = ss;

            InitializeComponent();

            SetMap(m);
            m_toolbox   = new Toolbox_Map();
            m_optionbox = new Optionbox_Map();

            MdiParent       = parent;
            FormBorderStyle = FormBorderStyle.SizableToolWindow;
            StartPosition   = FormStartPosition.Manual;
            Visible         = false;
            ControlBox      = false;

            // Set to 16x.
            cbZoom.SelectedIndex = (int)ZoomLevel.Zoom_16x;
            cbZoom.Enabled       = false;

            m_tileSpriteX = -1;
            m_tileSpriteY = -1;
        }
Пример #3
0
 public UndoMgr(ProjectMainForm owner, TabMgr.TabId id)
 {
     m_owner    = owner;
     m_id       = id;
     m_history  = new List <UndoAction>();
     m_nCurrent = -1;
 }
Пример #4
0
        public Palette256Form(ProjectMainForm parent, Palette256 p)
        {
            m_parent  = parent;
            m_palette = p;

            InitializeComponent();

            MdiParent       = parent;
            FormBorderStyle = FormBorderStyle.FixedToolWindow;
            StartPosition   = FormStartPosition.Manual;
            Visible         = false;
            ControlBox      = false;

            if (m_palette.IsBackground)
            {
                Text = "BgPalette '" + p.Name + "'";
            }
            else
            {
                Text = "Palette '" + p.Name + "'";
            }

            if (m_brushTransparent == null)
            {
                m_brushTransparent = new System.Drawing.Drawing2D.HatchBrush(
                    Options.TransparentPattern,
                    Color.LightGray, Color.Transparent);
            }
        }
Пример #5
0
        public Palette16Form(ProjectMainForm parent, Palette16 p)
        {
            m_parent = parent;
            m_palette = p;

            InitializeComponent();

            MdiParent = parent;
            FormBorderStyle = FormBorderStyle.FixedToolWindow;
            StartPosition = FormStartPosition.Manual;
            Visible = false;
            ControlBox = false;

            if (m_palette.IsBackground)
                Text = "BgPalette '" + p.Name + "'";
            else
                Text = "Palette '" + p.Name + "'";

            if (m_brushTransparent == null)
            {
                m_brushTransparent = new System.Drawing.Drawing2D.HatchBrush(
                        Options.TransparentPattern,
                        Color.LightGray, Color.Transparent);
            }
        }
Пример #6
0
        public MapForm(ProjectMainForm parent, Map m, Spriteset ss, Sprite s)
        {
            m_parent = parent;

            m_ss = ss;

            InitializeComponent();

            SetMap(m);
            m_toolbox = new Toolbox_Map();
            m_optionbox = new Optionbox_Map();

            MdiParent = parent;
            FormBorderStyle = FormBorderStyle.SizableToolWindow;
            StartPosition = FormStartPosition.Manual;
            Visible = false;
            ControlBox = false;

            // Set to 16x.
            cbZoom.SelectedIndex = (int)ZoomLevel.Zoom_16x;
            cbZoom.Enabled = false;

            m_tileSpriteX = -1;
            m_tileSpriteY = -1;
        }
Пример #7
0
        public SpriteForm(ProjectMainForm parent, Spriteset ss, Sprite s)
        {
            m_parent = parent;

            m_ss = ss;

            InitializeComponent();

            SetSprite(s);
            m_toolbox   = new Toolbox_Sprite();
            m_optionbox = new Optionbox_Sprite();
            m_arrowbox  = new Arrowbox_Sprite();

            MdiParent       = parent;
            FormBorderStyle = FormBorderStyle.SizableToolWindow;
            StartPosition   = FormStartPosition.Manual;
            Visible         = false;
            ControlBox      = false;

            // Set to 16x.
            cbZoom.SelectedIndex = (int)ZoomLevel.Zoom_16x;

            if (m_brushTransparent == null)
            {
                m_brushTransparent = new System.Drawing.Drawing2D.HatchBrush(
                    Options.TransparentPattern,
                    Color.LightGray, Color.Transparent);
            }
        }
Пример #8
0
 public RecentFiles(ProjectMainForm form, ToolStripMenuItem menu)
 {
     m_form = form;
     m_menu = menu;
     m_files = Properties.Settings.Default.RecentFiles;
     if (m_files == null)
         m_files = new StringCollection();
     BuildRecentMenu();
 }
Пример #9
0
        public ColorEditor16(ProjectMainForm parent, Palette16Form p16, Subpalette sp)
        {
            m_parent = parent;
            m_winPalette = p16;
            m_subpalette = sp;

            InitializeComponent();

            UpdateColorScrollbars();
        }
Пример #10
0
        public ColorEditor16(ProjectMainForm parent, Palette16Form p16, Subpalette sp)
        {
            m_parent     = parent;
            m_winPalette = p16;
            m_subpalette = sp;

            InitializeComponent();

            UpdateColorScrollbars();
        }
Пример #11
0
 public RecentFiles(ProjectMainForm form, ToolStripMenuItem menu)
 {
     m_form  = form;
     m_menu  = menu;
     m_files = Properties.Settings.Default.RecentFiles;
     if (m_files == null)
     {
         m_files = new StringCollection();
     }
     BuildRecentMenu();
 }
Пример #12
0
        public TabMgr(ProjectMainForm owner, TabId id)
        {
            m_owner = owner;
            m_eId = id;

            m_undo = new UndoMgr(owner, id);

            m_winLists = new List<Form>[(int)FormListType.MAX];
            for (int i=0; i<(int)FormListType.MAX; i++)
                m_winLists[(int)i] = new List<Form>();
        }
Пример #13
0
        public TabMgr(ProjectMainForm owner, TabId id)
        {
            m_owner = owner;
            m_eId   = id;

            m_undo = new UndoMgr(owner, id);

            m_winLists = new List <Form> [(int)FormListType.MAX];
            for (int i = 0; i < (int)FormListType.MAX; i++)
            {
                m_winLists[(int)i] = new List <Form>();
            }
        }
Пример #14
0
        /// <summary>
        /// Initialize a Spritely document.
        /// </summary>
        /// <param name="form">The display form that owns this document</param>
        public Document(ProjectMainForm form)
        {
            m_form = form;

            m_data.Palettes             = new Palettes(this, Palettes.Type.Sprite);
            m_data.Spritesets           = new Spritesets(this, false);
            m_data.BackgroundPalettes   = new Palettes(this, Palettes.Type.Background);
            m_data.BackgroundSpritesets = new Spritesets(this, true);
            m_data.BackgroundMaps       = new Maps(this);
            m_data.BackgroundImages     = new BgImages(this);

            m_data.Filer = new FileHandler(this);
        }
Пример #15
0
        /// <summary>
        /// Initialize a Spritely document.
        /// </summary>
        /// <param name="form">The display form that owns this document</param>
        public Document(ProjectMainForm form)
        {
            m_form = form;

            m_data.Palettes = new Palettes(this, Palettes.Type.Sprite);
            m_data.Spritesets = new Spritesets(this, false);
            m_data.BackgroundPalettes = new Palettes(this, Palettes.Type.Background);
            m_data.BackgroundSpritesets = new Spritesets(this, true);
            m_data.BackgroundMaps = new Maps(this);
            m_data.BackgroundImages = new BgImages(this);

            m_data.Filer = new FileHandler(this);
        }
Пример #16
0
        public BgImageListForm(ProjectMainForm parent, BgImages bmis)
        {
            m_parent   = parent;
            m_bgimages = bmis;

            InitializeComponent();

            MdiParent       = parent;
            FormBorderStyle = FormBorderStyle.FixedToolWindow;
            StartPosition   = FormStartPosition.Manual;
            Visible         = false;
            ControlBox      = false;
            Text            = "Background Images";
        }
Пример #17
0
        public ColorEncodingView(ProjectMainForm parent, Subpalette p)
        {
            m_parent = parent;

            InitializeComponent();
            this.DialogResult = DialogResult.No;

            m_subpalette = p;

            AdjustColorScrollbars();

            if (m_brushTransparent == null)
            {
                m_brushTransparent = new System.Drawing.Drawing2D.HatchBrush(
                        Options.TransparentPattern,
                        Color.LightGray, Color.Transparent);
            }
        }
Пример #18
0
        public ColorEncodingView(ProjectMainForm parent, Subpalette p)
        {
            m_parent = parent;

            InitializeComponent();
            this.DialogResult = DialogResult.No;

            m_subpalette = p;

            AdjustColorScrollbars();

            if (m_brushTransparent == null)
            {
                m_brushTransparent = new System.Drawing.Drawing2D.HatchBrush(
                    Options.TransparentPattern,
                    Color.LightGray, Color.Transparent);
            }
        }
Пример #19
0
        public SpritesetForm(ProjectMainForm parent, Spriteset ss)
        {
            m_parent = parent;
            m_ss = ss;

            InitializeComponent();

            MdiParent = parent;
            FormBorderStyle = FormBorderStyle.FixedToolWindow;
            StartPosition = FormStartPosition.Manual;
            Visible = false;
            ControlBox = false;

            if (m_ss.IsBackground)
                Text = "Tileset '" + ss.Name + "'";
            else
                Text = "Spriteset '" + ss.Name + "'";

            cbPalette.Items.Add(ss.Palette.Name);
            cbPalette.SelectedIndex = 0;
        }
Пример #20
0
        public BgImageForm(ProjectMainForm parent, BgImage bgi)
        {
            m_parent  = parent;
            m_bgimage = bgi;

            InitializeComponent();

            m_toolbox = new Toolbox_BgImage();

            MdiParent       = parent;
            FormBorderStyle = FormBorderStyle.SizableToolWindow;
            StartPosition   = FormStartPosition.Manual;
            Visible         = false;
            ControlBox      = false;

            // Set to 16x.
            cbZoom.SelectedIndex = (int)ZoomLevel.Zoom_16x;
            cbZoom.Enabled       = false;

            lNoImage.Visible = false;
        }
Пример #21
0
        const int k_pxBackgroundImageIdealWidth = 598; //590;

        public static void ResizeMainForm(ProjectMainForm form)
        {
            int pxScreenWidth  = Screen.PrimaryScreen.WorkingArea.Width;
            int pxScreenHeight = Screen.PrimaryScreen.WorkingArea.Height;

            // The size of the window - default to entire screen.
            int pxWidth  = pxScreenWidth;
            int pxHeight = pxScreenHeight;

            // Calc width of window frame (left + right side).
            int pxFrameWidth = form.Width - form.ClientSize.Width + 6;

            // The background map screen is the widest, so we use the form widths
            // to determine the best window size.
            int pxBgWidth = k_pxSpritesetWidth + k_pxSprite1IdealWidth
                            + k_pxBackgroundMapIdealWidth + pxFrameWidth;

            if (pxScreenWidth >= pxBgWidth)
            {
                pxWidth = pxBgWidth;
            }

            if (pxScreenHeight >= k_pxBackgroundMapIdealHeight)
            {
                pxHeight = k_pxBackgroundMapIdealHeight;
            }

            // Make sure the entire window is visible on the screen.
            System.Drawing.Point ptLocation = form.Location;
            if (ptLocation.X + pxWidth > pxScreenWidth)
            {
                ptLocation.X = pxScreenWidth - pxWidth;
            }
            if (ptLocation.Y + pxHeight > pxScreenHeight)
            {
                ptLocation.Y = pxScreenHeight - pxHeight;
            }
            form.Location = ptLocation;
            form.Size     = new System.Drawing.Size(pxWidth, pxHeight);
        }
Пример #22
0
        public UndoHistoryForm(ProjectMainForm owner)
        {
            m_owner = owner;

            InitializeComponent();
        }
Пример #23
0
 public TutorialTestForm(ProjectMainForm parent)
 {
     InitializeComponent();
 }
Пример #24
0
        public static void ResizeMainForm(ProjectMainForm form)
        {
            int pxScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;
            int pxScreenHeight = Screen.PrimaryScreen.WorkingArea.Height;

            // The size of the window - default to entire screen.
            int pxWidth = pxScreenWidth;
            int pxHeight = pxScreenHeight;

            // Calc width of window frame (left + right side).
            int pxFrameWidth = form.Width - form.ClientSize.Width + 6;

            // The background map screen is the widest, so we use the form widths
            // to determine the best window size.
            int pxBgWidth = k_pxSpritesetWidth + k_pxSprite1IdealWidth
                    + k_pxBackgroundMapIdealWidth + pxFrameWidth;
            if (pxScreenWidth >= pxBgWidth)
                pxWidth = pxBgWidth;

            if (pxScreenHeight >= k_pxBackgroundMapIdealHeight)
                pxHeight = k_pxBackgroundMapIdealHeight;

            // Make sure the entire window is visible on the screen.
            System.Drawing.Point ptLocation = form.Location;
            if (ptLocation.X + pxWidth > pxScreenWidth)
                ptLocation.X = pxScreenWidth - pxWidth;
            if (ptLocation.Y + pxHeight > pxScreenHeight)
                ptLocation.Y = pxScreenHeight - pxHeight;
            form.Location = ptLocation;
            form.Size = new System.Drawing.Size(pxWidth, pxHeight);
        }
Пример #25
0
        public UndoHistoryForm(ProjectMainForm owner)
        {
            m_owner = owner;

            InitializeComponent();
        }
Пример #26
0
 public UndoMgr(ProjectMainForm owner, TabMgr.TabId id)
 {
     m_owner = owner;
     m_id = id;
     m_history = new List<UndoAction>();
     m_nCurrent = -1;
 }