• 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.

Show/hide Panel

Messages
7
Country
russia
Could you tell me, please, how can I hide/show a panel window in MSFS2004?
I can use 64 panel windows, but how can I switch them without using menu?
 
Look at the code below, which is based on one from the simicons.cab file. These are the little 'buttons' on default panels to open/close windows.

Code:
<?xml version="1.0" encoding="utf-8"?>
<Gauge Name="GPS Zoom" Version="1.0">
    <Image Name="wincontrol.bmp"/>
    <Mouse>
        <Cursor Type="Hand"/>
	  <Tooltip>GPS Zoom</Tooltip>
        <Click>225 (&gt;K:PANEL_ID_TOGGLE)</Click>
    </Mouse>
</Gauge>

The number immediately following the <Click> entry (225 in this case) matches the number used in the ident= section of a [Windownn] entry in a panel.cfg file.

//--------------------------------------------------------
[Window01]
Background_color=32,32,32
size_mm=501,808
window_size_ratio=1.000
position=0
visible=0
ident=225
window_size= 0.352, 0.967
window_pos= 0.650, 0.040
no_luminous=1
zorder=4

You may change the label in the <Tooltip>My Custom Tooltip</Tooltip> entry as desired.

Obviously, the <Gauge Name="My Gaugename" Version="1.0"> should list the name you wish for your gauge to use... :D

In this example, the "wincontrol.bmp" is a transparent bitmap (pure black: RGB 0,0,0), but it can be anything you wish to use.
 
Last edited:
Thanks!
XML it's great, but what about C-code?

Well, if you wanted C you should have asked for it to begin with! ;)

Ninety-nine percent of folks who ask such questions want XML solutions. :D

In fact, if ALL you want to do is create a couple of such win_control gauges, C is waaaayyy overkill! :eek:

Code:
BOOL FSAPI wincontrol_RADIO_mouse_cb( PPIXPOINT relative_point, FLAGS32 mouse_flags)
{
    trigger_key_event (KEY_PANEL_ID_TOGGLE,10030) ; 
    return FALSE;
}

MOUSE_BEGIN(wincontrol_RADIO_mouse_rect,0,0,0)
  MOUSE_TOOLTIP_TEXT_STRING ("Radio Stack",NULL)
  MOUSE_CHILD_FUNCT(0,0,17,17,CURSOR_HAND,MOUSE_LEFTSINGLE,wincontrol_RADIO_mouse_cb)
MOUSE_END

For further details, see this 'sticky post' at my Panel & Gauge Forum: http://forums.flightsim.com/vbfs/showthread.php?t=159063
 
Last edited:
Well, if you wanted C you should have asked for it to begin with! ;)

Oh, sorry.

Ninety-nine percent of folks who ask such questions want XML solutions. :D

Hm, I think C is more conveniently.

In fact, if ALL you want to do is create a couple of such win_control gauges, C is waaaayyy overkill! :eek:

I want to create a panel with several gauges and the panel for testing gauges on first panel (it needs to send parameters between gauges on different panels and it would be convenient for testing).

Thanks a lot for help!

Sorry for my English.
 
Back
Top