Skip to content

Commit

Permalink
wp classe (POC)
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland-Lannuzel committed Jul 2, 2024
1 parent 75cf7b4 commit 27e9c09
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 2 deletions.
24 changes: 24 additions & 0 deletions Project/Sources/Classes/WPdocument.4dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Class constructor()
This:C1470.document:=WP New:C1317


Function setText($newText : Text; $textPosition : Integer; $rangeUpdate : Integer)
If (Count parameters:C259<3)
$rangeUpdate:=wk include in range:K81:180
End if
WP SET TEXT:C1574(This:C1470.document; $newText; $textPosition; $rangeUpdate)

Function getText($expressions : Integer)->$text : Text
If (Count parameters:C259=0)
$expressions:=wk expressions as value:K81:255
End if
$text:=WP Get text:C1575(This:C1470.document; $expressions)

Function textRange($start : Integer; $end : Integer)->$range : Object
$range:=WP Text range:C1341(This:C1470.document; $start; $end)






16 changes: 16 additions & 0 deletions Project/Sources/Classes/WPsection.4dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Class constructor($target : Object; $index : Integer)

Case of
: (Count parameters:C259=2)
This:C1470.section:=WP Get section:C1581($target; $index) // document + index

: (Value type:C1509($target)=Is object:K8:27)
This:C1470.section:=WP Get section:C1581($target) //element
End case


Function newHeader()->$header : Object
$header:=WP New header:C1586(This:C1470.section)

Function newFooter($section : Object)->$footer : Object
$footer:=WP New footer:C1587(This:C1470.section)
27 changes: 26 additions & 1 deletion Project/Sources/Methods/z.4dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
//%attributes = {}
//$d:=Chaîne(Date du jour; Système date court)
//$h:=Chaîne(Heure courante; Système heure court)
//$h:=Chaîne(Heure courante; Système heure court)


var $doc : cs:C1710.WPdocument
var $section1a; $section1b : cs:C1710.WPsection

var $text : Text
var $range; $header; $footer : Object

$doc:=cs:C1710.WPdocument.new()

$doc.setText("blablabla"; wk append:K81:179)

$text:=$doc.getText()
$range:=$doc.textRange(1; 3)

$section1a:=cs:C1710.WPsection.new($doc.document; 1)
$section1b:=cs:C1710.WPsection.new($range)


$header:=$section1b.newHeader()
$footer:=$section1b.newFooter()




2 changes: 1 addition & 1 deletion Project/Sources/catalog.4DCatalog
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<field name="title" uuid="19F64DF6BDDD4615A1EEC9F1978DBD56" type="10" limiting_length="255" never_null="true" id="3"/>
<field name="group" uuid="47208754D7924C1E8357A182DBB2A1CC" type="3" never_null="true" id="4"/>
<primary_key field_name="ID" field_uuid="25E1AC17AE3D4D5FBED8BEFDB6E6B6DC"/>
<table_extra input_form="InputToolBar" output_form="Output">
<table_extra input_form="InputSideBar" output_form="Output">
<editor_table_info displayable_fields_count="6">
<color red="255" green="255" blue="255" alpha="0"/>
<coordinates left="41.5" top="16.453125" width="120" height="167.33203125"/>
Expand Down

0 comments on commit 27e9c09

Please sign in to comment.