GUI description res files are different in Python
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 24/07/2012 at 12:37, xxxxxxxx wrote:
Creating .res files with dialog descriptions are slightly different in Python than with COFFEE or C++, aren't they?
For example, instead of:EDITNUMBERARROWS NAME {MIN 1.0; MAX 100.0;}
in Python we use:
REAL NAME {MIN 1.0; MAX 100.0}
or
LONG NAME {MIN 1.0; MAX 100.0}
For example, I was trying to create the equivalent of:
EDITNUMBERARROWS NAME {SIZE 50,0; MIN 1.0; MAX 100.0;}
But it seems that SIZE is not accepted in Python.
Where is the documentation of the description names and parameters used in Python? -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/07/2012 at 00:52, xxxxxxxx wrote:
.res file definition is the same for all languages (hopefully). It doesn't depends on the language.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/07/2012 at 01:35, xxxxxxxx wrote:
But there's a difference in making resources for dialogs and descriptions (objects, tags, etc).
ResEdit is a really good tool to create dialog resources. You can download it from the plugincafe's download section (the place where you can also download the documentations).-Nik
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/07/2012 at 01:41, xxxxxxxx wrote:
About the error with
EDITNUMBERARROWS NAME {SIZE 50,0; MIN 1.0; MAX 100.0;}EDITNUMBERARROWS doesn't accept MIN and MAX in the .res file.
You have to set the minimum and maximum in the code with GeDialog.SetReal(), for instance:self.SetReal(MY_CONTROL, 10.0, min=1.0, max=100.0)
This way you can then also set the initial value.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/07/2012 at 02:35, xxxxxxxx wrote:
I already use Resedit but it seems to only work fine for dialogs and not so well for descriptions.
As for EDITNUMBERARROWS, I can't even use that as I get an error. It seems that the only way to create numeric edit fields in descriptions for Python is with REAL or LONG.
So, definitely, there seems to exist some differences with the parameters in descriptors in Python and C++ and COFFEE.
And I still can't understand why the SIZE parameters doesn't work. I really need to be able to define the size of elements.Rui Batista
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/07/2012 at 03:23, xxxxxxxx wrote:
Originally posted by xxxxxxxx
I already use Resedit but it seems to only work fine for dialogs and not so well for descriptions.
As for EDITNUMBERARROWS, I can't even use that as I get an error. It seems that the only way to create numeric edit fields in descriptions for Python is with REAL or LONG.
So, definitely, there seems to exist some differences with the parameters in descriptors in Python and C++ and COFFEE.
And I still can't understand why the SIZE parameters doesn't work. I really need to be able to define the size of elements.You're getting an error because EDITNUMBERARROWS only works in a dialog resource. I've successfully declared an EDITNUMBERARROWS with SIZE but only in a dialog resource not a description resource. If you look at the EDITNUMBERARROWS documentation page in the C++ docs, you can see that it's a dialog element, not a description element.
In a description resource we declare the parameter type; this is why we have to use REAL, LONG, VECTOR etc.
And resource files (both description and dialog) aren't language dependent. The parser is independent. -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/07/2012 at 03:24, xxxxxxxx wrote:
_> It seems that the only way to create numeric edit fields in descriptions for Python is with REAL or LONG.
_
It's not for Python, it's for descriptions. Dialogs and descriptions differ. The resources for Python, COFFEE and C++ don't. In COFFEE, you usually don't need descriptions as, except for the (poor) TagData implementation (if even for that), you can only make dialogs.ResEdit doesn't work for descriptions, because it is made for dialogs. Dialogs and descriptions are actually very different things. For example, while a description-element usually has a label on it's own, a dialog-element has not.
Usually, you write descriptions by hand. There is not really a good tool. I've made one a while ago, but I must admit that it's not the best tool to create descriptions. The C++ documentation offers quite a lot of good information on dialog- and description resources, so take a look into that one if you haven't already.
-Nik
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/07/2012 at 03:34, xxxxxxxx wrote:
Thank you. I will look into it
Rui Batista
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/07/2012 at 03:43, xxxxxxxx wrote:
Apparently, there is no way to define the size of a numerical field (REAL, LONG or VECTOR) in descriptors
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/07/2012 at 03:47, xxxxxxxx wrote:
And, also, we can only create horizontal separators
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/07/2012 at 04:33, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Apparently, there is no way to define the size of a numerical field (REAL, LONG or VECTOR) in descriptors
Yes, you can't set the size of description elements. But I don't think it's bad. It guarantees uniform user interfaces in the attribute manager.
-Nik