You may find that you need to dynamically change the text in a header or item. This is a bit tricky in the currently public release, but is made much simpler in the next release.

In the current release, 2.0.111, you need to add a few lines of code to make this work. First of all you need to declare a group in your procedure data embed:

TskI GROUP(POB:TaskInfo)
     End

This declares a group that you then need modify.

 TskI = Outlookbar1.GetTaskInfo(OutlookBar1.Outlookpanel,0)
 TskI.Title = 'Changed Outlookbar Title'
 Outlookbar1.SetTaskInfo(OutlookBar1.Outlookpanel,|
                         0,|
                         TskI)

The first line loads the local group, TaskInfo, with the data from the header or item. The second line sets the title in the group and the third line updates the the header or item. Since this is rather awkward we decided to simplify this down to:

OutlookBar1.SetTitle(OutlookBar1.Outlookpanel,|
                     0,|
                     'Changed Outlookbar Title')

To download version 2.0.112, which includes the new SetTitle method, please go to Download Icetips Outlookbar 2.0.112

Arnor Baldvinsson

Sometimes it is necessary to update and refresh controls on the toolbar. In order to do so you need to know the control IDs. You can find those in the templates (see the "ID" field in these screenshots) or you can open the source for the procedure in the embeditor (right click on procedure and select "Source" from the popup menu) and locate declaration of the toolbar class (search for "POToolbarClass"). The IDs will be declared rigth above it and the control IDs start in a number range of 10,000.

Here is an example on how to update couple of entry fields and a checkbox button:

 loc:query     = SEA:Terms
 MinAsk        = SEA:MinAsk
 MaxAsk        = SEA:MaxAsk
 Toolbar30.SetText    (ID30_SearchEntry, loc:Query)
 Toolbar30.SetText    (ID30_MnPrice,     MinAsk)
 Toolbar30.SetText    (ID30_MxPrice,     MaxAsk)
 Toolbar30.SetChecked (ID30_Haspic,      Sea:HasImage)
 Toolbar30.Refresh(True)

Note that in order to make sure that everything is updated correctly you need to use Refresh(True) rather than just Refresh()

Arnor Baldvinsson

How can you execute an action in XP Taskpanel in code?

This is actually very simple to do, but may not be obvious. The following code was tested in the XPTaskpanelDemo_C6.app in the OpenWindow event handler in the ToolboxMenu procedure:

TaskPanel1.ExecuteAction(TaskPanel1.Demos, |
                         TaskPanel1.Demos:Colors, |
                         MouseLeft, 0)

This opens the Color Demo window when the taskpanel window opens.

Arnor Baldvinsson

1

In early 2008 I enrolled in the Microsoft Empover ISV program, which gives you access to various developer tools, MSDN subscription, etc. etc. It costs US$375 to enroll and you can re-enroll if you need to. All in all a very nice program and gives you access to a lot of software.

My Empower subscription was to expire on February 28, 2009 and couple of weeks earlier I went through the re-enrollment process and everything looked fine, except I was never charged for the $375 so I thought perhaps I had forgot how it worked and that it was a one time fee. Turns out that the re-enrollment never completed, for whatever reasons, so I recently found myself without the MSDN subscription and without access to the product keycodes on the MSDN website.

We had heard about the Microsoft BizSpark program so I decided to take a look at it - wouldn't cost anything since it's free. So I signed up for it. Wasn't optimistic that it would go through since it is for startup companies only and I have been signed up for various things at MS for several years. Didn't receive any emails or any further information so I figured it hadn't been accepted. A week later I decided to check it out and see if I could find an email address to write to to inquire about it. To my very pleasant surprise it went right into the member page so the sign-up had been successful. I found out that my MSDN subscription had been extended for 3 years, until July 2012!

To sign up, go to http://www.microsoft.com/bizspark or go to http://www.microsoftstartupzone.com/pages/home.aspx for more information. It is free to sign up, but you are required to pay $100 at the end of the membership period.

The Microsoft BizSpark is an excellent way for developers who are starting out to gain advantage by getting all the latest development tools from Microsoft. This includes anything from QuickBasic 4.5 (which was released in 1988!) to Visual Studio 2010. It includes operating systems from MS-Dos to Windows Server 2008 and Windows 7, including oddbals like Windows 3.2 (16bit). It also includes designer software like Expression Blend, Expression Design etc. The Applications section includes tools such as Access, Project, Front Page, MapPoint, MS Office, OneNote, Outlook, Virtual PC and Visio, which is an excellent database design tool - or at least to print out existing SQL databases. This just scratches the surface!

If you are looking for a good opportunity to bring yourself up to speed with the latest from Microsoft I would suggest that you look into BizSpark. It's free to start so the price is just right:)

Arnor Baldvinsson

Clarion uses dialog units as screen position measurement unit when designing windows. This is fixed and cannot be changed at design time, but it can be changed at runtime. For window design we can use PROP:Pixels and to change to pixels it is a simple matter of setting PROP:Pixels to true for the window object, like:

 WindowLabel {PROP:Pixels} = True

Or:

 0 {PROP:Pixels} = True

Since 0 (zero) always refers to the structure of the current target object. To set the window back to using dialog units, simply set PROP:Pixels to false:

 0 {PROP:Pixels} = False

It may not be immediately obvious, but you can also use a few other measurement units when dealing with windows at runtime. There are 3 more measurement units that can be used: PROP:Thous, PROP:mm and PROP:Points. If you set the properties to false Clarion goes back to dialog units. Normally we would only think of using PROP:Thous, PROP:mm and PROP:Points on reports, but they work equally well on windows!

The smallest unit you can use with PROP:Thous is 1 which equals 0.0254mm. Point is 1/72" equal to about 0.353mm. With millimeters, the smallest unit is 2 (or at least it used to be) or 100 times bigger than the smallest unit with PROP:Thous, which makes it pretty much useless for any precision placements. If I need to set sizes in metric units I convert to 1/1000" It may not always be perfect but for most things I think it is close enough.

If you have a control on a report, for example a fixed width textbox and you want the user of your software to be able to format the contents on a window so that it will look exactly as it will print, you can get the measurement from the report and use it to set the size of the textbox on a window. Let

2

Today we released a new extension for our Icetips Previewer into alpha testing. This new extension allows you to easily add data export to comma separated files to your reports and the Previewer.

A new tab on the "Call Previewer" template has been added where you can select either fields from a file (or local variables) or controls on the report into a list of fields to be exported.
One additional parameter is required on the Previewer procedure and then you add a single button control template on the Previewer window and you are done! We have been developing and tested this with both ABC and Fomin Report Builder reports. This extension does require our Icetips Utilities as it makes use of our string class to construct and export the data. There are no limits to the amount of fields or records that can be added to the export. This is all fully dynamic and there are no limits to the amount of data placed into each field. Data fields and controls can be mixed in the field list and the template suggests the headers and format based on the information from the dictionary and/or the controls on the report.
We expect to release this new addition in 2-3 weeks once it has been through some more testing. If you are interested in beta testing this addition, please drop us an email.

-- Arnor Baldvinsson

There has been some discussion about the fact that Microsoft no longer allows you to customize the start menu in Windows 7 to have the "classic" look. I have to admit that I have been using the Classic menu on both XP and Vista for many years and miss it when I started messing with Windows 7.

After some snooping around I found this article that describes how to set up a new toolbar which acts as a start button menu. Not quite the same, but close enough to get those of us who are suffering from withdrawal symptoms to relax:)

-- Arnor Baldvinsson

I have started posting what I call "Mini-Tutorials" about the Icetips Utilities. The first one is up and is about the String class.

There is a lot of powerful stuff in the Icetips Utilities and we are far enough ahead into this product now that we can start showing people really how they can be used. The tutorials are not about how the classes work, but how you can use them. They demonstrate with simple code how to accomplish certain tasks, in this case for example how to quickly read and write text files without using the Clarion ASCII driver. Also how to export data to comma separated files and even XML.

We will be posting one tutorial every Monday so make sure that you check them out!

-- Arnor Baldvinsson

We have made build 2352 available for download. This build includes mostly updates to the documentation - several more templates have been documented - and it also includes minor fixes to the ReadFileToString and WriteStringToFile methods that would report errors on the wrong api in some circumstances.

We are trying to get into a schedul or releasing something new every Monday but we hit an unexpected problem yesterday so we delayed the release until this morning!

-- Arnor Baldvinsson

1

Two months ago I implemented the Clarion PDF generation templates in a client project. I was pretty horrified by the results as characters were chopped and spaced very strangely. After posting about this on the Clarion newsgroups, Lee White suggested that this was because I was running Large Fonts on my system.

Since I have had to deal with Large Font issues before simply because I use high resolution and need to be able to seeB) I decided to take a closer look at this and see what was going on.

Sure enough the problem stems from code in the ABPRPDF.CLW file where the width of the characters is calculated. To fix this I made some changes to the files.

This involves adding a single method to the PDFGeneratorClass class in ABPRPDF.INC and ABPRPDF.CLW:

Add to class declaration in ABPRPDF.INC (I put it in at the top of the
method list, around line 195):

AdjustDPIValues   PROCEDURE(Long pValue),Long 
!! AB 2009-02-19  Adjusts DPI values

In the classfile, ABPRPDF.clw, I added this:

PDFGeneratorClass.AdjustDPIValues   PROCEDURE(Long pValue)!!,Long 
!! AB 2009-02-19  Adjusts DPI values
HDcScreen  UNSIGNED
IDPI       Long
R          Real
L          Long
 Code
 R = 1
 HDcScreen = GetDC(0)
 If HDcScreen <> 0
   IDPI = GetDeviceCaps(HDcScreen, 88)
   L = ReleaseDC(0, HDcScreen)
   R = IDPI/96
 End
 Return (pValue / R)

In PDFGeneratorClass.AddFontDescriptor method, you have code like this:

!SET the fonts Width
LOOP LOC:I=SELF.FontsNames.FirstChar TO SELF.FontsNames.LastChar
   LOC:CharToTest=CHR(LOC:I)
   IF GetTextExtentPoint32(LOC:DC,LOC:CharToTest, 1,LOC:CharSize)<>0 THEN
      IF LOC:Subclasing THEN
         IF SELF.FontsNames.CharWidth[LOC:I] THEN
            SELF.FontsNames.CharWidth[LOC:I] = LOC:CharSize.eW
         END
      ELSE
         SELF.FontsNames.CharWidth[LOC:I] = LOC:CharSize.eW
      END
   END
END

I changed both of the assignments to the CharWidth to:

SELF.FontsNames.CharWidth[LOC:I] = |
           SELF.AdjustDPIValues(LOC:CharSize.eW)

In PDFGeneratorClass.GetTextWidth method, you have code like this:

 IF SelectObject(LOC:DC, LOC:HFont) THEN
    RV = GetTextExtentPoint32(LOC:DC,pText, LEN(pText),LOC:CharSize)
    LOC:OLDMAPMODE=SetMapMode(LOC:DC,LOC:OLDMAPMODE)
    DeleteObject(LOC:HFont)
    RETURN LOC:CharSize.eW + (LOC:CharSize.eW/20)
 END

I changed the RETURN to adjust the value:

RETURN SELF.AdjustDPIValues(LOC:CharSize.eW + (LOC:CharSize.eW/20))

This takes care of the font sizing problem in any DPI combination that I
threw at it:)

Arnor Baldvinsson