comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: PropertySheet Widget Question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: PropertySheet Widget Question [message #36371] Mon, 15 September 2003 12:43
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
JD Smith writes:

> Without having taken the time to look into it, I was wondering if you can
> use properties and property sheets essentially for any object widget,
> independent of the iTools functionality. I.e., can you just INHERIT from
> a suitable property parent class, and get all the functionality for free?

With some caveats, this is true. I've been converting
the notion of "control panels" to "property sheets"
in my Catalyst Library, for example. I just made my
basic object, which all other objects in the system
inherit, a subclass of both IDL_Container and
IDLitComponent. The latter is required to register
properties for the PropertySheet widget.

You have to be just a bit careful. Properties are
really a notion associated with object graphic entities.
So properties like Line Style, Symbol, and Color have
specific meanings (type) with respect to object graphics axis
objects or plot objects, etc. So, for example, if your
objects work in the direct graphics system rather than
the object graphics system, there may or may not be
counterparts. There is a one-to-one match between line
styles, for example, so you can get away with a Line Style
property. But there are more object graphics symbols than
there are direct graphics symbols, so the user can choose
a symbol you can't provide (without some extra coding),
and this can cause an error.

Still, it is easy enough to work around these problems.
I have my own color picking tool, for example, so I can
create a property named COLOR, but instead of making it
a "color property", I make it a "user defined property".
Then when the user selects this property, my color selection
widget appears instead of the default one. Everything
else about this property works exactly like you would
expect. Very nice.

I did run into one other annoying feature of
property sheet widgets that RSI has promised to
look into it. String properties (e.g., I have been
working with a Tick Format property) beep every time
you hit a carriage return to enter the string value
on my Windows 2000 machine.

No beeps on Windows XP, so we are not sure what causes
this. Even though the property works correctly, I still
look up for error messages EVERY time (even when I know
it is coming...sigh!).

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: PropertySheet Widget Question [message #36372 is a reply to message #36371] Mon, 15 September 2003 12:06 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Fri, 12 Sep 2003 07:47:56 -0700, David Fanning wrote:

> David Fanning writes:
>
>> I want to set the font type. I have three choices: Hershey, Hardware,
>> and True-Type. I've used an enumerated property:
>>
>> self->RegisterProperty, 'FONT', 9, NAME="Font Type", $
>> ENUMLIST=['Hershey', 'Hardware', 'True-Type']
>>
>> But on the property sheet, the list shows up blank initially. The three
>> choices are there. And it works correctly, but I just don't see the
>> initial selection. I see the initial selection appears on iTools
>> enumerated lists, so I know it is possible. But two hours of looking
>> hasn't been of much help. Does anyone know how to do this?
>
> I ask questions on this newsgroup so infrequently that it seems a shame
> to answer my own question, but there you go...
>
> Thanks to the guys at RSI, who appear to get to work even before I do,
> I've figured out what my problem was. It's the ol' Hershey font is -1
> instead of the normal 0 for the default case problem. If the initial
> value of an ENUMLIST property is -1, then it doesn't put anything into
> its "default value" space initially.
>
> Now I've got it all sorted out and the property widget works like a
> champ. I'll be working on a training program today, though, to get all
> my users used to using FONT=0 if they want a Hershey font. :^)

Without having taken the time to look into it, I was wondering if you can
use properties and property sheets essentially for any object widget,
independent of the iTools functionality. I.e., can you just INHERIT from
a suitable property parent class, and get all the functionality for free?

JD
Re: PropertySheet Widget Question [message #36382 is a reply to message #36372] Fri, 12 September 2003 07:47 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> I want to set the font type. I have three choices:
> Hershey, Hardware, and True-Type. I've used an
> enumerated property:
>
> self->RegisterProperty, 'FONT', 9, NAME="Font Type", $
> ENUMLIST=['Hershey', 'Hardware', 'True-Type']
>
> But on the property sheet, the list shows up blank
> initially. The three choices are there. And it works
> correctly, but I just don't see the initial selection.
> I see the initial selection appears on iTools enumerated
> lists, so I know it is possible. But two hours of looking
> hasn't been of much help. Does anyone know how to do this?

I ask questions on this newsgroup so infrequently that
it seems a shame to answer my own question, but there you go...

Thanks to the guys at RSI, who appear to get to work
even before I do, I've figured out what my problem
was. It's the ol' Hershey font is -1 instead of the
normal 0 for the default case problem. If the initial value
of an ENUMLIST property is -1, then it doesn't put anything
into its "default value" space initially.

Now I've got it all sorted out and the property widget
works like a champ. I'll be working on a training program
today, though, to get all my users used to using FONT=0
if they want a Hershey font. :^)

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL java bridge
Next Topic: Simple 3D Visualisation

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 18 09:29:43 PDT 2025

Total time taken to generate the page: 1.44041 seconds