sort properties alphabetically in variable preview not working

조회 수: 4 (최근 30일)
Blazej Dobija
Blazej Dobija 2021년 2월 16일
댓글: Christopher Deng 2023년 6월 29일
Hello
As I preview for example ListBox handle and I try to sort properties by name then displayed order is bizarre. Or do I do something wrong or misunderstand something?
  댓글 수: 3
Matt J
Matt J 2023년 4월 21일
편집: Matt J 2023년 4월 21일
It is not random. For example, the Items, ItemsData, Value, and ValueChangedFcn properties are related to one another. Users will often want to view them grouped together, even though they are far apart alphabetically.
Christopher Deng
Christopher Deng 2023년 6월 29일
Well, nearly none of the users I know want this kind of list. Why cant we have an alphabetically sorted property names?

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt J
Matt J 2023년 4월 21일
편집: Matt J 2023년 4월 21일
You cannot change the order in which properties are displayed in the variable editor (other than to reverse it). If you want an alphabetized list of the properties, however, you can generate one at the command line.
>> string(sort(properties(lb)))
ans =
29×1 string array
"BackgroundColor"
"BeingDeleted"
"BusyAction"
"ContextMenu"
"CreateFcn"
"DeleteFcn"
"Enable"
"FontAngle"
"FontColor"
"FontName"
"FontSize"
"FontWeight"
"HandleVisibility"
"InnerPosition"
"Interruptible"
"Items"
"ItemsData"
"Layout"
"Multiselect"
"OuterPosition"
"Parent"
"Position"
"Tag"
"Tooltip"
"Type"
"UserData"
"Value"
"ValueChangedFcn"
"Visible"
  댓글 수: 2
Jordan B
Jordan B 2023년 4월 21일
It's a little rediculous that you have to do this. They should just make the sort button actually work properly.
Matt J
Matt J 2023년 4월 21일
편집: Matt J 2023년 4월 21일
It cannot work the way you might be used to from Windows Explorer because the sort button in Windows Explorer only has 2 states: forward and reverse alphabetical order. There are users, however, who sometimes want the order you currently see, the order in which the properties are defined in the ListBox class definition, which is a 3rd and 4th state altogether.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by