메뉴 그룹

메뉴 그룹은 메뉴 또는 도구 모음 내에서 관련 명령 및 컨트롤을 구성합니다.

소개

MenuGroup 태그 요소를 통해 노출되는 메뉴 그룹 컨트롤은 컨텍스트 팝업 미니 도구 모음을 포함하여 메뉴 기반 컨트롤의 항목 또는 명령 그룹에 대한 논리적 컨테이너입니다.

연결된 명령 선언의 LabelTitle 특성 또는 Command.LabelTitle 속성을 통해 메뉴 그룹에 레이블을 지정할 수 있습니다. LabelTitle에 할당된 값은 범주 헤더로 렌더링됩니다.

다음 예제에서는 두 개의 메뉴 그룹 명령 선언을 포함 하는 분할 단추 컨트롤에 대 한 명령 태그를 보여 줍니다.

<!-- SplitButton -->
<Command Name="cmdSplitButtonGroup"
         Symbol="cmdSplitButtonGroup"
         Comment="SplitButton Group"
         LabelTitle="SplitButton"/>
<Command Name="cmdSplitButton"
         Symbol="cmdSplitButton"
         Comment="SplitButton"
         LabelTitle="SplitButton"/>
<Command Name="cmdSBButtonItem"
         Symbol="cmdSBButtonItem"
         Comment="SBButtonItem"
         LabelTitle="SB ButtonItem"/>
<Command Name="cmdSBButton1"
         Symbol="cmdSBButton1"
         Comment="SBButton1"
         LabelTitle="SB Button">
  <Command.LargeImages>
    <Image Source="res/copyL_32.bmp"/>
  </Command.LargeImages>
  <Command.SmallImages>
    <Image Source="res/copyS_16.bmp"/>
  </Command.SmallImages>
  <Command.LargeHighContrastImages>
    <Image Source="res/copyLHC_32.bmp"/>
  </Command.LargeHighContrastImages>
  <Command.SmallHighContrastImages>
    <Image Source="res/copySHC_16.bmp"/>
  </Command.SmallHighContrastImages>
</Command>
<Command Name="cmdSBMajorItems"
         Comment="Major Items Category"
         LabelTitle="Major Items"/>
<Command Name="cmdSBStandardItems"
         Comment="Standard Items Category"
         LabelTitle="Standard Items"/>

다음 예제에서는 세 개의 MenuGroup 요소 선언이 있는 SplitButton 요소에 필요한 태그를 보여 줍니다. 그 중 2개는 이전 예제의 메뉴 그룹 명령과 연결됩니다. MenuGroup 요소의 Class 특성은 메뉴 항목의 크기를 지정하는 데 사용됩니다.

<Group CommandName="cmdSplitButtonGroup">
  <SplitButton CommandName="cmdSplitButton">
    <SplitButton.ButtonItem>
      <Button CommandName="cmdSBButtonItem"/>
    </SplitButton.ButtonItem>
    <SplitButton.MenuGroups>
      <MenuGroup CommandName="cmdSBMajorItems" 
                 Class="MajorItems">
        <Button CommandName="cmdSBButton1"/>
        <Button CommandName="cmdSBButton1"/>
      </MenuGroup>
      <MenuGroup CommandName="cmdSBStandardItems"
                 Class="StandardItems">
        <Button CommandName="cmdSBButton1"/>
        <Button CommandName="cmdSBButton1"/>
      </MenuGroup>
      <MenuGroup Class="StandardItems">
        <Button CommandName="cmdSBButton1"/>
        <Button CommandName="cmdSBButton1"/>
      </MenuGroup>
    </SplitButton.MenuGroups>
  </SplitButton>
</Group>

다음 스크린샷에서는 이전 예제의 태그에서 생성된 메뉴(세 개의 메뉴 그룹 컨트롤 포함)를 보여 줍니다.

세 개의 메뉴 그룹 컨트롤이 있는 메뉴의 스크린샷

리본 프레임워크는 메뉴 그룹 컨트롤에 대한 속성 키 컬렉션을 정의합니다.

일반적으로 메뉴 그룹 속성은 IUIFramework::InvalidateUICommand 메서드 호출을 통해 컨트롤과 연결된 명령을 무효화하여 리본 UI에서 업데이트됩니다. 무효화 이벤트는 IUICommandHandler::UpdateProperty 콜백 메서드에 의해 처리되고 속성 업데이트가 정의됩니다.

IUICommandHandler::UpdateProperty 콜백 메서드는 실행되지 않으며 애플리케이션은 프레임워크에서 속성이 필요할 때까지 업데이트된 속성 값을 쿼리합니다. 예를 들어 탭이 활성화되고 리본 UI에 컨트롤이 표시되는 경우 또는 도구 설명이 표시되는 경우입니다.

참고

경우에 따라 IUIFramework::GetUICommandProperty 메서드를 통해 속성을 검색하고 IUIFramework::SetUICommandProperty 메서드를 사용하여 설정할 수 있습니다.

 

다음 표에서는 메뉴 그룹 컨트롤과 연결된 속성 키를 나열합니다.

속성 키 참고
UI_PKEY_Enabled IUIFramework::GetUICommandPropertyIUIFramework::SetUICommandProperty를 지원합니다.
UI_PKEY_Keytip 무효화를 통해서만 업데이트할 수 있습니다.
UI_PKEY_Label 무효화를 통해서만 업데이트할 수 있습니다.
UI_PKEY_TooltipDescription 무효화를 통해서만 업데이트할 수 있습니다.
UI_PKEY_TooltipTitle 무효화를 통해서만 업데이트할 수 있습니다.

 

Windows 리본 프레임워크 컨트롤 라이브러리

MenuGroup 태그 요소