Border Box
Border Box using Window
Summary: Retrieves and displays window details, including title, class, hidden status, and properties, using a With Window Handler to interact with open windows.
Code:
//
windowList = Window();
windowTitleList = List();
windowClassList = List();
windowPropertyList = List();
For( i = 1, i <= N Items( windowList ),
i++,
windowTitleList[i] = Char( i ) ||
": " || (windowList[i] <<
Get Window Title);
windowClassList[i] = windowList[i]
<< Window Class Name;
windowPropertyList[i] = windowList[i]
<< Get Property List;
);
ShowWindowDetail =
Function( {},
{},
num = windowListBox <<
Get Selected Indices;
titleTxt <<
Set Text(
Word(
2,
windowTitleList[num],
": "
)
);
classTxt <<
Set Text( windowClassList[num] );
hiddenTxt <<
Set Text(
Char(
Not(
windowList[num] <<
Get Show Window
)
)
);
propertyListBox <<
Set Items( windowPropertyList[num] );
);
detailWindow =
New Window( "Window Details",
Border Box( Top( 10 ), Bottom( 10 ),
Left( 10 ), Right( 10 ),
V List Box(
Panel Box( "JMP Windows",
windowListBox =
List Box(
windowTitleList,
maxSelected( 1 )
),
Button Box(
"Show Details",
ShowWindowDetail()
),
Panel Box( "Details",
Lineup Box(
N Col( 2 ),
Text Box(
"Title: "
),
titleTxt =
Text Box( "" ),
Text Box(
"Class: "
),
classTxt =
Text Box( "" ),
Text Box(
"Hidden: "
),
hiddenTxt =
Text Box( "" ),
Text Box(
"Properties: "
),
propertyListBox
=
List Box(
{},
nlines( 7 )
)
)
)
)
)
)
);
Code Explanation:
- Retrieve all open windows.
- Initialize lists for window details.
- Loop through each window.
- Store window titles.
- Store window classes.
- Store window properties.
- Define function to show window details.
- Get selected window index.
- Update title text box.
- Update class text box.
- Update hidden status text box.
- Update properties list box.
- Create new window for details.
- Add list box for window selection.
- Add button to show details.
- Add panel for displaying details.