Klasa CCmdUIThe CCmdUI Class
Gdy kieruje polecenie Update do programu obsługi, struktura przekazuje programowi obsługi wskaźnik do CCmdUI
obiektu (lub do obiektu CCmdUI
klasy pochodnej).When it routes an update command to its handler, the framework passes the handler a pointer to a CCmdUI
object (or to an object of a CCmdUI
-derived class). Ten obiekt reprezentuje element menu lub przycisk paska narzędzi lub inny obiekt interfejsu użytkownika, który wygenerował polecenie.This object represents the menu item or toolbar button or other user-interface object that generated the command. Procedura obsługi aktualizacji wywołuje funkcje składowe CCmdUI
struktury za pomocą wskaźnika, aby zaktualizować obiekt interfejsu użytkownika.The update handler calls member functions of the CCmdUI
structure through the pointer to update the user-interface object. Na przykład poniżej przedstawiono procedurę obsługi aktualizacji dla elementu menu Wyczyść wszystko:For example, here is an update handler for the Clear All menu item:
void CMyWinApp::OnUpdateEditClearAll(CCmdUI *pCmdUI)
{
pCmdUI->Enable(m_bClearAllAvailable);
}
Ta procedura obsługi wywołuje Enable
funkcję elementu członkowskiego obiektu z dostępem do elementu menu.This handler calls the Enable
member function of an object with access to the menu item. Enable
sprawia, że element jest dostępny do użycia.Enable
makes the item available for use.
Zobacz teżSee also
Instrukcje: Aktualizowanie obiektów User-InterfaceHow to: Update User-Interface Objects