Recent

Author Topic: IBX for Lazarus 1.2 now available as a pre-release  (Read 12598 times)

tonyw

  • Sr. Member
  • ****
  • Posts: 319
    • MWA Software
IBX for Lazarus 1.2 now available as a pre-release
« on: February 26, 2015, 01:00:34 pm »
MWA Software is pleased to announce that Release 1.2 of IBX for Lazarus is now available as a pre-release. This version has a minimum support requirement of Lazarus 1.4 RC1/Free Pascal 2.6.4 and will not compile with earlier releases of Lazarus.

This release includes an internal SQL Parser supporting simple construction of dynamic queries e.g. using user selectable filters. It also includes three new controls making use of the parser. These are:

    TIBLookupComboEditBox

    TIBDynamicGrid

    TIBTreeview

See http://www.mwasoftware.co.uk/ib-controls

TIBLookupComboEditBox is a TDBLookupComboBox descendent that implements "autocomplete" of typed in text and "autoinsert" of new entries. Autocomplete uses SQL manipulation to revise the available list and restrict it to items that are prefixed by the typed text (either case sensitive or case insenstive). Autoinsert allows a newly typed entry to be added to the list dataset and included in the available list items.

TIBDynamicGrid is a TDBGrid descendent that provides for:

  • automatic resizing of selected columns to fill the available row length
  • automatic positioning and sizing of a "totals" control, typically at the column footer, on a per column basis.
  • DataSet resorting on header row click, sorting the dataset by the selected column. A second click on the same header cell reversed the sort order.
  • Support for a "Panel Editor". That is on clicking the indicator column, the row is automatically expanded and a panel superimposed on it. The panel can have any number of child controls, typically data aware controls with the same datasource as the grid allowing for editing of additional fields and more complex editors.
  • Reselection of the same row following resorting.
  • A new cell editor that provides the same functionality as TIBLookupComboEditBox. Its properties are specified on a per column basis and allows for one or more columns to have their values selected from a list provided by a dataset. Autocomplete and autoinsert are also available. The existing picklist editor is unaffected by the extension.

TIBTreeView is a data aware TCustomTreeView.

Examples are provided to illustrate the use of the new controls.

Feedback and comments are welcome

patyi

  • Full Member
  • ***
  • Posts: 168
Re: IBX for Lazarus 1.2 now available as a pre-release
« Reply #1 on: February 26, 2015, 09:13:00 pm »
Thanks and congratulation ! Impressive !  :D

Hey you are one step far with your TIBDynamicGrids "Panel Editor" from DBCtrlgrid !!!  :P

Are you thinking about making DBCtrlGrid component ?  O:-)

GaborBoros

  • New Member
  • *
  • Posts: 21
Re: IBX for Lazarus 1.2 now available as a pre-release
« Reply #2 on: March 09, 2015, 09:09:55 am »
Hi Tony,

Parser is a very nice feature! Thank You!

Please add SQL_BOOLEAN(32764) support to 1.2.

tonyw

  • Sr. Member
  • ****
  • Posts: 319
    • MWA Software
Re: IBX for Lazarus 1.2 now available as a pre-release
« Reply #3 on: March 09, 2015, 10:04:45 am »
Gabor,

SQL_BOOLEAN is a Firebird 3 feature - although I suppose it could be added before the new API is stable enough to support.

Oddly, I googled SQL_BOOLEAN to see what others might have done and came across this file: http://visual-t.ru/files/IBCustomDataSet.pas. It seems that someone has gone to the bother of updating IBX for Lazarus for SQL_BOOLEAN and publishing it but without submitting a patch. Any ideas?



tonyw

  • Sr. Member
  • ****
  • Posts: 319
    • MWA Software
Re: IBX for Lazarus 1.2 now available as a pre-release
« Reply #4 on: March 09, 2015, 10:07:49 am »
Patyl,

"Are you thinking about making DBCtrlGrid component ?"

Apologies for not replying earlier, but I thought I would look into this before responding. The answer is that I have been able to adapt the idea to make a Delphi DBCtrlGrid lookalike. It seems to work very well and I hope to make it available in the next couple of days.

tonyw

  • Sr. Member
  • ****
  • Posts: 319
    • MWA Software
Re: IBX for Lazarus 1.2 now available as a pre-release
« Reply #5 on: March 14, 2015, 01:12:23 pm »
MWA Software is pleased to announce that IBX For Lazarus 1.2.2 is now available as a pre-release. This release includes several user suggested enhancements including a Delphi Control Grid lookalike (TDBControlGrid). Although packaged in with IBX, there are no IBX dependencies in the Control Grid which should work with any TDataSet based component set.

This release builds on 1.2 and is requires Lazarus 1.4 RC2.

Download from http://www.mwasoftware.co.uk/downloads/category/16-pre-release-1-2

The changelog for this version is:

1.  A new IBControl - TDBControlGrid has been added. TDBControlGrid a lookalike
    rather than a clone for the Delphi TDBCrtlGrid. TDBControlGrid is a single column grid
    that replicates a TWinControl - typically a TPanel or a TFrame in each row. Each row
    corresponds to a row of the linked DataSource. Any data aware control on the
    replicated (e.g.) TPanel will then appear to have the appropriate value for the row.

2. As suggested by Julio Jiménez, a new property "SQLHourGlass" has been added to TIBDatabase.
   When set to false (default true), the Hour Glass cursor is supcpressed and no cursor change
   takes place during database access. This may be useful when there are performance issues with
   the change of cursor. Setting the property to false suppresses the change of cursor.

3. As suggested by Julio Jiménez, a new property "AutoCommit" has been added to TIBDataSet, TIBQuery
   and TIBTable. When set to acCommitRetaining (Default: acDisabled), a call is made to
   Transaction.CommitRetaining immediately after every Post or Delete. This has the effect of
   making all changes permanent immediately rather than when the transaction is explicitly
   committed.

4. Experimental support for the Firebird 3 SQL_BOOLEAN type has been added while still
   using the legacy Firebird API. Thanks to Gabor Boros for helping to test this feature.

patyi

  • Full Member
  • ***
  • Posts: 168
Re: IBX for Lazarus 1.2 now available as a pre-release
« Reply #6 on: March 14, 2015, 09:31:28 pm »
Hi Tony,

Yes ! Wonderful job !  :D
In most cases single column TDBControlGrid do the job, thanks for that, amazing progression !
There's a chance that multiple columns can be one in the future ?  O:-)

mse

  • Sr. Member
  • ****
  • Posts: 286
Re: IBX for Lazarus 1.2 now available as a pre-release
« Reply #7 on: March 15, 2015, 09:15:57 am »
There's a chance that multiple columns can be one in the future ?  O:-)
tdbwidgetgrid from MSEide+MSEgui project supports this. There one places tdb*edit widgets (tdbintegeredit,tdbstringedit...) at design time into the grid widget; every widget forms a data column. There is also twidgetgrid with similar functionality without DB-backend.
Source is here:
https://gitlab.com/groups/mseide-msegui

tonyw

  • Sr. Member
  • ****
  • Posts: 319
    • MWA Software
Re: IBX for Lazarus 1.2 now available as a pre-release
« Reply #8 on: April 14, 2015, 03:29:50 pm »
Version 1.2.3 is now available for download from

http://www.mwasoftware.co.uk/downloads/category/16-pre-release-1-2.

This is still a pre-release and will remain so until Lazarus 1.4 is released (IBX 1.2.x is dependent on Lazarus 1.4). Many thanks to those that have commented on and reported bugs with 1.2.2. Release notes follow:

IBX Change Log  version                                                          (1.2-3) Tue, 14 Apr 2015 14:11:17 +0100

1.  TIBStoredProc. Prepare now called by ParamByName to avoid need to always
    call Prepare before setting parameter values.

2.  Error message on ParamByName (all cases) not found now includes name of missing parameter.

3.  Code tidyup and more robust handling of dsql information result vector.

4.  Support for centralised handling of transaction status changes. TIBTransaction
    has been given additional events "AfterEdit", "AfterInsert", "AfterDelete", "AfterPost"
    and "AfterExecQuery". The first three are called after the same event is called
    for an IBCustomDataSet descendent using the Transaction. The fourth is called
    after a call to TIBSQL.ExecQuery, again using this transaction. These new events
    enable monitoring of transaction status changes for a given transaction to be
    handled in a single place. For example, when a change to the dataset occurs
    an indicator can be set that shows the user that in order to save changes,
    the transaction should be committed.  Rather than doing this per dataset, this
    can now be done per transaction.

5.  TDataSet.CheckBrowseMode automatically posts changes to the current row when
    the dataset is scrolled. However, any changes to the current row are, by default,
    discarded when the dataset is closed. TIBDataSet, TIBQuery and TIBTable now
    have a new property "DataSetCloseAction" that adds automatic posting of changes
    on dataset close. If this property is set to dcDiscardChanges (default) then the
    behaviour is unchanged from previous versions. if the value is set to dcSaveChanges
    then IBX will attempt to post any unsaved changes before the dataset is closed
    (and after the BeforeClose event handler is called). The exception is when the
    dataset is being closed as a result of a transaction rollback. In this case,
    no action is taken and any unsaved  changes are discarded. This avoids both
    unnecessary overhead and the risk that a validation error may occur in the Post
    raising an exception and thereby preventing a rollback.

6.  String Field sizes and Display Widths should now be correct for multi-byte character sets.
    In earlier versions, the Display Width was set to the maximum byte width rather than the character
    width. Display Widths are now corrected by dividing by the max byte width per character.
    For UTF8 character sets, the byte width is four and hence the Display Width will be
    the byte width divided by 4. The byte width of each character set is determined
    dynamically when the database connection is estabished from the RDB$CHARACTER_SETS
    system table. (see also http://bugs.freepascal.org/view.php?id=27766).

7.  SQLParser will now correctly parse SQL Text which contains ':' within quoted string.

8.  IBLookupComboEditBox: List should now always be restored to full list when the
    control loses focus. Default Key press default interval reduced to 200ms.

9.  DBControlGrid: Ensure that selection is changed to newly appended row, even
    when dataset rows are less than visible rows.

10. IBDynamicGrid: Editor Panel is not shown on indicator click if Datasource
    does not exist or DataSet is empty. More responsive on dataset open. New event
    OnRestorePosition. Column sort disabled if no header row.

11. IBTreeView: improved handling of response to "Add Node". Avoid scrolling dataset
    while dataset state is dsInsert. Avoids posting errors.

12. IBControls: New mechanism for distributing UpdateSQL and UpdateParams events. This is to
    avoid conflict with DisableControls/EnableControls with Master/Detail linked tables.

13. IBLookupComboEditBox: Now avoids SQL Errors when combo box text contains single quotes.

14. TIBDataSet and TIBQuery: new Event - OnValidatePost. This event has been introduced
    to solve a specific problem. That is when the dataset cursor is moved (e.g. by
    a grid mouse click and the current row is being edited or inserted. In this case, TDataset
    always "posts" the current record regardless or whether or not it may be more appropriate
    to cancel any changes; the post occurs before the "BeforeScroll" event fires due to the way the
    "MoveBy" function is implemented by TDataSet. The OnValidatePost event is called
    as the first action of the "Post" method and allows the handler to convert the Post
    into a Cancel if that is the appropriate action on moving to a different row. This is
    achieved by returning with "CancelPost" argument set to true. Note that an exception could be
    raised here, but it may still be more appropriate to validate a post and signal
    a problem in the "BeforePost" event handler. See readme.automaticposts.xhtml)

15. On Unix derived systems, the Firebird library name can now be given as a colon
    separated list. Each library name on the list is tried in turn, in left to right
    order with the first found being used as the firebird library. By default, on Linux,
    the library name list is 'libfbembed.so.2.5:libfbembed.so.2.1:libfbclient.so.2'. This can be
    overidden by the FBLIB environment variable or the OnGetLibraryName function.

    Note: when using the libfbembed.so, if you prefix the database name with "localhost:"
    then it will still attempt to access the database via the Firebird Server and will
    require a username and password. If only the pathname is given, then the username
    and password should be omitted and the unix file permissions are used to grant
    access.

jujibo

  • Full Member
  • ***
  • Posts: 114
Re: IBX for Lazarus 1.2 now available as a pre-release
« Reply #9 on: April 14, 2015, 09:14:45 pm »
Wow!. You have been working hard.

Groffy

  • Full Member
  • ***
  • Posts: 204
Re: IBX for Lazarus 1.2 now available as a pre-release
« Reply #10 on: April 15, 2015, 08:56:45 am »
Tony,

really great work !! Any chance to see a TabStop property for TDBGridColumn?

Little issue in TIBDatabase : Setting Connected = true during design time the login dialog occurs even with LoginPrompt = false. In runtime, the behaviour is like expected.


Best regards - Ulrich
Linux Mint / Windows 10 / Lazarus 3.0.0 / trunk -qt

mangakissa

  • Hero Member
  • *****
  • Posts: 1131
Re: IBX for Lazarus 1.2 now available as a pre-release
« Reply #11 on: April 15, 2015, 09:15:12 am »
I really like your TIBDynamicGrid  and TDBControlGrid.
Unfortunally only working with interbase/firebird
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

tonyw

  • Sr. Member
  • ****
  • Posts: 319
    • MWA Software
Re: IBX for Lazarus 1.2 now available as a pre-release
« Reply #12 on: April 15, 2015, 09:49:16 am »
TIB
I really like your TIBDynamicGrid  and TDBControlGrid.
Unfortunally only working with interbase/firebird

TIBDynamicGrid requires IBX as it updates the SQL and uses the very IBX dependent IBLookupComboBox as a powerful column editor for both picklist and lookup functions.
On the other han, it has an ancestor TDBDynamicGrid that does not require IBX and is where column resizing and the edit panel are implemented.

TDBControlGrid is packaged with the IBX Controls but has no IBX dependencies.

tonyw

  • Sr. Member
  • ****
  • Posts: 319
    • MWA Software
Re: IBX for Lazarus 1.2 now available as a pre-release
« Reply #13 on: April 15, 2015, 10:11:05 am »

Little issue in TIBDatabase : Setting Connected = true during design time the login dialog occurs even with LoginPrompt = false. In runtime, the behaviour is like expected.

This is intended behaviour. At design time, you need to log in to the database in order to do things like get the table and field lists, validate queries, etc. For that, it needs a valid username and password and hence the login dialog is always called at design time in order to prompt you for these. Perhaps you would disagree, but tempting the developer to save the password in the database properties will often end up with the unpleasant consequence of distributing a valid databasename, username and password with the final application (unless the developer remembers to explicitly delete them).

One thought: it may be an idea to add a property (for design time use only) that implies a local connection (embedded server with no password) or default password (masterkey).

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: IBX for Lazarus 1.2 now available as a pre-release
« Reply #14 on: April 15, 2015, 10:37:06 am »
Perhaps you would disagree, but tempting the developer to save the password in the database properties will often end up with the unpleasant consequence
I fully agree with you on that point.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

 

TinyPortal © 2005-2018