Just Code Challenge Week 11 Projects

Post your Just Code Challenge Week 11 Projects in this conversation! The blog post with my project will is published on Friday and I’ll update this conversation when this it is published.

So whenever you finish your week 11 project, go ahead and post it here. Have fun and be sure to download other projects and discuss!

Alternative MsgBox
(Tested in MacOS and Windows 10 - Xojo 2018r2)

This MsgBox gives the same functionality as MsgBox in Xojo plus some extras.
Syntax:

alt_MsgBox <message>
result = alt_MsgBox (<message>, [buttons], [title])

The buttons parameter is the same as MsgBox.
(See Page Not Found — Xojo documentation)

?Extra functionality:

Set color of title text and/or title bar
Set color of backgound and/or message text

alt_MsgBox_colorTitleBar - Set text color of title bar
alt_MsgBox_colorTitleText – Set color of title text
alt_MsgBox_colorBackground - Set background color of message area
alt_MsgBox_colorMessageText - Set color of message text

Usage:
alt_MsgBox_colorTitleBar =
alt_MsgBox_colorTitleText =

Example:

alt_MsgBox_colorTitleBar = &CEE000000 alt_MsgBox_colorTitleText = &C0000EE00 intReturn = alt_MsgBox(strMsg, 16, "Title of the new alt_MsgBox")
When alt_MsgBox is closed, the colors of the TitleBar, TitleText, colorBackground and colorMessageText are
reset to default (&c000000FF)
Since the color is reset when closing alt_MsgBox, adjust the color(s) in the Xojo IDE for your own standard coloring.

Position alt_MsgBox

alt_MsgBox_Top - Top position of alt_MsgBox in relation to the available top position of the main screen
alt_MsgBox_Left - Left position of alt_MsgBox in relation to the available left position of the main screen

Usage:
alt_MsgBox_Top =
alt_MsgBox_Left =

Example:

alt_MsgBox_colorTitleBar = &CEE000000 alt_MsgBox_colorTitleText = &C0000EE00 intReturn = alt_MsgBox(strMsg, 16, "Title of the new alt_MsgBox")

When alt_MsgBox is closed, the top and left positions of the window are reset to default (-1)

Mac

Windows

Project
alt_MsgBox.zip
(Contains all the pictures used in project. You have add them again after opening the project for the first time)

When moving alt_MsgBox (folder MessageBox) to your own project, recreating of the Imagesets is required.
See <https://xojo.com/issue/53160>

This week my submission is based on the MacOSLib 2 (64bit) project hosted on GitHub. The other day I was trying to get detailed information about the battery of my MacBook and MacOSLib provides an easy way to the IOKit API of the OS. So, I ended up with a simple Mac desktop app showing the current power status of the batteries. There can be more than one battery attached to a device, I assume, because the API provides a list of PowerSources.

I came accross some pitfalls, calling the libs PowerSource methods, because some type-convertion functions seems to be doing wrong things. But with some changes to the lib I managed to get it running in the end. Furthermore I added some missing PowerSource properties to the library. Hopefully I will find some time to get more used to github so that I can commit my changes to the library.

Project and binary is here.

Please note: The project does not contain the full MacOSLib since I removed unnecessary classes so that compiling runs quicker.

My project this week is something I’ve actually been working on for quite a while. It’s Xojo Dojo, a simple app that you can use to write and run your own scripts using Xojo code on the Raspberry Pi.

https://blog.xojo.com/2018/08/31/justcode-challenge-week-11-xojo-dojo-for-pi/

I added a manual (MS Word document) to the zip file.
The manual is also available in the project, see Win_MsgBox -> Notes -> alt_MsgBox

I’m well aware that this is a beaten horse, but this week I worked on a web date picker. In particular, I needed to modernize and add some extra features to the date picker we had been using which I found on the forum from years ago (if I had the source still, I’d credit the author and will do so if I find it). I added the ability to use Xojo.Core.Dates in addition to classic dates and built a little popup button so it is more intuitive to some users. Everything you need to add it to your web project is in a folder called “Date Picker” and there is an example web page showing the three versions I have as of now.

This is still a bit of a work in progress, so feel free to create a branch or fork off of my repository.

GitHub

One of my customers recently had a problem with his ThinkPad: despite the presence of the required tools, the on screen keyboard status indications were no longer working. I decided to find an alternative. Problem: none is good. Keyboard LEDs doesn’t offer sufficiently visual indicators. The other solutions display a permanent pop up, or no pop up at all!

Here is KeybState, a very discrete application (no icon in the taskbar or traybar), which visually displays the state of the keyboard when it is modified (CAPS or NUM lock). The pop up only appears on screen 1, but supports changes of screen resolution. I used Windows APIs to provide a borderless window with a transparent fade.


Source and win32 exe are here:
https://www.ascinfo.fr/fichiers/justcodechallenge2018/KeybState.zip

Water ripples

This is a simple water ripples animation created with Xojo using RGBSurface. The inspiration for this project came from this Java tutorial on Youtube.

Download source

Again I have used Einhugur’s Excel Reader plugin to do something I need to build into one of my larger applications. This time it is a simple import to a sqlite database, in order to make your data easier to handle.

Another nice part: the importing is done by thread. So the program shows an indicator of the process.

You can download the project here: https://surfdrive.surf.nl/files/index.php/s/IihWTlwypv7ScQN

Remember to install the necessary plugins from http://einhugur.com/Html/all.html

(when setting a column to date, make sure the column has the date format in Excel as well!)

This week’s submission is an update to the Sudoku puzzle solver posted in Week 7. I’ve now added some additional solving strategies. This required some refactoring, because the original data structures turned out not to be best suited for the newer strategies. The refactoring also includes a container control for displaying the cell values. If the value of a cell has not been determined, then instead of a a completely blank cell being displayed, it now displays a small 3x3 grid of spots (similar to the pips on a die or domino) indicating which candidates are still viable and which have been eliminated. The new container control is added to the window dynamically, and replaces a static array of fixed position label controls. This should also make it easier to align the cell data with the background image, should there be any platform related differences.

The intent of this project has always been to be an interactive solver that would help the user to learn the various solving techniques. So, rather than having a single “Solve” button, there is a separate button for applying each of the different strategies. There is now also a “Solve Notes” window that displays an itemized explanation of the steps involved in the solution. I had intended this to be part of the first submission, but didn’t have time to get it into a presentable state at that time.

Also, as in the previous version, the digits displayed in the game grid are colour coded according to the strategy used to solve them, and these colour codes are now displayed beside the corresponding solve buttons.

As with the previous submission I’ve included a file with example puzzles. It’s the same set of puzzles as before. There are still a couple of puzzles in that file that cannot be solved with the current set of strategies. I thought that I had them all covered, but discovered that one of the newly included solving strategies requires a bit more generalization, and I just didn’t have time to get that finished for this submission. While I know what needs to be done, I haven’t yet figured out the best way to do it. So, it appears that this may be a future submission in the Just Code Challenge.

Project file is here: Sudoku Solver Project

Also, for additional notes, refer to app.RevisionNotes in the project file

My project for this week is a small webmail interface with SQLite database to save the settings. There are still some things to be adjusted, but this week had no more time. But anyone can extend the program.

Download Project File