18% off JSDialog Pack

In celebration of my daughter turning 18 in a few days, we are offering 18% off JSDialog Pack orders.

Just use the coupon code MADDIE18 to get the discount.

http://www.jed-software.com/jsd_purchase.htm

Just in time for the next release, which will occur before June.

http://www.jed-software.com/jsd.htm

FireMonkey – iOS styles (problems and solutions)

In this post we’ll discover and solve a couple of glitches in the default styles supplied in FireMonkey for iOS.

  • Create a new FireMonkey iOS HD application.
  • Drop a button on the form and assign an OnClick handler.
  • In the OnClick handler, add code to display a simple message.
    • i.e. ShowMessage(‘You tapped me!’);
  • Run the application (you can do this on windows without going to XCode for this post)
  • Tap/Click on the button

Problem 1 – The default TButton style doesn’t look different when it has been pressed.

To fix this issue stopped the application and perform the following steps.

Right click on the TButton component and select the Edit Default Style… command at the bottom of the context menu.

The Style Designer will load and since we are updating the Default Style, will have the default style name for TButton, which is Buttonstyle.

The style consists of a TLayout, three TRectangle and a TText control.

To rectify the pressed state, grab a TInnerGlowEffect component from the Tool Palette.

Drag the TInnerGlowEffect component from the Tool Palette and drop it on the background TRectangle control.

With the TInnerGlowEffect component selected, you can see the available properties for the control.

Change the GlowColor property to better suit this situation, I chose Black.
Set the Enabled property to False. This is because we only want this effect enabled when the button is being pressed.
In the Trigger property, enter the following “IsPressed=true“. This means then whenever the IsPressed property is true, this effect will become enabled.

After your changes, you object inspector should look like the capture below.

Run the application now and hopefully you will see the effect display when the button is pressed.

Drop a couple of TCornerButton controls on the same application. Set the XRadius and YRadius values to 10 for one of the corner buttons. The sample application should now look something like the capture below.

Problem 2 – Under side of corner button looks strange when XRadius and YRadius values are not 3.

Below is a close up to better display the issue, it is really noticeable if your background is lighter.

To discover what is occuring with this style issue, we need to inspect the source code. Most importantly where the style information is loaded by the corner button control. In FireMonkey style properties should be modified in the ApplyStyle or ApplyStyleLookup methods. The ApplyStyle method for the TCustomCornerButton control is below, seems like everything should work.

Lets take a look at the default style for a TCornerButton.

Hmm, the source code referenced a StyleName called ‘secondbackground‘ button second background has been been set. The TRectangle without a name next to it should be called ‘secondbackground‘.

Use the object inspector to set the StyleName of the un-style-named TRectangle to ‘secondbackground‘.

Successful renaming is identified by your style, looking like the style in the capture below. Don’t set the name property by accident. You can’t set the name property to anything for a style (and have it persist).

Now when you view the form the corner button style won’t looked odd.

Problem 3 – The cornerbutton doesn’t show any effect when it is pressed.

Note how there is no TInnerGlowEffect define for the style. Follow the same steps above for the TButton and add the same effect (with the same property values) to the corner button style. Parent the TInnerGlowEffect to the background TRectangle control.

Problem 4 – The corner button has a TGlowEffect.

Kind of useless in a mobile application which doesn’t have a tab key to navigate between controls! Delete the TGlowEffect component from the style by clicking on the X.

Now you can rebuild and deploy to XCode and run on iOS to make sure these changes work well. Here is a capture from a real iPad (really it is!).

Default Styles

When in the Style Designer you can use the Load Default button to load all of the style details for the applications default style. This allows you to inspect other styles to learn from them. After making changes, I recommend you save the modified style to disk for safe keeping.

I would attach the modified style file to this post for download, but I’m not sure if I’m allowed to.

 

I’ve been doing a quite a bit of work with FireMonkey styles lately trying to make a nice TListBoxItem style. You may hear more about this in the future…

 

 

FastMM4 Gui – Source Code

About 5 years ago, I knocked together a little GUI layer on top of the .INC file for the FastMM4 project. This was to help someone (can’t remember who) that was having difficulties modifying the include file directly with all of the compiler defines.

Occasionally I get requests to update it and/or release the source. Since I don’t actually use it here is the source:

http://www.jed-software.com/files/fastmmgui_src.zip

Some blasts from the past:

Warnings

  • The parsing code is horrible.
  • The ListBox in the UI is custom drawn to display the checkboxes. It really should be a component, but I never got to that stage and haven’t needed such a component since.
  • I changed it today to use generics, but only in one spot so wouldn’t take long to convert back. Originally it was D2006.
  • Removed all warnings when built with XE2, so ThemeServices references were changed to StyleServices.
  • I don’t know how it will look in an unthemed operating system.
  • If you have JSDialog Pack, define JSD to use JSDialog Pack dialogs for messages.
  • There is no license on the code, there is no support on the code. You are on your own! The only caveat to this is if you can’t get a clean compile from the included source code, let me know and I’ll address it.

It isn’t complex code, it is just a bit messy reading the options from the INC file. Note it uses hardcoded start and end points, so these should be adjusted in the .ini file created when the application runs – or set in the source code if no .ini file is found. Method is called LoadDefaultSettings in the MainForm unit.

 

 

 

Ribbon – using a ribbon style for a normal menu

Recently the following QC report was created:

Report No: 102419 (RAID: 289385)          Status: Open
RibbonStyleActnCtrls: No dropdown arrows of Actiontoolbar buttons
http://qc.embarcadero.com/wc/qcmain.aspx?d=102419

I noticed it and included the changes necessary to make it work. Since the ribbon functionality uses additional properties on TActionClientItem, these can be set for normal menu items to get the desired outcome. These additional properties are ignored by existing styles.

An alternate solution is a source code change that is also documented on the report. This source code change is not interface breaking, so you just need to copy the modified file into your applications folder.

 

As noted on the report, a ribbon style won’t work if the user selects the option in the ActionManager to use “large” images. This is due to the large button size on the ribbon being three times the height of a small button, instead of two that the ActionManager expects.

XE Plus Pack – Release 6 (XE and XE2 versions)

A new release of XE Plus Pack is now available to download.

 

For Delphi XE – http://www.jed-software.com/files/XEPlusPackTrial.zip

For Delphi XE2 – http://www.jed-software.com/files/XE2PlusPackTrial.zip

NOTE: Update 3 must be installed for the Delphi XE2 version.

 

XE Plus Pack is a collection of IDE Experts, component editors and property editors available for either Delphi XE or Delphi XE2.

Currently XE Plus Pack consists of eight experts:

  1. Visual Forms (previously available as a separate product)
  2. Activate Project
  3. File Actions
  4. Remember IDE Tree Options
  5. Find Bar Alignment
  6. New Code Template
  7. Bookmark Guide (new in Release 6)
  8. Resolution Selector (new in Release 6)

The registered version costs 40 Euro (for one year and 20 Euro each year after that).

The XE trial lasts for 15 days, the XE2 trial lasts for 30 days.

 

The Bookmark Guide is a replacement for the existing bookmark system.

 

Resolution Selector adds resolution guidelines to the form designer. Also added is a combobox to the toolbar to allow switching the currently designed form between different resolutions.

 

 

JSDialog Pack 2.0.015

A new version of JSDialog Pack is now available to registered users with valid maintenance. If you haven’t received an email with the latest version – please contact me.

 

This version addresses a couple of issues and also adds support for dialog sheets. Dialog sheets are dialogs that drop down from the title bar (or monitor) to display information. Implemented because I needed a way to notify users of non-critical information, which is why the wrapper methods in this version allow a timeout period to be specified.

 

Short video showing dialog sheets in action (same as in previous post): Dialog Sheets. For further examples and videos download and install the updated JSDialog Pack Demos.

 

Updated Demos

The available demos have been updated with seven new demo applications. There has also been four videos added to show the demos running. All demo applications are code signed.

 

December 2011

- New TJSDialogSheet component

- Added ability to customise the appearance of command link buttons

- Make sure clicking on a button in a Radio Group calls theOnControlClick event handler

- Make sure common buttons expand in width for long captions

- Updated documentation

 

Fun Fact – today is exactly five years since the first version was released.

 

 

JSDialog Pack – Upcoming feature

Incase you missed the tweet from last week.

Something new coming in december:

10 secs of video. http://bit.ly/vbVhJ7

JSDialog Pack: Documentation

Work has almost been completed for the “Christmas Release” of JSDialog Pack. When I say almost completed there is still some testing to come and a couple of the new features are shaping nicely.

The new version will be released mid-december but I’ll go further into that when the release is closer.

One thing I’ve been concentrating on the past couple of days is updating the documentation. Unfortunately as a developer, I really like to write code, not write documentation. It is always good to have a good tool to complete this task efficiently and capable of producing a quality output (in multiple formats) in the end.

For my documentation I currently use Doc-O-Matic Professional version 6 (would like to upgrade to version 7, so you folks need to purchase some components ;-) ).

The single most important feature of this product I find is the QA View. It allows me to pin point exactly what properties, methods, classes and units are yet to be documented. It is always a relief to see no red boxes (or red boxes bordered by gray – not exported content). I’ve just finished getting all of the new items documented, as well as catching up on items that were not documented when first introduced.

A good habit I got into was creating the documentation while doing the coding. This is easy to do with Doc-O-Matic supporting a number of source documenting formats. Once I update the Doc-O-Matic project with the latest source version, I then make adjustments to the documentation in the inbuilt editor. It generally works very well and cuts down on the very important requirement to have the code documented for customers.

 

Some useless stats

Topic Count: 2510

Number of topics without content: should be zero

 

Web Help

Build Time: 2 minutes 12 seconds

Size of content: ~22MB

Time to upload to website: couple of hours (2682 files)

PDF Help

Build Time: 1 minute 55 seconds

Size of content: 7.56MB

Page count: 716

Html Help

Build Time: 2 minutes 38 seconds

Size of content: 3.45MB

 

While the PDF and Html Help formats are available to download from the website, I recommend using the online help since it can be updated and doesn’t require an additional download or change notification.

 

QC Plus – [2.0] interface change

I finally got around to upgrading the QC Plus code base from Delphi 2007 to XE2. Since I’ve done that I thought I’d make a little UI adjustment.

Probably not to the liking of some users…

Comments?

As you can see, it is still incomplete…

 

JSDialog Pack – Upcoming feature (custom command link colors)

A new feature in the next release of JSDialog Pack will be the ability to customise the colors used for command link buttons. Since the introduction of VCL Styles in XE2, dialogs can undertake a radial change in colors. While currently dialogs cater for this new feature, the next release will allow greater influence over the colors used for the dialog.

You can download a preview of the editor used to create, modify and save a color scheme. While the UI of this editor will most likely change – the file format shouldn’t need changes. So you can safely save any schemes you come up with for use when the feature is released.

http://www.jed-software.com/files/CommandLinkColorEditor.zip

Command Link Color Scheme - default

 

Command Link Color Scheme - custom