ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 01-31-2013
Vadim Fooks's Avatar
Vadim Fooks Vadim Fooks is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 67
Downloads: 26
Uploads: 0
Thanks: 50
Thanked 24 Times in 13 Posts
Rep Power: 118
Vadim Fooks will become famous soon enough
Default Drawing Custom Graphics/Mouse input in the GUI window

Greetings Ladies and Gentlemen,
Is there an easy way of creating simple vector graphics in the GUI window and a simple coordinate input and select/deselect mechanism?
For example, my model generates a number of coordinates that I visualize as selectable dots on the dedicated GUI window (not the 2D or 3D model window) and I give the user an option of selecting a number of those dots either by clicking on them or by clicking and dragging the selection window and then postprocessing the selected ones (e.g. storing their coordinates in the database).
I tried experimenting with the GUI and I managed to get it to fire mouse up and mouse down events, but not OnDraw and I could not figure out where to find mouse coordinates.
Could somebody possibly expalain if that is possible and hopefully direct me to appropriate resources/examples?
Thank you!
Vadim
  #2  
Old 01-31-2013
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

You can get full control of drawing and interacting with a mouse using a "graph" window type in the Flexsim GUI builder.

You can use OnDraw, OnClick, and other event handlers. cursorinfo() is the command you want to use to get the mouse cursor's location. clickcode() may also be helpful.

We use this mechanism in several places in the software, such as the Animator's timeline and the object selection popup.

Here are links to a few examples. These ones are drawing graphs, but you can draw whatever you want. Several of the widgets in CT are also custom-drawn using this method.

http://www.flexsim.com/community/for...ead.php?t=1863

http://www.flexsim.com/community/for...read.php?t=409
The Following User Says Thank You to Phil BoBo For This Useful Post:
Vadim Fooks (01-31-2013)


Thread Thread Starter Forum Replies Last Post
Pick window on conveyor. Neil Brandon Q&A 9 02-04-2013 03:12 AM
Custom GUI processing time input & script control shashanktrivedi Q&A 2 05-19-2011 10:28 AM
problem about GUI window Dane Lee Q&A 1 12-02-2010 06:53 AM
Edit Shape Factors using mouse Kris Geisberger User Development 0 04-22-2009 12:19 PM
Set Window position and size Nico Zahn Q&A 5 09-03-2008 02:09 PM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.