OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Aisgn Macro to CommanButton

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
arivas_2005
Power User
Power User


Joined: 10 Oct 2006
Posts: 98
Location: El Salvador CentroAm

PostPosted: Thu May 01, 2008 10:32 am    Post subject: Aisgn Macro to CommanButton Reply with quote

Hi.

I have the macro. it creates the CommandButton with label "Stop Process" in Active Sheet
It is visible while a long process runs.
Code:
Sub ShowButton3
   oSheet = Thiscomponent.CurrentController.ActiveSheet
   ControlBoton1 = Thiscomponent.createInstance("com.sun.star.drawing.ControlShape")
   ControlBox1=Thiscomponent.createInstance("com.sun.star.form.component.CommandButton")
   
      Dim oPos as new com.sun.star.awt.Point
      oPos.X = 8000  :   oPos.Y = 5000
      ControlBoton1.setPosition(oPos)
      Dim oSize as new com.sun.star.awt.Size
      oSize.Width  = 4000 :   oSize.Height = 2000
         ControlBoton1.setSize(oSize)
         ControlBox1.Name="float2"
         ControlBox1.label="Stop Process"
         ControlBox1.FontHeight = 15
         ControlBox1.FontName="Times"
         ControlBox1.BackgroundColor=13434879
         ControlBox1.MultiLine = True 'False
         ControlBoton1.setControl(ControlBox1)
         oSheet.DrawPage.add(ControlBoton1)

                        ' Here i need to asign a macro for event "preseed mouse" or others

End sub

But with a click on the button, I want to execute another macro to stop the process:
1.
How it can assign the macro "StopProcess" to the event "pressed mouse" or when pressing the button of the mouse (in the CommandButton Stop Process").
2.
How it can assign the macro "StopProcess" to the event "Reception foccus" or when reception of the foccus
3.
How it can assign the macro "StopProcess" to the event "Key pressed F4"

thanks for all !
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group