Editor

Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 45
  1. #16
    Infraction Banned Mars is offline
    MemberRank
    Jul 2014 Join Date
    271Posts

    Re: Editor

    Quote Originally Posted by Rekt View Post
    Well I only have the iQuest source for the 08 files, but I hope it helps.

    https://mega.co.nz/#!IIcxyazD!PpRM_w...BCsdaJ97nIVQDk
    I'll look at this. Thank you

  2. #17
    Apprentice skeleten is offline
    MemberRank
    Jun 2010 Join Date
    23Posts

    Re: Editor

    Will you make this open source or closed source? If you plan to open source it I'd recommend having a repository. If you'd like to have it closed sourced at first you can host it @ bitbucket, they have private repos.
    Once the weekend is over, I'd might be able to help you debug that NullRefrenceException

  3. #18
    Infraction Banned Mars is offline
    MemberRank
    Jul 2014 Join Date
    271Posts

    Re: Editor

    Quote Originally Posted by skeleten View Post
    Will you make this open source or closed source? If you plan to open source it I'd recommend having a repository. If you'd like to have it closed sourced at first you can host it @ bitbucket, they have private repos.
    Once the weekend is over, I'd might be able to help you debug that NullRefrenceException
    I'll eventually make it open sourced.

  4. #19
    Apprentice skeleten is offline
    MemberRank
    Jun 2010 Join Date
    23Posts

    Re: Editor

    That's nice and reassuring to hear - thank you for that.

  5. #20
    Infraction Banned Mars is offline
    MemberRank
    Jul 2014 Join Date
    271Posts

    Re: Editor

    Quote Originally Posted by skeleten View Post
    That's nice and reassuring to hear - thank you for that.
    Yeah, I want to get at least a base version out before I make it open sourced. By base version I mean have everything working.

    - - - Updated - - -

    Updated main post with the code for the table save button in hope of some help.
    Last edited by Mars; 08-02-15 at 12:12 AM.

  6. #21
    Apprentice skeleten is offline
    MemberRank
    Jun 2010 Join Date
    23Posts

    Re: Editor

    Do you have any known steps to reproduce the issue?
    It seems like `document` might be zero, so, you have to check if there is any document to begin with. Also, how do you assign the `document` variable?

  7. #22
    Infraction Banned Mars is offline
    MemberRank
    Jul 2014 Join Date
    271Posts

    Re: Editor

    Quote Originally Posted by skeleten View Post
    Do you have any known steps to reproduce the issue?
    It seems like `document` might be zero, so, you have to check if there is any document to begin with. Also, how do you assign the `document` variable?
    Open table event:
    Code:
                XtraTabPage addedpage = new XtraTabPage();
                OpenFileDialog open = new OpenFileDialog();
                open.Title = "Select table";
                open.Filter = "Text files (tab delimited|*.txt";
                if (open.ShowDialog() == DialogResult.OK)
                {
                    path = open.FileName;
                    addedpage = Tabs.TabPages.Add(open.SafeFileName);
                    Tabs.SelectedTabPage = addedpage;
                    if (open.FilterIndex == 1)
                    {
                        DevExpress.XtraSpreadsheet.SpreadsheetControl sheet = new DevExpress.XtraSpreadsheet.SpreadsheetControl();
                        sheet.Dock = DockStyle.Fill;
                        addedpage.Controls.Add(sheet);
                        IWorkbook document = sheet.Document;
                        using (FileStream stream = new FileStream(open.FileName, FileMode.Open))
                        {
                            document.LoadDocument(stream, DocumentFormat.Text);
                        }
                    }
                }
    Save table event:
    Code:
            IWorkbook document;
            private void SaveTable_ItemClick(object sender, ItemClickEventArgs e)
            {
                var save = XtraMessageBox.Show("Are you sure you want to save this table?", "Save file", MessageBoxButtons.YesNo);
                try
                {
                    if (save == System.Windows.Forms.DialogResult.Yes)
                    {
                        document.SaveDocument(DocumentFormat.Text);
                        Status.Caption = "Table(s) saved.";
                    }
                }
                catch(System.NullReferenceException ex)
                {
                    Status.Caption = "Object reference not set to an instance of an object.";
                }
            }

  8. #23
    Apprentice skeleten is offline
    MemberRank
    Jun 2010 Join Date
    23Posts

    Re: Editor

    The easy way is to check at the start of the event if the document is null like
    if(document == null) {
    // messagebox?
    return;
    }

    but that wont fix the real problem, unless the error occurs only if you have no open documents

  9. #24
    Success and nothing less Manova is offline
    MemberRank
    Nov 2011 Join Date
    936Posts

    Re: Editor

    Why does everyone create a SHN editor as their first project.

  10. #25
    Infraction Banned Mars is offline
    MemberRank
    Jul 2014 Join Date
    271Posts

    Re: Editor

    Quote Originally Posted by Manova View Post
    Why does everyone create a SHN editor as their first project.
    This isn't an SHN editor. It has support for SHN files, but it's not constricted to just this one type of file.

  11. #26
    Success and nothing less Manova is offline
    MemberRank
    Nov 2011 Join Date
    936Posts

    Re: Editor

    Yeah, this hasn't been done before.

  12. #27
    Infraction Banned Mars is offline
    MemberRank
    Jul 2014 Join Date
    271Posts

    Re: Editor

    Quote Originally Posted by Manova View Post
    Yeah, this hasn't been done before.
    Not sure if this is sarcasm or not.

  13. #28
    Alpha Member Cyndaquil is offline
    MemberRank
    Mar 2012 Join Date
    EnglandLocation
    2,137Posts

    Re: Editor

    Quote Originally Posted by Mars View Post
    Not sure if this is sarcasm or not.
    Well, it has been done multiple times before, so it can't exactly be sarcasm.

  14. #29
    Infraction Banned Mars is offline
    MemberRank
    Jul 2014 Join Date
    271Posts

    Re: Editor

    A tool for Fiesta to edit multiple file types?

  15. #30
    Apprentice skeleten is offline
    MemberRank
    Jun 2010 Join Date
    23Posts

    Re: Editor

    I think Cedric did some tool a while back that did both SHN as well as shine tables.
    Also, I once did a tool for editing the merchants (it's open source, you may incorparate some parts: https://github.com/skeleten/Merchant-Editor ; it might be outdated though)



Page 2 of 3 FirstFirst 123 LastLast

Advertisement