User Tools

Site Tools


aximagecanvas

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
aximagecanvas [2019/10/09 09:42]
bloguintosh [Event Handler Definitions]
aximagecanvas [2019/10/14 05:23] (current)
bloguintosh [Releases History]
Line 1: Line 1:
 ====== AXImageCanvas ====== ====== AXImageCanvas ======
  
-Canvas based UI control for Desktop ​Xojo developers (Desktop, Pro and Pro Plus); both for 32 and 64 Bits deployments on macOS, Windows and Linux.+Canvas based UI control for Xojo Desktop ​developers (Desktop Lite, Desktop, Pro and Pro Plus); both for 32 and 64 Bits deployments on macOS, Windows and Linux.
  
 This Class is available as **Standard Edition** and **Database Edition**. This Class is available as **Standard Edition** and **Database Edition**.
  
 You can work with the AXImageCanvas class from the IDE without restrictions when running your own apps in **Debug Mode**; but a license is required when you're ready to Build any project containing this class. You can work with the AXImageCanvas class from the IDE without restrictions when running your own apps in **Debug Mode**; but a license is required when you're ready to Build any project containing this class.
 +
 +===== Class Description =====
 +
 +AXImageCanvas greately simplifies the task of displaying a Picture into the containing control area (Width and Height), with the ability to correctly display the image maintaining its original aspect ratio whitout touching the original picture. This can be done from any dropped image from inside the app, via a Picture File dropped from the Desktop, or another Picture dropped from another **AXImageCanvas** control or executing App, plus any copied picture from another app or source. Of course, the displayed image can be set programmatically,​ just passing the desired Picture Object (instance).
 +
 +If the dropped image comes from a File, then the AXImageCanvas instance will keep a reference to the original FolderItem, so it is possible to do additional operations on it.
 +
 +AXImageCanvas supports the Copy, Paste, Cut, Clear (Delete) and Undo actions selected from the app menu or using the equivalent keyboard shortcuts.
  
 ===== AXImageCanvas in the Store ===== ===== AXImageCanvas in the Store =====
Line 28: Line 36:
 Supported Xojo Editions: Supported Xojo Editions:
  
 +  * Xojo Lite
   * Xojo Desktop   * Xojo Desktop
   * Xojo Pro   * Xojo Pro
   * Xojo Pro Plus   * Xojo Pro Plus
  
-In order to run and use AXImageCanvas,​ please make sure that the following Xojo standard plug-ins are included in the Xojo ''​plugins''​ folder. Restart the Xojo IDE if you need to copy them back to the Xojo ''​plugins''​ folder.+In order to run and use AXImageCanvas,​ please make sure that the following Xojo standard plug-ins are included in the Xojo ''​plugins''​ folder. Restart the Xojo IDE if you need to copy them back to the Xojo ''​plugins''​ folder. ​(This is not mandatory when using AXImageCanvas 1.1 and later, always you don't intend to use these database engines.)
  
   * MySQLCommunityPlugin.xojo_plugin   * MySQLCommunityPlugin.xojo_plugin
   * PostgreSQLPlugin.xojo_plugin   * PostgreSQLPlugin.xojo_plugin
 +
 +==== AXImageCanvas and Xojo API 1.0 and API 2.0 ====
 +
 +Since version 1.2.0, AXImageCanvas folder contains two demo projects:
 +
 +  * **AXImageCanvas API 1.** Use the class version found inside this Demo project with Xojo 2019r2 (or any of the previous supported releases), when your project uses API 1.0 code.
 +  * **AXImageCanvas API 2.** Use the class version found inside this Demo project with Xojo 2019r2 and later when your project uses API 2.0 code.
  
 ==== Licensing AXImageCanvas ==== ==== Licensing AXImageCanvas ====
Line 45: Line 61:
 Replacing ''​Name'',​ ''​Surname''​ and ''​Data''​ values with the information got from AprendeXojo after purchasing the license. Replacing ''​Name'',​ ''​Surname''​ and ''​Data''​ values with the information got from AprendeXojo after purchasing the license.
  
-==== Dragging Images From AXImageCanvas Instances ==== 
- 
-In order to start the Drag action from any AXImageCanvas Instance, press the ''​Command''​ key while start dragging with the pointing device on **macOS**; press the ''​Alt''​ key while start dragging with the pointing device on **Windows** and **Linux**. 
- 
-===== Class Description ===== 
- 
-AXImageCanvas greately simplifies the task of displaying a Picture into the containing control area (Width and Height), with the ability to correctly display the image maintaining its original aspect ratio whitout touching the original picture. This can be done from any dropped image from inside the app, via a Picture File dropped from the Desktop, or another Picture dropped from another **AXImageCanvas** control or executing App, plus any copied picture from another app or source. Of course, the displayed image can be set programmatically,​ just passing the desired Picture Object (instance). 
- 
-If the dropped image comes from a File, then the AXImageCanvas instance will keep a reference to the original FolderItem, so it is possible to do additional operations on it. 
- 
-AXImageCanvas supports the Copy, Paste, Cut, Clear (Delete) and Undo actions selected from the app menu or using the equivalent keyboard shortcuts. 
  
 ===== How to use AXImageCanvas in your own projects (Install) ===== ===== How to use AXImageCanvas in your own projects (Install) =====
Line 89: Line 94:
  
 The database engine used by the control instances can be changed on the fly! The database engine used by the control instances can be changed on the fly!
 +
 +===== Enabling Database Engines =====
 +
 +In order to **enable** and **use** any of the supported database engines, it's mandatory to set the associated Constant value to ''​True''​ under the ''​AXImageCanvasEnabledDB''​ public module (included in the AXImageCanvas Folder inside the Demo project). SQLite is the only database engine active by default in these constants:
 +
 +**AXImageCanvasEnabledDB Module default Constant values**
 +^Constant Name^Default Value^
 +|SQLiteEnabled|True|
 +|MySQLEnabled|False|
 +|PostgreSQLEnabled|False|
 +
 +The reasoning behind this made this way is to ensure the support for Xojo Desktop Lite users, and the no inclusion of non-used Xojo databases plug-ins in the deployed applications using AXImageCanvas.
 +
 +For example, this would be the Demo Project size compiled with several ''​AXImageCanvasEnabledDB''​ combinations on macOS:
 +
 +^SQLite^MySQL^PostgreSQL^App size^
 +|True|True|True|43.1 MB|
 +|False|True|False|40.2 MB|
 +|True|False|False|37,​7 MB|
 +|False|False|True|38.2 MB|
 +
 +===== AXImageCanvas Database Error Handling =====
 +Since AXImageCanvas 1.2, the component is not silent about errors with the database operations / access, displaying by default a dialog for every database access error during any of the supported CRUD operations. This is configurable via the ''​RaiseDatabaseExceptions As Boolean''​ property. When set to ''​True'',​ the AXImageCanvas instance will raise an exception that must be catched by the calling code for the operation.
 +
 +===== Dragging Images From AXImageCanvas Instances =====
 +
 +In order to start the Drag action from any AXImageCanvas Instance, press the ''​Command''​ key while start dragging with the pointing device on **macOS**; press the ''​Alt''​ key while start dragging with the pointing device on **Windows** and **Linux**.
 +
 +===== AXImageCanvas Shared Properties =====
 +^Property^Description^Standard Edition^Database Edition^
 +|APIVersion As Integer|Get the Xojo API version of the AXImageCanvas code. Values are 1 for API 1.0 and 2 for API 2.0|Yes|Yes|
 +|Version As String|Get the AXImageCanvas version.|Yes|Yes|
 +
 +===== AXImageCanvas Shared Methods =====
 +^Property^Description^Standard Edition^Database Edition^
 +|License(Name As String, Surname As String, Data as String)|Call this method to license the AXImageCanvas component in deployed applications.|Yes|Yes|
  
 ===== AXImageCanvas Properties ===== ===== AXImageCanvas Properties =====
Line 108: Line 149:
 |PictureFilePathColumn as String.|Set or Get the column name of the table database in charge of keep the path to the FolderItem pointing to the Picture. Available through the Inspector Panel and code.|No|Yes| |PictureFilePathColumn as String.|Set or Get the column name of the table database in charge of keep the path to the FolderItem pointing to the Picture. Available through the Inspector Panel and code.|No|Yes|
 |PreviewEnabled As Boolean.|Set or Get the ability to display an Image Preview Window for the current displayed picture of the control instance. Available Through the Inspector Panel and code.|Yes|Yes| |PreviewEnabled As Boolean.|Set or Get the ability to display an Image Preview Window for the current displayed picture of the control instance. Available Through the Inspector Panel and code.|Yes|Yes|
 +|RaiseDatabaseExceptions As Boolean|Set the management of database errors / Exceptions to the AXImageCanvas instance or raise them so they can be catched by the calling code. By default this is set to False, so they are catched from the instance. Set this Property to True so they can be raised along the responsibility chain of the App|No|Yes|
 |SelectionDelegate As SelectionCallback|This method is called when the control instance receives the Focus. Available through code.|Yes|Yes| |SelectionDelegate As SelectionCallback|This method is called when the control instance receives the Focus. Available through code.|Yes|Yes|
 |TableName As String.|Set or Get the name of the table responsible of the database features. Available through the Inspector Panel and code.|No|Yes| |TableName As String.|Set or Get the name of the table responsible of the database features. Available through the Inspector Panel and code.|No|Yes|
- 
 ===== AXImageCanvas Methods ===== ===== AXImageCanvas Methods =====
  
Line 134: Line 175:
 The following events are those from the Canvas class consumed by the AXImageCanvas and that are made available again to the created control instances. Add these Event Handlers in the AXImageCanvas instances to implement additional behaviour **after** the one implemented by the Class itself. The following events are those from the Canvas class consumed by the AXImageCanvas and that are made available again to the created control instances. Add these Event Handlers in the AXImageCanvas instances to implement additional behaviour **after** the one implemented by the Class itself.
  
-  * DoubleClick(X As Integer, Y As Integer)+  * DoubleClick(X As Integer, Y As Integer) (API 1.0) 
 +  * **DoubleClicked(X As Integer, Y As Integer)** (API 2.0)
   * GotFocus()   * GotFocus()
   * KeyDown(Key As String) As Boolean   * KeyDown(Key As String) As Boolean
Line 141: Line 183:
   * MouseDrag(X As Integer, Y as Integer)   * MouseDrag(X As Integer, Y as Integer)
   * MouseUp(X As Integer, Y as Integer)   * MouseUp(X As Integer, Y as Integer)
-  * Open+  * Open (API 1.0) 
 +  * **Opening** (API 2.0) 
 + 
 +===== AXImageCanvas Delegates Definition ===== 
 + 
 +^Delegate Signature^Description^Standard Edition^Database Edition^ 
 +|SelectionCallback(Control As AXImageCanvas)|Use any method in your code with this signature to receive the AXImageCanvas instance that is selected (has the focus). For that, the method has to be assigned to the SelectionDelegate Property.|Yes|Yes|
  
 ===== Releases History ===== ===== Releases History =====
Line 149: Line 197:
 |1.0.1|2019-09-07|[Add] Minor Changes and improvements. [New] Added selectionDelegate Property. [Fix] Now the project properly catch the exception when the path for the stored picture in the database is not reachable (for example using the provided example SQLite database).| |1.0.1|2019-09-07|[Add] Minor Changes and improvements. [New] Added selectionDelegate Property. [Fix] Now the project properly catch the exception when the path for the stored picture in the database is not reachable (for example using the provided example SQLite database).|
 |1.0.2|2019-10-02|[Add] Backwards compatibility to work with Xojo 2017r3 and later. [New] AcceptDroppedImages property. When set, it accepts dropped image files. [New] ImageDeleted event. If implemented,​ this event fires when the user (or code) deletes the image from the instance. [Add] Other minor improvements based on customers requests.| |1.0.2|2019-10-02|[Add] Backwards compatibility to work with Xojo 2017r3 and later. [New] AcceptDroppedImages property. When set, it accepts dropped image files. [New] ImageDeleted event. If implemented,​ this event fires when the user (or code) deletes the image from the instance. [Add] Other minor improvements based on customers requests.|
 +|1.1.0|2019-10-09|[Add] New AXImageCanvasEnabledDB public module to better manage the code associated with the supported databases engines at compilation time. That means, among other things, that any project using AXImageCanvas will not include the Xojo database plug-ins for those databases that are not in use in the App. [Change] The DoubleClicked Event Handler Definition is now DoubleClick so it not collides in Xojo 2019r2. [Improved] Compatibility with Xojo 2019r2 "out of the box". The complete rewriting for API 2.0 is under testing.|
 +|1.2.0|2019-10-14|[Add] New API 2.0 version of AXImageCanvas,​ so it can be used in combination with any project started using the Xojo API 2.0 in Xojo 2019r2 and later. [Add] New RaiseDatabaseException Property to set the way every instance deals with Database access errors. By default it is set to False what means that it will display a dialog with the error information. When set to True it raises an Exception that must be catched by the calling code.[Improved] AXICL class.|
aximagecanvas.1570606970.txt.gz · Last modified: 2019/10/09 09:42 by bloguintosh