Board index FlightGear Development Aircraft Cockpit development

movable panel instruments

Discussion about creating 2d and 3d cockpits.

movable panel instruments

Postby rahulroyrd350 » Thu Nov 19, 2009 2:58 pm

Sorry for the duplicate topic , but i felt that this is a more appropriate place to post this query

I want to be able to move the different instruments in my 2d panel to any position on my screen. Not with just shortcut keys , but with an intuitive drag and drop with the pointer. Is there any way to get this result? I am aware of the feature to have clickable objects in the panel. Any suggestions? Is there an existing patch available for this? Please give your inputs. I'd like to create some patch for this.
rahulroyrd350
 
Posts: 60
Joined: Wed Oct 28, 2009 5:08 am
Location: India
Callsign: rd350
Version: 2
OS: Fedora 8

Re: movable panel instruments

Postby rahulroyrd350 » Thu Nov 26, 2009 6:02 pm

Help! Please, this drag and drop of panel instruments will be a really useful feature for the ground replay system i am designing. Please share any ideas you have got on how to achieve this. No idea is too silly
rahulroyrd350
 
Posts: 60
Joined: Wed Oct 28, 2009 5:08 am
Location: India
Callsign: rd350
Version: 2
OS: Fedora 8

Re: movable panel instruments

Postby Torsten » Fri Nov 27, 2009 8:57 am

There is no out-of-the-box solution for this, sorry.
But with a little coding, it mibht be possible to implement.
    - Add a x-shift and a y-shift translation to each instrument, bound to individual properties
    - Add a *big* clickabel hotspot to your panel
    - Create some nasal code that monitors your mouse position after a click
    - With mouse button down, calculate the offset of your mouse pointer to the position of the click
    - set the x-shift and y-shift properties from the offset for the dragged instrument

You can even write the new offsets to a file, nasal can write property tree fragments to an xml file and reload them on next startup.

Not trivial, but doable.

Torsten
User avatar
Torsten
 
Posts: 645
Joined: Fri Feb 01, 2008 9:22 pm
Location: near Hamburg, Germany
Callsign: offline
Version: next
OS: Linux

Re: movable panel instruments

Postby rahulroyrd350 » Sun Nov 29, 2009 2:38 am

Torsten wrote:There is no out-of-the-box solution for this, sorry.
But with a little coding, it mibht be possible to implement.
    - Add a x-shift and a y-shift translation to each instrument, bound to individual properties
    - Add a *big* clickabel hotspot to your panel
    - Create some nasal code that monitors your mouse position after a click
    - With mouse button down, calculate the offset of your mouse pointer to the position of the click
    - set the x-shift and y-shift properties from the offset for the dragged instrument

You can even write the new offsets to a file, nasal can write property tree fragments to an xml file and reload them on next startup.

Not trivial, but doable.

Torsten

Exactly the kind of reply i was hoping to get. Thanks.. gave me a few ideas =)
rahulroyrd350
 
Posts: 60
Joined: Wed Oct 28, 2009 5:08 am
Location: India
Callsign: rd350
Version: 2
OS: Fedora 8


Return to Cockpit development

Who is online

Users browsing this forum: No registered users and 0 guests