Beispiel #1
0
LRESULT CTabWndHost::WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
	// Decode message.
	switch(iMsg)
	{
		// Key pressed.
		case WM_SIZE:
			{
				// Get the display area.
				CRect rcDisplay = DisplayRect();

				int nCurTab = CurSel();

				// Resize the currently displayed window.
				if (nCurTab != -1)
					TabWnd(nCurTab).Move(rcDisplay);
			}
			break;

		// Call the default handler.
		default:
			break;
	}

	// Call the base class' handler.
	return CStdWnd::WndProc(hWnd, iMsg, wParam, lParam);
}
Beispiel #2
0
void CTabWndHost::OnSelChanging()
{
	int nCurTab = CurSel();
	if (nCurTab == -1)
		return;

	// Hide current window.
	TabWnd(nCurTab).WindowPos(HWND_BOTTOM, false);
}
Beispiel #3
0
void CListBox::RestoreSel(size_t nItem) const
{
	size_t nCount = Count();

	// Handle no selection, or invalid selection.
	nItem = (nItem == Core::npos) ? 0 : nItem;
	nItem = (nItem >= nCount) ? (nCount-1) : nItem;

	CurSel(nItem);
}
Beispiel #4
0
void CTabWndHost::OnSelChange()
{
	int nCurTab = CurSel();
	if (nCurTab == -1)
		return;

	CWnd& oWnd = TabWnd(nCurTab);

	// Resize and bring the window to the front.
	oWnd.WindowPos(HWND_TOP, DisplayRect(), true);
	oWnd.Focus();
}
void
TZCBrowserCombo::DidResolve (TZCPublication *p)
{
  if (m_pResolvedZC)
    m_pResolvedZC->Unref ();
  m_pResolvedZC = p;

  if (p)
    {
      p->AddRef ();
      Clear ();
      CurSel (AddString (p->szName));
    }
  SendMessage (m_hMsgWnd, WM_ZCRESOLVED, 0, 0);
}
/*
 *  Called when the combo closes
 *  If the user selected another ZC dsn, use that now
 */
void
TZCBrowserCombo::OnCbnCloseUp (void)
{
  TZCPublication *p;
  int iIndex;

  if ((iIndex = CurSel ()) != CB_ERR)
    {
      if ((p = (TZCPublication *) Data (iIndex)) != NULL)
	{
	  p->AddRef ();
	  DidResolve (p);
	  p->Unref ();
	}
    }
}