Re: [MSEide-MSEgui-talk] Twidgetgrid and assitive interface.

2016-12-06 Thread Fred van Stappen
>> ;-) Yes, thanks but... does it search for frame.Caption or hint too ? (I 
>> know, I am insupportable.)

> Sure.

That it does search for frame or that I am insupportable or both ? ;-)

OK I will do some comparaison and decide after if i switch to 
getassistivecaption().
The thing is that with "WhatName" procedure, it does a filter and assist only 
the components that I already know and have tested.

Thanks.

Fre;D
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Twidgetgrid and assitive interface.

2016-12-06 Thread Martin Schreiber
On 12/06/2016 01:13 PM, Fred van Stappen wrote:
> 
>> Maybe use "iaSender.getassistivecaption()" instead?
> 
> ;-) Yes, thanks but... does it search for frame.Caption or hint too ? (I 
> know, I am insupportable.)
> 
Sure. The purpose of iassistiveclient is to provide the assistive server
with the needed information without the requirement that the server must
know the actual widget.
"
function twidget.getassistivecaption(): msestring;
begin
 if fframe <> nil then begin
  result:= fframe.getassistivecaption();
 end
 else begin
  result:= '';
 end;
end;

function tcustomcaptionframe.getassistivecaption(): msestring;
begin
 result:= getcaption();
end;

function tmenuitem.getassistivecaption(): msestring;
var
 item1: tmenuitem;
begin
 if getactiveitem(item1) then begin
  result:= item1.finfo.captiontext;
 end
 else begin
  result:= '';
 end;
end;

function tcustombutton.getassistivecaption(): msestring;
begin
 if factioninfo.captiontext <> '' then begin
  result:= factioninfo.captiontext;
 end
 else begin
  result:= inherited getassistivecaption();
 end;
end;

function tcustomtabbar.getassistivecaption(): msestring;
begin
 with flayoutinfo do begin
  if (focusedtab >= 0) and (focusedtab < tabs.count) then begin
   result:= tabs[focusedtab].caption;
  end
  else begin
   result:= inherited getassistivecaption();
  end;
 end;
end;
"

 Please remember the signature of "iassistiveclient":
"
 assistiveflagty =
(asf_embedded,asf_grid,asf_gridcell,asf_datetime,asf_menu);
 assistiveflagsty = set of assistiveflagty;

 iassistiveclient = interface(inullinterface)[miid_iassistiveclient]
  function getinstance: tobject;
  function getassistivename(): msestring;
  function getassistivecaption(): msestring;
  function getassistivetext(): msestring;
  function getassistivecaretindex(): int32; //-1 -> none
  function getassistivehint(): msestring;
  function getassistiveflags(): assistiveflagsty;
 {$ifdef mse_with_ifi}
  function getifidatalinkintf(): iifidatalink; //can be nil
 {$endif}
 end;
"

Martin

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Twidgetgrid and assitive interface.

2016-12-06 Thread Fred van Stappen
>> But selecting a "boolean" cell, there is a access violation error (see 
>> attachment twidgetgrid_crash.jpg).

> function TSak.WhatName(iaSender: iassistiveclient): msestring;
> [...]
>  if (Sender is tbooleaneditradio) then
>  begin
>  if (trim(Tbooleaneditradio(Sender).frame.Caption) <> '') then

Well seen Martin ! (Aaaargh, why did I not see it ?)

This solves all:

  [...]
 if assigned(Tbooleanedit(Sender).frame) then
 if (trim(Tbooleanedit(Sender).frame.Caption) <> '') then
  [...]


Many thanks Martin to give your time to check my code.

> Maybe use "iaSender.getassistivecaption()" instead?

;-) Yes, thanks but... does it search for frame.Caption or hint too ? (I know, 
I am insupportable.)

Many thanks Martin, you are very strong.

Fre;D

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Twidgetgrid and assitive interface.

2016-12-05 Thread Martin Schreiber
On 12/05/2016 10:23 PM, Fred van Stappen wrote:
> 
> Hello.
> 
> 
> This a continuation of:
> 
> 
> On Monday 05 December 2016 15:29:08 Fred van Stappen wrote:
>>
>> But there are some that make trouble.
>>
>> It is those in projectoptionsfo with boolean cells.
>> There is a Access violation error when selecting a "boolean" cell (cell
>> with X).
>>
>> I do not find how to fix this.
> 
> When selecting a "normal" cell, all is ok, the cell is said (see attachment 
> twidgetgrid_ok.jpg).
> 
> But selecting a "boolean" cell, there is a access violation error (see 
> attachment twidgetgrid_crash.jpg).
> 
"
function TSak.WhatName(iaSender: iassistiveclient): msestring;
[...]
  if (Sender is tbooleaneditradio) then
  begin
if (trim(Tbooleaneditradio(Sender).frame.Caption) <> '') then

   << frame is nil by default for grid widgets

  Result := 'radio button, ' + Tbooleaneditradio(Sender).frame.Caption
else
 if (Tbooleaneditradio(Sender).hint <> '') then
  Result := 'radio button, ' + Tbooleaneditradio(Sender).hint
  else
  Result := 'radio button, ' + Tbooleaneditradio(Sender).Name;
  end
"
Maybe use "iaSender.getassistivecaption()" instead?

Please remember the iassistiveclient interface:
"
 iassistiveclient = interface(inullinterface)[miid_iassistiveclient]
  function getinstance: tobject;
  function getassistivename(): msestring;
  function getassistivecaption(): msestring;
  function getassistivetext(): msestring;
  function getassistivecaretindex(): int32; //-1 -> none
  function getassistivehint(): msestring;
  function getassistiveflags(): assistiveflagsty;
 {$ifdef mse_with_ifi}
  function getifidatalinkintf(): iifidatalink; //can be nil
 {$endif}
 end;
"

Martin

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk