Page 1 of 1

Zooming Editorgadget (Windows-only )

Posted: Thu Nov 20, 2003 11:58 am
by Rings

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 

Posted: Sat Nov 22, 2003 3:11 pm
by Hi-Toro
Oh, very nice!

Posted: Tue Nov 25, 2003 1:20 pm
by TronDoc
you are too cool Rings!
--jb