Scintilla in Xojo with Search and Replace

Several people asked for this, so let us add a search feature to our example project. Beside of using ScintillaControlMBS control to show HTML, MySQL or Xojo code, the example now includes a find and replace window:

In Scintilla you not just have a current selection (actually multiple), but also a target range. The target range is used to search and replace text without the user seeing this. We also have a FindText() function to perform a search and return the range where text is found. So you can search and show it in user interface.

Search can be done with various flags:

kFindOptionNoneDefault setting is case-insensitive literal match.
kFindOptionMatchCaseA match only occurs with text that matches the case of the search string.
kFindOptionWholeWordA match only occurs if the characters before and after are not word characters as defined by WordChars property.
kFindOptionWordStartA match only occurs if the character before is not a word character as defined by WordChars property.
kFindOptionRegExpThe search string should be interpreted as a regular expression. Uses Scintilla's base implementation unless combined with kFindOptionCxx11RegEx to use C++11 version.

When Regular expressions are enabled, you can use the familiar syntax and use \0, \1, \2 and so on in replacement to reference the Nth captured value.

Please try this in the next pre-release.

Xojo Meetings for Montreal and Quebec City

Let's organize some local Xojo developer meetings for Quebec City and Montreal:

If you live in this part of Canada, or you like to come over from the USA, please join those surveys to find the perfect date between 21st to 26th March 2022:

Xojo Survey for Montreal   Xojo Survey for Quebec

If you like to join, please add yourself to the survey and contact us soon to put you on the list.

I reserve a table in a nice restaurant and I will be there. You can join and we can shop talk all night. Ask me plugin questions, bring your laptop and show projects.
And of course we discuss latest changes in Xojo, upcoming conferences and what's new in plugins.

Of course it is possible to arrange private meetings for consulting or training while I am in the city.

MBS Xojo Plugins, version 22.1pr4

New in this prerelease of the 22.1 plugins:
  • Updated Chromium classes to newer CEF version.
  • Fixed events for PhidgetManagerMBS class to work.
  • Added constants for ContinuityCameraMBS class.
  • Added enabled property for ContinuityCameraMBS class.
  • Changed RenameSpotColor in DynaPDFMBS class to allow you to pass empty string for second parameter to pass NULL for special none name.
  • Fixed problem with StoreKit framework not loading.
  • Added CovertArt function to TagLibFileRefMBS class.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/ or from DropBox.
Or ask us to be added to our shared DropBox folder.

Upgrading WebKit for Windows support

We regularly add new versions of Chromium Embedded Framework for WebKit support on Windows. The plugin has now the fifth version included. Depending on what version is reported bei CEF, we can pick the right interface, so you can use the same plugin with various Xojo versions and their related CEF versions.

For MBS Xojo Plugins 22.1 we upgrade our Chromium classes and you can try with 22.1pr4 pre-release version soon. Check out Chromium classes:

class ChromiumBrowserMBS
class ChromiumCookieManagerMBS
class ChromiumCookieMBS
class ChromiumFrameMBS
class ChromiumWebPluginInfoMBS

If you look for a modern HTMLViewer for Windows, also check our WebView2ControlMBS control for Xojo, which uses current Microsoft Edge browser as engine (based on Chromium).

See also: HTMLViewer JavaScript communication for Xojo and WebView2 for Xojo

Xojo Developer Magazine Year Books

Last week the new books arrived from XDevMag. Always great to have all the articles from one year of the Xojo Developer Magazine in one book, where you can just browse through when you have some time in your hammock.



We'll give away a few over the year at various Xojo meetings, once they start to take place again.
If you like to get one yourself, you can order them in the XDevMag book store. When you consider ordering them, better pick several years and let them ship together at a package price. There are also academic and subscriber discounts available and shipping from USA or Europe is available. (more)

Tip of the day: Count files in upload for iCloud

Some clients on macOS use Documents in the Cloud with their iCloud account. Files are synchronized with Apple's server and that may take a while, so you can check how many files in a directory are uploading currently:

Shared Function CountUploadFiles(dir as FolderItem) As integer Dim count As Integer For Each file As FolderItem In dir.Children(False) Dim url As New NSURLMBS(file) If url.UbiquitousItemIsUploading Then count = count + 1 End If If count > 100 Then Exit End If Next Return count End Function

For two applications we now check that and if a lot of files are uploading, we slow down creating files, so the sync process can catch up.

(more)

MBS Xojo Plugins, version 22.1pr3

New in this prerelease of the 22.1 plugins:
  • Deprecated OptionSSLEngine and OptionSSLEngineDefault properties in CURLSMBS class since you don't need those ever.
  • Changed NSCenterTextAlignment and NSRightTextAlignment to from constants to shared methods to return correct values for PDFAnnotationTextWidgetMBS, NSParagraphStyleMBS, NSTextMBS and PDFAnnotationFreeTextMBS classes.
  • Added Constructor for NSWindowMBS taking DesktopWindow.
  • Added State property for NSSwitchControlMBS control.
  • Updated DynaPDF to version 4.0.66.169.
  • Added SpaceWidthFactor property to DynaPDFMBS class.
  • Added kctPDFA_2u and kctPDFA_3u constants for DynaPDFMBS class.
  • Added UbiquitousItemIsExcludedFromSync, UbiquitousItemUploadingError, UbiquitousItemIsUploading, UbiquitousItemIsUploaded, UbiquitousItemIsShared, UbiquitousItemIsDownloading, UbiquitousItemIsDownloaded, UbiquitousItemHasUnresolvedConflicts, UbiquitousItemDownloadRequested, UbiquitousItemDownloadingStatus, UbiquitousItemDownloadingError, UbiquitousItemContainerDisplayName and IsUbiquitousItem properties to NSURLMBS class.
  • Updated LCMS library to version 2.13.1.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/ or from Dropbox.
Or ask us to be added to our shared Dropbox folder.

Adding NSSwitch to Xojo

The NSSwitch class in MacOS provides a nice toggle control for desktop applications. It looks like the iOS counterpart and represents a boolean flag to toggle something on or off:

You can use it with the NSSwitchControlMBS (or DesktopNSSwitchControlMBS) control in Xojo and the view is implemented via NSSwitchMBS class. We have an action event to run when the user changes the value and a State property for code to read/write the current value.

Please try with MBS Xojo Plugins 21.1pr2 and let us know what you think. Your feedback is welcome and will help to improve this control for the next releases.

MBS Xojo Plugins, version 22.1pr2

New in this prerelease of the 22.1 plugins: Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/ or from Dropbox.
Or ask us to be added to our shared Dropbox folder.

Change Bootstrap them in Xojo Web apps

When you build and run your web app in Xojo, you may wonder how to change all the predefined styles?

Well, first thing would to read in the Xojo documentation and you may find the page Changing the Appearance of Controls. There you can read that you can drop a replacement bootstrap.min.css into the project and Xojo will embed your version.

(more)

SQL options applicable to MySQL and MariaDB in MBS Plugin

Let us list options for connecting to MySQL or MariaDB via MBS FileMaker Plugin or MBS Xojo SQL Plugin:

(more)

Configure Scintilla Control for HTML

Our ScintillaControlMBS can be configured to over 100 different lexers to colorize various texts. And today we configure the control for HTML:

Our plugin example comes with a file called LexerConstants.txt with all the constants. For the hypertext lexer we copy the SCE_H_* constants. Since HTML can have embedded JavaScript, VBScript, PHP and Python, we can also copy the following constants until SCE_HPHP_OPERATOR. For each of those styles you can define later an effective style with a specific color. Then we get the list of keywords for html and I just copied it from the html.properties file used for scite. There we can also see what styles the editor uses.

With PropertyNames method in our control you can learn the properties defined by the lexer and for folding html, we turn on the fold, fold.html and fold.hypertext.comment properties. You can do this dynamically if you like. For example query PropertyNames, build checkboxes for them and use DescribeProperty() to get a descriptive text for each property.

The example project will be included with 21.1pr2 in the next days and should be a good start for anyone looking into a good HTML text editor within Xojo. Below a screenshot from Windows as this project can run on macOS, Windows and Linux.



The list of lexers available for Scintilla in our plugin is:
a68k, abaqus, ada, apdl, as, asm, asn1, asy, au3, ave, avs, baan, bash, batch, bib, blitzbasic, bullant, caml, cil, clarion, clarionnocase, cmake, COBOL, coffeescript, conf, cpp, cppnocase, csound, css, d, dataflex, diff, DMAP, DMIS, ecl, edifact, eiffel, eiffelkw, erlang, errorlist, escript, f77, flagship, forth, fortran, freebasic, fsharp, gap, gui4cli, haskell, hollywood, hypertext, ihex, indent, inno, json, julia, kix, kvirc, latex, lisp, literatehaskell, lot, lout, lua, magiksf, makefile, markdown, matlab, maxima, metapost, mmixal, modula, mssql, mysql, nim, nimrod, nncrontab, nsis, null, octave, opal, oscript, pascal, powerbasic, perl, phpscript, PL/M, po, pov, powerpro, powershell, abl, props, ps, purebasic, python, r, raku, rebol, registry, ruby, rust, sas, scriptol, smalltalk, SML, sorcins, specman, spice, sql, srec, stata, fcST, TACL, tads3, TAL, tcl, tcmd, tehex, tex, txt2tags, vb, vbscript, verilog, vhdl, visualprolog, x12, xml, yaml, xojo.

News from the MBS Xojo Plugins Version 22.0

In this article I want to introduce you the new functionalities from the MBS Xojo Plugins in version 22.0.

Scintilla

With the new part Scintilla you get a text code editor at your fingertips. With the DesktopScintillaControlMBS control and the ScintillaControlMBS control you can integrate the text editor into your solutions. You can not only write simple texts but also mark special keywords. Scintilla provides lexers for well-known programming and markup languages, which you can load as needed.

It provides lexers for syntax highlighting in over 100 languages including SQL, JavaScript and HTML. We added a Xojo lexer to highlight code for XojoScript. You can also specify your own keywords that will be highlighted in your texts. Scintilla supports not only the highlighting of words but also features that other script editors have, such as setting breakpoints or showing and hiding parts of the script for better clarity. The Advanced Script Editor in your application. Test it out!

(more)

Rewritten Phidgets Plugin

We added Phidget classes around 2010 to our MBS Xojo Plugins. We kept that running and various clients used all the old classes for various projects. To keep compatibility we renamed the old classes with a prefix Old, e.g. OldPhidgetMBS.

To support the new Phidget Library with support for Apple Silicon, we created new classes with the modern API. We can put in all the knowledge we got about C++ and Xojo and improve the classes to current standards. We wrap the C API from Phidgets library and so you can always look on their documentation, too.

Our plugin does all memory management automatically for you with allocation of required buffers. We dispatch all events on main thread including the asynchronously APIs and their completion events. You can of course use AddHandler if needed and send events to your delegate methods. We check error codes and raise PhidgetErrorExceptionMBS whenever needed. The exception then has an error message and the error code.

(more)

MBS Xojo Plugins, version 22.1pr1

New in this prerelease of the 22.1 plugins: Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/ or from Dropbox.
Or ask us to be added to our shared Dropbox folder.
The biggest plugin in space...

Archives

Apr 2024
Mar 2024
Feb 2024
Jan 2024
Dec 2023
Nov 2023
Oct 2023
Sep 2023
Aug 2023
Jul 2023
Jun 2023
May 2023
Apr 2023
Mar 2023
Feb 2023
Jan 2023
Dec 2022
Nov 2022
Oct 2022
Sep 2022
Aug 2022
Jul 2022
Jun 2022
May 2022
Apr 2022
Mar 2022
Feb 2022
Jan 2022
Dec 2021
Nov 2021
Oct 2021
Sep 2021
Aug 2021
Jul 2021
Jun 2021
May 2021
Apr 2021
Mar 2021
Feb 2021
Jan 2021
Dec 2020
Nov 2020
Oct 2020
Sep 2020
Aug 2020
Jul 2020
Jun 2020
May 2020
Apr 2020
Mar 2020
Feb 2020
Jan 2020
Dec 2019
Nov 2019
Oct 2019
Sep 2019
Aug 2019
Jul 2019
Jun 2019
May 2019
Apr 2019
Mar 2019
Feb 2019
Jan 2019
Dec 2018
Nov 2018
Oct 2018
Sep 2018
Aug 2018
Jul 2018
Jun 2018
May 2018
Apr 2018
Mar 2018
Feb 2018
Jan 2018
Dec 2017
Nov 2017
Oct 2017
Sep 2017
Aug 2017
Jul 2017
Jun 2017
May 2017
Apr 2017
Mar 2017
Feb 2017
Jan 2017
Dec 2016
Nov 2016
Oct 2016
Sep 2016
Aug 2016
Jul 2016
Jun 2016
May 2016
Apr 2016
Mar 2016
Feb 2016
Jan 2016
Dec 2015
Nov 2015
Oct 2015
Sep 2015
Aug 2015
Jul 2015
Jun 2015
May 2015
Apr 2015
Mar 2015
Feb 2015
Jan 2015
Dec 2014
Nov 2014
Oct 2014
Sep 2014
Aug 2014
Jul 2014
Jun 2014
May 2014
Apr 2014
Mar 2014
Feb 2014
Jan 2014
Dec 2013
Nov 2013
Oct 2013
Sep 2013
Aug 2013
Jul 2013
Jun 2013
May 2013
Apr 2013
Mar 2013
Feb 2013
Jan 2013
Dec 2012
Nov 2012
Oct 2012
Sep 2012
Aug 2012
Jul 2012
Jun 2012
May 2012
Apr 2012
Mar 2012
Feb 2012
Jan 2012
Dec 2011
Nov 2011
Oct 2011
Sep 2011
Aug 2011
Jul 2011
Jun 2011
May 2011
Apr 2011
Mar 2011
Feb 2011
Jan 2011
Dec 2010
Nov 2010
Oct 2010
Sep 2010
Aug 2010
Jul 2010
Jun 2010
May 2010
Apr 2010
Mar 2010
Feb 2010
Jan 2010
Dec 2009
Nov 2009
Oct 2009
Sep 2009
Aug 2009
Jul 2009
Apr 2009
Mar 2009
Feb 2009
Dec 2008
Nov 2008
Oct 2008
Aug 2008
May 2008
Apr 2008
Mar 2008
Feb 2008