Author Topic: Interactive DIP Switch Shape  (Read 36193 times)

0 Members and 1 Guest are viewing this topic.

YossiD

  • Jr. Member
  • **
  • Posts: 58
Interactive DIP Switch Shape
« on: February 08, 2009, 05:26:05 AM »
I have created a grouped shape of a DIP switch to be used in test equipment diagrams (attached). I'm looking for a way to get the individual switch to toggle between the OPEN and CLOSED positions. I thought of using EventDblClick, but I'm not experienced with that function and I haven't managed to get it to work.

I have a feeling this can be done making each switch in the bank a group of three shapes consisting of the outline and two smaller filled rectangles, one in the OPEN position and one in the CLOSED, with one of them visible and the other not. The double click event would swap the visibility attributes of the two small rectangles.

I also thought of a possibility of a right click option for the complete bank of switches that would bring up a table wherein one could specify which switches are OPEN and which are CLOSED.

All suggestions/solutions gratefully appreciated.
« Last Edit: February 12, 2009, 03:41:51 AM by Visio Guy »

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2948
    • Paul Herber's website
Re: Interactive DIP Switch Shape
« Reply #1 on: February 08, 2009, 07:12:19 AM »
Just a very quick response as I'm a bit busy ...
In the shape's shapesheet have a look at the Actions section, this is how you can add new commands to the shape's right-click menu. Toggling the menu item will change the "Checked" value, the fill formula (for example) of your shape can test this value and change the fill colour.
Or look at the formula used by the "Flowchart shapes" shape in the Flowchart stencil.

« Last Edit: February 12, 2009, 03:42:00 AM by Visio Guy »
Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

aledlund

  • Hero Member
  • *****
  • Posts: 1412
Re: Interactive DIP Switch Shape
« Reply #2 on: February 08, 2009, 11:01:02 AM »
sounds like a great project to implement Chris' discussion on multishapes (elsewhere on his site),
al
« Last Edit: February 12, 2009, 03:42:14 AM by Visio Guy »

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3829
  • Ideas Visio-lized into solutions
Re: Interactive DIP Switch Shape
« Reply #3 on: February 08, 2009, 12:11:10 PM »
Take a look at the attached drawing.  It uses double click event.  It's something I did awhile back...cleaned-up the file.
« Last Edit: February 12, 2009, 03:42:22 AM by Visio Guy »
Visio 2019 Pro

YossiD

  • Jr. Member
  • **
  • Posts: 58
Re: Interactive Shapes
« Reply #4 on: February 11, 2009, 03:00:07 AM »
Thanks, this is very helpful. Looks like it's more complicated to do than I originally thought, but hopefully your example will see me through.

Zigoto

  • Jr. Member
  • **
  • Posts: 16
Re: Interactive DIP Switch Shape
« Reply #5 on: February 11, 2009, 09:14:29 AM »
Pls find here enclosed the Dip Switch I have made.
Right click on the shape to select Open or Closed switch

Ziorg77
« Last Edit: February 12, 2009, 03:42:28 AM by Visio Guy »

YossiD

  • Jr. Member
  • **
  • Posts: 58
Re: Interactive DIP Switch Shape
« Reply #6 on: February 12, 2009, 12:54:36 AM »
Whoa, looks like you've done all the work for me. Now I just have to work through it to understand how it all works.

Huge thanks.
« Last Edit: February 12, 2009, 03:42:42 AM by Visio Guy »

Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1718
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Interactive DIP Switch Shape
« Reply #7 on: February 12, 2009, 03:41:31 AM »
Nice work, Ziorg77!

I've added a modified version of the DIP switch shape. Depending on how you use it, this might be an easier way to set the switches. Instead of setting each item, you enter an 8-digit bit-mask in a Shape Data field.

So to turn all of the switches on, you enter: 11111111. To turn them off, enter 00000000

You see the Shape Data window by toggling it via: View > Shape Data Window, or View > Custom Properties Window in older versions of Visio.

This shape might come in handy, say, if you were dropping lots of them on a page using automation code. It would be much easier and faster to set the switch values. For novice users or occasional changes, the first version is much better.
« Last Edit: February 12, 2009, 03:43:59 AM by Visio Guy »
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

aledlund

  • Hero Member
  • *****
  • Posts: 1412
Re: Interactive DIP Switch Shape
« Reply #8 on: February 12, 2009, 07:02:28 AM »
very slick!
al

Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1718
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Interactive DIP Switch Shape
« Reply #9 on: February 12, 2009, 07:53:43 AM »
Ooops, I suppose the 0s should be open and the 1s closed?
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Zigoto

  • Jr. Member
  • **
  • Posts: 16
Re: Interactive DIP Switch Shape
« Reply #10 on: February 12, 2009, 10:58:10 AM »
Thanks Visio Guy,
It's always the same question with the Dip Switch Open=On=1 or Open=Off = 0
I use to say "OpenOffO" in one word to remember
Great job, perfect with "OPEN = ON = 0" string instead of "OPEN"

Ziorg77

YossiD

  • Jr. Member
  • **
  • Posts: 58
Re: Interactive DIP Switch Shape
« Reply #11 on: February 12, 2009, 12:22:00 PM »
Thanks Ziorg and Visio guy for your excellent solutions. Not only have you provided me with the shape I need, but I have learned a lot by looking at the shape sheets for these solutions. It would have taken me days to figure this out on my own.

zhuravsky

  • Jr. Member
  • **
  • Posts: 46
Re: Interactive DIP Switch Shape
« Reply #12 on: February 19, 2009, 01:16:05 AM »
One more version.
No actions, no bit masks...
Just slide a switch as per usual, use mouse instead of screwdriver.
:)

YossiD

  • Jr. Member
  • **
  • Posts: 58
Re: Interactive DIP Switch Shape
« Reply #13 on: February 19, 2009, 03:00:48 AM »
Thanks zhuravsky.

With three solutions now this is really an embarrassment of riches!

Where do you guys find the time to do this? I can't even find the time to try to understand exactly how the solutions work.

Thank you all.

zhuravsky

  • Jr. Member
  • **
  • Posts: 46
Re: Interactive DIP Switch Shape
« Reply #14 on: February 19, 2009, 07:02:52 AM »
Hi,
It takes not so much time if you know how, I spent may be 30 minutes for previous variant.
Enjoy one more variant: "3d" dip switch

Edit: images added by Visio Guy to show off zhuravsky's very cool shapes
« Last Edit: February 19, 2009, 08:08:52 AM by Visio Guy »