当前位置: 首页>>代码示例>>C++>>正文


C++ AirspaceWarning::get_ack_day方法代码示例

本文整理汇总了C++中AirspaceWarning::get_ack_day方法的典型用法代码示例。如果您正苦于以下问题:C++ AirspaceWarning::get_ack_day方法的具体用法?C++ AirspaceWarning::get_ack_day怎么用?C++ AirspaceWarning::get_ack_day使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AirspaceWarning的用法示例。


在下文中一共展示了AirspaceWarning::get_ack_day方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: lease


//.........这里部分代码省略.........
      
      canvas.text_clipped(paint_rc.left + Col0LeftScreenCoords,
                          paint_rc.top + IBLSCALE(TextTop),
                          rcTextClip, sTmp);
      
      _stprintf(sTmp, _T("%-20s"), sTop.c_str());
      canvas.text(paint_rc.left + Col1LeftScreenCoords,
                  paint_rc.top + IBLSCALE(TextTop), sTmp);
      
      _stprintf(sTmp, _T("%-20s"), sBase.c_str());
      canvas.text(paint_rc.left + Col1LeftScreenCoords,
                  paint_rc.top + IBLSCALE(TextTop + TextHeight),
                  sTmp);
    }
    
    if (warning.get_warning_state() != AirspaceWarning::WARNING_INSIDE &&
        warning.get_warning_state() > AirspaceWarning::WARNING_CLEAR) {
      
      _stprintf(sTmp, _T("%d secs dist %d m"),
                (int)solution.elapsed_time,
                (int)solution.distance);
      
      canvas.text_clipped(paint_rc.left + Col0LeftScreenCoords,
                          paint_rc.top + IBLSCALE(TextTop + TextHeight),
                          rcTextClip, sTmp);
    }
    
    /* draw the warning state indicator */
    
    Brush *state_brush;
    const TCHAR *state_text;
    
    if (warning.get_warning_state() == AirspaceWarning::WARNING_INSIDE) {
      if (warning.get_ack_expired())
        state_brush = &hBrushInsideBk;
      else
        state_brush = &hBrushInsideAckBk;
      state_text = _T("inside");
    } else if (warning.get_warning_state() > AirspaceWarning::WARNING_CLEAR) {
      if (warning.get_ack_expired())
        state_brush = &hBrushNearBk;
      else
        state_brush = &hBrushNearAckBk;
      state_text = _T("near");
    } else {
      state_brush = NULL;
      state_text = NULL;
    }
    
    const PixelSize state_text_size =
      canvas.text_size(state_text != NULL ? state_text : _T("W"));
    
    if (state_brush != NULL) {
      /* colored background */
      PixelRect rc;
      
      rc.left = paint_rc.left + Col2LeftScreenCoords;
      rc.top = paint_rc.top + Layout::FastScale(paint_rc_margin);
      rc.right = paint_rc.right - Layout::FastScale(paint_rc_margin);
      rc.bottom = paint_rc.bottom - Layout::FastScale(paint_rc_margin);
      
      canvas.fill_rectangle(rc, *state_brush);
    }
    
    if (state_text != NULL) {
      // -- status text will be centered inside its table cell:
      canvas.text(paint_rc.left + Col2LeftScreenCoords + Layout::FastScale(paint_rc_margin) + (statusColWidth / 2)  - (canvas.text_width(state_text) / 2),
                  (paint_rc.bottom + paint_rc.top - state_text_size.cy) / 2,
                  state_text);
    }
    
    if (!warning.get_ack_expired())
      canvas.set_text_color(old_text_color);
        
    if (CursorAirspace == &as) {
      update_vis = true;
      if (!warning.get_ack_expired()) {
        ack1_vis = false;
        ack_vis = false;
      } else {
        if (warning.get_warning_state() == 
            AirspaceWarning::WARNING_INSIDE) {
          ack_vis = true;
          ack1_vis = false;
        } else {
          ack_vis = false;
          ack1_vis = true;
        }
      }
      ack2_vis = !warning.get_ack_day();
      enable_vis = !warning.get_ack_expired();
    }
  } // close scope
  if (update_vis) {
    wbAck1->set_visible(ack1_vis);
    wbAck2->set_visible(ack2_vis);
    wbAck->set_visible(ack_vis);
    wbEnable->set_visible(enable_vis);
  }
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:101,代码来源:dlgAirspaceWarnings.cpp


注:本文中的AirspaceWarning::get_ack_day方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。