Code Blocks

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

Code Blocks

Tim Burgess-5

Hi,

 

I know that a lot of WX developers use this application to generate their UI code. I don’t think it’s accessible for visually-impaired programmers, but I’m wondering if it can take in hand-written UI code and allow a sighted user to adjust sizing, control separation, etc. then save the modified code?

 

Any and all feedback gratefully accepted.

 

Best wishes.

 

Tim Burgess

Raised Bar Ltd.

E: [hidden email]

M: +44 (0)7989 486976

 

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Code Blocks

Steve Barnes


On 14/09/2018 11:12, [hidden email] wrote:

> Hi,
>
> I know that a lot of WX developers use this application to generate
> their UI code. I don’t think it’s accessible for visually-impaired
> programmers, but I’m wondering if it can take in hand-written UI code
> and allow a sighted user to adjust sizing, control separation, etc. then
> save the modified code?
>
> Any and all feedback gratefully accepted.
>
> Best wishes.
>
> Tim Burgess
>
> Raised Bar Ltd.
>
> E: [hidden email] <mailto:[hidden email]>
>
> M: +44 (0)7989 486976
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to [hidden email]
> or visit http://groups.google.com/group/wx-users

Tim,

There is possibly an even better option - XRC lets you define all of
your GUI elements in an XML format that your program, (written in C/C++
or Python) loads and uses. This has a lot of possible advantages:

  - while a little verbose XML, (and XRC), is a plain text format which
screen readers, etc., should be able to handle.
  - Other, sighted, users can examine and possibly tweak the (proposed)
user interface elements graphically using one of several graphical
editors. They don't need to have access to your code in fact your code
may not even be written yet!
  - As it is an external definition changes can be made without any need
to re-build the operational code.
  - You can build up a library of standard components and a standard
framework to use & reuse.
  - It can potentially complement internationalisation (I18N) when you
need to change the GUI elements in addition to the text elements.

Some links:
  - Official Overview: https://docs.wxwidgets.org/3.1/overview_xrc.html
  - A good tutorial on using XRC from wxPython can be found at
https://wiki.wxpython.org/XRCTutorial.
  - A tutorial on writing XRC files by hand for use in C/C++ can be
found at https://wiki.wxwidgets.org/Using_XML_Resources_with_XRC
  - The format definition is available at
https://docs.wxwidgets.org/3.0/overview_xrcformat.html
  - A discussion on using XRC & I18N together:
https://wiki.wxpython.org/XRCAndI18N

While it would be nice to have a less verbose option than XML to define
GUI elements there are the twin problems of validation and parsing to
consider.

I hope that this is a little help in making wxWidgets &/or wxPython more
approachable to yourself and possibly others with similar issues -
please note that I am not directly involved in XRC and am not the author
of any of the articles linked above.
--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

---
This email has been checked for viruses by AVG.
https://www.avg.com

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

RE: Code Blocks

Tim Burgess-5
Hi Steve,

That's potentially very interesting. I recall using XRC when I had to modify some legacy code for a contract a couple of years back, but the implementation for that application was very limited, so I probably under-estimated what it was capable of. I'll go and read the links you provided and see if it can help more than I thought😊 Getting a basic layout going with controls sized and positioned isn't my usual stumbling block, rather it's managing the enclosing window sizes. For instance, my current application has the following structure:

1 - A main application frame with menu bar and status bar;

2 - Activating most of the menu options brings up another frame that hosts a notebook with multiple pages (wxPanel).

I use SetSizerAndFit at each level to try and ensure that my controls within the various pages are scaled into their host panel (using an overall sizer for each page, obviously) and that the notebook is scaled within its host frame, etc.. Despite this, I'm told that my controls appear to be very small and only occupy a small corner of their containing window. My problem is conceptually getting to grips with what's happening here - is it that my notebook page is over-sized with respect to the controls it contains, or that the frame containing the notebook itself is wrongly sized? Will the XRC approach help me with this, or does it just handle control-type windows?

Many thanks for taking the time to try and help with this - it's greatly appreciated, as are all of the very patient folks on this list who keep me busy and productive.

Best wishes.

Tim Burgess

-----Original Message-----
From: [hidden email] <[hidden email]> On Behalf Of Steve Barnes
Sent: 14 September 2018 18:53
To: [hidden email]
Subject: Re: Code Blocks



On 14/09/2018 11:12, [hidden email] wrote:

> Hi,
>
> I know that a lot of WX developers use this application to generate
> their UI code. I don’t think it’s accessible for visually-impaired
> programmers, but I’m wondering if it can take in hand-written UI code
> and allow a sighted user to adjust sizing, control separation, etc.
> then save the modified code?
>
> Any and all feedback gratefully accepted.
>
> Best wishes.
>
> Tim Burgess
>
> Raised Bar Ltd.
>
> E: [hidden email] <mailto:[hidden email]>
>
> M: +44 (0)7989 486976
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to [hidden email]
> or visit http://groups.google.com/group/wx-users

Tim,

There is possibly an even better option - XRC lets you define all of your GUI elements in an XML format that your program, (written in C/C++ or Python) loads and uses. This has a lot of possible advantages:

  - while a little verbose XML, (and XRC), is a plain text format which screen readers, etc., should be able to handle.
  - Other, sighted, users can examine and possibly tweak the (proposed) user interface elements graphically using one of several graphical editors. They don't need to have access to your code in fact your code may not even be written yet!
  - As it is an external definition changes can be made without any need to re-build the operational code.
  - You can build up a library of standard components and a standard framework to use & reuse.
  - It can potentially complement internationalisation (I18N) when you need to change the GUI elements in addition to the text elements.

Some links:
  - Official Overview: https://docs.wxwidgets.org/3.1/overview_xrc.html
  - A good tutorial on using XRC from wxPython can be found at https://wiki.wxpython.org/XRCTutorial.
  - A tutorial on writing XRC files by hand for use in C/C++ can be found at https://wiki.wxwidgets.org/Using_XML_Resources_with_XRC
  - The format definition is available at https://docs.wxwidgets.org/3.0/overview_xrcformat.html
  - A discussion on using XRC & I18N together:
https://wiki.wxpython.org/XRCAndI18N

While it would be nice to have a less verbose option than XML to define GUI elements there are the twin problems of validation and parsing to consider.

I hope that this is a little help in making wxWidgets &/or wxPython more approachable to yourself and possibly others with similar issues - please note that I am not directly involved in XRC and am not the author of any of the articles linked above.
--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect those of my employer.

---
This email has been checked for viruses by AVG.
https://www.avg.com

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Code Blocks

oneeyeman
Hi, Tim,

On Fri, Sep 14, 2018 at 4:12 PM <[hidden email]> wrote:
Hi Steve,

That's potentially very interesting. I recall using XRC when I had to modify some legacy code for a contract a couple of years back, but the implementation for that application was very limited, so I probably under-estimated what it was capable of. I'll go and read the links you provided and see if it can help more than I thought😊 Getting a basic layout going with controls sized and positioned isn't my usual stumbling block, rather it's managing the enclosing window sizes. For instance, my current application has the following structure:

1 - A main application frame with menu bar and status bar;

2 - Activating most of the menu options brings up another frame that hosts a notebook with multiple pages (wxPanel).

I use SetSizerAndFit at each level to try and ensure that my controls within the various pages are scaled into their host panel (using an overall sizer for each page, obviously) and that the notebook is scaled within its host frame, etc.. Despite this, I'm told that my controls appear to be very small and only occupy a small corner of their containing window. My problem is conceptually getting to grips with what's happening here - is it that my notebook page is over-sized with respect to the controls it contains, or that the frame containing the notebook itself is wrongly sized? Will the XRC approach help me with this, or does it just handle control-type windows?

Do you have a screenshots of the application in question? Are you using the wxNotebook or another notebook-type window?
You can send it to me privately to not to pollute the list...

Thank you.


Many thanks for taking the time to try and help with this - it's greatly appreciated, as are all of the very patient folks on this list who keep me busy and productive.

Best wishes.

Tim Burgess

-----Original Message-----
From: [hidden email] <[hidden email]> On Behalf Of Steve Barnes
Sent: 14 September 2018 18:53
To: [hidden email]
Subject: Re: Code Blocks



On 14/09/2018 11:12, [hidden email] wrote:
> Hi,
>
> I know that a lot of WX developers use this application to generate
> their UI code. I don’t think it’s accessible for visually-impaired
> programmers, but I’m wondering if it can take in hand-written UI code
> and allow a sighted user to adjust sizing, control separation, etc.
> then save the modified code?
>
> Any and all feedback gratefully accepted.
>
> Best wishes.
>
> Tim Burgess
>
> Raised Bar Ltd.
>
> E: [hidden email] <mailto:[hidden email]>
>
> M: +44 (0)7989 486976
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to [hidden email]
> or visit http://groups.google.com/group/wx-users

Tim,

There is possibly an even better option - XRC lets you define all of your GUI elements in an XML format that your program, (written in C/C++ or Python) loads and uses. This has a lot of possible advantages:

  - while a little verbose XML, (and XRC), is a plain text format which screen readers, etc., should be able to handle.
  - Other, sighted, users can examine and possibly tweak the (proposed) user interface elements graphically using one of several graphical editors. They don't need to have access to your code in fact your code may not even be written yet!
  - As it is an external definition changes can be made without any need to re-build the operational code.
  - You can build up a library of standard components and a standard framework to use & reuse.
  - It can potentially complement internationalisation (I18N) when you need to change the GUI elements in addition to the text elements.

Some links:
  - Official Overview: https://docs.wxwidgets.org/3.1/overview_xrc.html
  - A good tutorial on using XRC from wxPython can be found at https://wiki.wxpython.org/XRCTutorial.
  - A tutorial on writing XRC files by hand for use in C/C++ can be found at https://wiki.wxwidgets.org/Using_XML_Resources_with_XRC
  - The format definition is available at https://docs.wxwidgets.org/3.0/overview_xrcformat.html
  - A discussion on using XRC & I18N together:
https://wiki.wxpython.org/XRCAndI18N

While it would be nice to have a less verbose option than XML to define GUI elements there are the twin problems of validation and parsing to consider.

I hope that this is a little help in making wxWidgets &/or wxPython more approachable to yourself and possibly others with similar issues - please note that I am not directly involved in XRC and am not the author of any of the articles linked above.
--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect those of my employer.

---
This email has been checked for viruses by AVG.
https://www.avg.com

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Code Blocks

Steve Barnes

<snip>

>     I use SetSizerAndFit at each level to try and ensure that my
>     controls within the various pages are scaled into their host panel
>     (using an overall sizer for each page, obviously) and that the
>     notebook is scaled within its host frame, etc.. Despite this, I'm
>     told that my controls appear to be very small and only occupy a
>     small corner of their containing window. My problem is conceptually
>     getting to grips with what's happening here - is it that my notebook
>     page is over-sized with respect to the controls it contains, or that
>     the frame containing the notebook itself is wrongly sized? Will the
>     XRC approach help me with this, or does it just handle control-type
>     windows?
>
>
> Do you have a screenshots of the application in question? Are you using
> the wxNotebook or another notebook-type window?
> You can send it to me privately to not to pollute the list...
>

Hi Tim,

I have had exactly this problem several times, (usually when asked to
fix someone else's code but occasionally my own), and it is usually one
of 2 problems:

  - if all of the controls are appearing on top of each other it is
usually a parenting problem of which sizer the controls are nested
within and which sizer is the parent of which sizer - this is actually
easier to conceptualise as XRC where the layout is explicit rather than
by assignment within the code,
  - sometimes there has been a failure to set the proportions or
  - sometimes absolute positioning has been mixed in with sizers - one
or the other needs to be used not both.

In XRC the nesting structure of the sizers is defined by the nesting
structure of the XML.

As far as I know XRC should handle all types of windows, frames, etc. -
if any are missing then I am sure that PRs would be welcomed.

As Igor said I also would be happy to look at a screen shot, (and/or the
GUI part of the code if it is practical & allowable to share) - off list
of course. One of the advantages of the XRC approach is that you can
share it without the associated code which reduces potential
intellectual property concerns when external assistance is needed or
desirable.

--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

---
This email has been checked for viruses by AVG.
https://www.avg.com

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Code Blocks

oneeyeman
Hi,
On Sat, Sep 15, 2018 at 12:45 AM Steve Barnes <[hidden email]> wrote:

>
>
> <snip>
> >     I use SetSizerAndFit at each level to try and ensure that my
> >     controls within the various pages are scaled into their host panel
> >     (using an overall sizer for each page, obviously) and that the
> >     notebook is scaled within its host frame, etc.. Despite this, I'm
> >     told that my controls appear to be very small and only occupy a
> >     small corner of their containing window. My problem is conceptually
> >     getting to grips with what's happening here - is it that my notebook
> >     page is over-sized with respect to the controls it contains, or that
> >     the frame containing the notebook itself is wrongly sized? Will the
> >     XRC approach help me with this, or does it just handle control-type
> >     windows?
> >
> >
> > Do you have a screenshots of the application in question? Are you using
> > the wxNotebook or another notebook-type window?
> > You can send it to me privately to not to pollute the list...
> >
>
> Hi Tim,
>
> I have had exactly this problem several times, (usually when asked to
> fix someone else's code but occasionally my own), and it is usually one
> of 2 problems:
>
>   - if all of the controls are appearing on top of each other it is
> usually a parenting problem of which sizer the controls are nested
> within and which sizer is the parent of which sizer - this is actually
> easier to conceptualise as XRC where the layout is explicit rather than
> by assignment within the code,
>   - sometimes there has been a failure to set the proportions or
>   - sometimes absolute positioning has been mixed in with sizers - one
> or the other needs to be used not both.
>
> In XRC the nesting structure of the sizers is defined by the nesting
> structure of the XML.
>
> As far as I know XRC should handle all types of windows, frames, etc. -
> if any are missing then I am sure that PRs would be welcomed.
>
> As Igor said I also would be happy to look at a screen shot, (and/or the
> GUI part of the code if it is practical & allowable to share) - off list
> of course. One of the advantages of the XRC approach is that you can
> share it without the associated code which reduces potential
> intellectual property concerns when external assistance is needed or
> desirable.

It is also easily testable by dropping the XRC file inside the xrcdemo folder...

Thank you.

>
> --
> Steve (Gadget) Barnes
> Any opinions in this message are my personal opinions and do not reflect
> those of my employer.
>
> ---
> This email has been checked for viruses by AVG.
> https://www.avg.com
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to [hidden email]
> or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Code Blocks

Stulov Dmitry-2
In reply to this post by Tim Burgess-5
wxFormBuilder can generate UI code on C++ or XRC, but can't modify existing code, only generate new.
This can be workaround using inherited window classes, but no way to import c++ code

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

RE: Code Blocks

Tim Burgess-5
In reply to this post by oneeyeman
That's a nice trick - thanks.

Best wishes.

Tim Burgess

-----Original Message-----
From: [hidden email] <[hidden email]> On Behalf Of Igor Korot
Sent: 14 September 2018 18:52
To: [hidden email]
Subject: Re: Code Blocks

Hi,
On Sat, Sep 15, 2018 at 12:45 AM Steve Barnes <[hidden email]> wrote:

>
>
> <snip>
> >     I use SetSizerAndFit at each level to try and ensure that my
> >     controls within the various pages are scaled into their host panel
> >     (using an overall sizer for each page, obviously) and that the
> >     notebook is scaled within its host frame, etc.. Despite this, I'm
> >     told that my controls appear to be very small and only occupy a
> >     small corner of their containing window. My problem is conceptually
> >     getting to grips with what's happening here - is it that my notebook
> >     page is over-sized with respect to the controls it contains, or that
> >     the frame containing the notebook itself is wrongly sized? Will the
> >     XRC approach help me with this, or does it just handle control-type
> >     windows?
> >
> >
> > Do you have a screenshots of the application in question? Are you
> > using the wxNotebook or another notebook-type window?
> > You can send it to me privately to not to pollute the list...
> >
>
> Hi Tim,
>
> I have had exactly this problem several times, (usually when asked to
> fix someone else's code but occasionally my own), and it is usually
> one of 2 problems:
>
>   - if all of the controls are appearing on top of each other it is
> usually a parenting problem of which sizer the controls are nested
> within and which sizer is the parent of which sizer - this is actually
> easier to conceptualise as XRC where the layout is explicit rather
> than by assignment within the code,
>   - sometimes there has been a failure to set the proportions or
>   - sometimes absolute positioning has been mixed in with sizers - one
> or the other needs to be used not both.
>
> In XRC the nesting structure of the sizers is defined by the nesting
> structure of the XML.
>
> As far as I know XRC should handle all types of windows, frames, etc.
> - if any are missing then I am sure that PRs would be welcomed.
>
> As Igor said I also would be happy to look at a screen shot, (and/or
> the GUI part of the code if it is practical & allowable to share) -
> off list of course. One of the advantages of the XRC approach is that
> you can share it without the associated code which reduces potential
> intellectual property concerns when external assistance is needed or
> desirable.

It is also easily testable by dropping the XRC file inside the xrcdemo folder...

Thank you.

>
> --
> Steve (Gadget) Barnes
> Any opinions in this message are my personal opinions and do not
> reflect those of my employer.
>
> ---
> This email has been checked for viruses by AVG.
> https://www.avg.com
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to [hidden email]
> or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

RE: Code Blocks

Tim Burgess-5
In reply to this post by Stulov Dmitry-2

Hi,

 

Does wxFormBuilder allow me to import my existing .xrc and modify it using the UI, please?

 

Best wishes.

 

Tim Burgess

 

From: [hidden email] <[hidden email]> On Behalf Of Teolog
Sent: 15 September 2018 09:28
To: wx-users <[hidden email]>
Subject: Re: Code Blocks

 

wxFormBuilder can generate UI code on C++ or XRC, but can't modify existing code, only generate new.

This can be workaround using inherited window classes, but no way to import c++ code

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Code Blocks

Steve Barnes
Hi Tim,

wxGlade does allow XRC import and can output XRC, C++ or Python.

Steve

On 02/10/2018 17:14, [hidden email] wrote:

> Hi,
>
> Does wxFormBuilder allow me to import my existing .xrc and modify it
> using the UI, please?
>
> Best wishes.
>
> Tim Burgess
>
> *From:*[hidden email] <[hidden email]> *On Behalf
> Of *Teolog
> *Sent:* 15 September 2018 09:28
> *To:* wx-users <[hidden email]>
> *Subject:* Re: Code Blocks
>
> wxFormBuilder can generate UI code on C++ or XRC, but can't modify
> existing code, only generate new.
>
> This can be workaround using inherited window classes, but no way to
> import c++ code
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to [hidden email]
> <mailto:[hidden email]>
> or visit http://groups.google.com/group/wx-users
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to [hidden email]
> or visit http://groups.google.com/group/wx-users

--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

---
This email has been checked for viruses by AVG.
https://www.avg.com

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users