Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCG/CGS/CGS Transitions
Function:
Required plugins for this example: MBS MacCG Plugin, MBS MacOSX Plugin, MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCG/CGS/CGS Transitions
This example is the version from Wed, 7th Aug 2012.
Project "CGS Transitions.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control PagePanel1 Inherits PagePanel
ControlInstance PagePanel1 Inherits PagePanel
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 1 Window1.FlipMBS End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 0 Window1.FlipBackMBS End EventHandler
End Control
Control PushButton3 Inherits PushButton
ControlInstance PushButton3 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 0 Window1.FlopBackMBS End EventHandler
End Control
Control PushButton4 Inherits PushButton
ControlInstance PushButton4 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 1 Window1.FlopMBS End EventHandler
End Control
Control PushButton5 Inherits PushButton
ControlInstance PushButton5 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 1 Window1.SwapDownMBS End EventHandler
End Control
Control PushButton6 Inherits PushButton
ControlInstance PushButton6 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 0 Window1.SwapUpMBS End EventHandler
End Control
Control PushButton7 Inherits PushButton
ControlInstance PushButton7 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 1 Window1.CubeUpDownMBS End EventHandler
End Control
Control PushButton8 Inherits PushButton
ControlInstance PushButton8 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 0 Window1.CubeUpDownMBS true End EventHandler
End Control
Control PushButton10 Inherits PushButton
ControlInstance PushButton10 Inherits PushButton
EventHandler Sub Action() PagePanel1.Value = 1 Window1.ZoomOutMBS DelayMBS .5 Window1.ZoomInMBS End EventHandler
End Control
Control PushButton11 Inherits PushButton
ControlInstance PushButton11 Inherits PushButton
EventHandler Sub Action() PagePanel1.Value = 0 Window1.ZoomOutMBS DelayMBS .5 Window1.ZoomInMBS End EventHandler
End Control
Control PushButton12 Inherits PushButton
ControlInstance PushButton12 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 1 Window1.CubeLeftRightMBS End EventHandler
End Control
Control PushButton13 Inherits PushButton
ControlInstance PushButton13 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 0 Window1.CubeLeftRightMBS True End EventHandler
End Control
Control PushButton14 Inherits PushButton
ControlInstance PushButton14 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 0 Window1.SlideLeftRightMBS True End EventHandler
End Control
Control PushButton15 Inherits PushButton
ControlInstance PushButton15 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 1 Window1.SlideLeftRightMBS End EventHandler
End Control
Control PushButton16 Inherits PushButton
ControlInstance PushButton16 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 1 Window1.SlideUpDownMBS End EventHandler
End Control
Control PushButton17 Inherits PushButton
ControlInstance PushButton17 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 0 Window1.SlideUpDownMBS True End EventHandler
End Control
Control PushButton18 Inherits PushButton
ControlInstance PushButton18 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 1 Window1.SwapLeftMBS End EventHandler
End Control
Control PushButton19 Inherits PushButton
ControlInstance PushButton19 Inherits PushButton
EventHandler Sub Action() Window1.PagePanel1.Value = 0 Window1.SwapRightMBS End EventHandler
End Control
Control PushButton20 Inherits PushButton
ControlInstance PushButton20 Inherits PushButton
EventHandler Sub Action() PagePanel1.Value = 0 Window1.FadeOutMBS DelayMBS .5 Window1.FadeInMBS End EventHandler
End Control
Control PushButton21 Inherits PushButton
ControlInstance PushButton21 Inherits PushButton
EventHandler Sub Action() PagePanel1.Value = 1 Window1.FadeOutMBS DelayMBS .5 Window1.FadeInMBS End EventHandler
End Control
Control Label1 Inherits Label
ControlInstance Label1 Inherits Label
End Control
Control Label2 Inherits Label
ControlInstance Label2 Inherits Label
End Control
Control PushButton22 Inherits PushButton
ControlInstance PushButton22 Inherits PushButton
EventHandler Sub Action() PagePanel1.Value = 0 Window1.WarpMBS End EventHandler
End Control
Control PushButton23 Inherits PushButton
ControlInstance PushButton23 Inherits PushButton
EventHandler Sub Action() PagePanel1.Value = 1 Window1.WarpMBS End EventHandler
End Control
Control PushButton24 Inherits PushButton
ControlInstance PushButton24 Inherits PushButton
EventHandler Sub Action() PagePanel1.Value = 1 Window1.WarpFadeMBS End EventHandler
End Control
Control PushButton25 Inherits PushButton
ControlInstance PushButton25 Inherits PushButton
EventHandler Sub Action() PagePanel1.Value = 0 Window1.WarpFadeMBS End EventHandler
End Control
EventHandler Sub Close() quit End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
Module WindowTransitionModule
Private Sub CGSTransitionsMBS(win As window, type As integer, direction As Integer) dim r as CGSTransitionRequestMBS dim w as CGSWindowMBS dim co As CGSConnectionMBS dim ct As new cgstransitionmBS co=new CGSConnectionMBS w=co.CGSWindow(win) r=new CGSTransitionRequestMBS Select case Type case 0 r.TransitionType=r.CGSFlip Case 1 r.TransitionType=r.CGSCube case 2 r.TransitionType=r.CGSSlide case 3 r.TransitionType=r.CGSSwap case 4 r.TransitionType=r.CGSWarpSwitch case 5 r.TransitionType=r.CGSWarpFade case 6 r.TransitionType=r.CGSFade case 7 r.TransitionType=r.CGSZoom end select select case direction case 0 r.TransitionOption=r.CGSLeft case 1 r.TransitionOption=r.CGSRight case 2 r.TransitionOption=r.CGSUp case 3 r.TransitionOption=r.CGSDown case 4 r.TransitionOption=r.CGSLeftBottomRight case 5 r.TransitionOption=r.CGSRightBottomLeft case 6 r.TransitionOption=r.CGSUpBottomRight case 7 r.TransitionOption=r.CGSDownTopRight case 8 r.TransitionOption=r.CGSBottomLeft case 9 r.TransitionOption=r.CGSBottomRight case 10 r.TransitionOption=r.CGSTopLeft case 11 r.TransitionOption=r.CGSTopRight case 12 r.TransitionOption=r.CGSInBottom case 13 r.TransitionOption=r.CGSInBottomRight case 14 r.TransitionOption=r.CGSInRight case 15 r.TransitionOption=r.CGSInOut end select r.HasBackGround=false r.HasBackColor=false r.Win=w ct=co.NewTransition(r) if ct<>Nil then win.refresh // draw new screen dim i As Double if Keyboard.ShiftKey then // Slow motion if SHIFT pressed i=5 else i=.5 end if ct.invoke i ct.wait i ct.release else 'MsgBox "Error creating the transition." end if End Sub
Sub CubeLeftRightMBS(Extends win As window, right As Boolean = False) dim i As Integer if right then i = 1 else i = 0 end if CGSTransitionsMBS win, 1, i End Sub
Sub CubeUpDownMBS(Extends win As window, down As Boolean = False) dim i As Integer if down then i = 3 else i = 2 end if CGSTransitionsMBS win, 1, i End Sub
Sub FadeInMBS(Extends w As Window) call w.TransitionWindowMBS(w, 4, 1) End Sub
Sub FadeOutMBS(Extends w As Window, CloseWindowAfterTransition As Boolean = False) call w.TransitionWindowMBS(w, 4, 2) if CloseWindowAfterTransition then w.close else w.hide end if End Sub
Sub FlipBackMBS(Extends win As window) CGSTransitionsMBS win, 0, 1 End Sub
Sub FlipMBS(Extends win As window) CGSTransitionsMBS win, 0, 0 End Sub
Sub FlopBackMBS(Extends win As window) CGSTransitionsMBS win, 0, 3 End Sub
Sub FlopMBS(Extends win As window) CGSTransitionsMBS win, 0, 2 End Sub
Sub SlideLeftRightMBS(Extends win As window, right As Boolean = False) dim i As Integer if right then i = 1 else i = 0 end if CGSTransitionsMBS win, 2, i End Sub
Sub SlideUpDownMBS(Extends win As window, down As Boolean = False) dim i As Integer if down then i = 3 else i = 2 end if CGSTransitionsMBS win, 2, i End Sub
Sub SwapDownMBS(Extends win As window) CGSTransitionsMBS win, 3, 3 End Sub
Sub SwapLeftMBS(Extends win As window) CGSTransitionsMBS win, 3, 0 End Sub
Sub SwapRightMBS(Extends win As window) CGSTransitionsMBS win, 3, 1 End Sub
Sub SwapUpMBS(Extends win As window) CGSTransitionsMBS win, 3, 2 End Sub
Sub WarpFadeMBS(Extends win As window) CGSTransitionsMBS win, 5, 1 End Sub
Sub WarpMBS(Extends win As window) CGSTransitionsMBS win, 4, 0 End Sub
Sub ZoomInMBS(Extends w As Window) call w.TransitionWindowMBS(w, 1, 1) End Sub
Sub ZoomOutMBS(Extends w As Window, CloseWindowAfterTransition As Boolean = False) call w.TransitionWindowMBS(w, 1, 2) if CloseWindowAfterTransition then w.close else w.hide end if End Sub
End Module
End Project

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacCG Plugin.





Links
MBS Xojo Chart Plugins