Skip to content

Commit

Permalink
ACI0104968 - UI
Browse files Browse the repository at this point in the history
  • Loading branch information
vdelachaux committed Aug 26, 2024
1 parent 1b7650d commit d1a099f
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 196 deletions.
121 changes: 26 additions & 95 deletions Project/Sources/Methods/QR_Get_column_format.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,133 +6,64 @@
// Created #3-4-2014 by Vincent de Lachaux
// Updated #2-20-2023 by Dominique Delahaye
// ----------------------------------------------------
// Description:
//
// ----------------------------------------------------
// Declarations

#DECLARE($area : Integer; $column : Integer; $column_type : Integer) : Text

If (False:C215)
C_TEXT:C284(QR_Get_column_format; $0)
C_LONGINT:C283(QR_Get_column_format; $1)
C_LONGINT:C283(QR_Get_column_format; $2)
C_LONGINT:C283(QR_Get_column_format; $3)
End if

/*
----------------------------------------------------
#DECLARE($area : Integer; $column : Integer; $columnType : Integer) : Text

CONSTANTS
----------------------------------------------------
*/

var \
$MIXED : Integer

//MARK: uppercase namming ok "K" start namming mean : it's a constant
//MARK: uppercase namming or "K" start namming mean : it's a constant
var $MIXED : Integer
$MIXED:=-1

/*
----------------------------------------------------
VARIABLES
var $count; $int : Integer
var $buffer; $format; $text; $type : Text

----------------------------------------------------
*/

var \
$count_columns; \
$count_parameters; \
$int : Integer

var \
$buffer; \
$format; \
$text; \
$type : Text


// ----------------------------------------------------
// Initialisations
$count_parameters:=Count parameters:C259

If (Asserted:C1132($count_parameters>=2; "Missing parameter"))
If ($column=0) // Compute the columns to find a common value

//$area:=$1
//$column:=$2
$count:=QR Count columns:C764($area)

If ($count_parameters>=3)
If ($count>0)

//$column_type:=$3

End if


Else

ABORT:C156

End if

// ----------------------------------------------------
If ($column=0) //compute the columns to find a common value

$count_columns:=QR Count columns:C764($area)

If ($count_columns>0)

//get type & format of the first column
// Get type & format of the first column
QR GET INFO COLUMN:C766($area; 1; $text; $text; $int; $int; $int; $format)
$column_type:=QR_Get_column_type($area; 1; True:C214)
$columnType:=QR_Get_column_type($area; 1; True:C214)

//the parse all columns
For ($column; 2; $count_columns; 1)
// The parse all columns
For ($column; 2; $count; 1)

QR GET INFO COLUMN:C766($area; $column; $text; $text; $int; $int; $int; $buffer)

If ($buffer#$format)\
| ($column_type#QR_Get_column_type($area; $column; True:C214))
| ($columnType#QR_Get_column_type($area; $column; True:C214))

//not the same: stop
// Not the same: stop
$column:=MAXLONG:K35:2-1

End if
End for

$format:=Choose:C955($column#MAXLONG:K35:2; $format; "")
$column_type:=Choose:C955($column#MAXLONG:K35:2; $column_type; $MIXED)
$format:=$column#MAXLONG:K35:2 ? $format : ""
$columnType:=$column#MAXLONG:K35:2 ? $columnType : $MIXED

End if

Else

QR GET INFO COLUMN:C766($area; $column; $text; $text; $int; $int; $int; $format)

If ($column_type=0)

$column_type:=QR_Get_column_type($area; $column)

End if
$columnType:=$columnType=0 ? QR_Get_column_type($area; $column) : $columnType

End if

If ($column_type=Is picture:K8:10)\
| ($column_type=Is date:K8:7)\
| ($column_type=Is time:K8:8)\
| ($column_type=Is boolean:K8:9)
If ($columnType=Is picture:K8:10)\
| ($columnType=Is date:K8:7)\
| ($columnType=Is time:K8:8)\
| ($columnType=Is boolean:K8:9)

$type:=Choose:C955($column_type=Is picture:K8:10; "pict_"; \
Choose:C955($column_type=Is date:K8:7; "date_"; \
Choose:C955($column_type=Is time:K8:8; "time_"; \
Choose:C955($column_type=Is boolean:K8:9; "bolean_"; ""))))
$type:=Choose:C955($columnType=Is picture:K8:10; "pict_"; \
Choose:C955($columnType=Is date:K8:7; "date_"; \
Choose:C955($columnType=Is time:K8:8; "time_"; \
Choose:C955($columnType=Is boolean:K8:9; "boolean_"; ""))))

$format:=Get localized string:C991($type+String:C10(Character code:C91($format)))

End if

return $format

// ----------------------------------------------------
// End
return $format
169 changes: 68 additions & 101 deletions Project/Sources/Methods/QR_SET_COLUMN_FORMAT.4dm
Original file line number Diff line number Diff line change
@@ -1,122 +1,89 @@
//%attributes = {"invisible":true}
// ----------------------------------------------------
// Project method : QR_SET_COLUMN_FORMAT
// Database: 4D report
// ID[42E482B75C6D4237B0559B166DC177EB]
// Created #3-4-2014 by Vincent de Lachaux
// ----------------------------------------------------
// Description:
//
// ----------------------------------------------------
// Declarations
C_LONGINT:C283($1)
C_LONGINT:C283($2)
C_TEXT:C284($3)
C_LONGINT:C283($4)
// ----------------------------------------------------
// Project method : QR_SET_COLUMN_FORMAT
// Database: 4D report
// ID[42E482B75C6D4237B0559B166DC177EB]
// Created #3-4-2014 by Vincent de Lachaux
// ----------------------------------------------------
#DECLARE($area : Integer; $column : Integer; $format : Text; $columnType : Integer)

C_LONGINT:C283($Lon_area;$Lon_column;$Lon_columnType;$Lon_hidden;$Lon_i;$Lon_parameters;$Lon_repeated;$Lon_width)
C_TEXT:C284($Txt_;$Txt_buffer;$Txt_format;$Txt_formula;$Txt_object;$Txt_title;$Txt_type)
var $buffer; $object; $title; $type : Text
var $hidden; $i; $repeated; $width : Integer

If (False:C215)
C_LONGINT:C283(QR_SET_COLUMN_FORMAT ;$1)
C_LONGINT:C283(QR_SET_COLUMN_FORMAT ;$2)
C_TEXT:C284(QR_SET_COLUMN_FORMAT ;$3)
C_LONGINT:C283(QR_SET_COLUMN_FORMAT ;$4)
End if

// ----------------------------------------------------
// Initialisations
$Lon_parameters:=Count parameters:C259

If (Asserted:C1132($Lon_parameters>=3;"Missing parameter"))

$Lon_area:=$1
$Lon_column:=$2
$Txt_format:=$3

If ($Lon_parameters>=4)

$Lon_columnType:=$4

End if

If ($Lon_columnType=0)

$Lon_columnType:=QR_Get_column_type ($Lon_area;$Lon_column)

End if
Else

ABORT:C156

End if

// ----------------------------------------------------
//ACI0099675
//If ($Lon_columnType=Is picture)\
| ($Lon_columnType=Is date)\
| ($Lon_columnType=Is time)\
| ($Lon_columnType=Is boolean)
$columnType:=$columnType=0 ? QR_Get_column_type($area; $column) : $columnType

/* ACI0099675
//If ($columnType=Is picture)\
| ($columnType=Is date)\
| ($columnType=Is time)\
| ($columnType=Is boolean)
*/

If ($Lon_columnType=Is picture:K8:10)\
| ($Lon_columnType=Is date:K8:7)\
| ($Lon_columnType=Is time:K8:8)\
| ($Lon_columnType=Is undefined:K8:13)\
| ($Lon_columnType=Is boolean:K8:9)
If ($columnType=Is picture:K8:10)\
| ($columnType=Is date:K8:7)\
| ($columnType=Is time:K8:8)\
| ($columnType=Is undefined:K8:13)\
| ($columnType=Is boolean:K8:9)

$Txt_type:=Choose:C955($Lon_columnType=Is picture:K8:10;"pict_";\
Choose:C955($Lon_columnType=Is date:K8:7;"date_";\
Choose:C955($Lon_columnType=Is time:K8:8;"time_";\
Choose:C955($Lon_columnType=Is boolean:K8:9;"bolean_";""))))
$type:=Choose:C955($columnType=Is picture:K8:10; "pict_"; \
Choose:C955($columnType=Is date:K8:7; "date_"; \
Choose:C955($columnType=Is time:K8:8; "time_"; \
Choose:C955($columnType=Is boolean:K8:9; "boolean_"; ""))))

$Lon_i:=1
$i:=1

Repeat

$Txt_buffer:=Get localized string:C991($Txt_type+String:C10($Lon_i))
$buffer:=Get localized string:C991($type+String:C10($i))

If ($Txt_buffer=$Txt_format)
If ($buffer=$format)

$Txt_format:=Char:C90($Lon_i)
CLEAR VARIABLE:C89($Txt_buffer) //stop
$format:=Char:C90($i)
CLEAR VARIABLE:C89($buffer) // Stop

End if

$Lon_i:=$Lon_i+1
$i:=$i+1

Until (Length:C16($Txt_buffer)=0)
Until (Length:C16($buffer)=0)
End if

QR GET INFO COLUMN:C766($Lon_area;\
$Lon_column;\
$Txt_title;\
$Txt_object;\
$Lon_hidden;\
$Lon_width;\
$Lon_repeated;\
$Txt_;\
$Txt_formula)
/* ACI0099675
QR GET INFO COLUMN($area; \
$column; \
$title; \
$object; \
$hidden; \
$width; \
$repeated; \
$buffer; \
$formula)
//ACI0099675
//QR SET INFO COLUMN($Lon_area;\
$Lon_column;\
$Txt_title;\
$Txt_formula;\
$Txt_object;\
$Lon_hidden;\
$Lon_width;\
$Lon_repeated;\
$Txt_format)
QR SET INFO COLUMN($area;\
$column;\
$title;\
$formula;\
$object;\
$hidden;\
$width;\
$repeated;\
$format)
*/

QR SET INFO COLUMN:C765($Lon_area;\
$Lon_column;\
$Txt_title;\
$Txt_object;\
$Lon_hidden;\
$Lon_width;\
$Lon_repeated;\
$Txt_format)
QR GET INFO COLUMN:C766($area; \
$column; \
$title; \
$object; \
$hidden; \
$width; \
$repeated; \
$buffer)

// ----------------------------------------------------
// End
QR SET INFO COLUMN:C765($area; \
$column; \
$title; \
$object; \
$hidden; \
$width; \
$repeated; \
$format)

0 comments on commit d1a099f

Please sign in to comment.