Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Orbiter SDK Orbiter software developers post your questions and answers about the SDK, the API interface, LUA, meshing, etc.

Thread Tools
Old 05-24-2018, 09:42 AM   #1
Default MFD Button Labels for USER MFD's

I have been an Orbiter fan for a long time and am working very seriously now on my own .dll based ship. I am working specifically on a very wide panel (1920 pixels) and have room for at least 3 or maybe even 4 MFD's while realizing that there may be frame rate problems. I have all the MFD buttons working fine but I cannot get the button labels working in the additional MFD.

I am sure that I must be missing something very simple but I am really stumped on this one. From what I can determine the maximum number of MFD's permitted is actually 10 - left, right and eight additional user defined called USER1 - USER8. However, when I try to setup an additional MFD based on this everything works fine except for the button menus. I don't get any text output anywhere for the additional MFD.

I know the code works because I get the button menus for the left and right MFD's. This code was borrowed from DG with only a few modifications

void Special::RedrawPanel_MFDButton(SURFHANDLE surf, int mfd, int side)
    HDC hDC = oapiGetDC(surf);
    SelectObject(hDC, g_Param.hFont[0]);
    SetTextColor(hDC, RGB(196, 196, 196));
    SetTextAlign(hDC, TA_CENTER);
    SetBkMode(hDC, TRANSPARENT);
    const char *label;
    int x = 13;
    int y = 3;

    for (int bt = 0; bt < 6; bt++) {
        if (label = oapiMFDButtonLabel(mfd, bt + side * 6)) {
            TextOut(hDC, x, y, label, strlen(label));
            y += 41;
        else break;
    oapiReleaseDC(surf, hDC);
And the associated calling functions

    RedrawPanel_MFDButton(surf, MFD_USER1, 0);
    return true;
    RedrawPanel_MFDButton(surf, MFD_USER1, 1);
    return true;
Any ideas? Do I need to do something special for a USER MFD?

Thanks to all in advance.

Last edited by dbeachy1; 05-25-2018 at 03:23 AM. Reason: Added [code] tags so code snippets are easier to read :)
tuanbusku is offline   Reply With Quote
Old 05-25-2018, 01:06 PM   #2
Notebook's Avatar


I'm not sure if it will help, but have you been through this thread?

Developer masterclass: Creating 2-D panels the new way
Posted 09-09-10 at 05:28 by martins
Notebook is offline   Reply With Quote

  Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK

Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump

All times are GMT. The time now is 05:37 AM.

Quick Links Need Help?

About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.