Nebula Research and Development

Pick / MultiValue DBMS Experts

  • Home
  • About
  • Contact
  • Blog
  • Search
  • Login

DesignBais Tip – Referencing Images

When adding an image in the Form Designer, the default Image File value is DBLOGO.JPG. When referring to images, we use this original Image File value, for example: DBIMAGESPEC<1> = "DBLOGO.JPG" This presents a problem as soon as another image goes on the form and you need to refer to it in code – which DBLOGO.JPG do you want?

Sometimes it’s nice to see something other than the generic DBLOGO.JPG placeholder in the form designer. To do this, you could change the Image File value of an image to something more representative of the data, and then create your own corresponding placeholder images. For example, you could create a LOGOPLACEHOLDER.GIF that looks something like a company logo, or a PRODUCT.GIF, or a CUSTOMER.JPG, etc, and then refer to that name in the form and in code. You don’t always need to create an image, it’s easy to copy/paste images from any web page, just right click an image – and be mindful of image ownership rights.

If you do use placeholders, it’s probably a good idea to standardize placeholder names. For example, all placeholder images should be either a GIF, or all placeholders should be a JPG, but mixing them could be confusing. You might also want to use a standard naming convention, like ensuring the filename has a PH in it: PH.PRODUCT.GIF, PH.CUSTOMER.GIF, etc. This makes it easy to find your placeholders under your c:\db\Images\MyCompany folder. Caution: A valid filename isn’t necessarily a valid field name in DesignBais. PH_PRODUCT.GIF is a valid filename but the underscore may confuse DesignBais which uses underscores to delimit filenames from form names, etc. Stick to using periods in all field names.

But what if we want to display and manipulate more than one product or customer image on the page? To do this, each image must have a unique ID. Creating a series of unique placeholder images is going a little overboard. Rather than referring to an image control as a filename, you can give images a unique name just like any other field. For example, if you have a series of images which are to represent on/off switches, set the Image File value to something like SWITCH1, SWITCH2, etc. (No .GIF or .JPG suffix is required) There isn’t an image called switch1 or switch2, so at design time an empty placeholder for the image will display (the DesignBais logo). But at runtime you can set images using code something like this:

DBIMAGESPEC<1> = "SWITCH1" : VM : "SWITCH2"
DBIMAGESPEC<2> = "MyCompany\On.gif" : VM : "MyCompany\Off.gif"

See the tip on Radio Buttons for an example of this last technique.

The next blog entry will follow-up on this and other image handling tips with a simple example of a thick-client-like toolbar for the top of your page. Feel free to register and post comments about these articles, or e-mail me with suggestions for more material.

Post navigation

DesignBais Tip – Image Toolbar → ← DesignBais Tip – Formatting Date/Time Fields

Leave a Reply Cancel reply

You must be logged in to post a comment.

Recent Posts

  • Major blog update
  • What’s up?
  • Intelligent User Interfaces
  • Amazon Web Services and MV Taboo
  • Building Community
  • System Maintenance – a quick note
  • MV Monitoring and Notification Part 2
  • Notifications for MV Support Providers
  • Upgrading blog soon
  • D3 OSFI Explored

Topics

.NET AccuTerm API BASIC blog BlueFinity Caché charts community D3 e-mail environment variables Excel Facebook FOSS Google graphs GUI import/export LinkedIn marketing multivalues mv.NET mySQL NebulaXChange NebulaXLite NebulaXPlus PBX QM RDBMS relational SaaS shell shutdown SMS social media speech SQL Server system monitoring telephony Twitter U2 UniObjects voice Web Services

Recent Blog Posts

  • Major blog update
  • What’s up?
  • Intelligent User Interfaces
  • Amazon Web Services and MV Taboo
  • Building Community
  • System Maintenance – a quick note
  • MV Monitoring and Notification Part 2
  • Notifications for MV Support Providers
  • Upgrading blog soon
  • D3 OSFI Explored

Blogs

  • Brian Leach's MultiValue Blog

Forums

  • jBASE Forum on Google
  • MVDBMS Google Group
  • OpenQM Forum on Google
  • Precision Solutions (Kevin King)

Sites

  • PickWiki.com

Status

Registration+Login is required to comment on blog posts.
Copyright © 2017 Nebula Research and Development
 
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OK