Skip to content

Commit 63f3f12

Browse files
committed
github:18138 - Squashed commit of the following:
commit 9615a6e Author: vdelachaux <vdl4@wanadoo.fr> Date: Wed Mar 18 18:17:59 2026 +0100 github:18138 - SearchPicker commit 1468a32 Author: vdelachaux <vdl4@wanadoo.fr> Date: Fri Mar 6 16:20:28 2026 +0100 github:18138 - wip on searchPicker
1 parent ee50733 commit 63f3f12

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+505
-666
lines changed

Project/Sources/Classes/_date.4dm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ Localized string:C991("Monthes_November"); \
3636
Localized string:C991("Monthes_December")\
3737
]
3838

39-
property inited:=False:C215
40-
4139
// === === === === === === === === === === === === === === === === === === === === === === === ===
4240
Class constructor()
4341

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
Class extends _widget
2+
3+
property toSearch:=""
4+
property page : Integer
5+
6+
// === === === === === === === === === === === === === === === === === === === === === === === ===
7+
Class constructor()
8+
9+
Super:C1705()
10+
11+
This:C1470.defaultValues()
12+
This:C1470.page:=1+Num:C11(Is Windows:C1573) // +1
13+
14+
If (Structure file:C489=Structure file:C489(*))\
15+
&& (Is macOS:C1572 && Shift down:C543)/* 🚧 FOR TESTING PURPOSES */
16+
17+
This:C1470.page+=1
18+
19+
End if
20+
21+
// === === === === === === === === === === === === === === === === === === === === === === === ===
22+
Function init()
23+
24+
Super:C1706.init()
25+
26+
var $container:=This:C1470.getContainerValue()
27+
28+
If ($container.type=Is text:K8:3)\
29+
| ($container.type=Is string var:K8:2)
30+
31+
Form:C1466.toSearch:=String:C10($container.value)
32+
This:C1470.update()
33+
34+
End if
35+
36+
// === === === === === === === === === === === === === === === === === === === === === === === ===
37+
Function defaultValues($force : Boolean)
38+
39+
If (Not:C34(This:C1470.inited) || $force)
40+
41+
var <>SearchPicker_SearchText:=""
42+
43+
var <>SearchPicker_PopupFunction : Text
44+
45+
var <>SearchPicker_Menu : Text
46+
47+
<>SearchPicker_PopupFunction:="Scope" //(or "Values")
48+
49+
RELEASE MENU:C978(<>SearchPicker_Menu)
50+
<>SearchPicker_Menu:=""
51+
52+
var <>SearchPicker_DummyText : Text
53+
var <>SearchPicker_Target : Pointer
54+
<>SearchPicker_Target:=-><>SearchPicker_DummyText
55+
56+
This:C1470.inited:=True:C214
57+
58+
End if
59+
60+
// === === === === === === === === === === === === === === === === === === === === === === === ===
61+
Function handleEvents($e : Object)
62+
63+
$e:=$e || FORM Event:C1606
64+
65+
// MARK:Form Method
66+
If ($e.objectName=Null:C1517)
67+
68+
Case of
69+
70+
//________________________________________________________________________________
71+
: ($e.code=On Load:K2:1)
72+
73+
FORM GOTO PAGE:C247(This:C1470.page; *)
74+
75+
This:C1470.init()
76+
77+
//________________________________________________________________________________
78+
: ($e.code=On Bound Variable Change:K2:52)
79+
80+
var $container:=This:C1470.getContainerValue()
81+
82+
If ($container.type=Is text:K8:3)\
83+
| ($container.type=Is string var:K8:2)
84+
85+
Form:C1466.toSearch:=String:C10($container.value)
86+
This:C1470.update()
87+
88+
End if
89+
90+
//________________________________________________________________________________
91+
: ($e.code=On Activate:K2:9)
92+
93+
This:C1470.manageFocus($e)
94+
95+
//________________________________________________________________________________
96+
End case
97+
98+
return
99+
100+
End if
101+
102+
// MARK: Widget Methods
103+
Case of
104+
105+
// ______________________________________________________
106+
: ($e.code=On Activate:K2:9)\
107+
|| ($e.code=On Deactivate:K2:10)
108+
109+
This:C1470.manageFocus($e)
110+
111+
// ______________________________________________________
112+
: ($e.objectName="search@")
113+
114+
Case of
115+
116+
//________________________________________________________________________________
117+
: ($e.code=On After Edit:K2:43)
118+
119+
This:C1470.setContainerValue(Get edited text:C655; [Is text:K8:3; Is string var:K8:2])
120+
This:C1470.update()
121+
122+
//________________________________________________________________________________
123+
: ($e.code=On Getting Focus:K2:7)
124+
125+
If (This:C1470.enterable)
126+
127+
OBJECT SET RGB COLORS:C628(*; "BgndRing@"; FORM Get color scheme:C1761="dark" ? "silver" : "grey"; Background color:K23:2)
128+
129+
Else
130+
131+
OBJECT SET RGB COLORS:C628(*; "BgndRing@"; FORM Get color scheme:C1761="dark" ? "grey" : "silver"; Background color:K23:2)
132+
133+
End if
134+
135+
//________________________________________________________________________________
136+
: ($e.code=On Losing Focus:K2:8)
137+
138+
OBJECT SET RGB COLORS:C628(*; "BgndRing@"; FORM Get color scheme:C1761="dark" ? "grey" : "silver"; Background color:K23:2)
139+
140+
//________________________________________________________________________________
141+
End case
142+
143+
// ______________________________________________________
144+
: ($e.objectName="close@")
145+
146+
Form:C1466.toSearch:=""
147+
This:C1470.setContainerValue(""; [Is text:K8:3; Is string var:K8:2])
148+
This:C1470.update()
149+
150+
// ______________________________________________________
151+
End case
152+
153+
// === === === === === === === === === === === === === === === === === === === === === === === ===
154+
Function update()
155+
156+
var $container:=This:C1470.getContainerValue()
157+
158+
If ($container.type=Is text:K8:3)\
159+
| ($container.type=Is string var:K8:2)
160+
161+
This:C1470.setContainerValue(String:C10($container.value); [Is text:K8:3; Is string var:K8:2])
162+
163+
End if
164+
165+
If (This:C1470.page=1)
166+
167+
OBJECT SET VISIBLE:C603(*; "CloseButton_Mac"; Length:C16($container.value)>0)
168+
169+
Else
170+
171+
If (Length:C16($container.value)>0)
172+
173+
OBJECT SET FORMAT:C236(*; "CloseButton_Win"; ";file:Images/SearchBox/win_close.svg")
174+
175+
Else
176+
177+
OBJECT SET FORMAT:C236(*; "CloseButton_Win"; ";file:Images/SearchBox/win_glass.svg")
178+
179+
End if
180+
End if
181+
182+
// === === === === === === === === === === === === === === === === === === === === === === === ===
183+
Function manageFocus($e : Object)
184+
185+
$e:=$e || FORM Event:C1606
186+
187+
If (This:C1470.enterable)
188+
189+
If (This:C1470.page=1)
190+
191+
GOTO OBJECT:C206(*; "SearchText_Mac")
192+
193+
Else
194+
195+
GOTO OBJECT:C206(*; "SearchText_Win")
196+
197+
End if
198+
199+
Else
200+
201+
GOTO OBJECT:C206(*; "")
202+
203+
End if
204+
205+
// <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <==
206+
Function set placeholder($value : Text)
207+
208+
OBJECT SET PLACEHOLDER:C1295(*; This:C1470.page=1 ? "SearchText_Mac" : "SearchText_Win"; $value)
209+
210+
// <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <==
211+
Function get enterable() : Boolean
212+
213+
return OBJECT Get enterable:C1067(*; This:C1470.page=1 ? "SearchText_Mac" : "SearchText_Win")
214+
215+
// <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <==
216+
Function set enterable($value : Boolean)
217+
218+
//This._enterable:=$value
219+
220+
If (This:C1470.page=1)
221+
222+
OBJECT SET ENTERABLE:C238(*; "SearchText_Mac"; $value)
223+
224+
Else
225+
226+
OBJECT SET ENTERABLE:C238(*; "SearchText_Win"; $value)
227+
228+
End if
229+
230+
This:C1470.manageFocus()
231+
232+
This:C1470.update()
233+

Project/Sources/Classes/_time.4dm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ property meridien; separator : Text
99

1010
property time : Time
1111

12-
property inited:=False:C215
13-
1412
// === === === === === === === === === === === === === === === === === === === === === === === ===
1513
Class constructor()
1614

Project/Sources/Classes/_widget.4dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
property currentForm : Text
22
property type : Text
33

4+
property inited:=False:C215
5+
46
// === === === === === === === === === === === === === === === === === === === === === === === ===
57
Class constructor()
68

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SearchPicker SET ENTERABLE("Subform"; True:C214)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SearchPicker SET ENTERABLE("Subform"; False:C215)
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"$4d": {
3+
"version": "1",
4+
"kind": "form"
5+
},
6+
"windowSizingX": "variable",
7+
"windowSizingY": "variable",
8+
"windowMinWidth": 0,
9+
"windowMinHeight": 0,
10+
"windowMaxWidth": 32767,
11+
"windowMaxHeight": 32767,
12+
"rightMargin": 20,
13+
"bottomMargin": 20,
14+
"events": [
15+
"onLoad"
16+
],
17+
"destination": "detailScreen",
18+
"pages": [
19+
{
20+
"objects": {}
21+
},
22+
{
23+
"objects": {
24+
"Subform": {
25+
"type": "subform",
26+
"left": 132,
27+
"top": 18,
28+
"width": 231,
29+
"height": 31,
30+
"detailForm": "SearchPicker",
31+
"dataSourceTypeHint": "text"
32+
},
33+
"Input": {
34+
"type": "input",
35+
"left": 132,
36+
"top": 51,
37+
"width": 198,
38+
"height": 17,
39+
"dataSource": "OBJECT Get value:C1743(\"Subform\")",
40+
"enterable": false,
41+
"focusable": false,
42+
"contextMenu": "none",
43+
"borderStyle": "none",
44+
"stroke": "#1e90ff"
45+
},
46+
"Input1": {
47+
"type": "input",
48+
"left": 9,
49+
"top": 18,
50+
"width": 80,
51+
"height": 17
52+
},
53+
"enable": {
54+
"type": "button",
55+
"text": "Enable",
56+
"top": 109,
57+
"left": 107,
58+
"width": 83,
59+
"height": 23,
60+
"events": [
61+
"onClick"
62+
],
63+
"method": "ObjectMethods/enable.4dm",
64+
"focusable": false
65+
},
66+
"enable1": {
67+
"type": "button",
68+
"text": "Disable",
69+
"top": 109,
70+
"left": 9,
71+
"width": 83,
72+
"height": 23,
73+
"events": [
74+
"onClick"
75+
],
76+
"method": "ObjectMethods/enable1.4dm",
77+
"focusable": false
78+
}
79+
},
80+
"entryOrder": [
81+
"Input1",
82+
"Subform",
83+
"Input",
84+
"enable",
85+
"enable1"
86+
]
87+
}
88+
],
89+
"geometryStamp": 24,
90+
"editor": {
91+
"activeView": "View 1",
92+
"defaultView": "View 1",
93+
"views": {
94+
"View 1": {}
95+
}
96+
},
97+
"method": "method.4dm"
98+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
OBJECT SET VALUE:C1742("Subform"; "Hello world")
2+
SearchPicker SET HELP TEXT("Subform"; "toto")
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
2-
SearchPicker__BtnClose ("Mac")
3-
1+
Form:C1466.handleEvents(FORM Event:C1606)
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
2-
SearchPicker__BtnClose("Win")
3-
1+
Form:C1466.handleEvents(FORM Event:C1606)

0 commit comments

Comments
 (0)