Zooming Editorgadget (Windows-only )
Posted: Thu Nov 20, 2003 11:58 am
Code: Select all
#WindowWidth = 600
#WindowHeight = 400
If OpenWindow(0, 100, 200, #WindowWidth, #WindowHeight, #PB_Window_MinimizeGadget, "PureBasic - EditorGadget Zooming")
If CreateGadgetList(WindowID())
rhwnd=EditorGadget(0,1,60,#WindowWidth ,#Windowheight-60)
SetGadgetText(0,"Purebasic rocks!")
Maxrange=300
MaxD=Maxrange/64 +1
TrackBarGadget(1, 1, 1, #WindowWidth, 40, 1, Maxrange )
TextGadget(2,2,40,400,14,"Set Zooming of Editgadget with Trackbar")
EndIf
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_EventGadget
If EventGadgetID()=1
Value=GetGadgetState(1)
lRet=SendMessage_(rhwnd,#EM_SetZoom,Value,MaxD)
If lRet=0
Debug "Error, Cannot set new zooming Range"
EndIf
EndIf
EndIf
Until EventID = #PB_EventCloseWindow
EndIf