Smalltalk MT 4.0 Release Notes

Home | Up | Search | X-Zone News | Services | Book Support | Links | Feedback | Smalltalk MT | The Scrapyard | FAQ | Technical Articles

 

Smalltalk MT 4.0
Samples

The following tables list the samples provided with Smalltalk MT.

bulletOLE Samples
bulletTutorial Samples
bulletWin32 Samples

Symbols

progexe.gif (953 bytes) The sample can be compiled to an EXE
progocx.gif (1030 bytes) The sample can be compiled to an OCX
progdll.gif (971 bytes) The sample can be compiled to a DLL
New in version 4

OLE Samples

Location: SAMPLES\OLE

Topic Folder Description
COM


 

COM\DCOM

progexe.gif (953 bytes)

The sample demonstrates the minimum requirements to use a COM object, whether it is on the same machine or on a different machine. The sample consists of a client and a server portion.
The server application, SSERVER.EXE, implements a simple stream class as a LocalServer. Instances of the class supports a limited form of the IStream interface.
The client application, SCLIENT.EXE, uses the class implemented by the server.
Both programs are compatible with the SimpleServer sample from the Windows SDK.
COM COM\SimpleCOMServer

progocx.gif (1030 bytes)

SimpleCOMServer is a simple COM Server that exports variations of an Add method. It demonstrates the basic steps to create a COM Server.
The associated Visual Basic project wraps a UI around SimpleCOMServer.
COM COM\SRandom

progocx.gif (1030 bytes)

SRandom is a simple server implemented using a dual interface. IRandomStream implements a random number generator that can be accessed using IRandomStream or via OLE Automation. The latter allows scripting languages such as Visual Basic to access the functionality.
ActiveX OCX\CustomButton

progocx.gif (1030 bytes)

CustomButton is a simple hot-tracking button implemented in Smalltalk.
ActiveX

 

OCX\SpxView

progocx.gif (1030 bytes)

SpxView is a Windows Explorer Extension that displays the contents of an XML project file. After registration, opening a file with the .SPX extension opens a new Explorer window that displays the contents of the project.
ActiveX OCX\STOPLITE

progocx.gif (1030 bytes)

StopLite demonstrates ActiveX programming. It replicates the functionality of the Stoplite sample in the Microsoft Windows SDK.
OLE SIMPCNTR

progexe.gif (953 bytes)

SimpleContainer implements a basic OLE container, using the document - view architecture. The user can select an OLE object from a list of available OLE servers, and embed it into the current document.
OLE STALK STALK extends the Smalltalk development environment with an OLE Automation server. The server lets you evaluate an arbitrary string of Smalltalk expressions and returns the result of the evaluation.

 

Tutorial

Location: Tutorial

Topics Folder Description
ActiveX Samples
ActiveX ActiveX\AXSAMPLE

progexe.gif (953 bytes)

Demonstrates how to integrate a third party ActiveX component.
The component used by this sample is Calendar Control 8.0 (which comes with MS Office).
 
ActiveX ActiveX\Licensed OCX Sample Shows how to use a licensed ActiveX control.
ActiveX ActiveX\MaskedEditSample

progexe.gif (953 bytes)

Demonstrates how to use the Masked Edit control.
ActiveX ActiveX\Shockwave Flash Demonstrates how to use the Shockwave Flash control.
ActiveX ActiveX\WebBrowserSample

progexe.gif (953 bytes)

Demonstrates how to use the Web Browser control. The project also includes a wrapper for the browser control.
Interface Builder Samples
GUI Builder Builder\Custom Button Demonstrates implementing a custom button with properties that can be edited with the GUI builder.
CustomButton plays a sound (a WAV file) when the user clicks it. The event is passed up the event handler chain, so further actions can be attached to the button, and the button can be used like a regular button.
CustomButton opens a dialog that lets the user enter the sound file. The sound file name is then appended to any generated initialization code.
GUI Builder Builder\Generic Demonstrates how to design a simple application that includes a menu, dialogs and event handlers.
GUI Builder Builder\Pool Sample By default, the Interface Builder assigns standard IDs to child controls and menu items.
The sample uses custom identifier names for the controls and menus.
Common Controls
GUI Controls,
Animation
Common Controls\Animation Sample Demonstrates how to use the animation control.
GUI Controls,
ComboboxEx
Common Controls\Comboboxex Sample Displays a ComboboxEx in a dialog.
GUI Controls,
DragListBox
Common Controls\DragListBox Sample Illustrates using the DragListBox common control.
 
GUI Controls,
HotKey
Common Controls\Hot Key Sample Illustrates using a HotKey control.
 
Property Pages,
Resource Dll
Common Controls\Property Sheet Sample

progexe.gif (953 bytes)

Illustrates property pages and sheets. The sample displays two property pages.
pages1.sp is a project that contains a version with in-memory templates.
pages2.sp is a project that contains a version that loads an external resource DLL.
GUI Controls,
ReBar
Common Controls\ReBar Sample Iillustrates using a ReBar control.
GUI Controls,
Slider,
ProgressBar,
UpDown
Common Controls\Slider Sample Illustrates using Sliders, ProgressBars and UpDown controls.
GUI Controls,
TabControl
Common Controls\Tab Sample Illustrates using a TabControl to show and hide child controls.

 
GUI Controls,
Time&Date
Common Controls\Time&Date Sample Illustrates using Time and Date controls.
GUI Controls,
Toolbar
Common Controls\ToolSample

progexe.gif (953 bytes)

This sample illustrates using a toolbar.
 
GUI Controls,
TreeView
Common Controls\TreeView Sample Illustrates using a TreeView and a custom implementation of drag and drop. You can drag the colored balls from one place to another in the window.
Dialog Boxes
Dialog Boxes,
Application Startup
Dialogs\Dialog Application Sample Demonstrates how to start an application that displays only a dialog box. The dialog displays the list of logical drives and, for each drive the user selects, the percentage of free space in a progress bar.
Dialog Boxes Dialogs\Dialog Sample 1 This sample illustrates setting and retrieving dialog data using #setData and #getData.
Dialog Boxes Dialogs\Dialog Sample 2 Illustrates basic event handling and validation.
Miscellaneous
API Sample API Sample Demonstrates how to invoke API functions and pass parameters.
Clipboard Clipboard Sample Scripts that access the clipboard.
OLE Drag&Drop,
GUI Controls,
TreeView
Drag&Drop Sample DragDropSample
Illustrates using OLE Drag and Drop and TreeView.
The sample displays a TreeView and lets the user drag items in the tree view, and drop color names onto the tree view.

It also demonstrates using the clipboard to achieve the same result.

FileDropSample
Demonstrates acting as a recipient for OLE file drag-drop and simple file-based drop using WM_DROPFILES.

Graphics Hello World Sample HelloWorldWindow inherits from GraphicsWindow and paints 'Hello World' onto its client area.
 
Help Help Sample This sample displays a help file and supports context-sensitive help. Help is in the Windows help format, however, the steps to use HTML help are identical.
Note: Recent versions of the HTML Help control call the Windows help system when they encounter an non-HTML help file.
Floating point Native FP Demonstrates how to use native floating point arithmetic across method calls.
Printing Printing Sample A script that draws an ellipse onto the default printer.
Runtime Symbols Runtime Symbol Sample\symtest

progexe.gif (953 bytes)

Illustrates using symbols at runtime. The sample displays a dialog box that converts between symbol IDs and the associated strings. It is also possible to add new symbols.
Timer Timer Sample The sample uses WinTimer to update a progress bar in a dialog. As the progress bar advances, the time intervals are increased.
Window Procedure WndProc Sample The standard window procedure in Window is heavily optimized and may be difficult to read. The sample window procedure implements the same functionality in a more friendly way.

 

 

Win32 Samples

Location: Win32

Topic Folder Description
GUI Autorun

progexe.gif (953 bytes)

AUTORUN displays and lets the user modify the current autorun settings (the autorun settings control which devices use the auto play feature).
GUI Clock

progexe.gif (953 bytes)

Clock is a simple analog clock similar to the Windows clock accessory. It demonstrates elliptic regions (a Window can be confined to a non-rectangular region).
Exception Handling EHS EHSDemo demonstrates exception handling and finalization. EHSDemo>>test invokes #test: with a block that, depending on user input, either:
- returns from the home context (block return)
- raises an exception
- continues
EHSDemo>>test: evaluates the argument block in a nested exception handler. The outer handler handles the software exception ST_EXCEPTION_ABORT, and passes all other exceptions to the next handler in the chain. The inner handler installs a termination handler that will be invoked whenever the
control-of-flow returns from the guarded body. The finalization block will be executed whatever the outcome of executing the block is.
Fibers Fiber Sample This example implements a fiber based file copy operation. It is a Smalltalk
incarnation of the FIBERS sample in the Windows SDK. The executing thread in the process calls WinFiber class>>convertThreadToFiber, to convert the thread to a fiber. This also allows the resultant fiber to be scheduled by another fiber.

Next, two additional fibers are created, one fiber which performs read operations against a specified file, and another fiber which performs the write operations against a specified file.

The primary fiber then schedules the read fiber. After a succesful read, the read fiber schedules the write fiber. After a succesful write in the write fiber, the write fiber schedules the read fiber. When the read/write cycle has completed, the primary fiber is scheduled, which results in the display of the read/write status. If an error occurs during the read or write fibers, the primary fiber is scheduled and status of the read/write is displayed.

GUI FILEFIND

progexe.gif (953 bytes)

FileFind is a more advanced Windows application. It sports a ToolBar, StatusWindow
and ListViews that display a report view of files. The user enters a filename to
search for (the name can include wildcards), and FileFind will scan a specified drive
for multiple instances of the same file. For example, if you type readme.txt in the
edit field of the tool bar, you will most likely get a bunch of readme files. The
search is performed in a background task that can be aborted by the user.
When the user clicks on a file in the results pane, the right pane lists the details
of all instances. It then possible to select files and send them to the recycle bin.
GUI GENERIC

progexe.gif (953 bytes)

GENERIC is a minimal Windows application.
GUI HTMLDlg

progexe.gif (953 bytes)

HTMLDialog demonstrates how to display an HTML dialog, pass arguments and retrieve results.
Floating point Mandelbrot

progexe.gif (953 bytes)

MANDELBROT displays a Mandelbrot set. You can zoom into the display.
GUI,
MDI
MDI

progexe.gif (953 bytes)

SIMDI is a minimal Windows MDI application.
GUI,
ReBar
More Samples\CoolBar CoolWindow demonstrates using the ReBar control with several controls.
GUI,
PropertySheet / PropertyPage
More Samples\DynSheet DYNSHEET demonstrates using dynamic property sheets using an in-memory template.
While most property pages are built using a resource template, this sample builds in-memory templates for the pages.
GUI,
ToolTip
More Samples\ToolTips The TOOLTIPS project demonstrates using tooltips. The dialogs create a ToolTip control and add tool windows or process tooltip notifications to display tool windows.
The first sample dialog, TTTestDialog, associates a tooltip text string with each control. The association is static (i.e., valid during the lifetime of the dialog).
The second sample installs an event handler for the TTN_NEEDTEXT notification. The handle, #onNeedText:, specifies the text to display in the tooltip window.
Dynamic tooltips are useful when displaying text that is only known at runtime, such as a fill ratio.
GUI More Samples\TwinEdit TwinEdit implements a window with two rich edit controls that are scrolled
synchroneously. The implementation creates a subclassed edit control
with a scrollbar and an edit without the scrollbar style. It then
uses windows subclassing to trap the WM_VSCROLL message and notify its
parent.

When the subclassed edit control receives a WM_VSCROLL message, it sends
an EN_MSGFILTER notification with the WM_VSCROLL message to its parent.

The parent window defines a handler for the EN_MSGFILTER notification
message. The handler method passes each included WM_VSCROLL message to
the other edit control, so that it scrolls in sync.
 
GUI,
Multithreading
Philo

progexe.gif (953 bytes)

PHILO is an implementation of the five-philosophers problem, using native threads and synchronization.
GUI Res32

progexe.gif (953 bytes)

Res32 inspects the resource section of an executable. The user can load an EXE or a DLL (in the PE format), and Res32 displays a list view of all resources in the file.Clicking on individual resources such as dialogs and menus opens a temporary window that displays the resource in question.
Unlike some other tools that use Win32 APIs to locate and load the resources, Res32 maps the executable file into memory and analyses the resource section. Res32 can easily be extended to replace individual resources, or to append elements to the resource tree (as long they fit into the same virtual address space).
GUI,
RichEdit, ToolBar, Ruler
RichText

progexe.gif (953 bytes)

RichText shows a basic text editor application using the Rich Text Edit control. The application hosts a tool bar, a Ruler control, and toolbar controls that allow the user to set the current font and size.
GUI,
Document-View
Scribble

progexe.gif (953 bytes)

ScribbleDoc illustrates a document - view architecture. The document is composed of polylines the user can manipulate. The main window presents two views: a graphical view and a textual list representation. The user can draw new lines or delete existing ones.
The views are updated accordingly. The result can be saved to and restored from disk.
DLL Building Select

progdll.gif (971 bytes)

SELECT demonstrates a very simple DLL built in Smalltalk. SELECT is the companion DLL for the Select sample in the Windows SDK. For demonstration purposes, the executable DEMO.EXE has been included. You will find the complete sample in the Win32 SDK files.
DLL Building SimpleDLL

progdll.gif (971 bytes)

SIMPLEDLL demonstrates a very simple DLL built in Smalltalk. It shows how to accept basic C arguments in Smalltalk functions.
EXE Building SimpleEXE

progexe.gif (953 bytes)

SIMPLEXE demonstrates a very simple EXE built in Smalltalk.
GUI,
Wizard97
Wiz97 This sample implements a simple Wizard97.

 

Table of ContentsPrevious Page | Next Page

This site, created by DirectX MVP Robert Dunlop and aided by the work of other volunteers, provides a free on-line resource for DirectX programmers.

Special thanks to WWW.MVPS.ORG, for providing a permanent home for this site.

Visitors Since 1/1/2000: Hit Counter
Last updated: 07/26/05.