== KnowledgeBase ==
=== OOBasic / LOBasic / StarOffice Basic ===
==== TopWindow having MenuBar ====
==== Embed multiple components into a single Window ====
'''Site''': http://www.oooforum.org/forum/viewtopic.phtml?t=9883
<pre>
REM  *****  BASIC  *****

global component1
global component2

Sub Main
   On Error goto Main_error
   
   ' Set the globals to Null initially, so that the TopWindowListener can
   ' recognize whether or not they point to valid items, and only run as
   ' appropriate.
   component1 = Null
   component2 = Null
   
   ' Get an AWT toolkit.
   ' OOo's AWT, not a Java AWT.
   oAwtToolkit = CreateUnoService( "com.sun.star.awt.Toolkit" )
   
   ' Create a top level window.
   oTopWindow = CreateTopWindow( oAwtToolkit, 100, 200, 800, 700 )
   
   ' At this point, you should check out the interfaces
   '  and all of the methods that they give you for
   '  manipulating this new oTopWindow.
   ' See comment in CreateTopWindow() below.
   
   ' Create a TopWindowListener
   ' This is necessary to close the OOo Component frames when the window closes,
   ' which is necessary so that OOo doesn't crash.  See details in
   ' TopWindowListener_windowClosing().
   oTopWindowListener = CreateUnoListener( "TopWindowListener_", "com.sun.star.awt.XTopWindowListener" )
   
   ' Add the TopWindowListener to the top-level window
   oTopWindow.addTopWindowListener(oTopWindowListener)
   
   ' Change the background color of the window to baby blue.
   oTopWindow.setBackground( RGB( 240, 240, 255 ) )
   
   ' At this point, if you stop the program, you will have a
   '  new OOo window on the screen, but you cannot do anything
   '  with it.  You cannot even close it!
   ' In fact, you have to kill the OOo process, as even OOo
   '  cannot close this window since it has no Frame and
   '  therefore is not integrated into the desktop environment.
   ' So I had to go on writing additional code....
   
   ' Create a new frame.
   oFrame = CreateUnoService( "com.sun.star.frame.Frame" )
   ' Initialize this frame with our new window.
   oFrame.initialize( oTopWindow )
   ' Tell the frame that its parent is the Desktop.
   oFrame.setCreator( StarDesktop )
   
   ' At this point you have a window that can be resized, moved, or closed.
   
   ' Create a sub-window.
   oSubWindow1 = CreateSubWindow( oAwtToolkit, oTopWindow, 100, 200, 300, 400 )
   
   ' Create a sub-frame.

   oSubFrame1 = CreateUnoService( "com.sun.star.frame.Frame" )
   ' Initialize this frame with our new window.
   oSubFrame1.initialize( oSubWindow1 )
   ' Tell the frame that its parent is the Desktop.
   oSubFrame1.setCreator( oFrame )
   
   ' add subframe to main frame
   oFrame.getFrames().append(oSubFrame1)
   
   
   
   ' Create another sub-window.
   oSubWindow2 = CreateSubWindow( oAwtToolkit, oTopWindow, 450, 200, 300, 400 )
   
   ' Create another sub-frame.
   oSubFrame2 = CreateUnoService( "com.sun.star.frame.Frame" )
   ' Initialize this frame with our new window.
   oSubFrame2.initialize( oSubWindow2 )
   ' Tell the frame that its parent is the Desktop.
   oSubFrame2.setCreator( oFrame )
   
   ' add subframe to main frame
   oFrame.getFrames().append(oSubFrame2)
   

   ' Create a new button.
   oBtnCtrl = MakeButtonCtrl( oAwtToolkit, oTopWindow, "Meow", "file:///c:/tmp/test-small.jpg",_
         MakeRectangle( 20, 30, 100, 40 ) )
   
   ' Now all the windows and sub-windows should be added, sizes set, etc.,
   ' So now, load items into them...
   
   ' Load something into the first frame (oSubFrame1, which we put to the left)
   component1 = oSubFrame1.loadComponentFromURL( "private:factory/simpress", "_self", 0, Array() )

   ' Load something into the second frame (oSubFrame2, which we put to the right)
   component2 = oSubFrame2.loadComponentFromURL( "private:factory/scalc", "_self", 0, Array() )
   
   Exit Sub
   
Main_error:

    MsgBox ("Main: There has been an error in " & sMacroName & ". " & chr(10) _
      & "Error text is: " & Error(Err) & chr(10) _
      & "Line number: " & Erl, 48, "Error Message")
   
End Sub


Sub TopWindowListener_windowOpened(oEventObject)
   ' do nothing
End Sub

Sub TopWindowListener_windowClosing(oEventObject)
   ' In here, we need to close the components using the XClosable interface,
   ' rather than letting the system automatically 'dispose()' of them.
   ' The class documentation says that if XCloseable is supported, then it
   ' should be used in lieu of 'dispose()'.
   '
   ' Tests of this window handler suggest that XCloseable /must/ be used -- if
   ' it isn't, then OpenOffice crashes.
   '
   ' Also note: these components must be closed /very/ quickly!  Introducing
   ' any sort of delay before closing them [even 'wait(100)'] causes OOo to
   ' crash.
   
   ' if the first component exists, close it.
   if not isNull(component1) then
      component1.close(false)
   end if
   
   ' if the second component exists, close it.
   if not isNull(component2) then
      component2.close(false)
   end if
End Sub

Sub TopWindowListener_windowClosed(oEventObject)
   ' do nothing
End Sub

Sub TopWindowListener_windowMinimized(oEventObject)
   ' do nothing
End Sub

Sub TopWindowListener_windowNormalized(oEventObject)
   ' do nothing
End Sub

Sub TopWindowListener_windowActivated(oEventObject)
   ' do nothing
End Sub

Sub TopWindowListener_windowDeactivated(oEventObject)
   ' do nothing
End Sub

Sub TopWindowListener_disposing(oEventObject)
   ' do nothing
End Sub



Function CreateTopWindow( oAwtToolkit, x, y, w, h )

   On Error goto CreateTopWindow_Error
   
   oWindowDesc = CreateUnoStruct( "com.sun.star.awt.WindowDescriptor" )
   With oWindowDesc
      ' specifies a top level window on the desktop. It is also a container.
      .Type = com.sun.star.awt.WindowClass.TOP
      ' is a modal top level window on the desktop. It is also a container.
'      .Type = com.sun.star.awt.WindowClass.MODALTOP
      ' is a container that may contain other components. It is not a top window.
'      .Type = com.sun.star.awt.WindowClass.CONTAINER
      ' is the simplest window. It can be a container.
'      .Type = com.sun.star.awt.WindowClass.SIMPLE
     
      ' specifies the name of the component service.
      ' A zero length name means that the vcl creates a blank top,
      '  a container, or a simple window.
      .WindowServiceName = ""
     
      ' specifies the parent of the component.
      ' If Parent == 0 && ParentIndex == -1 , then the window is on the desktop.
'      .Parent = null
'      .Parent = createUnoValue( "com.sun.star.awt.XWindowPeer", 0 )
'      .Parent = oAwtToolkit.getDesktopWindow()
      ' specifies the index of the parent window, if available.
      ' If Parent == 0 and this struct is a member of an array,
      '  then this is the offset from the beginning of the array to the parent.
      '  A value of -1 means desktop.
'      .ParentIndex = -1
     
      ' specifies the position and size of the window.
      ' This member is ignored if the window attribute is
      '  WindowAttribute::FULLSIZE .
      .Bounds = MakeRectangle( x, y, w, h )
     
      ' specifies the window attributes.
      .WindowAttributes = 0
      ' specifies that the window is initially visible.
      .WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.SHOW
      ' specifies that the window fills the complete desktop area.
'      .WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.FULLSIZE
      ' specifies that the window is optimum size.
'      .WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.OPTIMUMSIZE
      ' specifies that the window is minimum size.
'      .WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.MINSIZE
      ' specifies that the window has visible borders.
      .WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.BORDER
      ' specifies that the size of the window can be changed by the user.
      .WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.SIZEABLE
      ' specifies that the window can be moved by the user.
      .WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.MOVEABLE
      ' specifies that the window can be closed by the user.
      .WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.CLOSEABLE
      '[ DEPRECATED ] specifies that the window should support the XSystemDependentWindowPeer interface.
'      .WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.SYSTEMDEPENDENT
   End With
   
   oXWindowPeer = oAwtToolkit.createWindow( oWindowDesc )
   
   ' Look at the capabilities that these interfaces give you
   '  for manipulating your newly created window.
   ' Interfaces supported by oXWindowPeer...
   '  com.sun.star.awt.XTopWindow
   '  com.sun.star.awt.XWindow
   '  com.sun.star.awt.XWindowPeer
   '  com.sun.star.awt.XVclContainer
   '  com.sun.star.awt.XVclContainerPeer
   '  com.sun.star.awt.XVclWindowPeer
   '  com.sun.star.awt.XLayoutConstraints
   '  com.sun.star.awt.XView
   '  com.sun.star.awt.XDevice
   '  com.sun.star.lang.XEventListener
   '  com.sun.star.lang.XComponent
   '  com.sun.star.lang.XTypeProvider
   '  com.sun.star.accessibility.XAccessible
   '
   ' Properties...
   '  <object> MenuBar
   '  <array>  Windows
   '  <array>  Group
   '  <object> PosSize
   '  Boolean  Visible
   '  Boolean  Enable
   '  <object> Toolkit
   '  <object> Pointer
   '  Long     Background
   '  Boolean  DesignMode
   '  Long     Foreground
   '  <object> ControlFont
   '  <object> MinimumSize
   '  <object> PreferredSize
   '  <object> AccessibleContext
   '  <object> Graphics
   '  <object> Size
   '  <object> Info
   '  <array>  FontDescriptors
   
   CreateTopWindow = oXWindowPeer
   
   Exit Function

CreateTopWindow_Error:

    MsgBox ("CreateTopWindow: There has been an error in " & sMacroName & ". " & chr(10) _
      & "Error text is: " & Error(Err) & chr(10) _
      & "Line number: " & Erl, 48, "Error Message")

End Function


' This method is almost-identical to "CreateTopWindow", above, except that the
' WindowClass is set to CONTAINER, and the window's parent is set to 'parentWindow'.
' For details on what everything is and how it works, see "CreateTopWindow".
Function CreateSubWindow( oAwtToolkit, parentWindow, x, y, w, h )
   oWindowDesc = CreateUnoStruct( "com.sun.star.awt.WindowDescriptor" )
   With oWindowDesc
      ' is a container that may contain other components. It is not a top window.
      .Type = com.sun.star.awt.WindowClass.CONTAINER
     
      ' specifies the name of the component service.
      ' A zero length name means that the vcl creates a blank top,
      '  a container, or a simple window.
      .WindowServiceName = ""
     
      ' specifies the parent of the component.
      .Parent = parentWindow
      ' specifies the index of the parent window, if available.
      ' If Parent == 0 and this struct is a member of an array,
      '  then this is the offset from the beginning of the array to the parent.
      '  A value of -1 means desktop.
'      .ParentIndex = -1
     
      ' specifies the position and size of the window.
      ' This member is ignored if the window attribute is
      '  WindowAttribute::FULLSIZE .
      .Bounds = MakeRectangle( x, y, w, h )
     
      ' specifies the window attributes.
      .WindowAttributes = 0
      ' specifies that the window is initially visible.
      .WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.SHOW
      ' specifies that the window has visible borders.
      .WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.BORDER
   End With
   
   oXWindowPeer = oAwtToolkit.createWindow( oWindowDesc )

   CreateSubWindow = oXWindowPeer
End Function




Function MakeButtonCtrl( oAwtToolkit, oWindow, Optional cLabel, Optional cImageFile, Optional oPosSizeRect )
   ' Create a new button model.
   oButtonModel = CreateUnoService( "com.sun.star.awt.UnoControlButtonModel" )
   
   ' Create a new button control.
   oButtonCtrl = CreateUnoService( "com.sun.star.awt.UnoControlButton" )
   
   ' Tell the control that it has a model.
   oButtonCtrl.setModel( oButtonModel )
   
   ' Tell the control to create its window peer.
   ' (To understand what this means, it is helpful to
   '  read some Java documention about how Java's AWT works
   '  even though we're not working with Java AWT here.)
   ' Basically, this puts something visible onto the window.
   oButtonCtrl.createPeer( oAwtToolkit, oWindow )
   
   If Not IsMissing( cLabel ) Then
      oButtonModel.Label = cLabel
   EndIf
   
   If Not IsMissing( cImageFile ) Then
      oButtonModel.ImageURL = cImageFile
   EndIf
   
   If Not IsMissing( oPosSizeRect ) Then
      oButtonCtrl.setPosSize( _
                  oPosSizeRect.X, oPosSizeRect.Y,_
                  oPosSizeRect.Width, oPosSizeRect.Height,_
                  com.sun.star.awt.PosSize.POSSIZE )
   EndIf
   
   MakeButtonCtrl = oButtonCtrl
End Function


' ripped from Danny's library....

Function MakeRectangle( ByVal nX As Long, ByVal nY As Long,_
                  ByVal nWidth As Long, ByVal nHeight As Long ) As com.sun.star.awt.Rectangle
   oRectangle = createUnoStruct( "com.sun.star.awt.Rectangle" )
   With oRectangle
      .X = nX
      .Y = nY
      .Width = nWidth
      .Height = nHeight
   End With
   MakeRectangle() = oRectangle
End Function
</pre>

==== General Events ====
{| class="wikitable"
|<center>'''Event Name'''</center>
|<center>'''Event Type'''</center>
|<center>'''Descripción Ejecución'''</center>

|-
|Prior To Reset
|EventObject
|Antes que el formulario sea reseteado. El formulario es reseteado cuando el cursos se mueve a la fila insertada

|-
|After Reset
|EventObject
|Luego que el formulario se resetea

|-
|When Loading
|EventObject
|Cuando el formulario es cargado la primera vez

|-
|Before Reloading
|EventObject
|Antes que el formulario es recargado -también cuando se presiona el boton de recarga desde la barra de navegación o programandolo

|-
|When Reloading
|EventObject
|Cuando un formulario es recargado

|-
|Before Unloading
|EventObject
|Antes que inicie el formulario

|-
|When Unloading
|EventObject
|Cuando el formulario se está descargando

|-
|Confirm Deletion
|com.sun.star.sdb.RowChangeEvent
|Cuando un registro es seleccionado para ser eliminado.

|-
|Before Record Action
|com.sun.star.sdb.RowChangeEvent
|Cuando un registro es ingresado, actualizado o eliminado

|-
|After Record Action
|EventObject
|Luego de una accion es ejecutada sobre un registro. Ni antes ni después se se va a ejecutar hasta que se salga del registro modificado o el boton de Grabar sea presionado.

|-
|Before Record Change
|EventObject
|Antes que el formulario despliegue otro registro.

|-
|After Record Change
|
|Después que el formulario despliegue otro registro.

|}
==== Basic IDE ====
* Largo de archivo menor a 64K

== Reset MW pass ==
<pre>
UPDATE user 
SET user_password = CONCAT(':A:', MD5('<password>')) 
WHERE TRIM(CAST(user_email AS CHAR(40)))=<direccion>
</pre>
== KeyTeam ==
{| class="wikitable"
|<center>'''Code'''</center>
|<center>'''Site'''</center>
|<center>'''Eq'''</center>
|-
|850417886
|FZG
|FZG001
|-
|219838925
|FZG
|FZG002
|-
|707325105
|FZG
|FZG010
|-
|161523437
|MMV
|ADMIN
|}