Ask Dr. DePhobia - Questions and Answers about Clarion

by Jim DeFabia

Published 1998-11-01    Printer-friendly version

Q:

I am using flat buttons on a window. When the window opens, one of the buttons is raised. How can I flatten it?

A:

First of all let me warn you that you should never use a steam iron on your monitor. Not only can it cause damage, it will not flatten a button.

Seriously, the reason you see one button raised is because it is selected when the window opens. You can avoid this in one of two ways:

The first method is to add the SKIP attribute to the BUTTON. This prevents it from being selected. It only appears raised when the mouse is over the button. However, this also prevents users from using the tab key to select the button.

The second is to ensure another control (anything except a BUTTON) is the first in the tab order. This prevents it from appearing raised when the window opens, an enables a user to tab to the button and press it using the spacebar or enter key. Users who prefer using the keyboard over using the mouse will love you for this.

I have a file that has an autoincrement key on it. How do I set it so it starts at a specific value instead of 1? My company does not want a customer file with customer numbers starting with the number 1.

You can use the Database Manager (from the Dictionary Editor, press the Browse button) to add one record and edit the auto incrementing field to one less that the specific value you want to begin with.

Subsequent adds increment from that number.

Keep in mind that years from now, you won't know who your first customer is. But if anyone asks which is number one, just say, "They are all Number One!"

In Clarion 5 Enterprise Edition, I learned that Data Modeller can create test data. I find this useful, but want more data types than Data Modeller supplies in their generation database. Do they plan on adding any?

I don't know if they plan any additions, but this feature was designed for easy customization and extensibility.

Data Modeller creates data using the following methods:

  • Sequence Number which creates autoincrementing values from a specified Low Value.
  • Leave Empty which, as is says, leaves the field empty.
  • From List which randomly select a value from a list you create.
  • Relational selects values from a related file.
  • Random Create fills the field with random data.
  • By Length creates random data to fill the declared picture.
  • Fill From creates data the Generation Database.

Your question is about using the generation database and that is the feature that has exactly the extensibility you want. The generation database is just a TopSpeed file that is included with the Data Modeller installation. It contains a few hundred records of some commonly used data types (e.g., First name, Last Name, Address, etc.). If you want more, you can make your own file (or use one from any other project you have worked on in the past). Remember it must be a TopSpeed file (.TPS) and be named DMGEN.TPS. Place it in your \Clarion5\BIN directory and it is the file Data Modeller uses as the generation database.

Q:

I heard about the feature in Clarion 4 which allows you to search all the Clarion documentation PDF files. Can you explain how to use this feature?

A:

First of all, you must install the Adobe Acrobat Reader with Search. This is included on your Clarion CD.

  1. After installing, start the Acrobat Reader.

To do a query, you must first load an index.

  1. Select Tools -> Search -> Indexes.
  2. For Clarion 4, add C4index.pdx. For Clarion 5, add C5index.pdx.

You can add both. Keep in mind that you can choose which indexes to use during a search. If you are using both Clarion 5 and Clarion 5, you probably only want to search one set of manuals.

  1. Now, to conduct a search across all manuals, select Tools -> Search -> Query (or press ctrl+shift+F).
  2. To select the index to use, press the Indexes button.
  3. Check the box next to the index to use, making sure to clear any others.
  4. Define a search query and press the Search button. It will list documents that match the query.
  5. Double-click a document that seems likely to contain the information you want.
  6. To go to the next hit in the query, select Tools -> Search -> Next (or press ctrl+U).

Happy searching!

Q:

I am using Clarion 5 and want to add a drop list to a browse box using edit-in-place. Is there an easy way?

A:

It is very easy to use a static list. It only takes three lines of embed code.

To create an edit-in-place drop list from a static list:

  1. Enable Edit-in-Place by checking the Use Edit In Place Checkbox on the Update Buttons Extension template.

useEIP.GIF

  1. Press the Configure Edit in Place button.
  2. Press the Column Specific button.
  3. Press the Insert button, then press the ellipsis button to select the field from the file schematic.

Columns.GIF

Specific list adds the embed point we need.)
  1. Press the OK buttons all the way out.

Next, we'll embed the code to create the drop list and provide the data for the list.

  1. In the Local Objects, EditInPlace::CUSState, CreateControl, Code embed point, after the Parent Call, embed this code:
SELF.Feq = CREATE(0,CREATE:droplist)
Self.Feq{Prop:USE}=CUS:State
Self.Feq{Prop:Drop}=6
Self.Feq{Prop:FROM}='AL|MS|FL|GA|LA|SC'

EIPEmbed.GIF

  1. Save your embedded source and close the Embedded Source dialog.

That's all there is to it. I told you drop lists were drop-dead simple!

 

Submit your questions to jim-d@topspeed.com

Printer-friendly version

 
 

Search

 

Advanced Search
Topical Index

Related Articles

Subscribe to
ClarionMag

One year: $184

(includes all back issues since '99)

Renewals from $134

Two years: $274

Renewals from $224

More Info

Subscribe Now!

ClarionMag Blog

RSS Feeds

Updates via Email

Enter your Email


Powered by FeedBlitz

Quick Links