示例#1
0
bool CStatusBar::OnCreate(CREATESTRUCT *pCS)
{
	UNREFERENCED_PARAMETER(pCS);
	m_mdc.Create(0, 0);
	OnPrefChanged();
	return true;
}
示例#2
0
bool CReBar::OnCreate(CREATESTRUCT *pCS)
{
	if (!m_btnTools.Create<CToolBarButton>(m_hWnd, ID_TOOLS, &m_mdcToolsBtn, NULL, true, (HMENU)BUTTON_ID_TOOLS))
		ASSERTRETURN(false);

	if (!m_btnSeen.Create<CToolBarButton>(m_hWnd, ID_SEEN, &m_mdcSeenBtn, NULL, false, (HMENU)BUTTON_ID_SEENMAIN))
		ASSERTRETURN(false);

	if (!m_btnSort.Create<CToolBarButton>(m_hWnd, ID_SORT, &m_mdcSortBtn, NULL, true, (HMENU)BUTTON_ID_SORT))
		ASSERTRETURN(false);

	if (!m_btnView.Create<CToolBarButton>(m_hWnd, ID_VIEW, &m_mdcViewBtn, NULL, false, (HMENU)BUTTON_ID_VIEW))
		ASSERTRETURN(false);

	if (!m_eSearch.Create<RHintEdit>(m_hWnd, ES_AUTOHSCROLL, 0, NULL, 0, 0, 0, 0, ID_SEARCH))
		ASSERTRETURN(false);

	if (!m_categoryBar.Create<CCategoryBar>(m_hWnd))
		ASSERTRETURN(false);

	// Create tooltip windows for buttons

	HINSTANCE hInst = GetModuleHandle(NULL);
	CreateToolTip(m_hWnd, BUTTON_ID_TOOLS, hInst, GETSTR(IDS_TOOLTIP_TOOLS));
	CreateToolTip(m_hWnd, BUTTON_ID_SEENMAIN, hInst, GETSTR(IDS_TOOLTIP_SEENMAIN));
	CreateToolTip(m_hWnd, BUTTON_ID_SORT, hInst, GETSTR(IDS_TOOLTIP_SORT));
	CreateToolTip(m_hWnd, BUTTON_ID_VIEW, hInst, GETSTR(IDS_TOOLTIP_VIEW));

	m_mdc.Create(0, 0);
	OnPrefChanged();

	return true;
}
示例#3
0
bool CLogWnd::OnCreate(CREATESTRUCT *pCS)
{
	UNREFERENCED_PARAMETER(pCS);

	if (!m_edit.Create<REditFF>(m_hWnd, ES_MULTILINE|ES_READONLY|ES_AUTOHSCROLL|
			ES_AUTOVSCROLL/*|WS_VSCROLL*/))
		ASSERTRETURN(false);

	OnPrefChanged();
	return true;
}
NS_IMETHODIMP
sbWatchFolderPrefMgr::Observe(nsISupports *aSubject,
                              const char *aTopic,
                              const PRUnichar *aData)
{
  NS_ENSURE_ARG_POINTER(aTopic);

  nsresult rv;

  // Final UI startup:
  if (strcmp("final-ui-startup", aTopic) == 0) {
    nsCOMPtr<nsIObserverService> observerService =
      do_GetService("@mozilla.org/observer-service;1", &rv);
    NS_ENSURE_SUCCESS(rv, rv);

    rv = observerService->RemoveObserver(this, aTopic);
    NS_ENSURE_SUCCESS(rv, rv);

    // Now is the time to start listening to the pref branch.
    nsCOMPtr<nsIPrefBranch2> prefBranch =
      do_GetService("@mozilla.org/preferences-service;1", &rv);
    NS_ENSURE_SUCCESS(rv, rv);

    rv = prefBranch->AddObserver(PREF_WATCHFOLDER_ROOT, this, PR_FALSE);
    NS_ENSURE_SUCCESS(rv, rv);

    rv = mWatchFolderService->OnAppStartup();
    NS_ENSURE_SUCCESS(rv, rv);
  }
  // Library shutdown topic:
  else if (strcmp("quit-application-granted", aTopic) == 0) {
    nsCOMPtr<nsIObserverService> observerService =
      do_GetService("@mozilla.org/observer-service;1", &rv);
    NS_ENSURE_SUCCESS(rv, rv);

    rv = observerService->RemoveObserver(this, aTopic);
    NS_ENSURE_SUCCESS(rv, rv);

    rv = mWatchFolderService->OnAppShutdown();
    NS_ENSURE_SUCCESS(rv, rv);
  }
  // Pref changed topic:
  else if (strcmp(NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, aTopic) == 0) {
    nsCOMPtr<nsIPrefBranch2> prefBranch = do_QueryInterface(aSubject, &rv);
    NS_ENSURE_SUCCESS(rv, rv);

    rv = OnPrefChanged(nsDependentString(aData), prefBranch);
    NS_ENSURE_SUCCESS(rv, rv);
  }

  return NS_OK;
}
示例#5
0
bool CStatusBar::OnCreate(CREATESTRUCT *pCS)
{
	m_mdc.Create(0, 0);
	OnPrefChanged();
	return true;
}