Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic Control Formatting — Dockable Frame Controls for OS/2 PM

Demonstrates how to make OS/2 Presentation Manager frame controls (toolbar and status bar) dockable and floatable at runtime. The user can detach the toolbar or status bar into its own floating frame window, hide it, or re-dock it back into the main frame — all without restarting the application.

The technique subclasses the frame window procedure to intercept WM_QUERYFRAMECTLCOUNT and WM_FORMATFRAME, allowing the application to dynamically add or remove controls from the frame layout. A floating control is hosted in a second, minimal frame window that is itself subclassed to format its single child.

The sample also includes a basic MLE-based text editor (New, Undo, Cut, Copy, Paste, Clear) with a bitmap toolbar and a status bar that tracks cursor line and column.

Dynamic_Control_Formatting Screenshot

Features

  • Dockable / floatable toolbar (bitmap menu)
  • Dockable / floatable status bar
  • View menu to toggle visibility of each control
  • MLE editor with standard edit commands
  • Line / column display updated via WM_TIMER

Source layout

src/
  editor1.cpp      Main source (window procs, docking logic)
  editor1.h        Resource ID definitions
  editor1.rc       Menu, toolbar, dialog, bitmap, and icon resources
  comments.ico     Application icon
  *.BMP            Toolbar button bitmaps (Undo, Cut, Copy, Paste, Clear)
  editor1-gcc.def  Module definition file for GCC/kLIBC linker
  editor1-ow.lnk   Linker response file for OpenWatcom wlink

Requirements

Tool Version
OpenWatcom 2.0 (wpp386, wlink, wrc)
GCC / kLIBC 9.2 bitwiseworks (g++, wrc for resources)
OS/2 Toolkit for os2.h and PM headers

Build

OpenWatcom 2.0

compile-ow.cmd

Output: bin-ow\EDITOR1.EXE

GCC 9.2 / kLIBC

compile-gcc.cmd

Output: bin-gcc\EDITOR1.EXE

The compile scripts set the required EMXOMFLD_* environment variables and write a build log (compile-ow.log / compile-gcc.log).

License

Not specified by the original authors.

Authors

  • Eric Slatts (original EDM/2 sample)
  • Alger Pike (docking control support)
  • Marc Mittelmeijer

Links

About

Sample: Making your Frame Controls Dockable

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages