PDA

View Full Version : Help with event call back for throttle control



sonofullr
04-07-2007, 11:27 AM
I am designing a throttle,pitch and mixture control for a Diamond Star using some photo realist shots I took of my plane. I've got the MAKE_SLIDER to work but need help with some sample code for the MOUSE_CHILD_EVENT or MOUSE_CHILD_FUNC to position the controls using the mouse. Does anyone have some sample code for these?

Vince Kumagai -sonofullr
Diamond DA-40 N445DS

n4gix
04-07-2007, 02:06 PM
MOUSE_CHILD_FUNCT(44,8,82,143,CURSOR_UPARROW,MOUSE_LEFTDRAG,TQ_eng1_icr_mouse_cb)
MOUSE_CHILD_FUNCT(44,147,82,143,CURSOR_DOWNARROW,MOUSE_LEFTDRAG,TQ_eng1_dcr_mouse_cb)

BOOL FSAPI TQ_eng1_icr_mouse_cb( PPIXPOINT relative_point, FLAGS32 mouse_flags)
{
trigger_key_event (KEY_THROTTLE_INCR,0) ;
return FALSE;
}
BOOL FSAPI TQ_eng1_dcr_mouse_cb( PPIXPOINT relative_point, FLAGS32 mouse_flags)
{
trigger_key_event (KEY_THROTTLE_DECR,0) ;
return FALSE;
}