[Lazarus] Developing a WidgetSet

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Developing a WidgetSet

Free Pascal - Lazarus mailing list
Hello,
If I want to add a functionality like accessibility to WidgetSet, which
package could I use, lcl.lpk, or lclbase.lpk?
Also, how can I rebuilt the package when I modify/add some unit? Do I
need to always rebuild the IDe, or there is a quicker way?
I am thinking about syntax check / quick compilation to incrementally
check and fix semantic / syntax errors.

Thanks

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Developing a WidgetSet

Free Pascal - Lazarus mailing list
On 2017-10-08 21:09, Lubos Pintes via Lazarus wrote:
> If I want to add a functionality like accessibility to WidgetSet, which
> package could I use, lcl.lpk, or lclbase.lpk?

I believe "accessibility" is beyond the scope of the LCL. It is expected
that the underlying GUI toolkit (Qt, GTK, fpGUI etc) implement the
accessibility and will magically be available in your application, if
accessibility is enabled in your desktop environment.

Regards,
   Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Developing a WidgetSet

Free Pascal - Lazarus mailing list

Am 08.10.2017 23:15 schrieb "Graeme Geldenhuys via Lazarus" <[hidden email]>:
>
> On 2017-10-08 21:09, Lubos Pintes via Lazarus wrote:
>>
>> If I want to add a functionality like accessibility to WidgetSet, which
>> package could I use, lcl.lpk, or lclbase.lpk?
>
>
> I believe "accessibility" is beyond the scope of the LCL. It is expected that the underlying GUI toolkit (Qt, GTK, fpGUI etc) implement the accessibility and will magically be available in your application, if accessibility is enabled in your desktop environment.

Not quite as the LCL still nerds to feed the necessary information to the widgetset's accessibility subsystem, especially with custom drawn controls. AFAIK there had been some work in the past to principally prepare the LCL for this...

Regards,
Sven


--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Developing a WidgetSet

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
I think there was some work before. (Afaik only carbon, Mac)

Look at TControl properties AccessibleRole, AccessibleValue,
AccessibleDescription.
lcl\controls.pp line 1639

They refer to  TLazAccessibleObject (line 990)

Then in control.inc line 150   procedure
TLazAccessibleObject.SetAccessibleValue(const AValue: TCaption);
the widgetset is called
   WidgetsetClass :=
TWSLazAccessibleObjectClass(GetWSLazAccessibleObject());
   WidgetsetClass.SetAccessibleValue(Self, AValue);

TWSLazAccessibleObjectClass is at lcl\widgetset\wscontrols.pp line 80
TWSLazAccessibleObject is at line 71.

Search in files how it is sub-classed in carbon. Subclass it the same
way in other widgetset.

If you want to subclass it in win32 go to
lcl\interfaces\win32\win32wsfactory.pas line 131
   function RegisterLazAccessibleObject: Boolean; alias :
'WSRegisterLazAccessibleObject';
see the commented code. only the gtk reference is a copy and paste. it
needs to register the newly created class for win 32.

A few very short explanations:

Each widgetset (win, gtk, carbon, qt...) exports the methods for
registration. the "alias" makes it visible to the linker.
The LCL refers to those as external functions. So the LCL can be linked
against each widgetset.

Also each widgetset inherits from the classes in the parent folder
(generic classes).
e.g. TWSLazAccessibleObject in lcl\widgetset\wscontrols.pp line 71
and carbon inherits: TCarbonWSLazAccessibleObject =
class(TWSLazAccessibleObject)  in lcl\interfaces\carbon\carbonwscontrols.pp

The generic classes are also compiled into the lcl. So the widgetset can
provide the sub classes, and lcl knows how to call them.



On 08/10/2017 21:09, Lubos Pintes via Lazarus wrote:

> Hello,
> If I want to add a functionality like accessibility to WidgetSet,
> which package could I use, lcl.lpk, or lclbase.lpk?
> Also, how can I rebuilt the package when I modify/add some unit? Do I
> need to always rebuild the IDe, or there is a quicker way?
> I am thinking about syntax check / quick compilation to incrementally
> check and fix semantic / syntax errors.
>
> Thanks
>

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Developing a WidgetSet

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
You are quite wrong when you are talking about LCL.
For example, even buttons are not accessible, on the IDE welcome page,
screen reader reports only "button", instead of "StartIDE button", "Help
button", etc. Yes, the button itself is native, but is broken.
Another totally inaccessible component is, probably TTreeview. It is
used in the options dialog where categories are displayed, in the
package explorer etc. TCheckedListBox is yet another example. Code
editor is totally inaccessible, etc, etc.
So again, you are wrong.

Dňa 8. 10. 2017 o 23:15 Graeme Geldenhuys via Lazarus napísal(a):

> On 2017-10-08 21:09, Lubos Pintes via Lazarus wrote:
>> If I want to add a functionality like accessibility to WidgetSet, which
>> package could I use, lcl.lpk, or lclbase.lpk?
>
> I believe "accessibility" is beyond the scope of the LCL. It is expected
> that the underlying GUI toolkit (Qt, GTK, fpGUI etc) implement the
> accessibility and will magically be available in your application, if
> accessibility is enabled in your desktop environment.
>
> Regards,
>    Graeme
>


--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Developing a WidgetSet

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
Thank you Sven for excellent answer. I already know about most of this
stuff. You confirmed that my first small steps on this path were
correct, and I didn't overlook anything. Thank again.

Dňa 9. 10. 2017 o 1:16 Sven Barth via Lazarus napísal(a):

> Am 08.10.2017 23:15 schrieb "Graeme Geldenhuys via Lazarus"
> <[hidden email] <mailto:[hidden email]>>:
>  >
>  > On 2017-10-08 21:09, Lubos Pintes via Lazarus wrote:
>  >>
>  >> If I want to add a functionality like accessibility to WidgetSet, which
>  >> package could I use, lcl.lpk, or lclbase.lpk?
>  >
>  >
>  > I believe "accessibility" is beyond the scope of the LCL. It is
> expected that the underlying GUI toolkit (Qt, GTK, fpGUI etc) implement
> the accessibility and will magically be available in your application,
> if accessibility is enabled in your desktop environment.
>
> Not quite as the LCL still nerds to feed the necessary information to
> the widgetset's accessibility subsystem, especially with custom drawn
> controls. AFAIK there had been some work in the past to principally
> prepare the LCL for this...
>
> Regards,
> Sven
>
>
>


--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Developing a WidgetSet

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
Sorry I replied to wrong message. My thanks and my heart belongs just to
you. :-)
Dňa 9. 10. 2017 o 4:43 Martin Frb via Lazarus napísal(a):

> I think there was some work before. (Afaik only carbon, Mac)
>
> Look at TControl properties AccessibleRole, AccessibleValue,
> AccessibleDescription.
> lcl\controls.pp line 1639
>
> They refer to  TLazAccessibleObject (line 990)
>
> Then in control.inc line 150   procedure
> TLazAccessibleObject.SetAccessibleValue(const AValue: TCaption);
> the widgetset is called
>    WidgetsetClass :=
> TWSLazAccessibleObjectClass(GetWSLazAccessibleObject());
>    WidgetsetClass.SetAccessibleValue(Self, AValue);
>
> TWSLazAccessibleObjectClass is at lcl\widgetset\wscontrols.pp line 80
> TWSLazAccessibleObject is at line 71.
>
> Search in files how it is sub-classed in carbon. Subclass it the same
> way in other widgetset.
>
> If you want to subclass it in win32 go to
> lcl\interfaces\win32\win32wsfactory.pas line 131
>    function RegisterLazAccessibleObject: Boolean; alias :
> 'WSRegisterLazAccessibleObject';
> see the commented code. only the gtk reference is a copy and paste. it
> needs to register the newly created class for win 32.
>
> A few very short explanations:
>
> Each widgetset (win, gtk, carbon, qt...) exports the methods for
> registration. the "alias" makes it visible to the linker.
> The LCL refers to those as external functions. So the LCL can be linked
> against each widgetset.
>
> Also each widgetset inherits from the classes in the parent folder
> (generic classes).
> e.g. TWSLazAccessibleObject in lcl\widgetset\wscontrols.pp line 71
> and carbon inherits: TCarbonWSLazAccessibleObject =
> class(TWSLazAccessibleObject)  in lcl\interfaces\carbon\carbonwscontrols.pp
>
> The generic classes are also compiled into the lcl. So the widgetset can
> provide the sub classes, and lcl knows how to call them.
>
>
>
> On 08/10/2017 21:09, Lubos Pintes via Lazarus wrote:
>> Hello,
>> If I want to add a functionality like accessibility to WidgetSet,
>> which package could I use, lcl.lpk, or lclbase.lpk?
>> Also, how can I rebuilt the package when I modify/add some unit? Do I
>> need to always rebuild the IDe, or there is a quicker way?
>> I am thinking about syntax check / quick compilation to incrementally
>> check and fix semantic / syntax errors.
>>
>> Thanks
>>
>


--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Developing a WidgetSet

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
Thank for all replies, but my original question was overlooked. Can
someone answer it?

Dňa 8. 10. 2017 o 22:09 Lubos Pintes via Lazarus napísal(a):

> Hello,
> If I want to add a functionality like accessibility to WidgetSet, which
> package could I use, lcl.lpk, or lclbase.lpk?
> Also, how can I rebuilt the package when I modify/add some unit? Do I
> need to always rebuild the IDe, or there is a quicker way?
> I am thinking about syntax check / quick compilation to incrementally
> check and fix semantic / syntax errors.
>
> Thanks
>


--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Developing a WidgetSet

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Mon, Oct 9, 2017 at 9:49 AM, Lubos Pintes via Lazarus
<[hidden email]> wrote:
> screen reader reports only "button", instead of "StartIDE button", "Help
> button", etc. Yes, the button itself is native, but is broken.

O wonder why that is so. The button really is a native button. Why
does it not know its caption and name?

Juha
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Developing a WidgetSet

Free Pascal - Lazarus mailing list
*I wonder ...
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Developing a WidgetSet

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sun, Oct 8, 2017 at 11:09 PM, Lubos Pintes via Lazarus
<[hidden email]> wrote:
> Also, how can I rebuilt the package when I modify/add some unit? Do I need
> to always rebuild the IDe, or there is a quicker way?

You can test with any small application. No need to build the whole IDE.
The dependent LCL is compiled automatically when you compile your app.
It goes fast enough.

Juha
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Developing a WidgetSet

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
I reported this problem years ago. If I remember properly, only TBitBtn
has this behaviour.
Of course not all buttons in the IDE have empty names, but those on
options dialog, or welcome page.
Dňa 9. 10. 2017 o 9:14 Juha Manninen via Lazarus napísal(a):
> *I wonder ...
>


--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Developing a WidgetSet

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 2017-10-09 07:49, Lubos Pintes via Lazarus wrote:
> For example, even buttons are not accessible, on the IDE welcome page,
> screen reader reports only "button", instead of "StartIDE button", "Help
> button", etc. Yes, the button itself is native, but is broken.

It seems it is very LCL-widgetset dependent then. If using LCL-fpGUI
widgetset, then accessibility works fine when using SAK (Speech
Assistive Kit). Nothing special is required by LCL itself. At least that
is how it worked last time I tested back in 2015.


Regards,
   Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Developing a WidgetSet

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list

And now I tested this and I am sure, only TBitBtn doesn't expose the
name. And because TBitBtn is used mostly in the IDe, most buttons are
not accessible.Dňa 9. 10. 2017 o 9:41 Lubos Pintes via Lazarus napísal(a):
> I reported this problem years ago. If I remember properly, only TBitBtn
> has this behaviour.
> Of course not all buttons in the IDE have empty names, but those on
> options dialog, or welcome page.
> Dňa 9. 10. 2017 o 9:14 Juha Manninen via Lazarus napísal(a):
>> *I wonder ...
>>
>
>


--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus