

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
7 messages in org.openoffice.fr.progRe: [prog] création et suppression de...| From | Sent On | Attachments |
|---|---|---|
| Jovial | Jul 12, 2004 5:11 am | |
| Bob | Jul 12, 2004 5:16 am | |
| Jovial | Jul 12, 2004 7:33 am | |
| Jovial | Jul 12, 2004 7:36 am | |
| Agnès Simonet | Jul 12, 2004 9:58 am | |
| Tony GALMICHE | Jul 12, 2004 10:23 am | |
| Jovial | Jul 12, 2004 1:00 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [prog] création et suppression de controle | Actions... |
|---|---|---|
| From: | Agnès Simonet (agne...@laposte.net) | |
| Date: | Jul 12, 2004 9:58:06 am | |
| List: | org.openoffice.fr.prog | |
Bonjour, Jovial a écrit :
Bonjour :-) Je recherche des informations ou exemple pour créer et supprimer par programmation un bouton de control et pouvoir gerer sa taille et sa position
J'ai trouver un exemple pour la position chez Andrew . Mais il faut charger une librairie pour que cela marche Il y a peut être plus simple Jluc
Sub SeeThingProp Dim oForm, oControl, iNumControls%, i% Dim v() 'Par défaut, les contrôles se trouvent ici oForm = ThisComponent.Drawpage.Forms.getByName("Standard") 'oControl = oForm.getByName("MyPushButton") oControl = oForm.getByName("CheckBox") Dim vShape Dim vPosition, vSize Dim s$, vv vShape = GetControlShape(ThisComponent, "CheckBox") 'plante sur cette ligne
vPosition = vShape.getPosition() vSize = vShape.getSize() ' RunSimpleObjectBrowser(vSize) s = s & "Position = (" & vPosition.X & ", " & vPosition.Y & ")" & CHR$(10) s = s & "Height = " & vSize.Height & " Width = " & vSize.Width & CHR$(10) MsgBox s End Sub
J'ai fait mes travaux pratiques là-dessus la semaine dernière. Il me semble que Tony t'avait envoyé quelquechose du même tonneau. Mais est-ce que c'est ça que tu cherches ?
Sub creation_controle 'Attention aux coupures par la messagerie au niveau des signes = '****** creer un controle ******** 'créer une forme pour le controle dim MonDocument as object Dim MonTexte as object dim oSource as object dim oConnexion as object MonDocument = ThisComponent
Dim Ctl2Shape as object Ctl2Shape = MonDocument.createInstance("com.sun.star.drawing.ControlShape")
Dim Taille As New com.sun.star.awt.Size Taille.Width = 1000 Taille.Height = 800 Ctl2Shape.Size = Taille
'crée un modèle de controle, ici une listbox dim ModeleControle as object ModeleCtl2 = MonDocument.createInstance ("com.sun.star.form.component.ListBox") XRay.XRay ModeleCtl2 ModeleCtl2.Border = 1 ModeleCtl2.Name = "MaListbox" ModeleCtl2. BackgroundColor = 65200
'lier modèle et forme Ctl2Shape.setControl(ModeleCtl2)
'insérer la forme à la fin de la page de dessin du document Writer Dim MonCurseur MonCurseur=MonDocument.Text.createTextCursor MonCurseur.gotoEnd(false) MonTexte.insertTextContent( MonCurseur, Ctl2Shape, false)
End Sub







