Howto open new form via button in FULLSCREEN?

Creating and using forms
Post Reply
User avatar
NiksaVel
Posts: 91
Joined: Fri Jan 25, 2008 12:00 pm
Location: Croatia

Howto open new form via button in FULLSCREEN?

Post by NiksaVel »

Hi all,

I've been using the following macro I've found here in the forums to open a second form via button and it works fine...

Code: Select all


REM Generic macros needed to open any form
function OpenForm( formContainer as variant, oConnection as variant, sFormName as string) as variant
Dim aProp(1) As New com.sun.star.beans.PropertyValue
aProp(0).Name = "ActiveConnection"
aProp(0).Value = oConnection
aProp(1).Name = "OpenMode"
aProp(1).Value = "open"
OpenForm = formContainer.loadComponentFromURL(sFormName,"_parent",0,aProp())
end function

function getFormsTC() as variant
getFormsTC = thisComponent.Parent.getFormDocuments
end function

function getConnectionTC() as variant
getConnectionTC = thisComponent.Drawpage.Forms(0).ActiveConnection
end function


sub OpenForm_Button_Click( oev as variant )
sFormName = oev.Source.Model.Tag
OpenForm( getFormsTC, getConnectionTC, sFormName )
end sub 
However, I would REALLY REALLY like to add some instruction in there so that the new form opens in full screen mode... i.e. ctrl+shft+j


Thank you in advance for all the help...

N
OOo 3.1.X on Ubuntu 8.x + Linux Mint 7, Win XP, Vista
vstarc16
Posts: 36
Joined: Sun Feb 10, 2008 7:00 pm
Location: Zagreb, Croatia

Re: Howto open new form via button in FULLSCREEN?

Post by vstarc16 »

I use the folowing code, provided by Drew Jensen

Code: Select all

Declare Function ShowWindow Lib "user32" _
 (ByVal lHwnd As Long, ByVal lCmdShow As Long) As Boolean 

sub MaximizeFrame( aFrame as object ) 
    dim frame 
    dim window 
    dim handle 

    window = aframe.getContainerWindow() 
    handle = window.getWindowHandle(dimarray(), 1) 
        REM 1=WIN32 

    ShowWindow( handle, 3 ) 

end sub 

sub onWhenLoading( oEvent as object ) 
    MaximizeFrame( oEvent.Source.Parent.Parent.CurrentController.Frame) 
end sub
Hope it helps.

Vanja
OOo 3.1.X on Ms Vista
User avatar
NiksaVel
Posts: 91
Joined: Fri Jan 25, 2008 12:00 pm
Location: Croatia

Re: Howto open new form via button in FULLSCREEN?

Post by NiksaVel »

ahem... how do you use it?

I've tried testing it by mapping it to a button, but I got a:

BASIC runtime error
Property or method not found.

and the it's pointing to the

Code: Select all

        window = aframe.getContainerWindow()

I'm currently working via linux... does that have an impact?
OOo 3.1.X on Ubuntu 8.x + Linux Mint 7, Win XP, Vista
User avatar
NiksaVel
Posts: 91
Joined: Fri Jan 25, 2008 12:00 pm
Location: Croatia

Re: Howto open new form via button in FULLSCREEN?

Post by NiksaVel »

ahem... how do you use it? *bump*
OOo 3.1.X on Ubuntu 8.x + Linux Mint 7, Win XP, Vista
tcrabb
Posts: 24
Joined: Mon Apr 28, 2008 4:58 pm

Re: Howto open new form via button in FULLSCREEN?

Post by tcrabb »

I have used Drew's macro code to get form to go into full screen when loading by setting the events tab for each form to load it.

Works well when the main Base window is not set to do preview of each form.

If Base is configured to preview the form (in the drop down menu - None Document, Document Information) then it seems to screw with the whole process in some way resulting in the macro code not executing correctly - goes full screen 80% of the time and fails about 20% of the time.

This is only when the preview is set in the Base main project window - otherwise the macro works well - so thanks.
Post Reply