Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Method GetItemRect

Rect = send_message(ctrlentid , 'GetItemRect' , 'Item') returns some garbage data.

Comments

  • Ed,

    Just a quick response that my engineer for this control, Kevin, has been on holiday for the past couple of days. He will respond next week when he returns. I didn't want you to think we were ignoring the query.

    In the meantime, can you offer any more details that would make this easier to isolate? Does it happen all the time? Are you running in UTF8 mode?
  • edited June 2016
    Hi Don,
    Thank you for the response.
    We are not running UTF8.
    We also tried the last version available.
    Everytime we see garbagedata.
    We called this method from an onclick event with the purpose to create an editline on the rect position to let the user change the name of the item. At the moment we use a messagebox for this, so there is no urge for a solution.
    While we are testing/debugging/running with this control OI crashes frequently. What is the best practice for setting up this OLE? (QUALIFY_EVENT thingy).

    Regards
    Ed Keeman
  • Hi Ed,

    Regarding the crashing, please post screenshots of the crash when this happens. What version of OI are you using and what version of the SRP Tree control are you using?

    The SRP Tree control should be qualified as asynchronous, which is the default unless you specifically set <4> to a value of 1 or 2.
  • Prerelease version 4.0.1 RC12 fixes the GetItemRect method. Download it and give it a try.
  • Hi Kevin,
    I have tested this release.
    The data is a correct record now, but with 50% wrong information
    x = allways zero
    y = correct
    width = width of the control, not the item
    height = correct

    Our license is at version 3 , can we upgrade?

    Regards
    Ed
  • edited June 2016
    Moderator,
    Please remove this message.
  • Ed,

    I was under the impression that the property still doesn't work correctly. Is that correct? I was waiting to see if this would get resolved before discussing your upgrade options. Either way, if you want to upgrade now or later, we should discuss this via email. Please send me a note regarding how you want to proceed.
  • So, the data being returned is the data intended to be returned. It is the entire visible rectangle of an item. I take it you desire a different metric. What dimensions are you after?
  • Kevin,
    We want the metric from the label/data from one item.
    For example in a tree there is one item selected, you can see this selection because of its blue background.
    We expect that GetItemRect returns the rect of that blue square.

    Regards Ed
  • edited June 2016
    I've added a new method called GetItemEx. It takes two parameters. The first is an item key, the second is a keyword indicating what rectangle you want. Supported keywords are "Button", "CheckBox", "Content", "Edit", "Image", "Selectable", "Swatch", and "Text". I will document these officially, but for now, you might want to "Text", which gets you the dimensions of the text. "Selectable" gets you the dimensions of the rectangle where the user may click to select the item, so maybe that's an option as well. Here an example:

    RectText = Send_Message(@Window:".OLE_TREE", "OLE.GetItemRectEx", SelItem, "Text")

    Download 4.0.1 RC13 and give it a try.
  • Thanks Kevin,
    This week I'm not working.
    Next week I will evaluate this new method.

    Regards Ed
Sign In or Register to comment.