Forum Replies Created

  • MrPaul

    Reply To: Spell Checker does not behave as expected for certain words

    Participants 0
    Replies 14
    Last Activity 8 years, 7 months ago

    Hi,

    I'm trying to code around the french quote problem described in my first post. I managed to keep a safe list of prefixes that should be ignored, like “qu'”, but I still need to check the 2nd part of the word to see if it's valid.

    In our custom Spell Checker class, we set the range selection to the current word and call mXmax.Document.IsSpellingCorrect() to see if it's spelled correctly or not. When I manipulate this range selection to ignore the prefix from my safe list, IsSpellingCorrect() still picks up the 2nd part even though it's a valid word on its own. I have a feeling it's because it isn't surrounded by spaces, so it still thinks it's part of the prefix I'm trying to ignore.

    I can't seem to find any documentation about how this works, and there were no results for IsSpellingCorrect in the documentation:
    http://xmetal.com/webhelp/en/xmetaldeveloper/pg/7.0/pg.html

    Ideally, I'd like to be able to check the spelling of a particular word; in my example above I'd like to call something like IsSpellingCorrect(“on”) and if it returns true, I continue on, otherwise I'd show the list of suggestions.

    Is this possible?

    Reply

    MrPaul

    Reply To: Spell Checker does not behave as expected for certain words

    Participants 0
    Replies 14
    Last Activity 8 years, 8 months ago

    Thanks for the response. It helps to know that this is due to that word not being in your dictionary and not some kind of other obscure bug. We will add it to the user defined list.
    Any thoughts about the quote problem when using Canadian French? Not sure how to work around that one, since it doesn't pick up the entirety of the contraction, and only the first part…

    Reply

    MrPaul

    Reply To: Using xml:lang Values to Control Spell Checking

    Participants 0
    Replies 14
    Last Activity 8 years, 11 months ago

    Derek,

    Some of our documents have mixed languages. Mainly, I need to be able to switch between “en-ce” and “fr-cf” depending on the current position of the cursor (we have a custom spell checking module that loops through the document using a range and calls XMAX spell checking functionality). In our XML, the different language sections have a lang=1 or lang=2 attribute that I can use to determine which spell checker dictionary to use.

    My question is: in which XMAX call does the value of xml:lang get read to determine if the word is spelled correctly or not? Is it inside the call to ActiveDocument.IsSpellingCorrect()? Is it a bad idea to continuously change the value of the document's doctype on the fly?

    I tried testing this but using the example you provided, I am getting an “attribute exists” exception from XMAX the 2nd time it tries to set the value (since the code that checks if the word is spelled correctly loops as the range changes its selection).

    Also, the first time it's added, when I view the ActiveDocument.Document.xml value, I cannot see the set xml:lang attribute. Is that normal?

    Can I call docType.addAttribute with an element that isn't the root (in the 1st param)? How should I go about this?

    Thank you.

    EDIT: Just to add to this, if I check docType.hasAttribute(“Root”, “xml:lang”) before adding it, it will properly return false the 1st time, then true the 2nd time as to not re-add it. However, when I get to a section in the XML that is in a different language, I'd like to update this value. What's weird is that docType.attributes is empty and there doesn't seem to be a “updateAttribute” or other similar function. And again, if I re-call docType.addAttribute, it crashes with the error: “attribute exists.”. I tried playing with the intDeclType param in addAttribute (I noticed you set this to sqDTFIXED or 3 in your example) but to no avail.
    The good news is that when the xml:lang attribute is set to the value “en-ce” or “fr-cf”, the proper dictionaries are used! I just need to be able to update this dynamically.

    Reply

    MrPaul

    Reply To: Using xml:lang Values to Control Spell Checking

    Participants 0
    Replies 14
    Last Activity 9 years ago

    I have a few questions.

    1. Is all of the information still accurate for XMAX v7?

    2. We've noticed the following behavior when playing with the xml:lang attribute:

    xml:lang=”en” accepts “color” and “colour” as valid words.
    xml:lang=”en-US” accepts “color” and stops on “colour” (expected)
    xml:lang=”en-CA” does not seem to work. It doesn't even stop on “sfsdfsdfsf”.
    When the xml:lang attribute is omitted entirely, it accepts “colour” but stops on “color” (is this en-CA?)

    xml:lang=”fr-CA” does not work either. All words are ignored.
    xml:lang=”fr” seems to work for the french dictionary, but is it Canadian French?

    We need to be able to specify en-CA and fr-CA languages for the spell checker. How can we accomplish this?
    (Also, is there an .ini file when using XMAX? I could not find one.)

    3. Is there an API function that we can call instead of setting the xml:lang attribute (since our current DTD does not allow it)?

    Thanks.

    Reply

    MrPaul

    Reply To: Error when trying to set attribute value

    Participants 0
    Replies 14
    Last Activity 9 years ago

    My issue has been resolved. It was related to setting range.ReadOnlyContainer = True for the root node of that document. Some other code prior to setting the attribute value was being called.

    So, if you try to set nodeValue on a node that has been set as readonly (or its parent was set to readonly), it will return that error!

    Reply

    MrPaul

    Reply To: InsertWithTemplate example

    Participants 0
    Replies 14
    Last Activity 9 years, 1 month ago

    Thanks Derek. I already had a ctm file from the application we're migrating. It's just that there weren't any “Templates” in it so I'm still not sure why InsertWithTemplate was working in v3, but doesn't in xmax v7 unless I add the missing configuration in the ctm file. It works when I do that.

    For anyone else trying to accomplish the same thing, you can specify what to automatically insert when calling InsertWithTemplate when adding the following to the ctm file. For example:

    [code]
     
     
       
     
    [/code]

    Then when calling:

    [code]Selection.InsertWithTemplate(“Line”)[/code]

    It will insert this automatically:

    [code][/code]

    It works!

    Reply

    MrPaul

    Reply To: Search and Replace

    Participants 0
    Replies 14
    Last Activity 9 years, 2 months ago

    The above code works! We just upgraded to version 7 and I couldn't figure out why the Find and Replace All wasn't working, until I remembered this post. Thanks!

    Reply

    MrPaul

    Reply To: Windows Control Panel ‘Programs and Features’ won’t let me uninstall XMetal 6.0

    Participants 0
    Replies 14
    Last Activity 9 years, 4 months ago

    The MS tool worked for me! Thanks.

    Reply

    MrPaul

    Reply To: XMAX API call for Thesaurus

    Participants 0
    Replies 14
    Last Activity 9 years, 5 months ago

    Too bad. Yes, ideally GetSynonyms and GetAntonyms would suit our needs since we'd have to make our own bilingual custom dialog. Please keep me posted on the other possible solution though since we are using XMAX v6 at the moment.

    Reply

    MrPaul

    Reply To: Search and Replace

    Participants 0
    Replies 14
    Last Activity 9 years, 8 months ago

    I am experiencing some problems with the “whole words” flag for replace all as well. Can you confirm if this is also an issue (in addition to match case)?
    In which version of XMAX has this been fixed? We are using XMAX version 6.0.0.159.

    Reply

    MrPaul

    Reply To: Show or Hide inline images

    Participants 0
    Replies 14
    Last Activity 9 years, 9 months ago

    Ok, thanks.

    Reply

    MrPaul

    Reply To: Set properties of multiple selected table cells

    Participants 0
    Replies 14
    Last Activity 9 years, 10 months ago

    Is this still the case for XMAX v6 or later? Is there still no way to access the selected cells of a CALS table?

    Reply

    MrPaul

    Reply To: Moving Rows and Columns for CALS Table

    Participants 0
    Replies 14
    Last Activity 9 years, 10 months ago

    I'm not sure I understand your steps 3 and 4. When you talk about moving the range backwards, do you mean using ActiveDocument.Range.MoveUp()? Do I need to move up more than once to check if it has a row above the current selection or will MoveUp always go to the previous row, even if the selection is in the top most tbody row (row 2a in my example) and the table has a header?

    [code]
     

       
                           

           
              header 1a
              header 1b
              header 1c
           

         

         

           
      row 2a
              row 2b
              row 2c
           


      row 3a
      row 3b
      row 3c
           

         

       
     

    [/code]

    I'm also unsure about what you mean for checking that previousSibling is also a row. Could you provide an example?

    I have something like this:

    [code]var rng = ActiveDocument.Range;
    rng.MoveUp();
    if (Selection.IsEqual(rng)) {
    // cannot move row up
    else {
    // can move row up
    }[/code]

    I was hoping that rng.MoveUp() would stay put when the selection is in “header 1a” in my example, but it still seems to change so this code always falls into the else…

    Reply

    MrPaul

    Reply To: Move cursor inside node from selection

    Participants 0
    Replies 14
    Last Activity 9 years, 10 months ago

    Informative, thank you.

    Reply

    MrPaul

    Reply To: XMAX Full API Documentation for version 6 and 7

    Participants 0
    Replies 14
    Last Activity 9 years, 11 months ago

    Document.InlineMediaVisible is also present in the readme of version 6 under new APIs (with the exact same description). What's changed in version 7? How would we set this in .NET using the AxXMetaLControlLib.AxXMetaLControl object? In VB6, we seem to be able to access it but it's read only. So how do we set it?

    Thanks.

    Reply

Products
Downloads
Support