Skip to content

Commit

Permalink
try to catch escape key when cell is in editing mode using set shortc…
Browse files Browse the repository at this point in the history
…ut in a button
  • Loading branch information
delahaye-4D committed Nov 21, 2024
1 parent 06a8e67 commit 0a2a12f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
8 changes: 6 additions & 2 deletions Project/Sources/Forms/%25report/method.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ Case of

If (Num:C11($form_event.column)>1)

CALL FORM:C1391(Current form window:C827; "do_enable_object"; "trap_escape"; True:C214)
//CALL FORM(Current form window; "do_enable_object"; "trap_escape"; True)

CALL FORM:C1391(Current form window:C827; "do_set_shortcut"; "trap_escape"; Shortcut with Escape:K75:20)


End if

Expand All @@ -92,8 +95,9 @@ Case of
If (Num:C11($form_event.column)>1)


CALL FORM:C1391(Current form window:C827; "do_enable_object"; "trap_escape"; False:C215)
//CALL FORM(Current form window; "do_enable_object"; "trap_escape"; False)

CALL FORM:C1391(Current form window:C827; "do_set_shortcut"; "trap_escape")

End if

Expand Down
9 changes: 4 additions & 5 deletions Project/Sources/Forms/NQR/form.4DForm
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@
"width": 150,
"height": 34,
"sizingY": "move",
"shortcutKey": "[Esc]",
"shortcutKey": "",
"shortcutAccel": false,
"text": "trap-escape",
"focusable": false,
Expand Down Expand Up @@ -793,12 +793,10 @@
},
"geometryStamp": 159,
"editor": {
"activeView": "Area",
"activeView": "Toolbar",
"defaultView": "Toolbar",
"views": {
"Toolbar": {
"visible": false
},
"Toolbar": {},
"fieldList": {
"visible": false,
"objects": [
Expand Down Expand Up @@ -852,6 +850,7 @@
]
},
"Area": {
"visible": false,
"objects": [
"myQR"
]
Expand Down
1 change: 1 addition & 0 deletions Project/Sources/Methods/do_enable_object.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
#DECLARE($name : Text; $enabled : Boolean)

//OBJECT SET VISIBLE(*; $name; $enabled)

OBJECT SET ENABLED:C1123(*; $name; $enabled)
8 changes: 8 additions & 0 deletions Project/Sources/Methods/do_set_shortcut.4dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//%attributes = {"invisible":true,"preemptive":"incapable"}
#DECLARE($name : Text; $shortcut : Text; $modifiers : Integer)


$shortcut:=Count parameters:C259>1 ? $shortcut : ""
$modifiers:=Count parameters:C259>2 ? $modifiers : 0

OBJECT SET SHORTCUT:C1185(*; $name; $shortcut; $modifiers)
4 changes: 2 additions & 2 deletions Project/Sources/settings.4DSettings
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?><preferences stamp="2855">
<?xml version="1.0" encoding="UTF-8"?><preferences stamp="2856">
<com.4d>
<general execute_host_database_event="true"/>
<compiler>
Expand All @@ -18,7 +18,7 @@
</web>
<interface>
<shortcuts>
<cancel_input_form alt="false" command="false" ctrl="false" key_code="0" shift="false"/>
<cancel_input_form alt="false" command="false" ctrl="false" key_code="13595" shift="false"/>
<accept_input_form alt="false" command="false" ctrl="false" key_code="0" shift="false"/>
<add_subform alt="false" command="false" ctrl="false" key_code="0" shift="false"/>
</shortcuts>
Expand Down

0 comments on commit 0a2a12f

Please sign in to comment.