Ignore:
Timestamp:
02/14/13 19:09:26 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added initial support for the menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/plugin/src/xplra/MessageWindow.cc

    r38 r42  
    7373
    7474MessageWindow::MessageWindow() :
     75    showForced(false),
    7576    hideTime(0.0),
    7677    duration(0.0)
     
    104105//------------------------------------------------------------------------------
    105106
     107void MessageWindow::show()
     108{
     109    showForced = true;
     110    XPLMSetWindowIsVisible(windowID, 1);
     111}
     112
     113//------------------------------------------------------------------------------
     114
     115void MessageWindow::hide()
     116{
     117    showForced = false;
     118}
     119
     120//------------------------------------------------------------------------------
     121
    106122void MessageWindow::drawWindow()
    107123{
     
    115131    }
    116132
    117     if (now>=hideTime) {
     133    if (now>=hideTime) hideTime = 0.0;
     134
     135    if (hideTime==0.0 && !showForced) {
    118136        XPLMSetWindowIsVisible(windowID, 0);
    119137    } else {
    120138        XPLMDrawTranslucentDarkBox(left, top, right, bottom);
    121         XPLMDrawString(colour, left + 25, top - 15,
    122                        const_cast<char*>(displayedMessage.c_str()), 0,
    123                        xplmFont_Basic);
     139        if (hideTime!=0.0) {
     140            XPLMDrawString(colour, left + 25, top - 15,
     141                           const_cast<char*>(displayedMessage.c_str()), 0,
     142                           xplmFont_Basic);
     143        }
    124144    }
    125145}
Note: See TracChangeset for help on using the changeset viewer.