Custom slider


#1

Hi all,

I’m writing a Rhino plugin, that includes a small tabbed dialog.

In this dialog I’d like to put some sliders like in the ‘Materials’ plugin : this control shows the current value near the slider cursor, and includes an edit field to set the value.

Is this control available in the SDK ?

Thanks,

Claude


(John Brock) #2

Changed category to Rhino Developer.


(Dale Fugier) #3

Hi Claude,

If you are using the Rhino C++ SDK and, thus, MFC, then just use the CSliderCtrl control.

If you using RhinoCommon and WinForms, then you can use a TrackBar control.

– Dale


#4

Hi Dale,

Thanks for the information.

I’ll test that asap.

Claude.

[image: 3dRudder Logo] https://3dRudder.com * Claude Boulard | Embedded
Software Engineer*

3dRudder.com https://www.3drudder.com | cboulard@3drudder.com
1480 avenue Armenie / Puits Morandat / Gardanne, 13120

[image: image]


#5

Hi Dale,

I have another question, linked to the same topic (our Rhino plugin).

This plugin is based on a ‘CDialog’ object, including various controls for
the user interface.

In our plugin, a Rhino command ("_Zoom _All _Extents") is sent when a user
action (roughly a foot pressure on our device) is exceeding a given level.

This level is set via a control (a CEdit) in the user interface.

When testing this feature, an issue appeared : if the user sets incorrectly
this level to a low value, the trigger condition is always true, and the
command ("_Zoom _All _Extents") is sent continuously.
So far this is correct.

But, when Rhino executes this command, it redraws (or it forces the redraw)
our dialog window, so that the user can’t enter a correct value for the
parameter, because the dialog is permanently refreshed.

We were unable to understand and correct this issue.

We have bypassed this issue, by adding limits on this level, changing the
trigger condition etc.

Now it works better, but we’d prefer the “_Zoom _All _Extents” command not
to cause a refresh our plugin window.

Is it possible ?

Regards,

Claude B

[image: 3dRudder Logo] https://3dRudder.com * Claude Boulard | Embedded
Software Engineer*

3dRudder.com https://www.3drudder.com | cboulard@3drudder.com
1480 avenue Armenie / Puits Morandat / Gardanne, 13120

[image: image]


(Dale Fugier) #6

Hi @Claude_Boulard,

It is not clear to me how running the Zoom command is causing your dialog to refresh. We might need more details from you.

I’m guessing you are listening to a view event, and then this even occurs, then you have your dialog update. If this is the case, then just set a flag before running Zoom. Then when the view event occurs, check the flag and do nothing if it is set.

Also, if you’d rather not script the Zoom command, you can do this in code.

https://github.com/mcneel/rhino-developer-samples/blob/master/cpp/SampleCommands/cmdSampleZoomExtents.cpp

– Dale


#7

Hi Dale,

Thanks for the information. I’ll test it asap.

Regards.

Claude