1. 27 Nov, 2021 1 commit
  2. 25 Nov, 2021 1 commit
  3. 20 Nov, 2021 2 commits
  4. 16 Nov, 2021 1 commit
  5. 14 Nov, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_Calc: new OpenRangeSelector() method · b6e5b8ab
      Jean-Pierre Ledure authored
      The method activates the Calc document, opens a non-modal dialog
      with a text box, let the user make a selection in the current
      or another sheet and returns the selected area as a string.
      
      This method does not change the current selection.
      Arguments:
       Title: the title to display on the top of the dialog
       Selection: a default preselection as a String.
         When absent, the first element of the current selection is preselected.
       SingleCell: When True, only a single cell may be selected. Default = False
       CloseAfterSelect: When True (default-, the dialog is closed immediately
         after the selection. When False, the user may change his/her mind
         and must close the dialog manually.
      Returns:
       The selected range as a string, or the empty string
       when the user cancelled the request (close window button)
      
      Example:
       Dim sSelect As String, vValues As Variant
       sSelect = oDoc.OpenRangeSelector("Select a range ...")
       If sSelect = "" Then Exit Function
       vValues = oDoc.GetValue(sSele...
      b6e5b8ab
  6. 11 Nov, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_Calc: new Printf() method · 6839d1df
      Jean-Pierre Ledure authored
      Returns the input string after substitution of its tokens by
      their values in the given range
      
      This method is usually used in combination with SetFormula()
      
      The accepted tokens are:
         - %S   The sheet name containing the range,
                including single quotes when necessary
         - %R1  The row number of the top-left part of the range
         - %C1  The column letter of the top-left part of the range
         - %R2  The row number of the bottom-right part of the range
         - %C2  The column letter of the bottom-right part of the range
      
      The default token character (%) may be modified.
      
      The method is available both for Basic and Python user scripts
      6839d1df
  7. 10 Nov, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_PopupMenu: fix New PopupMenu without event · d6b77614
      Jean-Pierre Ledure authored
      Invoking the service without an event object was supposed to work.
      
      For instance:
      
         Dim myPopup As Object
         Set myPopup = CreateScriptService("PopupMenu", , 300, 300)
      
      This would create the PopupMenu in position (300, 300)
      without an event object... however this does not work.
      Getting an error saying that "Event is EMPTY"
      
      => Add an IsEmpty() test.
      d6b77614
  8. 09 Nov, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_Calc: First/Last * Row/Column/Cell accept sheets and ranges · 4bd33d40
      Jean-Pierre Ledure authored
      The methods
         FirstCell
         FirstColumn
         FirstRow
         LastCell
         LastColumn
         LastRow
         SheetName
      accept uniformly either a sheet name or a range name.
      They return a single cell as an absolute address (First/LastCell),
      a String (SheetName) or a Long.
      
      The range name is to be understood as the extended notation for ranges.
      
      FirstCell/Column/Row accept sheet names. However they will then always return
      either the "A1" cell or the value 1.
      
      The LastCell/Column/Row return the real last xxx for ranges, and
      the last USED xxx when the argument is a sheet.
      
      The A1Style() method surrounds from now on sheet names
      with single quotes only when necessary.
      
      The GetRangeAddress() method has been dropped as redundant with the actual
      methods. (Was new in 7.3 => no effect on upward compatibiity)
      4bd33d40
  9. 04 Nov, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_Calc: _ParseAddress() reuse last parsed address · bf767666
      Jean-Pierre Ledure authored
      Implementation to improve performance of a simple
      cache of the last already parsed range.
      
      The address is reused when the sheet name is explicit and that
      the range to parse, as a string, is identical to the
      previous parsing request.
      bf767666
  10. 03 Nov, 2021 1 commit
  11. 01 Nov, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_Calc: new GetRangeAddress() method · eae855e0
      Jean-Pierre Ledure authored
      The GetRangeAddress() method accepts 2 arguments:
        GetRangeAddress(Range, AddressItem)
      
      - a range as a string, to be understood as the extended definition
        described in the help pages
      
      - the item to be extracted from the given range, either:
          firstrow
          firstcol
          lastrow
          lastcol
          sheet
      
      The returned value is either:
      - a Long
      - a String when sheet is requested
      - an array of all these values when no item is given
      
      The method is available for both Basic and Python user scripts
      eae855e0
  12. 31 Oct, 2021 2 commits
    • Jean-Pierre Ledure's avatar
      SF_Calc: ShiftDown, ShiftLeft, ShiftRight, ShiftUp methods Python part · 399ba908
      Jean-Pierre Ledure authored
      scriptforge.py was missing in previous commit
      399ba908
    • Jean-Pierre Ledure's avatar
      SF_Calc: new ShiftDown, ShiftLeft, ShiftRight, ShiftUp methods · 778b4596
      Jean-Pierre Ledure authored
      ShiftRight() and ShiftDown() insert empty cells at the left/on the top of
      a given range and move all cells at the right/bottom of the range
      accordingly.
      They are similar to the Insert Cells ... menu commands
      
      ShiftLeft() and ShiftUp() delete cells at the left/top of a given
      range and move all cells at the right/below the range
      accordingly.
      They are similar to the Delete Cells ... menu commands
      
      The insertion/deletion may be done for a whole column/row.
      
      The number of columns/rows to insert/delete may be chosen.
      
      All methods are available in Basic and Python user scripts.
      778b4596
  13. 28 Oct, 2021 1 commit
  14. 27 Oct, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_Calc: new XSheetCellCursor property · 491b84f3
      Jean-Pierre Ledure authored
      The XSheetCellCursor property requires one mandatory argument,
      a range as a string.
      
      It returns a UNO object of type com.sun.star.sheet.XSheetCellCursor.
      Such an object is designed to navigate thru the spreadsheet.
      
      After the user script has used one or more navigation verbs
      (gotoNext(), ...) the resulting range can be got back in the
      script by using the cursor.AbsoluteName UNO property.
      The new range can be given as input to further ScriptForge
      methods.
      
      XSheetCellCursor is available both from Basic and Python user scripts.
      491b84f3
  15. 26 Oct, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_Calc: new Region() property · 29b96eb4
      Jean-Pierre Ledure authored
      The Region() property expects one mandatory argument,
      a range given as a string.
      
      It returns a new range as a string, including the sheet name,
      corresponding with the smallest area
      - containing the input range
      - completely surrounded with empty cells
      
      It is complementary to Offset() and A1Style() to make the
      definition of ranges easy.
      
      The property is available both in Basic and Python user scripts.
      29b96eb4
  16. 23 Oct, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_Calc: new A1Style() method · 7b5feda8
      Jean-Pierre Ledure authored
      Returns a range expressed in A1-style as defined by its coordinates
      If only one pair of coordinates is given, the range will embrace only a single cell
      
      Arguments:
         Row1 : the row number of the first coordinate
         Column1 : the column number of the first coordinates
         Row2 : optional, the row number of the second coordinate
         Column2 : optional, the column number of the second coordinates
         SheetName: Default = the current sheet. If present, the sheet must exist
      
      Is complementary to the Offset() method to compute ranges easily
      
      Available both from Basic and Python user scripts
      7b5feda8
  17. 15 Oct, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SFWidgets: new library, new popup menu service · 95310316
      Jean-Pierre Ledure authored
      The SFWidgets library is intended to host the Toolbar,
      ToolbarControl (both future) and PopupMenu services.
      
      A popup menu is usually triggered by a mouse action
      (typically a right-click) on a dialog, a form, or one of their controls.
       In this case the menu will be displayed below the clicked area.
      When triggered by other events, including in the normal flow
      of a user script, the script should provide the coordinates
      of the topleft edge of the menu versus the actual component.
      
      The menu is described from top to bottom with next methods:
         AddItem()
         AddCheckBox()
         AddRadioButton()
      Example:
         .AddCheckBox("View>Toolbars>Dialog")
         .AddCheckBox("View>Toolbars>Find", STatus := True)
         .AddCheckBox("View>Status Bar", STatus := True)
         .AddItem("View>Full Screen", Name := "FULLSCREEN")
      The SubmenuCharacter (Default = ">" is modifiable.
      
      Each menu item receives a numeric and a string identifier.
      The execute() method returns the item selected by the user.
      
      The service is available both from Basic and Python user scripts.
      95310316
  18. 14 Oct, 2021 2 commits
  19. 02 Oct, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_Platform: increase speed of Fonts property · 86bd9d5b
      Jean-Pierre Ledure authored
      Tests have proven that the use of a case sensitive search
      on long strings improves significantly the execution
      performance.
      
      The number of fonts being potentially huge (2-3K), the change
      in the InStr() Basic function of the Compare argument
      can divide the execution duration by factors in the range > 5.
      86bd9d5b
  20. 28 Sep, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_Platform: new Fonts property · 9f0ebcad
      Jean-Pierre Ledure authored
      The Fonts property returns the list of available fonts
      as an unsorted array of unique font names
      
      The size of the array being potentially huge, the choice
      has been made to not sort the list at each invocation
      of the property.
      To get it sorted, use the SF_Array.Sort() method.
      
      The property is available both from Basic and Python scripts.
      9f0ebcad
  21. 21 Sep, 2021 1 commit
  22. 02 Sep, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_L10N/SF_Dialog: AddTextsFromDialog() and GetTextsFromL10N() · ad36f8ba
      Jean-Pierre Ledure authored
      The objective is to facilitate the automatic translation of
      all fixed texts in dialogs and dialog controls.
      
      Concerned items are:
      - the title of the dialog
      - the caption associated with next control types:
        Button, CheckBox, FixedLine, FixedText, GroupBox and RadioButton
      - the content of list- and comboboxes
      - the tip- or helptext displayed when the mouse is hovering the control
      
      ScriptForge.SF_L10N.AddTextsFromDialog(dialog)
        store all fixed texts of the dialog in the list of translatable strings
        of a L10N object to prepare a POT file
      
      SFDialogs.Dialog.GetTextsFromL10N(l10n)
        get the translated versions of all fixed texts in the dialog from
        a L10N object and apply them on the dialog before display
      
      Both methods are executable from Basic and Python user scripts
      ad36f8ba
  23. 30 Aug, 2021 4 commits
  24. 27 Aug, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_DialogControl: add management of table controls in dialogs · cae588f0
      Jean-Pierre Ledure authored
      With the method SetTableData(), feed a tablecontrol
      with a sortable and selectable array of data.
      Columns and rows may receive a header.
      Column widths are adjusted manually by the user or
      with the same method.
      Alignments can be set as well by script.
      
        oControl.SetTableData(DataArray, Widths, Alignments)
          DataArray: the set of data to display in the table control,
            including optional column/row headers
            Is a 2D array in Basic, is a tuple of tuples inPython
          Widths: the column's relative widths as a 1D array,
            each element corresponding with a column.
            If the array is shorter than the number of columns,
            the last value is kept for the next columns.
            Example:
              Widths := Array(1, 2)
            means that the first column is half as wide as all
            the other columns.
            When the argument is absent, the columns are evenly
            spreaded over the control.
          Alignments: the column's horizontal alignment as a string
            with length = number of columns.
            Possible characters are:
              L(EFT), C(ENTER), R(IGHT) or space (default behaviour)
            Default: LEFT for strings, RIGHT for numbers
      
      Impact on existing properties: ListIndex, Value
      New properties: XGridColumnModel, XGridDataModel
      
      All properties and methods are available from user
      scripts written either in Basic or in Python.
      cae588f0
  25. 19 Aug, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      PDF Export: getting/setting options, export documents as PDF files · 1e846d2b
      Jean-Pierre Ledure authored
      Next methods are introcued in SF_Session:
        - GetPDFExportOptions to extract a dictionary of the
          40+ existing options for PDF export
        - SetPDFExportOptions to update the existing options
          When applied the options are permanent also for user manual exports
      Those methods are not available in Python.
      
      Next method to export a document to PDF:
        - ExportAsPDF: it uses the options set above and/or takes
          next specific and transitional options:
            pages, password, watermark
      This method is implemented for use from Basic and Python
      1e846d2b
  26. 01 Aug, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_Chart: new service to manage Calc charts · 7abf8ae8
      Jean-Pierre Ledure authored
      New methods in the SF_Calc service:
        Charts(), to list charts or to instantiate a chart service
        CreateChart, to create a new chart in a given Calc sheet
      
      The SF_Chart service has next properties to parameter the type
      and the characteristics of the (new or pre-existing) chart
        ChartType, Deep, Dim3d, Exploded, Filled, Legend, Percent, Stacked,
        Title, XTitle, YTitle
      Next methods are available:
        Resize, to move and resize the chart shape
        ExportToFile, to export the chart as a graphical object
          Supported: gif, jpeg, png, svg and tiff
      
      New error messages in SF_Root and SF_Exception.
      Corresponding labels are integrated in the POT file
      
      Full support under Basic and Python
      
      Review of make file of the SFDocuments library
      7abf8ae8
  27. 23 Jul, 2021 1 commit
  28. 22 Jul, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      scriptforge.py/CreateScriptService: allow keyword arguments · 8d3e0c9d
      Jean-Pierre Ledure authored
      For Python scripts only:
      
      the CreateScriptService() method accepts now both positional
      (as before) and keyword arguments.
      
      The impacted services are:
      - l10n
      - timer
      
      Done with the ReviewServiceArgs() class method that returns the
      input arguments as a tuple in the correct sequence. This method
      is inserted in each of the impacted service definitions.
      8d3e0c9d
  29. 13 Jul, 2021 2 commits
    • Jean-Pierre Ledure's avatar
      SF_Base: new CloseFormDocument() method · fa3bf56a
      Jean-Pierre Ledure authored
      The closure of a form document is available from
      the SF_Form service.
      
      A form document is since recent commits associated with
      actions like PrintOut() that do not require to access
      its internal forms.
      
      As a consequence, the closure of a form document from
      the SF_Base service gains in relevance.
      
      Hence the actual commit.
      fa3bf56a
    • Jean-Pierre Ledure's avatar
      SF_L10N: FIX return value of AddText() · 41ed7182
      Jean-Pierre Ledure authored
      Return value should be True when successful.
      Was erroneously False.
      
      Minor bug. No correction  in 7.1 and 7.2
      41ed7182
  30. 12 Jul, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SFDocuments: new PrintOut() method · 2275b261
      Jean-Pierre Ledure authored
      The PrintOut() method launches the printing of a
      LO document to a printer previously defined by default,
      by the user or by the SetPrinter() method.
      
      It is applicable on any document, on a Calc sheet, a Base form
      document. For a Writer document specific arguments may
      be provided.
      
      Implemented both for Basic and Python scripts.
      2275b261
  31. 09 Jul, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SFDocuments: new SetPrinter() method · ddc5c732
      Jean-Pierre Ledure authored
      The SetPrinter() method is applicable to any document type,
      except Base documents.
      It is also applicable to Base form documents.
      
      The method defines next printer settings:
      - the printer name
      - the orientation
      - the paper format
      
      The settings are kept per document or form document
      
      To bypass array management troubles in Basic,
      the SF_Utils._SetPropertyValue() Sub is converted to a Function.
      (no user scripts impact, only internal use).
      ddc5c732
  32. 07 Jul, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SF_Writer: move Forms() method from SF_Document · 84a337da
      Jean-Pierre Ledure authored
      The Forms() method was placed in the SF_Document service
      but was applicable only on Writer documents
      
      Now it is placed correctly in the recently created Writer service.
      Effective in Basic and Python.
      
      Additionally redundant parentheses have been removed in scriptforge.py
      84a337da
  33. 06 Jul, 2021 1 commit
    • Jean-Pierre Ledure's avatar
      SFDocuments: new SF_Writer service · ecf7e5ab
      Jean-Pierre Ledure authored
      Addition of the skeleton of the new SF_Writer service
      as a subclass of SF_Document.
      
      Entry points in CreateScriptService are provided
      both for Basic and Python user scripts.
      
      Full compatibility with existing user scripts.
      
      Specific properties and methods will be provided in mater
      commits.
      ecf7e5ab