'encoding UTF-8 Do not remove or change this line! '************************************************************************** ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ' ' Copyright 2000, 2010 Oracle and/or its affiliates. ' ' OpenOffice.org - a multi-platform office productivity suite ' ' This file is part of OpenOffice.org. ' ' OpenOffice.org is free software: you can redistribute it and/or modify ' it under the terms of the GNU Lesser General Public License version 3 ' only, as published by the Free Software Foundation. ' ' OpenOffice.org is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU Lesser General Public License version 3 for more details ' (a copy is included in the LICENSE file that accompanied this code). ' ' You should have received a copy of the GNU Lesser General Public License ' version 3 along with OpenOffice.org. If not, see ' ' for a copy of the LGPLv3 License. ' '/************************************************************************ ' ** ' ** owner : joerg.skottke@sun.com ' ** ' ** short description : Tools to draw and select form controls in basic-ide ' ** '\****************************************************************************** public const ICONTROLCOUNT = 22 function hGetControlParams( cParam as string ) as integer '///

Retrieve basic parameters to draw formcontrols to a dialog

'///All values are in percent relative to the window size. '///+ All values are optimized for 1024x768 pixels screen resolution but '///+ have been tested successfully with 1280x1024 and 800x600
'///In most cases it is desired to place multiple controls on a single '///+ dialog pane. To prevent the controls from overlapping each other '///+ they are arranged in rows and columns. Each control is identified '///+ by a unique number (see description for hInsertControl(...)). The '///+ dimensions are defined in hGetControlParams(...). The coordinates '///+ returned by this function can be used to draw and to select a control.
'///Input: '///
    '///+
  1. Name of the coordinate (string). Valid options are:
  2. '/// '///
'///Returns: '///
    '///+
  1. Coordinate/Distance/Size in percent of window size (integer)
  2. '/// '///
'///Description: '/// end function '******************************************************************************* function hGetControlName( iControl as integer ) as string '///

A function to deliver a speaking name for all form controls

'///Note that the numbers of the controls are unique
'///In most cases it is desired to place multiple controls on a single '///+ dialog pane. To prevent the controls from overlapping each other '///+ they are arranged in rows and columns. Each control is identified '///+ by a unique number (see description for hInsertControl(...)). The '///+ dimensions are defined in hGetControlParams(...). The coordinates '///+ returned by this function can be used to draw and to select a control.
'///Input: '///
    '///+
  1. Number of the control (integer)
  2. '/// '///
'///Returns: '///
    '///+
  1. Name for a control (string)
  2. '/// '///
'///Description: '/// end function '******************************************************************************* function hInsertControl( iControl as integer ) as string '///

Function to insert one of the BASIC formcontrols by index

'///Note that the numbers of the controls are unique
'///In most cases it is desired to place multiple controls on a single '///+ dialog pane. To prevent the controls from overlapping each other '///+ they are arranged in rows and columns. Each control is identified '///+ by a unique number (see description for hInsertControl(...)). The '///+ dimensions are defined in hGetControlParams(...). The coordinates '///+ returned by this function can be used to draw and to select a control.
'///Input: '///
    '///+
  1. Number of the control (integer)
  2. '/// '///
'///Returns: '///
    '///+
  1. Name for a control (string)
  2. '/// '///
'///Description: '/// end function '******************************************************************************* function hDrawControlOnDialog( iControl as integer ) as string '///

Draw a control on a dialog at a fixed position

'///Note that the numbers of the controls are unique
'///In most cases it is desired to place multiple controls on a single '///+ dialog pane. To prevent the controls from overlapping each other '///+ they are arranged in rows and columns. Each control is identified '///+ by a unique number (see description for hInsertControl(...)). The '///+ dimensions are defined in hGetControlParams(...). The coordinates '///+ returned by this function can be used to draw and to select a control.
'///Input: '///
    '///+
  1. Number of the control (integer)
  2. '/// '///
'///Returns: '///
    '///+
  1. Name for a control (string)
  2. '/// '///
'///Description: '/// end function '******************************************************************************* function hDrawControl( xPos as integer, _ yPos as integer, _ xEnd as integer, _ yEnd as integer ) as boolean '///

Draw a control on the dialog pane in the dialog editor

'///Starting point: Basic IDE/Dialog editor
'///In most cases it is desired to place multiple controls on a single '///+ dialog pane. To prevent the controls from overlapping each other '///+ they are arranged in rows and columns. Each control is identified '///+ by a unique number (see description for hInsertControl(...)). The '///+ dimensions are defined in hGetControlParams(...). The coordinates '///+ returned by this function can be used to draw and to select a control.
'///Note: All units are in percent of the relative to the current window size
'///Input: '///
    '///+
  1. X-Orego (Upper left corner) (integer)
  2. '/// '///+
  3. Y-Orego (Upper left corner) (integer)
  4. '/// '///+
  5. X-End (Lower right corner) (integer)
  6. '/// '///+
  7. Y-End (Lower right corner) (integer)
  8. '/// '///
'///Returns: '///
    '///+
  1. Errorstatus (boolean)
  2. '/// '///
'///Description: '/// DialogWindow.MouseUp( 20 , 20 ) try DialogWindow.MouseDown ( xPos, yPos ) DialogWindow.MouseMove ( xEnd, yEnd ) DialogWindow.MouseUp ( xEnd, yEnd ) hDrawControl() = true catch warnlog( "#i39852# " & CFN & "Unable to complete mouseactions on dialog" ) hDrawControl() = false endcatch end function '******************************************************************************* function hGetControlPosXO( iControl as integer ) as integer '///

Retrieve the upper left X-coordinate for a control

'///In most cases it is desired to place multiple controls on a single '///+ dialog pane. To prevent the controls from overlapping each other '///+ they are arranged in rows and columns. Each control is identified '///+ by a unique number (see description for hInsertControl(...)). The '///+ dimensions are defined in hGetControlParams(...). The coordinates '///+ returned by this function can be used to draw and to select a control.
'///Input: '///
    '///+
  1. Number of the control (integer)
  2. '/// '///
'///Returns: '///
    '///+
  1. X-Orego in percent of window size (integer)
  2. '///
'///Description: '/// if ( iControl <= 6 ) then hGetControlPosXO() = xOffset elseif( ( iControl >= 7 ) and ( iControl <= 12 ) ) then hGetControlPosXO() = xOffset + 1 * xDistance elseif( ( iControl >= 13 ) and ( iControl <= 18 ) ) then hGetControlPosXO() = xOffset + 2 * xDistance else hGetControlPosXO() = xOffset + 3 * xDistance endif end function '******************************************************************************* function hGetControlPosYO( iControl as integer ) as integer '///

Retrieve the upper left Y-coordinate for a control

'///In most cases it is desired to place multiple controls on a single '///+ dialog pane. To prevent the controls from overlapping each other '///+ they are arranged in rows and columns. Each control is identified '///+ by a unique number (see description for hInsertControl(...)). The '///+ dimensions are defined in hGetControlParams(...). The coordinates '///+ returned by this function can be used to draw and to select a control.
'///Input: '///
    '///+
  1. Number of the control (integer)
  2. '/// '///
'///Returns: '///
    '///+
  1. Y-Orego in percent of window size (integer)
  2. '///
'///Description: '/// select case iControl case 1 , 7 , 13 , 19 : hGetControlPosYO() = yOffset case 2 , 8 , 14 , 20 : hGetControlPosYO() = yOffset + 1 * yDistance case 3 , 9 , 15 , 21 : hGetControlPosYO() = yOffset + 2 * yDistance case 4 , 10 , 16 , 22 : hGetControlPosYO() = yOffset + 3 * yDistance case 5 , 11 , 17 : hGetControlPosYO() = yOffset + 4 * yDistance case 6 , 12 , 18 : hGetControlPosYO() = yOffset + 5 * yDistance end select end function '******************************************************************************* function hGetControlPosXE( iControl as integer ) as integer '///

Retrieve the lower right X-coordinate for a control

'///In most cases it is desired to place multiple controls on a single '///+ dialog pane. To prevent the controls from overlapping each other '///+ they are arranged in rows and columns. Each control is identified '///+ by a unique number (see description for hInsertControl(...)). The '///+ dimensions are defined in hGetControlParams(...). The coordinates '///+ returned by this function can be used to draw and to select a control.
'///Input: '///
    '///+
  1. Number of the control (integer)
  2. '/// '///
'///Returns: '///
    '///+
  1. X-End in percent of window size (integer)
  2. '///
'///Description: '/// end function '******************************************************************************* function hGetControlPosYE( iControl as integer ) as integer '///

Retrieve the lower right Y-coordinate for a control

'///In most cases it is desired to place multiple controls on a single '///+ dialog pane. To prevent the controls from overlapping each other '///+ they are arranged in rows and columns. Each control is identified '///+ by a unique number (see description for hInsertControl(...)). The '///+ dimensions are defined in hGetControlParams(...). The coordinates '///+ returned by this function can be used to draw and to select a control.
'///Input: '///
    '///+
  1. Number of the control (integer)
  2. '/// '///
'///Returns: '///
    '///+
  1. Y-End in percent of window size (integer)
  2. '///
'///Description: '/// end function '******************************************************************************* function hGetControlPosXM( iControl as integer ) as integer '///

Retrieve the center (X) of a control

'///In most cases it is desired to place multiple controls on a single '///+ dialog pane. To prevent the controls from overlapping each other '///+ they are arranged in rows and columns. Each control is identified '///+ by a unique number (see description for hInsertControl(...)). The '///+ dimensions are defined in hGetControlParams(...). The coordinates '///+ returned by this function can be used to draw and to select a control.
'///Input: '///
    '///+
  1. Number of the control (integer)
  2. '/// '///
'///Returns: '///
    '///+
  1. X-Center in percent of window size (integer)
  2. '///
'///Description: '/// end function '******************************************************************************* function hGetControlPosYM( iControl as integer ) as integer '///

Retrieve the center (Y) of a control

'///In most cases it is desired to place multiple controls on a single '///+ dialog pane. To prevent the controls from overlapping each other '///+ they are arranged in rows and columns. Each control is identified '///+ by a unique number (see description for hInsertControl(...)). The '///+ dimensions are defined in hGetControlParams(...). The coordinates '///+ returned by this function can be used to draw and to select a control.
'///Input: '///
    '///+
  1. Number of the control (integer)
  2. '/// '///
'///Returns: '///
    '///+
  1. Y-Center in percent of window size (integer)
  2. '///
'///Description: '/// end function '******************************************************************************* function hSelectControl( iControl as integer ) as boolean '///

Function to select one of the BASIC formcontrols by index

'///Note: Refer to the inline documentation for implementation details
'///In most cases it is desired to place multiple controls on a single '///+ dialog pane. To prevent the controls from overlapping each other '///+ they are arranged in rows and columns. Each control is identified '///+ by a unique number (see description for hInsertControl(...)). The '///+ dimensions are defined in hGetControlParams(...). The coordinates '///+ returned by this function can be used to draw and to select a control.
'///Input: '///
    '///+
  1. Number of the control (integer)
  2. '/// '///
'///Returns: '///
    '///+
  1. Errorstatus (boolean)
  2. '/// '///
'///Description: '/// end function