lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [PATCH] Don't hard code explicit wxDatePickerCtrl size


From: Greg Chicares
Subject: Re: [lmi] [PATCH] Don't hard code explicit wxDatePickerCtrl size
Date: Sat, 31 Jan 2015 19:52:25 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0

On 01/31/2015 06:09 PM, Vadim Zeitlin wrote:
> On Sat, 31 Jan 2015 17:29:41 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> On 01/29/2015 08:35 PM, Vadim Zeitlin wrote:
> GC> > On Thu, 29 Jan 2015 17:48:16 +0000 Greg Chicares <address@hidden> wrote:
> GC> > 
> GC> > GC> Now I've built lmi natively for gnu/linux, and set my DPI to 
> 192...and
> GC> > GC> indeed I see the problem you mentioned. Using 'skin.xrc', on the 
> "Inforce"
> GC> > GC> tab, numeric fields are only wide enough to display "1234", and 
> date fields
> GC> > GC> show "01/" and half of a "2".
> GC> > 
> GC> >  This is without the patch, isn't it?
> GC> 
> GC> Yes.
> GC> 
> GC> > Or does it happen even with the patch
> GC> > applied?
> GC> 
> GC> Now I apply this patch:
> GC>   http://lists.nongnu.org/archive/html/lmi/2015-01/msg00028.html
> GC>   0001-Remove-explicit-sizes-from-wxDatePickerCtrl-in-the-r.patch
> GC> and the date controls are wide enough. Actually, as I believe you noted 
> earlier,
> GC> they're wider than necessary--there's room for an extra '1' on the end:
> GC>   01/31/20151
> 
>  Hmm, we should be able to get this exactly right in wxGTK as it uses the
> generic version, so everything is under our control. OTOH, being slightly
> too wide is not that catastrophic, especially as opposed to not being wide
> enough.

True, but why not make it perfect?

> GC> But I want YYYYMMDD. Let's see...
> GC> 
> GC> /opt/lmi/build[0]$LC_TIME="en_DK.UTF-8" 
> LD_LIBRARY_PATH=/usr/local/lib:/opt/lmi/local/lib ./lmi_wx --ash_nazg
> GC> locale::facet::_S_create_c_locale name not valid
> GC> 
> GC> Hvorfor er det?
> GC>   $ls /usr/share/i18n/locales/en_DK
> GC>   /usr/share/i18n/locales/en_DK
> GC> 
> GC> Let's do this:
> GC>   /usr/share/i18n/locales[0]#localedef -f UTF-8 -i en_DK en_DK.UTF-8
> GC> and retry...no, same error. I guess I'll return to that another day.
> 
>  See locale-gen(1) (this is Debian-specific AFAIK). In short, you need to
> uncomment the corresponding line in /etc/locale.gen and run this program to
> make the locale usable.

Thanks--it would have taken me a while to find the debian-specific procedure.

/usr/share/i18n/locales[0]#sed -i /etc/locale.gen -e'/en_DK.UTF-8/s/^# //'
/usr/share/i18n/locales[0]#locale-gen
Generating locales (this might take a while)...
  en_DK.UTF-8... done
  en_US.UTF-8... done
Generation complete.

Proof that it works:

/opt/lmi/build[0]$date +%x
01/31/2015
/opt/lmi/build[0]$LC_TIME="en_DK.UTF-8" date +%x
2015-01-31

That's encouraging, but I still get the same error with lmi:

/opt/lmi/build[0]$LC_TIME="en_DK" 
LD_LIBRARY_PATH=/usr/local/lib:/opt/lmi/local/lib ./lmi_wx --ash_nazg
locale::facet::_S_create_c_locale name not valid

That would appear to be a libstdc++ issue. I should think at least one
of Stroustrup's compatriots would be using libstdc++, no? I can't
believe I'm supposed to rebuild the compiler. What am I missing?

> GC> Anyway, there are many other issues:
> GC>  - Numeric textcontrols on "Inforce" tab (e.g.) are not wide enough.
> 
>  This is almost certainly due to hardcoding their width to 80 pixels.

Yes, of course. That's under my control. I just won't have the time to
address all of this soon: doing it carefully takes a lot of work.

> GC>  - Ctrl-Pg{Up|Down} appears not to work for changing tabs, but that's
> GC>    because it gets stuck in the "Policy" listbox.
> GC>  - Up and down arrows in radioboxes don't change selections--maybe
> GC>    that's just a gtk vs msw difference, and of course I can make a
> GC>    selection with spacebar.
> GC>  - Probably another gtk thing: date control doesn't have up-down
> GC>    controls for Y D M like msw.
> 
>  This is indeed all wxGTK/GTK+ specific. AFAIK keyboard handling is just
> not as well done in GTK+ as under MSW (still much better than in OS X
> though...) and so you need to exit the listbox by TAB-bing out of it before
> being able to use Ctrl-Pg{Up,Down}.

Are you saying that keyboard handling:
(1) is less polished in wxGTK than in wxMSW, which is remediable; or
(2) is less polished in GTK+ than in MSW, which is not?

> GC>  - I like the narrow pull-down-arrow button on the date control better
> GC>    than the enormous one on comboboxes; is that customizable? As it
> GC>    stands, comboboxes for state and country aren't wide enough to show
> GC>    any text.
> 
>  Hmm, this is probably theme-dependent, I don't have any especially
> enormous buttons in the comboboxes. Maybe they are twice larger than
> necessary because of the scaling? Then it would be something to fix in
> wxGTK... Could you please send me a screenshot privately so that I
> understand better what's going on here?

Sent.

> GC>  - Help | About text is as narrow as a newspaper column.
> GC>  - Nothing on the "Window" menu works.
> 
>  I have no immediate ideas about either of those :-( I could debug them if
> you'd like to, of course.

Yes, I think that's a good idea--if it can happen with debian, then
we can't be sure it won't happen with something like msw-10, or any
version of msw with 192 DPI on a high-resolution screen.

> GC> When I close lmi, I see many lines like this:
> GC>   16:51:06: Debug: Wrong type returned from the model: string required 
> but actual type is long
> GC> which I haven't investigated. That's coming from wx, isn't it?
> 
>  Yes, but it indicates that something is bad in our code, probably the
> illustration view wxDataViewCtrl. This is something that does need to be
> fixed, I think.

To reproduce:
I start lmi...and there's nothing on the console.
I do "File | New | Census"...and I see seven copies of that line.

> GC> That didn't seem to work. I installed libgtk-3-{0|bin|dev}, and apt said
> GC> they were all already installed; but I reconfigure wx and get the same
> GC> result as above:
> GC> 
> GC> /opt/lmi/wxWidgets/configure --with-gtk3 [...repeated from zsh history]
> GC> ...
> GC> checking for GTK+ - version >= 2.6.0... yes (version 2.24.10)
> GC> ...
> GC> Which GUI toolkit should wxWidgets use?                 GTK+ 2 with 
> support for GTK+ printing
> GC> 
> GC> I have the feeling that I'm missing something obvious.
> 
>  Are you running configure in the same directory where you had run it for
> wxGTK2 build before? If so, it probably cached the GTK+ version and you'd
> need to either "rm -rf /opt/lmi/wx-scratch && mkdir $_ && cd $_" or 
> "mkdir /opt/lmi/wx-scratch-gtk3 && cd $_" and reconfigure.

I still get
  Which GUI toolkit should wxWidgets use?                 GTK+ 2 with support 
for GTK+ printing
so I'll show everything I did along with `dpkg-query -l '*gtk*'`:

/opt/lmi/wx-scratch[1]$rm -rf *
zsh: sure you want to delete all the files in /opt/lmi/wx-scratch [yn]? y
/opt/lmi/wx-scratch[0]$ls
/opt/lmi/wx-scratch[0]$/opt/lmi/wxWidgets/configure --with-gtk3 
--enable-std_string --disable-threads --disable-apple_ieee --without-libjpeg 
--without-libtiff --disable-gif --enable-stl --disable-joystick 
--prefix=/opt/lmi/local >log 2>&1
/opt/lmi/wx-scratch[0]$grep -i gtk log
checking for toolkit... gtk
checking for --without-gtkprint... no
checking for GTK+ version...
checking for GTK+ - version >= 2.6.0... yes (version 2.24.10)
checking if GTK+ is version >= 2.18... yes
checking for GTKPRINT... yes
checking for WEBKIT... configure: WARNING: webkitgtk not found.
config.status: creating lib/wx/config/gtk2-unicode-3.1
config.status: creating lib/wx/config/inplace-gtk2-unicode-3.1
config.status: creating lib/wx/include/gtk2-unicode-3.1/wx/setup.h
  Which GUI toolkit should wxWidgets use?                 GTK+ 2 with support 
for GTK+ printing
/opt/lmi/wx-scratch[0]$dpkg-query -l '*gtk*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
un  evince-gtk     <none>                    (no description available)
un  gir1.0-clutter <none>                    (no description available)
un  gir1.0-gtk-2.0 <none>                    (no description available)
un  gir1.2-gtk-2.0 <none>                    (no description available)
ii  gir1.2-gtk-3.0 3.4.2-7      amd64        GTK+ graphical user interface lib
ii  gir1.2-gtkclut 1.2.0-2      amd64        GObject introspection data for th
ii  gir1.2-gtksour 3.4.2-1      amd64        gir files for the GTK+ syntax hig
ii  gir1.2-javascr 1.8.1-3.4    amd64        GObject introspection data for th
ii  gir1.2-spice-c 0.12-5       amd64        GTK3 widget for SPICE clients (GO
ii  gtk-doc-tools  1.18-2       all          GTK+ documentation tools
un  gtk-sharp2-gap <none>                    (no description available)
ii  gtk2-engines:a 1:2.20.2-2   amd64        theme engines for GTK+ 2.x
ii  gtk2-engines-x 2.8.1-3      amd64        GTK+-2.0 theme engine for Xfce
un  gtk2.0-binver- <none>                    (no description available)
un  gtk3-binver-3. <none>                    (no description available)
un  gtkam          <none>                    (no description available)
ii  gtkperf        0.40+ds-2    amd64        GTK+ performance benchmark
ii  libavahi-ui-gt 0.6.31-2     amd64        Avahi GTK+ User interface library
ii  libcanberra-gt 0.28-6       amd64        translates GTK+ widgets signals t
ii  libcanberra-gt 0.28-6       amd64        GTK+ helper for playing widget ev
ii  libcanberra-gt 0.28-6       amd64        GTK+ 3.0 helper for playing widge
ii  libcanberra-gt 0.28-6       amd64        translates GTK3 widgets signals t
ii  libcaribou-gtk 0.4.4-1      amd64        Configurable on screen keyboard w
ii  libcaribou-gtk 0.4.4-1      amd64        Configurable on screen keyboard w
ii  libchamplain-g 0.12.3-1     amd64        Gtk+ widget to display maps
ii  libcheese-gtk2 3.4.2-2      amd64        tool to take pictures and videos
un  libclutter-gtk <none>                    (no description available)
ii  libclutter-gtk 1.2.0-2      amd64        Open GL based interactive canvas
ii  libclutter-gtk 1.2.0-2      amd64        Open GL based interactive canvas
ii  libclutter-gtk 1.2.0-2      all          Open GL based interactive canvas
un  libclutter-gtk <none>                    (no description available)
un  libempathy-gtk <none>                    (no description available)
ii  libgdu-gtk0    3.0.2-3      amd64        GTK+ standard dialog library for
ii  libgirara-gtk2 0.1.2-3      amd64        library for minimalistic user int
un  libgpod4-nogtk <none>                    (no description available)
ii  libgtk-3-0:amd 3.4.2-7      amd64        GTK+ graphical user interface lib
ii  libgtk-3-0-dbg 3.4.2-7      amd64        GTK+ libraries and debugging symb
ii  libgtk-3-bin   3.4.2-7      amd64        programs for the GTK+ graphical u
ii  libgtk-3-commo 3.4.2-7      all          common files for the GTK+ graphic
ii  libgtk-3-dev   3.4.2-7      amd64        development files for the GTK+ li
ii  libgtk-3-doc   3.4.2-7      all          documentation for the GTK+ graphi
un  libgtk-directf <none>                    (no description available)
ii  libgtk-vnc-1.0 0.5.0-3.1    amd64        VNC viewer widget for GTK+2 (runt
ii  libgtk-vnc-2.0 0.5.0-3.1    amd64        VNC viewer widget for GTK+3 (runt
ii  libgtk2-perl   2:1.244-1    amd64        Perl interface to the 2.x series
un  libgtk2-perl-d <none>                    (no description available)
ii  libgtk2.0-0:am 2.24.10-2    amd64        GTK+ graphical user interface lib
ii  libgtk2.0-bin  2.24.10-2    amd64        programs for the GTK+ graphical u
ii  libgtk2.0-cil  2.12.10-5    amd64        CLI binding for the GTK+ toolkit
ii  libgtk2.0-comm 2.24.10-2    all          common files for the GTK+ graphic
ii  libgtk2.0-dev  2.24.10-2    amd64        development files for the GTK+ li
ii  libgtk2.0-doc  2.24.10-2    all          documentation for the GTK+ graphi
ii  libgtkhtml-4.0 4.4.4-1      amd64        HTML rendering/editing library -
ii  libgtkhtml-4.0 4.4.4-1      all          HTML rendering/editing library -
ii  libgtkhtml-edi 4.4.4-1      amd64        HTML rendering/editing library -
un  libgtkmm-2.4-1 <none>                    (no description available)
un  libgtkmm-2.4-1 <none>                    (no description available)
ii  libgtkmm-2.4-1 1:2.24.2-1   amd64        C++ wrappers for GTK+ (shared lib
ii  libgtkmm-3.0-1 3.4.2-1      amd64        C++ wrappers for GTK+ (shared lib
un  libgtkmm-3.0-d <none>                    (no description available)
ii  libgtksourcevi 3.4.2-1      amd64        shared libraries for the GTK+ syn
ii  libgtksourcevi 3.4.2-1      all          common files for the GTK+ syntax
ii  libgtksourcevi 3.4.2-1      amd64        development files for the GTK+ sy
ii  libgtksourcevi 3.4.2-1      all          documentation for the GTK+ syntax
ii  libgtksourcevi 2.10.4-1     amd64        shared libraries for the GTK+ syn
ii  libgtksourcevi 2.10.4-1     all          common files for the GTK+ syntax
un  libgtksourcevi <none>                    (no description available)
ii  libgtkspell0   2.0.16-1     amd64        a spell-checking addon for GTK's
ii  libjavascriptc 1.8.1-3.4    amd64        Javascript engine library for GTK
ii  libjavascriptc 1.8.1-3.4    amd64        Javascript engine library for GTK
ii  libjavascriptc 1.8.1-3.4    amd64        Javascript engine library for GTK
ii  libjavascriptc 1.8.1-3.4    amd64        Javascript engine library for GTK
ii  libnm-gtk-comm 0.9.4.1-5    all          library for wireless and mobile d
ii  libnm-gtk0     0.9.4.1-5    amd64        library for wireless and mobile d
un  libpolkit-gtk- <none>                    (no description available)
ii  libreoffice-gt 1:3.5.4+dfsg amd64        office productivity suite -- GTK+
un  libreoffice-gt <none>                    (no description available)
ii  libseed-gtk3-0 3.2.0-2      amd64        GObject JavaScript bindings for t
ii  libspice-clien 0.12-5       amd64        GTK2 widget for SPICE clients (ru
ii  libspice-clien 0.12-5       amd64        GTK3 widget for SPICE clients (ru
ii  libspice-clien 0.12-5       amd64        GTK3 widget for SPICE clients (de
ii  libwebkitgtk-1 1.8.1-3.4    amd64        Web content engine library for GT
ii  libwebkitgtk-1 1.8.1-3.4    all          Web content engine library for GT
ii  libwebkitgtk-3 1.8.1-3.4    amd64        Web content engine library for GT
ii  libwebkitgtk-3 1.8.1-3.4    amd64        Web content engine library for GT
ii  libwebkitgtk-3 1.8.1-3.4    all          Web content engine library for GT
ii  libwebkitgtk-3 1.8.1-3.4    amd64        Web content engine library for GT
un  macopix-gtk2   <none>                    (no description available)
un  monodoc-gtk2.0 <none>                    (no description available)
un  python-aptdaem <none>                    (no description available)
ii  python-aptdaem 0.45-2       all          Python GTK+ 3 widgets to run an a
ii  python-gtk-vnc 0.5.0-3.1    amd64        VNC viewer widget for GTK+2 (Pyth
ii  python-gtk2    2.24.0-3+b1  amd64        Python bindings for the GTK+ widg
un  python-gtk2-do <none>                    (no description available)
un  python-gtkglex <none>                    (no description available)
ii  python-gtksour 2.10.1-2     amd64        Python bindings for the GtkSource
un  python-gtkspel <none>                    (no description available)
ii  python-spice-c 0.12-5       amd64        GTK2 widget for SPICE clients (Py
ii  software-prope 0.82.7.1debi all          manage the repositories that you
un  spice-client-g <none>                    (no description available)
ii  transmission-g 2.52-3+nmu2  amd64        lightweight BitTorrent client (GT
ii  vim-gtk        2:7.3.547-7  amd64        Vi IMproved - enhanced vi editor
ii  xdg-user-dirs- 0.9-1        amd64        tool to manage well known user di
/opt/lmi/wx-scratch[0]$




reply via email to

[Prev in Thread] Current Thread [Next in Thread]