Jump to content
Sign in to follow this  
Guest Moparmike

Get gauge size into a variable? (using FS2000/CFS2 gua...

Recommended Posts

Guest Moparmike

I'm working on a slider-type gauge for CFS2...hence the reason behind me using the FS2000 SDK...I need to find the y-axis size of my gauge when it's placed on the panel so I can use it in the mouse position calculations.I've got working code for this in an FS2002 gauge using this to get the size dimension:

 pelement->gauge_header->size.y

The problem is that the FS2000 gauge header doesn't have "size" defined. To get my mouse position, I'm using:

 PPIXBOX relative_point

I have tried using

 PPIXBOX size_y

to get the y-axis dimension into the code as a variable, but it isn't working.In particular, I'm using the formula "y_axis_dimension_var - relative_point_var" to invert the mouse action. I.E. 0 @ the bottom of the gauge and the Y-axis size value @ the top of the gauge.Anyone have any tips or a snippet I can follow?

Share this post


Link to post
Share on other sites
Guest Moparmike

Additional info:I can get the x-axis dimension into the gauge usingpelement->gauge_header->size_x_mmbut there is no similar def for the y-axis...Here is the FS700 gauge header definition from the FS2000gauges.h:////////////////////////////////////////////////////////////////////typedef struct GAUGEHDR{ UINT32 gauge_header_version; char *gauge_name; PPELEMENT_HEADER elements_list; PQUERY_ROUTINE_610 query_routine_610; PINSTALL_ROUTINE_610 install_routine_610; PINITIALIZE_ROUTINE_610 initialize_routine_610; PUPDATE_ROUTINE_610 update_routine_610; PGENERATE_ROUTINE_610 generate_routine_610; PDRAW_ROUTINE_610 draw_routine_610; PKILL_ROUTINE_610 kill_routine_610; char reserved_1[4]; UINT32 size_x_mm; char reserved_2[32]; PMOUSERECT mouse_rect; PGAUGE_CALLBACK gauge_callback; UINT32 user_data; PVOID parameters; char* usage; char reserved_3[16];}////////////////////////////////////////////////////////////////////Here is the PIXBOX def:////////////////////////////////////////////////////////////////////typedef struct PIXBOX{ PIXEL x; PIXEL y; PIXEL size_x; PIXEL size_y;}////////////////////////////////////////////////////////////////////

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...