

![]() | 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: |
4 messages in org.openoffice.fr.progRe: [prog] Calc - boutons macro| From | Sent On | Attachments |
|---|---|---|
| LE MOULEC Jacques | May 4, 2007 12:09 am | |
| oo...@volcar.org | May 4, 2007 9:39 am | |
| oo...@volcar.org | May 4, 2007 9:45 am | |
| Bernard Marcelly | May 4, 2007 11:20 am |

![]() | 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] Calc - boutons macro | Actions... |
|---|---|---|
| From: | oo...@volcar.org (oo...@volcar.org) | |
| Date: | May 4, 2007 9:45:41 am | |
| List: | org.openoffice.fr.prog | |
Selon oo...@volcar.org:
Selon LE MOULEC Jacques <jacq...@cnasea.fr>:
Bonjour,
Je cherche les fonctionnalites pour creer un bouton macro en mode programmation.
J'ai trouve, en tatonnant + avec le livre OOo programmation (version 1) les elements suivants :
Sub bouton
Dim Feuille as object, PageGraphique as object, TypeBouton as object Dim button_model as object, monForm as object Dim aPos as new com.sun.star.awt.Point Dim aSize as new com.sun.star.awt.Size dim unEvent as new com.sun.star.script.ScriptEventDescriptor
Feuille = ThisComponent.Sheets.getByName("Feuille1") PageGraphique = Feuille.getDrawPage() TypeBouton = ThisComponent.createInstance("com.sun.star.drawing.ControlShape")
'Position en 1/1000 de pouce => 1 pouce = 2540 aPos.X = 17500 aPos.Y = 500 TypeBouton.Position = aPos 'Taille aSize.Width = 6000 aSize.Height = 1600 TypeBouton.Size = aSize
button_model = ThisComponent.createInstance("com.sun.star.form.component.CommandButton") button_model.Name = "PushButton" button_model.Label = "Edition" 'button_model.Tag = 16711935 button_model.FontHeight = 15 'taille police button_model.FontName = "Arial" 'nom police
'button_model.Tag = RGB(0,0,0) button_model.HelpText = "Mise à jour de la valeur du stock dans la fiche principale"
TypeBouton.Control = button_model PageGraphique.add(TypeBouton)
'unEvent.ListenerType = "com.sun.star.awt.XMouseListener" 'unEvent.EventMethod = "mouseReleased" 'unEvent.ScriptType = "StarBasic" 'unEvent.ScriptCode = "ArmOOor601.Module2.Test"
'monForm = PageGraphique.Forms.getByName( "Standard") 'monForm.registerScriptEvent(monForm.Count - 1, unEvent)
End Sub
il me manque : 1- affecter une couleur au bouton (qu'est-ce que button_model.Tag ?)
button_model.backgroundcolor = rgb(255,128,255)
le Tag correspond à la bulle d'aide qui s'affiche au passage de la souris sur le controle.
Désolé, la définition précédente s'applique au HelpText. Le Tag n'étant qu'un élément d'information du contrôle.
2- mettre la police du titre (Label) en gras button_model.FontWeight = 150 3- ... et toutes autres informations utiles.
Merci.
Francois Gatto
Francois







