Antlr 4

Having once upon a time having had to use Lex & Yacc, and their eventual successors Flex & Bison, I’d been more than passingly familiar with writing and debugging grammars.

And all their weirdness like shift reduce conflicts 😛

At Xojo I’d looked through the grammar for the language to make sure various editors and parsers were conforming to the grammar especially in places like the method signature editor where you could paste in the whole thing into the method name and it would pull it apart.… Read the rest

Graphics in C# on macOS

The Einhugur framework has similarities to Xojo in many ways

It has a Canvas, just like Xojo

And when you use its paint event you can do many of the same things like drawing text and shapes and pictures.

We can add a canvas just like other controls. And we can implement the paint event in the same way.… Read the rest

Hanging on by a …

THREAD !!!!!!!!!!

yeah ok bad joke. I’ve been so dang busy with studying and work that I just haven’t had a reasonable chance to write any updates for the C# on macOS series.

But now that my Canadian Ski Patrol exams are done I can get back to some fun.

How to make our little project use a thread instead of a timer.… Read the rest

Using other databases in C#

A new version of the Einhugur C# UI framework was released a short while ago.

Since the framework is still literally a work in progress some changes an dupes are to be expected. Listbox now exists and its constructor now takes an array of column titles as well as the initial dimensions. So you may need to update code like


list = new ListBox(10, 20, 80, 20 );

to add a new last parameter

list = new ListBox(10, 20, 80, 20, new string[] {"col 1", "col 2"} );

to set the column titles.… Read the rest

Tired of adding strings ?

If you’ve ever had to write a lot of output with strings you’ve probably had to concatenate them.

In VB you used &. In Xojo you use + and more than likely Str, Format, and the newer ToString.

Eventually when you write enough code you end up with things that look like

Var Explanation as string = "Hint: If you don't save," _
  + " you will lose your work" _
  + " since your last Save."
Read the rest

Working with databases in C#

The trek continues !

One of the common things we need our applications to do is interact with a database. Sometimes its just a local SQLite, or other stand alone db engine like that, or some “Big Iron” database like Oracle, MS SQL Server, PostgreSQL, etc. Or maybe a NoSQL database like Mongo ?
With Xojo there are only a handful of plugins Tod ell with the vast majority of databases.… Read the rest

Working with Databases in C# – status

yes I’m still working on this and am figuring out which of the gazillion database modules available for things like Oracle, SQLITE, etc work on macOS

With .Net Core and some of the supporting modules being fairly new to macOS not all of them work. There seem to be several choices for using any of the db’s from MS SQL Server, Oracle, PostgreSQL, Mysql, MariaDB etc all the way to ones I’ve never heard of

Adding Event handlers

OK So now we have a control on a Window
But how do we react to events that happen to that control ?
Like KeyDown, Keyup, GotFocus, LostFocus, and TextChanged. Thats all the events there are on TextFields – for now.

In Xojo you’d just add the event handler to the control & put code in it.… Read the rest

Adding menubar & controls in C#

For all of you following along YEAH its about damned time ! 🙂
I agree

I’ve been proceeding slowly to make it so you can follow and not try to cram 10000 items in one post (we ARE trying to keep it manageable)

First Lets remove the last bits of “cruft” left in our getting starting project
Since we’re not actually using a normal macOS document application we can delete the ViewController.csRead the rest