Showing posts with label context menu. Show all posts
Showing posts with label context menu. Show all posts

2021/10/08

Windows 11에서 이전버전의 Context Menu 사용하기

 Windows 11을 사용하면서 가장 불편한 점이 개편된 Context Menu였다.

Windows 11의 개편된 Context Menu

새로운 Context Menu는 몇 개의 대표 메뉴로 구성되었고 이전의 Context Menu를 보려면 "Show more options" 메뉴를 선택해야만 하였다.

Context Menu 에 등록된 압축관련 메뉴와 폴더 생성 메뉴를 자주 사용하기에 개편된 Context Menu는 상당히 불편하였다.

Windows 11 22000 버전 이전에는 옵션메뉴를 통해 이전 Context Menu로 변경할 수 있었으나 22000 버전 이후로는 이마저도 막혀버렸다.

그러던 중 레이스트리를 편집하여 이전 버전의 Context Menu를 활성화 하는 방법을 찾았다.

 

레지스트리 편집기를 열어 HKEY_CURRENT_USER\Software\Classes\CLSID 에 {86ca1aa0-34aa-4e8b-a509-50c905bae2a2} 를 추가하고 추가한 {86ca1aa0-34aa-4e8b-a509-50c905bae2a2} 키에 서브키 InprocServer32 를 추가한 후 (Default) 값을 공란으로 설정한다.

Windows 10 버전의 Context 메뉴를 사용하기위한 레지스트리 내용

레지스트리 편집을 마치고 재부팅을하면 이전 Windows 10 버전의 Context Menu를 볼 수 있다.

Windows 11에서 이전 Context Menu 를 활성화한 화면


2021/07/07

[Windows 11] 파일 탐색기의 팝업메뉴(Context Menu)을 Windows 10 형태로 변경하기

※ 22000.71 버전 이후로 적용이 되지 않는다. ☹️


Windows 11의 큰 변화중의 하나는 파일 탐색기의 리본바와 팝업메뉴의 간소화이다.

메인 메뉴의 사용이 많지 않는 나는 간소화에 큰 영향이 없는데 팝업 메뉴의 경우 간소화로 많은 불편함을 가져왔다.


탐색기 작업에 많은 부분을 팝업 메뉴로 처리를 했는데 기존의 메뉴를 부르기에는 매우 불편하게 변경이 되었다. 나와 유사한 생각을 하는 사람이 많아서인지 이전 형태의 팝업 메뉴로 전환하는 방법을 찾는 사람이 많은 것 같다.


이전 형태로 되돌리는 방법은 간단하였다. 폴더 옵션에서 "Launch folder windows in a separate process" 옵션을 선택해 주기만 하면된다.


이전 버전에도 있는 옵션인데 어찌 이번 버전에서는 탐색기의 외형까지 영향을 주는지는 모르겠으나 이 옵션을 설정하면 이전 형태의 탐색기를 사용할 수 있다.




2013/07/16

윈도우의 Context Menu를 확장해 주는 FileMenu Tools



윈도우의 Context Menu에 추가되어 다양한 기능을 지원하는 프로그램 이다.



특정 확장자를 특정 프로그램에 연결을 하거나 복사/이동 파일 이름 복사와 속성 변경 파일 영구삭제(복구방지) 기능 등을 기본적으로 지원한다.


필요에 따라 사용자가 메뉴를 추가하는 기능도 지원한다.



FileMenu Tool

Original Post :
http://neodreamer-dev.tistory.com/717

2010/04/06

[Android Dev.] Context Menu 구성하기

안드로이드는 View 를 Long-Touch 할 경우 Context Menu 를 보여지게 할 수 있다. Context Menu 는 크게 두 부분으로 나뉘는데 메뉴의 타이틀을 나타내는 헤더 부분과 사용자가 선택할 수 있는 메뉴 부분으로 나뉜다.



메뉴 위쪽의 헤더 부분은 생략할 수 있고 필요에 따라 Custom View 로 대체할 수 있다. Context Menu 를 간단하게 분리해 보면 헤더의 유무와 헤더의 종류에 따라 분리할 수 있다. 아래는 각각의 경우에 따른 구현 내용이다.



공통으로 사용되는 Botton 의 Context Menu 리소스

<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/MnuHi"
android:title="Hi!"
android:checkable="true"
android:checked="false"
/>
<item
android:id="@+id/MnuBye"
android:title="Bye!"
android:checkable="true"
android:checked="false"
/>
</menu>






메뉴 Header가 없는 Context Menu




메뉴 리소스로 부터 메뉴를 읽어들이기만 하면 위와 같은 심플한 Context Menu 가 출력이 된다.

    public void onCreateContextMenu( ContextMenu menu, View v, 
ContextMenu.ContextMenuInfo menuinfo )
{
if ( v == btnHello )
{
// menu_button.xml 에서 메뉴 불러오기
MenuInflater inflater = getMenuInflater();
inflater.inflate( R.menu.menu_button, menu );
}
}






시스템에서 지원하는 Header를 갖은 Context Menu


Context Menu 생성시 Context Menu 개체의 Header 에 setHeaderIcon 과 setHeaderTitle 함수를 이용하여 아이콘과 타이틀을 지정하면 위와 같이 시스템에서 지원하는 Header가 출력 된다.

    public void onCreateContextMenu( ContextMenu menu, View v, 
ContextMenu.ContextMenuInfo menuinfo )
{
if ( v == btnHello )
{
// menu_button.xml 에서 메뉴 불러오기
MenuInflater inflater = getMenuInflater();
inflater.inflate( R.menu.menu_button, menu );

menu.setHeaderIcon( R.drawable.icon );
menu.setHeaderTitle( "Context for Button" );
}
}






Custom View 를 Header로 갖는 Context Menu


메뉴 헤더 부분에 원하는 View를 올릴 수 있는데 이는 Context Menu 개체의 setHeaderView( View v ) 함수를 이용하면 된다. 뷰를 올리게 되면 setHeaderIcon 과 setHeaderTitle 함수가 지정되더라도 이를 무시하고 사용자가 지정한 View 를 메뉴의 헤더로 대체한다.



헤더에 사용된 View Layout 리소스 xml 파일 내용 (context_view_for_button.xml)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/IVContextL"
android:src="@drawable/icon"
android:layout_gravity="top|left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/TVContext"
android:layout_gravity="center_vertical|center_horizontal"
android:text="It's Custom Header on Context"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ImageView
android:id="@+id/IVContextR"
android:src="@drawable/icon"
android:layout_gravity="top|right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>



메뉴 헤더에 View 를 올리는 코드

    public void onCreateContextMenu( ContextMenu menu, View v, 
ContextMenu.ContextMenuInfo menuinfo )
{
if ( v == btnHello )
{
// menu_button.xml 에서 메뉴 불러오기
MenuInflater inflater = getMenuInflater();
inflater.inflate( R.menu.menu_button, menu );

menu.setHeaderIcon( R.drawable.icon ); // 무시됨
menu.setHeaderTitle( "Context for Button" ); // 무시됨

LayoutInflater layout = getLayoutInflater();
View v2 = layout.inflate( R.layout.context_view_for_button, null );
menu.setHeaderView( v2 );
}
}



<

Original Post : http://neodreamer-dev.tistory.com/402

2010/04/05

[Study Note] Context Menu 사용하기~~

Context Menu 는 View에서 사용자가 길게 터치(Long-Touch)할 경우 보여지는 메뉴이다.



Context Menu 를 사용하기 위해서는 View 를 registerForContextMenu 함수를 이용하여 Context Menu 를 호출 할 수 있도록 등록하여 주어야 한다.




registerForContextMenu( View v );





View 를 registerForContextMenu 를 이용하여 등록하면 해당 View 에서 사용자가 Long-Touch 를 하게되면 onCreateContextMenu 함수가 호출이 된다. 이때 넘겨 받은 View 개체에 따라서 적절한 Menu를 만들어 주면 만들어진 Menu가 보여지게 된다. Context Menu 는 서브 메뉴와 Checkable Menu 를 지원한다.





public void onCreateContextMenu( ContextMenu  menu,



View  v, ContextMenu.ContextMenuInfo  menuInfo )


매개변수



ContextMenu menu : 보여지게 될 menu 개체

View v : Context Menu 를 소유한 View 개체

ContextMenu.ContextMenuInfo menuInfo : menu에 대한추가 적인 정보로 내용은 view 에따라 달라짐.





보여지는 Context Menu 를 선택하게 되면 onContextItemSelected 함수가 호출이 되고 이때 선택된 메뉴가 넘어 매개변수(MenuItem)로 오는데 받은 메뉴에 대한 적절한 처리를 해 주면 된다.





public boolean onContextItemSelected( MenuItem  item )

매개변수



MenuItem item : 선택된 Context Menu



반환 값



선택 된 Menu item에 대한 처리 여부





리소스 파일 보기



소스 파일 보기



Context Menu for TextView 1

TextView 의 Context Menu

Context Menu for TextView 2

Context Menu의 Sub Menu





Context Menu for ImageView 1

ImageView 의 Context Menu

Context Menu for ImageView 2

Context Menu의 SubMenu





Context Menu for Button 1

Button의 Context Menu 1

Context Menu for Button 2

Button의 Context Menu 2



<

Original Post : http://neodreamer-dev.tistory.com/401