Single RangeSelector

Started by Fred Tomke, October 28, 2009, 02:31:43 AM

Previous topic - Next topic

Fred Tomke

Hello,

as I already note in the SliderSample I wanted to upload a RangeSelector. It can be used for selecting a single range. In this case two percentage values are changed.

Short sample description
Custom single range selection.

Requirements
OpenDCL Runtime 5.x

Used OpenDCL functionalities

  • Resizable modeless form
  • Working with OnPaint event of a picture box
  • Working with temorary drawings in a picturebox
  • Working with mouse events

Long sample description, genesis
I participate to a project of a university for landscape architects. At this project plants and flowers have to be distributed on the ground according to certain rules. Rules can be followed absolutely (yes/no), by priority (how important is this rule, using random generator), and at least by having a value in a given range. Until now I didn't know how to define the range. Using a picture box may solve this. It could be also a base for multiple ranges.

Features of the selector

  • To set the initial values click anywhere into the picturebox (for instance onto the small text).
  • Click left mousebutton on the left hand side of the blue bar's left end, the lower end of the selection will be changed to the clickpoint. Moving the mouse while the left mousebutton is pressed, the lower end changes as long you move the mouse.
  • Click left mousebutton on the right hand side of the blue bar's right end, the upper end of the selection will be changed to the clickpoint. Moving the mouse while the left mousebutton is pressed, the upper end changes as long you move the mouse.
Divide now in mind the bar into 4 parts:
  • Click the left mouse button within the left quarter of the bar, the lower end of the selection will be changed to the clickpoint.
  • Click the left mouse button within the right quarter of the bar, the upper end of the selection will be changed to the clickpoint.
  • Click within the middle two quarters of the blue bar you can move the blue bar without changing the range width. If you move the bar to the left or to the right end the bar stops there, even if you're going on moving the mouse (until you have reached the outer quarter of the blue bar).
  • The blue bar will automatically get stretched if the form will be resized.

Enjoy it!

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

BazzaCAD

Dude, you're making the rest of us look bad. :)
Amazing work.
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

DW

Fred,
Thanks for sharing, it is great to see creative ways for leveraging OpenDCL. I'm looking forward to discovering how you've put this control together. I'm a landscape architect and use OpenDCL interfaces for planting plan management and documentation - plants are usually distributed either as a mix (percentage) or individually, your control suggests an intriguing new way of defining plant distribution.

Cheers,
David

Fred Tomke

Hi, David, it's great to hear that you're doing the same like me. In a few weeks I can let you take part of the university project. I'm interested in your opinion about our solution.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Slavko Ivanovic


Creative and useful.

I will add this to my standard library for sure!

Fred. Excellent job.

Regards.
***  siCAD Solutions for AutoCAD  ***
ArchiTools l ToolsPlus l LandTools l LBE

DW

Thanks Fred, I would very much like to be involved and to provide some feedback in your project.
Regards,
David