• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Mouse functions in C++

JB3DG

Resource contributor
Messages
1,325
Country
southafrica
Hi guys

Can someone explain how the mouse_list_install/register/unregister functions work? I have a multi page aircraft config manager that i have created as a C++ gauge and i need to be able to dynamically add and remove mouse areas based on the page that im in. I would do it as a Simconnect window but i dont have much knowledge about Windows programming and no time to learn it at this time.

Thanks
JB
 
Jon, are these multi-function line-select buttons you need to reconfigure, or simply random click spots depending on the page displayed?
 
random click spots that must change location with each page or even be removed.
 
In any case, you can make the "click" action dependent on whether any given page is currently selected, much like we can use a <Visibility> condition to enable/disable any given mouse area.

Not tested, but perhaps something like this?
Code:
if (Page1 == 1) {
	MOUSE_CHILD_FUNCT(61,347,48,47,CURSOR_HAND,MOUSE_LEFTSINGLE,EDM700_R_mouse_cb0)
	MOUSE_CHILD_FUNCT(292,354,43,38,CURSOR_HAND,MOUSE_LEFTSINGLE,EDM700_R_mouse_cb1)
}

if (Page2 == 1) {
	MOUSE_CHILD_FUNCT(x,y,w,h) etcetera...
}
 
Thats what i have been using....but unless there is another way to use it i have only used it inside the MOUSE_BEGIN/MOUSE END macros which has made them fixed position only. Thats why i asked about those special function like mouse list install or mouse list register/unregister and how they work.
 
Thats what i have been using....but unless there is another way to use it i have only used it inside the MOUSE_BEGIN/MOUSE END macros which has made them fixed position only. Thats why i asked about those special function like mouse list install or mouse list register/unregister and how they work.

I've never even looked at any other possibility... ;)
 
Oh i see you put a function in the place of a key event for the last parameter and then you can control if the key event is triggered! :D
 
And i see you are using MOUSE_CHILD_FUNC rather than MOUSE_CHILD_EVENT. How did i miss this....thanks a bunch :D
 
Back
Top