コード例 #1
0
ファイル: app.cpp プロジェクト: 623442733/sciter-sdk
extern "C" HWINDOW startup()
{
    RECT frame;
    frame.top = 100;
    frame.left = 100;
    frame.right = 100 + 500 + 1;
    frame.bottom = 100 + 500 + 1;
    
    HWINDOW hw = SciterCreateWindow(SW_MAIN | SW_ALPHA | SW_TOOL, &frame, 0,0,0);
    SciterSetCallback(hw, &SciterViewCallback, nullptr);
    SciterLoadFile(hw, WSTR("res:default.htm"));
    
    return hw;
}
コード例 #2
0
bool wxSciterControl::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos /*= wxDefaultPosition*/, const wxSize& size /*= wxDefaultSize*/, long style /*= wxSUNKEN_BORDER*/, const wxValidator& validator /*= wxDefaultValidator*/)
{
  if (!wxControl::Create(parent, id, pos, size, style, validator))
    return false;

  SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
  SetInitialSize(size);

  // Create Sciter child window with size exactly as our control.
  const auto crc = this->GetClientRect();
  RECT rc = {crc.GetLeft(), crc.GetTop(), crc.GetRight(), crc.GetBottom()};
  m_hwnd = SciterCreateWindow(SW_CHILD, &rc, nullptr, nullptr, this->GetHandle());

  if(m_hwnd) {
    static volatile sciter::debug_output setup_dbg;

    // Setup sciter callbacks
    setup_callback();
    sciter::attach_dom_event_handler(m_hwnd, this);

    // Adjust our window style to eliminate double edge 
    if(this->HasFlag(wxBORDER_MASK)) {
      auto style = this->GetWindowStyleFlag();
      style &= ~wxBORDER_MASK;
      style |= wxBORDER_NONE;
      this->SetWindowStyleFlag(style);
    }

    // Show Sciter window
#ifdef __WINDOWS__
    ::ShowWindow(m_hwnd, this->IsShown() ? SW_SHOW : SW_HIDE);
#endif

    this->Refresh();
  }
  return true;
}