_Title "OS/3 Operating Environment - Version 2.01 ALPHA" Type Information Title As String * 4 versionNumber As Single buildNumber As _Unsigned Long End Type Type anOption Debug As _Byte End Type Type aDisplayOption isFullscreen As _Byte isScaled As _Byte isSmoothed As _Byte keepTextBackground As _Byte End Type Type aDisplay sizeX As _Unsigned Integer sizeY As _Unsigned Integer Options As aDisplayOption Handle As _Unsigned Long End Type Type aBackgroundOption isCentered As _Byte isScaled As _Byte isTiled As _Byte isSolidColour As _Byte theColour As _Unsigned Long End Type Type aBackground Options As aBackgroundOption Handle As _Unsigned Long End Type Type aCanvas positionX As Integer positionY As Integer sizeX As _Unsigned Integer sizeY As _Unsigned Integer Handle As _Unsigned Long End Type Type anIcon positionX As _Unsigned Integer positionY As _Unsigned Integer sizeX As _Unsigned Integer sizeY As _Unsigned Integer Handle As _Unsigned Long End Type Type aWindowStatus isMinimized As _Byte isRestored As _Byte isMaximized As _Byte 'wasRestored AS _BYTE ' in order to obsolete these two items, when minimizing window, do not clear the variables 'wasMaximized AS _BYTE ' isRestored or isMaximized, then if isMinimized and isRestored both are equal to -1, it is isResizing As _Byte ' equivalent to wasRestored = -1. isMinimized and isMaximized would be equivalent to wasMaximized. isMoving As _Byte isActive As _Byte End Type Type aWindowOption isDialogBox As _Byte isMinimizable As _Byte isRestorable As _Byte isMaximizable As _Byte isResizable As _Byte isMovable As _Byte End Type Type aWindow parentIdentifier As _Unsigned _Integer64 'The canvas handle that the window will be drawn to Canvas As aCanvas Icon As anIcon Title As String Status As aWindowStatus Options As aWindowOption Theme As String End Type Type aLimit Maximum As _Unsigned _Integer64 ' Maximum limit for the Canvas, Window, and Zone dynamic arrays. Minimum As _Unsigned _Integer64 ' Minimum ... End Type Type aSize Windows As _Unsigned _Integer64 Zones As _Unsigned _Integer64 End Type Type aGrayscale Black As _Unsigned Long Darkest As _Unsigned Long Darker As _Unsigned Long Dark As _Unsigned Long Neutral As _Unsigned Long Light As _Unsigned Long Lighter As _Unsigned Long Lightest As _Unsigned Long White As _Unsigned Long End Type Type aPrimaryColour Red As _Unsigned Long Green As _Unsigned Long Blue As _Unsigned Long End Type Type aSecondaryColour Cyan As _Unsigned Long Magenta As _Unsigned Long Yellow As _Unsigned Long End Type Type aTertiaryColour Azure As _Unsigned Long Violet As _Unsigned Long Rose As _Unsigned Long Orange As _Unsigned Long Chartreuse As _Unsigned Long springGreen As _Unsigned Long End Type Type aPalette Grayscale As aGrayscale Primary As aPrimaryColour Secondary As aSecondaryColour Tertiary As aTertiaryColour End Type Type aThemePalette activeTitlebar As _Unsigned Long inactiveTitlebar As _Unsigned Long Highlight As _Unsigned Long Shadow As _Unsigned Long HighlightDark As _Unsigned Long ShadowDark As _Unsigned Long Face As _Unsigned Long TranslucentFace As _Unsigned Long windowFace As _Unsigned Long windowHighlight As _Unsigned Long windowShadow As _Unsigned Long resizeBox As _Unsigned Long macForeground As _Unsigned Long macBackground As _Unsigned Long Desktop As _Unsigned Long End Type Type aZone parentIdentifier As _Unsigned _Integer64 childIdentifier As _Unsigned _Integer64 Identifier As _Unsigned _Integer64 positionX As _Unsigned Integer positionY As _Unsigned Integer sizeX As _Unsigned Integer sizeY As _Unsigned Integer Purpose As String * 10 End Type Type anIterator windowPut As _Unsigned _Integer64 windowRemove As _Unsigned _Integer64 checkWindow As _Unsigned _Integer64 checkZone As _Unsigned _Integer64 windowRaise As _Unsigned _Integer64 windowActivate As _Unsigned _Integer64 End Type Type aCursor positionX As Integer positionY As Integer leftClicked As _Byte rightClicked As _Byte imageHandle As _Unsigned Long End Type Dim Shared theInformation As Information theInformation.Title = "OS/3" theInformation.versionNumber = 2.0 theInformation.buildNumber = 0 Dim Shared theOption As anOption theOption.Debug = -1 Dim Shared theLimit As aLimit theLimit.Minimum = 0 theLimit.Maximum = 0 - 1 Dim Shared theSize As aSize theSize.Windows = theLimit.Minimum theSize.Zones = theLimit.Minimum Dim Shared theDisplay As aDisplay theDisplay.Options.isScaled = 0 theDisplay.Options.isSmoothed = -1 Dim Shared theBackground As aBackground ' Declare RGB Colors (Primary, Secondary, and Tertiary) Dim Shared thePalette As aPalette ' Initialize Grayscales (8 Brightness levels) thePalette.Grayscale.Black = _RGBA32(0, 0, 0, 255) thePalette.Grayscale.Darkest = _RGBA32(31, 31, 31, 255) thePalette.Grayscale.Darker = _RGBA32(63, 63, 63, 255) thePalette.Grayscale.Dark = _RGBA32(95, 95, 95, 255) thePalette.Grayscale.Neutral = _RGBA32(127, 127, 127, 255) thePalette.Grayscale.Light = _RGBA32(159, 159, 159, 255) thePalette.Grayscale.Lighter = _RGBA32(191, 191, 191, 255) thePalette.Grayscale.Lightest = _RGBA32(223, 223, 223, 255) thePalette.Grayscale.White = _RGBA32(255, 255, 255, 255) ' Initialize Colors (Primary, Secondary, and Tertiary) thePalette.Primary.Red = _RGBA32(255, 0, 0, 255) thePalette.Primary.Green = _RGBA32(0, 255, 0, 255) thePalette.Primary.Blue = _RGBA32(0, 0, 255, 255) thePalette.Secondary.Cyan = thePalette.Primary.Green + thePalette.Primary.Blue thePalette.Secondary.Magenta = thePalette.Primary.Red + thePalette.Primary.Blue thePalette.Secondary.Yellow = thePalette.Primary.Red + thePalette.Primary.Green thePalette.Tertiary.Azure = thePalette.Primary.Blue + thePalette.Secondary.Cyan thePalette.Tertiary.Violet = thePalette.Primary.Blue + thePalette.Secondary.Magenta thePalette.Tertiary.Rose = thePalette.Primary.Red + thePalette.Secondary.Magenta thePalette.Tertiary.springGreen = thePalette.Primary.Green + thePalette.Secondary.Cyan thePalette.Tertiary.Orange = thePalette.Primary.Red + thePalette.Secondary.Yellow thePalette.Tertiary.Chartreuse = thePalette.Primary.Green + thePalette.Secondary.Yellow ' Declare Theme colors Dim Shared theTheme As aThemePalette ' Initialize Theme colors theTheme.activeTitlebar = thePalette.Tertiary.Azure + thePalette.Secondary.Magenta theTheme.inactiveTitlebar = thePalette.Tertiary.Azure + thePalette.Tertiary.springGreen theTheme.resizeBox = thePalette.Grayscale.Light theTheme.Highlight = _RGBA32(237, 237, 237, 255) theTheme.Shadow = _RGBA32(175, 175, 175, 255) theTheme.HighlightDark = _RGBA32(189, 189, 189, 255) theTheme.ShadowDark = _RGBA32(125, 125, 125, 255) theTheme.Face = _RGBA32(173, 173, 173, 255) theTheme.TranslucentFace = _RGBA32(159, 159, 159, 127) theTheme.windowFace = _RGBA32(227, 235, 254, 255) theTheme.windowHighlight = _RGBA32(255, 255, 255, 95) theTheme.windowShadow = _RGBA32(0, 0, 0, 95) theTheme.resizeBox = thePalette.Grayscale.Black theTheme.activeTitlebar = _RGBA32(183, 202, 242, 255) theTheme.inactiveTitlebar = _RGBA32(209, 220, 248, 255) theTheme.macForeground = thePalette.Grayscale.Black theTheme.macBackground = thePalette.Grayscale.White theTheme.Desktop = _RGBA32(49, 99, 156, 255) Dim Shared theIterator As anIterator ' Declare global arrays ReDim Shared theWindow(theSize.Windows) As aWindow ReDim Shared theZone(theSize.Zones) As aZone Dim Shared theZoneMatched As _Unsigned _Integer64 Dim Shared theWindowMatched As _Unsigned _Integer64 Dim Shared thePurpose As String ' Declare mouse cursor variable Dim Shared theMouse As aCursor DISPLAY_Smooth 'DISPLAY_Scale DISPLAY_init 800, 600, 0 BACKGROUND_init -1 BACKGROUND_put ' Window 1 WINDOW_init 100, 100 WINDOW_title "Control Panel", theSize.Windows WINDOW_options -1, -1, -1, -1, -1, 0 WINDOW_status -1, -1, 0, 0, 0 WINDOW_draw "SYSTEM", theSize.Windows WINDOW_put 50, 50, theSize.Windows ZONE_commonInit ' Window 2 WINDOW_init 100, 100 WINDOW_title "File Manager", theSize.Windows WINDOW_options -1, -1, -1, -1, -1, 0 WINDOW_status -1, -1, 0, 0, 0 WINDOW_draw "WIN31", theSize.Windows WINDOW_put 100, 100, theSize.Windows ZONE_commonInit ' Window 3 WINDOW_init 100, 100 WINDOW_title "Test", theSize.Windows WINDOW_options -1, -1, -1, -1, -1, 0 WINDOW_status -1, -1, 0, 0, 0 WINDOW_draw "MACOS", theSize.Windows WINDOW_put 300, 400, theSize.Windows ZONE_commonInit ' Window 4 WINDOW_init 100, 100 WINDOW_title "Virus Scanner", theSize.Windows WINDOW_options -1, -1, -1, -1, -1, 0 WINDOW_status -1, -1, 0, 0, 0 WINDOW_draw "BEOS", theSize.Windows WINDOW_put 100, 100, theSize.Windows ZONE_commonInit ' Window 5 WINDOW_init 100, 100 WINDOW_title "IDE", theSize.Windows WINDOW_options -1, -1, -1, -1, -1, 0 WINDOW_status -1, -1, 0, 0, 0 WINDOW_draw "NONE", theSize.Windows WINDOW_put 100, 100, theSize.Windows ZONE_commonInit Do BACKGROUND_put For theIterator.windowPut = 1 To theSize.Windows WINDOW_put theWindow(theIterator.windowPut).Canvas.positionX, theWindow(theIterator.windowPut).Canvas.positionY, theIterator.windowPut Next theIterator.windowPut MOUSE_probe MOUSE_checkWindow MOUSE_checkZone theWindowMatched MOUSE_clickAction _Display Loop Until Len(InKey$): System ' End user code Sub DISPLAY_init (inSizeX As _Unsigned Integer, inSizeY As _Unsigned Integer, inIsFullscreen As _Byte) theDisplay.sizeX = inSizeX theDisplay.sizeY = inSizeY theDisplay.Options.isFullscreen = inIsFullscreen theDisplay.Handle = _NewImage(theDisplay.sizeX, theDisplay.sizeY, 32) Screen theDisplay.Handle _PrintMode _KeepBackground If inIsFullscreen Then DISPLAY_fullscreen theDisplay.Options.isScaled, theDisplay.Options.isSmoothed End If End Sub Sub DISPLAY_Scale If theDisplay.Options.isScaled = 0 Then theDisplay.Options.isScaled = -1 Else theDisplay.Options.isScaled = 0 End If End Sub Sub DISPLAY_Smooth If theDisplay.Options.isSmoothed = 0 Then theDisplay.Options.isSmoothed = -1 Else theDisplay.Options.isSmoothed = 0 End If End Sub Sub DISPLAY_fullscreen (inScaled As _Byte, inSmoothed As _Byte) If inScaled Then If inSmoothed Then theDisplay.Options.isScaled = -1 theDisplay.Options.isSmoothed = -1 If theDisplay.Options.isScaled = -1 And theDisplay.Options.isSmoothed = -1 Then _FullScreen _Stretch , _Smooth End If Else theDisplay.Options.isScaled = -1 theDisplay.Options.isSmoothed = 0 If theDisplay.Options.isScaled = -1 And theDisplay.Options.isSmoothed = 0 Then _FullScreen _Stretch End If End If Else If inSmoothed Then theDisplay.Options.isScaled = 0 theDisplay.Options.isSmoothed = -1 If theDisplay.Options.isScaled = 0 And theDisplay.Options.isSmoothed = -1 Then _FullScreen _SquarePixels , _Smooth End If Else theDisplay.Options.isScaled = 0 theDisplay.Options.isSmoothed = 0 If theDisplay.Options.isScaled = 0 And theDisplay.Options.isSmoothed = 0 Then _FullScreen _SquarePixels End If End If End If End Sub Sub BACKGROUND_add If Not theBackground.Handle Then theBackground.Handle = _NewImage(_Width(theDisplay.Handle), _Height(theDisplay.Handle), 32) End If End Sub Sub BACKGROUND_init (inIsImage As _Byte) BACKGROUND_add If inIsImage Then BACKGROUND_colour theTheme.Desktop BACKGROUND_image "Gold1.png", "TILE" Else BACKGROUND_colour theTheme.Desktop End If End Sub Sub BACKGROUND_image (inFilename As String, inOption As String) inFilename = LTrim$(RTrim$(inFilename)) If Len(inFilename) Then If _FileExists(inFilename) Then Dim Temporary As _Unsigned Long Temporary = _LoadImage(inFilename, 32) Else Exit Sub End If End If _Dest theBackground.Handle inOption = LTrim$(RTrim$(UCase$(inOption))) Select Case inOption Case "CENTER" Dim centeredX As _Unsigned Integer: centeredX = (_Width(theDisplay.Handle) - _Width(Temporary)) / 2 Dim centeredY As _Unsigned Integer: centeredY = (_Height(theDisplay.Handle) - _Height(Temporary)) / 2 _PutImage (centeredX, centeredY)-(_Width(Temporary) + centeredX, _Height(Temporary) + centeredY), Temporary, theBackground.Handle theBackground.Options.isCentered = -1 Case "SCALE" _PutImage (0, 0)-(_Width(theDisplay.Handle), _Height(theDisplay.Handle)), Temporary, theBackground.Handle theBackground.Options.isScaled = -1 Case "TILE" Dim numberWide As Single: numberWide = _Width / _Width(Temporary) Dim numberHigh As Single: numberHigh = _Height / _Height(Temporary) Dim currentTileY As _Unsigned Integer Dim currentTileX As _Unsigned Integer For currentTileY = 0 To numberHigh For currentTileX = 0 To numberWide _PutImage (_Width(Temporary) * currentTileX, _Height(Temporary) * currentTileY), Temporary, theBackground.Handle Next currentTileX Next currentTileY theBackground.Options.isTiled = -1 End Select _Dest theDisplay.Handle _FreeImage Temporary End Sub Sub BACKGROUND_colour (inColour As _Unsigned Long) _Dest theBackground.Handle Line (0, 0)-(_Width(theBackground.Handle), _Height(theBackground.Handle)), inColour, BF End Sub Sub BACKGROUND_put If theBackground.Handle Then _PutImage , theBackground.Handle, theDisplay.Handle End If End Sub Sub BACKGROUND_remove If theBackground.Handle Then _FreeImage (theBackground.Handle) End If End Sub Sub WINDOW_put (inPositionX As _Unsigned Integer, inPositionY As _Unsigned Integer, inIdentifier As _Unsigned _Integer64) theWindow(inIdentifier).Canvas.positionX = inPositionX theWindow(inIdentifier).Canvas.positionY = inPositionY _Dest theWindow(inIdentifier).Canvas.Handle _PutImage (theWindow(inIdentifier).Canvas.positionX, theWindow(inIdentifier).Canvas.positionY)-(theWindow(inIdentifier).Canvas.positionX + _Width(theWindow(inIdentifier).Canvas.Handle), theWindow(inIdentifier).Canvas.positionY + _Height(theWindow(inIdentifier).Canvas.Handle)), theWindow(inIdentifier).Canvas.Handle, theDisplay.Handle _Dest theDisplay.Handle End Sub Sub WINDOW_remove (inIdentifier As _Unsigned _Integer64) If theWindow(inIdentifier).Canvas.Handle Then _FreeImage (theWindow(inIdentifier).Canvas.Handle) End If For Iterator.windowRemove = inIdentifier To theSize.Windows - 1 Step 1 theWindow(Iterator.windowRemove) = theWindow(Iterator.windowRemove + 1) Next Iterator.windowRemove If theSize.Windows > theLimit.Minimum Then ' redim array theSize.Windows = theSize.Windows - 1 ReDim _Preserve theWindow(theSize.Windows) As aWindow End If End Sub Sub WINDOW_add If theSize.Windows < theLimit.Maximum Then theSize.Windows = theSize.Windows + 1 ReDim _Preserve theWindow(theSize.Windows) As aWindow End If End Sub Sub WINDOW_init (inSizeX As _Unsigned Integer, inSizeY As _Unsigned Integer) WINDOW_add theWindow(theSize.Windows).Canvas.sizeX = inSizeX theWindow(theSize.Windows).Canvas.sizeY = inSizeY theWindow(theSize.Windows).Canvas.Handle = _NewImage(theWindow(theSize.Windows).Canvas.sizeX, theWindow(theSize.Windows).Canvas.sizeY, 32) End Sub Sub WINDOW_title (inTitle As String, inIdentifier As _Unsigned _Integer64) theWindow(inIdentifier).Title = inTitle End Sub Sub WINDOW_draw (inTheme As String, inIdentifier As _Unsigned _Integer64) inTheme = LTrim$(RTrim$(UCase$(inTheme))) theWindow(inIdentifier).Theme = inTheme _Dest theWindow(inIdentifier).Canvas.Handle _PrintMode _KeepBackground Select Case inTheme Case "NONE" WIDGET_box 0, 0, _Width - 1, _Height - 1, 1 WIDGET_box 0, 0, _Width - 1, _Height - 1, 1 Case "SYSTEM" WIDGET_box 0, 0, _Width - 1, _Height - 1, 1 WIDGET_box 0, 0, _Width - 1, _Height - 1, 1 If theWindow(inIdentifier).Status.isActive Then WIDGET_titlebar 2, 2, _Width - 5, 23, theTheme.activeTitlebar Else WIDGET_titlebar 2, 2, _Width - 5, 23, theTheme.inactiveTitlebar End If WIDGET_box2 _Width - 48, 3, 20, 20, 1, 7 WIDGET_box2 _Width - 25, 3, 20, 20, 1, 2 WIDGET_box3 4, 3, 20, 20, 1, 1, 7 Case "BEOS" '''BeOS Dim g1 As _Unsigned Long, g2 As _Unsigned Long, g3 As _Unsigned Long If id = 0 Then g1 = _RGBA32(255, 255, 82, 255) g2 = _RGBA32(255, 206, 0, 255) g3 = _RGBA32(173, 123, 0, 255) Else g1 = _RGBA32(255, 255, 255, 255) g2 = _RGBA32(239, 239, 239, 255) g3 = _RGBA32(156, 156, 156, 255) End If WIDGET_box 0, 19, _Width - 1, _Height - 1, 1 Dim tabWidth As _Unsigned Integer: tabWidth = (50 + _PrintWidth(theWindow(inIdentifier).Title)) Dim tabHeight As _Unsigned Integer: tabHeight = 18 'window outline Line (0, 0)-(tabWidth, 0), _RGB(156, 156, 156) Line (tabWidth + 1, tabHeight)-(theWindow(inIdentifier).Canvas.sizeX - 1, tabHeight), _RGB(156, 156, 156) Line (0, 0)-(0, theWindow(inIdentifier).Canvas.sizeY - 1), _RGB(156, 156, 156) Line (tabWidth, 1)-(tabWidth, tabHeight), _RGB(99, 99, 99) Line (0, theWindow(inIdentifier).Canvas.sizeY)-(theWindow(inIdentifier).Canvas.sizeX, theWindow(inIdentifier).Canvas.sizeY), _RGB(99, 99, 99) Line (theWindow(inIdentifier).Canvas.sizeX, tabHeight - 1)-(theWindow(inIdentifier).Canvas.sizeX, theWindow(inIdentifier).Canvas.sizeY), _RGB(99, 99, 99) Line (1, theWindow(inIdentifier).Canvas.sizeY - 1)-(theWindow(inIdentifier).Canvas.sizeX - 1, theWindow(inIdentifier).Canvas.sizeY - 1), _RGB(140, 140, 140) Line (theWindow(inIdentifier).Canvas.sizeX - 1, theWindow(inIdentifier).Canvas.sizeY - 1)-(theWindow(inIdentifier).Canvas.sizeX - 1, tabHeight + 1), _RGB(140, 140, 140) Line (1, tabHeight + 1)-(1, theWindow(inIdentifier).Canvas.sizeY - 2), _RGB(255, 255, 255) Line (tabWidth - 1, tabHeight + 1)-(theWindow(inIdentifier).Canvas.sizeX - 2, tabHeight + 1), _RGB(255, 255, 255) Line (2, tabHeight + 1)-(tabWidth - 2, tabHeight + 1), _RGB(222, 222, 222) Line (2, tabHeight + 2)-(theWindow(inIdentifier).Canvas.sizeX - 2, theWindow(inIdentifier).Canvas.sizeY - 2), _RGB(222, 222, 222), B Line (3, tabHeight + 3)-(3, theWindow(inIdentifier).Canvas.sizeY - 3), _RGB(156, 156, 156) Line (3, tabHeight + 3)-(theWindow(inIdentifier).Canvas.sizeX - 4, tabHeight + 3), _RGB(156, 156, 156) Line (4, theWindow(inIdentifier).Canvas.sizeY - 3)-(theWindow(inIdentifier).Canvas.sizeX - 4, theWindow(inIdentifier).Canvas.sizeY - 3), _RGB(255, 255, 255) Line (theWindow(inIdentifier).Canvas.sizeX - 3, theWindow(inIdentifier).Canvas.sizeY - 3)-(theWindow(inIdentifier).Canvas.sizeX - 3, tabHeight + 3), _RGB(255, 255, 255) 'tab background Line (1, 1)-(tabWidth - 1, 1), g1 Line (1, 1)-(1, tabHeight), g1 Line (2, 2)-(tabWidth - 2, tabHeight), g2, BF Line (tabWidth - 1, 2)-(tabWidth - 1, tabHeight), g3 'buttons Dim c0 As _Unsigned Long: c0 = _RGBA32(255, 255, 57, 255) Dim c1 As _Unsigned Long: c1 = _RGBA32(255, 239, 33, 255) Dim c2 As _Unsigned Long: c2 = _RGBA32(255, 206, 0, 255) Dim c3 As _Unsigned Long: c3 = _RGBA32(239, 181, 0, 255) Dim c4 As _Unsigned Long: c4 = _RGBA32(214, 156, 0, 255) LeftButtonStartX = 3 LeftButtonStartY = 3 Line (LeftButtonStartX + 0, LeftButtonStartY + 0)-(LeftButtonStartX + 13, LeftButtonStartY + 0), c4 Line (LeftButtonStartX + 0, LeftButtonStartY + 0)-(LeftButtonStartX + 0, LeftButtonStartY + 13), c4 Line (LeftButtonStartX + 1, LeftButtonStartY + 1)-(LeftButtonStartX + 13, LeftButtonStartY + 1), c0 Line (LeftButtonStartX + 1, LeftButtonStartY + 1)-(LeftButtonStartX + 1, LeftButtonStartY + 13), c0 Line (LeftButtonStartX + 1, LeftButtonStartY + 13)-(LeftButtonStartX + 13, LeftButtonStartY + 13), c0 Line (LeftButtonStartX + 13, LeftButtonStartY + 13)-(LeftButtonStartX + 13, LeftButtonStartY + 1), c0 Line (LeftButtonStartX + 2, LeftButtonStartY + 12)-(LeftButtonStartX + 12, LeftButtonStartY + 12), c4 Line (LeftButtonStartX + 12, LeftButtonStartY + 12)-(LeftButtonStartX + 12, LeftButtonStartY + 2), c4 Line (LeftButtonStartX + 6, LeftButtonStartY + 11)-(LeftButtonStartX + 11, LeftButtonStartY + 11), c3 Line (LeftButtonStartX + 7, LeftButtonStartY + 10)-(LeftButtonStartX + 11, LeftButtonStartY + 10), c3 Line (LeftButtonStartX + 9, LeftButtonStartY + 9)-(LeftButtonStartX + 11, LeftButtonStartY + 9), c3 Line (LeftButtonStartX + 10, LeftButtonStartY + 8)-(LeftButtonStartX + 11, LeftButtonStartY + 8), c3 Line (LeftButtonStartX + 9, LeftButtonStartY + 7)-(LeftButtonStartX + 11, LeftButtonStartY + 7), c3 PSet (LeftButtonStartX + 11, LeftButtonStartY + 6), c3 Line (LeftButtonStartX + 9, LeftButtonStartY + 8)-(LeftButtonStartX + 8, LeftButtonStartY + 9), c2 Line (LeftButtonStartX + 8, LeftButtonStartY + 8)-(LeftButtonStartX + 7, LeftButtonStartY + 9), c3 Line (LeftButtonStartX + 11, LeftButtonStartY + 3)-(LeftButtonStartX + 10, LeftButtonStartY + 4), c1 Line (LeftButtonStartX + 6, LeftButtonStartY + 10)-(LeftButtonStartX + 5, LeftButtonStartY + 11), c2 Line (LeftButtonStartX + 11, LeftButtonStartY + 5)-(LeftButtonStartX + 10, LeftButtonStartY + 6), c2 Line (LeftButtonStartX + 11, LeftButtonStartY + 4)-(LeftButtonStartX + 4, LeftButtonStartY + 11), c2 Line (LeftButtonStartX + 9, LeftButtonStartY + 5)-(LeftButtonStartX + 5, LeftButtonStartY + 9), c2 Line (LeftButtonStartX + 4, LeftButtonStartY + 10)-(LeftButtonStartX + 3, LeftButtonStartY + 11), c1 Line (LeftButtonStartX + 11, LeftButtonStartY + 2)-(LeftButtonStartX + 2, LeftButtonStartY + 11), c2 Line (LeftButtonStartX + 10, LeftButtonStartY + 2)-(LeftButtonStartX + 2, LeftButtonStartY + 10), c1 Line (LeftButtonStartX + 8, LeftButtonStartY + 3)-(LeftButtonStartX + 3, LeftButtonStartY + 8), c2 Line (LeftButtonStartX + 8, LeftButtonStartY + 2)-(LeftButtonStartX + 2, LeftButtonStartY + 8), c1 Line (LeftButtonStartX + 7, LeftButtonStartY + 2)-(LeftButtonStartX + 2, LeftButtonStartY + 7), c1 Line (LeftButtonStartX + 6, LeftButtonStartY + 2)-(LeftButtonStartX + 2, LeftButtonStartY + 6), c1 Line (LeftButtonStartX + 5, LeftButtonStartY + 2)-(LeftButtonStartX + 2, LeftButtonStartY + 5), c1 Line (LeftButtonStartX + 4, LeftButtonStartY + 2)-(LeftButtonStartX + 2, LeftButtonStartY + 4), c0 Line (LeftButtonStartX + 3, LeftButtonStartY + 2)-(LeftButtonStartX + 2, LeftButtonStartY + 3), c1 PSet (LeftButtonStartX + 2, LeftButtonStartY + 2), c0 PSet (LeftButtonStartX + 9, LeftButtonStartY + 2), c1 PSet (LeftButtonStartX + 2, LeftButtonStartY + 9), c1 RightButtonStartX = (tabWidth - 14) - 2 RightButtonStartY = 3 Line (RightButtonStartX + 0, RightButtonStartY + 0)-(RightButtonStartX + 7, RightButtonStartY + 0), c4 Line (RightButtonStartX + 0, RightButtonStartY + 0)-(RightButtonStartX + 0, RightButtonStartY + 7), c4 Line (RightButtonStartX + 1, RightButtonStartY + 1)-(RightButtonStartX + 8, RightButtonStartY + 1), c0 Line (RightButtonStartX + 1, RightButtonStartY + 1)-(RightButtonStartX + 1, RightButtonStartY + 8), c0 Line (RightButtonStartX + 8, RightButtonStartY + 1)-(RightButtonStartX + 8, RightButtonStartY + 8), c0 Line (RightButtonStartX + 1, RightButtonStartY + 8)-(RightButtonStartX + 8, RightButtonStartY + 8), c0 Line (RightButtonStartX + 2, RightButtonStartY + 7)-(RightButtonStartX + 7, RightButtonStartY + 7), c4 Line (RightButtonStartX + 7, RightButtonStartY + 2)-(RightButtonStartX + 7, RightButtonStartY + 7), c4 Line (RightButtonStartX + 9, RightButtonStartY + 3)-(RightButtonStartX + 13, RightButtonStartY + 3), c4 Line (RightButtonStartX + 9, RightButtonStartY + 4)-(RightButtonStartX + 13, RightButtonStartY + 4), c0 Line (RightButtonStartX + 13, RightButtonStartY + 4)-(RightButtonStartX + 13, RightButtonStartY + 13), c0 Line (RightButtonStartX + 13, RightButtonStartY + 13)-(RightButtonStartX + 4, RightButtonStartY + 13), c0 Line (RightButtonStartX + 4, RightButtonStartY + 13)-(RightButtonStartX + 4, RightButtonStartY + 9), c0 Line (RightButtonStartX + 3, RightButtonStartY + 13)-(RightButtonStartX + 3, RightButtonStartY + 9), c4 Line (RightButtonStartX + 12, RightButtonStartY + 5)-(RightButtonStartX + 12, RightButtonStartY + 12), c4 Line (RightButtonStartX + 12, RightButtonStartY + 12)-(RightButtonStartX + 5, RightButtonStartY + 12), c4 Line (RightButtonStartX + 11, RightButtonStartY + 6)-(RightButtonStartX + 11, RightButtonStartY + 11), c3 Line (RightButtonStartX + 6, RightButtonStartY + 11)-(RightButtonStartX + 11, RightButtonStartY + 11), c3 Line (RightButtonStartX + 5, RightButtonStartY + 9)-(RightButtonStartX + 5, RightButtonStartY + 11), c1 Line (RightButtonStartX + 6, RightButtonStartY + 9)-(RightButtonStartX + 6, RightButtonStartY + 10), c1 PSet (RightButtonStartX + 7, RightButtonStartY + 9), c1 Line (RightButtonStartX + 9, RightButtonStartY + 5)-(RightButtonStartX + 11, RightButtonStartY + 5), c1 Line (RightButtonStartX + 9, RightButtonStartY + 6)-(RightButtonStartX + 10, RightButtonStartY + 6), c1 PSet (RightButtonStartX + 9, RightButtonStartY + 7), c1 Line (RightButtonStartX + 10, RightButtonStartY + 9)-(RightButtonStartX + 10, RightButtonStartY + 10), c2 PSet (RightButtonStartX + 9, RightButtonStartY + 10), c2 Line (RightButtonStartX + 10, RightButtonStartY + 8)-(RightButtonStartX + 8, RightButtonStartY + 10), c1 Line (RightButtonStartX + 10, RightButtonStartY + 7)-(RightButtonStartX + 7, RightButtonStartY + 10), c2 Line (RightButtonStartX + 2, RightButtonStartY + 2)-(RightButtonStartX + 4, RightButtonStartY + 2), c1 Line (RightButtonStartX + 2, RightButtonStartY + 3)-(RightButtonStartX + 3, RightButtonStartY + 3), c1 PSet (RightButtonStartX + 2, RightButtonStartY + 4), c1 Line (RightButtonStartX + 6, RightButtonStartY + 2)-(RightButtonStartX + 6, RightButtonStartY + 4), c2 Line (RightButtonStartX + 2, RightButtonStartY + 6)-(RightButtonStartX + 3, RightButtonStartY + 6), c2 Line (RightButtonStartX + 5, RightButtonStartY + 2)-(RightButtonStartX + 2, RightButtonStartY + 5), c2 Line (RightButtonStartX + 5, RightButtonStartY + 3)-(RightButtonStartX + 3, RightButtonStartY + 5), c1 Line (RightButtonStartX + 4, RightButtonStartY + 6)-(RightButtonStartX + 6, RightButtonStartY + 6), c3 PSet (RightButtonStartX + 6, RightButtonStartY + 5), c3 Line (RightButtonStartX + 4, RightButtonStartY + 5)-(RightButtonStartX + 5, RightButtonStartY + 5), c2 PSet (RightButtonStartX + 5, RightButtonStartY + 4), c2 Color _RGB(0, 0, 0), g2 _PrintString (25, 3), theWindow(inIdentifier).Title Case "WIN31" If theWindow(inIdentifier).Options.isDialogBox Then Line (0, 0)-(theWindow(inIdentifier).Canvas.sizeX - 1, theWindow(inIdentifier).Canvas.sizeY - 1), thePalette.Grayscale.Black, B Line (1, 1)-(theWindow(inIdentifier).Canvas.sizeX - 2, theWindow(inIdentifier).Canvas.sizeY - 2), windowBackgroundColor, BF If theWindow(inIdentifier).Status.isActive Then Line (1, 1)-(theWindow(inIdentifier).Canvas.sizeX - 2, theWindow(inIdentifier).Canvas.sizeY - 2), theTheme.activeTitlebar, BF Line (4, 4)-(theWindow(inIdentifier).Canvas.sizeX - 5, theWindow(inIdentifier).Canvas.sizeY - 5), windowBackgroundColor, BF WIDGET_Button31 5, 5, 22, 22, 6, 0 Line (23, 5)-(23, 23), thePalette.Grayscale.Black Line (5, 23)-(23, 23), thePalette.Grayscale.Black If theWindow(inIdentifier).Status.isActive = -1 Then Line (24, 5)-(theWindow(inIdentifier).Canvas.sizeX - 6, 23), theTheme.activeTitlebar, BF Line (5, 23)-(theWindow(inIdentifier).Canvas.sizeX - 6, 23), thePalette.Grayscale.Black Centering = (theWindow(inIdentifier).Canvas.sizeX - (30 + Len(theWindow(inIdentifier).Title))) / 2 _PrintString (Centering + 23, 7), theWindow(inIdentifier).Title Else Line (0, 0)-(theWindow(inIdentifier).Canvas.sizeX - 1, theWindow(inIdentifier).Canvas.sizeY - 1), thePalette.Grayscale.Black, B Line (1, 1)-(theWindow(inIdentifier).Canvas.sizeX - 2, theWindow(inIdentifier).Canvas.sizeY - 2), theTheme.HighlightDark, B Line (2, 2)-(theWindow(inIdentifier).Canvas.sizeX - 2, theWindow(inIdentifier).Canvas.sizeY - 2), theTheme.ShadowDark, B Line (2, 2)-(theWindow(inIdentifier).Canvas.sizeX - 3, theWindow(inIdentifier).Canvas.sizeY - 3), theTheme.Highlight, B Line (3, 3)-(theWindow(inIdentifier).Canvas.sizeX - 3, theWindow(inIdentifier).Canvas.sizeY - 3), theTheme.Shadow, B Line (3, 3)-(theWindow(inIdentifier).Canvas.sizeX - 4, theWindow(inIdentifier).Canvas.sizeY - 4), thePalette.Grayscale.Black, B Line (0, theWindow(inIdentifier).Canvas.sizeY - 23)-(3, theWindow(inIdentifier).Canvas.sizeY - 23), thePalette.Grayscale.Black Line (23, theWindow(inIdentifier).Canvas.sizeY - 3)-(23, theWindow(inIdentifier).Canvas.sizeY), thePalette.Grayscale.Black If theWindow(inIdentifier).Options.isResizable = 0 Then Line (theWindow(inIdentifier).Canvas.sizeX, theWindow(inIdentifier).Canvas.sizeY - 23)-(theWindow(inIdentifier).Canvas.sizeX - 3, theWindow(inIdentifier).Canvas.sizeY - 23), thePalette.Grayscale.Black Line (theWindow(inIdentifier).Canvas.sizeX - 23, theWindow(inIdentifier).Canvas.sizeY - 3)-(theWindow(inIdentifier).Canvas.sizeX - 23, theWindow(inIdentifier).Canvas.sizeY), thePalette.Grayscale.Black End If Line (4, 4)-(theWindow(inIdentifier).Canvas.sizeX - 5, theWindow(inIdentifier).Canvas.sizeY - 5), theTheme.windowFace, BF If theWindow(inIdentifier).Status.isActive = -1 Then Line (4, 4)-(theWindow(inIdentifier).Canvas.sizeX - 6, 21), theTheme.activeTitlebar, BF Else Line (4, 4)-(theWindow(inIdentifier).Canvas.sizeX - 6, 21), theTheme.inactiveTitlebar, BF End If Line (theWindow(inIdentifier).Canvas.sizeX - 23, 0)-(theWindow(inIdentifier).Canvas.sizeX - 1, 22), thePalette.Grayscale.Black, B Line (theWindow(inIdentifier).Canvas.sizeX - 42, 3)-(theWindow(inIdentifier).Canvas.sizeX - 23, 22), thePalette.Grayscale.Black, B Line (0, 0)-(22, 22), thePalette.Grayscale.Black, B Line (0, 22)-(theWindow(inIdentifier).Canvas.sizeX - 1, 22), thePalette.Grayscale.Black WIDGET_Button31 4, 4, 21, 21, 5, 0 WIDGET_Button31 theWindow(inIdentifier).Canvas.sizeX - 41, 4, theWindow(inIdentifier).Canvas.sizeX - 24, 21, 3, 0 Centering = (theWindow(inIdentifier).Canvas.sizeX - (60 + _PrintWidth(theWindow(inIdentifier).Title))) / 2 _PrintString (Centering + 20, 5), theWindow(inIdentifier).Title If theWindow(inIdentifier).Status.isMaximized = 0 Then WIDGET_Button31 theWindow(inIdentifier).Canvas.sizeX - 22, 4, theWindow(inIdentifier).Canvas.sizeX - 5, 21, 1, 0 ElseIf theWindow(inIdentifier).Status.isMaximized = -1 Then WIDGET_Button31 theWindow(inIdentifier).Canvas.sizeX - 22, 4, theWindow(inIdentifier).Canvas.sizeX - 5, 21, 2, 0 End If If theWindow(inIdentifier).Options.isResizable = -1 Then Line (theWindow(inIdentifier).Canvas.sizeX - 23, theWindow(inIdentifier).Canvas.sizeY - 23)-(theWindow(inIdentifier).Canvas.sizeX - 1, theWindow(inIdentifier).Canvas.sizeY - 1), thePalette.Grayscale.Black, B WIDGET_Button31 theWindow(inIdentifier).Canvas.sizeX - 22, theWindow(inIdentifier).Canvas.sizeY - 22, theWindow(inIdentifier).Canvas.sizeX - 5, theWindow(inIdentifier).Canvas.sizeY - 5, 4, 0 End If End If Case "MACOS" 'Window border Line (0, 0)-(theWindow(inIdentifier).Canvas.sizeX, theWindow(inIdentifier).Canvas.sizeY), theTheme.macForeground, B Line (0, 0)-(theWindow(inIdentifier).Canvas.sizeX - 1, theWindow(inIdentifier).Canvas.sizeY - 1), theTheme.macForeground, B 'Window Background Line (1, 1)-(theWindow(inIdentifier).Canvas.sizeX - 2, theWindow(inIdentifier).Canvas.sizeY - 2), theTheme.macBackground, BF 'Titlebar lines Line (2, 4)-(theWindow(inIdentifier).Canvas.sizeX - 3, 4), theTheme.macForeground Line (2, 6)-(theWindow(inIdentifier).Canvas.sizeX - 3, 6), theTheme.macForeground Line (2, 8)-(theWindow(inIdentifier).Canvas.sizeX - 3, 8), theTheme.macForeground Line (2, 10)-(theWindow(inIdentifier).Canvas.sizeX - 3, 10), theTheme.macForeground Line (2, 12)-(theWindow(inIdentifier).Canvas.sizeX - 3, 12), theTheme.macForeground Line (2, 14)-(theWindow(inIdentifier).Canvas.sizeX - 3, 14), theTheme.macForeground Line (2, 16)-(theWindow(inIdentifier).Canvas.sizeX - 3, 16), theTheme.macForeground 'Titlebar Button Line (10, 3)-(23, 17), theTheme.macBackground, BF Line (11, 4)-(22, 16), theTheme.macForeground, B 'Info area & border Line (0, 20)-(theWindow(inIdentifier).Canvas.sizeX - 1, 20), theTheme.macForeground Line (0, 38)-(theWindow(inIdentifier).Canvas.sizeX - 1, 38), theTheme.macForeground Line (0, 40)-(theWindow(inIdentifier).Canvas.sizeX - 1, 40), theTheme.macForeground 'Scrollbar borders Line (0, theWindow(inIdentifier).Canvas.sizeY - 17)-(theWindow(inIdentifier).Canvas.sizeX - 1, theWindow(inIdentifier).Canvas.sizeY - 17), theTheme.macForeground Line (theWindow(inIdentifier).Canvas.sizeX - 17, 40)-(theWindow(inIdentifier).Canvas.sizeX - 17, theWindow(inIdentifier).Canvas.sizeY - 1), theTheme.macForeground 'Scroll button edges Line (theWindow(inIdentifier).Canvas.sizeX - 17, theWindow(inIdentifier).Canvas.sizeY - 32)-(theWindow(inIdentifier).Canvas.sizeX - 1, theWindow(inIdentifier).Canvas.sizeY - 32), theTheme.macForeground WIDGET_buttonMac (theWindow(inIdentifier).Canvas.sizeX - 17) + 1, (theWindow(inIdentifier).Canvas.sizeY - 32) + 1, 2 Line (15, theWindow(inIdentifier).Canvas.sizeY - 17)-(15, theWindow(inIdentifier).Canvas.sizeY - 1), theTheme.macForeground WIDGET_buttonMac 1, (theWindow(inIdentifier).Canvas.sizeY - 17) + 1, 4 Line (theWindow(inIdentifier).Canvas.sizeX - 32, theWindow(inIdentifier).Canvas.sizeY - 17)-(theWindow(inIdentifier).Canvas.sizeX - 32, theWindow(inIdentifier).Canvas.sizeY - 1), theTheme.macForeground WIDGET_buttonMac (theWindow(inIdentifier).Canvas.sizeX - 32) + 1, (theWindow(inIdentifier).Canvas.sizeY - 17) + 1, 3 Line (theWindow(inIdentifier).Canvas.sizeX - 17, 55)-(theWindow(inIdentifier).Canvas.sizeX - 1, 55), theTheme.macForeground WIDGET_buttonMac (theWindow(inIdentifier).Canvas.sizeX - 17) + 1, 40 + 1, 1 'Resize button Line (theWindow(inIdentifier).Canvas.sizeX - 14, theWindow(inIdentifier).Canvas.sizeY - 14)-(theWindow(inIdentifier).Canvas.sizeX - 7, theWindow(inIdentifier).Canvas.sizeY - 7), theTheme.macForeground, B Line (theWindow(inIdentifier).Canvas.sizeX - 12, theWindow(inIdentifier).Canvas.sizeY - 12)-(theWindow(inIdentifier).Canvas.sizeX - 3, theWindow(inIdentifier).Canvas.sizeY - 3), theTheme.macForeground, B Line (theWindow(inIdentifier).Canvas.sizeX - 13, theWindow(inIdentifier).Canvas.sizeY - 13)-(theWindow(inIdentifier).Canvas.sizeX - 8, theWindow(inIdentifier).Canvas.sizeY - 8), theTheme.macBackground, BF PATTERN_checkerboxDither 16, theWindow(inIdentifier).Canvas.sizeY - 16, theWindow(inIdentifier).Canvas.sizeX - 49, 14, theTheme.macForeground, theTheme.macBackground PATTERN_checkerboxDither theWindow(inIdentifier).Canvas.sizeX - 16, 56, 14, theWindow(inIdentifier).Canvas.sizeY - 89, theTheme.macForeground, theTheme.macBackground End Select _Dest theDisplay.Handle End Sub Sub WINDOW_options (inIsMinimizable As _Byte, inIsRestorable As _Byte, inIsMaximizable As _Byte, inIsMovable As _Byte, inIsResizable As _Byte, inIsDialogBox As _Byte) theWindow(theSize.Windows).Options.isMinimizable = inIsMinimizable theWindow(theSize.Windows).Options.isRestorable = inIsRestorable theWindow(theSize.Windows).Options.isMaximizable = inIsMaximizable theWindow(theSize.Windows).Options.isMovable = inIsMovable theWindow(theSize.Windows).Options.isResizable = inIsResizable theWindow(theSize.Windows).Options.isDialogBox = inIsDialogBox End Sub Sub WINDOW_status (inIsMinimized As _Byte, inIsRestored As _Byte, inIsMaximized As _Byte, inIsMoving As _Byte, inIsResizing As _Byte) theWindow(theSize.Windows).Status.isMinimized = inIsMinimized theWindow(theSize.Windows).Status.isRestored = inIsRestored theWindow(theSize.Windows).Status.isMaximized = inIsMaximized theWindow(theSize.Windows).Status.isMoving = inIsMoving theWindow(theSize.Windows).Status.isResizing = inIsResizing End Sub Sub WINDOW_minimize (inIdentifier As _Unsigned _Integer64) If theWindow(inIdentifier).Options.isMinimizable Then theWindow(inIdentifier).Status.isMinimized = -1 End If If Not theWindow(inIdentifier).Icon.Handle Then theWindow(inIdentifier).Icon.Handle = _LoadImage("blank.png") End If End Sub Sub WINDOW_restore (inIdentifier As _Unsigned _Integer64) If theWindow(inIdentifier).Options.isRestorable Then theWindow(inIdentifier).Status.isMinimized = 0 theWindow(theSize.Windows).Status.isRestored = -1 theWindow(inIdentifier).Status.isMaximized = 0 End If End Sub Sub WINDOW_maximize (inIdentifier As _Unsigned _Integer64) If theWindow(inIdentifier).Options.isMaximizable Then theWindow(theSize.Windows).Status.isMaximized = -1 End If End Sub Sub WINDOW_move (inIdentifier As _Unsigned _Integer64) If theWindow(inIdentifier).Options.isMovable Then theWindow(inIdentifier).Status.isMoving = -1 Dim previousPositionX As _Unsigned Integer, previousPositionY As _Unsigned Integer previousPositionX = theWindow(inIdentifier).Canvas.positionX - theMouse.positionX previousPositionY = theWindow(inIdentifier).Canvas.positionY - theMouse.positionY While theMouse.leftClicked BACKGROUND_put For theIterator.windowPut = 1 To theSize.Windows WINDOW_put theWindow(theIterator.windowPut).Canvas.positionX, theWindow(theIterator.windowPut).Canvas.positionY, theIterator.windowPut Next theIterator.windowPut MOUSE_probe theWindow(inIdentifier).Canvas.positionX = theMouse.positionX + previousPositionX theWindow(inIdentifier).Canvas.positionY = theMouse.positionY + previousPositionY _PutImage (theWindow(inIdentifier).Canvas.positionX, theWindow(inIdentifier).Canvas.positionY), theWindow(inIdentifier).Canvas.Handle _Display Wend theWindow(inIdentifier).Status.isMoving = 0 End If End Sub Sub WINDOW_resize (inIdentifier As _Unsigned _Integer64) If theWindow(inIdentifier).Options.isResizable Then theWindow(inIdentifier).Status.isResizing = -1 Dim positionX As _Unsigned Integer, positionY As _Unsigned Integer Dim sizeX As _Unsigned Integer, sizeY As _Unsigned Integer positionX = theWindow(inIdentifier).Canvas.positionX positionY = theWindow(inIdentifier).Canvas.positionY While theMouse.leftClicked BACKGROUND_put For theIterator.windowPut = 1 To theSize.Windows WINDOW_put theWindow(theIterator.windowPut).Canvas.positionX, theWindow(theIterator.windowPut).Canvas.positionY, theIterator.windowPut Next theIterator.windowPut MOUSE_probe If theOption.Debug Then _PrintString (0, 750), LTrim$(RTrim$(Str$(theMouse.positionX - theWindow(inIdentifier).Canvas.positionX))) _PrintString (100, 750), LTrim$(RTrim$(Str$(theMouse.positionY - theWindow(inIdentifier).Canvas.positionY))) End If _Display Wend sizeX = (theMouse.positionX - theWindow(inIdentifier).Canvas.positionX) sizeY = (theMouse.positionY - theWindow(inIdentifier).Canvas.positionY) theWindow(inIdentifier).Canvas.sizeX = sizeX theWindow(inIdentifier).Canvas.sizeY = sizeY _FreeImage theWindow(inIdentifier).Canvas.Handle theWindow(inIdentifier).Canvas.Handle = _NewImage(theWindow(inIdentifier).Canvas.sizeX, theWindow(inIdentifier).Canvas.sizeY, 32) WINDOW_draw theWindow(inIdentifier).Theme, inIdentifier WINDOW_put positionX, positionY, inIdentifier ZONE_commonUpdate inIdentifier theWindow(inIdentifier).Status.isResizing = 0 End If End Sub Sub WINDOW_raise (inIdentifier As _Unsigned _Integer64) Dim temporaryWindow As aWindow: temporaryWindow = theWindow(inIdentifier) For theIterator.windowRaise = inIdentifier To theSize.Windows If theIterator.windowRaise >= inIdentifier And theIterator.windowRaise < theSize.Windows Then theWindow(theIterator.windowRaise) = theWindow(theIterator.windowRaise + 1) End If Next theIterator.windowRaise theWindow(theSize.Windows) = temporaryWindow ZONE_commonUpdate theSize.Windows WINDOW_activate inIdentifier End Sub Sub WINDOW_activate (inIdentifier As _Unsigned _Integer64) For theIterator.windowActivate = theLimit.Minimum + 1 To theSize.Windows theWindow(theIterator.windowActivate).Status.isActive = 0 Next theIterator.windowActivate theWindow(inIdentifier).Status.isActive = -1 End Sub Sub WINDOW_close (inIdentifier As _Unsigned _Integer64) temporary = inIdentifier End Sub Sub WINDOW_removeIcon (inIdentifier As _Unsigned _Integer64) If theWindow(inIdentifier).Icon.Handle Then _FreeImage (theWindow(inIdentifier).Icon.Handle) End If End Sub Sub WINDOW_iconInit (inFilename As String, inIdentifier As _Unsigned _Integer64) theWindow(inIdentifier).Icon.Handle = _LoadImage(inFilename, 32) End Sub Sub WIDGET_box (boxPositionX As _Unsigned Integer, boxPositionY As _Unsigned Integer, boxWidth As _Unsigned Integer, boxHeight As _Unsigned Integer, boxDepth As _Unsigned Integer) Line (boxPositionX, boxPositionY)-(boxPositionX + boxWidth, boxPositionY + boxHeight), thePalette.Grayscale.Lighter, BF Line (boxPositionX + boxDepth, boxPositionY + boxDepth)-(boxPositionX + boxWidth, boxPositionY + boxHeight), thePalette.Grayscale.Darker, BF Line (boxPositionX + boxDepth, boxPositionY + boxDepth)-((boxPositionX + boxWidth) - boxDepth, (boxPositionY + boxHeight) - boxDepth), thePalette.Grayscale.Neutral, BF End Sub Sub WIDGET_box2 (boxPositionX As _Unsigned Integer, boxPositionY As _Unsigned Integer, boxWidth As _Unsigned Integer, boxHeight As _Unsigned Integer, boxDepth As _Unsigned Integer, interiorDepth As _Unsigned Integer) interiorDepth = interiorDepth * boxDepth Line (boxPositionX, boxPositionY)-(boxPositionX + boxWidth, boxPositionY + boxHeight), thePalette.Grayscale.Darker, BF Line (boxPositionX + boxDepth, boxPositionY + boxDepth)-(boxPositionX + boxWidth, boxPositionY + boxHeight), thePalette.Grayscale.Lighter, BF Line (boxPositionX + boxDepth, boxPositionY + boxDepth)-((boxPositionX + boxWidth) - boxDepth, (boxPositionY + boxHeight) - boxDepth), thePalette.Grayscale.Neutral, BF Line (boxPositionX + boxDepth + interiorDepth, boxPositionY + boxDepth + interiorDepth)-(boxPositionX + boxWidth - boxDepth - interiorDepth, boxPositionY + boxHeight - boxDepth - interiorDepth), thePalette.Grayscale.Lighter, BF Line (boxPositionX + (boxDepth * 2) + interiorDepth, boxPositionY + (boxDepth * 2) + interiorDepth)-(boxPositionX + boxWidth - boxDepth - interiorDepth, boxPositionY + boxHeight - boxDepth - interiorDepth), thePalette.Grayscale.Darker, BF Line (boxPositionX + (boxDepth * 2) + interiorDepth, boxPositionY + (boxDepth * 2) + interiorDepth)-(boxPositionX + boxWidth - (boxDepth * 2) - interiorDepth, boxPositionY + boxHeight - (boxDepth * 2) - interiorDepth), thePalette.Grayscale.Neutral, BF End Sub Sub WIDGET_box3 (boxPositionX As _Unsigned Integer, boxPositionY As _Unsigned Integer, boxWidth As _Unsigned Integer, boxHeight As _Unsigned Integer, boxDepth As _Unsigned Integer, interiorDepthX As _Unsigned Integer, interiorDepthY As _Unsigned Integer) interiorDepthX = interiorDepthX * boxDepth interiorDepthY = interiorDepthY * boxDepth Line (boxPositionX, boxPositionY)-(boxPositionX + boxWidth, boxPositionY + boxHeight), thePalette.Grayscale.Darker, BF Line (boxPositionX + boxDepth, boxPositionY + boxDepth)-(boxPositionX + boxWidth, boxPositionY + boxHeight), thePalette.Grayscale.Lighter, BF Line (boxPositionX + boxDepth, boxPositionY + boxDepth)-((boxPositionX + boxWidth) - boxDepth, (boxPositionY + boxHeight) - boxDepth), thePalette.Grayscale.Neutral, BF Line (boxPositionX + boxDepth + interiorDepthX, boxPositionY + boxDepth + interiorDepthY)-(boxPositionX + boxWidth - boxDepth - interiorDepthX, boxPositionY + boxHeight - boxDepth - interiorDepthY), thePalette.Grayscale.Lighter, BF Line (boxPositionX + (boxDepth * 2) + interiorDepthX, boxPositionY + (boxDepth * 2) + interiorDepthY)-(boxPositionX + boxWidth - boxDepth - interiorDepthX, boxPositionY + boxHeight - boxDepth - interiorDepthY), thePalette.Grayscale.Darker, BF Line (boxPositionX + (boxDepth * 2) + interiorDepthX, boxPositionY + (boxDepth * 2) + interiorDepthY)-(boxPositionX + boxWidth - (boxDepth * 2) - interiorDepthX, boxPositionY + boxHeight - (boxDepth * 2) - interiorDepthY), thePalette.Grayscale.Neutral, BF End Sub Sub WIDGET_titlebar (titlebarPositionX As _Unsigned Integer, titlebarPositionY As _Unsigned Integer, titlebarWidth As _Unsigned Integer, titlebarHeight As _Unsigned Integer, titlebarColour As _Unsigned Long) Line (titlebarPositionX, titlebarPositionY)-(titlebarPositionX + titlebarWidth, titlebarPositionY + titlebarHeight), titlebarColour, BF End Sub Sub WIDGET_Button31 (buttonStartX As _Unsigned Integer, buttonStartY As _Unsigned Integer, buttonEndX As _Unsigned Integer, buttonEndY As _Unsigned Integer, buttonTypeSelector As _Unsigned _Byte, buttonPressed As _Byte) If buttonTypeSelector <= 4 Then If buttonPressed = 0 Then Line (buttonStartX, buttonStartY)-(buttonEndX, buttonEndY), theTheme.ShadowDark, B Line (buttonStartX, buttonStartY)-(buttonEndX - 1, buttonEndY - 1), theTheme.Highlight, B Line (buttonStartX + 1, buttonStartY + 1)-(buttonEndX - 1, buttonEndY - 1), theTheme.ShadowDark, B Line (buttonStartX + 1, buttonStartY + 1)-(buttonEndX - 2, buttonEndY - 2), theTheme.Highlight, B Line (buttonStartX + 2, buttonStartY + 2)-(buttonEndX - 2, buttonEndY - 2), theTheme.Face, BF ElseIf buttonPressed = -1 Then Line (buttonStartX, buttonStartY)-(buttonEndX, buttonEndY), highlightColor, B Line (buttonStartX, buttonStartY)-(buttonEndX - 1, buttonEndY - 1), shadowColor2, B Line (buttonStartX + 1, buttonStartY + 1)-(buttonEndX - 1, buttonEndY - 1), theTheme.Highlight, B Line (buttonStartX + 1, buttonStartY + 1)-(buttonEndX - 2, buttonEndY - 2), theTheme.ShadowDark, B Line (buttonStartX + 2, buttonStartY + 2)-(buttonEndX - 2, buttonEndY - 2), theTheme.Face, BF End If End If Select Case buttonTypeSelector Case 0 Case 1 Line (buttonStartX + 8, buttonStartY + 6)-(buttonStartX + 8, buttonStartY + 6), thePalette.Grayscale.Black Line (buttonStartX + 7, buttonStartY + 7)-(buttonStartX + 9, buttonStartY + 7), thePalette.Grayscale.Black Line (buttonStartX + 6, buttonStartY + 8)-(buttonStartX + 10, buttonStartY + 8), thePalette.Grayscale.Black Line (buttonStartX + 5, buttonStartY + 9)-(buttonStartX + 11, buttonStartY + 9), thePalette.Grayscale.Black Case 2 Line (buttonStartX + 8, buttonStartY + 4)-(buttonStartX + 8, buttonStartY + 4), thePalette.Grayscale.Black Line (buttonStartX + 7, buttonStartY + 5)-(buttonStartX + 9, buttonStartY + 5), thePalette.Grayscale.Black Line (buttonStartX + 6, buttonStartY + 6)-(buttonStartX + 10, buttonStartY + 6), thePalette.Grayscale.Black Line (buttonStartX + 5, buttonStartY + 7)-(buttonStartX + 11, buttonStartY + 7), thePalette.Grayscale.Black Line (buttonStartX + 5, buttonStartY + 10)-(buttonStartX + 11, buttonStartY + 10), thePalette.Grayscale.Black Line (buttonStartX + 6, buttonStartY + 11)-(buttonStartX + 10, buttonStartY + 11), thePalette.Grayscale.Black Line (buttonStartX + 7, buttonStartY + 12)-(buttonStartX + 9, buttonStartY + 12), thePalette.Grayscale.Black Line (buttonStartX + 8, buttonStartY + 13)-(buttonStartX + 8, buttonStartY + 13), thePalette.Grayscale.Black Case 3 Line (buttonStartX + 5, buttonStartY + 7)-(buttonStartX + 11, buttonStartY + 7), thePalette.Grayscale.Black Line (buttonStartX + 6, buttonStartY + 8)-(buttonStartX + 10, buttonStartY + 8), thePalette.Grayscale.Black Line (buttonStartX + 7, buttonStartY + 9)-(buttonStartX + 9, buttonStartY + 9), thePalette.Grayscale.Black Line (buttonStartX + 8, buttonStartY + 10)-(buttonStartX + 8, buttonStartY + 10), thePalette.Grayscale.Black Case 4 Line (buttonStartX + 4, buttonStartY + 12)-(buttonStartX + 12, buttonStartY + 12), thePalette.Grayscale.Black Line (buttonStartX + 12, buttonStartY + 4)-(buttonStartX + 12, buttonStartY + 12), thePalette.Grayscale.Black Line (buttonStartX + 4, buttonStartY + 10)-(buttonStartX + 10, buttonStartY + 10), thePalette.Grayscale.Black Line (buttonStartX + 10, buttonStartY + 4)-(buttonStartX + 10, buttonStartY + 10), thePalette.Grayscale.Black Case 5 Line (buttonStartX, buttonStartY)-(buttonEndX, buttonEndY), faceColor, BF Line (buttonStartX + 3, buttonStartY + 9)-(buttonStartX + 16, buttonStartY + 11), theTheme.Shadow, B Line (buttonStartX + 2, buttonStartY + 8)-(buttonStartX + 15, buttonStartY + 10), thePalette.Grayscale.Black, B Line (buttonStartX + 3, buttonStartY + 9)-(buttonStartX + 14, buttonStartY + 9), thePalette.Grayscale.White Case 6 Line (buttonStartX, buttonStartY)-(buttonEndX, buttonEndY), faceColor, BF Line (buttonStartX + 6, buttonStartY + 9)-(buttonStartX + 11, buttonStartY + 11), theTheme.Shadow, B Line (buttonStartX + 5, buttonStartY + 8)-(buttonStartX + 12, buttonStartY + 10), thePalette.Grayscale.Black, B Line (buttonStartX + 6, buttonStartY + 9)-(buttonStartX + 11, buttonStartY + 9), thePalette.Grayscale.White End Select End Sub Sub WIDGET_buttonMac (buttonStartX As _Unsigned Integer, buttonStartY As _Unsigned Integer, buttonTypeSelector As _Unsigned _Byte) Select Case buttonTypeSelector Case 1 Line (buttonStartX, buttonStartY)-(buttonStartX + 13, buttonStartY + 13), theTheme.macBackground, BF Line (buttonStartX + 6, buttonStartY + 1)-(buttonStartX + 12, buttonStartY + 7), theTheme.macForeground Line (buttonStartX + 12, buttonStartY + 7)-(buttonStartX + 9, buttonStartY + 7), theTheme.macForeground Line (buttonStartX + 9, buttonStartY + 7)-(buttonStartX + 9, buttonStartY + 11), theTheme.macForeground Line (buttonStartX + 9, buttonStartY + 11)-(buttonStartX + 3, buttonStartY + 11), theTheme.macForeground Line (buttonStartX + 3, buttonStartY + 11)-(buttonStartX + 3, buttonStartY + 7), theTheme.macForeground Line (buttonStartX + 3, buttonStartY + 7)-(buttonStartX, buttonStartY + 7), theTheme.macForeground Line (buttonStartX, buttonStartY + 7)-(buttonStartX + 6, buttonStartY + 1), theTheme.macForeground Case 2 Line (buttonStartX, buttonStartY)-(buttonStartX + 13, buttonStartY + 13), theTheme.macBackground, BF Line (buttonStartX + 3, buttonStartY + 2)-(buttonStartX + 9, buttonStartY + 2), theTheme.macForeground Line (buttonStartX + 9, buttonStartY + 2)-(buttonStartX + 9, buttonStartY + 6), theTheme.macForeground Line (buttonStartX + 9, buttonStartY + 6)-(buttonStartX + 12, buttonStartY + 6), theTheme.macForeground Line (buttonStartX + 12, buttonStartY + 6)-(buttonStartX + 6, buttonStartY + 12), theTheme.macForeground Line (buttonStartX + 6, buttonStartY + 12)-(buttonStartX, buttonStartY + 6), theTheme.macForeground Line (buttonStartX, buttonStartY + 6)-(buttonStartX + 3, buttonStartY + 6), theTheme.macForeground Line (buttonStartX + 3, buttonStartY + 6)-(buttonStartX + 3, buttonStartY + 2), theTheme.macForeground Case 3 Line (buttonStartX, buttonStartY)-(buttonStartX + 13, buttonStartY + 13), theTheme.macBackground, BF Line (buttonStartX + 7, buttonStartY)-(buttonStartX + 13, buttonStartY + 6), theTheme.macForeground Line (buttonStartX + 13, buttonStartY + 6)-(buttonStartX + 7, buttonStartY + 12), theTheme.macForeground Line (buttonStartX + 7, buttonStartY + 12)-(buttonStartX + 7, buttonStartY + 9), theTheme.macForeground Line (buttonStartX + 7, buttonStartY + 9)-(buttonStartX + 3, buttonStartY + 9), theTheme.macForeground Line (buttonStartX + 3, buttonStartY + 9)-(buttonStartX + 3, buttonStartY + 3), theTheme.macForeground Line (buttonStartX + 3, buttonStartY + 3)-(buttonStartX + 7, buttonStartY + 3), theTheme.macForeground Line (buttonStartX + 7, buttonStartY + 3)-(buttonStartX + 7, buttonStartY), theTheme.macForeground Case 4 Line (buttonStartX, buttonStartY)-(buttonStartX + 13, buttonStartY + 13), theTheme.macBackground, BF Line (buttonStartX + 6, buttonStartY)-(buttonStartX + 6, buttonStartY + 3), theTheme.macForeground Line (buttonStartX + 6, buttonStartY + 3)-(buttonStartX + 10, buttonStartY + 3), theTheme.macForeground Line (buttonStartX + 10, buttonStartY + 3)-(buttonStartX + 10, buttonStartY + 9), theTheme.macForeground Line (buttonStartX + 10, buttonStartY + 9)-(buttonStartX + 6, buttonStartY + 9), theTheme.macForeground Line (buttonStartX + 6, buttonStartY + 9)-(buttonStartX + 6, buttonStartY + 12), theTheme.macForeground Line (buttonStartX + 6, buttonStartY + 12)-(buttonStartX, buttonStartY + 6), theTheme.macForeground Line (buttonStartX, buttonStartY + 6)-(buttonStartX + 6, buttonStartY), theTheme.macForeground End Select End Sub Sub PATTERN_horizontalGradient (x0, y0, w, h, c1 As _Unsigned Long, c2 As _Unsigned Long) Dim mr As Double, mg As Double, mb As Double mr = (_Red(c2) - _Red(c1)) / w mg = (_Green(c2) - _Green(c1)) / w mb = (_Blue(c2) - _Blue(c1)) / w For x = 0 To w - 1 r = _Red(c2) + (x - w) * mr g = _Green(c2) + (x - w) * mg b = _Blue(c2) + (x - w) * mb Line (x + x0, y0)-Step(0, h), _RGBA32(r, g, b, 255), BF Next End Sub Sub PATTERN_verticalGradient (x0, y0, w, h, c1 As _Unsigned Long, c2 As _Unsigned Long) Dim mr As Double, mg As Double, mb As Double mr = (_Red(c2) - _Red(c1)) / h mg = (_Green(c2) - _Green(c1)) / h mb = (_Blue(c2) - _Blue(c1)) / h For y = 0 To h - 1 r = _Red(c2) + (y - h) * mr g = _Green(c2) + (y - h) * mg b = _Blue(c2) + (y - h) * mb Line (x0, y + y0)-Step(w, 0), _RGBA32(r, g, b, 255), BF Next End Sub Sub PATTERN_diagonalGradient (x0, y0, w, h, c1 As _Unsigned Long, c2 As _Unsigned Long) Dim mr As Double, mg As Double, mb As Double dw = w + h mr = (_Red(c2) - _Red(c1)) / dw mg = (_Green(c2) - _Green(c1)) / dw mb = (_Blue(c2) - _Blue(c1)) / dw For d = 0 To dw - 1 r = _Red(c2) + (d - dw) * mr g = _Green(c2) + (d - dw) * mg b = _Blue(c2) + (d - dw) * mb If d <= h - 1 Then Line (x0 + d, y0)-(x0, y0 + d), _RGBA32(r, g, b, 255) ElseIf d >= h And d <= w - 1 Then Line (x0 + d, y0)-(x0 + (d - h), y0 + h), _RGBA32(r, g, b, 255) ElseIf d >= w And d <= dw - 1 Then Line (x0 + w, y0 + (d - w))-(x0 + (d - h), y0 + h), _RGBA32(r, g, b, 255) End If Next d End Sub Sub PATTERN_checkerboxDither (x0, y0, w, h, inColor1 As _Unsigned Long, inColor2 As _Unsigned Long) Line (x0, y0)-(x0 + w, y0 + h), inColor2, BF For j = y0 To y0 + h If j Mod 2 = 1 Then For i = x0 To x0 + w If i Mod 2 = 1 Then PSet (i, j), inColor2 Else PSet (i, j), inColor1 End If Next i Else For i = x0 To x0 + w If i Mod 2 = 0 Then PSet (i, j), inColor2 Else PSet (i, j), inColor1 End If Next i End If Next j End Sub Sub PATTERN_verticalDither (x0, y0, w, h, inColor1 As _Unsigned Long, inColor2 As _Unsigned Long, inSpacing As _Unsigned Integer) Line (x0, y0)-(x0 + w, y0 + h), inColor2, BF For j = y0 To y0 + h For i = x0 To (x0 + w) - 1 Step inSpacing PSet (i, j), inColor1 Next i Next j End Sub Sub PATTERN_horizontalDither (x0, y0, w, h, inColor1 As _Unsigned Long, inColor2 As _Unsigned Long, inSpacing As _Unsigned Integer) Line (x0, y0)-(x0 + w, y0 + h), inColor2, BF For i = x0 To (x0 + w) - 1 For j = y0 To y0 + h Step inSpacing PSet (i, j), inColor1 Next j Next i End Sub Sub PATTERN_horizontalSpacedDither (x0, y0, w, h, inColor1 As _Unsigned Long, inColor2 As _Unsigned Long, inSpacing As _Unsigned Integer) cc = 1 Line (x0, y0)-(x0 + w, y0 + h), inColor2, BF For i = x0 To x0 + w Step inSpacing Select Case cc Case 1 For j = y0 To y0 + h If j Mod 2 <> 0 Then PSet (i, j), inColor1 End If Next j cc = cc + 1 Case 2 For j = y0 To y0 + h If j Mod 2 = 0 Then PSet (i, j), inColor1 End If Next j cc = 1 End Select Next i End Sub Sub PATTERN_verticalSpacedDither (x0, y0, w, h, inColor1 As _Unsigned Long, inColor2 As _Unsigned Long, inSpacing As _Unsigned Integer) cc = 1 Line (x0, y0)-(x0 + w, y0 + h), inColor2, BF For i = y0 To y0 + h Step inSpacing Select Case cc Case 1 For j = x0 To x0 + w If j Mod 2 <> 0 Then PSet (j, i), inColor1 End If Next j cc = cc + 1 Case 2 For j = x0 To x0 + w If j Mod 2 = 0 Then PSet (j, i), inColor1 End If Next j cc = 1 End Select Next i End Sub Sub PATTERN_squareDither (x0, y0, w, h, inColor1 As _Unsigned Long, inColor2 As _Unsigned Long, inSpacing As _Unsigned Integer) Line (x0, y0)-((x0 + w) - 1, (y0 + h) - 1), inColor2, BF For i = x0 To x0 + w Step inSpacing For j = y0 To y0 + h Step inSpacing PSet (i, j), inColor1 Next j Next i End Sub Sub PATTERN_squarePattern (x0, y0, w, h, inColor1 As _Unsigned Long, inColor2 As _Unsigned Long, inSpacing As _Unsigned Integer) Line (x0, y0)-((x0 + w) - 1, (y0 + h) - 1), inColor2, BF For i = x0 To x0 + w Step inSpacing Line (centerX + i, y0)-(centerX + i, (y0 + h) - 1), inColor1 Next i For i = y0 To y0 + h Step inSpacing Line (x0, centerY + i)-((x0 + w) - 1, centerY + i), inColor1 Next i End Sub Sub ZONE_add If theSize.Zones < theLimit.Maximum Then theSize.Zones = theSize.Zones + 1 ReDim _Preserve theZone(theSize.Zones) As aZone End If End Sub Sub ZONE_init (inPositionX As _Unsigned Integer, inPositionY As _Unsigned Integer, inSizeX As _Unsigned Integer, inSizeY As _Unsigned Integer, inPurpose As String * 3) ZONE_add theZone(theSize.Zones).parentIdentifier = theSize.Windows theZone(theSize.Zones).Identifier = theSize.Zones theZone(theSize.Zones).positionX = inPositionX theZone(theSize.Zones).positionY = inPositionY theZone(theSize.Zones).sizeX = inSizeX theZone(theSize.Zones).sizeY = inSizeY theZone(theSize.Zones).Purpose = inPurpose End Sub Sub ZONE_commonInit ZONE_init 4, 3, 20, 20, "CLOSE" ZONE_init 24, 3, _Width(theWindow(theSize.Windows).Canvas.Handle) - 69, 20, "MOVE" ZONE_init _Width(theWindow(theSize.Windows).Canvas.Handle) - 46, 3, 20, 20, "MINIMIZE" ZONE_init _Width(theWindow(theSize.Windows).Canvas.Handle) - 23, 3, 20, 20, "MAXIMIZE" ZONE_init _Width(theWindow(theSize.Windows).Canvas.Handle) - 23, _Height(theWindow(theSize.Windows).Canvas.Handle) - 23, 20, 20, "RESIZE" End Sub Sub ZONE_update (inParentIdentifier As _Unsigned _Integer64, inIdentifier As _Unsigned _Integer64, inPositionX As _Unsigned Integer, inPositionY As _Unsigned Integer, inSizeX As _Unsigned Integer, inSizeY As _Unsigned Integer, inPurpose As String * 3) theZone(inIdentifier).parentIdentifier = inParentIdentifier theZone(inIdentifier).Identifier = inIdentifier theZone(inIdentifier).positionX = inPositionX theZone(inIdentifier).positionY = inPositionY theZone(inIdentifier).sizeX = inSizeX theZone(inIdentifier).sizeY = inSizeY theZone(inIdentifier).Purpose = inPurpose End Sub Sub ZONE_commonUpdate (inIdentifier As _Unsigned _Integer64) ZONE_update inIdentifier, (((inIdentifier - 1) * 5) + 1), 4, 3, 20, 20, "CLOSE" ZONE_update inIdentifier, (((inIdentifier - 1) * 5) + 2), 24, 3, _Width(theWindow(inIdentifier).Canvas.Handle) - 69, 20, "MOVE" ZONE_update inIdentifier, (((inIdentifier - 1) * 5) + 3), _Width(theWindow(inIdentifier).Canvas.Handle) - 46, 3, 20, 20, "MINIMIZE" ZONE_update inIdentifier, (((inIdentifier - 1) * 5) + 4), _Width(theWindow(inIdentifier).Canvas.Handle) - 23, 3, 20, 20, "MAXIMIZE" ZONE_update inIdentifier, (((inIdentifier - 1) * 5) + 5), _Width(theWindow(inIdentifier).Canvas.Handle) - 23, _Height(theWindow(inIdentifier).Canvas.Handle) - 23, 20, 20, "RESIZE" End Sub Sub MOUSE_checkWindow theWindowMatched = 0 For theIterator.checkWindow = theSize.Windows To 1 Step -1 If theMouse.positionX >= theWindow(theIterator.checkWindow).Canvas.positionX And theMouse.positionX <= theWindow(theIterator.checkWindow).Canvas.positionX + theWindow(theIterator.checkWindow).Canvas.sizeX Then If theMouse.positionY >= theWindow(theIterator.checkWindow).Canvas.positionY And theMouse.positionY <= theWindow(theIterator.checkWindow).Canvas.positionY + theWindow(theIterator.checkWindow).Canvas.sizeY Then theWindowMatched = theIterator.checkWindow Exit For End If End If Next theIterator.checkWindow If theWindowMatched Then If theOption.Debug Then _Dest theDisplay.Handle _PrintString (10, 10), "Window: " + Str$(theWindowMatched) End If End If End Sub Sub MOUSE_checkZone (inIdentifier As _Unsigned _Integer64) theZoneMatched = 0: thePurpose = "" For theIterator.checkZone = 1 To theSize.Zones Step 1 If theZone(theIterator.checkZone).parentIdentifier = inIdentifier Then If theMouse.positionX >= theWindow(inIdentifier).Canvas.positionX + theZone(theIterator.checkZone).positionX And theMouse.positionX <= theWindow(inIdentifier).Canvas.positionX + (theZone(theIterator.checkZone).positionX + theZone(theIterator.checkZone).sizeX) Then If theMouse.positionY >= theWindow(inIdentifier).Canvas.positionY + theZone(theIterator.checkZone).positionY And theMouse.positionY <= theWindow(inIdentifier).Canvas.positionY + (theZone(theIterator.checkZone).positionY + theZone(theIterator.checkZone).sizeY) Then theZoneMatched = theIterator.checkZone thePurpose = theZone(theZoneMatched).Purpose thePurpose = LTrim$(RTrim$(UCase$(thePurpose))) Exit For End If End If End If Next theIterator.checkZone If theZoneMatched Then If theOption.Debug Then _Dest theDisplay.Handle _PrintString (125, 10), "Zone: " + Str$(theZoneMatched) _PrintString (225, 10), "Purpose: " + LTrim$(RTrim$(thePurpose)) End If End If 'thePurpose = "RAISE" End Sub Sub MOUSE_clickAction If theMouse.leftClicked Then Select Case thePurpose Case "CLOSE" WINDOW_close theWindowMatched Case "MINIMIZE" WINDOW_minimize theWindowMatched Case "RESTORE" WINDOW_restore theWindowMatched Case "MAXIMIZE" WINDOW_maximize theWindowMatched Case "MOVE" WINDOW_move theWindowMatched Case "RESIZE" WINDOW_resize theWindowMatched Case "RAISE" WINDOW_raise theWindowMatched End Select ElseIf theMouse.rightClicked Then ' Context menu End If End Sub Sub MOUSE_probe Do theMouse.positionX = _MouseX theMouse.positionY = _MouseY theMouse.leftClicked = _MouseButton(1) theMouse.rightClicked = _MouseButton(2) Loop While _MouseInput End Sub