[Glade-users] a really useful feature programmers would beg for: user defined property editor macros


I realize the following feature would really make sense...

The user interface I am writing (which I thought I would have finished
by today, but
nevertheless...), has several windows. Each one of these needs to have
spacing: e.g. if I set the spacing and padding to 11 and 6
respectively for a widget
with a particular function, then I'd better do it consistently
everywhere. What glade
needs to let me do is:

- have a popup menu where I can define constants.
- let me specify these constants in numeric fields (use a combobox
  showing all constants defined up to this point in glade)

The constants then become #define's at code generation time.

This amazing feature is truly amazing, and not even Qt designer has it, but it
is so productive: imagine I want to change a certain kind of border width later
on to a different number. Then I don't have to do so in every single widget.
And I'd do it that way by hand anyways if I were to code from scratch: I'd
come up with a set of defines, and then code a bunch of widget instantiators
which used those #define's as parameters. Luckyly, there's glade, so I don't
have to code from scratch, but, if this feature was there, my desire to code
from scratch would be COMPLETELY gone, and so would think several
other users I bet you. There is no other advantage to coding from scatch
to what I mention here, so please give it serious consideration. :-)


Another reason why to have a popup menu that allows you to define constants
to be used within glade? Because there are also several strings (e.g., a push
button may be called Cancel). Now, this needs to be translated into other
languages, but we don't want the poor translators to translate it a hundred
times when it really does deserve to be translated the same way regardless
of context. So, what a "from scratch" programmer would do, is define a
constant with the string "Cancel":

#define GLADE_MACRO_CANCEL "Cancel"

and then use it where needed. The translator only uses gettext once to translate
the macro (haven't used gettext yet, maybe I need to wrap the above "Cancel" in
a function call, but you get the idea (Qt has a simiar tr function,
but Qt designer
is also deficient in this area of macros I am hinting at). So then, using user
defined macros improves both:

1. layout management


2. I18N

at the same time, with such a cool feature. So user have the option of
numeric/string values, or user defined glade macros in the property
editor fields.

Best Regards!


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