Friday, February 24, 2017

TitleBarX Color Cycling Trick

What is TitleBarX again?

It is a class to replace the form's titlebar.  It has these features:

1.  Two captions
2.  Ability to change on-the-ply its color and the objects on a form, and retain those via a popup colorwheel

To take a thorough glimpse on what this class is, click here

A subscriber emailed me just now and asked if we can change its default behavior of picking up the last color scheme.  What he wanted instead is to dictate to the class the color cycling which is based on the day of the week.  So for Monday, a color, Tuesday another color and so on...

Well, the trick is simple enough so I will show it here in case some of those who use it wants to do the same.  The trick is to put something like this on its Init Event:

* TitlebarX Init
DODEFAULT()
Do Case
      Case Dow(Date()) = 1
            This.BackColor = Rgb(0,128,128)
      Case Dow(Date()) = 2
            This.BackColor = Rgb(128,255,0)
      Otherwise
            This.BackColor = Rgb(138,176,66)
Endcase
This._swapcolor()

And that is it!  Cheers!

Tuesday, February 21, 2017

EditX 2017.02.20 Version

Okay. So for new readers, what is this EditX again? 

EditX is a dropdown editbox control class to save space on forms and grid. This is especially designed to show and handle contents of memo fields. 

Another new subscriber seems to be very much interested in this especially on grid usage so after a long time, I dug this one out again. And decided to do a major overhaul to satisfy them, and of course to make it better further. 

So What is New? 

  • More responsive. Unlike on the previous versions where when inside a grid cell, you need to click twice, first on that cell to activate it then next on the arrow to fire the dropdown section, with this one you can click on the arrow straight from anywhere and it will fire outright
  • Added ReadOnly. This allows us to use this on Grid to show memo notes and to either limit it to viewing purposes only or to allow direct editing of underlying ControlSource's value
  • Cosmetic adjustments. Adjusted objects positions and sizes depending if it is on form or inside a grid. Changed down arrow to a better one.
  • Finally, cleaned up old codes and other objects and replaced those with better and leaner ones. 

Advantages of EditX vs native EditBox? 

Thursday, February 9, 2017

DropSwitch

February 13, 2017

Added MultiSelect capability.  It is controlled by two properties:

  • MultiSelect
    • .F. (Default), only a single switch can be selected each time from the dropdown list.  The caption of the selected switch will be reflected outright on the class
    • .T. or allow multiselect.  When this is set to .T., the caption will reflect the number of switches turned on (see image below)
  • mValues = are character values representing which switches are turned on.  On the image below, I set the initial mValues to 1,3,5.  mValues change on-the-ply, or when you turn on and off available switches.  Showing new Theme 17 I created just now too.


=====
February 9, 2017

Well, I've been meaning to do this for a long time but can't find much time to work on it.  But yesterday, I decided to finally do this.

What is DropSwitch?

It is a Control class with a commandbutton that has a dropdown form with several switches based on your desire.  You can think of the dropdown portion like an OptionGroup on a dropdown form, except that it does not use radiobuttons but my switches.



It is more like my OptionSwitchX class but this one hides the selection until you click the button.  So if you want to change the value, click on it, click anew on the popup selections (change will reflect on-the-ply), and click outside.


Some more differences with OptionSwitchX: