MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / ControlSetVisible

Method ControlSetVisible

source/script_gui.cpp:1120–1147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1118
1119
1120void GuiType::ControlSetVisible(GuiControlType &aControl, bool aVisible)
1121{
1122 GuiControlType *tab_control;
1123 int selection_index;
1124
1125 // GUI_CONTROL_ATTRIB_EXPLICITLY_HIDDEN is maintained for use with tab controls. It allows controls
1126 // on inactive tabs to be marked for later showing. It also allows explicitly hidden controls to
1127 // stay hidden even when their tab/page becomes active. It is updated unconditionally for simplicity
1128 // and maintainability.
1129 if (aVisible)
1130 aControl.attrib &= ~GUI_CONTROL_ATTRIB_EXPLICITLY_HIDDEN;
1131 else
1132 aControl.attrib |= GUI_CONTROL_ATTRIB_EXPLICITLY_HIDDEN;
1133 if (tab_control = FindTabControl(aControl.tab_control_index)) // It belongs to a tab control that already exists.
1134 {
1135 if (!(GetWindowLong(tab_control->hwnd, GWL_STYLE) & WS_VISIBLE)) // But its tab control is hidden...
1136 return;
1137 selection_index = TabCtrl_GetCurSel(tab_control->hwnd);
1138 if (selection_index != aControl.tab_index && selection_index != -1)
1139 return; // v1.0.48.04: Concerning the line above, see comments in ControlSetEnabled.
1140 }
1141 // Since above didn't return, act upon the show/hide:
1142 ShowWindow(aControl.hwnd, aVisible ? SW_SHOWNOACTIVATE : SW_HIDE);
1143 if (aControl.type == GUI_CONTROL_TAB) // This control is a tab control.
1144 // Update the control so that its current tab's controls will all be shown or hidden (now
1145 // that the tab control itself has just been shown or hidden):
1146 ControlUpdateCurrentTab(aControl, false);
1147}
1148
1149
1150ResultType GuiType::ParseMoveParams(int aCoord[4], ResultToken &aResultToken, ExprTokenType *aParam[], int aParamCount)

Callers 1

InvokeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected