Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 15.1 ('Xojo Pi Lab')
Instant purchase and download via GumRoad!

FEATURE

Working with Bitmasks

How to present and manage bitmask data

Issue: 15.1 (January/February 2017)
Author: JC Cruz
Author Bio: JC is a freelance writer based in British Columbia. He is a regular contributor to MacTech Magazine and Dr Dobb's Journal. Away from the writing pile, JC spends quality time with his nephew, as a proper uncle should.
Article Description: geNumber>46
Article Length (in bytes): 42,449
Starting Page Number: Article Number: 15106
Resource File(s):

Download Icon project15106.zip Updated: 2017-01-02 14:50:56

Related Link(s): None

Excerpt of article text...

State data can take the form of several state flags or a single bitmask value. In today's article, I shall explore the benefits of using bitmasks to represent states. I shall introduce the two control widgets used to display and accept state data.

Next, I describe how I customize those widgets, streamlining their behaviour and reducing boiler code. And I demonstrate how I use the custom widgets.

Readers must have a working knowledge of Xojo. The demo project FooFlags is available from the magazine's website.

States as Data

I often have to use state data when working with database records, with preferences settings, with user data in general. State data are usually Boolean types, but some are integers, each integer value specifying a state level.

Types of state data

...End of Excerpt. Please purchase the magazine to read the full article.