Version 1.10 beta
Copyright 2007 - 2014 PurpleSwift Software CC

www.purpleswift.com
Updated 17 Feb 2014



This version of CoolButtons is for Clarion 6, 7, 8 and 9 only
 



Introduction

 

The visual impact is the first thing that your users will notice about your application.  You spend time and effort developing excellent software and now CoolButtons provides an elegant way to make your application look really slick.

 

CoolButtons provides custom graphics for all of your application buttons. 

 

 

Features
  • 3 Button Graphic styles are provided.

  • Your own graphics can easily be added.

  • Special function buttons provided for "Filename lookup" and "Entry field lookup" etc.

  • Takes less than 1 minute to add to your application.

  • All graphics can be linked into your application Ė single exe, no missing files.
     

Installing CoolButtons

Run the install program CoolButtonsInstall.exe.

Notes

  1. When upgrading, simply install the new CoolButtons over the currently installed version.  It is not necessary to uninstall the previous version.

The install program does the following.

  1. Copies the CoolButtons files to your clarion directory as per table below.
  2. Adds a shortcut menu for CoolButtons.  Start | All Programs | Clarion 6 Accessories | CoolButtons
  3. Updates the global redirection file as per the table below.
  4. Registers the CoolButtons template.
s s s s
  Installed Files   s
 
Clarion 6    

 

 
  3rdParty      
    Bin C60CBNX.DLL  
      GDIPLUS.DLL  
    Docs CoolButtons CoolButtons.HTM
    Examples CoolButtons CoolButtonsDemo.APP
    Lib C60CBNX.LIB  
      C60CBNXL.LIB  
    LibSrc CoolButtons.INC  
    Images CoolButtons Style images
    Template CoolButtons.TPL  
  s
      s

 

s s s s
  Redirection File   s
 

[Common]
*.DLL=C:\Clarion6\3rdParty\Bin
*.TP?=C:\Clarion6\3rdParty\Template
*.LIB=C:\Clarion6\3rdParty\Lib
*.JPG=C:\Clarion6\3rdParty\Images
*.GIF=C:\Clarion6\3rdParty\Images
*.PNG=C:\Clarion6\3rdParty\Images\CoolButtons
*.INC=C:\Clarion6\3rdParty\Libsrc

  s
      s

 

Adding CoolButtons to your Application

 

Scenario 1 : Single exe

 

  1. Click the Global button and click the Extensions button on the Global Properties window.

  2. Click the Insert button and then select the EnableCoolButtons Extension.

  3. Click OK to close the global settings dialog.

 

Scenario 2 : Multi exe with data dll

For the data dll.

  1. Click the Global button and click the Extensions button on the Global Properties window.

  2. Click the Insert button and then select the EnableCoolButtons Extension.

  3. Click the Advanced tab

  4. Check the This is a multi DLL application

  5. Check the This is the data DLL

  6. Click OK to close the global settings dialog.

For the exe and other dllís.

  1. Click the Global button and click the Extensions button on the Global Properties window.

  2. Click the Insert button and then select the EnableCoolButtons Extension.

  3. Click the Advanced tab

  4. Check the This is a multi DLL application

  5. Click OK to close the global settings dialog.

 

The CoolButtons Templates

 

EnableCoolButtons Extension

 

 

Button Style

This style will be used as the default style for all windows in your application.  Selecting one of the 3 standard styles results in the graphic images for that style being linked into your application.

 

The "Use INI File" option is provided for testing button images which are read from disk each time a procedure is run.  This is NOT intended for normal application use.  When you application is run with this option selected then a "template" INI file is created and populated with all the relevant INI entries.

 

The Custom option is used for adding your own graphic images.  See Custom Style for more details.

Button Transparency

0 is invisible and 255 is opaque (solid, no transparency).   This transparency factor is applied to the existing transparency in the graphics images.

Button Text Font

You may customize your Button text font settings here.  This is very useful because with dark coloured buttons the default black text becomes difficult to read.

Button Colour

The hue (colour) that you select is used to recolour the button images.  Any white, black or gray in the image is left unchanged.  If you select a RGB colour then the hue (hue saturation luminosity) of that colour is calculated and used.

Special Buttons

The Special buttons form is used to selectively recolour buttons, replace button icons or select special button images.  Include and exclude filters are provided for ease of use.  See Special Buttons for more details.

Button Properties

Use this setting to override the default button properties.

 

CoolButtons Extension

 

 

Checking the "Disable CoolButtons in this procedure" will remove all CoolButtons template generated code from this procedure.  This can be used to exclude individual windows from getting a CoolButtons style.

 

 

Buttons to Ignore

CoolButtons is NOT applied to these buttons.

Override Button

Buttons may be recoloured, button icons may be replaced and special button images may be assigned on a per control basis.  See Override Button for more details.
 

Override Button

 

Button equate

This identifies the button control to be modified.  Select one from the list.

Button type

Use the button type to select which button image to use.

Button Text Font

You may customize your Button text font settings here.  This is very useful because with dark coloured buttons the default black text becomes difficult to read.

Button Transparency

0 is invisible and 255 is opaque (solid, no transparency).   This transparency factor is applied to the existing transparency in the graphics images.

Button Colour

The hue (colour) that you select is used to recolour the button images.  Any white, black or gray in the image is left unchanged.  If you select a RGB colour then the hue (hue saturation luminosity) of that colour is calculated and used.

Replace button icon

If the button already has an icon then check this option to replace the icon with another icon.  This can be useful where the new button colour clashes with the default icon.

Icon image

Specify the icon file name to use as a replacement.

 

Custom Style

 

Standard Button

Used to set the images for the normal button.  This is required.  See Standard Button for more details.

Lookup Field Button

Optionally replace the "Lookup Field" images.  Note that you can use the "Lookup Field" images for any purpose you choose, the "Lookup field" label is just a label.  The same goes for the Lookup File, Back and Forward Buttons.

Lookup File

Optionally replace the "Lookup File" images.

Back Button

Optionally replace the "Back Button" images.

Forward Button

Optionally replace the "Back Button" images.

Standard Button

 

 

Button Images

Enter all the image names manually here.  See Button Images for more details.

Button original Hue / Colour

The original hue is used in the image re-colour process.  If none is supplied then the colour in the center of the image is used.  

Button Images

 

 

The various image heights are necessary because compressing transparent images yields very poor results.  The beautiful soft edges become ugly jagged edges.

Special Buttons

 

Button type

Use the button type to select which button image to use.

Button selection properties

At least one of the "+" conditions must be met for the button to have this "style" applied.  If any of the "-" conditions are met then the button is NOT modified.  None of the condition tests are case sensitive.  The conditions are met if the supplied substring is found anywhere in each of the button property strings.

 

Button Text Font

You may customize your Button text font settings here.  This is very useful because with dark coloured buttons the default black text becomes difficult to read.

Button Transparency

0 is invisible and 255 is opaque (solid, no transparency).   This transparency factor is applied to the existing transparency in the graphics images.

Button Colour

The hue (colour) that you select is used to recolour the button images.  Any white, black or gray in the image is left unchanged.  If you select a RGB colour then the hue (hue saturation luminosity) of that colour is calculated and used.

Replace button icon

If the button already has an icon then check this option to replace the icon with another icon.  This can be useful where the new button colour clashes with the default icon.

Icon image

Specify the icon file name to use as a replacement.

 

The CoolButtons Classes

 

The CoolButtons classes have a lot of methods and properties.  The few that you might like to use are detailed below.  The class is prototyped in the include file Clarionxx\3rdParty\LibSrc\CoolButtons.inc where you can view the full listing.

 

s s s s
  Properties   s
 

CoolButtonsDefaultsClass.Disable

byte Set to TRUE to "remove" CoolButtons from your application at runtime.  Only affects windows that are not already open.
CoolButtonsDefaultsClass.Opacity long The range of values is [2 to 254].  A value of 2 is completely transparent.  This "transparency" factor is applied to the button images.  Any existing transparency in the images is added to.  This has the effect that transparent parts of your images always remain transparent.
CoolButtonsDefaultsClass.ButtonStyle long This property is only used on opening a window.  It will not change buttons on windows that are already open.

The 3 standard styles expect the graphics images to be linked into your application.  If you would like the CoolFrames global template extension to link in all the images, not just the single style selected then check the "Include All Style Images in Project" option on the Advanced tab.  

cbSTYLE_ROUNDED equate(1)
cbSTYLE_3D equate(2)
cbSTYLE_JELLY equate(3)
cbSTYLE_USEINI equate(4)
cbSTYLE_CUSTOM equate(5) 

CoolButtonsDefaultsClass.ButtonHue long The range of values is [0 - 239]
Use this property to specify the hue for the Standard buttons. 

Use -1 to leave the images in original state.

CoolButtonsDefaultsClass.ButtonColour long This property is only used if the hue is -1.  The ButtonColour expects a clarion color such as COLOR:RED.
CoolButtonsDefaultsClass.FontColour long The FontColour property expects a clarion color such as COLOR:BLACK.
  s
      s

 

s s s s
  Methods   s
 
AutoFillNames (string Prefix, string Ext, long ButtonType=cbSTD_BUTTON) cbSTD_BUTTON equate(1)
cbFORWARD_BUTTON equate(2)
cbBACK_BUTTON equate(3)
cbLOOKUPFILE_BUTTON equate(4)
cbLOOKUPFIELD_BUTTON equate(5)
UpdateRadioButtons (long ButtonParentEquate) Use to update all radio buttons to new settings in the radio Option.
SetRadioPropDisable (long ButtonEquate,long NewRadioDisable) Use to set the {prop:disable} of individual radio buttons.
SetRadioPropHide (long ButtonEquate,long NewRadioHide) Use to set the {prop:hide} of individual radio buttons.
SetPropFlat (long ButtonEquate,long NewPropFlat) Use to set the {prop:flat} of  buttons.
GetPropFlat (long ButtonEquate),long Use to get the {prop:flat} of  buttons.
  s
      s

 

 

License and Copyright

 

This product is copyright © 2007 - 2014 by PurpleSwift Software CC.  Your application(s) do not require any licensing or royalties for including CoolButtons.

 

This product is provided as-is. Use it entirely at your own risk. Use of this product implies your acceptance of this, along with the recognition of copyright stated above. In no way will PurpleSwift Software CC, their employees or affiliates be liable in any way for any damages or business losses you may incur as a direct or indirect result of using this product.

 

 

Distribution

 

CoolButtons is now compiles from source - no DLL will be needed for distribution with your application.

 

For running under Win98 and Win2K you will need the GDIPLUS.DLL.

 

If you have used your own graphics images then these will also be required unless they are linked into your application.

 

 

Compatibility

 

CoolButtons supports ABC, Legacy, DLL mode, Local mode and Multi-DLL applications.

 

CoolButtons has been tested under Win98, Win2K, WinNT and WinXP.

For running under Win98 and Win2K you will need the GDIPLUS.DLL.

 

 

Updates

 

Download the latest version of CoolButtons from www.purpleswift.com/tools/CoolButtons/CoolButtonsInstall.exe

 

 

FAQ
  1. How do I change the button style at runtime?

    To have the graphics images for the other styles available (compiled in) check the Include all style images in project option on the advanced tab.  Use the ButtonStyle property to select the style at runtime.  Suggested embed point : Global Embeds, AfterCoolButtonsGlobalSettings.

    Example :  CoolButtonDefaults.ButtonStyle =
    cbSTYLE_ROUNDED
     

  2. How do I change the button colour at runtime?

    Use either the
    ButtonHue or the ButtonColour property.  Please note that to use the ButtonColour property the ButtonHue property must be set to -1.  Suggested embed point : Global Embeds, AfterCoolButtonsGlobalSettings.

    Example : CoolButtonDefaults.ButtonHue = 0 ! Pure RED
     

  3. How do I change the button font colour at runtime?

    Use the
    FontColour property. 
    Suggested embed point : Global Embeds, AfterCoolButtonsGlobalSettings.

    Example : CoolButtonDefaults.FontColour = COLOR:YELLOW
     

  4. How do I use my own images for the buttons?

    You select the Custom button style on the CoolButtons global extension Settings tab.  Press the Style Settings button and proceed from there.  See Custom Style for more details.
     

  5. What is the Use INI File option under Button Style on the CoolButtons global extension Settings tab?

    This is used for testing a button image set.  In order to generate the "blank" INI entries, compile and then run your app with this "style".  You can then edit the INI file and fill in all the button image properties to use for testing.   Note that this is intended for testing only.
     

  6. Why do I see a rectangular frame around my buttons?

    This occurs when you have not included an XP Manifest in your exe.   See App Settings tab in Global Properties.
     

  7. My app has many windows and I only want to add CoolButtons to a few windows.  Is there a better solution than going to each procedure and Disabling CoolButtons?

    Use the Set CoolButtons default setting to Disabled option on the Advanced tab of the CoolButtons Global extension.   You will then only need to Enable CoolButtons in the required procedures.
     

  8. Some of my procedures that use third-party templates do not have CoolButtons.  How can I add the CoolButtons extension to these procedures?

    Use the Add CoolButtons to all procedures except SOURCE option on the Advanced tab of the CoolButtons Global extension.  If you open the extension dialog on the offending procedure then the CoolButtons template will appear.
     

  9. How do I apply CoolButtons to my radio buttons?

    In the procedure CoolButtons extension press the Override Button on the Settings tab.  Inset a new override.  Check the Include Radio Buttons option and then select the required radio buttons (option) field equate and then press OK to save.

    Please note that runtime changes to the radio buttons parent option properties might not reflect in the radio buttons for example setting the option {prop:use} value.  The CoolButtonsClass.UpdateRadioButtons() method is provided for this purpose.  Please see the CoolButtonsDemo.app for an example application.  

    Also note that the individual radio button {prop:hide} and {prop:disable} should be changed using the SetRadioPropHide() and the SetRadioPropDisable() methods.

 

Version History

 

Version 1.10 beta (17 February 2014)

  1. Dropped compiled LIB and DLL distribution, now compiles from source code.

  2. Added C9 to the installer.

Version 1.09 beta (9 November 2011)

  1. Added clarion 7.3 build 7900 version to the install file.

  2. Fixed bug in legacy DLL mode compiles.

  3. Added clarion 8.0 build 8658 version to the install file.

  4. Changed the install password - C8 support is an paid for upgrade.

Version 1.08 beta (22 July 2010)

  1. Added clarion 7.1 build 6545 version to the install file.

  2. Added clarion 7.2 build 7248 version to the install file.

  3. Added cb_TemplateDisabled equate for use with OMIT('*** CB Stuff ***',cb_TemplateDisabled)

  4. Added support for radio buttons.  See FAQ 9.

  5. Added SetPropFlat method to allow runtime changing of the {prop:flat} property.

  6. Added GetPropFlat method to allow runtime reading of the {prop:flat} property.

  7. Added SetRadioPropHide method to allow runtime changing of a radio {prop:hide} property.

  8. Added SetRadioPropDisable method to allow runtime changing of a radio {prop:disable} property.

  9. Added UpdateRadioButtons method to re-sync the radio buttons to changes in the option.

  10. Fixed bug where buttons with {prop:default} set were not properly drawn.

  11. Dropped support for C55 - removed from the install file.

Version 1.07 beta (23 April 2009)

  1. Added clarion 7 build 5349 version to the install file.

  2. Added DLLs loaded check.  Window calls during DLL loading is not allowed.

Version 1.06 beta (12 August 2008)

  1. Added support for the clarion QBE.

  2. Modified the CoolButtons.disable using a Global variable to work in a multi DLL app.   Note : Global variable is now required to be declared as type BYTE.

  3. Added version info to DLL's

  4. Fixed bug in template where importing procedures from a CoolButtons .APP created duplicate CoolButtons extensions which you could not delete.

  5. Added Clarion 7.0 beta install.

  6. Added runtime object initialization check. 

  7. Added Set CoolButtons default setting to Disabled option.   See FAQ 7.

  8. Added Add CoolButtons to all procedures except SOURCE option.  See FAQ 8.

 

Version 1.05 beta (9 August 2007)

  1. Fixed bug where CoolButtons caused GPF after standard "confirm delete?" messagebox.

Version 1.04 beta (8 August 2007)

  1. Added support for button resizing.

  2. Fixed bug where "Special buttons" did not work with multi DLL apps.

  3. Revamped images for colour consistency and size.

  4. Fixed bug where re-colouring produced white blotches in some images.

  5. Fixed bug where the button background was sometimes corrupted.

Version 1.03 beta (9 May 2007)

  1. Fixed bug where some buttons were drawn with overlapping graphics and incorrectly sized.

Version 1.02 beta (1 May 2007)

  1. Fixed bug where tall buttons were drawn with trashed graphics.

  2. Removed some OutputDebugString debugging statements.

  3. Added SmallCross.ICO to the install - was missing from the example.

Version 1.01 beta (26 April 2007)

  1. Fixed GDI handle and memory "leak".

  2. Added support for button icon replacement.

  3. Added support for selectively colouring buttons.

  4. Added support for user graphics as button images.

  5. Updated documentation.

  6. Updated FAQ's

  7. Reduced memory usage. 

 

Version 1.00 beta (12 March 2007)

  1. Initial release