I got an email this morning from a customer who was trying, without any success, to change the text of items in a Drop Combo control in PowerToolbar at runtime. The simplest way would be to simply use:

Toolbar1.SetItemText(MyItem,'My Text')

Unfortunately that only works for drop buttons, not Drop Combos. I figured it would be a simple task to add a method to do this but ran into a brick wall. The brick wall was the APIs used to construct Drop down Combo controls do not have any messages or methods to change the text for a given item! It seems to be set in stone once the item is created. So what can you do? The simple answer is to recreate the Drop Combo items! It is very fast and as far as I can tell it does not cause any flicker.

If you want to restore the text in the entry field, you need a single CSTRING variable to contain the text. Below is the code needed to reset the items in the Drop Combo:

Loc:Str = Toolbar1.GetText(ID1_DropCombo)
Toolbar1.DeleteItems(ID1_DropCombo)
Toolbar1.AddComboItem(ID1_DropCombo, 'NEW Drop combo item 1', )
Toolbar1.AddComboItem(ID1_DropCombo, 'NEW Drop combo item 2', )
Toolbar1.SetText(ID1_DropCombo,Loc:Str)

In this case Loc:Str is a CSTRING(100) variable that is a temporary buffer for the contents of the Drop Combo edit control. The Toolbar1.DeleteItems deletes ALL the items from the list and the next two Toolbar1.AddComboItem lines add two new items to the list. The Toolbar1.SetText resets the text in the edit control and you are back where you started except you now have updated items in your list.

Arnor Baldvinsson

This past week both Sue and I have been suffering from the H1N1. Our daughter, Laila, got over it in two days and didn't really get sick with it, lucky her!

The problem isn't that it has been so bad - it hasn't! Neither of us has had fever, chills or bone aches, which we usually get with the flu, just nasty caugh og really bad fatigue. If there is one word that sums up H1N1 for us it has to be "TIRED"! As I'm writing this I don't really feel bad at all, still some caugh, but I have about as much energy as a disconnected spark plug - i.e. none at all! We are certainly grateful that it hasn't been worse, but it's that in-between state where you are not really sick but you can't really do much that isn't much fun.

So things are pretty much in very slow motion here these days and I apologize if emails have not been answered immediately! Hopefully we will be over this in a day or two:)

Arnor Baldvinsson

2

In my last blog I described my experience with the 1.5TB Seagate FreeAgent Desk external drive that I bought from Costco.

Instead I ordered a Coolmax CD-391T-U2 enclosure from TigerDirect and a 1.5TB Western Digtial drive. Wednesday I received the enclosures and the drive and immediately put the drive in. It was a bit tricky to put this together and the USB cable that came with it was only about 14-16" long. I plugged it in and the first thing I noticed was how loud the fan was. It was disturbingly loud!

First thing was to partition and format the drive and I knew that would take a while so I set it to do that over night. The morning after it was still formatting and I realized something was not right, so I stopped the formatting process and reconnected the drive to another USB port with another cable in case it was a cable/port problem.

8 hours later it was finally done with the format process so yesterday afternoon I started a backup process. I immediately realized that something was not right. It was barely getting 1MB pr. second transfer rate to the new drive. After messing around with it I realized that the enclosure seems to be having an issue with the USB to SATA conversion OR that it is actually designed for USB 1.1 not USB 2.0! So I decided to not mess with this and I am returning those to Tiger Direct.

After hours of checking things out I decided on my next enclosure to test out, a Vantec NexStar 3 NST-360SU-BL enclosure that supports both USB 2.0 and eSATA which supports up to 3Gbps (Gigabits per second) transfer rate compared to 480Mbps (Megabits per second) for USB 2.0 and only 12Mbps for USB 1.1! I should have those sometime next week and will report my experience with those. The Vantec does not have a fan so it should be quiet. It does come with both USB and eSATA cables (unfortunately the machine I'm using this with doesn't have an eSATA port, but more on that later) and get's 4.7 stars out of 5 available in 94 reviews on TigerDirect. The price is (currently) the same as the CoolMax, or US$29.99.

Arnor Baldvinsson

In September I bought a 1.5TB Seagate FreeAgent Desk external drive from costco.com. I had been looking for an external drive solution for backup purposes for a while and the FreeAgent drives looked good and we had previously bought two 500GB drives that performed without a single problem.

FreeAgent Desk

I plugged the drive in and everything looked good. I set up all my backup processing using the two backup software I use, InSync from Dillobits and Second Copy, both of which have served me well for years.

After I had set everything up and shared the drive, since part of the backup was from another computer, I rebooted my computer to make a clean start. That's when the problems started. During bootup I got an error message about a drive being problematic, don't remember exactly what it was, and the disc diagnostic program insisted to run on my C: drive. Everything checked out and no problems were reported.

I set all my backup processes to start and did some direct copying as well and after about 12 hours all the data was in place. For the next few days everything worked fine, but then one day I got an error message from windows telling me that there was a write error and it couldn't write the Q:\$MT file or something like that, Q:\ being the drive letter of the FreeAgent drive. This persisted for a few days and then everything seemed to be working ok again and for the next 5 weeks or so no problems at all, so I decided this was something for the history books.

About 3 weeks ago I decided to buy another drive of the same type so I can rotate the drives for an off site backup, which I use the removable drives for. I have been very busy lately and I delayed putting up the drive until last weekend.

This new drive started out with write errors from the start. I re-partitioned and re-formatted the drive twice to see if I could get it to work, but no help. I ended up returning it to Costco for a full refund.

So I did some research online to try to find out what the heck is going on with those drives. Well, you don't have to look very long to find people who have had a lot of problems with the 1.5TB FreeAgent drives! One of the websites I found was this one. It claims that the problems are caused by overheating, which I can relate to since there is no ventilation for the enclosure, it is completely closed off! I could also feel it getting pretty hot and someone that posted about this had measured the drive temperature getting up to 250

A customer contacted me and sent me some screenshots of a menu themed with PowerToolbar that had several menu items missing from the last menu on the menubar. It was obvious that something was not working correctly so I asked him to export the appframe to TXA and email it to me. After duplicating this problem yesterday I spent couple of hours today investigating what was going on. Here is a screenshot of the menu:

Missing menu items

Something was obviously wrong and my initial investigation wasn't promising. The API calls that get the information about each menu item simply weren't returning the text for the menu items! My suspicion was directed to a big menu with several levels of submenus as a possible culprit because it was the menu next before the trouble menu. So I cut it out of the source and lo and behold the Help menu worked again! I painstakingly copied the items and menus back into the menu until the Help menu failed and I had found the culprit.

One of the MENU statement had the HIDE attribute on it, and something about that set the menu item organization completely off and plunged the next menu into a deep hole! The fix was very simple, just remove the HIDE attribute from the MENU and add a one line of code into ThisWindow.Init to hide the menu.

 ?ReportsAddressBook2 {PROP:Hide} = TRUE

That's all there was to fix this problem. The menu now looks like it should:

Missing menu items fixed

This customer had also noticed another problem which was that the hotkey text on a menu item would disappear if the menu had a submenu and the submenu had been displayed. After some digging around I also found the culprit for that problem. When the submenu opened and closed the hotkeys for the items in the parent menu weren't reloaded so the width of each item was set to 0. This caused the hotkey text to be effectively drawn to the right of the menu. This is now fixed in build 2.0.118 which will be made available to the public after the weekend:)

Arnor Baldvinsson

5

One of the features of Clarion 7 is code completion, also called intellisense. Unfortunately it does not work in the embed editor but it does in the source editor and the Embeditor. The Embeditor is what you get when you right click on a procedure and select "Source" from the popup menu or open the Embed tree and click the Source button.

In one of the recent builds, Softvelocity gave us an option to open the Embeditor when we double click on an embed in the embed tree and thus give us full use of the intellisense.

It is easy to set this up once you know where to look! Which is why I'm writing this as I have to hunt this down every time I do a clean install of C7.

But before we go further, I want to clear up something that causes a lot of confusion.

In Clarion there are 3 editors:
Source editor: This is what you get when you open a source file for editing. This editor works like any other editor and edits files only.

Embed Editor: This is the editor that you get when you go into an embed via the embed tree. This editor only displays one embed and does not have code completion.

Embeditor: This is the editor that you see when you right click on a procedure and select "Source" or hit the "Source" button in the embed tree. This editor shows all embeds and does have code completion.

There are three places that affect the code completion. To set it up, please follow these steps.

1. Open the Tools menu and select "Application Options" Note that this option is disabled if an application is loaded.

Clarion 7 Tools Menu

2. Go to the "Embed Editor" tab and make sure that the "Edit source embeds in context by default (Using Embeditor)" is checked.

Clarion 7 Embed Editor Options

This allows you to use the Embeditor instead of the Embed Editor when you open an embed from the embed tree, giving you full access to the code completion.

3. Open the Tools menu and select the "Options" item which is at the bottom of the menu.

4. Select the "Text Editor | Code Completion" node in the tree on the left and check the options you want active. I believe that the settings I have are the default settings.

Clarion 7 Code Completion Options

5. Finally make sure that Code Completion is active in the Edit menu.

Clarion 7 Code Completion setting

Now when you double click on an embed entry in the embed tree, you will be taken directly into the Embeditor where you can edit your embed in context and get full use of the code completion/intellisense feature!

Clarion 7 Code Completion in the Embeditor

I hope this helps some people who are lost in where exactly to set this up.

Arnor Baldvinsson

1

Several weeks ago someone in the Clarion world mentioned LogMeIn to me as a way to remote control your computers. So I downloaded and installed their freeware version of it on my laptop and the two desktop computers that I work on.

LogMeIn

On mornings like today, when the weather is cool and crips, it is very nice to be able to light a fire in our wood stove in the living room and park myself in front of it with my laptop and access my desktop computers. It works pretty well on our LAN (which is mostly 1GB, cat 6, but my laptop is obviously wireless) and it is free! I have not yet experimented with LogMeIn over the internet.

The only problem I have had is that when I connect to my laptop from the desktops, it tends to log off after a few mintues and I have to keep logging in. I'm not sure what that is about but I rarely need to use that so it is not a big deal.

You can run it in full screen or you can run it contained within the browser. The color dept can be determined but beaware that it actually changes the color dept on the machine you are connected to. The color dept is restored when you diconnect from it, but it might cause confusion if you look at the screen you are controling;)

All in all, definitely worth looking into if you need to remote control your computers. They also have Pro2 version and several other products that can be combined to create powerful remote control setup to control external computers and create VPN settings but those products are not free and generally require a monthly or an annual subscription.

Arnor Baldvinsson

One of my customers contacted me couple of days ago to ask if it was possible to sort items in a drop button, when the items are created at runtime. Since the items are stored in a queue I figured it would be fairly easy.

 Toolbar1.DeleteItems(ID1_Name)

 Toolbar1.AddDropItem(ID1_Name,'Arnor','ok_16.ico',1)
 Toolbar1.AddDropItem(ID1_Name,'Robert','ok_16.ico',2)
 Toolbar1.AddDropItem(ID1_Name,'Monica','ok_16.ico',3)
 Toolbar1.AddDropItem(ID1_Name,'Ana Maria','ok_16.ico',4)
 Toolbar1.AddDropItem(ID1_Name,'Ivan','ok_16.ico',5)

 Sort(Toolbar1.BandQ.ControlQ.pDropButton.ItemQ,|
      Toolbar1.BandQ.ControlQ.pDropButton.ItemQ.szTxt)
 !! Reset the ItemIDs after sorting the queue.
 Loop I# = 1 To Records(Toolbar1.BandQ.ControlQ.pDropButton.ItemQ)
   Get(Toolbar1.BandQ.ControlQ.pDropButton.ItemQ,I#)
   Toolbar1.BandQ.ControlQ.pDropButton.ItemQ.ItemID = I#
   Put(Toolbar1.BandQ.ControlQ.pDropButton.ItemQ)
 End
 Display()

Note that this will not work properly if you have separators in the drop items. If you want to do that, I would suggest to add the item text entries to a queue and sort them before you add them to the drop button. Something like this might work:

AddDropButtonItems         ROUTINE
 Data
Q   Queue
T     CString(256) !! Item text
SF    Byte         !! Separator Follows
    End
 Code
 Q.T = 'Arnor' ;     Q.SF = False; Add(Q)
 Q.T = 'Robert' ;    Q.SF = True;  Add(Q)
 Q.T = 'Monica' ;    Q.SF = False; Add(Q)
 Q.T = 'Ana Maria' ; Q.SF = False; Add(Q)
 Q.T = 'Ivan' ;      Q.SF = False; Add(Q)
 Sort(Q,Q.T)
 Toolbar1.DeleteItems(ID1_Name)
 Loop X# = 1 To Records(Q)
   Get(Q,X#)
   Toolbar1.AddDropItem(ID1_Name,Q.T,'ok_16.ico',1)
   If Q.SF = True !! Add Separator
     Toolbar1.AddDropItem(ID1_Name,'-','ok_16.ico',1)
   End
 End

 Display()

This should be able to handle sorted list with separators. I'm planning to add a method to sort the items alphabetically and I think I can make it handle the separators correctly too. The method I describe here is a bit more flexible as it gives you full control over how the items are arranged.

Arnor Baldvinsson

On some of the XP-Theme product download pages it was stated that XP-Theme works with Clarion 5.5. This is not correct. When the source was moved up to Clarion 6.0 by PowerOffice there were quite a few modifications made to the code to make it thread safe in the new Clarion 6 threading model. Unfortunately this also made the code incompatible with Clarion 5.5.

Since it is seven and a half years since the last Clarion 5.5 build was released (May 29, 2002 according to my zip files) I will not be attempting to port the current product back to 5.5 compatibility.

I have updated the website and download information to reflect this and hopefully I found all the places it was mentioned. If you see somewhere that XP-Theme is compatible with Clarion 5.5, I would appreciate it if you would please let me know:)

Arnor Baldvinsson

One of my customer asked how he could hide and unhide a band on a PowerToolbar on the application frame from a PowerToolbar button on his MDI window.

In order to do this you need to set up the MDI client template on the MDI window. PowerToolbar uses a global instance of the POToolbarGlobalClass to control the appframe toolbar from other threads. You can take a look at some of the methods in the online documentation.

The code you need to toggle the visibility of a band looks like this:

If AppToolbar.GetBandVisible(TB1_TestWindowBand) = True
    AppToolbar.SetBandVisible(TB1_TestWindowBand, False)
Else
    AppToolbar.SetBandVisible(TB1_TestWindowBand, True)
End

That is pretty much all there is to it. This is exactly the same code as you would use on the appframe itself.

Arnor Baldvinsson