Skip to content

Instantly share code, notes, and snippets.

@CarlTBarnes
Last active August 15, 2024 22:10
Show Gist options
  • Save CarlTBarnes/d980bbb72de9ac908d9d42d3f85e5e21 to your computer and use it in GitHub Desktop.
Save CarlTBarnes/d980bbb72de9ac908d9d42d3f85e5e21 to your computer and use it in GitHub Desktop.
Resize Window using the LibSrc Legacy WindowResizeType class in ResCode.clw
!!! 1. In Global Data / Program add thse 2 lines
PRAGMA('compile(ResCode.CLW)')
INCLUDE('ResDef.CLW'),ONCE
!!! 2. For each Window to Resize
!!! 2a. Add to Procedure DATA
WinResize WindowResizeType
!!! 2b. Add to Procedure CODE after Open(Window) to Init Resize
OPEN(Window)
!FYI you MUST call Resize.Init() or the Class &Queue's will not be NEW so calls will GPF
WinResize.Init(AppStrategy:Surface,Resize:SetMinSize) !This works ok, does not always fill space available for TEXT,LIST,Etc
!!! 2c. Add to Procedure Accept CASE EVENT()
ACCEPT
CASE EVENT()
OF EVENT:Sized ; POST(EVENT:DoResize) !Required for Resize Class
!!! 2d. Add to Procedure Return
WinResize.Kill()
!===========================================
For more information look at
ResDef.CLW - The WindowResizeType CLASS declartion
ResCode.CLW - The WindowResizeType CLASS code
ABRESIZE.EQU - Resize Equates and Types like ControlQueue and ResizeQueue
Extens.TPW - Resize Templates #EXTENSION (WindowResize
TODO:
Make a Resize Debug class to view the Queues and Properties.
It would have to be INCLUDE'd in the ResDef.CLW and ResCode.CLW
That would make it a Friend so it could see all the Private Data.
Could add the Get FEQ Name so List would show.
What does work is to use CbWndPreview ClassReflection.
DebugResizeBtn ROUTINE
DATA
WndPrvCls CbWndPreviewClass
CODE
WndPrvCls.ClassReflection(WinResize,'WinResize')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment