1
1
Fork 0
mirror of https://github.com/FellippeHeitor/InForm.git synced 2025-01-15 11:59:34 +00:00

Reassigns the key to select multiple controls from Shift to Ctrl. Also:

Allows desselecting a control while Ctrl is held.
This commit is contained in:
FellippeHeitor 2018-05-20 23:21:27 -03:00
parent 491aaf2b8b
commit 30f5148142
2 changed files with 14 additions and 2 deletions

View file

@ -1733,11 +1733,23 @@ SUB __UI_EventDispatcher
END IF
END IF
IF _KEYDOWN(100304) OR _KEYDOWN(100303) THEN
IF _KEYDOWN(100305) OR _KEYDOWN(100306) THEN
IF Control(__UI_HoveringID).Type <> __UI_Type_Frame AND Control(__UI_HoveringID).Type <> __UI_Type_Form AND Control(__UI_HoveringID).Type <> __UI_Type_Font AND Control(__UI_HoveringID).Type <> __UI_Type_MenuItem AND Control(__UI_HoveringID).Type <> __UI_Type_MenuPanel AND Control(__UI_HoveringID).Type <> __UI_Type_ContextMenu AND Control(__UI_HoveringID).Type <> __UI_Type_MenuBar THEN
IF Control(__UI_HoveringID).ControlIsSelected = False AND Control(__UI_HoveringID).ParentID = Control(__UI_FirstSelectedID).ParentID AND Control(__UI_FirstSelectedID).Type <> __UI_Type_Frame THEN
Control(__UI_HoveringID).ControlIsSelected = True
__UI_TotalSelectedControls = __UI_TotalSelectedControls + 1
ELSEIF Control(__UI_HoveringID).ControlIsSelected = True THEN
Control(__UI_HoveringID).ControlIsSelected = False
__UI_TotalSelectedControls = __UI_TotalSelectedControls - 1
IF __UI_TotalSelectedControls = 1 THEN
FOR i = 1 TO UBOUND(Control)
IF Control(i).ControlIsSelected THEN __UI_FirstSelectedID = i: EXIT FOR
NEXT
ELSEIF __UI_TotalSelectedControls > 0 AND __UI_FirstSelectedID = __UI_HoveringID THEN
FOR i = 1 TO UBOUND(Control)
IF Control(i).ControlIsSelected THEN __UI_FirstSelectedID = i: EXIT FOR
NEXT
END IF
END IF
END IF
ELSE

View file

@ -154,7 +154,7 @@ SUB __UI_BeforeUpdateDisplay
IF __UI_ActiveMenu > 0 AND LEFT$(Control(__UI_ParentMenu).Name, 5) <> "__UI_" THEN b$ = MKI$(-1) ELSE b$ = MKI$(0)
SendData b$, OffsetMenuPanelIsON
IF __UI_SelectionRectangle THEN b$ = MKI$(-1) ELSE b$ = MKI$(0)
IF __UI_SelectionRectangle OR __UI_CtrlIsDown THEN b$ = MKI$(-1) ELSE b$ = MKI$(0)
SendData b$, OffsetSelectionRectangle
UiEditorFile = FREEFILE