Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

English translation of pluie manual and documentation from french to english.

There may be errors


due to commands being translated that I have not fixed as of yet. Transtation is from
www.altavista.com Questions or Donations of content for the american translation can be directed to
http://groups.google.com/group/dexrow-software-and-programming-group?hl=en My software is at
http://www.stormpages.com/edexter/csound.html © 2007 Eric Dexter. Permission is hereby granted to
distribute this manual as part of a distribution of pluie with or without python as long as credits remain
and websites remain intact. Keep in mind that comunication with pluie gui's and your python program
may be blocked by your active-x and other settings on microsoft windows but the pages themselves
will generate fine. Hopefully I will add another example to this documentation. If you find this
manual useful please consider donating source code and debugging to the authors projects.

2 .......... tutorial example 1


5 .......... Documentation
7 .......... Fax
8 .......... Selected Questions
This tutorial is based on the examples provided with PLUIE. One starts with
exemple01.py

PLUIE is broken up into two parts:

• the creation of a card (of a screen)


• the use of a card

Us allon to start with the creation part of a card.

Example 01 ("exemple01.py")

Def cree():

import guie

g1=guie.ggroup(ID='GR1')

t1=guie.glabel(ID='TXT01', label='''Mon premier exemple.''') #my first example

c1=guie.gbutton(ID='BTOK', label = 'OK')

c2=guie.gbutton(ID='BTANNEL', label='Annuler')

g1.insert(t1, c1, c2)

guie.gwrite(g1, fichier='okann.htm')

return g1

Result:
Explanations:

g1=guie.ggroup(ID=' GR1 ')

A group defines, whose ID is "GR1"

t1=guie.glabel(ID=' TXT01 ', label=' ' ' My first


example.''')

A label (text) defines, whose ID is "TXT01"

c1=guie.gbutton(ID=' BTOK', label=' OK')


c2=guie.gbutton(ID=' BTANNUL', label=' Annuler')

Defines two buttons, whose ID are "BTOK" & "BTANNUL"

g1.insert(t1, c1, c2)

One inserts Basle and the two buttons in the group.

guie.gwrite(g1, fichier=' okann.htm')

The result is recorded in the file "okann.htm"

Use

The function below uses the card "okann.htm", above definite.

def utilise():
importation guie
g=guie.guie(' okann.htm')

while True:
if not g.getnextaction():
if g.type==' break':
print 'GUIE casse' #broken gui
break
else:
time.sleep(0.1)
else:
if g.type=='clic':
if g.cible=='BTOK':
print “Le bouton OK a ete clique"

#O.K. Button was pressed


if g.cible==' BTANNUL':
print "the button ' Annuler' was
clicked."
print "One will finish."
g.close()
break
print "One finished."

Explanations

import guie
g=guie.guie(' okann.htm')

One opens the card "okann.htm"

while True:

The loop will turn until one stops it.

if not g.getnextaction():

The events (blur, focus, clavier, souris (mouse translated), etc.) are memorized in a file
(FIFO; English tail). Thus, they progressively are treated, without losing some, even if the
treatments are long. One can say that there is an operation in threads separated, between the
card and the use.
getnextaction() will turn over the following event, which is on standby. If there is no event,
None is turned over. If the card is not available any more, the pseudo event "break" is turned
over.

if g.type==' click:

The only managed events are as follows:

• "clic"; click on a button of the mouse


• "focus"; arrival in an object
• "blur"; when the cursor leaves an object
• "key"; press on a key of the keyboard
• "changevalue"; starts, if, at the time of the "blur" of a field, the contents
changed, since the "x-ray one". This event always precedes a "blur".
• "break"; it is an pseudo-event, turned over by PLUIE, when it does not
manage any more to join the card.

One has several additional information, to help to manage the events:

• type; type of the event ("clic", "focus", "blur", "key", "changevalue",


"break")
• kbskey; can contain "shift", "ctrl" or "alt", if one of these special keys
were inserted at the time of the event
• cible; ID of the object targets event
• kbuffer; code (ASCII) key of the keyboard
• mousebutton; button of the mouse inserted at the time of the event (1
left, 2 right)

g.close()

firm the card.

Other examples

With PLUIE, you downloaded vingt-un examples, named "exemple01.py" with


"exemple21.py".

You are invited to test them, and to look at the code-source.

Documentation

Guiding principles.

There are two great parts, in PLUIE:

• the creation of a card (of a screen)


• the use of a card.
Creation of a card

Groups

With RAIN, one directly does not pose buttons or fields. It must always be contained in a
group (and a group can contain other groups).

Objects usable

For the moment, the only definite objects are:

• group
• jump of lignes(s) (saut de lignes(s) in french)
• label (text)
• image
• champ (translates as field)
• textarea (field multiple-line)
• table (in reading alone)
• bouton (button)
• marquee (ravelling text)

Generic properties

• ID; the identifier is obligatory. As the identifier is also usable as a property,


and in order to maintain a compatibility maximum, it is advised to use
only letters or figures, without accents, diacritic, and preferably in capital
letters

Methods:

• close(); firm the object, and all objects contained, while calling, for each one
regen(). Turn over code-source HTML of the unit.
• walk(); turn over a list of (object, type), for the object and all the objects
contained.
• walkd(); turn over a dictionary {ID: object } object, for the object and all the
objects contained.
• regen(); turn over the code - recomputed source HTML, for the current
object.

Properties of the groups (standard "group")

• X; horizontal position in points. Optional


• y; driving position in points. Optional
• larg; width of the group in points. Optional. 400 per defect.
haut (translates as high); height of the group in points. Optional. Variable by
defect.
• klass; name of style CSS. "cad0" by defect.
• sens (translates as feel); method of alignment of the objects contained in the
groups. "H" horizontal; "V" vertical. "V" by defect.
• align; alignment of the group. "left", "right" or "center". "center" by defect.
This parameter is thwarted by property X
• content; contents HTML "source" of the object

Properties of gbr (standard "gbr"); jumps of line.

• nb; a number of jumps of lines (< Br > in HTML).


• klass; name of style CSS. "" by defect.

Use

Events

The managed events are as follows:

• "clic"; click on a button of the mouse


• "focus"; arrival in an object
• "blur"; when the cursor leaves an object
• "key"; press on a key of the keyboard
• "changevalue"; starts, if, at the time of the "blur" of a field, the contents
changed, since the "x-ray one". This event precedes
• always a "blur".
• "break"; it is an pseudo-event, turned over by Pluie, when it does not manage
any more to join the card.

One has several additional information, to help to manage the events:


• type; type of the event ("clic", "focus", "blur", "key", "changevalue", "break")
• kbskey; can contain "shift", "ctrl" or "alt", if one of these special keys were
inserted at the time of the event
• cible; ID of the object targets event
• kbuffer; code (ASCII) key of the keyboard
• mousebutton; button of the mouse inserted at the time of the event (1 left, 2
right)

F.A.Q. (Foire Aux Questions)

RAIN function-you it with Internet-Exploring 6?

Yes, I tested. RAIN functions with IE-6. But certain functions go only with IE-7 (the Zoom
for example).

I am obliged to change certain parameters of safety tous.les.jours.

That arrives, with certain software of safety, which cancels the modifications made by the
users.
I, in particular met that with SpyBot-Search & Destroy, or Windows Defender. It should be
noted that, in this software, it is possible to decontaminate the automatic modification of
certain parameters.

Good evening!

I added script exemple12.py: visualization HTML, Flash, and Web site.

Modif important now makes it possible expressed as a percentage to use the sizes (%) in more of the
sizes in pixels (px).

Blow, one passes in version 0.4.

Good (re)-remote loadings

Exemple16.py is a small poisoned gift, for the readers of this forum.

To be able to use it, one needs that is installed, on the station, Excel-2000, Excel-XP, or Excel-2003
Why poisoned? Because that that fronctionne more, as soon as Office-2007 is installed. The
explanation is simple: in its great interest of the users, ms withdrew components OWC of Office-2007.
Conclusion: in the long term, that will not function any more...

Ah yes, the address: http://www.ponx.org/ponx/exemple16.py

You might also like