[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
changing genprop.awk to handle radio_values
From: |
Shai Ayal |
Subject: |
changing genprop.awk to handle radio_values |
Date: |
Fri, 14 Sep 2007 09:40:40 +0300 |
As discussed in previous threads, to set radio_properties and/or
color_properties from an octave_value, an assignment should be
preformed, not a constructions. i.e.
radio_property rp("all|none|quiet");
octave_value ov("none");
// the right way, preserves the allowed_values
rp = ov;
// the wrong way, overwrites allowed values
rp = radio_property(ov);
Currently genprops.awk only allows for the "wrong way" when emitting a
"set" function:
## void
## set_NAME (const octave_value& val)
## {
## set_NAME (TYPE (val));
## }
##
this can be fixed in one of the following ways:
1) don't change genprops.awk, and use an o or O modifier to write a
custom version of set
2) make genprop always emit an assignment "set" function:
## void
## set_NAME (const octave_value& val)
## {
## NAME =val;
## }
##
3) add another modifier (say "a") to make genprops emit an assignment
set function
4) have genprop.awk automatically emit an assignment "set" function
(like in example 2) if TYPE is color_property or radio_property
all of these changes seem trivial, the question is, which road to take?
Shai
- changing genprop.awk to handle radio_values,
Shai Ayal <=