Skip to content

Commit 0c642cb

Browse files
committed
github:#11777 fix issues #13442 and #13445
1 parent 0342721 commit 0c642cb

File tree

3 files changed

+62
-65
lines changed

3 files changed

+62
-65
lines changed

Project/Sources/Forms/Editor/form.4DForm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1216,5 +1216,5 @@
12161216
"version": "1",
12171217
"kind": "form"
12181218
},
1219-
"geometryStamp": 76
1219+
"geometryStamp": 78
12201220
}

Project/Sources/Methods/Editor_FORMULA_Stop.4dm

+29-32
Original file line numberDiff line numberDiff line change
@@ -188,59 +188,56 @@ Else
188188

189189
$Txt_strokeColor:=Color_from_long(Editor_Get_color("font-color"))
190190

191-
$Txt_value:=Localized string:C991("Labels_sampleformula")
191+
//$Txt_value:=Localized string("Labels_sampleformula")
192192

193193
$Dom_buffer:=DOM Find XML element by ID:C1010($Dom_label; "objects")
194194

195+
$Dom_buffer:=DOM Create XML element:C865($Dom_buffer; "object"; \
196+
"type"; "variable"; \
197+
"left"; $Lon_left; \
198+
"top"; $Lon_top; \
199+
"right"; $Lon_right; \
200+
"bottom"; $Lon_bottom; \
201+
"field-type"; 0; \
202+
"font-name"; OB Get:C1224($Obj_parameters; "default-font"; Is text:K8:3); \
203+
"font-color"; $Txt_strokeColor; \
204+
"font-size"; 9; \
205+
"preserve-aspect-ratio"; "false"; \
206+
"stroke-color"; $Txt_strokeColor; \
207+
"stroke-width"; Editor_Get_default_stroke_width; \
208+
"stroke-opacity"; 1; \
209+
"fill-color"; Color_from_long(Editor_Get_color("fill")); \
210+
"fill-opacity"; 1; \
211+
"direction"; "down"; \
212+
"value"; $Txt_value; \
213+
"style"; "plain"; \
214+
"alignment"; "left"; \
215+
"id"; $Txt_ID)
195216

196217

197218
var $save_ok : Integer
198-
var $do_delete : Boolean
219+
var $do_cancel : Boolean
199220

200221
$save_ok:=OK
201222

202223
EDIT FORMULA:C806(Table:C252(C_MASTER_TABLE)->; $Txt_value)
203224

204-
$do_delete:=OK=0
205-
If ($do_delete)
225+
$do_cancel:=OK=0
226+
If ($do_cancel)
206227
Else
207-
208-
209-
210-
$Dom_buffer:=DOM Create XML element:C865($Dom_buffer; "object"; \
211-
"type"; "variable"; \
212-
"left"; $Lon_left; \
213-
"top"; $Lon_top; \
214-
"right"; $Lon_right; \
215-
"bottom"; $Lon_bottom; \
216-
"field-type"; 0; \
217-
"font-name"; OB Get:C1224($Obj_parameters; "default-font"; Is text:K8:3); \
218-
"font-color"; $Txt_strokeColor; \
219-
"font-size"; 9; \
220-
"preserve-aspect-ratio"; "false"; \
221-
"stroke-color"; $Txt_strokeColor; \
222-
"stroke-width"; Editor_Get_default_stroke_width; \
223-
"stroke-opacity"; 1; \
224-
"fill-color"; Color_from_long(Editor_Get_color("fill")); \
225-
"fill-opacity"; 1; \
226-
"direction"; "down"; \
227-
"value"; $Txt_value; \
228-
"style"; "plain"; \
229-
"alignment"; "left"; \
230-
"id"; $Txt_ID)
231-
228+
DOM SET XML ATTRIBUTE:C866($Dom_buffer; "value"; $Txt_value)
232229

233230
Editor_TEXT_EDIT_SET_VALUE($Dom_textArea; $Txt_value)
234231
End if
235232

236-
Editor_SET_TOOL
237-
Editor_SELECT_OBJECT($Dom_object; $Txt_ID)
238233

239-
If ($do_delete)
234+
Editor_SELECT_OBJECT($Dom_object; $Txt_ID)
235+
If ($do_cancel)
240236

241237
Editor_SELECT_DELETE
242238

243239
End if
240+
Editor_SET_TOOL
244241

245242
OK:=$save_ok
246243

Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
//%attributes = {"invisible":true}
2-
// ----------------------------------------------------
3-
// Project method : Editor_SEL_Get_font_size
4-
// Database: 4D Labels
5-
// ID[FE76B784355147EA9AE5478E5B7FA7E6]
6-
// Created #19-5-2015 by Vincent de Lachaux
7-
// ----------------------------------------------------
8-
// Description:
9-
//
10-
// ----------------------------------------------------
11-
// Declarations
2+
// ----------------------------------------------------
3+
// Project method : Editor_SEL_Get_font_size
4+
// Database: 4D Labels
5+
// ID[FE76B784355147EA9AE5478E5B7FA7E6]
6+
// Created #19-5-2015 by Vincent de Lachaux
7+
// ----------------------------------------------------
8+
// Description:
9+
//
10+
// ----------------------------------------------------
11+
// Declarations
1212
C_LONGINT:C283($0)
1313
C_TEXT:C284($1)
1414

1515
C_BOOLEAN:C305($Boo_text)
16-
C_LONGINT:C283($Lon_fontSize;$Lon_i;$Lon_parameters;$Lon_value)
17-
C_TEXT:C284($Dom_label;$Dom_object;$Txt_ID)
16+
C_LONGINT:C283($Lon_fontSize; $Lon_i; $Lon_parameters; $Lon_value)
17+
C_TEXT:C284($Dom_label; $Dom_object; $Txt_ID)
1818

19-
ARRAY TEXT:C222($tDom_selected;0)
19+
ARRAY TEXT:C222($tDom_selected; 0)
2020

2121
If (False:C215)
22-
C_LONGINT:C283(Editor_SEL_Get_font_size ;$0)
23-
C_TEXT:C284(Editor_SEL_Get_font_size ;$1)
22+
C_LONGINT:C283(Editor_SEL_Get_font_size; $0)
23+
C_TEXT:C284(Editor_SEL_Get_font_size; $1)
2424
End if
2525

26-
// ----------------------------------------------------
27-
// Initialisations
26+
// ----------------------------------------------------
27+
// Initialisations
2828
$Lon_parameters:=Count parameters:C259
2929

30-
If (Asserted:C1132($Lon_parameters>=0;"Missing parameter"))
30+
If (Asserted:C1132($Lon_parameters>=0; "Missing parameter"))
3131

32-
//NO PARAMETERS REQUIRED
32+
//NO PARAMETERS REQUIRED
3333

34-
//Optional parameters
34+
//Optional parameters
3535
If ($Lon_parameters>=1)
3636

3737
$Dom_label:=$1
3838

3939
Else
4040

41-
Editor_Get_grips (->$Dom_label)
41+
Editor_Get_grips(->$Dom_label)
4242

4343
End if
4444

@@ -50,20 +50,20 @@ Else
5050

5151
End if
5252

53-
// ----------------------------------------------------
54-
For ($Lon_i;1;Editor_SEL_Get_count ($Dom_label;->$tDom_selected))
53+
// ----------------------------------------------------
54+
For ($Lon_i; 1; Editor_SEL_Get_count($Dom_label; ->$tDom_selected))
5555

56-
DOM GET XML ATTRIBUTE BY NAME:C728($tDom_selected{$Lon_i};"object-id";$Txt_ID)
56+
DOM GET XML ATTRIBUTE BY NAME:C728($tDom_selected{$Lon_i}; "object-id"; $Txt_ID)
5757

58-
$Dom_object:=Editor_OB_Get_type ($Dom_label;$Txt_ID;->$Boo_text)
58+
$Dom_object:=Editor_OB_Get_type($Dom_label; $Txt_ID; ->$Boo_text)
5959

6060
If ($Boo_text)
6161

62-
DOM GET XML ATTRIBUTE BY NAME:C728($Dom_object;"font-size";$Lon_value)
62+
DOM GET XML ATTRIBUTE BY NAME:C728($Dom_object; "font-size"; $Lon_value)
6363

6464
If ($Lon_fontSize=-1)
6565

66-
//first one
66+
//first one
6767
$Lon_fontSize:=$Lon_value
6868

6969
Else
@@ -78,9 +78,9 @@ For ($Lon_i;1;Editor_SEL_Get_count ($Dom_label;->$tDom_selected))
7878
End if
7979
End for
8080

81-
// ----------------------------------------------------
82-
// Return
83-
$0:=$Lon_fontSize
81+
// ----------------------------------------------------
82+
// Return
83+
return $Lon_fontSize
8484

85-
// ----------------------------------------------------
86-
// End
85+
// ----------------------------------------------------
86+
// End

0 commit comments

Comments
 (0)