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

How Can I insert a Button in a Document, but not in a form?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
Oskars
Guest





PostPosted: Mon Jun 14, 2004 3:06 am    Post subject: How Can I insert a Button in a Document, but not in a form? Reply with quote

and track / assign key pressed event to it?

I'v got VB code witch connect to SQL Server and updates fields in the Sheet.
It all works fine in Excel, but in Spreadsheet it doesn't.

Any Ideas?
Oskars.
Back to top
davidh182
OOo Advocate
OOo Advocate


Joined: 01 Apr 2004
Posts: 413

PostPosted: Tue Jun 15, 2004 1:23 am    Post subject: Reply with quote

Look in "Form Functions" on the main toolbar (left of sheet)
From there you can put a button on the sheet and assign macro to it
You can assign a different macro to each action [mouse over, key press etc.]
Then click "Design Mode on/off" [2nd row of "Form Functions"] to activate it.
Back to top
View user's profile Send private message Send e-mail
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Tue Jun 15, 2004 6:27 am    Post subject: Reply with quote

In the end, the button must be part of a form.

The form doesn't have to do anything. There is no drawback to the requirement for a control to be part of a form.

You can have as many forms per page as you wish. Forms don't impose any requirement to be using a database or be tied in any way to a database.

Think of a form as just a way of grouping buttons.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
geoff_f
OOo Enthusiast
OOo Enthusiast


Joined: 21 Nov 2003
Posts: 181
Location: Canberra, Australia

PostPosted: Wed Jun 16, 2004 3:41 am    Post subject: Reply with quote

DannyB said:
Quote:
In the end, the button must be part of a form.

The form doesn't have to do anything. There is no drawback to the requirement for a control to be part of a form.

You can have as many forms per page as you wish. Forms don't impose any requirement to be using a database or be tied in any way to a database.

Think of a form as just a way of grouping buttons.

This might be true of Draw, but not of Calc. You can simply insert buttons anywhere onto the sheet and assign a macro to them, with no forms involved, just as davidh182 said. I used this method when I created my Clueless Crossword Solver, which you can see here:

http://www.ooomacros.org/user.php
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Sun Jun 27, 2004 10:25 am    Post subject: Reply with quote

geoff_f wrote:
DannyB wrote:
In the end, the button must be part of a form.

This might be true of Draw, but not of Calc. You can simply insert buttons anywhere onto the sheet and assign a macro to them, with no forms involved, just as davidh182 said.


Can you provide an example of how this is true?

I just created a Calc spreadsheeet.

Draw a simple button onto it.

Then bring up the Form Navigator. (Fifth button from the right, buttom row, of Form Functions tear off window.)

The button I just put onto the spreadsheet is definitely within a form called "Standard".

I do not see how it would be possible to have a control that is NOT part of a form?

I just answerd a question about how to add a button to a spreadsheet.
http://www.oooforum.org/forum/viewtopic.php?t=10230
I know of no simpler procedure to add a button to a spreadsheet. Even the simple procedure I described results in the button being in the "Standard" form, even though you did not expressly create a form.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
geoff_f
OOo Enthusiast
OOo Enthusiast


Joined: 21 Nov 2003
Posts: 181
Location: Canberra, Australia

PostPosted: Mon Jun 28, 2004 3:12 am    Post subject: Reply with quote

DannyB said:
Quote:
Can you provide an example of how this is true?

The example I gave was in my next sentence:
Quote:
I used this method when I created my Clueless Crossword Solver, which you can see here:

http://www.ooomacros.org/user.php

I've just checked that file using the form navigator as described by DannyB, and have found that the buttons are indeed in a form; mine are in a form called 'WW-Standard' Embarassed. So it seems that Calc will put any buttons you create in a form by default, despite your not having created a form explicitly. But it is still true that you can put buttons in a form without first creating a form for them, as the Help files suggest you need to do (Help-> Forms; editing and creating-> New Form).

In hindsight, my use of 'with no forms involved' was loose wording. What I should have said is 'You can simply insert buttons anywhere onto the sheet and assign a macro to them, without first explicitly creating a form'. But DannyB is right, the buttons must be part of a form; Calc will see to that, even if you don't.
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 Calc 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