예제 #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
파일: MapForm.cs 프로젝트: nnn1590/spritely
        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
파일: UndoMgr.cs 프로젝트: nnn1590/spritely
 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;
 }