Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 12 NOV 2019 03:25:45PM Richard Hunt wrote:

OI Version 9.4

I am fine tuning my edit table procedures. I have some SENDMESSAGE information, and I was interested in getting a more complete list of edit table SENDMESSAGEs.

For instance I have…

* Sendmessage equates.

* Number Args Description.

* 1060 Get current row.

* 1083 Select row, arg3… 0=unselect 1=select.

* 1085 Select all rows, arg3… 0=unselect 1=select.

* 1086 Get row select count.

* 1088 Get row select first.

* 1089 Get row select next.

* 1105 0,0 Get visible rows.

* 1106 0,0 Get visible columns.

* 1107 Get notify row.

* 1108 Get notify column.

* 1115 Get current row selection.

* 1120 1,0 Get row height.

* 1120 2,0 Get row total width.

* 1120 3,0 Get row header height.

* 1120 4,0 Get row number column width.

ROW_HEIGHT = SENDMESSAGE(ET_HANDLE,1120,1,0)

ROW_TOTAL_WIDTH = SENDMESSAGE(ET_HANDLE,1120,1,0)

ROW_HEADER_HEIGHT = SENDMESSAGE(ET_HANDLE,1120,1,0)

ROW_NUMBER_COLUMN_WIDTH = SENDMESSAGE(ET_HANDLE,1120,1,0)

This helps me to position and size the edit table within my window.

It would be nice to have more SENDMESSAGE information so that I can do more. Most important would be the vertical and horizontal scrollbars.

I am using child handles to determine if the vertical and horizontal scroll bars exist.


At 12 NOV 2019 06:35PM Carl Pates wrote:

Richard,

Is this OI9 or OI10?

Thanks

Carl Pates


At 13 NOV 2019 01:29PM Richard Hunt wrote:

I am currently working with OI Version 9.4

Would OI Version 10 be different? Different edit table DLL's?


At 14 NOV 2019 08:15AM Carl Pates wrote:

Richard,

The v10 EditTable was rewritten from scratch for several reasons, one of those being to remove the reliance on raw SendMessage calls and style bits - everything is now available as properties and methods.

Having said that, the v10 EditTable does support some messages for backwards compatibility as well as the old style bits. The former message API was never documented as part of the product, so only the parts that Rev have used in OI internally have been kept. If there's something you think is critical that should be there please let us know, but the entire message API will not be implemented as this would be a waste of everyone's time and add a big support burden. Style bits (column and control) were documented so are fully supported and should be able to be used without a problem.

Carl Pates


At 14 NOV 2019 01:24PM Richard Hunt wrote:

Oi Version 9.4

If you wanted to resize the width of the editable horizontally due to a column being widened and the form has the horizontal space to do so, then what would be the correct width for the editable to not need or not display the vertical scrollbar? Or how would I calculate the width of the editable so as to show the all the columns of the editable with or without the vertical scrollbar?


At 14 NOV 2019 03:06PM Richard Hunt wrote:

What I have found out…

1) The SIZE property for an editable gives the width (Field 3) including the vertical scrollbar only if the FORM DESIGNER > More editable properties > styles > "BAR VISIBLE" item is checked. If this item is unchecked then it does not include the vertical scrollbar width.

2) If BAR VISIBLE item is not checked and the vertical scrollbar is visible due to total rows exceeding the visible rows then the SIZE property still does not include the vertical scrollbar width.

3) Using the formula…

A1 = GET_PROPERTY(ET_FOCUS,'ORIG_STRUCT')

A2 = A1<1,31,1>

A3 = SEND_MESSAGE(ET_FOCUS,'COLWIDTH',0)

A4 = SUM(A3)

WIDTH = A2 + A4

WIDTH variable is not complete. It is missing the vertical scrollbar width if the vertical scrollbar is visible. It is also not considering if Windows is "Themed" and the spacing between the editable rows and the vertical scrollbar.

4) If I was to calculate the editable true width I need to use the formula…

A1 = SENDMESSAGE(ET_HANDLE,1120,2,0 ;* Total column width (similar to COLWIDTH).

A2 = SENDMESSAGE(ET_HANDLE,1120,4,0 ;* Row Label/number column width (similar to <1,31,1> except that this logic takes into consideration if the row label/number is currently visible or currently being used).

A3 = GETSYSTEMMETRICS(2) :* Vertical scrollbar width

A4 = GET_PROPERTY(ET_FOCUS,'THEMED')

WIDTH = A1 + A2 + A3 + (A2 GT 0) + (THEMED * 2)

IF VERTICAL_SCROLLBAR_VISIBLE THEN ;* The trick is how to determine if the vertical scrollbar is visible.

WIDTH += A3 + (THEMED * 2) + 1

END

Item 4 formula gives the maximum width or total width the editable requires to show all columns. Now I can properly determine the proper resizing of the window (form) if I want to show the full width of the editable. I can now center the editable within the window (form) or selected area.


At 15 NOV 2019 05:48AM Carl Pates wrote:

Richard,

For v10:

The DTM_GETDTMETRICS (1120 in your example) is still supported, so your code there will still work if you wish. The COLWIDTH method is still supported as well.

You can easily tell in v10 if the scrollbar is visible because it's actually just another object the same as any other OI control. it has a name of "$VSCROLL" (Although you can use it's properties you should only ever GET them as it's "owned" by the EditTable).

   

   bVScrollVisible = get_Property ( etID : ".$VSCROLL", "VISIBLE" )

   bVScrollWidth  = get_Property ( etID : ".$VSCROLL", "WIDTH" )



   bRowHeaderVisible =  get_Property( etID, "SHOWROWHEADERS" )

   nRowHeaderWidth  = get_Property( etID : ".COLUMNS", "WIDTH", 0 ) ;



   // The SYSTEM object exposes the GetSystemMetrics function directly, removing the need for

   // an API call

   equ SM_CXVSCROLL$ to 2

   nValue = get_Property( "SYSTEM", "METRICS", SM_CXVSCROLL$ )

 

You don't need to worry about theming - all value returned are true values. To take into account the "border" (i.e the non-client area) you use the difference between the SIZE width and the CLIENTSIZE width.

Carl Pates

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/77ad074b223c8047a6a3e0aaeed75074.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1