PVDynamic Example Code
Previous  Top  Next

PureVision automatically adds this to the start of your Event Loop when a project is exported.


A full Initialization & Callback loop in your main source code might look like this:

;-Init Includes
XIncludeFile "Example_Constants.pb"
XIncludeFile "Example_Windows.pb"

Procedure SizeWindowHandler()
PVDynamic_Resize(WindowID(EventWindow()))
EndProcedure
BindEvent(#PB_Event_SizeWindow,@SizeWindowHandler())

Procedure WindowCallback(WindowID,Message,wParam,lParam)
ReturnValue=#PB_ProcessPureBasicEvents  
If Message=#WM_CTLCOLORSTATIC Or Message=#WM_CTLCOLOREDIT Or Message=#WM_CTLCOLORLISTBOX  
ReturnValue=PVDynamic_ColorGadget(lParam,wParam)  
EndIf  
ProcedureReturn ReturnValue  
EndProcedure



If you have made a number of changes to your project regarding Dynamic Resizing and your Event Loop already exists from an earlier Export, make sure the SizeWindowHandler() Procedure is at the beginning of your Main Event Loop.



If you are updating an existing Project and are unable to Export your original GUI File, you can manually edit your "_Window.pb" file.
Any line containing PVDynamic_AddLockWIndow, change to the following...

PVDynamic_AddLockWindow(#Window_Form1,1) -->
WindowBounds(#Window_Form1,WindowWidth(#Window_Form1),WindowHeight(#Window_Form1),WindowWidth(#Window_Form1),#PB_Ignore)

PVDynamic_AddLockWindow(#Window_Form1,2) -->
WindowBounds(#Window_Form1,WindowWidth(#Window_Form1),WindowHeight(#Window_Form1),#PB_Ignore,WindowHeight(#Window_Form1))

PVDynamic_AddLockWindow(#Window_Form1,3) -->
WindowBounds(#Window_Form1,WindowWidth(#Window_Form1),WindowHeight(#Window_Form1),#PB_Ignore,#PB_Ignore)