Skip to content

Commit

Permalink
update UI for textboxes buttun (action stanrdard / menu)
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland-Lannuzel committed Jan 11, 2024
1 parent ef06d03 commit 5d49d6c
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 32 deletions.
4 changes: 2 additions & 2 deletions Project/Sources/Forms/IconTest/form.4DForm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"destination": "detailScreen",
"rightMargin": 19,
"bottomMargin": 20,
Expand Down Expand Up @@ -2349,7 +2349,7 @@
"version": "1",
"kind": "form"
},
"geometryStamp": 216,
"geometryStamp": 221,
"editor": {
"activeView": "View 1",
"defaultView": "View 1",
Expand Down
2 changes: 1 addition & 1 deletion Project/Sources/Forms/WP_Palette_Alignments/form.4DForm
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@
"icon": "/RESOURCES/Images/Sidebar/SectionBreak_24.png",
"iconFrames": 4,
"style": "toolbar",
"popupPlacement": "separated",
"popupPlacement": "linked",
"events": [
"onClick"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Case of
: (Form event code:C388=On Alternative Click:K2:36)
: (Form event code:C388=On Clicked:K2:4)
MENU_Display("TextBox")

End case
6 changes: 3 additions & 3 deletions Project/Sources/Forms/WP_Palette_Backgrounds/form.4DForm
Original file line number Diff line number Diff line change
Expand Up @@ -595,14 +595,14 @@
"width": 40,
"height": 40,
"events": [
"onAlternateClick"
"onClick"
],
"style": "toolbar",
"action": "insertTextBox",
"action": "",
"focusable": false,
"iconFrames": 4,
"tooltip": ":xliff:InsertTextBox",
"popupPlacement": "separated",
"popupPlacement": "linked",
"icon": "/RESOURCES/Images/TBcommon/Insert/InsertTextBox_32.png",
"method": "ObjectMethods/btn_insertTextArea.4dm"
},
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Case of
: (Form event code:C388=On Clicked:K2:4)

: (Form event code:C388=On Alternative Click:K2:36)
MENU_Display("TextBox")

End case
End case
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Case of
: (Form event code:C388=On Clicked:K2:4)

MENU_Display("TextBox")

End case
32 changes: 16 additions & 16 deletions Project/Sources/Forms/WP_Toolbar/form.4DForm
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@
},
"btn_insertPageBreak": {
"type": "button",
"top": 30,
"top": 35,
"left": 385,
"width": 40,
"height": 40,
Expand All @@ -1460,7 +1460,7 @@
},
"btn_insertSectionBreak": {
"type": "button",
"top": 30,
"top": 35,
"left": 465,
"width": 40,
"height": 40,
Expand Down Expand Up @@ -1779,7 +1779,7 @@
},
"btn_insertColumnBreak": {
"type": "button",
"top": 30,
"top": 35,
"left": 345,
"width": 40,
"height": 40,
Expand Down Expand Up @@ -1937,7 +1937,7 @@
},
"btn_insertContinuousSectionBreak": {
"type": "button",
"top": 30,
"top": 35,
"left": 425,
"width": 40,
"height": 40,
Expand Down Expand Up @@ -2016,7 +2016,7 @@
"width": 0,
"startPoint": "topLeft"
},
"btn_insertTextArea": {
"btn_insertTextArea1": {
"type": "button",
"text": "",
"top": 35,
Expand All @@ -2027,13 +2027,13 @@
"onAlternateClick"
],
"style": "toolbar",
"action": "insertTextBox",
"action": "",
"focusable": false,
"iconFrames": 4,
"tooltip": ":xliff:InsertTextBox",
"popupPlacement": "separated",
"popupPlacement": "none",
"icon": "/RESOURCES/Images/TBcommon/Insert/InsertTextBox_32.png",
"method": "ObjectMethods/btn_insertTextArea.4dm"
"method": "ObjectMethods/btn_insertTextArea1.4dm"
},
"cb_distinctFirstPage": {
"type": "checkbox",
Expand Down Expand Up @@ -2095,7 +2095,7 @@
"btn_insertTime3",
"btn_visibleEmptyImages",
"btn_displayAsSymbol",
"btn_insertTextArea",
"btn_insertTextArea1",
"cb_distinctFirstPage",
"cb_distinctLeftRightPage"
]
Expand Down Expand Up @@ -2931,24 +2931,24 @@
"width": 0,
"startPoint": "topLeft"
},
"btn_insertTextArea1": {
"btn_insertTextArea2": {
"type": "button",
"text": "",
"top": 30,
"left": 5,
"width": 60,
"height": 50,
"events": [
"onAlternateClick"
"onClick"
],
"style": "toolbar",
"action": "insertTextBox",
"action": "",
"focusable": false,
"icon": "/RESOURCES/Images/TBcommon/Insert/InsertTextBox_48.png",
"iconFrames": 4,
"tooltip": ":xliff:InsertTextBox",
"popupPlacement": "separated",
"method": "ObjectMethods/btn_insertTextArea1.4dm"
"popupPlacement": "linked",
"method": "ObjectMethods/btn_insertTextArea2.4dm"
},
"Line71": {
"type": "line",
Expand Down Expand Up @@ -3196,7 +3196,7 @@
}
},
"entryOrder": [
"btn_insertTextArea1",
"btn_insertTextArea2",
"btn_insertImage1",
"btn_imageBehind",
"btn_imageInline",
Expand Down Expand Up @@ -4595,5 +4595,5 @@
"View 9": {}
}
},
"geometryStamp": 7042
"geometryStamp": 7050
}
5 changes: 5 additions & 0 deletions Project/Sources/Methods/MENU_Display.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ Case of

: ($content="TextBox")

//APPEND MENU ITEM($menu; ak standard action title)
//SET MENU ITEM PROPERTY($menu; -1; Associated standard action name; "insertTextBox")

//APPEND MENU ITEM($menu; "-")

APPEND MENU ITEM:C411($menu; ak standard action title:K76:83)
SET MENU ITEM PROPERTY:C973($menu; -1; Associated standard action name:K28:8; "textBox/height")

Expand Down
21 changes: 21 additions & 0 deletions Project/Sources/Methods/UI_ManageTextAreaButtons.4dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//%attributes = {}
var $format; $action : Text
var $result : Object

ARRAY LONGINT:C221($_events; 0)
$result:=Get action info:C1442("textBox/remove"; ak main form:K76:69)

If ($result.enabled=True:C214)
APPEND TO ARRAY:C911($_events; On Clicked:K2:4)
$action:=""
$format:=";;;;;;;;;;1;;" // 1 activates the popup triangle

Else

$action:="insertTextBox"
$format:=";;;;;;;;;;0;;" //0 removes the popup triangle
End if

OBJECT SET ACTION:C1259(*; "btn_insertTextArea@"; $action)
OBJECT SET EVENTS:C1239(*; "btn_insertTextArea@"; $_events; Enable events disable others:K42:37) // maybe none if standard action
OBJECT SET FORMAT:C236(*; "btn_insertTextArea@"; $format)
4 changes: 3 additions & 1 deletion Project/Sources/Methods/UI_PaletteBackgrounds.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,6 @@ If (Count parameters:C259>0)
OBJECT SET VALUE:C1742($changeWhat; $size)

End if
// </ACI0104082>
// </ACI0104082>

UI_ManageTextAreaButtons
4 changes: 4 additions & 0 deletions Project/Sources/Methods/UI_Toolbar.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ If (Form:C1466#Null:C1517) //;"The variable associated to the toolbar should be
UI_PaletteFindAndReplace //ACI0103628 - see method too

Else

// general cases after
If ($page=1) || ($page=11) // both pages have enterable areas
$protected:=UI_isProtected(False:C215) // 2022 oct 13 (TEST) don't manage focus on page 1 because fontSize is focusable
Expand Down Expand Up @@ -104,6 +105,9 @@ If (Form:C1466#Null:C1517) //;"The variable associated to the toolbar should be

End case

UI_ManageTextAreaButtons // buttons btn_insertTextArea and btn_insertTextArea1 (page 2 and 5)


// TAB BUTTONS ARE ALWAYS ENABLED.
OBJECT SET ENABLED:C1123(*; "tab@"; True:C214)

Expand Down
5 changes: 5 additions & 0 deletions Project/Sources/Methods/WP_BorderMenu.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ $applyTo:=UI_GetApplyTo
If ($withMenu)

$menuRef:=Create menu:C408

//APPEND MENU ITEM($menuRef; Get localized string("bordersAll"))
////APPEND MENU ITEM($menuRef; ak standard action title)
//SET MENU ITEM PROPERTY($menuRef; -1; Associated standard action name; $applyTo+"/borderStyle"+$where+"?value=solid")

APPEND MENU ITEM:C411($menuRef; Get localized string:C991("bordersStyle"))
//APPEND MENU ITEM($menuRef; ak standard action title)
SET MENU ITEM PROPERTY:C973($menuRef; -1; Associated standard action name:K28:8; $applyTo+"/borderStyle"+$where)
Expand Down
2 changes: 1 addition & 1 deletion Project/Sources/catalog.4DCatalog
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE base SYSTEM "http://www.4d.com/dtd/2007/base.dtd" >
<base name="4D WritePro Interface" uuid="94CC57D4DD674D83A19AD1955D22A833" collation_locale="en">
<base name="4D WritePro Interface" uuid="94CC57D4DD674D83A19AD1955D22A833" collation_locale="fr">
<schema name="DEFAULT_SCHEMA"/>
<table name="Sample" uuid="FCDC2942AAC24F1C8E119520A0C6B44B" id="1">
<field name="ID" uuid="25E1AC17AE3D4D5FBED8BEFDB6E6B6DC" type="4" unique="true" autosequence="true" not_null="true" id="1"/>
Expand Down

0 comments on commit 5d49d6c

Please sign in to comment.