Forum Discussion

rcain's avatar
rcain
Occasional Contributor
10 years ago

How do I tell if there is a checkbox rowheader on a sftTreeControl32ocx

I have a sfttreecontrol32ocx object.  With current code to click on a particular cell I calculate the left in a for loop adding the ColumnWidth:

For nIndex = 0 To nAdjustedCol
   nLeft = nLeft + oInteraction.guiObject.ColumnWidth(nIndex)
Next

 

However with the control I am working with now there is a checkbox rowheader at the very left of the control.  It does not move when I rearrance the columns, appears like a locked row in excel (doesnt move).  Having this row header throws off the above Left calculation.

 

I cannot figure out what property to use to determine if this checkbox is there or not.  

 

Any thoughts?

  • Do you have access to the devs? They'll know best how they've implemented it.

     

    Also, I'm wondering if individual cells may actually contain location proerties to save you having to calculate the co-ordinates of a cell you want? I'm assuming the cells themselves don't have a "Click" method which is why you need their co-ordinates within the container?

     

    I don't know the particular control you're dealing with, but Delphi Tree nodes have a "DisplayRect" property which gives me back it's relative poisition within the control. Again, the devs will be able to tell you if something like this is available within the control you're using.

     

    This: http://www.softelvdm.com/Docs2/SftTree%20OCX%207.0/SftTreeItem_GetPosition.html

     

    ... looks like it might be of some use?

    • rcain's avatar
      rcain
      Occasional Contributor

      Colin,

      I could have access to the developers, however this is not an easy process.

       

      Our users simply specify a column or row index they wish to interact with, (ex columnindex=1;rowindex=2) and I have to calculate where that is on this grid.

       

      I looked at your sftTree link but my version did not have any rowheaders.width property.

       

      My hope is there is a Propertie I am not seeing that will tell me a) when a rowheader exists b)how wide this rowheader is

      • Colin_McCrae's avatar
        Colin_McCrae
        Community Hero

        Whats the application written in? It may need to be compiled with debug info on to allow you access to native properties such as those in my link.

         

        Thats certainly the case with the Delphi grids I work with, Without debug info, they would be pretty much impossible to test.

         

        And mine is the same. Data driven by the user. They specify the column/row name/number (some are named, some not, just make life more interesting). I need to deduce what they're trying to do from that by working out whats on screen, and whats actually available via the underlying dataset. Takes a bit of working out in some cases. They're not the simplest of controls to interact with. Especially if you try and do it in such a generic way ...