Klarisoft™ http://www.klariosoft.com

KSstbar™ Documentation
  

Contents


About KSstbar™ Template

KSstbar™ Template gives Clarion user an easy access to the standard MS Windows StatusBar control.
KSstbar™ can be used in Clarion4, Clarion5 or Clarion5.5 32-bit applications. With the help of the templates you will be able to handle standard Windows 32-bit StatusBar control in a "Clarion Way". Templates support placing of the StatusBar control on a Frame/Winodow, autoresizing, displaying today's date/current time, standard MSG display and many other features.

KSstbar™ Template is a pure Clarion source (no dll or lib black boxes) based on the ABC/Legacy compliant StatusBar class! Start using the templates and give you Clarion applications native MS Windows 32-bit look.


About StatusBar Controls

The common controls are a set of windows that are implemented by the common control library, which is a dynamic-link library (DLL) included with the Microsoft® Windows® operating system. Like other control windows, a common control is a child window that an application uses in conjunction with another window to perform I/O tasks.
  
A status bar is a horizontal window at the bottom of a parent window in which an application can display various kinds of status information. The status bar can be divided into parts to display more than one type of information. The following illustration shows the status bar in the Microsoft® Windows® Paint application. The status bar is the bar at the bottom of the window that contains Help text and coordinate information.


Getting started

Register the templates:

The KSstbar™ Setup Program can automatically register the templates. If you do not wish to register the templates automatically you will have to register them manually.
  
Start Clarion, select "Template registry" from the "Setup" menu. When the "Template registry" window opens, select the "Register" button on the right. Then you are prompted for a filename. Select KSstbar.tpl (for both ABC and Legacy templates). These files are located in your TEMPLATE folder.

After registering your Template Registry window will look like:

  
Register the templates:

To add Status Bar to your application use Templates Extension.
After you added Status Bar you can use StatusBar Class Properties and Methods to display information in the Status Bar.
One of the useful methods is KSstbar.SetText(Part, PartText) 
                where Part is a part number
                   PartText is a text to display in a Status Bar


Templates

Extension "Status Bar Control"

This extension is used to add standard Status Bar control to a Window or Frame Window:
(The images below show the template prompts for the KSstbar™ control template. 
 You can find the detailed description in tables below)
  
  
KSstbar TAB:

Prompt   Description
Status Bar Object Name   Name of KSstbar Control Object in the source code.
Height in pixels Height of StatusBar in pixels
Include SizeGrip
If checked then the SizeGrip picture    is displayed in the bottom right corner of the window.
MSG:
  
MSG Part
  
  
Display standard Clarion MSG (PROP:MSG) in the Status Bar Part number "MSG Part".
MSG Window If "Frame Window" is selected then standard Clarion MSG (PROP:MSG) will be displayed  in the Frame Window.
  
If "This Window" is selected then standard Clarion MSG (PROP:MSG) will be displayed  in this (current) Window.

  
Parts TAB:

Prompt   Description
Browse Part names of the Status Bar. 
Insert Insert new Status Bar Part.
Properties   Change selected Status Bar Part.
Delete Delete selected Status Bar Part.
   Use Up Down buttons to move Status Bar parts. 
Resizable Part   Type part number that should be Resizable when window resizes.  By default it is the last Status Bar Part.

  
Insert or Change StatusBar Part:

Prompt   Description
Part Name   Part name (To show in the Browse. See picture above.) 
Part Width   Width of this part in the Status Bar. It should always have a value. 
Icon You may indicate an icon to display on the left side of the Status Bar Part.
You can select .ico .dll or .exe file.
Icon Num (for DLL)   If you select dll or exe in the Icon prompt then you should select Icon Number. (Usually dll or exe contains some linked in icons. The first icon has an Icon Number of zero.)
Part Style
Select style of the Status Bar Part:   POPIN  

or POPOUT  
Type of Text
Choice one from:  Standard Text  - to display standard text (system font)
Drawn Text  - to display text with color and bold 
    attributes
Display Date or Time   - to display date or time.
    See picture and table below for
    description.
Date or Time If "Display Date or Time" is selected in a previous prompt then press this button to setup Date/Time options. (See picture and table below for description.)
Text Text to display in this Part when window opens. You can keep this field blank if you do not want to display default text in this part or do not wish to display text in this Part at all. 
Alignment  If you select "Drawn Text" in "Type of Text" prompt then you should select Alignment of text in the Part.
Text color  If you select "Drawn Text" in "Type of Text" prompt then you may select Color of text in the Part.
Bold  If you select "Drawn Text" in "Type of Text" prompt then you may select Bold Text in the Part.

  
Date/Time options:
It is possible to show current Date or Time at any Part of a Status Bar.

Prompt   Description
Display Date or Time  Choose between Date or Time. In one Part you can display either Date or Time. You can not display both Date and Time in the same Part of a Status Bar.  
If you choice is Date Display...
  
Date Picture
  
  
Select date picture to display Date in the Part.
Other Date Picture You may type here other Clarion Date Picture if you do not like standard Date Picture (in the previous prompt).
Show the day of week... Select this check box to show the day of week before the date.
If you choice is Time Display... 
  
Time Picture
  
  
Select time picture to display Time in the Part.
Other Time Picture You may type here other Clarion Time Picture if you do not like standard Time Picture (in the previous prompt).

  
  
Extension "Communicate with Frame Window Status Bar Control"

If you use Frame Window with a Status Bar you should add this extension to all the windows in your application. (Except the cases when you add an additional Status Bar to a window procedure.)

When you add this extension you can use KSstbar class methods to display text or show icons in a Frame Window Status Bar.

Prompt   Description
Status Bar Object Name   Name of KSstbar Control Object in the source code.
MSG:
  
MSG Part
  
  
Display standard Clarion MSG (PROP:MSG) in the Status Bar Part number "MSG Part".
MSG Window Select "Frame Window" to show standard Clarion MSG (PROP:MSG) in the Frame Window.

  


Class description

This table lists the KSstbar™ Properties and Methods.

Name   Type  Description
Properties
  
FrameClass
  
  
StatusBar
  
  
Use this property to call Frame Window Status Bar methods.
Other Properties   All other properties are private and should be used with this template. If you want to use this class without template please look at the template generated code and copy it to your source.
Methods
  
Init 
  
  
PROCEDURE(<LONG ResizedPart>,
<LONG CommonWidth>)
  
  
Initializes the KSstbar™ control.
Kill  PROCEDURE Kills and deinitializes the KSstbar™ control.
CreateStatusBar PROCEDURE(LONG SIZEGRIP=SBARS_SIZEGRIP),
SHORT,PROC 
Create KSstbar™ control.

Parameters:
SIZEGRIP=SBARS_SIZEGRIP: display SizeGrip
SIZEGRIP=0: don't display SizeGrip

DrawText PROCEDURE(LONG Part, STRING stText,
<LONG IconNum>, LONG sbAlignment = 2, LONG TextColor = COLOR:BTNTEXT,
LONG fontbold = False, LONG textoffset = 0)
Draw graphic text in the Status Bar Part.

Parameters:
Part:  Part Number
stText:  Text
IconNum:  Icon number
sbAlignment:  Text Alignment (1-Left, 2-Center, 3-Reght)
TextColor:  Text Color
fontbold:  if True then text is Bold
textoffset:  Text offset

GetRect PROCEDURE(LONG Part,*LONG Left,
*LONG Top,*LONG Right,*LONG Bottom)
Get Status Bar coordinates.

Parameters:
Part:  Part Number
Left: receive left position
Top: receive top position
Right: receive right position
Bottom: receive bottom position

ResizeStatusBar PROCEDURE Resize the Status Bar. You should call this method when window is resized.
RedrawStatusBar PROCEDURE Redraw Graphic Text in the Status Bar.
PrepareIcons PROCEDURE(STRING IconFile, LONG Part, LONG IconNum) Prepare Icons to use in the SetIcon Method.

Parameters:
IconFile:    icon file name
IconNum:  Part Number 

SetIcon PROCEDURE(LONG Part) Set icon for the Status Bar Part.
You should use this method after icons are prepared by PrepareIcons method.

Parameters:
Part:  Part Number

SetText PROCEDURE(LONG Part, STRING PartText,<LONG Style>) Display text at the Status Bar Part.

Parameters:
Part:  Part Number
PartText:  Text
Style: Text Style

SetFrameClass PROCEDURE() Call this method in the Frame Window to setup this Status Bar as a Frame Status Bar. Status Bar Class in other windows can use this Class methods with FrameClass property.

 


Installed files

The following files will be copied to your hard disk during installation. All the pathnames are relative to your Clarion root directory (e.g. C:\CLARION5,  C:\C55), depending on your choice during installation.

Directory File Name Definition
Example\KS\KSstbar   *.ico
*.bmp
*.dll
*.exe
*.app
KSstbar™ Demo Applications


If you install templates for Clarion4 then Clarion4 examples are installed.
If you install templates for Clarion5 then Clarion5 examples are installed.
If you install templates for Clarion5.5 then Clarion5.5 examples are installed.
KS\KSstbar KSstbar.htm  
*.gif
  
This documentation and images.
Lib KScomct.lib
  
Library (to link Clarion with Windows API)
Libsrc KSstbar.inc
KSstbar.clw
  
KSstbar™ Class Defenition
Template KSLogo.bmp
KSstbar.tpl
KSstbar.tpw
  
Template and templates image files.

  


Using KSstbar™ without templates

It is possible to use KSstbar™ without templates, but there are some things to consider:
   
You will need to include KSstbar.inc (located in your LIBSRC folder) manually.
 
You will also have to add a .lib file to your project:
Open the "Project editor" window, locate the "Library, object and resource files" entry and press "Add file". Select KScomct.lib file.
 
 


Copyright notice

KSstbar™ copyright © 2001 by KlariSoft. All rights reserved.

  


Contacts

For support, please write to Support@klarisoft.com
For updates of this product please visit http://www.klarisoft.com regularly.