このビューが表示されるか(true)表示されないか(false)を示す Boolean 値を設定したり、戻したりします。
注:最小化された、または折りたたまれたビューは、Visible であると見なされます。
// get accessor Boolean rtn = View.Visible; // set accessor View.Visible = Boolean; |
/*
This example shows how you can set up a toggle button for
a view by creating a runtime property page with a button
with logic attached that negates whatever the value the
View.Visible property is currently set to.
*/
NewScene("", false);
var oPSet = ActiveSceneRoot.AddProperty("CustomProperty", false, "ViewToggleExample");
// Define layout
var oLayout = oPSet.PPGLayout;
oLayout.AddButton("Toggle");
// Connect the logic
oLayout.Logic = Toggle_OnClicked.toString();
oLayout.Language = "JScript";
// Show the property page and immediately delete it
InspectObj(oPSet, null, "Toggle View Demo", siModal, false);
DeleteObj(oPSet);
// ------------------------------------------------------
// Handler function
function Toggle_OnClicked()
{
var oLayout = Desktop.ActiveLayout;
oLayout.Views(0).Visible = !oLayout.Views(0).Visible;
} |