Re: Adam D. Ruppe's Minigui using example

2016-01-23 Thread Andre Polykanine via Digitalmars-d-learn

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)


Adam D. Ruppe's Minigui using example

2016-01-15 Thread Andre Polykanine via Digitalmars-d-learn

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!


Re: Dub package with C code

2015-09-25 Thread Andre Polykanine via Digitalmars-d-learn
Hello tired_eyes,

tevDdl> Once again, I'm absolutely sure tha D should have an official
tevDdl> blog! Forums can't replace blogs, forums are for discussions, not 
tevDdl> for content presentation.

+1 on this.

-- 
With best regards from Ukraine,
Andre



Re: Working Windows GUI library?

2015-09-04 Thread Andre Polykanine via Digitalmars-d-learn
Hello thedeemon,

tvDdl> Yes, DFL!
tvDdl> https://github.com/Rayerd/dfl

Sounds  good.  but still... I can't find any examples or documentation
:(

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: @m_elensule; Facebook: menelion
My blog: http://menelion.oire.org/


 Original message 
From: thedeemon via Digitalmars-d-learn 
To: digitalmars-d-learn@puremagic.com
Date created: , 9:30:34 AM
Subject: Working Windows GUI library?


  On Thursday, 3 September 2015 at 15:46:28 UTC, Andre Polykanine 
wrote:
> So  my  question  is:  is  there any reliable GUI library 
> implementing native Windows controls?

Yes, DFL!
https://github.com/Rayerd/dfl
It's a thin wrapper over WinAPI so all controls are native. I've 
built several apps with it and quite happy with this library. It 
comes with a graphical interface builder called Entice Designer 
which is rather old but still works fine. Also, with this lib 
your app is just a single binary less than 1 MB, no additional 
DLLs required.



Working Windows GUI library?

2015-09-03 Thread Andre Polykanine via Digitalmars-d-learn
Hi everyone,
Does   anyone   of   you  work  with a Windows GUI library with native
controls in order to write desktop apps in D?
Here  is  why  I'm  asking:  actually, there are quite a number of GUI
libraries listed at wiki.dlang.org.
However, I have one specific requirement: the resulting apps should be
accessible  for blind and visually impaired users. To do that, Windows
native  controls are highly preferred since they are treated correctly
by  screen  reading  software.  So  no  QT,  no GTK (they are both not
accessible under Windows).
I've  tried  to  build  samples for each library, and got virtually no
results:  DGui was the only one that caused no problems at all, but it
has   almost   no   documentation   and   most   of  the  samples  are
drawing-related.
So  my  question  is:  is  there any reliable GUI library implementing
native Windows controls?
Thanks!
  

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: @m_elensule; Facebook: menelion
My blog: http://menelion.oire.org/



Re: Working Windows GUI library?

2015-09-03 Thread Andre Polykanine via Digitalmars-d-learn
Hello Adam,

ADRvDdl> Easily usable by the blind or people with motor difficulties and
ADRvDdl> other similar challenges.

Exactly, thank you.
I.e.,   the   app   should   be usable without mouse and with a screen
reader (to over-simplify the
things).

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: @m_elensule; Facebook: menelion
My blog: http://menelion.oire.org/


 Original message 
From: Adam D. Ruppe via Digitalmars-d-learn 
To: digitalmars-d-learn@puremagic.com
Date created: , 7:56:52 PM
Subject: Working Windows GUI library?


  On Thursday, 3 September 2015 at 16:49:51 UTC, BBasile wrote:
> I don't know what you meant by 'accessible'

Easily usable by the blind or people with motor difficulties and 
other similar challenges.



Templates and writing variable number of arguments

2015-08-23 Thread Andre Polykanine via Digitalmars-d-learn
Hi everyone,
It's me again.
Now  I'm  struggling  with  the  `output` member function which should
output  a  string  either  to  stdout  or  to a file, depending on the
parameter.
However,  I would like it to work like `writefln` with variable number
of arguments:
output(Hello %s!, world); // should be OK
output(%s  %s:  %s  %d  times,  I, say, Hello world!, 500); //
Should also be OK

Here is my code:

final void output(T)(string text, T params...) const {
if (this.outFile == ) {
writefln(text, params);
} else { // Output to a file
auto f = File(this.outFile, w);
try {
f.writefln(text, params);
} catch(Exception e) {
writefln(Unable to write to %s: %s, 
this.outFile, e.msg);
}
}
}

And the compiler says it can't deduce the type of arguments.
What am I doing wrong here?
Maybe, I don't need such a function and all and there is a way to make
it more elegant?
Thanks!

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: @m_elensule; Facebook: menelion
My blog: http://menelion.oire.org/



Re: A couple questions about a simple project

2015-08-17 Thread Andre Polykanine via Digitalmars-d-learn
Hello John,

Yes, but this doesn't work, either.
Now I have this (that was my first variant, btw):

string s;
try {
s = cast(string)std.file.read(f);
try {
check(s);
if (this.verbose) {
output(format(%s: 
validation passed!, f));
}
} catch(CheckException e) {
// This is output when a file is invalid, that works
output(format(Failed to 
validate %s: %s, f, e.toString()));
}
} catch(Exception exc) {
//  And  that  isn't  output,  I  see  just  the  stacktrace as if the
exception was not caught at all
output(format(Error reading %s: %s, 
f, exc.msg));
}
}

To  catch  the  exception,  I  need  to  wrap  the  validate() call in
`try...catch` in `main()`. Why so?
Thanks!
-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: @m_elensule; Facebook: menelion
My blog: http://menelion.oire.org/


 Original message 
From: John Colvin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
To: digitalmars-d-learn@puremagic.com
Date created: , 6:17:38 PM
Subject: A couple questions about a simple project


  On Monday, 17 August 2015 at 15:05:56 UTC, Andre Polykanine wrote:
 Hi everyone,
 I'm  new to D (I'm learning it by reading the great online book 
 by Ali
 Çehreli  -  thank  you  very  much for it, sir!), and, more 
 than that,
 programming  is  my hobby, so please bear with me if I'm asking 
 stupid
 questions.
 I've  made  a  toy  project  which  is  a small command-line 
 XML files
 validator:
 https://github.com/Oire/dxv/
 and I have a couple questions about it:
 1.  I'm  using std.getopt but don't know how to make it display 
 a help
 message if no options are present at all:
 D:\repos\git\dxv\dxv.exe
 (nothing   happens   but   I   would  like it to show the help 
 as with
 --help switch)

Check if args has changed length after calling getopt, if not 
then it didn't find any options.

 2. As you can see, I check whether the file to validate can be 
 read. I
 tried both `try...catch` and `enforce` (current version:
 `string  s  =  enforce(cast(string)std.file.read(f),  Unable  
 to read
 file);`
 ),  but  this  very  exception  for  some reason can be caught 
 only in
 `main()`.
 What am I missing?
 Thanks!

string s;
try
{
 s = cast(string)std.file.read(f);
}
catch (FileException e)
{
 // do whatever you want.
}




A couple questions about a simple project

2015-08-17 Thread Andre Polykanine via Digitalmars-d-learn
Hi everyone,
I'm  new to D (I'm learning it by reading the great online book by Ali
Çehreli  -  thank  you  very  much for it, sir!), and, more than that,
programming  is  my hobby, so please bear with me if I'm asking stupid
questions.
I've  made  a  toy  project  which  is  a small command-line XML files
validator:
https://github.com/Oire/dxv/
and I have a couple questions about it:
1.  I'm  using std.getopt but don't know how to make it display a help
message if no options are present at all:
D:\repos\git\dxv\dxv.exe
(nothing   happens   but   I   would  like it to show the help as with
--help switch)
2. As you can see, I check whether the file to validate can be read. I
tried both `try...catch` and `enforce` (current version:
`string  s  =  enforce(cast(string)std.file.read(f),  Unable  to read
file);`
),  but  this  very  exception  for  some reason can be caught only in
`main()`.
What am I missing?
Thanks!
  

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: @m_elensule; Facebook: menelion
My blog: http://menelion.oire.org/




D Wiki: Windows programming examples are missing

2015-08-05 Thread Andre Polykanine via Digitalmars-d-learn
Hi everyone,
I'm fairly new to D and am really excited about it.
I would like to see more examples of Windows programming in D, but the
repository indicated on the D wiki seems to be moved or deleted.
More info is here:
http://wiki.dlang.org/talk:D_for_Win32
Thanks!

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: @m_elensule; Facebook: menelion
My blog: http://menelion.oire.org/