----- in english (or near english) -----
Hello,
as I met the same problem, I wrote a small tool to modify the width of a column very easily, and without being oblige to write a script or to do the calculation of the tabstops. The name of this tool is "Columna v1.0"
There are two ways to use this tool : as palette or as XCMD.
In the first case, it's enougth to write...
In this window, you'll find some buttons on wich you could click to increase or decrease the width of a choosen column. This will work for table field even if the cell editing is set to true, even if the text is locked, etc.
Take a look at this page :
http://rg75.free.fr/hyperespace.columna.htm
In the second case, it's possible to modify the width of a column with a command integrated to Columna. This command -
SetColWidth - comes with the following arguments : the name of the file where is the field to be modified, the name of the field to be modified, the number of the column in this field, and at least, the new size of the column
Code: Select all
setcolwidth "myFile" [name of the file/Text],"myField" [name of the field/Text],column number [integer],size of the column [integer]
Take careful to give the real name of the file and not the title of the window !!!
Here is an exemple of how to set the width of the column as near as possible to the length of the text in this column:
Code: Select all
on closefield
put fld "Contact" into tempor
set itemdelimiter to tab
sort lines of tempor descending by the number of chars in item 1 of each --- max length in the choosen column
put ((the number of chars in item 1 of line 1 of tempor)*9) into colwidth ----*9 depend of course of the font's size
start using stack "/folder1/folder2/Columna.rev"
setcolwidth "Adresse","Contact",1,colwidth
stop using stack "Columna"
end closefield
I hope it could be useful to some Revo users.
Renaud
--- En français ---
Bonjour,
comme je rencontrais le même problème, j'ai fini par créer un petit outil qui permet de modifier la largeur d'un colonne très aisément, et sans passer, ou presque, par la programmation et le calcul des tabstops. Il s'agit de "Columna v1.0".
Il est possible d'utiliser cet outil soit comme une palette, soit comme une XCMD
Dans le premier cas il suffira d'utiliser le script suivant :
Dans cette fenêtre, ll y a des boutons sur lesquels il suffit d'appuyer pour modifier la largeur d'une colonne préalablement choisie. Cela marchera même s'il s'agit d'une table, même si le champ est verrouillé, et si l'option "cell éditing" est cochée.
Pour avoir un aperçu allez jeter un oeil à l'adresse suivante :
http://rg75.free.fr/hyperespace.columna.htm
Dans le second cas, il est possible de modifier la largeur d'une colonne à l'aide d'une commande intégrée à Columna. On utilisera en effet la commande
SetColWidth avec les arguments suivants : le nom du fichier où se trouve le champ à modifier, le nom de ce champ, le numéro de la colonne dans le champs et enfin la largeur de colonne souhaitée.
Code: Select all
setcolwidth "myFile" [name of the file/Text],"myField" [name of the field/Text],column number [integer],size of the column [integer]
Prenez garde à bien indiquer le nom du fichier et non celui de la fenêtre !
Voici un exemple permettant de fixer la largeur d'une colonne en fonction de la longueur du teste qu'elle contient :
Code: Select all
on closefield
put fld "Contact" into tempor
set itemdelimiter to tab
sort lines of tempor descending by the number of chars in item 1 of each ... max length in the choosen column
put ((the number of chars in item 1 of line 1 of tempor)*9) into colwidth ----*9 depend of the size of the font
start using stack "/folder1/folder2/Columna.rev"
setcolwidth "Adresse","Contact",1,colwidth
stop using stack "Columna"
end closefield
Avec l'espoir que cela puisse être utile à quelques utilisateurs de Revo
Renaud