Skip to content

Commit

Permalink
code cleaning folder PATH PICKER replace _o_C_xxxxx with var
Browse files Browse the repository at this point in the history
  • Loading branch information
delahaye-4D committed Sep 23, 2024
1 parent a35f5e3 commit 170f15b
Show file tree
Hide file tree
Showing 35 changed files with 1,790 additions and 1,402 deletions.
19 changes: 10 additions & 9 deletions Project/Sources/Forms/HDI_PATH_PICKER/ObjectMethods/Button.4dm
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
C_TEXT:C284($Txt_fileName)
var $file_name : Text

$Txt_fileName:=Select document:C905("";"";"";0)

$file_name:=Select document:C905(""; ""; ""; 0)

If (OK=1)

//set the path
(OBJECT Get pointer:C1124(Object named:K67:5;"widget_path"))->:=DOCUMENT
//set the path
(OBJECT Get pointer:C1124(Object named:K67:5; "widget_path"))->:=DOCUMENT

//set the type, message & placeholder
PathPicker SET TYPE ("widget_path";Is a document:K24:1)
pathPicker SET MESSAGE ("widget_path";"Select file:")
PathPicker SET PLACEHOLDER ("widget_path";"Please select a file")
//set the type, message & placeholder
PathPicker SET TYPE("widget_path"; Is a document:K24:1)
pathPicker SET MESSAGE("widget_path"; "Select file:")
PathPicker SET PLACEHOLDER("widget_path"; "Please select a file")

//update UI
//update UI
SET TIMER:C645(-1)

End if
18 changes: 9 additions & 9 deletions Project/Sources/Forms/HDI_PATH_PICKER/ObjectMethods/Button1.4dm
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
C_TEXT:C284($Txt_path)
var $path : Text

$Txt_path:=Select folder:C670("";"";0)
$path:=Select folder:C670(""; ""; 0)

If (OK=1)

//set the path
(OBJECT Get pointer:C1124(Object named:K67:5;"widget_path"))->:=$Txt_path
//set the path
(OBJECT Get pointer:C1124(Object named:K67:5; "widget_path"))->:=$path

//set the type, message & placeholder
PathPicker SET TYPE ("widget_path";Is a folder:K24:2)
pathPicker SET MESSAGE ("widget_path";"Select folder:")
PathPicker SET PLACEHOLDER ("widget_path";"Please select a folder")
//set the type, message & placeholder
PathPicker SET TYPE("widget_path"; Is a folder:K24:2)
pathPicker SET MESSAGE("widget_path"; "Select folder:")
PathPicker SET PLACEHOLDER("widget_path"; "Please select a folder")

//update UI
//update UI
SET TIMER:C645(-1)

End if
13 changes: 7 additions & 6 deletions Project/Sources/Forms/HDI_PATH_PICKER/ObjectMethods/type.4dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
C_LONGINT:C283($Lon_type)
var $type : Integer

$Lon_type:=Self:C308->-1

PathPicker SET TYPE ("widget_path";$Lon_type)
pathPicker SET MESSAGE ("widget_path";Choose:C955($Lon_type=Is a document:K24:1;"Select file:";"Select folder:"))
PathPicker SET PLACEHOLDER ("widget_path";Choose:C955($Lon_type=Is a document:K24:1;"Please select a file";"Please select a folder"))
$type:=Self:C308->-1

//update UI
PathPicker SET TYPE("widget_path"; $type)
pathPicker SET MESSAGE("widget_path"; Choose:C955($type=Is a document:K24:1; "Select file:"; "Select folder:"))
PathPicker SET PLACEHOLDER("widget_path"; Choose:C955($type=Is a document:K24:1; "Please select a file"; "Please select a folder"))

//update UI
SET TIMER:C645(-1)
73 changes: 39 additions & 34 deletions Project/Sources/Forms/HDI_PATH_PICKER/ObjectMethods/widget_path.4dm
Original file line number Diff line number Diff line change
@@ -1,47 +1,52 @@
// ----------------------------------------------------
// Object method : HDI_PATH_PICKER.widget_path
// ID[5AC07F61D04D4C29A136AA0B224F1384]
// Created #9-9-2014 by Vincent de Lachaux
// ----------------------------------------------------
// Declarations
C_LONGINT:C283($Lon_bottom;$Lon_formEvent;$Lon_left;$Lon_right;$Lon_top)
C_POINTER:C301($Ptr_me)
C_TEXT:C284($Txt_me)

// ----------------------------------------------------
// Initialisations
$Lon_formEvent:=Form event code:C388
$Txt_me:=OBJECT Get name:C1087(Object current:K67:2)
$Ptr_me:=OBJECT Get pointer:C1124(Object current:K67:2)

$Lon_formEvent:=Form event code:C388

// ----------------------------------------------------
// ----------------------------------------------------
// Object method : HDI_PATH_PICKER.widget_path
// ID[5AC07F61D04D4C29A136AA0B224F1384]
// Created #9-9-2014 by Vincent de Lachaux
// ----------------------------------------------------
// Declarations

var $e : Object
var $my_name : Text
var $self : Pointer

var $left; $top; $right; $bottom : Integer



// ----------------------------------------------------
// Initialisations

$e:=FORM Event:C1606
$my_name:=OBJECT Get name:C1087(Object current:K67:2)
$self:=OBJECT Get pointer:C1124(Object current:K67:2)


// ----------------------------------------------------
Case of

//______________________________________________________
: ($Lon_formEvent<0)
//______________________________________________________
: ($e.code<0)

//______________________________________________________
: ($Lon_formEvent=On Data Change:K2:15)
//______________________________________________________
: ($e.code=On Data Change:K2:15)

//update UI
//update UI
SET TIMER:C645(-1)

//______________________________________________________
: ($Lon_formEvent=On Load:K2:1)
//______________________________________________________
: ($e.code=On Load:K2:1)

//Resize the widget
OBJECT GET COORDINATES:C663(*;$Txt_me+".template";$Lon_left;$Lon_top;$Lon_right;$Lon_bottom)
OBJECT SET COORDINATES:C1248(*;$Txt_me;$Lon_left;$Lon_top;$Lon_right;$Lon_bottom)
//Resize the widget
OBJECT GET COORDINATES:C663(*; $my_name+".template"; $left; $top; $right; $bottom)
OBJECT SET COORDINATES:C1248(*; $my_name; $left; $top; $right; $bottom)

//Offsets of the widget
subform_SET_OFFSET ($Txt_me)
//Offsets of the widget
subform_SET_OFFSET($my_name)

//______________________________________________________
//______________________________________________________
Else

ASSERT:C1129(False:C215;"Form event activated unnecessary ("+String:C10($Lon_formEvent)+")")
ASSERT:C1129(False:C215; "Form event activated unnecessary ("+String:C10($e.code)+")")

//______________________________________________________
//______________________________________________________
End case
9 changes: 7 additions & 2 deletions Project/Sources/Forms/HDI_PATH_PICKER/form.4DForm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"destination": "detailScreen",
"windowTitle": "HDI Path picker",
"windowSizingY": "fixed",
Expand Down Expand Up @@ -314,5 +314,10 @@
"message"
]
}
]
],
"geometryStamp": 4,
"$4d": {
"version": "1",
"kind": "form"
}
}
63 changes: 32 additions & 31 deletions Project/Sources/Forms/HDI_PATH_PICKER/method.4dm
Original file line number Diff line number Diff line change
@@ -1,50 +1,51 @@
// ----------------------------------------------------
// Form method : HDI_PATH_PICKER
// ID[6422098872994C57B8AC9F8BBA079A42]
// Created #9-9-2014 by Vincent de Lachaux
// ----------------------------------------------------
// Declarations
C_LONGINT:C283($Lon_formEvent)
// ----------------------------------------------------
// Form method : HDI_PATH_PICKER
// ID[6422098872994C57B8AC9F8BBA079A42]
// Created #9-9-2014 by Vincent de Lachaux
// ----------------------------------------------------
// Declarations
var $e : Object

// ----------------------------------------------------
// Initialisations
$Lon_formEvent:=Form event code:C388

// ----------------------------------------------------
// ----------------------------------------------------
// Initialisations
$e:=FORM Event:C1606

// ----------------------------------------------------

Case of

//______________________________________________________
: ($Lon_formEvent=On Load:K2:1)
//______________________________________________________
: ($e.code=On Load:K2:1)

GOTO OBJECT:C206(*;"")
GOTO OBJECT:C206(*; "")

SET TIMER:C645(-1)

//______________________________________________________
: ($Lon_formEvent=On Unload:K2:2)
//______________________________________________________
: ($e.code=On Unload:K2:2)

//______________________________________________________
: ($Lon_formEvent=On Timer:K2:25)
//______________________________________________________
: ($e.code=On Timer:K2:25)

SET TIMER:C645(0)

//options
(OBJECT Get pointer:C1124(Object named:K67:5;"browse"))->:=Num:C11(PathPicker Get option ("widget_path";1))
(OBJECT Get pointer:C1124(Object named:K67:5;"showOnDisk"))->:=Num:C11(PathPicker Get option ("widget_path";2))
(OBJECT Get pointer:C1124(Object named:K67:5;"copyPath"))->:=Num:C11(PathPicker Get option ("widget_path";3))
(OBJECT Get pointer:C1124(Object named:K67:5;"openItem"))->:=Num:C11(PathPicker Get option ("widget_path";4))
(OBJECT Get pointer:C1124(Object named:K67:5;"type"))->:=1+PathPicker Get type ("widget_path")
(OBJECT Get pointer:C1124(Object named:K67:5;"message"))->:=PathPicker Get message ("widget_path")
(OBJECT Get pointer:C1124(Object named:K67:5;"placeholder"))->:=PathPicker Get placeholder ("widget_path")
//options
(OBJECT Get pointer:C1124(Object named:K67:5; "browse"))->:=Num:C11(PathPicker Get option("widget_path"; 1))
(OBJECT Get pointer:C1124(Object named:K67:5; "showOnDisk"))->:=Num:C11(PathPicker Get option("widget_path"; 2))
(OBJECT Get pointer:C1124(Object named:K67:5; "copyPath"))->:=Num:C11(PathPicker Get option("widget_path"; 3))
(OBJECT Get pointer:C1124(Object named:K67:5; "openItem"))->:=Num:C11(PathPicker Get option("widget_path"; 4))
(OBJECT Get pointer:C1124(Object named:K67:5; "type"))->:=1+PathPicker Get type("widget_path")
(OBJECT Get pointer:C1124(Object named:K67:5; "message"))->:=PathPicker Get message("widget_path")
(OBJECT Get pointer:C1124(Object named:K67:5; "placeholder"))->:=PathPicker Get placeholder("widget_path")

//path
(OBJECT Get pointer:C1124(Object named:K67:5;"path"))->:=(OBJECT Get pointer:C1124(Object named:K67:5;"widget_path"))->
//path
(OBJECT Get pointer:C1124(Object named:K67:5; "path"))->:=(OBJECT Get pointer:C1124(Object named:K67:5; "widget_path"))->

//______________________________________________________
//______________________________________________________
Else

ASSERT:C1129(False:C215;"Form event activated unnecessary ("+String:C10($Lon_formEvent)+")")
ASSERT:C1129(False:C215; "Form event activated unnecessary ("+String:C10($e.code)+")")

//______________________________________________________
//______________________________________________________
End case
18 changes: 9 additions & 9 deletions Project/Sources/Forms/NQR/method.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
// Created #13-3-2014 by Vincent de Lachaux
// ----------------------------------------------------
// Declarations
C_BOOLEAN:C305($Boo_many; $Boo_one)
C_LONGINT:C283($Lon_area; $Lon_formEvent; $Lon_timerEvent)
C_POINTER:C301($Ptr_timer)
_O_C_BOOLEAN:C305($Boo_many; $Boo_one)
_O_C_LONGINT:C283($Lon_area; $Lon_formEvent; $Lon_timerEvent)
_O_C_POINTER:C301($Ptr_timer)

// ----------------------------------------------------
// Initialisations
Expand Down Expand Up @@ -67,12 +67,12 @@ Case of
$Ptr_timer->:=-1 //init
SET TIMER:C645(-1)

If (<>withFeature102041)
// do not modify .doAction C++ is using it for launching QR ON COMMAND
Form:C1466.doAction:=Formula:C1597(NQR_doAction($1))
End if
//If (<>withFeature102041)

// do not modify .doAction C++ is using it for launching QR ON COMMAND
Form:C1466.doAction:=Formula:C1597(NQR_doAction($1))

//End if

//______________________________________________________
: ($Lon_formEvent=On Timer:K2:25)
Expand Down
Loading

0 comments on commit 170f15b

Please sign in to comment.