• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TopWindowStyle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中TopWindowStyle的典型用法代码示例。如果您正苦于以下问题:C++ TopWindowStyle类的具体用法?C++ TopWindowStyle怎么用?C++ TopWindowStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: TopCanvas

void
TopWindow::Create(const TCHAR *text, PixelSize size,
                  TopWindowStyle style)
{
  invalidated = true;

  delete screen;
  screen = new TopCanvas();

#if defined(ENABLE_SDL) && (SDL_MAJOR_VERSION >= 2)
#ifdef UNICODE
  const WideToUTF8Converter text2(text);
#else
  const char* text2 = text;
#endif
  screen->Create(text2, size, style.GetFullScreen(), style.GetResizable());
#else
  screen->Create(size, style.GetFullScreen(), style.GetResizable());
#endif

  if (!screen->IsDefined()) {
    delete screen;
    screen = nullptr;
    return;
  }

  ContainerWindow::Create(nullptr, screen->GetRect(), style);

#if defined(ENABLE_SDL) && (SDL_MAJOR_VERSION < 2)
  SetCaption(text);
#endif
}
开发者ID:CnZoom,项目名称:XcSoarWork,代码行数:32,代码来源:TopWindow.cpp


示例2: TopCanvas

void
TopWindow::Create(const TCHAR *text, PixelSize size,
                  TopWindowStyle style)
{
  invalidated.store(true, std::memory_order_relaxed);

  delete screen;
  screen = new TopCanvas();
  screen->Create(size.cx, size.cy,
                 style.GetFullScreen(), style.GetResizable());

  ContainerWindow::Create(NULL, screen->GetRect(), style);

  SetCaption(text);
}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:15,代码来源:TopWindow.cpp


示例3: Create

  void Create(PixelSize size) {
    TopWindowStyle style;
    style.Resizable();

    SingleWindow::Create(_T("RunFAITriangleSectorRenderer"),
                         size, style);

    const PixelRect rc = GetClientRect();

    WindowStyle with_border;
    with_border.Border();

    PixelRect button_rc = rc;
    button_rc.top = button_rc.bottom - 30;
    close_button.Create(*this, _T("Close"), ID_CLOSE, button_rc);
    close_button.SetFont(normal_font);

    triangle_window.Create(*this, rc, with_border);
  }
开发者ID:MindMil,项目名称:XCSoar,代码行数:19,代码来源:RunFAITriangleSectorRenderer.cpp


示例4: sizeof

void
TopWindow::set(const TCHAR *cls, const TCHAR *text, PixelRect rc,
               TopWindowStyle style)
{
  const UPixelScalar width = rc.right - rc.left;
  const UPixelScalar height = rc.bottom - rc.top;

  screen.Set(width, height, style.GetFullScreen(), style.GetResizable());

  ContainerWindow::set(NULL, 0, 0, width, height, style);

#ifndef ANDROID
#ifdef _UNICODE
  char text2[_tcslen(text) * 4];
  ::WideCharToMultiByte(CP_UTF8, 0, text, -1, text2, sizeof(text2),
                        NULL, NULL);
#else
  const char *text2 = text;
#endif

  ::SDL_WM_SetCaption(text2, NULL);
#endif
}
开发者ID:damianob,项目名称:xcsoar_mess,代码行数:23,代码来源:TopWindow.cpp


示例5: Create

  void Create(PixelSize size) {
    TopWindowStyle style;
    style.Resizable();

    SingleWindow::Create(_T("RunMapWindow"), size, style);

    PixelRect rc = GetClientRect();
    map.Create(*this, rc);
    map.SetWaypoints(&way_points);
    map.SetAirspaces(&airspace_database);
    map.SetTopography(topography);
    map.SetTerrain(terrain);
    if (terrain != NULL)
      map.SetLocation(terrain->GetTerrainCenter());

    rc.left = 5;
    rc.top = 5;
    rc.right = rc.left + 60;
    rc.bottom = rc.top + 20;
    close_button.Create(*this, _T("Close"), ID_CLOSE, rc);
    close_button.SetFont(Fonts::map);
    close_button.BringToTop();
  }
开发者ID:StefanL74,项目名称:XCSoar,代码行数:23,代码来源:RunMapWindow.cpp


示例6: assert

void
TopWindow::CreateNative(const TCHAR *text, PixelSize size,
                        TopWindowStyle style)
{
  x_display = event_queue->GetDisplay();
  assert(x_display != nullptr);

  const X11Window x_root = DefaultRootWindow(x_display);
  if (x_root == 0) {
    fprintf(stderr, "DefaultRootWindow() failed\n");
    exit(EXIT_FAILURE);
  }

  XSetWindowAttributes swa;
  swa.event_mask = KeyPressMask | KeyReleaseMask | KeymapStateMask |
    ButtonPressMask | ButtonReleaseMask |
    PointerMotionMask |
    VisibilityChangeMask |
    ExposureMask | StructureNotifyMask;

  x_window = XCreateWindow(x_display, x_root,
                           0, 0, size.cx, size.cy, 0,
                           CopyFromParent, InputOutput,
                           CopyFromParent, CWEventMask,
                           &swa);
  if (x_window == 0) {
    fprintf(stderr, "XCreateWindow() failed\n");
    exit(EXIT_FAILURE);
  }

  XMapWindow(x_display, x_window);
  XStoreName(x_display, x_window, text);

  if (style.GetFullScreen()) {
    /* tell the window manager we want full-screen */
    const Atom atoms[] = {
      XInternAtom(x_display, "_NET_WM_STATE_FULLSCREEN", false),
    };
    XChangeProperty(x_display, x_window,
                    XInternAtom(x_display, "_NET_WM_STATE", false),
                    XA_ATOM, 32, PropModeReplace,
                    (const unsigned char *)atoms, ARRAY_SIZE(atoms));
  }

  /* receive "Close" button clicks from the window manager */
  auto wm_delete_window = XInternAtom(x_display, "WM_DELETE_WINDOW", false);
  XSetWMProtocols(x_display, x_window, &wm_delete_window, 1);
}
开发者ID:LK8000,项目名称:LK8000,代码行数:48,代码来源:TopWindow.cpp


示例7: Startup

/**
 * "Boots" up XCSoar
 * @param hInstance Instance handle
 * @param lpCmdLine Command line string
 * @return True if bootup successful, False otherwise
 */
bool
Startup()
{
  VerboseOperationEnvironment operation;

#ifdef HAVE_DOWNLOAD_MANAGER
  Net::DownloadManager::Initialise();
#endif

  LogFormat("Display dpi=%u,%u", Display::GetXDPI(), Display::GetYDPI());

  // Creates the main window

  TopWindowStyle style;
  if (CommandLine::full_screen)
    style.FullScreen();

  style.Resizable();

  MainWindow *const main_window = CommonInterface::main_window =
    new MainWindow();
  main_window->Create(SystemWindowSize(), style);
  if (!main_window->IsDefined())
    return false;

#ifdef ENABLE_OPENGL
  LogFormat("OpenGL: "
#ifdef ANDROID
#ifdef USE_EGL
            "egl=native "
#else
            "egl=no "
#endif
#endif
#ifdef HAVE_OES_DRAW_TEXTURE
            "oesdt=%d "
#endif
#ifdef HAVE_DYNAMIC_MULTI_DRAW_ARRAYS
            "mda=%d "
#endif
            "npot=%d vbo=%d fbo=%d stencil=%#x",
#ifdef HAVE_OES_DRAW_TEXTURE
            OpenGL::oes_draw_texture,
#endif
#ifdef HAVE_DYNAMIC_MULTI_DRAW_ARRAYS
            GLExt::HaveMultiDrawElements(),
#endif
             OpenGL::texture_non_power_of_two,
             OpenGL::vertex_buffer_object,
            OpenGL::frame_buffer_object,
            OpenGL::render_buffer_stencil);
#endif

  CommonInterface::SetUISettings().SetDefaults();
  main_window->Initialise();

#ifdef SIMULATOR_AVAILABLE
  // prompt for simulator if not set by command line argument "-simulator" or "-fly"
  if (!sim_set_in_cmd_line_flag) {
    SimulatorPromptResult result = dlgSimulatorPromptShowModal();
    switch (result) {
    case SPR_QUIT:
      return false;

    case SPR_FLY:
      global_simulator_flag = false;
      break;

    case SPR_SIMULATOR:
      global_simulator_flag = true;
      break;
    }
  }
#endif

  CommonInterface::SetSystemSettings().SetDefaults();
  CommonInterface::SetComputerSettings().SetDefaults();
  CommonInterface::SetUIState().Clear();

  const auto &computer_settings = CommonInterface::GetComputerSettings();
  const auto &ui_settings = CommonInterface::GetUISettings();
  auto &live_blackboard = CommonInterface::GetLiveBlackboard();

  if (!LoadProfile())
    return false;

  operation.SetText(_("Initialising"));

  /* create XCSoarData on the first start */
  CreateDataPath();

  Display::LoadOrientation(operation);
  main_window->CheckResize();

//.........这里部分代码省略.........
开发者ID:MaxPower-No1,项目名称:XCSoar,代码行数:101,代码来源:Startup.cpp


示例8: _T

/**
 * "Boots" up XCSoar
 * @param hInstance Instance handle
 * @param lpCmdLine Command line string
 * @return True if bootup successful, False otherwise
 */
bool
XCSoarInterface::Startup()
{
  VerboseOperationEnvironment operation;

  // Set the application title to "XCSoar"
  TCHAR szTitle[] = _T("XCSoar");

  //If "XCSoar" is already running, stop this instance
  if (MainWindow::find(szTitle))
    return false;

  LogStartUp(_T("Display dpi=%u,%u"), Display::GetXDPI(), Display::GetYDPI());

  // Creates the main window
  LogStartUp(_T("Create main window"));

  TopWindowStyle style;
  if (CommandLine::full_screen)
    style.FullScreen();
  if (CommandLine::resizable)
    style.Resizable();

  main_window.Set(szTitle, SystemWindowSize(), style);
  if (!main_window.IsDefined())
    return false;

#ifdef ENABLE_OPENGL
  LogStartUp(_T("OpenGL: "
#ifdef HAVE_EGL
                "egl=%d "
#endif
                "npot=%d vbo=%d fbo=%d"),
#ifdef HAVE_EGL
             OpenGL::egl,
#endif
             OpenGL::texture_non_power_of_two,
             OpenGL::vertex_buffer_object,
             OpenGL::frame_buffer_object);
#endif

  main_window.Initialise();

#ifdef SIMULATOR_AVAILABLE
  // prompt for simulator if not set by command line argument "-simulator" or "-fly"
  if (!sim_set_in_cmd_line_flag) {
    DialogLook white_look;
    white_look.Initialise(Fonts::map_bold, Fonts::map, Fonts::map_label,
                          Fonts::map_bold, Fonts::map_bold);
    white_look.SetBackgroundColor(COLOR_WHITE);
    SetXMLDialogLook(white_look);

    SimulatorPromptResult result = dlgSimulatorPromptShowModal();
    switch (result) {
    case SPR_QUIT:
      return false;

    case SPR_FLY:
      global_simulator_flag = false;
      break;

    case SPR_SIMULATOR:
      global_simulator_flag = true;
      break;
    }
  }
#endif

  SetXMLDialogLook(main_window.GetLook().dialog);

  SetSystemSettings().SetDefaults();
  SetComputerSettings().SetDefaults();
  SetUISettings().SetDefaults();
  SetUIState().Clear();

  if (!LoadProfile())
    return false;

  operation.SetText(_("Initialising"));

  /* create XCSoarData on the first start */
  CreateDataPath();

  Display::LoadOrientation(operation);

  main_window.InitialiseConfigured();

  TCHAR path[MAX_PATH];
  LocalPath(path, _T("cache"));
  file_cache = new FileCache(path);

  ReadLanguageFile();

  status_messages.LoadFile();
//.........这里部分代码省略.........
开发者ID:damianob,项目名称:xcsoar_mess,代码行数:101,代码来源:Components.cpp


示例9:

void
MainWindow::Create(PixelSize size, TopWindowStyle style)
{
  style.EnableDoubleClicks();
  SingleWindow::Create(title, size, style);
}
开发者ID:MindMil,项目名称:XCSoar,代码行数:6,代码来源:MainWindow.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Topend类代码示例发布时间:2022-05-31
下一篇:
C++ TopWindow类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap