Thursday, January 29, 2015

TitleBarX Class

* Updates February 2, 2015

Added NoMax property to hide Max Button.  This should not be confused with _noMax property which simply disables the max button

Added NoMin property to hide Minimum Button

Added 3 shapes at the bottom to give an illusion of a gradient bottom border.  Although GDI+X is good for gradient, I want my classes to not be dependent of an external file like an .app.  Maybe in the future I may change decision or not

Added Form Pinning capability on Controlbox section.  When it is pinned, the pin icon will turn into red and you won't be able to move the form.  To unpin, click on it again

Removed the date and showed instead plain time().  Made it bigger

Added _shade method.  That is what you can use to get a different shade of the current color you  pick for other objects in the form (using _SwapColor Method).  So now you can implement color themes with variying shades not only on the class itself but on any objects you wish.  Here is how it looks like

Friday, January 16, 2015

Tick/Untick a checkbox on Grid with AllowCellSelection = .F.

Normally, when we want to put a checkbox on grid for the purpose of ticking and unticking it, then most probably most of you do it this way:

  • Set AllowCellSelection = .T.
  • Drill to every textbox object inside each columns and put under When method Return(.f.).  That is to prohibit the cell in getting focus

An alternative way is to set AllowCellSelection = .F. and use grid's double-click on toggling the value of the logical field bound to that checkbox, then perform a grid refresh

Monday, January 12, 2015

ShellExecute, Force open file to non-default application

As most of us know, ShellExecute() is a very useful tool to open a file on its external associated application.  When you issue this command:

Local lcFile
lcFile = Getfile('doc,docx')
If !Empty(m.lcFile)

Then that document file will be opened by MsWord or its counterpart like say on LibreOffice

Or if you do:

Local lcFile
lcFile = Getfile('xls,xlsx')
If !Empty(m.lcFile)

Or even: