Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEV-SAMPLES-LIB-C-PlaceDialogButtons

OS/2 PM utility DLL that dynamically repositions pushbuttons evenly across the bottom of a dialog box.

Description

BTNPLC.DLL exports a single function, PlaceDialogButtons, which is useful when some dialog buttons are conditionally hidden or shown. After adjusting button visibility in WM_INITDLG, call this function to spread the remaining visible buttons evenly across the dialog's bottom edge.

Example usage:

PSHORT aidButtons;

aidButtons    = malloc( 2 * sizeof( SHORT ) );
aidButtons[0] = DID_OK;
aidButtons[1] = DID_CANCEL;
PlaceDialogButtons( hab, hwndDlg, 2, aidButtons );
free( aidButtons );

Function signature:

USHORT _System PlaceDialogButtons(
    HAB    hab,        /* Anchor block handle  */
    HWND   hwndDlg,   /* Dialog window handle */
    SHORT  cButtons,  /* Count of buttons     */
    PSHORT aidButtons /* Array of button IDs  */
);

Source structure

src/
  BTNPLC.C         - PlaceDialogButtons implementation + GCC DLL entry point
  btnplc-gcc.def   - GCC module definition (LIBRARY, bldlevel, EXPORTS)
  btnplc-ow.lnk    - OpenWatcom wlink script

Requirements

Install the following ArcaOS/OS/2 packages:

yum install git gcc make libc-devel binutils watcom-wrc watcom-wlink-hll

For OpenWatcom builds, install OpenWatcom 2.0 separately.

Building with GCC 9.2

Run from the project root on the OS/2 system:

compile-gcc.cmd

The DLL is placed in bin-gcc\BTNPLC.DLL.
The build log is saved to compile-gcc.log.

To clean: compile-gcc.cmd clean

Building with OpenWatcom 2.0

compile-ow.cmd

The DLL is placed in bin-ow\BTNPLC.DLL.
The build log is saved to compile-ow.log.

To clean: compile-ow.cmd clean

Version history

Version Date Notes
1.02 2026-07-28 Moved sources to src/, added OW build, fixed _System on definition, guarded _DLL_InitTerm for OW, fixed STACKSIZE typo.
1.01 2023-05-25 Added GCC DLL entry point (_DLL_InitTerm), bldlevel description.
1.00 1990-06-17 Original version by David C. Briccetti.

License

May be used for any purpose but not sold (per original author).

Authors

  • Martin Iturbide (2023, 2026)
  • David C. Briccetti (1990)

About

BTNPLC - PlaceDialogButtons function, single .C file. This function dynamically positions dialog pushbuttons across the bottom of a dialog box. It is useful in cases where different pushbuttons appear in different circumstances.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages