HOME  | SIMPLE GRID | DEMO  | BUY NOW


 

    SimpleTools  (c) 2002-2006 Octatec Ltd
   


Introduction

This is a set of  OCXs and Automation Objects intended to make your programming tasks much simpler. They can be used by VisualBasic, C++, EXCEL/VBA, or any language that understands Active X (COM). 

SimpleTree Code Sample
Method List
Encapsulate a standard Tree control, making its use very easy to use from VB, VBA or C++
SimpleTable Code Sample
Method List
Encapsulate a standard List control, making its use very easy to use from VB, VBA or C++
SimpleURL Code Sample
Method List
Add URLs to you dialogs and forms
SimpleTextMarkup Code Sample
Method List
Add a text block containg multiple hypertext links, text in different colours and different fonts, all through a very simple API
SimpleTimer Code Sample
Method List
Easily add a Timer to your VBA, VB or C++ applications
SimpleLine Code Sample
Method List
Embellish your dialog boxes with 3D lines
SimpleFolerSelect Code Sample
Method List
An easy to use Folder-Selection box
DateTime API Code Sample
Method List
This object makes comparing and adding dates very easy
Distributing and Licensing
How to distribute your applications that use SimpleTools

SimpleTree (see code sample)

This is an OCX wrapper for the standard Tree control. It is exceptionally easy to use and allows you to add trees to your dialog-based applications very quickly. Being a simplification of the general Tree interface, not all Tree functionality is present, but that is not a limiting factor, as, you can Post or Send messages directly to the underlying HWND via specific methods and so access more advanced  functionality that is not exposed directly by the control. 



SimpleTable (see code sample)

This OCX is a wrapper for the standard List control (in report mode). It allows you to present data in a tabular form. It is not grid control, however, and does not support in-place editing of items, individual  cell colours, etc. For a fully-fledged grid control iwth all these features, see SimpleGrid. Like the SimpleTree, the SimpleTable  provides Post and Send methods so you can access more advanced functionality of the underlying List control if you need to. 



SimpleURL (see code sample)

This OCX has 2 properties, a URL path  the DisplayText. With this control you can enter clickable text links directly on your dialog that will take you to the Internet or display a local file. You can set the Font, Text and Background colours of the DisplayText. In the example below, the control is only the underlined text "Octatec Web Site" 

 


SimpleTextMarkup (see code sample)

This is a more flexible than the SimpleURL control. This control allows you to create a block of text, and selectively ‘markup’ various parts of it. E.G. you can make change the colour and or font of words, make words clickable, make words underlined etc. When clickable words are clicked, you receive an event notifying you of this and you can display a URL or take some other appropriate action. In the example below, the control is the whole of the text block. 

The text can be ‘marked-up’ using API calls on character positions or by setting the control with a HTML-like string


SimpleTimer (see code sample)

This is a very simple timer object that fires a  TimerTick event at regular intervals. This gives you easy access to Timer functionality from environments that dont normally provide it. You can keep the timer invisible, or display its very simple image if you wish. 

SimpleLine (see code sample)

This OCX simply lets you add lines (horizontal or vertical, 3D or flat) to your dialog. It is an extremely simple facility, but it is not so straight forward to do without this control  (especialy in C++ based dialogs). It can be used in conjunction with the SimpleURL to make your dialog boxes more interesting. 

SimpleFolderSelect (see code sample)

This is an automation object, not an OCX. It displays a tree-based dialog from where you can select a folder. As its name suggests, it is intended to allow you to select folders (rather than files) from the file system. 



DateTime API (see code sample)

This COM Automation Object provides a rich set of methods for manipulating dates. The class encapsulates the OLE/VB DATE type. The object is particularly good at comparing dates and adding various units to the date, e.g. AddDays, AddMonths, AddMinutes etc. When the object is created, it is initialized to Midnight 1/1/2001. Unlike the other objects in this package, this object does not depend on the MFC DLL. 


VBA Code Samples

The package comes with a Sample C++ application that uses all the controls, and an EXCEL spread sheet that also uses the controls. The code sample here is just a fragment, to give you an idea of how easy the controls are to use. 

SimpleTree

This code shows initialization, events are triggered when items are selected, double-clicked etc. 

Private Sub InitTree_Click()
    idroot = SimpleTree1.AddRoot("ROOT", -1, False, 0)
        idbranch1 = SimpleTree1.AddBranch(idroot, "branch1", -1, False, 0)
        idbranch2 = SimpleTree1.AddBranch(idroot, "branch2", -1, False, 0)
        idbranch3 = SimpleTree1.AddBranch(idroot, "branch3", -1, False, 0)
            Call SimpleTree1.AddBranch(idbranch3, "sub-branch", -1, False, 0)

    SimpleTree1.ExpandItem (idroot)
    SimpleTree1.SelectItem (idroot)
End Sub


SimpleTable

This code shows initialization, events are triggered when items are selected, double-clicked etc. 

Private Sub InitTable_Click()
    SimpleTable1.EnableFullRowSelect (True)
    SimpleTable1.EnableGridLines (True)
    SimpleTable1.EnableMovableColumns (True)

    Call SimpleTable1.AddPropotionateColumn("col1", 3, True)
    Call SimpleTable1.AddPropotionateColumn("col2", 3, True)
    Call SimpleTable1.AddPropotionateColumn("col3", 3, False)

    Call SimpleTable1.AppendRow(-1, 0)
    Call SimpleTable1.AppendRow(-1, 0)

    Call SimpleTable1.SetCellText(0, 0, "0,0")
    Call SimpleTable1.SetCellText(0, 1, "0,1")
    Call SimpleTable1.SetCellText(0, 2, "0,2")

    Call SimpleTable1.SetCellText(1, 0, "1,0")
    Call SimpleTable1.SetCellText(1, 1, "1,1")
    Call SimpleTable1.SetCellText(1, 2, "1,2")
End Sub


SimpleURL

No code is required for this control, events are triggered when the the URL is selected, but you need not respond to them. You simply set the URL and DisplayText proerties. 

SimpleTextMarkup

Private Sub Init_STMup_Click() 'a buton click to initialize the Simple Text Markup control,
                                                             'could also be done as part of general application initialization

    SimpleTextMarkup1.Text = "Please click here to visit the Octatec web site"
'NB: as an alternative to setting the text and calling the Markup… methods, 
          'you could set the control from a hypertext string (rather like HTML)

    Dim l1 As Long ' start - zero based
    Dim l2 As Long ' length
    Call SimpleTextMarkup1.Find(l1, l2, "Please", 1)
    Call SimpleTextMarkup1.MarkupItalic(l1, l2)
        'we could just count the position in the string manualy
        'but using Find() is a bit more maintainable
        'NB - the '1' in the Find() call indictates we should 
        'find the first occurance of 'Please' in the string

    Call SimpleTextMarkup1.Find(l1, l2, "here", 1)
    Call SimpleTextMarkup1.MarkupClickable(l1, l2, 1)
 

    Call SimpleTextMarkup1.Find(l1, l2, "Octatec", 1)
    Call SimpleTextMarkup1.MarkupBold(l1, l2)

    Call SimpleTextMarkup1.Find(l1, l2, "Octatec web site", 1)
    Call SimpleTextMarkup1.MarkupTextColour(l1, l2, vbRed)

End Sub

Private Sub SimpleTextMarkup1_OnItemClick(ByVal clickID As Long, ByVal Text As String)
    Call SimpleTextMarkup1.DisplayURL("http://www.octatec.co.uk/")
End Sub


SimpleTimer

Private Sub StartTimer_Click()
    SimpleTimer1.SetTimerInterval 1  ' 1 second
    SimpleTimer1.Start
End Sub

Private Sub StopTimer_Click()
    SimpleTimer1.Stop
End Sub


SimpleLine

No code is required for this control, and no events are triggered, you simply set the Vertical/Horizontal/3D properties. 

SimpleFolderSelect

Private Sub SelectFolder_Click()
    Dim folderSelect As Object
    Set folderSelect = CreateObject("SimpleFolderSelect")

    folderSelect.SetInitialDir ("c:\program files")
    folderSelect.NonexistantDirNotAllowed

    ok = folderSelect.DoModal
    If (ok = 1) Then
        path = folderSelect.GetPath
        Range("G25").Value = path
    End If
End Sub


DateTime API

Private Sub DateTimeTest_Click()
    Dim dateTime1 As Object
    Set dateTime1 = CreateObject("DateTime.API")

    s = dateTime1.FormatDateTime

    MsgBox "Date1 Initial Value " & s ' this is 1/1/2001 00:00:00

    Dim dateTime2 As Object
    Set dateTime2 = CreateObject("DateTime.API")
    ok = dateTime2.SetDatePart(21, 10, 2002)
    s = dateTime2.FormatDateTime

    MsgBox "Date2 Value  " & s

    If (dateTime2.IsGT(dateTime1.GetDate())) Then
        MsgBox "DateTime Greater-Than Test OK"
    End If

    dateTime1.SetNow
    dateTime1.AddDays (56)
    s = dateTime1.FormatDateTime

    MsgBox "56 days from now is: " & s
End Sub


Method List

SimpleTree

SimpleTree Methods

long AddRoot(BSTR name, long imageId, boolean boldFont, long userData);
Add a root item, you may store the ID returned for latter use in other methods. The name parameter is the text that is displayed in the tree. The imageId van be -1 if you don't want an image displayed, otherwise it is the return value from the AddImage() or AddImageFromFile() methods. The userData parameter can be 0 or any value of your choosing. If you want to display the item using a Bold Font, pass in TRUE for the boldFont parameter. You should store the returned value and use it as the parent parameter  the AddBranch() method 

long AddBranch(long parent, BSTR name, long imageId, boolean boldFont, long userData);
Add branches to a previous branch or the root of the tree. The imageId van be -1 if you don't want an image displayed, otherwise it is the return value from the AddImage() or AddImageFromFile()methods. The userData parameter can be 0 or any value of your choosing. You can store the returned value and use it as the parent parameter  in subsequent AddBranch() method calls 

long AddImage(long bitmapResourceId);
Store an image in the tree, bitmapResourceId should be the ID of a bitmap resource in your application, if you don't have one, use the next method… 

long AddImageFromFile(BSTR  bitmapFile);
Load a bitmap from a file, several example images are inculded with the tool kit. The retgurned value can be used to specify and image in the AddRoot and AddBranch methods. 

void MakeItemBold(long itemId, boolean boldMode)
Display the item in a Bold Font 

void ChangeImage(long itemId, long imageId)
Change the image associated with the item 

boolean ExpandItem(long itemId);
Expand the item, dispaying branches underneath the item 

boolean SelectItem(long itemId);
Select an item. 

long GetSelectedItem();
Get the currently selected item - items are normaly selected when a user clicks it, in which case an event is fired 

void DeleteAllItems();
Delete all items 

boolean DeleteItem(long itemId);
Delete  an individual item. 

BSTR GetItemText(long itemId)
Get the displaying text (name) of an item 

long GetItemUserData(long itemId);
Get the user data associated with an item 

boolean Walk(long startItemID);
Initiate a 'walk' of the tree, starting from a particular ID, this can be 0 to start at the root of the tree. Afer this method has been called, the VisitTreeItem event will be fired for each item in the tree. 

long GetHWND();
Get the underlying HWND of the tree control 

boolean PostMessage(long msg, long wparam, long lparam);
boolean SendMessage(long msg, long wparam, long lparam);
Post or Send a message to the underlying Tree control 

SimpleTree Events

void ItemSelected(long itemId, BSTR name, long imageId, long userData);
called when the user clicks (selects) an item. 

void ItemDoubleClick(long itemId, BSTR name, long imageId, long userData);
called when the user double-clicks an item. 

void ItemRightClick(long itemId, BSTR name, long imageId, long userData);
called when the user right-clicks an item 

long VisitTreeItem(long itemID, BSTR name, long imageID, long userData, long depth, BSTR path, long* outputIndicator);
This event is fired repeatedly for each item in the tree after the Walk() method has been called. If you want to terminate the Walk at any point, set outputIndicator = 0.


SimpleTable

Methods

void EnableFullRowSelect(boolean mode);
If this method is called with TRUE as a parameter,  the selection mark occupies the full row, without this the selection mark occupies the first column only 

void EnableGridLines(boolean mode);
If this method is called with TRUE as a parameter,  grid lines are drawn to distinguish rows and columns 

void EnableMovableColumns(boolean mode);
If this method is called with TRUE as a parameter, columns can be 'dragged' to new locations. 

void AddPropotionateColumn(BSTR title, long proportionateWidth, boolean leftJustified);
Add a column to the table, the width is proportionate. The main purpose of this method is,  to add equally spaced columns, in which case the proportionateWidth parameter should be the same as the number of columns you intend to add. (The proportion of space occupied by the column is always 1/proportionateWidth

BOOL AddPercentageColumn(BSTR title, long percentageWidth, BOOL leftJustify); 
You can use this method to add columns that take up a particular percentage of the table width. I.e. you could add a column that is 75% and another that is 25%. You could even add a 3rd that is, say 33%, in which case, the table would have a scroll bar. This gives you much more control than the AddProportionateColumn() method. The percentageWidth parameter is an integer value that represents the percentage of the grid that will be used by the column. This could be greater than 100 if you wanted a realy wide column with a scroll bar, but probably you don't want that. If the percentages specified son't add up to 100, you will have some 'unused space' to the right of all your specified columns. 

void AddColumn(BSTR title, long width, long leftJustified);
Add a column to the table, specifying the absolute width. 

long AddImage(long bitmapResourceId);
Store an image in the tree, bitmapResourceId should be the ID of a bitmap resource in your application, if you don't have one, use the next method… 

long AddImageFromFile(BSTR bitmapFile);
Load a bitmap from a file, several example images are inculded with the tool kit. The returned value can be used to specify an image in the AppendRow and InsertRow methods. 

long AppendRow(long imageId, long userData);
long InsertRow(long insertAt, long imageId, long userData);
Insert or append a row,  the row is created empty. If you don't want to display an image, pass in -1 as the imageId, otherwise, pass in a value returned from AddImage() or AddImageFromFile()

boolean SetCellText(long row, long col, BSTR text);
This sets the text of a particular cell, the row must already have been added (appended or inserted) 

BSTR GetCellText(long row, long col);
Get the text of a particular cell. 

void void DeleteRow(long rowIndex);
Delete a particular row. 

void DeleteAllRows();
Delete all rows. 

long GetSelectedRow();
Get the currently selected row,  a row becomes selectd when a user clicks it, and when this happens, an event is fired. 

long GetRowUserData(long row);
Get the user-data associated with a row 

long GetColumnCount();
long GetRowCount();
Get the number of columns and rows in the table 

boolean PostMessage(long msg, long wparam, long lparam);
boolean SendMessage(long msg, long wparam, long lparam);
Post or send a message to the underlying List control 

long GetHWND();
Get the HWND of the underlying List control 

Simple Table Events

void RowSelected(long rowIndex, long imageId, long userData);
The user clicked a row, thus selecting it. 

void RowDoubleClick(long rowIndex, long imageId, long userData);
The user double-clicked a row. 

void RowRightClick(long rowIndex, long imageId, long userData);
The user right-clicked a row 

void ColumnClick(long columnIdex, BSTR columnTitle);
The usre clicked a column heading. 


SimpleURL

The SimpleURL control just allows to position a clickable-strings on your dialog. This control allows you to position blocks of text in you dialog. The blocks of text can contain clickable strings, and text of differing fonts/sizes/colours just like HTML 

Properties

BSTR url;
The url to be displayed when the text is clicked, e.g. http://www.octatec.co.uk

BSTR displayText;
The text that is displayed on the screen, when the text is clicked, the url is displayed in its own window. 

Methods

void SetColours(long rgbNormal, long rgbVisited, long rgbActive);
Set the colours for the display text, the text can be displayed in different colours before the URL has been visited, while the URL is active, and after the URL has closed. 

void SetBackgroundColour(long rgbValue);
You can use this method to set the background colour. Where the container supports the AmbientBackgroundColour property, this is used as a default, otherwise, the system  ‘dialog-box-colour’ is used as the default. 

void SetFont(long pointSize, BSTR fontName);
You can use this method to set the background colour. Where the container supports the AmbientFont property, this is used as a default. 

void SetPosition(long top, long left, long bottom, long right);
Use this method to change the size and position of the URL window – call this method before the URL has been displayed. 

boolean DisplayURL(BSTR url);
You can use this method to display any URL – you never need to call this if you don’t want, the URL is automatically displayed when the user clicks the text,  but you can use this method at any time to display any URL. 

Events

void OpenURL(BSTR url, BSTR displayText, long* outputIndicator);
This event if fired before the URL is displayed. Normally, you will completely ignore this event, but you can catch it and, maybe, change the URL to be displayed. If you set *outputIndicator = 0, the URL sill not be displayed. 


SimpleTextMarkup

Properties

short BorderStyle

This property controls the border...
0=no border
1=simple border
2=include scroll bars if needed
3=a border with scrollbars

This property needs to be set before calling any methods.

BSTR Text

This property sets the text of the control, you should set this (or call SetFromHypertext() ) before using other methods 

Methods

boolean Find(long* start, long* length, BSTR text, long placement);

Find a particular string in the control, the 0-based staring position and length of the string are returned. The placement parameter allows you to specify the placement of the string to find i.e. which occurrence of a particular string to locate, e.g. in the string "This is very very long text", to find the 2nd occurrence of very, set the placement value to 2, and make the call  Find(pstart, plen, "very", 2).This method is provided to make the calls to the Markup… methods easier. NB: as an alternative to using the Markup... methods, you can use SetFromHypertext()

boolean MarkupClickable(long start, long length, long clickID);
Set a 'clickable' link within the text. The text starting at 'start' (0-based) and extending for 'length' characters will be draw under-lined and in the specified 'link-normal' colour. The cursor will change to a pointing-hand when over the text, and if the text is clicked,  an ItemClick event will be fired  with the specified clickID and the actual text as parameters. While the ItemClick event is in progress, the text will be drawn in the 'active-link'colour, and when the ItemClick has been processed, the text will be draw in the 'visited-link' colour. 

NB: in any of the Markup… methods the length parameter can be specified as -1 indicating the end of the text. 

boolean MarkupBold(long start, long length);
boolean MarkupItalic(long start, long length);
boolean MarkupUnderline(long start, long length);

Make the specified text Bold, Italic or Underlined. One or more Markup methods can be called on the same text  to add to the Markup attributes of the text 

boolean MarkupTextColour(long start, long length, long rgbColour);

Make the text a specified colour, rgbColour is  a standard RGB value 

boolean MarkupFontFace(long start, long length, BSTR faceName);

Set the font-face for the specified text. The font-face parameter is a string such as "Arial", "Times New Roman", "Courier New" etc. 

boolean MarkupFontHeight(long start, long length, long tenthsOfPoint);

Set the font-height for the specified text. The font-height parameter is compatibikle with the size value in CreatePointFont. I.e. Character height in 10ths of a point. NB: the underlying RichEditCtrl specifies char height in twips - a twip is 1/1440 of an inch, or 1/20 of a printer's point. i.e. the input measure here is in units of 2 twips, 2/20 of a printer's point. 

boolean MarkupClear(long start, long length);

Clear all attributes for the specified character range 

void MarkupClearAll();

Clear all attributes for all text 

void SetClickableColours(long rgbNormal, long rgbVisited, long rgbActive);
Set the colours for the clickable  text, the text can be displayed in different colours before the URL has been visited, while the URL is active, and after the URL has closed. This method must be called before any clickable links have been 'marked-up'. 

boolean SetFromHypertext(BSTR hyperText);

If you don't like calling the Markup… methods repeatedly to set the properties of the text, you can set all Markups via a HyperText string. The format of the HyperText is very similar to HTML, but slightly simplified. The format is specified below

boolean DisplayURL(BSTR url);

This method can be used to display a WWW url, such as "http://www.octatec.co.uk"

void SetUrlPosition(long top, long left, long bottom, long right);

If you call DisplayURL(BSTR url) the URL will be displayed in a new window, you can call this before DisplayURL(BSTR url)  to set the size and location of the URL window 

void SetBackgroundColor(long rgbColour);

Set the background colour of the control, by default, this is white. 

void EnableSelectableText(BOOL mode)

By default, the control does not allow the text to be selected, this method can be called to enbable selectable text (Conrol-C then copies the text to the clipboard)

Events

void OnItemClick(long clickID, BSTR text);
This event is fired when ‘clickable’ text is clicked, the clickID and text itself are passed as parameters. 
 

Hyper Text Format

Clickable (Anchor) <a>

The basic format of a clickable anchor is  <a numeric-id>text</a>, E.G  <a 100>click me</a>
The numeric-id is passed with the OnItemClick event, along with the text when the item is clicked.

Italic <i>

<i>text</i>

Bold <b>

<b>text</b>

Text Colour <c>

<c r:g:b >text</c>  OR 
<c 0xXXXXXXXX>text</c>

Where r:g:b specifies the RGB values, and 0xXXXXXXXX also specifies the RGB value, but in hex. 

Font Face <f>

The basic format of a font-face directive is  <f font-name>text</f>, E.G  <f Times New Roman>text</f>

Font Height <z>

The basic format of font-size directive is  <z font-size>text</z> text</f>, E.G  <z 110>text</z>

Example

LPCTSTR ht =  "<b>This is a <c 255:0:0><z 140><f Times New Roman>test</f></z></c></b>\r\n"
              "Click <a 1>here</a> for an event\r\nEnd of text";

m_simpleTextMarkup.SetFromHypertext(ht);


SimpleTimer

Methods

The mthod names for this object fully describe their function... 

void SetTimerInterval(long seconds);
void SetTimerIntervalEx(long milliseconds);
Call one of these methods before starting the timer. 

boolean Start();
boolean Stop();
boolean IsRunning();

Events

void TimerTick()
This event is fired on every tick of the timer. 


SimpleLine

Properties

boolean VerticalLine;
Make the line Vertical or Horizontal 

boolean Line3D;
Give the line a 3D appearance. 

Methods

void SetBackgroundColour(long rgbValue);
You can use this method to set the background colour. Where the container supports the AmbientBackgroundColour property, this is used as a default, otherwise, the system  ‘dialog-box-colour’ is used as the default. 

void SetLineColour(long rgbValue)
This method has no effect if the line is a 3D line, otherwise it sets the colour of the line. 


SimpleFolderSelect

Object Name: "SimpleFolderSelect"

Methods

void SetInitialDir(BSTR folderName);
Set the initial directory the dialog will display 

void IncludeRemovableDrives(boolean mode);
Allow the dialog to include removable drives in the tree, the default is FALSE. 

void NonexistantDirNotAllowed();
Call this to prevent the user entering a non-existant directory 

void NonexistantDirWarn();
Call this so that the user is warned if he enters a a non-existant directory. 

void NonexistantDirSilent();
Call this to allow the user to enter a non-existant directory . 

void ReadOnlyEditBox(boolean mode);
This makes the  edit-box part of the dialog read-only, so the user can only select directories displayed in the tree. 

void SetTitle(BSTR title);
Set the title of the dialog box 

void EnableInitialPathLoad(boolean initalPathLoad);
If you set the initial path, the dialog will locate the position in the tree. If you call this method with FALSE as the parameter, the initial path will not be located in the tree. The default is TRUE

void EnableRootLoad(boolean rootLoad);
If this method is called with TRUE as the parameter, the root directory of each drive is pre-loaded. The main consequence of this is to enable the use of 'tree-buttons' at the root level. The default value is FALSE

long DoModal();
Call this method to actually display the dialog, it will return IDOK(1) if the user clicks OK or IDCANCEL (2) if the user clicks Cancel

BSTR GetPath();
Call this method after DoModal() has returned to get the path selected by the user. 


DateTime API

Object name: "DateTime.API"

Methods

Mostly, the method names are self explanitory 

void SetDate(DATE date);
Set the date from a VB/OLE DATE type. 

void SetNow();
Set the DateTime object to 'now' 

long SetDay(short day);
long SetMonth(short month);
long SetYear(short year);
long SetHour(short hour);
long SetMinute(short min);
long SetSecond(short second);
long SetMillisecond(short millisecond);
Set the various parts of the DateTime object - you should always check the return value in case you set an illegal date, e.g. if the Object is set to 30/Jan/2001 and you call SetMonth(2), the result would be 30/Feb/2001, clearly an error, in this case FALSE is returned and the DateTime object is unchanged. For this reason you need to take care if you are setting  a DateTime by setting the individual parts, you may prefer to set all the Date parts in one call using SetDatePart() and thus avoid intermediate errors that could occur. 

short GetDay();
short GetMonth();
short GetYear();
short GetHour();
short GetMinute();
short GetSecond();
short GetMillisecond();
Get the various pars of the Date/Time 

DATE GetDate();
Get the OLE/VB DATE type 

BSTR GetMonthName();
Get the month name, e.g. "Jan". 

BSTR GetDayOfWeek();
Get the day of the week, e.g. "Mon". 

short GetJulian();
Get the julian date. 

short GetDaysInMonth(short month);
Get the days in the specified month, if the month is 0, the month in the current DateTime object is used, in which case, leap-years are accounted for. 

void AddDays(short numDays);
void AddHours(short numHours);
void AddMinutes(long numMinutes);
void AddSeconds(long numSeconds);
void AddMilliseconds(long numMilliseconds);
void AddYears(short numYears);
void AddMonths(short numMonths);
Add the various units to the DateTime object, the resulting DateTime is guaranteed to be a legal date/time, i.e. such issues as leap years/Feb 29 are catered for. 

long IsLeapYear(short year);
Return TRUE if the input year is a leap year, if the input year is 0, the year in the current DateTime object is used. 

void SetFromTime_t(long time);
Set the date time from a standard time_t date representation. 

BSTR FormatDateTime();
The format is DD MMM YYYY HH:MM:SS 

BSTR FormatDateUS();
The format is MM/DD/YYYY 

BSTR FormatDateUK();
The format is DD/MM/YYYY 

BSTR FormatTime();
The format is HH:MM:SS 

long IsEQ(DATE date);
long IsLT(DATE date);
long IsGT(DATE date);
long IsGE(DATE date);
long IsLE(DATE date);
Compare the DateTime in the object to the input DATE 

void SetDatePart(short day, short month, short year, long* ok);
void SetTimePart(short hour, short min, short second, short ms, long* ok);
Set the Date and Time in a single call 


Distributing the OCXs and the Automation Objects

You can distribute the .OCX and the .DLL files without restriction. The OCXs will not work in design mode unless you have installed the full SimpleTools package, but they will work as normal at run-time allowing you to distribute any applications you write that uses them. 

If your applicatons use the DateTimeClass or the SimpeFolderSelect, you must also distribute a Run-Time licence for these 2 objects. You do this by running the ToolsRTL program (which somes with the simple tools package) on any system that you wish to use the DateTimeClass or the SimpleFolderSelect. The usage is: simply ToolsRTL.exe, running this will install an RTL 'run-time' licence on the current machine. (ToolsRTL.exe is not supplied with the demo version) 

If you are creating setup programs or Installation utilities, you may be interested in Octatec's InstallScript system which allows you to create setup programs embedded  in self-extracting archives very easily and quickly. 





For a fully-fledged Active X Grid Control that is powerful, yet easy to use, see SimplGrid

Home | FixGateway | AFI/J | SimpleGrid | SBpayroll | SXAzip | InstallScript | DiskUsage/DiskClean | Virtual Desktop Manager | ComBridge | Demos | Purchase