Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg As Dword
%IDC_Graphic = 500
Function PBMain() As Long
Dialog New Pixels, 0, "Graphic Set Clip",300,300,250,250, %WS_OverlappedWindow To hDlg
Control Add Graphic, hDlg, %IDC_Graphic, "",10,10,230,230, %WS_Border
Graphic Attach hDlg, %IDC_Graphic
Graphic Set WordWrap 1
Graphic Set Virtual 400,400
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local w,h,wClip,wCanvas As Long
Select Case Cb.Msg
Case %WM_Size
Dialog Get Client hDlg To w,h
Control Set Client hDlg, %IDC_Graphic, w-20,h-20
Graphic Clear
Graphic Set Clip 0,0,Graphic(Canvas.X) - Graphic(Client.X) + IIf(Graphic(Client.Y)<Graphic(Canvas.Y),Metrics(Scroll.Vert),0),0
Dialog Set Text hDlg, Str$(Graphic(Clip.X))
Graphic Print "Now is the time for all good men to come to the aid of their country"
End Select
End Function
'gbs_00576
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm