Example #1
0
void ImageButton::OnMouseUp(wxMouseEvent& evt) {
  wxWindow* w = static_cast<wxWindow*>(evt.GetEventObject());
  if (w->HasCapture()) w->ReleaseMouse();

  wxRect zeroRect(0, 0, GetSize().GetWidth(), GetSize().GetHeight());

  pressed_ = false;
  SetState(_T("Up"));
  Update();

  if (zeroRect.Contains(evt.GetPosition())) {
    wxCommandEvent newEvent(wxeEVT_CLICK);
    newEvent.SetEventObject(this);
    GetEventHandler()->ProcessEvent(newEvent);
  }
}
Example #2
0
void TabDoc::CreateTab(CWnd* parent)
{
  // Create the pane window
  Create(parent);

  // Create the tab control
  CRect zeroRect(0,0,0,0);
  m_tab.Create(WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE,zeroRect,this,0);
  m_tab.SendMessage(TCM_SETMINTABWIDTH,0,8);

  // Add tabs
  m_tab.InsertItem(DocTab_Home,"?H");
  m_tab.InsertItem(DocTab_Examples,"Examples");
  m_tab.InsertItem(DocTab_Index,"General Index");

  // Create the HTML control window
  m_html = (ReportHtml*)(RUNTIME_CLASS(ReportHtml)->CreateObject());
  if (!m_html->Create(NULL,NULL,WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,1))
  {
    TRACE("Failed to create HTML control\n");
  }
}