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


C++ TopWindowStyle::GetFullScreen方法代码示例

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


在下文中一共展示了TopWindowStyle::GetFullScreen方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例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


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