Tech Articles


Trapping DataWindow Control System Commands


Perhaps you’ve enabled the titlebar and control menu of a DataWindow control.  You may even want the users to be able to minimize/maximize and reposition the control at runtime.

DataWindow Control Properties

Now you’d like to trap when the user interacts with the control in this fashion in order to execute some logic when they do. Perhaps you’d like to know when/if the user closes the DataWindow control.

Control Menu

Go ahead and map a custom event for the DataWindow control to the pbm_syscommand Event ID.

User Event Declaration

For purposes of demonstration, I’ve placed a singlelineedit control on a window and assigned the commandtype argument value of the event (an unsignedlong) as a string to the text property of the sle.

sle_commandtype.text = String ( commandtype )

In the screenshot, you can see that I’ve trapped the user clicking on the titlebar of the DataWindow control with a commandtype value of 61458. 

Command Type Numeric Value

For your reference, I’ve included a roster of commandtype values here in this tip. Happy trapping!

61458: TitleBar Clicked

61456: “Move” invoked from Control Menu (cursor keys can move DW control)

61587: Control menu dropped down

61536: DataWindow Control Closed by Control Menu (or “X”)

61472: DataWindow Control is Minimized

61488: DataWindow Control is Maximized or resized by border interaction

61728: DataWindow Control size is “Restored”

61441: DataWindow Control is resized by left border interaction

61442: DataWindow Control is resized by right border interaction

61443: DataWindow Control is resized by top border interaction

61444: DataWindow Control is resized by NW corner interaction

61445: DataWindow Control is resized by NE corner interaction

61446: DataWindow Control is resized by bottom border interaction

61447: DataWindow Control is resized by SW corner interaction

61448: DataWindow Control is resized by SE corner interaction

 

Comments (0)
There are no comments posted here yet

Find Articles by Tag

PowerBuilder (Appeon) Class Export License DragDrop DataType Interface RESTClient DevOps Database Connection Elevate Conference File HTTPClient Azure PowerBuilder PDFlib Variable PostgreSQL ODBC driver PBNI Trial External Functions Export JSON BLOB Outlook Platform Sort Encoding JSON TortoiseGit Migration XML C# WinAPI Windows OS .NET Std Framework Repository GhostScript SqlExecutor Event DataWindow SQL Server Database Table UI RibbonBar Builder Source Code Error Service Icon Jenkins Testing OrcaScript Deployment Import JSON Database Profile Resize SnapObjects PowerServer Mobile Filter .NET DataStore iOS Performance Oracle PBVM Open Source DataWindow JSON Messagging PFC Validation Transaction PowerServer Web Model COM Import .NET Assembly Git Event Handling SqlModelMapper Excel Design Stored Procedure Script 64-bit API Database Charts SVN InfoMaker OAuth Web Service Proxy PowerScript (PS) NativePDF PowerBuilder Compiler Menu Debug Source Control Event Handler Authentication Bug ActiveX Encryption Debugger PostgreSQL Array Graph SQL Database Painter OLE Expression ODBC MessageBox JSONGenerator Mobile SnapDevelop Web API OAuth 2.0 Branch & Merge Automated Testing Android JSONParser PBDOM Application TLS/SSL PDF SOAP WebBrowser Windows 10 Icons RibbonBar UI Themes Text Visual Studio Data Linux OS Authorization TreeView CoderObject Database Object Configuration CrypterObject 32-bit Database Table Data Database Table Schema IDE Window UI Modernization TFS DLL RichTextEdit Control Installation Debugging CI/CD SDK Syntax REST