www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Adam D. Ruppe's Minigui using example

reply Andre Polykanine <andre oire.org> writes:
Hi everyone,
I would like to use Minigui 
(https://github.com/adamdruppe/arsd/blob/master/minigui.d) and 
test it for accessibility.
Does anyone have an actual example of, say, a simple form with a 
set of radio buttons or check boxes to start with?
Thanks in advance!
Jan 15 2016
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Saturday, 16 January 2016 at 01:27:32 UTC, Andre Polykanine 
wrote:
 Does anyone have an actual example of, say, a simple form with 
 a set of radio buttons or check boxes to start with?
 Thanks in advance!
Sort of. I still haven't used it in a real world program so it isn't complete but here's one of my test programs: --- import arsd.minigui; void main() { auto window = new MainWindow(); auto exitAction = new Action("E&xit"); exitAction.triggered ~= { window.close(); }; window.statusTip = "D ROX!"; auto button = new Checkbox("Uses D!", window); button.isChecked = true; auto hlayout = new HorizontalLayout(window); auto gb = new Fieldset("Type", hlayout); auto gb2 = new Fieldset("cool", hlayout); auto boxlol1 = new Radiobox("Test", gb); auto boxlol2 = new Radiobox("Test2", gb2); auto boxlol3 = new Radiobox("Test", gb); auto boxlol4 = new Radiobox("Test2", gb2); auto group = new MutuallyExclusiveGroup(); group.addMember(new Radiobox("Heavyweight", gb)); auto btn = group.addMember(new Radiobox("Small library", gb)); btn.isChecked = true; btn.statusTip = "205 KB exe on Windows"; //auto spinner = new Spinner(window); ComboboxBase cb = new DropDownSelection(window); cb.addOption("test"); cb.addOption("cool"); cb.setSelection(1); //cb.addEventListener("changed", (Event ev) { //auto bm = new MessageBox("changed " ~ cb.options[cb.selection]); //}); // FIXME: adding this to gb2 instead of window causes wtf stuff cb = new ComboBox(window); cb.addOption("test"); cb.addOption("cool"); cb.setSelection(1); cb = new FreeEntrySelection(window); cb.addOption("test"); cb.addOption("cool"); cb.setSelection(1); auto lineEdit = new LineEdit(window); auto menu = new MenuBar(); auto fileMenu = new Menu("&File"); auto exitButton = fileMenu.addItem(new MenuItem(exitAction)); menu.addItem(fileMenu); window.loop(); } --- On Windows, it uses the native controls, so it should work reasonably well, though on Linux it does its own thing and is far from complete. BTW simplewindow doesn't seem to compile on newest dmd because of the new core.sys.windows.windows so I'll have to update that if you're on the newest release...
Jan 15 2016
parent Andre Polykanine <andre oire.org> writes:
On Saturday, 16 January 2016 at 03:14:01 UTC, Adam D. Ruppe wrote:
 On Saturday, 16 January 2016 at 01:27:32 UTC, Andre Polykanine 
 wrote:
 Does anyone have an actual example of, say, a simple form with 
 a set of radio buttons or check boxes to start with?
 Thanks in advance!
Sort of. I still haven't used it in a real world program so it isn't complete but here's one of my test programs:
[...]
 On Windows, it uses the native controls, so it should work 
 reasonably well, though on Linux it does its own thing and is 
 far from complete.



 BTW simplewindow doesn't seem to compile on newest dmd because 
 of the new core.sys.windows.windows so I'll have to update that 
 if you're on the newest release...
Thanks Adam, I have DMD 2.068.2 so far so it did work. However it seems to be not so accessible as I expected (tested with JAWS for Windows, latest release [1]). For instance, the focus lands nowhere when the program is launched. Then there is a (not too comfortable) possibility to make it show the elements to the screen reader upon pressing Tab. [1]:https://en.wikipedia.org/wiki/JAWS_(screen_reader)
Jan 23 2016