Dyalog / ewc-client

Other
1 stars 4 forks source link

Implement GetFocus and GetTextSize Methods #119

Closed mkromberg closed 8 months ago

mkromberg commented 9 months ago

We need a mechanism to invoke methods, the first two being GetFocus and GetTextSize. I suggest we call the messages "WX", X for execute. Examples:

{"WX":{"Method":"GetFocus","ID":"F1","Info":[]},"WGID":"123"} Expected Response: {"WX":{"Info":["EDIT1"],"WGID":"123"}} Explanation: The focus is currently in object EDIT1 within F1.

{"WX":{"Method":"GetTextSize","ID":"F1","Info":[["Hello","World"],"F1.FntSys"]},"WGID":"124"} Expected Response: {"WX":{"Info":[32,39],"WGID":"124"}} Explanation: The two-row text will be 32 pixels high and 39 pixels wide.

Note that for GetTextSize, the font is optional (Info may only have one element).

Demo_Issue119 will send these messages and validate the responses.

mkromberg commented 8 months ago

Demo_Issue119 has been updated so that it creates two text objects and then draws a box around each one using the result of GetTextSize. The boxes should exactly match the size of the text, but at the moment it looks like this:

image

Note that the first box has the wrong size, and the second box does not appear at all.

mkromberg commented 8 months ago

The Win32 screen shot look like this, with GetTextSize returning [26,28] and [20,41]. image