diff --git a/InForm.ui b/InForm.ui index ca6662a..0974dfa 100644 --- a/InForm.ui +++ b/InForm.ui @@ -214,41 +214,41 @@ CONST __UI_Center = 1 CONST __UI_Right = 2 'Messagebox constants -CONST __UI_MsgBox_OkOnly = 0 -CONST __UI_MsgBox_OkCancel = 1 -CONST __UI_MsgBox_AbortRetryIgnore = 2 -CONST __UI_MsgBox_YesNoCancel = 3 -CONST __UI_MsgBox_YesNo = 4 -CONST __UI_MsgBox_RetryCancel = 5 -CONST __UI_MsgBox_CancelTryagainContinue = 6 +CONST MsgBox_OkOnly = 0 +CONST MsgBox_OkCancel = 1 +CONST MsgBox_AbortRetryIgnore = 2 +CONST MsgBox_YesNoCancel = 3 +CONST MsgBox_YesNo = 4 +CONST MsgBox_RetryCancel = 5 +CONST MsgBox_CancelTryagainContinue = 6 -CONST __UI_MsgBox_Critical = 16 -CONST __UI_MsgBox_Question = 32 -CONST __UI_MsgBox_Exclamation = 48 -CONST __UI_MsgBox_Information = 64 +CONST MsgBox_Critical = 16 +CONST MsgBox_Question = 32 +CONST MsgBox_Exclamation = 48 +CONST MsgBox_Information = 64 -CONST __UI_MsgBox_DefaultButton1 = 0 -CONST __UI_MsgBox_DefaultButton2 = 256 -CONST __UI_MsgBox_DefaultButton3 = 512 -CONST __UI_MsgBox_Defaultbutton4 = 768 +CONST MsgBox_DefaultButton1 = 0 +CONST MsgBox_DefaultButton2 = 256 +CONST MsgBox_DefaultButton3 = 512 +CONST MsgBox_Defaultbutton4 = 768 -CONST __UI_MsgBox_AppModal = 0 -CONST __UI_MsgBox_SystemModal = 4096 -CONST __UI_MsgBox_SetForeground = 65536 +CONST MsgBox_AppModal = 0 +CONST MsgBox_SystemModal = 4096 +CONST MsgBox_SetForeground = 65536 -CONST __UI_MsgBox_Ok = 1 -CONST __UI_MsgBox_Cancel = 2 -CONST __UI_MsgBox_Abort = 3 -CONST __UI_MsgBox_Retry = 4 -CONST __UI_MsgBox_Ignore = 5 -CONST __UI_MsgBox_Yes = 6 -CONST __UI_MsgBox_No = 7 -CONST __UI_MsgBox_Tryagain = 10 -CONST __UI_MsgBox_Continue = 11 +CONST MsgBox_Ok = 1 +CONST MsgBox_Cancel = 2 +CONST MsgBox_Abort = 3 +CONST MsgBox_Retry = 4 +CONST MsgBox_Ignore = 5 +CONST MsgBox_Yes = 6 +CONST MsgBox_No = 7 +CONST MsgBox_Tryagain = 10 +CONST MsgBox_Continue = 11 'Global constants -CONST __UI_True = -1 -CONST __UI_False = 0 +CONST True = -1 +CONST False = 0 ON ERROR GOTO __UI_ErrorHandler @@ -281,49 +281,49 @@ SUB __UI_InternalMenus 'Internal "design mode" context menu. ------------------------------------------- DIM __UI_NewID AS LONG __UI_NewID = __UI_NewControl(__UI_Type_ContextMenu, "__UI_PreviewMenu", 0, 0, 0, 0, 0) - Control(__UI_NewID).Font = __UI_Font("segoeui.ttf",12,"") + Control(__UI_NewID).Font = SetFont("segoeui.ttf",12,"") __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuAlignLeft", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) - __UI_SetCaption "__UI_PreviewMenuAlignLeft", "Align &Left" + SetCaption "__UI_PreviewMenuAlignLeft", "Align &Left" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuAlignRight", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) - __UI_SetCaption "__UI_PreviewMenuAlignRight", "Align &Right" + SetCaption "__UI_PreviewMenuAlignRight", "Align &Right" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuAlignTops", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) - __UI_SetCaption "__UI_PreviewMenuAlignTops", "Align T&op" + SetCaption "__UI_PreviewMenuAlignTops", "Align T&op" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuAlignBottoms", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) - __UI_SetCaption "__UI_PreviewMenuAlignBottoms", "Align &Bottom-" + SetCaption "__UI_PreviewMenuAlignBottoms", "Align &Bottom-" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuAlignCentersV", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) - __UI_SetCaption "__UI_PreviewMenuAlignCentersV", "Align cent&ers Vertically" + SetCaption "__UI_PreviewMenuAlignCentersV", "Align cent&ers Vertically" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuAlignCentersH", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) - __UI_SetCaption "__UI_PreviewMenuAlignCentersH", "Ali&gn centers Horizontally" + SetCaption "__UI_PreviewMenuAlignCentersH", "Ali&gn centers Horizontally" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuAlignCenterV", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) - __UI_SetCaption "__UI_PreviewMenuAlignCenterV", "Center &Vertically" + SetCaption "__UI_PreviewMenuAlignCenterV", "Center &Vertically" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuAlignCenterH", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) - __UI_SetCaption "__UI_PreviewMenuAlignCenterH", "Center &Horizontally-" + SetCaption "__UI_PreviewMenuAlignCenterH", "Center &Horizontally-" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuDistributeV", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) - __UI_SetCaption "__UI_PreviewMenuDistributeV", "Distribute Ver&tically" + SetCaption "__UI_PreviewMenuDistributeV", "Distribute Ver&tically" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuDistributeH", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) - __UI_SetCaption "__UI_PreviewMenuDistributeH", "Distribute Hori&zontally-" + SetCaption "__UI_PreviewMenuDistributeH", "Distribute Hori&zontally-" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuCopy", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) - __UI_SetCaption "__UI_PreviewMenuCopy", "&Copy" + SetCaption "__UI_PreviewMenuCopy", "&Copy" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuPaste", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) - __UI_SetCaption "__UI_PreviewMenuPaste", "&Paste" + SetCaption "__UI_PreviewMenuPaste", "&Paste" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuDelete", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) - __UI_SetCaption "__UI_PreviewMenuDelete", "&Delete-" + SetCaption "__UI_PreviewMenuDelete", "&Delete-" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuSelect", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) - __UI_SetCaption "__UI_PreviewMenuSelect", "Select &All" + SetCaption "__UI_PreviewMenuSelect", "Select &All" END SUB '--------------------------------------------------------------------------------- @@ -342,7 +342,7 @@ SUB __UI_Init _ICON IF Control(__UI_FormID).CenteredWindow THEN _SCREENMOVE _MIDDLE - IF Control(__UI_FormID).Font = 0 THEN Control(__UI_FormID).Font = __UI_Font("", 8, "") + IF Control(__UI_FormID).Font = 0 THEN Control(__UI_FormID).Font = SetFont("", 8, "") IF Caption(__UI_FormID) = "" THEN Caption(__UI_FormID) = RTRIM$(Control(__UI_FormID).Name) @@ -358,19 +358,19 @@ SUB __UI_Init NEXT __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_TextMenuCut", 0, 0, 0, 0, __UI_GetID("__UI_TextFieldMenu")) - __UI_SetCaption "__UI_TextMenuCut", "Cu&t" + SetCaption "__UI_TextMenuCut", "Cu&t" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_TextMenuCopy", 0, 0, 0, 0, __UI_GetID("__UI_TextFieldMenu")) - __UI_SetCaption "__UI_TextMenuCopy", "&Copy" + SetCaption "__UI_TextMenuCopy", "&Copy" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_TextMenuPaste", 0, 0, 0, 0, __UI_GetID("__UI_TextFieldMenu")) - __UI_SetCaption "__UI_TextMenuPaste", "&Paste" + SetCaption "__UI_TextMenuPaste", "&Paste" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_TextMenuDelete", 0, 0, 0, 0, __UI_GetID("__UI_TextFieldMenu")) - __UI_SetCaption "__UI_TextMenuDelete", "&Delete-" + SetCaption "__UI_TextMenuDelete", "&Delete-" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_TextMenuSelect", 0, 0, 0, 0, __UI_GetID("__UI_TextFieldMenu")) - __UI_SetCaption "__UI_TextMenuSelect", "Select &all" + SetCaption "__UI_TextMenuSelect", "Select &all" END IF _DISPLAYORDER _SOFTWARE, _HARDWARE @@ -386,8 +386,8 @@ SUB __UI_Init TIMER(__UI_EventsTimer) ON TIMER(__UI_RefreshTimer) ON - __UI_AutoRefresh = __UI_True - __UI_Loaded = __UI_True + __UI_AutoRefresh = True + __UI_Loaded = True END SUB '--------------------------------------------------------------------------------- @@ -398,10 +398,10 @@ SUB __UI_ProcessInput DIM ContainerOffsetTop AS INTEGER, ContainerOffsetLeft AS INTEGER STATIC __UI_CurrentResizeStatus AS _BYTE, __UI_CurrentBackColor AS _UNSIGNED LONG - __UI_HasInput = __UI_False + __UI_HasInput = False __UI_ExitTriggered = _EXIT - IF __UI_ExitTriggered AND 1 THEN __UI_ExitTriggered = __UI_True: __UI_HasInput = __UI_True + IF __UI_ExitTriggered AND 1 THEN __UI_ExitTriggered = True: __UI_HasInput = True IF _SCREENX = -32000 AND _SCREENY = -32000 THEN 'Window was minimized @@ -410,9 +410,9 @@ SUB __UI_ProcessInput 'Mouse input (optimization kindly provided by Luke Ceddia): __UI_MouseWheel = 0 - IF __UI_MouseIsDown THEN __UI_HasInput = __UI_True + IF __UI_MouseIsDown THEN __UI_HasInput = True IF _MOUSEINPUT THEN - __UI_HasInput = __UI_True + __UI_HasInput = True __UI_MouseWheel = __UI_MouseWheel + _MOUSEWHEEL IF _MOUSEBUTTON(1) = __UI_MouseButton1 AND _MOUSEBUTTON(2) = __UI_MouseButton2 THEN DO WHILE _MOUSEINPUT @@ -433,7 +433,7 @@ SUB __UI_ProcessInput DIM TempHover AS LONG __UI_BelowHoveringID = 0 FOR i = 1 TO UBOUND(Control) - IF Control(i).ID AND Control(i).Type <> __UI_Type_MenuItem AND ((Control(i).Hidden = __UI_False AND __UI_DesignMode = __UI_False) OR (__UI_DesignMode = __UI_True)) THEN + IF Control(i).ID AND Control(i).Type <> __UI_Type_MenuItem AND ((Control(i).Hidden = False AND __UI_DesignMode = False) OR (__UI_DesignMode = True)) THEN Control(i).HoveringVScrollbarButton = 0 IF Control(i).ParentID > 0 THEN ContainerOffsetTop = Control(Control(i).ParentID).Top @@ -444,13 +444,13 @@ SUB __UI_ProcessInput IF __UI_MouseLeft >= ContainerOffsetLeft + Control(i).Left AND __UI_MouseLeft <= ContainerOffsetLeft + Control(i).Left + Control(i).Width - 1 AND __UI_MouseTop >= ContainerOffsetTop + Control(i).Top AND __UI_MouseTop <= ContainerOffsetTop + Control(i).Top + Control(i).Height - 1 THEN __UI_BelowHoveringID = TempHover TempHover = Control(i).ID - IF Control(i).HasVScrollbar AND __UI_IsDragging = __UI_False THEN + IF Control(i).HasVScrollbar AND __UI_IsDragging = False THEN IF __UI_MouseLeft >= ContainerOffsetLeft + Control(i).Left + Control(i).Width - __UI_ScrollbarWidth THEN - IF __UI_MouseTop <= Control(i).Top + ContainerOffsetTop + __UI_ScrollbarButtonHeight AND __UI_DraggingThumb = __UI_False THEN + IF __UI_MouseTop <= Control(i).Top + ContainerOffsetTop + __UI_ScrollbarButtonHeight AND __UI_DraggingThumb = False THEN 'Hovering "up" button Control(i).HoveringVScrollbarButton = 1 Control(i).PreviousInputViewStart = 0 - ELSEIF __UI_MouseTop >= Control(i).Top + ContainerOffsetTop + Control(i).Height - __UI_ScrollbarButtonHeight AND __UI_DraggingThumb = __UI_False THEN + ELSEIF __UI_MouseTop >= Control(i).Top + ContainerOffsetTop + Control(i).Height - __UI_ScrollbarButtonHeight AND __UI_DraggingThumb = False THEN 'Hovering "down" button Control(i).HoveringVScrollbarButton = 2 Control(i).PreviousInputViewStart = 0 @@ -481,13 +481,13 @@ SUB __UI_ProcessInput __UI_BelowHoveringID = TempHover TempHover = Control(i).ID - IF Control(i).HasVScrollbar AND __UI_IsDragging = __UI_False THEN + IF Control(i).HasVScrollbar AND __UI_IsDragging = False THEN IF __UI_MouseLeft >= ContainerOffsetLeft + Control(i).Left + Control(i).Width - __UI_ScrollbarWidth THEN - IF __UI_MouseTop <= Control(i).Top + ContainerOffsetTop + __UI_ScrollbarButtonHeight AND __UI_DraggingThumb = __UI_False THEN + IF __UI_MouseTop <= Control(i).Top + ContainerOffsetTop + __UI_ScrollbarButtonHeight AND __UI_DraggingThumb = False THEN 'Hovering "up" button Control(i).HoveringVScrollbarButton = 1 Control(i).PreviousInputViewStart = 0 - ELSEIF __UI_MouseTop >= Control(i).Top + ContainerOffsetTop + Control(i).Height - __UI_ScrollbarButtonHeight AND __UI_DraggingThumb = __UI_False THEN + ELSEIF __UI_MouseTop >= Control(i).Top + ContainerOffsetTop + Control(i).Height - __UI_ScrollbarButtonHeight AND __UI_DraggingThumb = False THEN 'Hovering "down" button Control(i).HoveringVScrollbarButton = 2 Control(i).PreviousInputViewStart = 0 @@ -519,7 +519,7 @@ SUB __UI_ProcessInput 'For an active menu, we'll detect individual menu items being hovered _FONT Control(TempHover).Font FOR i = 1 TO UBOUND(Control) - IF Control(i).ParentID = __UI_ParentMenu AND Control(i).Hidden = __UI_False THEN + IF Control(i).ParentID = __UI_ParentMenu AND Control(i).Hidden = False THEN IF __UI_MouseTop >= Control(__UI_ActiveMenu).Top + Control(i).Top AND __UI_MouseTop <= Control(__UI_ActiveMenu).Top + Control(i).Top + Control(i).Height - 1 THEN TempHover = Control(i).ID __UI_Focus = Control(i).ID @@ -540,7 +540,7 @@ SUB __UI_ProcessInput END IF 'Design mode specific hover: - IF __UI_DesignMode AND __UI_IsResizing = __UI_False AND __UI_IsDragging = __UI_False THEN + IF __UI_DesignMode AND __UI_IsResizing = False AND __UI_IsDragging = False THEN __UI_ResizeHandleHover = 0 IF Control(__UI_HoveringID).ControlIsSelected AND Control(__UI_HoveringID).Type <> __UI_Type_MenuBar AND Control(__UI_HoveringID).Type <> __UI_Type_MenuItem THEN IF __UI_MouseLeft >= Control(__UI_HoveringID).Left + Control(Control(__UI_HoveringID).ParentID).Left + Control(__UI_HoveringID).Width - 8 AND __UI_MouseTop >= Control(__UI_HoveringID).Top + Control(Control(__UI_HoveringID).ParentID).Top + Control(__UI_HoveringID).Height / 2 - 4 AND __UI_MouseTop <= Control(__UI_HoveringID).Top + Control(Control(__UI_HoveringID).ParentID).Top + Control(__UI_HoveringID).Height / 2 + 4 THEN @@ -567,10 +567,10 @@ SUB __UI_ProcessInput IF __UI_ActiveMenu = 0 THEN __UI_Focus = __UI_HoveringID END IF - ELSEIF Control(__UI_Focus).Type = __UI_Type_MenuPanel AND Control(__UI_HoveringID).Type = __UI_Type_MenuBar AND __UI_ActiveMenuIsContextMenu = __UI_False AND __UI_DesignMode = __UI_False THEN + ELSEIF Control(__UI_Focus).Type = __UI_Type_MenuPanel AND Control(__UI_HoveringID).Type = __UI_Type_MenuBar AND __UI_ActiveMenuIsContextMenu = False AND __UI_DesignMode = False THEN IF __UI_ParentMenu <> __UI_HoveringID AND NOT Control(__UI_HoveringID).Disabled THEN - __UI_ActivateMenu Control(__UI_HoveringID), __UI_False - __UI_ForceRedraw = __UI_True + __UI_ActivateMenu Control(__UI_HoveringID), False + __UI_ForceRedraw = True ELSEIF Control(__UI_HoveringID).Disabled THEN __UI_DestroyControl Control(__UI_ActiveMenu) __UI_Focus = __UI_HoveringID @@ -613,7 +613,7 @@ SUB __UI_ProcessInput 'Keyboard input: __UI_KeyHit = _KEYHIT - IF __UI_KeyHit THEN __UI_HasInput = __UI_True + IF __UI_KeyHit THEN __UI_HasInput = True 'Adjust the Resize Status of this form based on its CanResize property: IF Control(__UI_FormID).CanResize <> __UI_CurrentResizeStatus THEN @@ -630,7 +630,7 @@ SUB __UI_ProcessInput DIM CheckResize AS _BYTE CheckResize = _RESIZE IF (CheckResize AND Control(__UI_FormID).CanResize) OR __UI_CurrentBackColor <> Control(__UI_FormID).BackColor OR Control(__UI_FormID).Width <> _WIDTH(0) OR Control(__UI_FormID).Height <> _HEIGHT(0) THEN - __UI_AutoRefresh = __UI_False + __UI_AutoRefresh = False _DELAY .1 IF CheckResize THEN Control(__UI_FormID).Width = _RESIZEWIDTH @@ -646,25 +646,25 @@ SUB __UI_ProcessInput _DEST Control(__UI_FormID).Canvas COLOR Control(__UI_FormID).ForeColor, Control(__UI_FormID).BackColor CLS - IF __UI_HasMenuBar = __UI_True THEN + IF __UI_HasMenuBar = True THEN 'Add menubar div to main form's canvas _FONT Control(__UI_FormID).Font - LINE (0, uspacing& + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), __UI_Darken(Control(__UI_FormID).BackColor, 80) - LINE (0, uspacing& + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), __UI_Darken(Control(__UI_FormID).BackColor, 120) + LINE (0, uspacing& + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 80) + LINE (0, uspacing& + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120) __UI_RefreshMenuBar END IF _DEST 0 IF LEN(__UI_CurrentTitle) THEN _TITLE __UI_CurrentTitle - __UI_AutoRefresh = __UI_True - __UI_HasInput = __UI_True + __UI_AutoRefresh = True + __UI_HasInput = True END IF 'Update main window title if needed IF __UI_CurrentTitle <> Caption(__UI_FormID) THEN __UI_CurrentTitle = Caption(__UI_FormID) _TITLE __UI_CurrentTitle - __UI_HasInput = __UI_True + __UI_HasInput = True END IF __UI_LastInputReceived = TIMER @@ -678,7 +678,7 @@ SUB __UI_UpdateDisplay DIM ContainerOffsetLeft AS INTEGER, ContainerOffsetTop AS INTEGER DIM ControlState AS _BYTE '1 = Normal; 2 = Hover/focus; 3 = Mouse down; 4 = Disabled; - IF __UI_AutoRefresh = __UI_False THEN EXIT SUB + IF __UI_AutoRefresh = False THEN EXIT SUB __UI_BeforeUpdateDisplay @@ -724,7 +724,7 @@ SUB __UI_UpdateDisplay ELSE IF NOT GridDrawn THEN 'Draw grid onto main window's canvas - GridDrawn = __UI_True + GridDrawn = True 'Free the hardware bg image: _FREEIMAGE Control(__UI_FormID).Canvas 'Create a new software one: @@ -747,7 +747,7 @@ SUB __UI_UpdateDisplay IF (GridDrawn AND NOT __UI_IsDragging) OR (GridDrawn AND Control(__UI_DraggingID).ParentID > 0) OR __UI_ForceRedraw THEN 'Restore main window hardware bg - GridDrawn = __UI_False + GridDrawn = False 'Free the hardware bg image: _FREEIMAGE Control(__UI_FormID).Canvas 'Create a new software one: @@ -758,8 +758,8 @@ SUB __UI_UpdateDisplay CLS IF __UI_HasMenuBar THEN _FONT Control(__UI_FormID).Font - LINE (0, uspacing& + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), __UI_Darken(Control(__UI_FormID).BackColor, 80) - LINE (0, uspacing& + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), __UI_Darken(Control(__UI_FormID).BackColor, 120) + LINE (0, uspacing& + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 80) + LINE (0, uspacing& + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120) END IF _DEST 0 END IF @@ -857,9 +857,9 @@ SUB __UI_UpdateDisplay END IF IF Control(i).ControlIsSelected THEN - IF OverlayReset = __UI_False THEN + IF OverlayReset = False THEN 'Reset the helper canvas of the main form - OverlayReset = __UI_True + OverlayReset = True IF Control(__UI_FormID).HelperCanvas <> 0 THEN _FREEIMAGE Control(__UI_FormID).HelperCanvas Control(__UI_FormID).HelperCanvas = _NEWIMAGE(Control(__UI_FormID).Width, Control(__UI_FormID).Height, 32) _DEST Control(__UI_FormID).HelperCanvas @@ -867,7 +867,7 @@ SUB __UI_UpdateDisplay ELSE _DEST Control(__UI_FormID).HelperCanvas END IF - OverlayisVisible = __UI_True + OverlayisVisible = True IF Control(i).Type = __UI_Type_MenuItem THEN TempParentID = Control(i).ParentID @@ -920,10 +920,10 @@ SUB __UI_UpdateDisplay DIM CheckChildControls AS LONG, NoMoreChildren AS _BYTE, ThisParent AS LONG ThisParent = Control(i).ParentID - NoMoreChildren = __UI_True + NoMoreChildren = True FOR CheckChildControls = i + 1 TO UBOUND(Control) IF Control(CheckChildControls).ParentID = ThisParent THEN - NoMoreChildren = __UI_False + NoMoreChildren = False EXIT FOR END IF NEXT @@ -943,9 +943,9 @@ SUB __UI_UpdateDisplay NEXT IF __UI_DesignMode AND __UI_SelectionRectangle THEN - IF OverlayReset = __UI_False THEN + IF OverlayReset = False THEN 'Reset the helper canvas of the main form - OverlayReset = __UI_True + OverlayReset = True IF Control(__UI_FormID).HelperCanvas <> 0 THEN _FREEIMAGE Control(__UI_FormID).HelperCanvas Control(__UI_FormID).HelperCanvas = _NEWIMAGE(Control(__UI_FormID).Width, Control(__UI_FormID).Height, 32) _DEST Control(__UI_FormID).HelperCanvas @@ -953,7 +953,7 @@ SUB __UI_UpdateDisplay ELSE _DEST Control(__UI_FormID).HelperCanvas END IF - OverlayisVisible = __UI_True + OverlayisVisible = True 'LINE(__UI_SelectionRectangleLeft, __UI_SelectionRectangleTop)-(__UI_MouseLeft,__UI_MouseTop), _RGBA32(39, 144, 244, 100), BF 'LINE(__UI_SelectionRectangleLeft, __UI_SelectionRectangleTop)-(__UI_MouseLeft,__UI_MouseTop), _RGB32(39, 188, 244), B @@ -1054,7 +1054,7 @@ SUB __UI_UpdateDisplay _PUTIMAGE (_WIDTH \ 2 - TipPanelWidth \ 2, 0), DragTip END IF - __UI_ForceRedraw = __UI_False + __UI_ForceRedraw = False STATIC WaitMessageSetup AS _BYTE, PrevWaitMessage AS STRING DIM NoInputMessage$ @@ -1067,9 +1067,9 @@ SUB __UI_UpdateDisplay __UI_WaitMessageHandle = _NEWIMAGE(_WIDTH(0), _HEIGHT(0), 32) END IF - IF WaitMessageSetup = __UI_False OR PrevWaitMessage <> __UI_WaitMessage THEN + IF WaitMessageSetup = False OR PrevWaitMessage <> __UI_WaitMessage THEN PrevWaitMessage = __UI_WaitMessage - WaitMessageSetup = __UI_True + WaitMessageSetup = True PrevDest = _DEST _DEST __UI_WaitMessageHandle LINE (0, 0)-STEP(_WIDTH, _HEIGHT), _RGBA32(0, 0, 0, 170), BF @@ -1081,7 +1081,7 @@ SUB __UI_UpdateDisplay COLOR _RGB32(255, 255, 255) __UI_PrintString _WIDTH / 2 - __UI_PrintWidth(NoInputMessage$) / 2, _HEIGHT \ 2 - _FONTWIDTH, NoInputMessage$ IF LEN(__UI_WaitMessage) > 0 THEN - __UI_WaitMessage = "(" + __UI_WaitMessage + ")" + IF LEFT$(__UI_WaitMessage, 1) <> "(" THEN __UI_WaitMessage = "(" + __UI_WaitMessage + ")" COLOR _RGB32(0, 0, 0) __UI_PrintString _WIDTH / 2 - __UI_PrintWidth(NoInputMessage$) / 2 + 1, _HEIGHT \ 2 + 4, __UI_WaitMessage COLOR _RGB32(255, 255, 255) @@ -1098,8 +1098,8 @@ SUB __UI_UpdateDisplay END SUB '--------------------------------------------------------------------------------- -FUNCTION __UI_Darken~& (WhichColor~&, ByHowMuch%) - __UI_Darken~& = _RGB32(_RED32(WhichColor~&) * (ByHowMuch% / 100), _GREEN32(WhichColor~&) * (ByHowMuch% / 100), _BLUE32(WhichColor~&) * (ByHowMuch% / 100)) +FUNCTION Darken~& (WhichColor~&, ByHowMuch%) + Darken~& = _RGB32(_RED32(WhichColor~&) * (ByHowMuch% / 100), _GREEN32(WhichColor~&) * (ByHowMuch% / 100), _BLUE32(WhichColor~&) * (ByHowMuch% / 100)) END FUNCTION SUB __UI_EventDispatcher @@ -1138,13 +1138,13 @@ SUB __UI_EventDispatcher $IF WIN THEN 'Alt+F4 - Windows IF ((_KEYDOWN(100308) OR _KEYDOWN(100307)) AND __UI_KeyHit = -15872) OR __UI_ExitTriggered THEN - __UI_UnloadSignal = __UI_True + __UI_UnloadSignal = True __UI_BeforeUnload IF __UI_UnloadSignal THEN SYSTEM END IF $ELSE IF __UI_ExitTriggered THEN - __UI_UnloadSignal = __UI_True + __UI_UnloadSignal = True __UI_BeforeUnload IF __UI_UnloadSignal THEN SYSTEM END IF @@ -1168,9 +1168,9 @@ SUB __UI_EventDispatcher ELSEIF Control(__UI_HoveringID).Type = __UI_Type_MenuBar AND LastMouseLeft <> __UI_MouseLeft THEN LastMouseLeft = __UI_MouseLeft IF __UI_ActiveMenu > 0 AND __UI_ParentMenu <> Control(__UI_HoveringID).ID AND __UI_ParentMenu > 0 THEN - IF __UI_ActiveMenuIsContextMenu = __UI_False AND __UI_DesignMode = __UI_False THEN - __UI_ActivateMenu Control(__UI_HoveringID), __UI_False - __UI_ForceRedraw = __UI_True + IF __UI_ActiveMenuIsContextMenu = False AND __UI_DesignMode = False THEN + __UI_ActivateMenu Control(__UI_HoveringID), False + __UI_ForceRedraw = True END IF END IF END IF @@ -1228,13 +1228,13 @@ SUB __UI_EventDispatcher 'FocusIn, FocusOut DIM __UI_FocusSearch AS LONG - IF __UI_KeyHit = 9 AND __UI_IsDragging = __UI_False THEN 'TAB + IF __UI_KeyHit = 9 AND __UI_IsDragging = False THEN 'TAB IF __UI_DesignMode THEN __UI_FocusSearch = __UI_FirstSelectedID FOR i = 1 TO UBOUND(Control) - Control(i).ControlIsSelected = __UI_False + Control(i).ControlIsSelected = False NEXT DO @@ -1245,7 +1245,7 @@ SUB __UI_EventDispatcher END IF IF __UI_FocusSearch = __UI_FirstSelectedID THEN 'Full circle. No controls can be selected at the moment - Control(__UI_FocusSearch).ControlIsSelected = __UI_True + Control(__UI_FocusSearch).ControlIsSelected = True EXIT DO END IF @@ -1253,20 +1253,20 @@ SUB __UI_EventDispatcher IF Control(__UI_FocusSearch).Type <> __UI_Type_MenuItem THEN __UI_TotalSelectedControls = 1 __UI_FirstSelectedID = __UI_FocusSearch - Control(__UI_FocusSearch).ControlIsSelected = __UI_True + Control(__UI_FocusSearch).ControlIsSelected = True EXIT DO ELSE IF __UI_ParentMenu = Control(__UI_FocusSearch).ParentID THEN __UI_TotalSelectedControls = 1 __UI_FirstSelectedID = __UI_FocusSearch - Control(__UI_FocusSearch).ControlIsSelected = __UI_True + Control(__UI_FocusSearch).ControlIsSelected = True EXIT DO END IF END IF END IF LOOP ELSE - __UI_KeyboardFocus = __UI_True + __UI_KeyboardFocus = True __UI_FocusSearch = __UI_Focus DO IF _KEYDOWN(100304) OR _KEYDOWN(100303) THEN @@ -1290,7 +1290,7 @@ SUB __UI_EventDispatcher END IF 'Any visible dropdown lists/menus will be destroyed when focus is lost - IF __UI_DesignMode = __UI_False THEN + IF __UI_DesignMode = False THEN IF __UI_ActiveDropdownList > 0 AND ((__UI_Focus <> __UI_ActiveDropdownList AND __UI_Focus <> __UI_ParentDropdownList) OR __UI_KeyHit = 27) THEN __UI_Focus = __UI_ParentDropdownList __UI_DestroyControl Control(__UI_ActiveDropdownList) @@ -1298,7 +1298,7 @@ SUB __UI_EventDispatcher ELSEIF __UI_ActiveMenu > 0 AND (__UI_Focus <> __UI_ActiveMenu AND __UI_Focus <> __UI_ParentMenu) THEN IF Control(__UI_Focus).Type <> __UI_Type_MenuItem THEN __UI_DestroyControl Control(__UI_ActiveMenu) - __UI_ForceRedraw = __UI_True + __UI_ForceRedraw = True END IF END IF END IF @@ -1337,8 +1337,8 @@ SUB __UI_EventDispatcher 'MouseDown, MouseUp, BeginDrag IF __UI_MouseButton2 THEN 'Second mouse button is first pressed - IF __UI_Mouse2IsDown = __UI_False THEN - __UI_Mouse2IsDown = __UI_True + IF __UI_Mouse2IsDown = False THEN + __UI_Mouse2IsDown = True __UI_Mouse2DownOnID = __UI_HoveringID ELSE 'Second mouse button is still pressed @@ -1346,137 +1346,138 @@ SUB __UI_EventDispatcher ELSE 'Second mousebutton is released IF __UI_Mouse2IsDown THEN - __UI_Mouse2IsDown = __UI_False + __UI_Mouse2IsDown = False __UI_Mouse2DownOnID = 0 'Click (second mouse button) IF __UI_DesignMode THEN DIM RightClickSelect AS _BYTE - RightClickSelect = __UI_True + RightClickSelect = True GOSUB DesignModeClickToSelect + RightClickSelect = False IF __UI_TotalSelectedControls = 0 THEN - Control(__UI_GetID("__UI_PreviewMenuAlignLeft")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuAlignRight")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuAlignTops")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuAlignBottoms")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuAlignCenterV")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuAlignCenterH")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuAlignCentersV")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuAlignCentersH")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuDistributeV")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuDistributeH")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuCopy")).Disabled = __UI_True - Control(__UI_GetID("__UI_PreviewMenuDelete")).Disabled = __UI_True + Control(__UI_GetID("__UI_PreviewMenuAlignLeft")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuAlignRight")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuAlignTops")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuAlignBottoms")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuAlignCenterV")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuAlignCenterH")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuAlignCentersV")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuAlignCentersH")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuDistributeV")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuDistributeH")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuCopy")).Disabled = True + Control(__UI_GetID("__UI_PreviewMenuDelete")).Disabled = True ELSEIF __UI_TotalSelectedControls = 1 THEN - Control(__UI_GetID("__UI_PreviewMenuAlignLeft")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuAlignRight")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuAlignTops")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuAlignBottoms")).Hidden = __UI_True + Control(__UI_GetID("__UI_PreviewMenuAlignLeft")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuAlignRight")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuAlignTops")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuAlignBottoms")).Hidden = True IF Control(__UI_FirstSelectedID).Type <> __UI_Type_MenuBar AND Control(__UI_FirstSelectedID).Type <> __UI_Type_MenuItem THEN - Control(__UI_GetID("__UI_PreviewMenuAlignCenterV")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignCenterH")).Hidden = __UI_False + Control(__UI_GetID("__UI_PreviewMenuAlignCenterV")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignCenterH")).Hidden = False ELSE - Control(__UI_GetID("__UI_PreviewMenuAlignCenterV")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuAlignCenterH")).Hidden = __UI_True + Control(__UI_GetID("__UI_PreviewMenuAlignCenterV")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuAlignCenterH")).Hidden = True END IF - Control(__UI_GetID("__UI_PreviewMenuAlignCentersV")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuAlignCentersH")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuDistributeV")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuDistributeH")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuCopy")).Disabled = __UI_False - Control(__UI_GetID("__UI_PreviewMenuDelete")).Disabled = __UI_False + Control(__UI_GetID("__UI_PreviewMenuAlignCentersV")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuAlignCentersH")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuDistributeV")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuDistributeH")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuCopy")).Disabled = False + Control(__UI_GetID("__UI_PreviewMenuDelete")).Disabled = False ELSEIF __UI_TotalSelectedControls = 2 THEN - Control(__UI_GetID("__UI_PreviewMenuAlignLeft")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignRight")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignTops")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignBottoms")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignCenterV")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignCenterH")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignCentersV")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignCentersH")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuDistributeV")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuDistributeH")).Hidden = __UI_True - Control(__UI_GetID("__UI_PreviewMenuCopy")).Disabled = __UI_False - Control(__UI_GetID("__UI_PreviewMenuDelete")).Disabled = __UI_False + Control(__UI_GetID("__UI_PreviewMenuAlignLeft")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignRight")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignTops")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignBottoms")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignCenterV")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignCenterH")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignCentersV")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignCentersH")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuDistributeV")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuDistributeH")).Hidden = True + Control(__UI_GetID("__UI_PreviewMenuCopy")).Disabled = False + Control(__UI_GetID("__UI_PreviewMenuDelete")).Disabled = False ELSE - Control(__UI_GetID("__UI_PreviewMenuAlignLeft")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignRight")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignTops")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignBottoms")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignCenterV")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignCenterH")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignCentersV")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuAlignCentersH")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuDistributeV")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuDistributeH")).Hidden = __UI_False - Control(__UI_GetID("__UI_PreviewMenuCopy")).Disabled = __UI_False - Control(__UI_GetID("__UI_PreviewMenuDelete")).Disabled = __UI_False + Control(__UI_GetID("__UI_PreviewMenuAlignLeft")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignRight")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignTops")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignBottoms")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignCenterV")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignCenterH")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignCentersV")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuAlignCentersH")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuDistributeV")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuDistributeH")).Hidden = False + Control(__UI_GetID("__UI_PreviewMenuCopy")).Disabled = False + Control(__UI_GetID("__UI_PreviewMenuDelete")).Disabled = False END IF IF _CLIPBOARD$ = "InForm" + CHR$(1) THEN - Control(__UI_GetID("__UI_PreviewMenuPaste")).Disabled = __UI_False + Control(__UI_GetID("__UI_PreviewMenuPaste")).Disabled = False ELSE - Control(__UI_GetID("__UI_PreviewMenuPaste")).Disabled = __UI_True + Control(__UI_GetID("__UI_PreviewMenuPaste")).Disabled = True END IF IF Control(__UI_HoveringID).Type = __UI_Type_MenuBar THEN - Control(__UI_GetID("__UI_PreviewMenuCopy")).Disabled = __UI_True + Control(__UI_GetID("__UI_PreviewMenuCopy")).Disabled = True END IF - IF __UI_HoveringID > 0 AND Control(__UI_HoveringID).Type <> __UI_Type_MenuItem AND Control(__UI_HoveringID).Type <> __UI_Type_MenuPanel THEN __UI_ActivateMenu Control(__UI_GetID("__UI_PreviewMenu")), __UI_False - __UI_CantShowContextMenu = __UI_False + IF __UI_HoveringID > 0 AND Control(__UI_HoveringID).Type <> __UI_Type_MenuItem AND Control(__UI_HoveringID).Type <> __UI_Type_MenuPanel THEN __UI_ActivateMenu Control(__UI_GetID("__UI_PreviewMenu")), False + __UI_CantShowContextMenu = False IF __UI_ActiveMenu > 0 THEN IF Control(__UI_ActiveMenu).Height > Control(__UI_FormID).Height OR Control(__UI_ActiveMenu).Width > Control(__UI_FormID).Width THEN - __UI_CantShowContextMenu = __UI_True + __UI_CantShowContextMenu = True END IF END IF - ELSEIF Control(__UI_HoveringID).ContextMenuID > 0 AND Control(__UI_HoveringID).Disabled = __UI_False THEN + ELSEIF Control(__UI_HoveringID).ContextMenuID > 0 AND Control(__UI_HoveringID).Disabled = False THEN __UI_Focus = __UI_HoveringID __UI_PreviousFocus = __UI_Focus 'Internal text field menu: IF Control(__UI_HoveringID).ContextMenuID = __UI_GetID("__UI_TextFieldMenu") THEN IF Control(__UI_HoveringID).TextIsSelected THEN - Control(__UI_GetID("__UI_TextMenuCut")).Disabled = __UI_False - Control(__UI_GetID("__UI_TextMenuCopy")).Disabled = __UI_False - Control(__UI_GetID("__UI_TextMenuDelete")).Disabled = __UI_False + Control(__UI_GetID("__UI_TextMenuCut")).Disabled = False + Control(__UI_GetID("__UI_TextMenuCopy")).Disabled = False + Control(__UI_GetID("__UI_TextMenuDelete")).Disabled = False ELSE - Control(__UI_GetID("__UI_TextMenuCut")).Disabled = __UI_True - Control(__UI_GetID("__UI_TextMenuCopy")).Disabled = __UI_True - Control(__UI_GetID("__UI_TextMenuDelete")).Disabled = __UI_True + Control(__UI_GetID("__UI_TextMenuCut")).Disabled = True + Control(__UI_GetID("__UI_TextMenuCopy")).Disabled = True + Control(__UI_GetID("__UI_TextMenuDelete")).Disabled = True END IF IF LEN(_CLIPBOARD$) > 0 THEN - Control(__UI_GetID("__UI_TextMenuPaste")).Disabled = __UI_False + Control(__UI_GetID("__UI_TextMenuPaste")).Disabled = False ELSE - Control(__UI_GetID("__UI_TextMenuPaste")).Disabled = __UI_True + Control(__UI_GetID("__UI_TextMenuPaste")).Disabled = True END IF END IF - __UI_ActivateMenu Control(Control(__UI_HoveringID).ContextMenuID), __UI_False + __UI_ActivateMenu Control(Control(__UI_HoveringID).ContextMenuID), False END IF END IF END IF IF __UI_MouseButton1 THEN 'Mouse button is first pressed - IF __UI_MouseIsDown = __UI_False THEN + IF __UI_MouseIsDown = False THEN __UI_MouseDownTop = __UI_MouseTop __UI_MouseDownLeft = __UI_MouseLeft IF __UI_DesignMode THEN IF LEFT$(Control(__UI_HoveringID).Name, 5) = "__UI_" THEN GOTO ProcessClick DesignModeClickToSelect: - IF RightClickSelect AND Control(__UI_HoveringID).Type = __UI_Type_MenuPanel THEN RETURN + IF RightClickSelect AND (Control(__UI_HoveringID).Type = __UI_Type_MenuPanel OR LEFT$(Control(__UI_HoveringID).Name, 5) = "__UI_") THEN RETURN IF __UI_ActiveMenu > 0 AND Control(__UI_HoveringID).Type <> __UI_Type_MenuPanel THEN IF Control(__UI_Focus).Type <> __UI_Type_MenuItem THEN __UI_DestroyControl Control(__UI_ActiveMenu) - __UI_ForceRedraw = __UI_True + __UI_ForceRedraw = True END IF END IF IF _KEYDOWN(100304) OR _KEYDOWN(100303) THEN IF Control(__UI_HoveringID).Type <> __UI_Type_Frame AND Control(__UI_HoveringID).Type <> __UI_Type_Form AND Control(__UI_HoveringID).Type <> __UI_Type_Font AND Control(__UI_HoveringID).Type <> __UI_Type_MenuItem AND Control(__UI_HoveringID).Type <> __UI_Type_MenuPanel AND Control(__UI_HoveringID).Type <> __UI_Type_ContextMenu AND Control(__UI_HoveringID).Type <> __UI_Type_MenuBar THEN - IF Control(__UI_HoveringID).ControlIsSelected = __UI_False AND Control(__UI_HoveringID).ParentID = Control(__UI_FirstSelectedID).ParentID AND Control(__UI_FirstSelectedID).Type <> __UI_Type_Frame THEN - Control(__UI_HoveringID).ControlIsSelected = __UI_True + IF Control(__UI_HoveringID).ControlIsSelected = False AND Control(__UI_HoveringID).ParentID = Control(__UI_FirstSelectedID).ParentID AND Control(__UI_FirstSelectedID).Type <> __UI_Type_Frame THEN + Control(__UI_HoveringID).ControlIsSelected = True __UI_TotalSelectedControls = __UI_TotalSelectedControls + 1 END IF END IF @@ -1484,43 +1485,43 @@ SUB __UI_EventDispatcher IF Control(__UI_HoveringID).Type = __UI_Type_MenuPanel AND LEFT$(Control(__UI_ParentMenu).Name, 5) <> "__UI_" THEN DIM TempValue AS LONG TempValue = __UI_NewControl(__UI_Type_MenuItem, "", 0, 0, 0, 0, __UI_ParentMenu) - __UI_SetCaption Control(TempValue).Name, RTRIM$(Control(TempValue).Name) - __UI_ActivateMenu Control(__UI_ParentMenu), __UI_False + SetCaption Control(TempValue).Name, RTRIM$(Control(TempValue).Name) + __UI_ActivateMenu Control(__UI_ParentMenu), False FOR i = 1 TO UBOUND(Control) - Control(i).ControlIsSelected = __UI_False + Control(i).ControlIsSelected = False NEXT - Control(TempValue).ControlIsSelected = __UI_True + Control(TempValue).ControlIsSelected = True __UI_TotalSelectedControls = 1 __UI_FirstSelectedID = TempValue ELSEIF Control(__UI_HoveringID).Type = __UI_Type_Form AND __UI_MouseTop <= (uspacing& + 5) THEN IF __UI_HasMenuBar THEN TempValue = __UI_NewControl(__UI_Type_MenuBar, "", 0, 0, 0, 0, 0) - __UI_SetCaption Control(TempValue).Name, RTRIM$(Control(TempValue).Name) + SetCaption Control(TempValue).Name, RTRIM$(Control(TempValue).Name) FOR i = 1 TO UBOUND(Control) - Control(i).ControlIsSelected = __UI_False + Control(i).ControlIsSelected = False NEXT - Control(TempValue).ControlIsSelected = __UI_True + Control(TempValue).ControlIsSelected = True __UI_RefreshMenuBar __UI_PrevMouseLeft = -1: __UI_PrevMouseTop = -1 __UI_TotalSelectedControls = 1 __UI_FirstSelectedID = TempValue - __UI_ActivateMenu Control(TempValue), __UI_False + __UI_ActivateMenu Control(TempValue), False __UI_HoveringID = TempValue END IF ELSE - IF Control(__UI_HoveringID).ControlIsSelected = __UI_False THEN + IF Control(__UI_HoveringID).ControlIsSelected = False THEN FOR i = 1 TO UBOUND(Control) - Control(i).ControlIsSelected = __UI_False + Control(i).ControlIsSelected = False NEXT __UI_TotalSelectedControls = 0 __UI_FirstSelectedID = 0 IF Control(__UI_HoveringID).Type <> __UI_Type_Form AND Control(__UI_HoveringID).Type <> __UI_Type_Font AND Control(__UI_HoveringID).Type <> __UI_Type_ContextMenu AND Control(__UI_HoveringID).Type <> __UI_Type_MenuPanel THEN - Control(__UI_HoveringID).ControlIsSelected = __UI_True + Control(__UI_HoveringID).ControlIsSelected = True __UI_TotalSelectedControls = 1 __UI_FirstSelectedID = __UI_HoveringID IF Control(__UI_HoveringID).Type = __UI_Type_MenuBar THEN - __UI_ActivateMenu Control(__UI_HoveringID), __UI_False - __UI_JustOpenedMenu = __UI_True + __UI_ActivateMenu Control(__UI_HoveringID), False + __UI_JustOpenedMenu = True END IF END IF ELSE @@ -1544,8 +1545,8 @@ SUB __UI_EventDispatcher IF Control(__UI_HoveringID).Type = __UI_Type_MenuBar AND __UI_ActiveMenu > 0 AND __UI_HoveringID = __UI_ParentMenu THEN __UI_Focus = __UI_PreviousFocus ELSEIF Control(__UI_HoveringID).Type = __UI_Type_MenuBar AND __UI_ActiveMenu = 0 THEN - __UI_ActivateMenu Control(__UI_HoveringID), __UI_False - __UI_JustOpenedMenu = __UI_True + __UI_ActivateMenu Control(__UI_HoveringID), False + __UI_JustOpenedMenu = True ELSEIF Control(__UI_HoveringID).Type = __UI_Type_MenuItem THEN 'Do nothing until mouseup (click) ELSE @@ -1553,15 +1554,15 @@ SUB __UI_EventDispatcher __UI_Focus = 0 END IF END IF - __UI_MouseIsDown = __UI_True + __UI_MouseIsDown = True __UI_MouseDownOnID = __UI_HoveringID IF __UI_DesignMode AND __UI_MouseDownOnID = __UI_FormID THEN - __UI_SelectionRectangle = __UI_True + __UI_SelectionRectangle = True __UI_SelectionRectangleTop = __UI_MouseTop __UI_SelectionRectangleLeft = __UI_MouseLeft ELSE - __UI_SelectionRectangle = __UI_False + __UI_SelectionRectangle = False END IF IF NOT __UI_DesignMode THEN @@ -1571,7 +1572,7 @@ SUB __UI_EventDispatcher __UI_MouseDownOnScrollbar = TIMER ELSEIF Control(__UI_HoveringID).HoveringVScrollbarButton = 3 THEN IF NOT __UI_DraggingThumb THEN - __UI_DraggingThumb = __UI_True + __UI_DraggingThumb = True __UI_ThumbDragTop = __UI_MouseTop __UI_DraggingThumbOnID = __UI_HoveringID END IF @@ -1583,10 +1584,10 @@ SUB __UI_EventDispatcher 'Single-line textbox contents are selected when first focused. Control(__UI_Focus).Cursor = LEN(Text(__UI_Focus)) Control(__UI_Focus).SelectionStart = 0 - Control(__UI_Focus).TextIsSelected = __UI_True + Control(__UI_Focus).TextIsSelected = True END IF ELSE - Control(__UI_Focus).TextIsSelected = __UI_False + Control(__UI_Focus).TextIsSelected = False __UI_SelectedText = "" __UI_SelectionLength = 0 IF Control(__UI_Focus).Multiline AND Control(__UI_Focus).HoveringVScrollbarButton = 0 THEN @@ -1614,7 +1615,7 @@ SUB __UI_EventDispatcher IF i > __UI_LastRenderedCharCount THEN Control(__UI_Focus).Cursor = ThisLineStart + ThisLineLen - 1 Control(__UI_Focus).SelectionStart = Control(__UI_Focus).Cursor ELSE - Control(__UI_Focus).TextIsSelected = __UI_False + Control(__UI_Focus).TextIsSelected = False __UI_SelectedText = "" __UI_SelectionLength = 0 'Single-line textbox click @@ -1629,7 +1630,7 @@ SUB __UI_EventDispatcher IF i < 0 THEN i = Control(__UI_Focus).Cursor = 0 Control(__UI_Focus).SelectionStart = Control(__UI_Focus).Cursor END IF - __UI_IsSelectingText = __UI_True + __UI_IsSelectingText = True __UI_IsSelectingTextOnID = __UI_Focus END IF END IF @@ -1638,7 +1639,7 @@ SUB __UI_EventDispatcher __UI_MouseDownOnScrollbar = TIMER ELSEIF Control(__UI_HoveringID).HoveringVScrollbarButton = 3 THEN IF NOT __UI_DraggingThumb THEN - __UI_DraggingThumb = __UI_True + __UI_DraggingThumb = True __UI_ThumbDragTop = __UI_MouseTop __UI_DraggingThumbOnID = __UI_HoveringID END IF @@ -1651,21 +1652,21 @@ SUB __UI_EventDispatcher 'Mouse button is still pressed IF __UI_DesignMode THEN IF __UI_ResizeHandleHover = 0 AND (TIMER - __UI_LastMouseDownEvent > .3 OR (__UI_MouseTop <> __UI_MouseDownTop OR __UI_MouseLeft <> __UI_MouseDownLeft)) THEN - IF __UI_IsDragging = __UI_False AND __UI_SelectionRectangle = __UI_False THEN - __UI_IsDragging = __UI_True + IF __UI_IsDragging = False AND __UI_SelectionRectangle = False THEN + __UI_IsDragging = True __UI_DraggingID = __UI_HoveringID FOR i = 1 TO UBOUND(Control) IF Control(i).ControlIsSelected AND Control(i).Type = __UI_Type_Frame THEN __UI_DraggingID = i FOR i = 1 TO UBOUND(Control) - IF i <> __UI_DraggingID THEN Control(i).ControlIsSelected = __UI_False + IF i <> __UI_DraggingID THEN Control(i).ControlIsSelected = False NEXT EXIT FOR END IF NEXT IF Control(__UI_FirstSelectedID).Type = __UI_Type_MenuBar OR Control(__UI_FirstSelectedID).Type = __UI_Type_MenuItem THEN __UI_DraggingID = 0 - __UI_IsDragging = __UI_False + __UI_IsDragging = False __UI_MouseDownOnID = 0 ELSE __UI_MouseDownOnID = 0 @@ -1674,8 +1675,8 @@ SUB __UI_EventDispatcher END IF END IF ELSE - IF __UI_IsResizing = __UI_False AND __UI_SelectionRectangle = __UI_False AND Control(__UI_FirstSelectedID).Type <> __UI_Type_MenuBar AND Control(__UI_FirstSelectedID).Type <> __UI_Type_MenuItem THEN - __UI_IsResizing = __UI_True + IF __UI_IsResizing = False AND __UI_SelectionRectangle = False AND Control(__UI_FirstSelectedID).Type <> __UI_Type_MenuBar AND Control(__UI_FirstSelectedID).Type <> __UI_Type_MenuItem THEN + __UI_IsResizing = True __UI_ResizingID = __UI_HoveringID __UI_MouseDownOnID = 0 __UI_DragY = __UI_MouseTop @@ -1701,7 +1702,7 @@ SUB __UI_EventDispatcher IF __UI_MouseLeft < Control(__UI_Focus).Left - Control(Control(__UI_Focus).ParentID).Left THEN Control(__UI_Focus).Cursor = 0 IF Control(__UI_IsSelectingTextOnID).Cursor <> Control(__UI_IsSelectingTextOnID).SelectionStart THEN - Control(__UI_IsSelectingTextOnID).TextIsSelected = __UI_True + Control(__UI_IsSelectingTextOnID).TextIsSelected = True END IF ELSE 'Multi-line textbox click @@ -1725,7 +1726,7 @@ SUB __UI_EventDispatcher IF i > __UI_LastRenderedCharCount THEN Control(__UI_IsSelectingTextOnID).Cursor = ThisLineStart + ThisLineLen - 1 IF Control(__UI_IsSelectingTextOnID).Cursor <> Control(__UI_IsSelectingTextOnID).SelectionStart THEN - Control(__UI_IsSelectingTextOnID).TextIsSelected = __UI_True + Control(__UI_IsSelectingTextOnID).TextIsSelected = True END IF END IF END IF @@ -1806,8 +1807,8 @@ SUB __UI_EventDispatcher 'Mouse button is released IF __UI_MouseIsDown THEN IF __UI_IsDragging THEN - __UI_IsDragging = __UI_False - __UI_ForceRedraw = __UI_True + __UI_IsDragging = False + __UI_ForceRedraw = True 'Snap the previously dragged control to the grid (if Ctrl is down): IF Control(__UI_DraggingID).ParentID > 0 AND Control(__UI_DraggingID).Type <> __UI_Type_MenuItem THEN __UI_PreviewTop = __UI_PreviewTop - Control(Control(__UI_DraggingID).ParentID).Top @@ -1818,17 +1819,17 @@ SUB __UI_EventDispatcher __UI_DraggingID = 0 END IF IF __UI_IsResizing THEN - __UI_IsResizing = __UI_False + __UI_IsResizing = False __UI_ResizingID = 0 'FOR i = 1 TO UBOUND(Control) ' IF Control(i).ControlIsSelected AND Control(i).Type = __UI_Type_TextBox THEN ' Control(i).FieldArea = Control(i).Width / _FONTWIDTH((Control(i).Font)) - 1 - ' __UI_ForceRedraw = __UI_True + ' __UI_ForceRedraw = True ' END IF 'NEXT END IF IF __UI_DraggingThumb THEN - __UI_DraggingThumb = __UI_False + __UI_DraggingThumb = False __UI_DraggingThumbOnID = 0 END IF @@ -1844,7 +1845,7 @@ SUB __UI_EventDispatcher IF NOT Control(__UI_HoveringID).Disabled THEN SELECT CASE Control(__UI_HoveringID).Type CASE __UI_Type_RadioButton - __UI_SetRadioButtonValue __UI_HoveringID + SetRadioButtonValue __UI_HoveringID CASE __UI_Type_CheckBox Control(__UI_HoveringID).Value = NOT Control(__UI_HoveringID).Value CASE __UI_Type_TextBox @@ -1874,7 +1875,7 @@ SUB __UI_EventDispatcher ' IF LEN(Text(__UI_HoveringID)) > 0 THEN ' Control(__UI_HoveringID).Cursor = LEN(Text(__UI_HoveringID)) ' Control(__UI_HoveringID).SelectionStart = 0 - ' Control(__UI_HoveringID).TextIsSelected = __UI_True + ' Control(__UI_HoveringID).TextIsSelected = True ' END IF ' ELSE ' Control(__UI_HoveringID).Cursor = TempNewCursor @@ -1930,10 +1931,10 @@ SUB __UI_EventDispatcher CASE __UI_Type_MenuItem __UI_Focus = __UI_PreviousFocus __UI_DestroyControl Control(__UI_ActiveMenu) - __UI_ForceRedraw = __UI_True + __UI_ForceRedraw = True END SELECT __UI_LastMouseClick = TIMER - __UI_JustOpenedMenu = __UI_False + __UI_JustOpenedMenu = False __UI_MouseDownOnID = 0 ProcessClick: @@ -1956,7 +1957,7 @@ SUB __UI_EventDispatcher IF LEN(__UI_SelectedText) > 0 THEN _CLIPBOARD$ = __UI_SelectedText CASE "__UI_TEXTMENUPASTE" DIM ContextMenuPaste AS _BYTE - ContextMenuPaste = __UI_True + ContextMenuPaste = True GOSUB PasteIntoTextBox CASE "__UI_TEXTMENUDELETE" __UI_DeleteSelection @@ -1964,7 +1965,7 @@ SUB __UI_EventDispatcher IF LEN(Text(__UI_Focus)) > 0 THEN Control(__UI_Focus).Cursor = LEN(Text(__UI_Focus)) Control(__UI_Focus).SelectionStart = 0 - Control(__UI_Focus).TextIsSelected = __UI_True + Control(__UI_Focus).TextIsSelected = True END IF CASE "__UI_PREVIEWMENUALIGNLEFT" IF __UI_TotalSelectedControls > 1 THEN @@ -2162,7 +2163,7 @@ SUB __UI_EventDispatcher DIM FindLefts AS INTEGER, NextControlToDistribute AS LONG DIM TotalSpace AS INTEGER, BinSize AS INTEGER - __UI_AutoRefresh = __UI_False + __UI_AutoRefresh = False FOR FindLefts = 0 TO Control(__UI_FormID).Width - 1 FOR i = 1 TO UBOUND(Control) IF Control(i).ControlIsSelected AND Control(i).Left = FindLefts THEN @@ -2207,15 +2208,15 @@ SUB __UI_EventDispatcher 'NEXT END IF - __UI_AutoRefresh = __UI_True - __UI_ForceRedraw = __UI_True + __UI_AutoRefresh = True + __UI_ForceRedraw = True CASE "__UI_PREVIEWMENUDISTRIBUTEV" 'Build a sublist containing the selected controls in the order they 'are currently placed vertically: REDIM SubList(1 TO __UI_TotalSelectedControls) AS LONG DIM FindTops AS INTEGER - __UI_AutoRefresh = __UI_False + __UI_AutoRefresh = False FOR FindTops = 0 TO Control(__UI_FormID).Height - 1 FOR i = 1 TO UBOUND(Control) IF Control(i).ControlIsSelected AND Control(i).Top = FindTops THEN @@ -2260,8 +2261,8 @@ SUB __UI_EventDispatcher 'NEXT END IF - __UI_AutoRefresh = __UI_True - __UI_ForceRedraw = __UI_True + __UI_AutoRefresh = True + __UI_ForceRedraw = True CASE "__UI_PREVIEWMENUCOPY": GOTO ControlCopy CASE "__UI_PREVIEWMENUPASTE": GOTO ControlPaste CASE "__UI_PREVIEWMENUDELETE": GOTO ControlDelete @@ -2275,16 +2276,16 @@ SUB __UI_EventDispatcher IF __UI_ActiveMenu > 0 THEN __UI_DestroyControl Control(__UI_ActiveMenu) __UI_Focus = __UI_PreviousFocus - __UI_ForceRedraw = __UI_True + __UI_ForceRedraw = True END IF END IF END IF - __UI_IsSelectingText = __UI_False + __UI_IsSelectingText = False __UI_IsSelectingTextOnID = 0 - __UI_MouseIsDown = __UI_False + __UI_MouseIsDown = False __UI_MouseDownOnID = 0 __UI_PreviousMouseDownOnID = 0 - __UI_SelectionRectangle = __UI_False + __UI_SelectionRectangle = False END IF END IF @@ -2296,7 +2297,7 @@ SUB __UI_EventDispatcher IF Control(__UI_BelowHoveringID).Type = __UI_Type_Frame OR Control(__UI_HoveringID).Type = __UI_Type_Frame THEN IF Control(__UI_HoveringID).Type = __UI_Type_Frame THEN __UI_BelowHoveringID = __UI_HoveringID IF Control(__UI_FirstSelectedID).ParentID <> __UI_BelowHoveringID THEN - SetNewParent = __UI_True + SetNewParent = True LeftOffset = Control(__UI_BelowHoveringID).Left TopOffset = Control(__UI_BelowHoveringID).Top END IF @@ -2305,7 +2306,7 @@ SUB __UI_EventDispatcher LeftOffset = Control(Control(__UI_FirstSelectedID).ParentID).Left TopOffset = Control(Control(__UI_FirstSelectedID).ParentID).Top __UI_BelowHoveringID = 0 - SetNewParent = __UI_True + SetNewParent = True END IF END IF END IF @@ -2317,11 +2318,11 @@ SUB __UI_EventDispatcher '(Ctrl enables snapping): IF ((Control(i).Top + (__UI_MouseTop - __UI_DragY))) MOD 10 = 0 THEN _ Control(i).Top = (Control(i).Top + (__UI_MouseTop - __UI_DragY)): _ - SnappedY = __UI_True + SnappedY = True IF ((Control(i).Left + (__UI_MouseLeft - __UI_DragX))) MOD 10 = 0 THEN _ Control(i).Left = (Control(i).Left + (__UI_MouseLeft - __UI_DragX)): _ - SnappedX = __UI_True + SnappedX = True ELSE Control(i).Top = Control(i).Top + (__UI_MouseTop - __UI_DragY) Control(i).Left = Control(i).Left + (__UI_MouseLeft - __UI_DragX) @@ -2357,7 +2358,7 @@ SUB __UI_EventDispatcher END IF IF __UI_IsResizing AND __UI_ResizingID > 0 THEN __UI_Click 0 'Force the preview to inform it was edited - __UI_ForceRedraw = __UI_True + __UI_ForceRedraw = True FOR i = 1 TO UBOUND(Control) IF Control(i).ControlIsSelected THEN 'Right @@ -2409,7 +2410,7 @@ SUB __UI_EventDispatcher __UI_DragY = __UI_MouseTop __UI_DragX = __UI_MouseLeft END IF - IF __UI_DraggingThumb = __UI_True THEN + IF __UI_DraggingThumb = True THEN IF Control(__UI_DraggingThumbOnID).Type = __UI_Type_ListBox THEN IF __UI_MouseTop >= Control(__UI_DraggingThumbOnID).Top + Control(Control(__UI_DraggingThumbOnID).ParentID).Top + __UI_ScrollbarButtonHeight AND __UI_MouseTop <= Control(__UI_DraggingThumbOnID).Top + Control(Control(__UI_DraggingThumbOnID).ParentID).Top + Control(__UI_DraggingThumbOnID).Height - __UI_ScrollbarButtonHeight THEN 'Dragging in the track area @@ -2448,7 +2449,7 @@ SUB __UI_EventDispatcher 'Check for mouse going through objects, not encompassing corners: __UI_TotalSelectedControls = 0 FOR i = 1 TO UBOUND(Control) - Control(i).ControlIsSelected = __UI_False + Control(i).ControlIsSelected = False IF Control(i).Type <> __UI_Type_Form AND Control(i).Type <> __UI_Type_Font AND Control(i).Type <> __UI_Type_MenuBar AND Control(i).Type <> __UI_Type_MenuItem AND Control(i).Type <> __UI_Type_MenuPanel AND Control(i).Type <> __UI_Type_ContextMenu AND Control(i).ParentID = 0 THEN IF tmx >= Control(i).Left AND tmx <= Control(i).Left + Control(i).Width - 1 AND tmy >= Control(i).Top AND tmy <= Control(i).Top + Control(i).Height - 1 THEN Control(i).ControlIsSelected = -1 IF tsmx >= Control(i).Left AND tsmx <= Control(i).Left + Control(i).Width - 1 AND tsmy >= Control(i).Top AND tsmy <= Control(i).Top + Control(i).Height - 1 THEN Control(i).ControlIsSelected = -1 @@ -2478,28 +2479,28 @@ SUB __UI_EventDispatcher 'Keyboard handler 'Modifiers (Ctrl, Alt, Shift): - IF __UI_KeyHit = 100303 OR __UI_KeyHit = 100304 THEN __UI_ShiftIsDown = __UI_True - IF __UI_KeyHit = -100303 OR __UI_KeyHit = -100304 THEN __UI_ShiftIsDown = __UI_False - IF __UI_KeyHit = 100305 OR __UI_KeyHit = 100306 THEN __UI_CtrlIsDown = __UI_True - IF __UI_KeyHit = -100305 OR __UI_KeyHit = -100306 THEN __UI_CtrlIsDown = __UI_False - IF __UI_KeyHit = 100307 OR __UI_KeyHit = 100308 THEN __UI_AltIsDown = __UI_True - IF __UI_KeyHit = -100307 OR __UI_KeyHit = -100308 THEN __UI_AltIsDown = __UI_False + IF __UI_KeyHit = 100303 OR __UI_KeyHit = 100304 THEN __UI_ShiftIsDown = True + IF __UI_KeyHit = -100303 OR __UI_KeyHit = -100304 THEN __UI_ShiftIsDown = False + IF __UI_KeyHit = 100305 OR __UI_KeyHit = 100306 THEN __UI_CtrlIsDown = True + IF __UI_KeyHit = -100305 OR __UI_KeyHit = -100306 THEN __UI_CtrlIsDown = False + IF __UI_KeyHit = 100307 OR __UI_KeyHit = 100308 THEN __UI_AltIsDown = True + IF __UI_KeyHit = -100307 OR __UI_KeyHit = -100308 THEN __UI_AltIsDown = False 'Alt: IF NOT __UI_DesignMode THEN IF __UI_AltIsDown AND Control(__UI_Focus).Type = __UI_Type_MenuBar THEN __UI_Focus = __UI_PreviousFocus - __UI_AltIsDown = __UI_False + __UI_AltIsDown = False ELSEIF __UI_AltIsDown AND __UI_ActiveMenu > 0 THEN __UI_Focus = __UI_PreviousFocus __UI_DestroyControl Control(__UI_ActiveMenu) - __UI_ForceRedraw = __UI_True + __UI_ForceRedraw = True __UI_KeyHit = 0 - __UI_AltIsDown = __UI_False + __UI_AltIsDown = False ELSEIF __UI_AltIsDown THEN IF NOT __UI_ShowHotKeys THEN - __UI_ShowHotKeys = __UI_True - __UI_ForceRedraw = __UI_True 'Trigger a global redraw + __UI_ShowHotKeys = True + __UI_ForceRedraw = True 'Trigger a global redraw END IF SELECT CASE __UI_KeyHit @@ -2520,7 +2521,7 @@ SUB __UI_EventDispatcher __UI_Click Control(i).ID CASE __UI_Type_RadioButton IF Control(i).CanHaveFocus THEN __UI_Focus = Control(i).ID - __UI_SetRadioButtonValue Control(i).ID + SetRadioButtonValue Control(i).ID __UI_Click Control(i).ID CASE __UI_Type_CheckBox IF Control(i).CanHaveFocus THEN __UI_Focus = Control(i).ID @@ -2545,11 +2546,11 @@ SUB __UI_EventDispatcher CASE __UI_Type_MenuBar IF __UI_ActiveMenu = 0 THEN __UI_PreviousFocus = __UI_Focus - __UI_ActivateMenu Control(i), __UI_True - __UI_ForceRedraw = __UI_True + __UI_ActivateMenu Control(i), True + __UI_ForceRedraw = True Control(__UI_ActiveMenu).Value = __UI_Focus __UI_KeyHit = 0 - __UI_AltIsDown = __UI_False + __UI_AltIsDown = False END IF END SELECT EXIT FOR @@ -2560,8 +2561,8 @@ SUB __UI_EventDispatcher END SELECT ELSE IF __UI_ShowHotKeys THEN - __UI_ShowHotKeys = __UI_False - __UI_ForceRedraw = __UI_True 'Trigger a global redraw + __UI_ShowHotKeys = False + __UI_ForceRedraw = True 'Trigger a global redraw IF LEN(__UI_AltCombo$) THEN 'Numeric keypresses with alt pressed are converted into the proper ASCII character @@ -2587,25 +2588,25 @@ SUB __UI_EventDispatcher IF __UI_DesignMode THEN IF __UI_KeyHit = 27 THEN FOR i = 1 TO UBOUND(Control) - Control(i).ControlIsSelected = __UI_False + Control(i).ControlIsSelected = False NEXT __UI_TotalSelectedControls = 0 __UI_FirstSelectedID = 0 END IF END IF - IF __UI_Focus > 0 AND __UI_KeyHit <> 0 AND __UI_DesignMode = __UI_False THEN + IF __UI_Focus > 0 AND __UI_KeyHit <> 0 AND __UI_DesignMode = False THEN __UI_KeyPress __UI_Focus - __UI_KeyboardFocus = __UI_True + __UI_KeyboardFocus = True 'Enter activates the selected/default button, if any - IF __UI_IsDragging = __UI_False AND __UI_KeyHit = -13 AND NOT Control(__UI_Focus).Disabled THEN + IF __UI_IsDragging = False AND __UI_KeyHit = -13 AND NOT Control(__UI_Focus).Disabled THEN IF Control(__UI_Focus).Type = __UI_Type_Button OR Control(__UI_Focus).Type = __UI_Type_MenuItem THEN i = __UI_Focus IF Control(__UI_Focus).Type = __UI_Type_MenuItem THEN __UI_Focus = __UI_PreviousFocus __UI_DestroyControl Control(__UI_ActiveMenu) - __UI_ForceRedraw = __UI_True + __UI_ForceRedraw = True __UI_KeyHit = 0 END IF __UI_HoveringID = i @@ -2616,7 +2617,7 @@ SUB __UI_EventDispatcher __UI_DestroyControl Control(__UI_ActiveDropdownList) IF Control(__UI_Focus).PreviousValue <> Control(__UI_Focus).Value THEN __UI_ValueChanged __UI_Focus ELSEIF Control(__UI_Focus).Type = __UI_Type_MenuBar THEN - __UI_ActivateMenu Control(__UI_Focus), __UI_True + __UI_ActivateMenu Control(__UI_Focus), True ELSEIF Control(__UI_Focus).Type = __UI_Type_TextBox AND Control(__UI_Focus).Multiline THEN 'Do nothing. Enter will add a new line to a multiline textbox (below). ELSEIF __UI_Focus <> __UI_DefaultButtonID AND __UI_DefaultButtonID > 0 THEN @@ -2651,9 +2652,9 @@ SUB __UI_EventDispatcher FOR i = 1 TO UBOUND(Control) IF Control(i).HotKey = __UI_KeyHit AND NOT Control(i).Disabled AND Control(i).Type = __UI_Type_MenuBar THEN IF __UI_ActiveMenu = 0 THEN - __UI_ActivateMenu Control(i), __UI_True + __UI_ActivateMenu Control(i), True Control(__UI_ActiveMenu).Value = __UI_Focus - __UI_ForceRedraw = __UI_True + __UI_ForceRedraw = True __UI_KeyHit = 0 END IF EXIT FOR @@ -2667,7 +2668,7 @@ SUB __UI_EventDispatcher CASE 19712 'Right __UI_Focus = __UI_NextMenuBarControl(__UI_Focus) CASE 18432, 20480 'Up, down - __UI_ActivateMenu Control(__UI_Focus), __UI_True + __UI_ActivateMenu Control(__UI_Focus), True __UI_KeyHit = 0 END SELECT CASE __UI_Type_MenuPanel, __UI_Type_MenuItem @@ -2680,7 +2681,7 @@ SUB __UI_EventDispatcher IF Control(i).HotKey = __UI_KeyHit AND NOT Control(i).Disabled AND Control(i).Type = __UI_Type_MenuItem AND Control(i).ParentID = __UI_ParentMenu THEN __UI_Focus = __UI_PreviousFocus __UI_DestroyControl Control(__UI_ActiveMenu) - __UI_ForceRedraw = __UI_True + __UI_ForceRedraw = True __UI_KeyHit = 0 IF LEFT$(Control(i).Name, 5) = "__UI_" THEN __UI_HoveringID = i @@ -2700,15 +2701,15 @@ SUB __UI_EventDispatcher __UI_DestroyControl Control(__UI_ActiveMenu) __UI_KeyHit = 0 CASE 19200 'Left - IF __UI_ActiveMenuIsContextMenu = __UI_False THEN - __UI_ActivateMenu Control(__UI_PreviousMenuBarControl(__UI_ParentMenu)), __UI_True - __UI_ForceRedraw = __UI_True + IF __UI_ActiveMenuIsContextMenu = False THEN + __UI_ActivateMenu Control(__UI_PreviousMenuBarControl(__UI_ParentMenu)), True + __UI_ForceRedraw = True END IF __UI_KeyHit = 0 CASE 19712 'Right - IF __UI_ActiveMenuIsContextMenu = __UI_False THEN - __UI_ActivateMenu Control(__UI_NextMenuBarControl(__UI_ParentMenu)), __UI_True - __UI_ForceRedraw = __UI_True + IF __UI_ActiveMenuIsContextMenu = False THEN + __UI_ActivateMenu Control(__UI_NextMenuBarControl(__UI_ParentMenu)), True + __UI_ForceRedraw = True END IF __UI_KeyHit = 0 CASE 18432 'Up @@ -2722,24 +2723,24 @@ SUB __UI_EventDispatcher SELECT CASE __UI_KeyHit CASE 32 'Emulate mouse down/click - IF __UI_IsDragging = __UI_False AND NOT Control(__UI_Focus).Disabled THEN + IF __UI_IsDragging = False AND NOT Control(__UI_Focus).Disabled THEN 'Space bar down on a button - IF __UI_KeyIsDown = __UI_False AND __UI_KeyDownOnID = 0 THEN + IF __UI_KeyIsDown = False AND __UI_KeyDownOnID = 0 THEN __UI_KeyDownOnID = __UI_Focus - __UI_KeyIsDown = __UI_True + __UI_KeyIsDown = True END IF END IF CASE -32 - IF __UI_IsDragging = __UI_False AND NOT Control(__UI_Focus).Disabled THEN + IF __UI_IsDragging = False AND NOT Control(__UI_Focus).Disabled THEN 'Space bar released and a button has focus IF __UI_KeyIsDown AND __UI_Focus = __UI_KeyDownOnID THEN IF Control(__UI_KeyDownOnID).Type = __UI_Type_RadioButton THEN - __UI_SetRadioButtonValue __UI_KeyDownOnID + SetRadioButtonValue __UI_KeyDownOnID ELSEIF Control(__UI_KeyDownOnID).Type = __UI_Type_CheckBox THEN Control(__UI_KeyDownOnID).Value = NOT Control(__UI_KeyDownOnID).Value END IF __UI_KeyDownOnID = 0 - __UI_KeyIsDown = __UI_False + __UI_KeyIsDown = False __UI_Click __UI_Focus END IF END IF @@ -2762,7 +2763,7 @@ SUB __UI_EventDispatcher __UI_FocusOut __UI_Focus __UI_Focus = __UI_FocusSearch __UI_FocusIn __UI_Focus - IF Control(__UI_FocusSearch).Type = __UI_Type_RadioButton THEN __UI_SetRadioButtonValue __UI_Focus + IF Control(__UI_FocusSearch).Type = __UI_Type_RadioButton THEN SetRadioButtonValue __UI_Focus EXIT DO END IF LOOP @@ -2837,7 +2838,7 @@ SUB __UI_EventDispatcher IF __UI_CtrlIsDown THEN PasteIntoTextBox: IF Control(__UI_Focus).Multiline THEN - Clip$ = __UI_ReplaceText(_CLIPBOARD$, CHR$(13) + CHR$(10), CHR$(10), __UI_False, 0) + Clip$ = Replace(_CLIPBOARD$, CHR$(13) + CHR$(10), CHR$(10), False, 0) IF LEN(Clip$) > 0 THEN IF NOT Control(__UI_Focus).TextIsSelected THEN IF Control(__UI_Focus).Cursor = LEN(Text(__UI_Focus)) THEN @@ -2853,13 +2854,13 @@ SUB __UI_EventDispatcher 'IF s1 > s2 THEN SWAP s1, s2 'Text(__UI_Focus) = LEFT$(Text(__UI_Focus), s1) + Clip$ + MID$(Text(__UI_Focus), s2 + 1) 'Control(__UI_Focus).Cursor = s1 + LEN(Clip$) - 'Control(__UI_Focus).TextIsSelected = __UI_False + 'Control(__UI_Focus).TextIsSelected = False '__UI_SelectedText = "" '__UI_SelectionLength = 0 END IF END IF IF ContextMenuPaste THEN - ContextMenuPaste = __UI_False + ContextMenuPaste = False RETURN END IF __UI_KeyHit = 0 @@ -2884,13 +2885,13 @@ SUB __UI_EventDispatcher IF s1 > s2 THEN SWAP s1, s2 Text(__UI_Focus) = LEFT$(Text(__UI_Focus), s1) + Clip$ + MID$(Text(__UI_Focus), s2 + 1) Control(__UI_Focus).Cursor = s1 + LEN(Clip$) - Control(__UI_Focus).TextIsSelected = __UI_False + Control(__UI_Focus).TextIsSelected = False __UI_SelectedText = "" __UI_SelectionLength = 0 END IF END IF IF ContextMenuPaste THEN - ContextMenuPaste = __UI_False + ContextMenuPaste = False RETURN END IF __UI_KeyHit = 0 @@ -2913,7 +2914,7 @@ SUB __UI_EventDispatcher IF __UI_CtrlIsDown THEN Control(__UI_Focus).Cursor = LEN(Text(__UI_Focus)) Control(__UI_Focus).SelectionStart = 0 - Control(__UI_Focus).TextIsSelected = __UI_True + Control(__UI_Focus).TextIsSelected = True __UI_KeyHit = 0 END IF END IF @@ -2932,7 +2933,7 @@ SUB __UI_EventDispatcher s2 = Control(__UI_Focus).Cursor IF s1 > s2 THEN SWAP s1, s2 Text(__UI_Focus) = LEFT$(Text(__UI_Focus), s1) + CHR$(__UI_KeyHit) + MID$(Text(__UI_Focus), s2 + 1) - Control(__UI_Focus).TextIsSelected = __UI_False + Control(__UI_Focus).TextIsSelected = False __UI_SelectedText = "" __UI_SelectionLength = 0 Control(__UI_Focus).Cursor = s1 + 1 @@ -2982,7 +2983,7 @@ SUB __UI_EventDispatcher 's2 = Control(__UI_Focus).Cursor 'IF s1 > s2 THEN SWAP s1, s2 'Text(__UI_Focus) = LEFT$(Text(__UI_Focus), s1) + CHR$(__UI_KeyHit) + MID$(Text(__UI_Focus), s2 + 1) - 'Control(__UI_Focus).TextIsSelected = __UI_False + 'Control(__UI_Focus).TextIsSelected = False '__UI_SelectedText = "" '__UI_SelectionLength = 0 'Control(__UI_Focus).Cursor = s1 + 1 @@ -3079,12 +3080,12 @@ SUB __UI_EventDispatcher SelectAllInFrame: DIM ThisContainer AS LONG ThisContainer = Control(__UI_FirstSelectedID).ID - Control(__UI_FirstSelectedID).ControlIsSelected = __UI_False + Control(__UI_FirstSelectedID).ControlIsSelected = False __UI_TotalSelectedControls = 0 FOR i = 1 TO UBOUND(Control) IF Control(i).Type <> __UI_Type_Frame AND Control(i).Type <> __UI_Type_Form AND Control(i).Type <> __UI_Type_Font AND Control(i).Type <> __UI_Type_MenuBar AND Control(i).Type <> __UI_Type_MenuItem AND Control(i).Type <> __UI_Type_MenuPanel AND Control(i).Type <> __UI_Type_ContextMenu AND Control(i).Type <> __UI_Type_MenuItem THEN IF Control(i).ID > 0 AND Control(i).ParentID = ThisContainer THEN - Control(i).ControlIsSelected = __UI_True + Control(i).ControlIsSelected = True __UI_TotalSelectedControls = __UI_TotalSelectedControls + 1 IF __UI_TotalSelectedControls = 1 THEN __UI_FirstSelectedID = Control(i).ID END IF @@ -3095,7 +3096,7 @@ SUB __UI_EventDispatcher FOR i = 1 TO UBOUND(Control) IF Control(i).Type <> __UI_Type_Frame AND Control(i).Type <> __UI_Type_Form AND Control(i).Type <> __UI_Type_Font AND Control(i).Type <> __UI_Type_MenuBar AND Control(i).Type <> __UI_Type_MenuItem AND Control(i).Type <> __UI_Type_MenuPanel AND Control(i).Type <> __UI_Type_ContextMenu AND Control(i).Type <> __UI_Type_MenuItem THEN IF Control(i).ID > 0 AND Control(i).ParentID = 0 THEN - Control(i).ControlIsSelected = __UI_True + Control(i).ControlIsSelected = True __UI_TotalSelectedControls = __UI_TotalSelectedControls + 1 IF __UI_TotalSelectedControls = 1 THEN __UI_FirstSelectedID = Control(i).ID END IF @@ -3111,7 +3112,7 @@ SUB __UI_EventDispatcher FOR i = 1 TO UBOUND(Control) IF Control(i).ControlIsSelected AND Control(i).Type <> __UI_Type_Frame AND Control(i).Type <> __UI_Type_MenuBar AND Control(i).Type <> __UI_Type_MenuItem THEN ControlClipboard$ = ControlClipboard$ + MKL$(i) - CopyDone = __UI_True + CopyDone = True END IF NEXT IF CopyDone THEN _CLIPBOARD$ = "InForm" + CHR$(1) @@ -3136,10 +3137,10 @@ SUB __UI_EventDispatcher END IF FOR i = 1 TO UBOUND(Control) - Control(i).ControlIsSelected = __UI_False + Control(i).ControlIsSelected = False NEXT - __UI_AutoRefresh = __UI_False + __UI_AutoRefresh = False _DELAY .1 Clip$ = MID$(ControlClipboard$, 5) FOR i = 1 TO j @@ -3168,15 +3169,15 @@ SUB __UI_EventDispatcher Control(PasteID).Top = Control(PasteID).Top + 20 Control(PasteID).Left = Control(PasteID).Left + 20 END IF - Control(PasteID).ControlIsSelected = __UI_True + Control(PasteID).ControlIsSelected = True IF i = 1 THEN FirstToBeSelected = PasteID END IF NEXT __UI_TotalSelectedControls = j __UI_FirstSelectedID = FirstToBeSelected - __UI_ForceRedraw = __UI_True - __UI_AutoRefresh = __UI_True + __UI_ForceRedraw = True + __UI_AutoRefresh = True END IF END IF CASE 21248 'Delete @@ -3196,7 +3197,7 @@ SUB __UI_EventDispatcher END IF IF Control(i).Type = __UI_Type_MenuBar THEN DIM MustRefreshMenuBar AS _BYTE - MustRefreshMenuBar = __UI_True + MustRefreshMenuBar = True FOR j = 1 TO UBOUND(Control) IF Control(j).ParentID = i THEN __UI_DestroyControl Control(j) @@ -3208,7 +3209,7 @@ SUB __UI_EventDispatcher END IF __UI_DestroyControl Control(i) IF MustRefreshMenuBar THEN __UI_RefreshMenuBar - __UI_ForceRedraw = __UI_True + __UI_ForceRedraw = True __UI_TotalSelectedControls = __UI_TotalSelectedControls - 1 END IF NEXT @@ -3257,10 +3258,10 @@ SUB __UI_EventDispatcher END IF NEXT END SELECT - IF __UI_ActiveMenu > 0 THEN __UI_ActivateMenu Control(__UI_ParentMenu), __UI_False + IF __UI_ActiveMenu > 0 THEN __UI_ActivateMenu Control(__UI_ParentMenu), False ELSEIF __UI_KeyHit <> 0 THEN 'No control has focus 'Enter activates the default button, if any - IF __UI_IsDragging = __UI_False AND __UI_KeyHit = -13 AND __UI_DefaultButtonID > 0 THEN + IF __UI_IsDragging = False AND __UI_KeyHit = -13 AND __UI_DefaultButtonID > 0 THEN 'Enter released and there is a default button __UI_Click __UI_DefaultButtonID END IF @@ -3296,14 +3297,14 @@ FUNCTION __UI_GetFontID (FontHandle&) END FUNCTION '--------------------------------------------------------------------------------- -FUNCTION __UI_Font& (NewFontFile AS STRING, NewFontSize AS INTEGER, TempNewFontAttributes AS STRING) +FUNCTION SetFont& (NewFontFile AS STRING, NewFontSize AS INTEGER, TempNewFontAttributes AS STRING) DIM NextSlot AS LONG, i AS LONG, Temp$, NewFontAttributes AS STRING 'If the passed font is already loaded, we'll just return its handle FOR NextSlot = 1 TO UBOUND(Control) IF Control(NextSlot).Type = __UI_Type_Font THEN IF UCASE$(Text(NextSlot)) = UCASE$(NewFontFile) AND Control(NextSlot).Max = NewFontSize AND UCASE$(Caption(NextSlot)) = UCASE$(NewFontAttributes) THEN - __UI_Font& = Control(NextSlot).Value + SetFont& = Control(NextSlot).Value EXIT FUNCTION END IF END IF @@ -3375,13 +3376,13 @@ FUNCTION __UI_Font& (NewFontFile AS STRING, NewFontSize AS INTEGER, TempNewFontA Text(NextSlot) = NewFontFile Caption(NextSlot) = UCASE$(NewFontAttributes) - __UI_Font& = Control(NextSlot).Value + SetFont& = Control(NextSlot).Value 'If loading the requested font fails, we default to _FONT 8 IF Control(NextSlot).Value <= 0 THEN __UI_DestroyControl Control(NextSlot) Control(NextSlot).Value = 8 - __UI_Font& = 8 + SetFont& = 8 END IF END IF END FUNCTION @@ -3427,13 +3428,12 @@ FUNCTION __UI_NewControl (ControlType AS INTEGER, ControlName AS STRING, NewWidt NextSlot = NextSlot + 1 EXIT FOR ELSE - IF NextSlot = 1 THEN EXIT FOR + IF NextSlot = 1 THEN NextSlot = UBOUND(Control) + 1: EXIT FOR END IF NEXT - IF NextSlot = 0 THEN + IF NextSlot = UBOUND(Control) + 1 THEN 'No empty slots. We must increase Control() and its helper arrays - NextSlot = UBOUND(Control) + 1 REDIM _PRESERVE Control(0 TO NextSlot + 99) AS __UI_ControlTYPE REDIM _PRESERVE Caption(1 TO NextSlot + 99) AS STRING REDIM _PRESERVE __UI_TempCaptions(1 TO NextSlot + 99) AS STRING @@ -3460,7 +3460,7 @@ FUNCTION __UI_NewControl (ControlType AS INTEGER, ControlName AS STRING, NewWidt Control(NextSlot).Font = Control(ParentID).Font END IF - IF Control(NextSlot).Font = 0 THEN Control(NextSlot).Font = __UI_Font("", 8, "") + IF Control(NextSlot).Font = 0 THEN Control(NextSlot).Font = SetFont("", 8, "") Control(NextSlot).Width = NewWidth Control(NextSlot).Height = NewHeight @@ -3489,8 +3489,8 @@ FUNCTION __UI_NewControl (ControlType AS INTEGER, ControlName AS STRING, NewWidt _FREEIMAGE TempCanvas END IF - IF __UI_HasMenuBar = __UI_False THEN - __UI_HasMenuBar = __UI_True + IF __UI_HasMenuBar = False THEN + __UI_HasMenuBar = True 'Add menubar div to main form's canvas IF Control(__UI_FormID).Canvas <> 0 THEN _FREEIMAGE Control(__UI_FormID).Canvas Control(__UI_FormID).Canvas = _NEWIMAGE(Control(__UI_FormID).Width, Control(__UI_FormID).Height, 32) @@ -3498,14 +3498,14 @@ FUNCTION __UI_NewControl (ControlType AS INTEGER, ControlName AS STRING, NewWidt COLOR Control(__UI_FormID).ForeColor, Control(__UI_FormID).BackColor CLS _FONT Control(__UI_FormID).Font - LINE (0, uspacing& + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), __UI_Darken(Control(__UI_FormID).BackColor, 80) - LINE (0, uspacing& + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), __UI_Darken(Control(__UI_FormID).BackColor, 120) + LINE (0, uspacing& + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 80) + LINE (0, uspacing& + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120) _DEST 0 END IF END IF IF ControlType = __UI_Type_TrackBar OR ControlType = __UI_Type_TextBox OR ControlType = __UI_Type_Button OR ControlType = __UI_Type_CheckBox OR ControlType = __UI_Type_RadioButton OR ControlType = __UI_Type_ListBox OR ControlType = __UI_Type_DropdownList THEN - Control(NextSlot).CanHaveFocus = __UI_True + Control(NextSlot).CanHaveFocus = True END IF IF ControlType = __UI_Type_Frame THEN @@ -3545,12 +3545,12 @@ FUNCTION __UI_NewControl (ControlType AS INTEGER, ControlName AS STRING, NewWidt END IF IF (ControlType = __UI_Type_PictureBox AND __UI_DesignMode) OR ControlType = __UI_Type_TextBox OR ControlType = __UI_Type_Frame OR ControlType = __UI_Type_ListBox OR ControlType = __UI_Type_DropdownList THEN - Control(NextSlot).HasBorder = __UI_True + Control(NextSlot).HasBorder = True END IF IF ControlType = __UI_Type_PictureBox THEN Control(NextSlot).HelperCanvas = _NEWIMAGE(NewWIdth, NewHeight, 32) - Control(NextSlot).Stretch = __UI_True + Control(NextSlot).Stretch = True END IF __UI_NewControl = NextSlot @@ -3560,7 +3560,7 @@ END FUNCTION SUB __UI_DestroyControl (This AS __UI_ControlTYPE) DIM i AS LONG - __UI_AutoRefresh = __UI_False + __UI_AutoRefresh = False IF This.ID > 0 THEN Caption(This.ID) = "" @@ -3612,14 +3612,14 @@ SUB __UI_DestroyControl (This AS __UI_ControlTYPE) IF This.Canvas <> 0 THEN _FREEIMAGE This.Canvas: This.Canvas = 0 IF This.HelperCanvas <> 0 THEN _FREEIMAGE This.HelperCanvas: This.HelperCanvas = 0 This.TransparentColor = 0 - This.Stretch = __UI_False - This.PreviousStretch = __UI_False + This.Stretch = False + This.PreviousStretch = False This.BackColor = 0 This.ForeColor = 0 This.SelectedForeColor = 0 This.SelectedBackColor = 0 This.BackStyle = 0 - This.HasBorder = __UI_False + This.HasBorder = False This.Padding = 0 This.Align = 0 This.BorderColor = 0 @@ -3636,17 +3636,17 @@ SUB __UI_DestroyControl (This AS __UI_ControlTYPE) This.HotKey = 0 This.HotKeyOffset = 0 This.HotKeyPosition = 0 - This.ShowPercentage = __UI_False + This.ShowPercentage = False This.InputViewStart = 0 This.PreviousInputViewStart = 0 This.LastVisibleItem = 0 - This.HasVScrollbar = __UI_False + This.HasVScrollbar = False This.VScrollbarButton2Top = 0 This.HoveringVScrollbarButton = 0 This.ThumbHeight = 0 This.ThumbTop = 0 This.VScrollbarRatio = 0 - 'This.HasHScrollbar = __UI_False + 'This.HasHScrollbar = False 'This.HScrollbarButton2Left = 0 'This.HoveringHScrollbarButton = 0 'This.LongestLine = 0 @@ -3657,34 +3657,34 @@ SUB __UI_DestroyControl (This AS __UI_ControlTYPE) This.PrevCursor = 0 This.FieldArea = 0 This.PreviousFieldArea = 0 - This.TextIsSelected = __UI_False - This.Multiline = __UI_False + This.TextIsSelected = False + This.Multiline = False This.FirstVisibleLine = 0 This.PrevFirstVisibleLine = 0 This.CurrentLine = 0 This.PrevCurrentLine = 0 This.VisibleCursor = 0 This.PrevVisibleCursor = 0 - This.ControlIsSelected = __UI_False + This.ControlIsSelected = False This.SelectionLength = 0 This.SelectionStart = 0 - This.WordWrap = __UI_False + This.WordWrap = False This.CanResize = 0 - This.CanHaveFocus = __UI_False - This.Disabled = __UI_False - This.Hidden = __UI_False - This.CenteredWindow = __UI_False + This.CanHaveFocus = False + This.Disabled = False + This.Hidden = False + This.CenteredWindow = False This.ControlState = 0 - This.ChildrenRedrawn = __UI_False + This.ChildrenRedrawn = False This.FocusState = 0 __UI_HasMenuBar = (__UI_FirstMenuBarControl > 0) - __UI_AutoRefresh = __UI_True + __UI_AutoRefresh = True END SUB '--------------------------------------------------------------------------------- -SUB __UI_SetCaption (Control$, TempCaption$) +SUB SetCaption (Control$, TempCaption$) DIM i AS LONG, FindSep%, ThisID AS LONG, NewCaption$, UsedList$, TempKey AS _UNSIGNED _BYTE DIM PrevFont AS LONG, TempCanvas AS LONG, PrevDest AS LONG @@ -3737,27 +3737,7 @@ SUB __UI_SetCaption (Control$, TempCaption$) END SUB '--------------------------------------------------------------------------------- -SUB __UI_SetText (Control$, NewText$) - DIM ThisID AS LONG - - ThisID = __UI_GetID(Control$) - IF ThisID = 0 THEN EXIT SUB - - Text(ThisID) = NewText$ -END SUB - -'--------------------------------------------------------------------------------- -SUB __UI_SetTip (Control$, NewTip$) - DIM ThisID AS LONG - - ThisID = __UI_GetID(Control$) - IF ThisID = 0 THEN EXIT SUB - - ToolTip(ThisID) = NewTip$ -END SUB - -'--------------------------------------------------------------------------------- -SUB __UI_LoadImage (This AS __UI_ControlTYPE, File$) +SUB LoadImage (This AS __UI_ControlTYPE, File$) DIM PrevDest AS LONG, ErrorMessage$ STATIC NotFoundImage AS LONG @@ -3900,16 +3880,16 @@ FUNCTION __UI_SpecialCharsToCHR$ (Text$) END FUNCTION '--------------------------------------------------------------------------------- -SUB __UI_SetRadioButtonValue (id) +SUB SetRadioButtonValue (id) 'Radio buttons will change value of others in the same group DIM i AS LONG FOR i = 1 TO UBOUND(Control) IF Control(i).Type = __UI_Type_RadioButton AND Control(i).ParentID = Control(id).ParentID THEN - Control(i).Value = __UI_False + Control(i).Value = False END IF NEXT - Control(id).Value = __UI_True + Control(id).Value = True END SUB '--------------------------------------------------------------------------------- @@ -3917,11 +3897,11 @@ SUB __UI_CheckSelection (id) IF NOT Control(id).Multiline THEN IF __UI_ShiftIsDown THEN IF NOT Control(id).TextIsSelected THEN - Control(id).TextIsSelected = __UI_True + Control(id).TextIsSelected = True Control(id).SelectionStart = Control(id).Cursor END IF ELSE - Control(id).TextIsSelected = __UI_False + Control(id).TextIsSelected = False __UI_SelectedText = "" __UI_SelectionLength = 0 END IF @@ -3937,7 +3917,7 @@ SUB __UI_DeleteSelection s2 = Control(__UI_Focus).Cursor IF s1 > s2 THEN SWAP s1, s2 Text(__UI_Focus) = LEFT$(Text(__UI_Focus), s1) + MID$(Text(__UI_Focus), s2 + 1) - Control(__UI_Focus).TextIsSelected = __UI_False + Control(__UI_Focus).TextIsSelected = False __UI_SelectedText = "" __UI_SelectionLength = 0 Control(__UI_Focus).Cursor = s1 @@ -3964,7 +3944,7 @@ SUB __UI_CursorAdjustments END SUB '--------------------------------------------------------------------------------- -FUNCTION __UI_ReplaceText$ (TempText$, SubString$, NewString$, CaseSensitive AS _BYTE, TotalReplacements AS LONG) +FUNCTION Replace$ (TempText$, SubString$, NewString$, CaseSensitive AS _BYTE, TotalReplacements AS LONG) DIM FindSubString AS LONG, Text$ IF LEN(TempText$) = 0 THEN EXIT SUB @@ -3982,7 +3962,7 @@ FUNCTION __UI_ReplaceText$ (TempText$, SubString$, NewString$, CaseSensitive AS TotalReplacements = TotalReplacements + 1 LOOP - __UI_ReplaceText$ = Text$ + Replace$ = Text$ END FUNCTION '--------------------------------------------------------------------------------- @@ -4063,11 +4043,11 @@ FUNCTION __UI_GetTextBoxLine$ (id AS LONG, LineNumber AS LONG, StartPosition AS END FUNCTION '--------------------------------------------------------------------------------- -SUB __UI_AddListBoxItem (WhichListBox$, Item$) +SUB AddItem (WhichListBox AS LONG, Item$) DIM ThisID AS LONG - ThisID = __UI_GetID(WhichListBox$) - IF Control(ThisID).Type <> __UI_Type_ListBox AND Control(ThisID).Type <> __UI_Type_DropdownList THEN ERROR 5: EXIT SUB + ThisID = WhichListBox + IF Control(ThisID).Type <> __UI_Type_ListBox AND Control(ThisID).Type <> __UI_Type_DropdownList THEN EXIT SUB Text(ThisID) = Text(ThisID) + Item$ + CHR$(13) Control(ThisID).Max = Control(ThisID).Max + 1 @@ -4075,11 +4055,11 @@ SUB __UI_AddListBoxItem (WhichListBox$, Item$) END SUB '--------------------------------------------------------------------------------- -SUB __UI_RemoveListBoxItem (WhichListBox$, ItemToRemove AS INTEGER) +SUB RemoveItem (WhichListBox AS LONG, ItemToRemove AS INTEGER) DIM This AS __UI_ControlTYPE, TempText$, ThisItem%, FindLF&, TempCaption$ - This = Control(__UI_GetID(WhichListBox$)) - IF This.Type <> __UI_Type_ListBox AND This.Type <> __UI_Type_DropdownList THEN ERROR 5: EXIT SUB + This = Control(WhichListBox) + IF This.Type <> __UI_Type_ListBox AND This.Type <> __UI_Type_DropdownList THEN EXIT SUB IF ItemToRemove > This.Max THEN ERROR 6: EXIT SUB @@ -4113,11 +4093,11 @@ SUB __UI_RemoveListBoxItem (WhichListBox$, ItemToRemove AS INTEGER) END SUB '--------------------------------------------------------------------------------- -SUB __UI_ReplaceListBoxItem (WhichListBox$, ItemToReplace AS INTEGER, NewText$) +SUB ReplaceItem (WhichListBox AS LONG, ItemToReplace AS INTEGER, NewText$) DIM This AS __UI_ControlTYPE, TempText$, ThisItem%, FindLF&, TempCaption$ - This = Control(__UI_GetID(WhichListBox$)) - IF This.Type <> __UI_Type_ListBox AND This.Type <> __UI_Type_DropdownList THEN ERROR 5: EXIT SUB + This = Control(WhichListBox) + IF This.Type <> __UI_Type_ListBox AND This.Type <> __UI_Type_DropdownList THEN EXIT SUB IF ItemToReplace > This.Max THEN ERROR 6: EXIT SUB @@ -4145,7 +4125,7 @@ SUB __UI_ReplaceListBoxItem (WhichListBox$, ItemToReplace AS INTEGER, NewText$) END SUB '--------------------------------------------------------------------------------- -FUNCTION __UI_GetListBoxItem$ (id AS LONG, Item AS LONG) +FUNCTION GetItem$ (id AS LONG, Item AS LONG) DIM This AS __UI_ControlTYPE, ThisItem AS LONG, FindLF AS LONG, LastLF AS LONG This = Control(id) @@ -4153,10 +4133,10 @@ FUNCTION __UI_GetListBoxItem$ (id AS LONG, Item AS LONG) FindLF = INSTR(Text(id), CHR$(13)) IF Item = 1 THEN IF FindLF = 0 THEN - __UI_GetListBoxItem$ = Text(id) + GetItem$ = Text(id) EXIT FUNCTION ELSE - __UI_GetListBoxItem$ = LEFT$(Text(id), FindLF - 1) + GetItem$ = LEFT$(Text(id), FindLF - 1) EXIT FUNCTION END IF END IF @@ -4169,12 +4149,12 @@ FUNCTION __UI_GetListBoxItem$ (id AS LONG, Item AS LONG) FindLF = INSTR(LastLF + 1, Text(id), CHR$(13)) IF FindLF > 0 THEN IF ThisItem = Item THEN - __UI_GetListBoxItem$ = MID$(Text(id), LastLF + 1, FindLF - LastLF - 1) + GetItem$ = MID$(Text(id), LastLF + 1, FindLF - LastLF - 1) EXIT FUNCTION END IF ELSE IF ThisItem = Item THEN - __UI_GetListBoxItem$ = MID$(Text(id), LastLF + 1) + GetItem$ = MID$(Text(id), LastLF + 1) END IF EXIT FUNCTION END IF @@ -4230,7 +4210,7 @@ END SUB '--------------------------------------------------------------------------------- SUB __UI_PrintString(Left AS INTEGER, Top AS INTEGER, Text$) REDIM __UI_ThisLineChars(LEN(Text$)) AS LONG - uprint_extra Left, Top, _OFFSET(Text$), LEN(Text$), __UI_True, __UI_True, __UI_LastRenderedLineWidth, _OFFSET(__UI_ThisLineChars()), __UI_LastRenderedCharCount, _DEFAULTCOLOR, 0 + uprint_extra Left, Top, _OFFSET(Text$), LEN(Text$), True, True, __UI_LastRenderedLineWidth, _OFFSET(__UI_ThisLineChars()), __UI_LastRenderedCharCount, _DEFAULTCOLOR, 0 END SUB '--------------------------------------------------------------------------------- @@ -4345,18 +4325,18 @@ FUNCTION __UI_WordWrap$ (PassedText AS STRING, Width AS INTEGER, Lines AS INTEGE END FUNCTION '--------------------------------------------------------------------------------- -FUNCTION __UI_MessageBox& (Message$, Title$, Setup AS LONG) +FUNCTION MessageBox& (Message$, Title$, Setup AS LONG) _DELAY .1 'So the interface can redraw before the messagebox kicks in IF Title$ = "" THEN Title$ = __UI_CurrentTitle $IF WIN THEN - __UI_MessageBox& = __UI_MB(0, Message$ + CHR$(0), Title$ + CHR$(0), Setup) + MessageBox& = __UI_MB(0, Message$ + CHR$(0), Title$ + CHR$(0), Setup + MsgBox_SystemModal + MsgBox_SetForeground) $ELSE IF (Setup AND 4) THEN - __UI_MessageBox& = __UI_MB(0, Message$ + CHR$(0), Title$ + CHR$(0), 4) + MessageBox& = __UI_MB(0, Message$ + CHR$(0), Title$ + CHR$(0), 4) ELSE - __UI_MessageBox& = __UI_MB(0, Message$ + CHR$(0), Title$ + CHR$(0), 0) + MessageBox& = __UI_MB(0, Message$ + CHR$(0), Title$ + CHR$(0), 0) END IF $END IF END FUNCTION @@ -4388,9 +4368,9 @@ SUB __UI_ActivateDropdownlist (This AS __UI_ControlTYPE) Control(__UI_ActiveDropdownList).SelectedForeColor = This.SelectedForeColor Control(__UI_ActiveDropdownList).SelectedBackColor = This.SelectedBackColor Control(__UI_ActiveDropdownList).Font = This.Font - Control(__UI_ActiveDropdownList).HasBorder = __UI_True + Control(__UI_ActiveDropdownList).HasBorder = True Control(__UI_ActiveDropdownList).BorderColor = _RGB32(0, 0, 0) - Control(__UI_ActiveDropdownList).CanHaveFocus = __UI_True + Control(__UI_ActiveDropdownList).CanHaveFocus = True Control(__UI_ActiveDropdownList).InputViewStart = 1 Control(__UI_ActiveDropdownList).LastVisibleItem = MaxVisible __UI_Focus = __UI_ActiveDropdownList @@ -4420,11 +4400,11 @@ SUB __UI_ActivateMenu (This AS __UI_ControlTYPE, SelectFirstItem AS _BYTE) IF This.Type = __UI_Type_MenuBar THEN Control(__UI_ActiveMenu).Left = This.Left Control(__UI_ActiveMenu).Top = uspacing& + 3 - __UI_ActiveMenuIsContextMenu = __UI_False + __UI_ActiveMenuIsContextMenu = False ELSEIF This.Type = __UI_Type_ContextMenu THEN Control(__UI_ActiveMenu).Left = __UI_MouseLeft Control(__UI_ActiveMenu).Top = __UI_MouseTop - __UI_ActiveMenuIsContextMenu = __UI_True + __UI_ActiveMenuIsContextMenu = True END IF 'Calculate panel's width and position the menu items diff --git a/UiEditor.bas b/UiEditor.bas index fb70116..7571e11 100644 --- a/UiEditor.bas +++ b/UiEditor.bas @@ -37,6 +37,27 @@ REDIM SHARED PreviewParentIDS(0) AS STRING DIM SHARED FontList.Names AS STRING REDIM SHARED FontList.FileNames(0) AS STRING +$IF WIN THEN + CONST PathSep$ = "\" +$ELSE + CONST PathSep$ = "/" +$END IF + +DIM SHARED CurrentPath$ +DIM SHARED DialogBG AS LONG +DIM SHARED OpenDialog AS LONG +DIM SHARED OpenFrame AS LONG +DIM SHARED FileNameLB AS LONG +DIM SHARED FileNameTextBox AS LONG +DIM SHARED PathLB AS LONG +DIM SHARED FilesLB AS LONG +DIM SHARED FileList AS LONG +DIM SHARED PathsLB AS LONG +DIM SHARED DirList AS LONG +DIM SHARED OpenBT AS LONG +DIM SHARED CancelBT AS LONG +DIM SHARED ShowOnlyFrmbinFilesCB AS LONG + CheckPreviewTimer = _FREETIMER ON TIMER(CheckPreviewTimer, .003) CheckPreview @@ -124,6 +145,7 @@ $END IF 'Event procedures: --------------------------------------------------------------- SUB __UI_Click (id AS LONG) DIM Answer AS _BYTE, Dummy AS LONG, b$, UiEditorFile AS INTEGER + STATIC LastClick#, LastClickedID AS LONG SELECT EVERYCASE UCASE$(RTRIM$(Control(id).Name)) CASE "ALIGNMENUALIGNLEFT": Dummy = 201 @@ -151,14 +173,14 @@ SUB __UI_Click (id AS LONG) b$ = MKI$(__UI_Type_MenuBar) PUT #UiEditorFile, OffsetNewControl, b$ CLOSE #UiEditorFile - Edited = __UI_True + Edited = True CASE "INSERTMENUMENUITEM" UiEditorFile = FREEFILE OPEN "UiEditor.dat" FOR BINARY AS #UiEditorFile b$ = MKI$(__UI_Type_MenuItem) PUT #UiEditorFile, OffsetNewControl, b$ CLOSE #UiEditorFile - Edited = __UI_True + Edited = True CASE "VIEWMENUPREVIEWDETACH" PreviewAttached = NOT PreviewAttached Control(id).Value = PreviewAttached @@ -181,7 +203,7 @@ SUB __UI_Click (id AS LONG) b$ = MKI$(Dummy) PUT #UiEditorFile, OffsetNewControl, b$ CLOSE #UiEditorFile - Edited = __UI_True + Edited = True CASE "STRETCH" b$ = MKI$(Control(id).Value) SendData b$, 14 @@ -224,9 +246,9 @@ SUB __UI_Click (id AS LONG) END IF NEXT IF LEN(Temp$) THEN - Answer = __UI_MessageBox(Temp$, "Loaded fonts", __UI_MsgBox_OkOnly + __UI_MsgBox_Information) + Answer = MessageBox(Temp$, "Loaded fonts", MsgBox_OkOnly + MsgBox_Information) ELSE - Answer = __UI_MessageBox("There are no fonts loaded.", "", __UI_MsgBox_OkOnly + __UI_MsgBox_Critical) + Answer = MessageBox("There are no fonts loaded.", "", MsgBox_OkOnly + MsgBox_Critical) END IF CASE "FILEMENULOAD" DIM a$, i AS LONG, __UI_EOF AS _BYTE @@ -234,10 +256,10 @@ SUB __UI_Click (id AS LONG) DIM NewLeft AS INTEGER, NewTop AS INTEGER, NewName AS STRING DIM NewParentID AS STRING, FloatValue AS _FLOAT - CONST LogFileLoad = __UI_False + CONST LogFileLoad = False IF _FILEEXISTS("form.frmbin") = 0 THEN - Answer = __UI_MessageBox("File form.frmbin not found.", "", __UI_MsgBox_OkOnly + __UI_MsgBox_Critical) + Answer = MessageBox("File form.frmbin not found.", "", MsgBox_OkOnly + MsgBox_Critical) ELSE OPEN "form.frmbin" FOR BINARY AS #1 IF LogFileLoad THEN OPEN "ui_log.txt" FOR OUTPUT AS #2 @@ -247,7 +269,7 @@ SUB __UI_Click (id AS LONG) EXIT SUB END IF IF LogFileLoad THEN PRINT #2, "FOUND INFORM+1" - __UI_AutoRefresh = __UI_False + __UI_AutoRefresh = False FOR i = 1 TO UBOUND(Control) __UI_DestroyControl Control(i) NEXT @@ -314,11 +336,11 @@ SUB __UI_Click (id AS LONG) GET #1, , b$ Text(Dummy) = b$ IF Control(Dummy).Type = __UI_Type_PictureBox OR Control(Dummy).Type = __UI_Type_Button THEN - __UI_LoadImage Control(Dummy), Text(Dummy) + LoadImage Control(Dummy), Text(Dummy) END IF IF LogFileLoad THEN PRINT #2, "TEXT:" + Text(Dummy) CASE -4 'Stretch - Control(Dummy).Stretch = __UI_True + Control(Dummy).Stretch = True IF LogFileLoad THEN PRINT #2, "STRETCH" CASE -5 'Font IF LogFileLoad THEN PRINT #2, "FONT:"; @@ -337,7 +359,7 @@ SUB __UI_Click (id AS LONG) NewFontAttributes = FontSetup$ - Control(Dummy).Font = __UI_Font(NewFontFile, NewFontSize, NewFontAttributes) + Control(Dummy).Font = SetFont(NewFontFile, NewFontSize, NewFontAttributes) CASE -6 'ForeColor b$ = SPACE$(4): GET #1, , b$ Control(Dummy).ForeColor = _CV(_UNSIGNED LONG, b$) @@ -362,7 +384,7 @@ SUB __UI_Click (id AS LONG) Control(Dummy).BackStyle = __UI_Transparent IF LogFileLoad THEN PRINT #2, "BACKSTYLE:TRANSPARENT" CASE -12 - Control(Dummy).HasBorder = __UI_True + Control(Dummy).HasBorder = True IF LogFileLoad THEN PRINT #2, "HASBORDER" CASE -13 b$ = SPACE$(1): GET #1, , b$ @@ -389,19 +411,19 @@ SUB __UI_Click (id AS LONG) Control(Dummy).HotKeyOffset = CVI(b$) IF LogFileLoad THEN PRINT #2, "HOTKEYOFFSET="; Control(Dummy).HotKeyOffset CASE -19 - Control(Dummy).ShowPercentage = __UI_True + Control(Dummy).ShowPercentage = True IF LogFileLoad THEN PRINT #2, "SHOWPERCENTAGE" CASE -20 - Control(Dummy).CanHaveFocus = __UI_True + Control(Dummy).CanHaveFocus = True IF LogFileLoad THEN PRINT #2, "CANHAVEFOCUS" CASE -21 - Control(Dummy).Disabled = __UI_True + Control(Dummy).Disabled = True IF LogFileLoad THEN PRINT #2, "DISABLED" CASE -22 - Control(Dummy).Hidden = __UI_True + Control(Dummy).Hidden = True IF LogFileLoad THEN PRINT #2, "HIDDEN" CASE -23 - Control(Dummy).CenteredWindow = __UI_True + Control(Dummy).CenteredWindow = True IF LogFileLoad THEN PRINT #2, "CENTEREDWINDOW" CASE -24 'Tips b$ = SPACE$(4): GET #1, , b$ @@ -420,7 +442,7 @@ SUB __UI_Click (id AS LONG) Control(Dummy).Interval = _CV(_FLOAT, b$) IF LogFileLoad THEN PRINT #2, "INTERVAL="; Control(Dummy).Interval CASE -27 - Control(Dummy).WordWrap = __UI_True + Control(Dummy).WordWrap = True IF LogFileLoad THEN PRINT #2, "WORDWRAP" CASE -28 b$ = SPACE$(4): GET #1, , b$ @@ -428,14 +450,14 @@ SUB __UI_Click (id AS LONG) IF LogFileLoad THEN PRINT #2, "TRANSPARENTCOLOR" __UI_ClearColor Control(Dummy).HelperCanvas, Control(Dummy).TransparentColor, -1 CASE -29 - Control(Dummy).CanResize = __UI_True + Control(Dummy).CanResize = True IF LogFileLoad THEN PRINT #2, "CANRESIZE" CASE -1 'new control IF LogFileLoad THEN PRINT #2, "READ NEW CONTROL:-1" EXIT DO CASE -1024 IF LogFileLoad THEN PRINT #2, "READ END OF FILE:-1024" - __UI_EOF = __UI_True + __UI_EOF = True EXIT DO CASE ELSE IF LogFileLoad THEN PRINT #2, "UNKNOWN DATA="; CVI(b$) @@ -445,32 +467,169 @@ SUB __UI_Click (id AS LONG) LOOP UNTIL __UI_EOF CLOSE #1 IF LogFileLoad THEN CLOSE #2 - __UI_AutoRefresh = __UI_True + __UI_AutoRefresh = True EXIT SUB LoadError: - __UI_AutoRefresh = __UI_True - Answer = __UI_MessageBox("File form.frmbin is not valid.", "", __UI_MsgBox_OkOnly + __UI_MsgBox_Critical) + __UI_AutoRefresh = True + Answer = MessageBox("File form.frmbin is not valid.", "", MsgBox_OkOnly + MsgBox_Critical) CLOSE #1 END IF CASE "FILEMENUNEW" + IF Edited THEN + Answer = MessageBox("Save the current form?", "", MsgBox_YesNoCancel + MsgBox_Question) + IF Answer = MsgBox_Cancel THEN + EXIT SUB + ELSEIF Answer = MsgBox_Yes THEN + SaveForm False + END IF + END IF + + 'Kill the preview (send PID = 0) + UiEditorFile = FREEFILE + OPEN "UiEditor.dat" FOR BINARY AS #UiEditorFile + b$ = MKL$(0) + PUT #UiEditorFile, OffsetEditorPID, b$ + CLOSE #UiEditorFile + _DELAY .1 + + KILL "UiEditorPreview.frmbin" + KILL "UiEditor.dat" + + $IF WIN THEN + SHELL _DONTWAIT "UiEditorPreview.exe" + $ELSE + SHELL _DONTWAIT "./UiEditorPreview" + $END IF + + UiEditorFile = FREEFILE + OPEN "UiEditor.dat" FOR BINARY AS #UiEditorFile + b$ = MKL$(__UI_GetPID) + PUT #UiEditorFile, OffsetEditorPID, b$ + CLOSE #UiEditorFile + + __UI_ForceRedraw = True CASE "FILEMENUSAVE" - SaveForm __UI_True + SaveForm True CASE "HELPMENUABOUT" - Answer = __UI_MessageBox("InForm Designer" + CHR$(10) + "by Fellippe Heitor" + CHR$(10) + CHR$(10) + "Twitter: @fellippeheitor" + CHR$(10) + "e-mail: fellippe@qb64.org", "About", __UI_MsgBox_OkOnly + __UI_MsgBox_Information) + Answer = MessageBox("InForm Designer" + CHR$(10) + "by Fellippe Heitor" + CHR$(10) + CHR$(10) + "Twitter: @fellippeheitor" + CHR$(10) + "e-mail: fellippe@qb64.org", "About", MsgBox_OkOnly + MsgBox_Information) CASE "HELPMENUHELP" - Answer = __UI_MessageBox("Design a form and export the resulting code to generate an event-driven QB64 program.", "What's all this?", __UI_MsgBox_OkOnly + __UI_MsgBox_Information) + Answer = MessageBox("Design a form and export the resulting code to generate an event-driven QB64 program.", "What's all this?", MsgBox_OkOnly + MsgBox_Information) CASE "FILEMENUEXIT" IF Edited THEN - Answer = __UI_MessageBox("Save the current form before leaving?", "", __UI_MsgBox_YesNoCancel + __UI_MsgBox_Question) - IF Answer = __UI_MsgBox_Cancel THEN + Answer = MessageBox("Save the current form before leaving?", "", MsgBox_YesNoCancel + MsgBox_Question) + IF Answer = MsgBox_Cancel THEN EXIT SUB - ELSEIF Answer = __UI_MsgBox_Yes THEN - SaveForm __UI_False + ELSEIF Answer = MsgBox_Yes THEN + SaveForm False END IF END IF SYSTEM + CASE "FILEMENUOPEN" + IF Edited THEN + Answer = MessageBox("Save the current form?", "", MsgBox_YesNoCancel + MsgBox_Question) + IF Answer = MsgBox_Cancel THEN + EXIT SUB + ELSEIF Answer = MsgBox_Yes THEN + SaveForm False + END IF + END IF + + 'Hide the preview + SendSignal -2 + + 'Refresh the file list control's contents + DIM TotalFiles% + CurrentPath$ = _CWD$ + Text(FileList) = idezfilelist$(CurrentPath$, 0, TotalFiles%) + Control(FileList).Max = TotalFiles% + Control(FileList).LastVisibleItem = 0 'Reset it so it's recalculated + + Control(DialogBG).Left = 0: Control(DialogBG).Top = 0 + Control(OpenFrame).Left = 68: Control(OpenFrame).Top = 70 + + __UI_ForceRedraw = True + CASE "CANCELBT" + Text(FileNameTextBox) = "" + Control(DialogBG).Left = -500: Control(DialogBG).Top = -600 + Control(OpenFrame).Left = -500: Control(OpenFrame).Top = -600 + + 'Show the preview + SendSignal -3 + + __UI_ForceRedraw = True + CASE "OPENBT" + OpenFile: + DIM FileToOpen$, FreeFileNum AS INTEGER + FileToOpen$ = CurrentPath$ + PathSep$ + Text(FileNameTextBox) + IF _FILEEXISTS(FileToOpen$) THEN + 'Kill the preview (send PID = 0) + UiEditorFile = FREEFILE + OPEN "UiEditor.dat" FOR BINARY AS #UiEditorFile + b$ = MKL$(0) + PUT #UiEditorFile, OffsetEditorPID, b$ + CLOSE #UiEditorFile + _DELAY .1 + + KILL "UiEditorPreview.frmbin" + KILL "UiEditor.dat" + FreeFileNum = FREEFILE + OPEN FileToOpen$ FOR BINARY AS #FreeFileNum + b$ = SPACE$(LOF(FreeFileNum)) + GET #FreeFileNum, 1, b$ + CLOSE #FreeFileNum + + OPEN "UiEditorPreview.frmbin" FOR BINARY AS #FreeFileNum + PUT #FreeFileNum, 1, b$ + CLOSE #FreeFileNum + + $IF WIN THEN + SHELL _DONTWAIT "UiEditorPreview.exe" + $ELSE + SHELL _DONTWAIT "./UiEditorPreview" + $END IF + + UiEditorFile = FREEFILE + OPEN "UiEditor.dat" FOR BINARY AS #UiEditorFile + b$ = MKL$(__UI_GetPID) + PUT #UiEditorFile, OffsetEditorPID, b$ + CLOSE #UiEditorFile + + Control(DialogBG).Left = -500: Control(DialogBG).Top = -600 + Control(OpenFrame).Left = -500: Control(OpenFrame).Top = -600 + ELSE + Answer = MessageBox("File not found.", "", MsgBox_OkOnly + MsgBox_Critical) + END IF + CASE "FILELIST" + Text(FileNameTextBox) = GetItem(FileList, Control(FileList).Value) + IF Control(FileList).HoveringVScrollbarButton = 0 AND LastClickedID = id AND TIMER - LastClick# < .3 THEN 'Double click + GOTO OpenFile + END IF + CASE "DIRLIST" + Text(FileNameTextBox) = GetItem(DirList, Control(DirList).Value) + IF LastClickedID = id AND TIMER - LastClick# < .3 THEN 'Double click + CurrentPath$ = idezchangepath(CurrentPath$, Text(FileNameTextBox)) + Caption(PathLB) = "Path: " + CurrentPath$ + Text(DirList) = idezpathlist$(CurrentPath$, TotalFiles%) + Control(DirList).Max = TotalFiles% + Control(DirList).LastVisibleItem = 0 'Reset it so it's recalculated + GOTO ReloadList + END IF + CASE "SHOWONLYFRMBINFILESCB" + ReloadList: + IF Control(ShowOnlyFrmbinFilesCB).Value THEN + Text(FileList) = idezfilelist$(CurrentPath$, 0, TotalFiles%) + Control(FileList).Max = TotalFiles% + Control(FileList).LastVisibleItem = 0 'Reset it so it's recalculated + ELSE + Text(FileList) = idezfilelist$(CurrentPath$, 1, TotalFiles%) + Control(FileList).Max = TotalFiles% + Control(FileList).LastVisibleItem = 0 'Reset it so it's recalculated + END IF END SELECT + + LastClickedID = id + LastClick# = TIMER END SUB SUB __UI_MouseEnter (id AS LONG) @@ -506,7 +665,7 @@ SUB __UI_BeforeUpdateDisplay STATIC MidRead AS _BYTE, PrevFirstSelected AS LONG IF NOT MidRead THEN - MidRead = __UI_True + MidRead = True UiEditorFile = FREEFILE OPEN "UiEditor.dat" FOR BINARY AS #UiEditorFile @@ -529,18 +688,19 @@ SUB __UI_BeforeUpdateDisplay b$ = MKI$(AutoNameControls) PUT #UiEditorFile, OffsetAutoName, b$ - 'Controls in the editor lose focus when the preview is manipulated b$ = SPACE$(2): GET #UiEditorFile, OffsetNewDataFromPreview, b$ IF CVI(b$) = -1 OR CVI(b$) = -3 THEN - IF CVI(b$) = -1 THEN Edited = __UI_True + 'Controls in the editor lose focus when the preview is manipulated + IF CVI(b$) = -1 THEN Edited = True + IF __UI_ActiveDropdownList > 0 THEN __UI_DestroyControl Control(__UI_ActiveDropdownList) IF __UI_ActiveMenu = 0 THEN __UI_Focus = 0 b$ = MKI$(0): PUT #UiEditorFile, OffsetNewDataFromPreview, b$ ELSEIF CVI(b$) = -2 THEN 'User attempted to right-click a control but the preview 'form is smaller than the menu panel. In such case the "Align" 'menu is shown in the editor. - __UI_ActivateMenu Control(__UI_GetID("AlignMenu")), __UI_False - __UI_ForceRedraw = __UI_True + __UI_ActivateMenu Control(__UI_GetID("AlignMenu")), False + __UI_ForceRedraw = True b$ = MKI$(0): PUT #UiEditorFile, OffsetNewDataFromPreview, b$ END IF @@ -552,13 +712,14 @@ SUB __UI_BeforeUpdateDisplay FirstSelected = CVL(b$) IF PrevFirstSelected <> FirstSelected THEN PrevFirstSelected = FirstSelected - __UI_ForceRedraw = __UI_True + __UI_ForceRedraw = True END IF b$ = SPACE$(2): GET #UiEditorFile, OffsetMenuPanelIsON, b$ PreviewHasMenuActive = CVI(b$) IF LEN(RTRIM$(__UI_TrimAt0$(PreviewControls(PreviewFormID).Name))) > 0 THEN - Caption(__UI_FormID) = UiEditorTitle$ + " - " + RTRIM$(PreviewControls(PreviewFormID).Name) + ".frm" + Caption(__UI_FormID) = UiEditorTitle$ + " - " + RTRIM$(PreviewControls(PreviewFormID).Name) + ".frmbin" + SetCaption "FileMenuSave", "&Save '" + RTRIM$(PreviewControls(PreviewFormID).Name) + ".frmbin'" END IF IF Edited THEN @@ -568,75 +729,75 @@ SUB __UI_BeforeUpdateDisplay SelectedProperty = Control(__UI_GetID("PropertiesList")).Value IF PreviewHasMenuActive THEN - Control(__UI_GetID("InsertMenuMenuItem")).Disabled = __UI_False + Control(__UI_GetID("InsertMenuMenuItem")).Disabled = False ELSE - Control(__UI_GetID("InsertMenuMenuItem")).Disabled = __UI_True + Control(__UI_GetID("InsertMenuMenuItem")).Disabled = True END IF IF TotalSelected = 0 THEN - __UI_SetCaption "PropertiesFrame", "Control properties: " + RTRIM$(PreviewControls(PreviewFormID).Name) + SetCaption "PropertiesFrame", "Control properties: " + RTRIM$(PreviewControls(PreviewFormID).Name) FirstSelected = PreviewFormID - Control(__UI_GetID("AlignMenuAlignLeft")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuAlignRight")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuAlignTops")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuAlignBottoms")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuAlignCenterV")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuAlignCenterH")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuAlignCentersV")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuAlignCentersH")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuDistributeV")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuDistributeH")).Disabled = __UI_True + Control(__UI_GetID("AlignMenuAlignLeft")).Disabled = True + Control(__UI_GetID("AlignMenuAlignRight")).Disabled = True + Control(__UI_GetID("AlignMenuAlignTops")).Disabled = True + Control(__UI_GetID("AlignMenuAlignBottoms")).Disabled = True + Control(__UI_GetID("AlignMenuAlignCenterV")).Disabled = True + Control(__UI_GetID("AlignMenuAlignCenterH")).Disabled = True + Control(__UI_GetID("AlignMenuAlignCentersV")).Disabled = True + Control(__UI_GetID("AlignMenuAlignCentersH")).Disabled = True + Control(__UI_GetID("AlignMenuDistributeV")).Disabled = True + Control(__UI_GetID("AlignMenuDistributeH")).Disabled = True ELSEIF TotalSelected = 1 THEN IF FirstSelected > 0 AND FirstSelected <= UBOUND(PreviewControls) THEN - __UI_SetCaption "PropertiesFrame", "Control properties: " + RTRIM$(PreviewControls(FirstSelected).Name) + SetCaption "PropertiesFrame", "Control properties: " + RTRIM$(PreviewControls(FirstSelected).Name) - Control(__UI_GetID("AlignMenuAlignLeft")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuAlignRight")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuAlignTops")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuAlignBottoms")).Disabled = __UI_True + Control(__UI_GetID("AlignMenuAlignLeft")).Disabled = True + Control(__UI_GetID("AlignMenuAlignRight")).Disabled = True + Control(__UI_GetID("AlignMenuAlignTops")).Disabled = True + Control(__UI_GetID("AlignMenuAlignBottoms")).Disabled = True IF PreviewControls(FirstSelected).Type <> __UI_Type_MenuBar AND PreviewControls(FirstSelected).Type <> __UI_Type_MenuItem THEN - Control(__UI_GetID("AlignMenuAlignCenterV")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignCenterH")).Disabled = __UI_False + Control(__UI_GetID("AlignMenuAlignCenterV")).Disabled = False + Control(__UI_GetID("AlignMenuAlignCenterH")).Disabled = False ELSE - Control(__UI_GetID("AlignMenuAlignCenterV")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuAlignCenterH")).Disabled = __UI_True + Control(__UI_GetID("AlignMenuAlignCenterV")).Disabled = True + Control(__UI_GetID("AlignMenuAlignCenterH")).Disabled = True END IF - Control(__UI_GetID("AlignMenuAlignCentersV")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuAlignCentersH")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuDistributeV")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuDistributeH")).Disabled = __UI_True + Control(__UI_GetID("AlignMenuAlignCentersV")).Disabled = True + Control(__UI_GetID("AlignMenuAlignCentersH")).Disabled = True + Control(__UI_GetID("AlignMenuDistributeV")).Disabled = True + Control(__UI_GetID("AlignMenuDistributeH")).Disabled = True END IF ELSEIF TotalSelected = 2 THEN - __UI_SetCaption "PropertiesFrame", "Control properties: (multiple selection)" + SetCaption "PropertiesFrame", "Control properties: (multiple selection)" - Control(__UI_GetID("AlignMenuAlignLeft")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignRight")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignTops")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignBottoms")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignCenterV")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignCenterH")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignCentersV")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignCentersH")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuDistributeV")).Disabled = __UI_True - Control(__UI_GetID("AlignMenuDistributeH")).Disabled = __UI_True + Control(__UI_GetID("AlignMenuAlignLeft")).Disabled = False + Control(__UI_GetID("AlignMenuAlignRight")).Disabled = False + Control(__UI_GetID("AlignMenuAlignTops")).Disabled = False + Control(__UI_GetID("AlignMenuAlignBottoms")).Disabled = False + Control(__UI_GetID("AlignMenuAlignCenterV")).Disabled = False + Control(__UI_GetID("AlignMenuAlignCenterH")).Disabled = False + Control(__UI_GetID("AlignMenuAlignCentersV")).Disabled = False + Control(__UI_GetID("AlignMenuAlignCentersH")).Disabled = False + Control(__UI_GetID("AlignMenuDistributeV")).Disabled = True + Control(__UI_GetID("AlignMenuDistributeH")).Disabled = True ELSE - __UI_SetCaption "PropertiesFrame", "Control properties: (multiple selection)" + SetCaption "PropertiesFrame", "Control properties: (multiple selection)" - Control(__UI_GetID("AlignMenuAlignLeft")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignRight")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignTops")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignBottoms")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignCenterV")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignCenterH")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignCentersV")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuAlignCentersH")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuDistributeV")).Disabled = __UI_False - Control(__UI_GetID("AlignMenuDistributeH")).Disabled = __UI_False + Control(__UI_GetID("AlignMenuAlignLeft")).Disabled = False + Control(__UI_GetID("AlignMenuAlignRight")).Disabled = False + Control(__UI_GetID("AlignMenuAlignTops")).Disabled = False + Control(__UI_GetID("AlignMenuAlignBottoms")).Disabled = False + Control(__UI_GetID("AlignMenuAlignCenterV")).Disabled = False + Control(__UI_GetID("AlignMenuAlignCenterH")).Disabled = False + Control(__UI_GetID("AlignMenuAlignCentersV")).Disabled = False + Control(__UI_GetID("AlignMenuAlignCentersH")).Disabled = False + Control(__UI_GetID("AlignMenuDistributeV")).Disabled = False + Control(__UI_GetID("AlignMenuDistributeH")).Disabled = False END IF @@ -650,7 +811,7 @@ SUB __UI_BeforeUpdateDisplay Text(PropertyValueID) = __UI_TrimAt0$(PreviewCaptions(FirstSelected)) CASE 3 'Text IF PreviewControls(FirstSelected).Type = __UI_Type_ListBox OR PreviewControls(FirstSelected).Type = __UI_Type_DropdownList THEN - Text(PropertyValueID) = __UI_ReplaceText(PreviewTexts(FirstSelected), CHR$(13), "\n", __UI_False, 0) + Text(PropertyValueID) = Replace(PreviewTexts(FirstSelected), CHR$(13), "\n", False, 0) ELSE Text(PropertyValueID) = PreviewTexts(FirstSelected) END IF @@ -681,61 +842,61 @@ SUB __UI_BeforeUpdateDisplay CASE 14 'Padding Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Padding)) END SELECT - Control(PropertyUpdateStatusID).Hidden = __UI_True + Control(PropertyUpdateStatusID).Hidden = True ELSE __UI_CursorAdjustments DIM PropertyAccept AS _BYTE SELECT CASE SelectedProperty CASE 1 'Name - IF LCASE$(Text(PropertyValueID)) = LCASE$(RTRIM$(PreviewControls(FirstSelected).Name)) THEN PropertyAccept = __UI_True + IF LCASE$(Text(PropertyValueID)) = LCASE$(RTRIM$(PreviewControls(FirstSelected).Name)) THEN PropertyAccept = True CASE 2 'Caption - IF Text(PropertyValueID) = PreviewCaptions(FirstSelected) THEN PropertyAccept = __UI_True + IF Text(PropertyValueID) = PreviewCaptions(FirstSelected) THEN PropertyAccept = True CASE 3 'Text IF PreviewControls(FirstSelected).Type = __UI_Type_ListBox OR PreviewControls(FirstSelected).Type = __UI_Type_DropdownList THEN - IF __UI_ReplaceText(Text(PropertyValueID), "\n", CHR$(13), __UI_False, 0) = PreviewTexts(FirstSelected) THEN PropertyAccept = __UI_True + IF Replace(Text(PropertyValueID), "\n", CHR$(13), False, 0) = PreviewTexts(FirstSelected) THEN PropertyAccept = True ELSE - IF Text(PropertyValueID) = PreviewTexts(FirstSelected) THEN PropertyAccept = __UI_True + IF Text(PropertyValueID) = PreviewTexts(FirstSelected) THEN PropertyAccept = True END IF CASE 4 'Top - IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Top)) THEN PropertyAccept = __UI_True + IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Top)) THEN PropertyAccept = True CASE 5 'Left - IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Left)) THEN PropertyAccept = __UI_True + IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Left)) THEN PropertyAccept = True CASE 6 'Width - IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Width)) THEN PropertyAccept = __UI_True + IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Width)) THEN PropertyAccept = True CASE 7 'Height - IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Height)) THEN PropertyAccept = __UI_True + IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Height)) THEN PropertyAccept = True CASE 8 'Font IF LEN(PreviewFonts(FirstSelected)) > 0 THEN - IF LCASE$(Text(PropertyValueID)) = LCASE$(PreviewFonts(FirstSelected)) THEN PropertyAccept = __UI_True + IF LCASE$(Text(PropertyValueID)) = LCASE$(PreviewFonts(FirstSelected)) THEN PropertyAccept = True ELSE - IF LCASE$(Text(PropertyValueID)) = LCASE$(PreviewFonts(PreviewFormID)) THEN PropertyAccept = __UI_True + IF LCASE$(Text(PropertyValueID)) = LCASE$(PreviewFonts(PreviewFormID)) THEN PropertyAccept = True END IF CASE 9 'Tooltip - IF Text(PropertyValueID) = PreviewTips(FirstSelected) THEN PropertyAccept = __UI_True + IF Text(PropertyValueID) = PreviewTips(FirstSelected) THEN PropertyAccept = True CASE 10 'Value - IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Value)) THEN PropertyAccept = __UI_True + IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Value)) THEN PropertyAccept = True CASE 11 'Min - IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Min)) THEN PropertyAccept = __UI_True + IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Min)) THEN PropertyAccept = True CASE 12 'Max - IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Max)) THEN PropertyAccept = __UI_True + IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Max)) THEN PropertyAccept = True CASE 13 'Interval - IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Interval)) THEN PropertyAccept = __UI_True + IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Interval)) THEN PropertyAccept = True CASE 14 'Padding - IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Padding)) THEN PropertyAccept = __UI_True + IF Text(PropertyValueID) = LTRIM$(STR$(PreviewControls(FirstSelected).Padding)) THEN PropertyAccept = True END SELECT - Control(PropertyUpdateStatusID).Hidden = __UI_False + Control(PropertyUpdateStatusID).Hidden = False _DEST Control(PropertyUpdateStatusID).HelperCanvas CLS , _RGBA32(0, 0, 0, 0) IF PropertyAccept AND LEN(RTRIM$(Text(PropertyValueID))) > 0 THEN _PUTIMAGE (0, 0), PropertyUpdateStatusImage, , (0, 0)-STEP(15, 15) - __UI_SetTip "PropertyUpdateStatus", "The property value entered was accepted" + ToolTip(__UI_GetID("PropertyUpdateStatus")) = "The property value entered was accepted" ELSEIF LEN(RTRIM$(Text(PropertyValueID))) > 0 THEN IF TIMER - LastKeyPress > .5 THEN _PUTIMAGE (0, 0), PropertyUpdateStatusImage, , (0, 16)-STEP(15, 15) - __UI_SetTip "PropertyUpdateStatus", "Property value not accepted" + ToolTip(__UI_GetID("PropertyUpdateStatus")) = "Property value not accepted" ELSE _PUTIMAGE (0, 0), PropertyUpdateStatusImage, , (0, 32)-STEP(15, 15) - __UI_SetTip "PropertyUpdateStatus", "" + ToolTip(__UI_GetID("PropertyUpdateStatus")) = "" END IF END IF _DEST 0 @@ -760,24 +921,24 @@ SUB __UI_BeforeUpdateDisplay Control(__UI_GetID("Resizable")).Value = PreviewControls(FirstSelected).CanResize 'Disable properties that don't apply - Control(__UI_GetID("Stretch")).Disabled = __UI_True - Control(__UI_GetID("HasBorder")).Disabled = __UI_True - Control(__UI_GetID("ShowPercentage")).Disabled = __UI_True - Control(__UI_GetID("WordWrap")).Disabled = __UI_True - Control(__UI_GetID("CanHaveFocus")).Disabled = __UI_True - Control(__UI_GetID("Disabled")).Disabled = __UI_True - Control(__UI_GetID("Hidden")).Disabled = __UI_True - Control(__UI_GetID("CenteredWindow")).Disabled = __UI_True - Control(__UI_GetID("AlignOptions")).Disabled = __UI_True - Control(BackStyleListID).Disabled = __UI_True - __UI_ReplaceListBoxItem "PropertiesList", 3, "Text" - Control(__UI_GetID("Resizable")).Disabled = __UI_True + Control(__UI_GetID("Stretch")).Disabled = True + Control(__UI_GetID("HasBorder")).Disabled = True + Control(__UI_GetID("ShowPercentage")).Disabled = True + Control(__UI_GetID("WordWrap")).Disabled = True + Control(__UI_GetID("CanHaveFocus")).Disabled = True + Control(__UI_GetID("Disabled")).Disabled = True + Control(__UI_GetID("Hidden")).Disabled = True + Control(__UI_GetID("CenteredWindow")).Disabled = True + Control(__UI_GetID("AlignOptions")).Disabled = True + Control(BackStyleListID).Disabled = True + ReplaceItem __UI_GetID("PropertiesList"), 3, "Text" + Control(__UI_GetID("Resizable")).Disabled = True Caption(PropertyValueID) = "" IF TotalSelected > 0 THEN SELECT EVERYCASE PreviewControls(FirstSelected).Type CASE __UI_Type_MenuBar, __UI_Type_MenuItem - Control(__UI_GetID("Disabled")).Disabled = __UI_False - Control(__UI_GetID("Hidden")).Disabled = __UI_False + Control(__UI_GetID("Disabled")).Disabled = False + Control(__UI_GetID("Hidden")).Disabled = False CASE __UI_Type_MenuBar 'Check if this is the last menu bar item so that Align options can be enabled FOR i = UBOUND(PreviewControls) TO 1 STEP -1 @@ -786,106 +947,107 @@ SUB __UI_BeforeUpdateDisplay END IF NEXT IF i = FirstSelected THEN - Control(__UI_GetID("AlignOptions")).Disabled = __UI_False + Control(__UI_GetID("AlignOptions")).Disabled = False END IF SELECT CASE SelectedProperty CASE 1, 2, 9 - Control(PropertyValueID).Disabled = __UI_False + Control(PropertyValueID).Disabled = False CASE ELSE - Control(PropertyValueID).Disabled = __UI_True + Control(PropertyValueID).Disabled = True END SELECT CASE __UI_Type_MenuItem SELECT CASE SelectedProperty CASE 1, 2, 3, 9, 10 - Control(PropertyValueID).Disabled = __UI_False + Control(PropertyValueID).Disabled = False CASE ELSE - Control(PropertyValueID).Disabled = __UI_True + Control(PropertyValueID).Disabled = True END SELECT CASE __UI_Type_PictureBox - __UI_ReplaceListBoxItem "PropertiesList", 3, "Image file" - Control(__UI_GetID("Stretch")).Disabled = __UI_False - Control(BackStyleListID).Disabled = __UI_False + ReplaceItem __UI_GetID("PropertiesList"), 3, "Image file" + Control(__UI_GetID("Stretch")).Disabled = False + Control(BackStyleListID).Disabled = False SELECT CASE SelectedProperty CASE 1, 3, 4, 5, 6, 7, 9 - Control(PropertyValueID).Disabled = __UI_False + Control(PropertyValueID).Disabled = False CASE ELSE - Control(PropertyValueID).Disabled = __UI_True + Control(PropertyValueID).Disabled = True END SELECT CASE __UI_Type_Frame, __UI_Type_Label - Control(BackStyleListID).Disabled = __UI_False + Control(BackStyleListID).Disabled = False SELECT CASE SelectedProperty CASE 1, 2, 4, 5, 6, 7, 8, 9, 14 - Control(PropertyValueID).Disabled = __UI_False + Control(PropertyValueID).Disabled = False CASE ELSE - Control(PropertyValueID).Disabled = __UI_True + Control(PropertyValueID).Disabled = True END SELECT CASE __UI_Type_TextBox - Control(BackStyleListID).Disabled = __UI_False + Control(BackStyleListID).Disabled = False CASE __UI_Type_Button, __UI_Type_MenuItem - __UI_ReplaceListBoxItem "PropertiesList", 3, "Image file" + ReplaceItem __UI_GetID("PropertiesList"), 3, "Image file" CASE __UI_Type_Button, __UI_Type_TextBox SELECT CASE SelectedProperty CASE 1, 2, 3, 4, 5, 6, 7, 8, 9 - Control(PropertyValueID).Disabled = __UI_False + Control(PropertyValueID).Disabled = False CASE ELSE - Control(PropertyValueID).Disabled = __UI_True + Control(PropertyValueID).Disabled = True END SELECT CASE __UI_Type_CheckBox, __UI_Type_RadioButton - Control(BackStyleListID).Disabled = __UI_False + Control(BackStyleListID).Disabled = False SELECT CASE SelectedProperty CASE 1, 2, 4, 5, 6, 7, 8, 9, 10 - Control(PropertyValueID).Disabled = __UI_False + Control(PropertyValueID).Disabled = False CASE ELSE - Control(PropertyValueID).Disabled = __UI_True + Control(PropertyValueID).Disabled = True END SELECT CASE __UI_Type_ProgressBar SELECT CASE SelectedProperty CASE 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12 - Control(PropertyValueID).Disabled = __UI_False + Control(PropertyValueID).Disabled = False CASE ELSE - Control(PropertyValueID).Disabled = __UI_True + Control(PropertyValueID).Disabled = True END SELECT CASE __UI_Type_TrackBar SELECT CASE SelectedProperty CASE 1, 4, 5, 6, 7, 9, 10, 11, 12, 13 - Control(PropertyValueID).Disabled = __UI_False + Control(PropertyValueID).Disabled = False CASE ELSE - Control(PropertyValueID).Disabled = __UI_True + Control(PropertyValueID).Disabled = True END SELECT CASE __UI_Type_ListBox, __UI_Type_DropdownList - Control(BackStyleListID).Disabled = __UI_False + ReplaceItem __UI_GetID("PropertiesList"), 3, "List items" + Control(BackStyleListID).Disabled = False SELECT CASE SelectedProperty CASE 1, 3, 4, 5, 6, 7, 8, 9, 10, 12 - Control(PropertyValueID).Disabled = __UI_False + Control(PropertyValueID).Disabled = False CASE ELSE - Control(PropertyValueID).Disabled = __UI_True + Control(PropertyValueID).Disabled = True END SELECT CASE __UI_Type_Frame, __UI_Type_Label, __UI_Type_TextBox, __UI_Type_ListBox, __UI_Type_DropdownList, __UI_Type_PictureBox - Control(__UI_GetID("HasBorder")).Disabled = __UI_False + Control(__UI_GetID("HasBorder")).Disabled = False CASE __UI_Type_ProgressBar - Control(__UI_GetID("ShowPercentage")).Disabled = __UI_False + Control(__UI_GetID("ShowPercentage")).Disabled = False CASE __UI_Type_Label - Control(__UI_GetID("WordWrap")).Disabled = __UI_False + Control(__UI_GetID("WordWrap")).Disabled = False CASE __UI_Type_Button, __UI_Type_CheckBox, __UI_Type_RadioButton, __UI_Type_TextBox, __UI_Type_ListBox, __UI_Type_DropdownList, __UI_Type_TrackBar - Control(__UI_GetID("CanHaveFocus")).Disabled = __UI_False + Control(__UI_GetID("CanHaveFocus")).Disabled = False CASE __UI_Type_Button, __UI_Type_CheckBox, __UI_Type_RadioButton, __UI_Type_TextBox, __UI_Type_ListBox, __UI_Type_DropdownList, __UI_Type_TrackBar, __UI_Type_Label, __UI_Type_ProgressBar - Control(__UI_GetID("Disabled")).Disabled = __UI_False + Control(__UI_GetID("Disabled")).Disabled = False CASE __UI_Type_Frame, __UI_Type_Button, __UI_Type_CheckBox, __UI_Type_RadioButton, __UI_Type_TextBox, __UI_Type_ListBox, __UI_Type_DropdownList, __UI_Type_TrackBar, __UI_Type_Label, __UI_Type_ProgressBar, __UI_Type_PictureBox - Control(__UI_GetID("Hidden")).Disabled = __UI_False + Control(__UI_GetID("Hidden")).Disabled = False CASE __UI_Type_Label - Control(__UI_GetID("AlignOptions")).Disabled = __UI_False + Control(__UI_GetID("AlignOptions")).Disabled = False END SELECT ELSE 'Properties relative to the form - Control(__UI_GetID("CenteredWindow")).Disabled = __UI_False - Control(__UI_GetID("Resizable")).Disabled = __UI_False - __UI_ReplaceListBoxItem "PropertiesList", 3, "Icon" + Control(__UI_GetID("CenteredWindow")).Disabled = False + Control(__UI_GetID("Resizable")).Disabled = False + ReplaceItem __UI_GetID("PropertiesList"), 3, "Icon" SELECT CASE SelectedProperty CASE 1, 2, 3, 6, 7, 8 'Name, Caption, Width, Height, Font - Control(PropertyValueID).Disabled = __UI_False + Control(PropertyValueID).Disabled = False CASE ELSE - Control(PropertyValueID).Disabled = __UI_True + Control(PropertyValueID).Disabled = True END SELECT END IF @@ -957,7 +1119,7 @@ SUB __UI_BeforeUpdateDisplay UpdateColorPreview Control(ColorPropertiesListID).Value, ThisColor, ThisBackColor END IF - MidRead = __UI_False + MidRead = False CLOSE #UiEditorFile END IF @@ -966,11 +1128,11 @@ END SUB SUB __UI_BeforeUnload DIM Answer AS _BYTE IF Edited THEN - Answer = __UI_MessageBox("Save the current form before leaving?", "", __UI_MsgBox_YesNoCancel + __UI_MsgBox_Question) - IF Answer = __UI_MsgBox_Cancel THEN - __UI_UnloadSignal = __UI_False - ELSEIF Answer = __UI_MsgBox_Yes THEN - SaveForm __UI_False + Answer = MessageBox("Save the current form before leaving?", "", MsgBox_YesNoCancel + MsgBox_Question) + IF Answer = MsgBox_Cancel THEN + __UI_UnloadSignal = False + ELSEIF Answer = MsgBox_Yes THEN + SaveForm False END IF END IF END SUB @@ -1030,7 +1192,7 @@ SUB __UI_OnLoad _FREEIMAGE CommControls - __UI_ForceRedraw = __UI_True + __UI_ForceRedraw = True 'Read controls' IDs to avoid repeated calls to __UI_GetID later on RedTrackID = __UI_GetID("Red"): RedTextBoxID = __UI_GetID("RedValue") @@ -1044,8 +1206,8 @@ SUB __UI_OnLoad Control(__UI_GetID("PropertiesList")).Value = 2 - PreviewAttached = __UI_True - AutoNameControls = __UI_True + PreviewAttached = True + AutoNameControls = True IF _FILEEXISTS("UiEditorPreview.frmbin") THEN KILL "UiEditorPreview.frmbin" @@ -1113,11 +1275,26 @@ SUB __UI_OnLoad PUT #UiEditorFile, OffsetEditorPID, b$ CLOSE #UiEditorFile + 'Fill "open dialog" listboxes: + '------------------------------------------------- + DIM TotalFiles% + CurrentPath$ = _CWD$ + Text(FileList) = idezfilelist$(CurrentPath$, 0, TotalFiles%) + Control(FileList).Max = TotalFiles% + Control(FileList).LastVisibleItem = 0 'Reset it so it's recalculated + + Text(DirList) = idezpathlist$(CurrentPath$, TotalFiles%) + Control(DirList).Max = TotalFiles% + Control(DirList).LastVisibleItem = 0 'Reset it so it's recalculated + + Caption(PathLB) = "Path: " + CurrentPath$ + '------------------------------------------------- + TIMER(CheckPreviewTimer) ON EXIT SUB UiEditorPreviewNotFound: - i = __UI_MessageBox("UiEditorPreview component not found or failed to load.", "UiEditor", __UI_MsgBox_OkOnly + __UI_MsgBox_Critical) + i = MessageBox("UiEditorPreview component not found or failed to load.", "UiEditor", MsgBox_OkOnly + MsgBox_Critical) SYSTEM ShowMessage: @@ -1173,12 +1350,12 @@ SUB __UI_ValueChanged (id AS LONG) SELECT EVERYCASE UCASE$(RTRIM$(Control(id).Name)) CASE "PROPERTIESLIST" _DELAY .1 'Give the screen update routine time to finish - IF Control(PropertyValueID).Disabled = __UI_False THEN + IF Control(PropertyValueID).Disabled = False THEN __UI_Focus = PropertyValueID IF LEN(Text(__UI_Focus)) > 0 THEN Control(__UI_Focus).Cursor = LEN(Text(__UI_Focus)) Control(__UI_Focus).SelectionStart = 0 - Control(__UI_Focus).TextIsSelected = __UI_True + Control(__UI_Focus).TextIsSelected = True END IF END IF CASE "ALIGNOPTIONS" @@ -1481,7 +1658,7 @@ SUB LoadPreview GET #BinaryFileNum, , b$ PreviewTexts(Dummy) = b$ CASE -4 'Stretch - PreviewControls(Dummy).Stretch = __UI_True + PreviewControls(Dummy).Stretch = True CASE -5 'Font DIM FontSetup$, FindSep AS INTEGER DIM NewFontName AS STRING, NewFontFile AS STRING @@ -1507,7 +1684,7 @@ SUB LoadPreview CASE -11 PreviewControls(Dummy).BackStyle = __UI_Transparent CASE -12 - PreviewControls(Dummy).HasBorder = __UI_True + PreviewControls(Dummy).HasBorder = True CASE -13 b$ = SPACE$(1): GET #BinaryFileNum, , b$ PreviewControls(Dummy).Align = _CV(_BYTE, b$) @@ -1527,15 +1704,15 @@ SUB LoadPreview b$ = SPACE$(2): GET #BinaryFileNum, , b$ PreviewControls(Dummy).HotKeyOffset = CVI(b$) CASE -19 - PreviewControls(Dummy).ShowPercentage = __UI_True + PreviewControls(Dummy).ShowPercentage = True CASE -20 - PreviewControls(Dummy).CanHaveFocus = __UI_True + PreviewControls(Dummy).CanHaveFocus = True CASE -21 - PreviewControls(Dummy).Disabled = __UI_True + PreviewControls(Dummy).Disabled = True CASE -22 - PreviewControls(Dummy).Hidden = __UI_True + PreviewControls(Dummy).Hidden = True CASE -23 - PreviewControls(Dummy).CenteredWindow = __UI_True + PreviewControls(Dummy).CenteredWindow = True CASE -24 'Tips b$ = SPACE$(4): GET #BinaryFileNum, , b$ b$ = SPACE$(CVL(b$)) @@ -1545,9 +1722,9 @@ SUB LoadPreview b$ = SPACE$(LEN(FloatValue)): GET #BinaryFileNum, , b$ PreviewControls(Dummy).Interval = _CV(_FLOAT, b$) CASE -27 - PreviewControls(Dummy).WordWrap = __UI_True + PreviewControls(Dummy).WordWrap = True CASE -29 - PreviewControls(Dummy).CanResize = __UI_True + PreviewControls(Dummy).CanResize = True CASE -30 b$ = SPACE$(2): GET #BinaryFileNum, , b$ PreviewControls(Dummy).HotKeyPosition = CVI(b$) @@ -1557,7 +1734,7 @@ SUB LoadPreview CASE -1 'new control EXIT DO CASE -1024 - __UI_EOF = __UI_True + __UI_EOF = True EXIT DO CASE ELSE EXIT DO @@ -1581,7 +1758,16 @@ SUB SendData (b$, Property AS INTEGER) b$ = MKI$(Property): PUT #FileNum, OffsetPropertyChanged, b$ b$ = MKI$(-1): PUT #FileNum, OffsetNewDataFromEditor, b$ CLOSE #FileNum - Edited = __UI_True + Edited = True +END SUB + +SUB SendSignal (Value AS INTEGER) + DIM FileNum AS INTEGER, b$ + FileNum = FREEFILE + OPEN "UiEditor.dat" FOR BINARY AS #FileNum + + b$ = MKI$(Value): PUT #FileNum, OffsetNewDataFromEditor, b$ + CLOSE #FileNum END SUB SUB UpdateColorPreview (Attribute AS _BYTE, ForeColor AS _UNSIGNED LONG, BackColor AS _UNSIGNED LONG) @@ -1612,6 +1798,8 @@ SUB CheckPreview 'Check if the preview window is still alive DIM b$, UiEditorFile AS INTEGER + IF Control(OpenFrame).Hidden = False THEN EXIT SUB + UiEditorFile = FREEFILE OPEN "UiEditor.dat" FOR BINARY AS #UiEditorFile b$ = SPACE$(4): GET #UiEditorFile, OffsetPreviewPID, b$ @@ -1625,11 +1813,11 @@ SUB CheckPreview c& = CloseHandle(hnd&) IF b& = 1 AND ExitCode& = 259 THEN 'Preview is active. - Control(__UI_GetID("ViewMenuPreview")).Disabled = __UI_True + Control(__UI_GetID("ViewMenuPreview")).Disabled = True ELSE 'Preview was closed. TIMER(__UI_EventsTimer) OFF - Control(__UI_GetID("ViewMenuPreview")).Disabled = __UI_False + Control(__UI_GetID("ViewMenuPreview")).Disabled = False __UI_WaitMessage = "Reloading preview window..." OPEN "UiEditor.dat" FOR BINARY AS #UiEditorFile b$ = MKL$(0): PUT #UiEditorFile, OffsetPreviewPID, b$ @@ -1655,7 +1843,7 @@ SUB CheckPreview IF PROCESS_CLOSED(UiPreviewPID, 0) THEN 'Preview was closed. TIMER(__UI_EventsTimer) OFF - Control(__UI_GetID("ViewMenuPreview")).Disabled = __UI_False + Control(__UI_GetID("ViewMenuPreview")).Disabled = False __UI_WaitMessage = "Reloading preview window..." OPEN "UiEditor.dat" FOR BINARY AS #UiEditorFile b$ = MKL$(0): PUT #UiEditorFile, OffsetPreviewPID, b$ @@ -1676,7 +1864,7 @@ SUB CheckPreview TIMER(__UI_EventsTimer) ON ELSE 'Preview is active. - Control(__UI_GetID("ViewMenuPreview")).Disabled = __UI_True + Control(__UI_GetID("ViewMenuPreview")).Disabled = True END IF END IF $END IF @@ -1690,8 +1878,8 @@ SUB SaveForm (ExitToQB64 AS _BYTE) BaseOutputFileName = RTRIM$(PreviewControls(PreviewFormID).Name) IF _FILEEXISTS(BaseOutputFileName + ".bas") OR _FILEEXISTS(BaseOutputFileName + ".frmbin") OR _FILEEXISTS(BaseOutputFileName + ".bas") THEN - Answer = __UI_MessageBox("Some files will be overwritten. Proceed?", "", __UI_MsgBox_YesNo + __UI_MsgBox_Question) - IF Answer = __UI_MsgBox_No THEN EXIT SUB + Answer = MessageBox("Some files will be overwritten. Proceed?", "", MsgBox_YesNo + MsgBox_Question) + IF Answer = MsgBox_No THEN EXIT SUB END IF TextFileNum = FREEFILE OPEN BaseOutputFileName + ".frm" FOR OUTPUT AS #TextFileNum @@ -1767,7 +1955,7 @@ SUB SaveForm (ExitToQB64 AS _BYTE) 'ELSE ' a$ = PreviewCaptions(i) 'END IF - a$ = " __UI_SetCaption " + CHR$(34) + RTRIM$(PreviewControls(i).Name) + CHR$(34) + ", " + __UI_SpecialCharsToCHR$(PreviewCaptions(i)) + a$ = " SetCaption " + CHR$(34) + RTRIM$(PreviewControls(i).Name) + CHR$(34) + ", " + __UI_SpecialCharsToCHR$(PreviewCaptions(i)) b$ = MKI$(-2) + MKL$(LEN(PreviewCaptions(i))) '-2 indicates a caption PUT #BinaryFileNum, , b$ PUT #BinaryFileNum, , PreviewCaptions(i) @@ -1775,7 +1963,7 @@ SUB SaveForm (ExitToQB64 AS _BYTE) END IF IF LEN(PreviewTips(i)) > 0 THEN - a$ = " __UI_SetTip " + CHR$(34) + RTRIM$(PreviewControls(i).Name) + CHR$(34) + ", " + __UI_SpecialCharsToCHR$(PreviewTips(i)) + a$ = " ToolTip(__UI_GetID(" + CHR$(34) + RTRIM$(PreviewControls(i).Name) + CHR$(34) + ")) = " + __UI_SpecialCharsToCHR$(PreviewTips(i)) b$ = MKI$(-24) + MKL$(LEN(PreviewTips(i))) '-24 indicates a tip PUT #BinaryFileNum, , b$ PUT #BinaryFileNum, , PreviewTips(i) @@ -1800,14 +1988,14 @@ SUB SaveForm (ExitToQB64 AS _BYTE) TempCaption$ = TempText$ TempText$ = "" END IF - a$ = " __UI_AddListBoxItem " + CHR$(34) + RTRIM$(PreviewControls(i).Name) + CHR$(34) + ", " + CHR$(34) + TempCaption$ + CHR$(34) + a$ = " AddItem __UI_NewID, " + CHR$(34) + TempCaption$ + CHR$(34) PRINT #TextFileNum, a$ LOOP CASE __UI_Type_PictureBox, __UI_Type_Button - a$ = " __UI_LoadImage Control(__UI_NewID), " + CHR$(34) + PreviewTexts(i) + CHR$(34) + a$ = " LoadImage Control(__UI_NewID), " + CHR$(34) + PreviewTexts(i) + CHR$(34) PRINT #TextFileNum, a$ CASE ELSE - a$ = " __UI_SetText " + CHR$(34) + RTRIM$(PreviewControls(i).Name) + CHR$(34) + ", " + __UI_SpecialCharsToCHR$(PreviewCaptions(i)) + a$ = " Text(__UI_GetID(" + CHR$(34) + RTRIM$(PreviewControls(i).Name) + CHR$(34) + ")) = " + __UI_SpecialCharsToCHR$(PreviewCaptions(i)) PRINT #TextFileNum, a$ END SELECT b$ = MKI$(-3) + MKL$(LEN(PreviewTexts(i))) '-3 indicates a text @@ -1820,7 +2008,7 @@ SUB SaveForm (ExitToQB64 AS _BYTE) PUT #BinaryFileNum, , b$ END IF IF PreviewControls(i).Stretch THEN - PRINT #TextFileNum, " Control(__UI_NewID).Stretch = __UI_True" + PRINT #TextFileNum, " Control(__UI_NewID).Stretch = True" b$ = MKI$(-4) PUT #BinaryFileNum, , b$ END IF @@ -1840,7 +2028,7 @@ SUB SaveForm (ExitToQB64 AS _BYTE) NewFontParameters = LEFT$(FontSetup$, FindSep - 1) FontSetup$ = MID$(FontSetup$, FindSep + 1) - FontSetup$ = "__UI_Font(" + CHR$(34) + NewFontFile + CHR$(34) + ", " + FontSetup$ + ", " + CHR$(34) + NewFontParameters + CHR$(34) + ")" + FontSetup$ = "SetFont(" + CHR$(34) + NewFontFile + CHR$(34) + ", " + FontSetup$ + ", " + CHR$(34) + NewFontParameters + CHR$(34) + ")" PRINT #TextFileNum, " Control(__UI_NewID).Font = " + FontSetup$ END IF 'Colors are saved only if they differ from the theme's defaults @@ -1874,7 +2062,7 @@ SUB SaveForm (ExitToQB64 AS _BYTE) b$ = MKI$(-11): PUT #BinaryFileNum, , b$ END IF IF PreviewControls(i).HasBorder THEN - PRINT #TextFileNum, " Control(__UI_NewID).HasBorder = __UI_True" + PRINT #TextFileNum, " Control(__UI_NewID).HasBorder = True" b$ = MKI$(-12): PUT #BinaryFileNum, , b$ END IF IF PreviewControls(i).Align = __UI_Center THEN @@ -1905,23 +2093,23 @@ SUB SaveForm (ExitToQB64 AS _BYTE) ' b$ = MKI$(-18) + MKI$(PreviewControls(i).HotKeyOffset): PUT #BinaryFileNum, , b$ 'END IF IF PreviewControls(i).ShowPercentage THEN - PRINT #TextFileNum, " Control(__UI_NewID).ShowPercentage = __UI_True" + PRINT #TextFileNum, " Control(__UI_NewID).ShowPercentage = True" b$ = MKI$(-19): PUT #BinaryFileNum, , b$ END IF IF PreviewControls(i).CanHaveFocus THEN - PRINT #TextFileNum, " Control(__UI_NewID).CanHaveFocus = __UI_True" + PRINT #TextFileNum, " Control(__UI_NewID).CanHaveFocus = True" b$ = MKI$(-20): PUT #BinaryFileNum, , b$ END IF IF PreviewControls(i).Disabled THEN - PRINT #TextFileNum, " Control(__UI_NewID).Disabled = __UI_True" + PRINT #TextFileNum, " Control(__UI_NewID).Disabled = True" b$ = MKI$(-21): PUT #BinaryFileNum, , b$ END IF IF PreviewControls(i).Hidden THEN - PRINT #TextFileNum, " Control(__UI_NewID).Hidden = __UI_True" + PRINT #TextFileNum, " Control(__UI_NewID).Hidden = True" b$ = MKI$(-22): PUT #BinaryFileNum, , b$ END IF IF PreviewControls(i).CenteredWindow THEN - PRINT #TextFileNum, " Control(__UI_NewID).CenteredWindow = __UI_True" + PRINT #TextFileNum, " Control(__UI_NewID).CenteredWindow = True" b$ = MKI$(-23): PUT #BinaryFileNum, , b$ END IF IF PreviewControls(i).ContextMenuID THEN @@ -1933,11 +2121,11 @@ SUB SaveForm (ExitToQB64 AS _BYTE) b$ = MKI$(-26) + _MK$(_FLOAT, PreviewControls(i).Interval): PUT #BinaryFileNum, , b$ END IF IF PreviewControls(i).WordWrap THEN - PRINT #TextFileNum, " Control(__UI_NewID).WordWrap = __UI_True" + PRINT #TextFileNum, " Control(__UI_NewID).WordWrap = True" b$ = MKI$(-27): PUT #BinaryFileNum, , b$ END IF IF PreviewControls(i).CanResize AND PreviewControls(i).Type = __UI_Type_Form THEN - PRINT #TextFileNum, " Control(__UI_NewID).CanResize = __UI_True" + PRINT #TextFileNum, " Control(__UI_NewID).CanResize = True" b$ = MKI$(-29): PUT #BinaryFileNum, , b$ END IF IF PreviewControls(i).Padding > 0 THEN @@ -2045,16 +2233,30 @@ SUB SaveForm (ExitToQB64 AS _BYTE) NEXT CLOSE #TextFileNum IF ExitToQB64 THEN - Answer = __UI_MessageBox("Exporting successful. Files output:" + CHR$(10) + " " + BaseOutputFileName + ".bas" + CHR$(10) + " " + BaseOutputFileName + ".frm" + CHR$(10) + " " + BaseOutputFileName + ".frmbin" + CHR$(10) + CHR$(10) + "Exit to QB64?", "", __UI_MsgBox_YesNo + __UI_MsgBox_Question) - IF Answer = __UI_MsgBox_No THEN EXIT SUB + b$ = "Exporting successful. Files output:" + CHR$(10) + " " + BaseOutputFileName + ".bas" + CHR$(10) + " " + BaseOutputFileName + ".frm" + CHR$(10) + " " + BaseOutputFileName + ".frmbin" $IF WIN THEN - SHELL _DONTWAIT "qb64.exe " + BaseOutputFileName + ".bas" + IF _FILEEXISTS("qb64.exe") THEN + b$ = b$ + CHR$(10) + CHR$(10) + "Exit to QB64?" + ELSE + b$ = b$ + CHR$(10) + CHR$(10) + "Close the editor?" + END IF $ELSE - SHELL _DONTWAIT "./qb64 " + BaseOutputFileName + ".bas" + IF _FILEEXISTS("qb64") THEN + b$ = b$ + CHR$(10) + CHR$(10) + "Exit to QB64?" + ELSE + b$ = b$ + CHR$(10) + CHR$(10) + "Close the editor?" + END IF + $END IF + Answer = MessageBox(b$, "", MsgBox_YesNo + MsgBox_Question) + IF Answer = MsgBox_No THEN Edited = False: EXIT SUB + $IF WIN THEN + IF _FILEEXISTS("qb64.exe") THEN SHELL _DONTWAIT "qb64.exe " + BaseOutputFileName + ".bas" + $ELSE + IF _FILEEXISTS("qb64") THEN SHELL _DONTWAIT "./qb64 " + BaseOutputFileName + ".bas" $END IF SYSTEM ELSE - Answer = __UI_MessageBox("Exporting successful. Files output:" + CHR$(10) + " " + BaseOutputFileName + ".bas" + CHR$(10) + " " + BaseOutputFileName + ".frm" + CHR$(10) + " " + BaseOutputFileName + ".frmbin", "", __UI_MsgBox_OkOnly + __UI_MsgBox_Information) + Answer = MessageBox("Exporting successful. Files output:" + CHR$(10) + " " + BaseOutputFileName + ".bas" + CHR$(10) + " " + BaseOutputFileName + ".frm" + CHR$(10) + " " + BaseOutputFileName + ".frmbin", "", MsgBox_OkOnly + MsgBox_Information) END IF END SUB @@ -2108,7 +2310,7 @@ SUB SaveSelf PUT #2, , b$ IF LEN(Caption(i)) > 0 THEN - a$ = "__UI_SetCaption " + CHR$(34) + RTRIM$(Control(i).Name) + CHR$(34) + ", " + __UI_SpecialCharsToCHR$(Caption(i)) + a$ = "SetCaption " + CHR$(34) + RTRIM$(Control(i).Name) + CHR$(34) + ", " + __UI_SpecialCharsToCHR$(Caption(i)) b$ = MKI$(-2) + MKL$(LEN(Caption(i))) '-2 indicates a caption PUT #2, , b$ PUT #2, , Caption(i) @@ -2116,7 +2318,7 @@ SUB SaveSelf END IF IF LEN(ToolTip(i)) > 0 THEN - a$ = "__UI_SetTip " + CHR$(34) + RTRIM$(Control(i).Name) + CHR$(34) + ", " + __UI_SpecialCharsToCHR$(ToolTip(i)) + a$ = "ToolTip(__UI_GetID(" + CHR$(34) + RTRIM$(Control(i).Name) + CHR$(34) + ")) = " + __UI_SpecialCharsToCHR$(ToolTip(i)) b$ = MKI$(-24) + MKL$(LEN(ToolTip(i))) '-24 indicates a tip PUT #2, , b$ PUT #2, , ToolTip(i) @@ -2141,14 +2343,14 @@ SUB SaveSelf TempCaption$ = TempText$ TempText$ = "" END IF - a$ = "__UI_AddListBoxItem " + CHR$(34) + RTRIM$(Control(i).Name) + CHR$(34) + ", " + CHR$(34) + TempCaption$ + CHR$(34) + a$ = "AddItem __UI_GetID(" + CHR$(34) + RTRIM$(Control(i).Name) + CHR$(34) + "), " + CHR$(34) + TempCaption$ + CHR$(34) PRINT #1, a$ LOOP CASE __UI_Type_PictureBox, __UI_Type_Button - a$ = "__UI_LoadImage Control(__UI_NewID), " + CHR$(34) + Text(i) + CHR$(34) + a$ = "LoadImage Control(__UI_NewID), " + CHR$(34) + Text(i) + CHR$(34) PRINT #1, a$ CASE ELSE - a$ = "__UI_SetText " + CHR$(34) + RTRIM$(Control(i).Name) + CHR$(34) + ", " + __UI_SpecialCharsToCHR$(Caption(i)) + a$ = "Text(__UI_GetID(" + CHR$(34) + RTRIM$(Control(i).Name) + CHR$(34) + ")) = " + __UI_SpecialCharsToCHR$(Caption(i)) PRINT #1, a$ END SELECT b$ = MKI$(-3) + MKL$(LEN(Text(i))) '-3 indicates a text @@ -2161,7 +2363,7 @@ SUB SaveSelf PUT #2, , b$ END IF IF Control(i).Stretch THEN - PRINT #1, "Control(__UI_NewID).Stretch = __UI_True" + PRINT #1, "Control(__UI_NewID).Stretch = True" b$ = MKI$(-4) PUT #2, , b$ END IF @@ -2170,14 +2372,14 @@ SUB SaveSelf IF Control(i).Font = 8 OR Control(i).Font = 16 THEN 'Internal fonts SaveInternalFont: - FontSetup$ = "__UI_Font(" + CHR$(34) + "VGA Emulated" + CHR$(34) + ", " + CHR$(34) + CHR$(34) + "," + STR$(Control(__UI_GetFontID(Control(i).Font)).Max) + ", " + CHR$(34) + CHR$(34) + ")" + FontSetup$ = "SetFont(" + CHR$(34) + "VGA Emulated" + CHR$(34) + ", " + CHR$(34) + CHR$(34) + "," + STR$(Control(__UI_GetFontID(Control(i).Font)).Max) + ", " + CHR$(34) + CHR$(34) + ")" PRINT #1, "Control(__UI_NewID).Font = " + FontSetup$ FontSetup$ = "**" + LTRIM$(STR$(Control(__UI_GetFontID(Control(i).Font)).Max)) b$ = MKI$(-5) + MKI$(LEN(FontSetup$)) + FontSetup$ PUT #2, , b$ ELSE SaveExternalFont: - FontSetup$ = "__UI_Font(" + CHR$(34) + Text(__UI_GetFontID(Control(i).Font)) + CHR$(34) + "," + STR$(Control(__UI_GetFontID(Control(i).Font)).Max) + ", " + CHR$(34) + Caption(__UI_GetFontID(Control(i).Font)) + CHR$(34) + ")" + FontSetup$ = "SetFont(" + CHR$(34) + Text(__UI_GetFontID(Control(i).Font)) + CHR$(34) + "," + STR$(Control(__UI_GetFontID(Control(i).Font)).Max) + ", " + CHR$(34) + Caption(__UI_GetFontID(Control(i).Font)) + CHR$(34) + ")" PRINT #1, "Control(__UI_NewID).Font = " + FontSetup$ FontSetup$ = RTRIM$(Control(__UI_GetFontID(Control(i).Font)).Name) + "\" + Text(__UI_GetFontID(Control(i).Font)) + "\" + LTRIM$(STR$(Control(__UI_GetFontID(Control(i).Font)).Max)) + "\" + Caption(__UI_GetFontID(Control(i).Font)) b$ = MKI$(-5) + MKI$(LEN(FontSetup$)) + FontSetup$ @@ -2233,7 +2435,7 @@ SUB SaveSelf b$ = MKI$(-11): PUT #2, , b$ END IF IF Control(i).HasBorder THEN - PRINT #1, "Control(__UI_NewID).HasBorder = __UI_True" + PRINT #1, "Control(__UI_NewID).HasBorder = True" b$ = MKI$(-12): PUT #2, , b$ END IF IF Control(i).Align = __UI_Center THEN @@ -2264,23 +2466,23 @@ SUB SaveSelf b$ = MKI$(-18) + MKI$(Control(i).HotKeyOffset): PUT #2, , b$ END IF IF Control(i).ShowPercentage THEN - PRINT #1, "Control(__UI_NewID).ShowPercentage = __UI_True" + PRINT #1, "Control(__UI_NewID).ShowPercentage = True" b$ = MKI$(-19): PUT #2, , b$ END IF IF Control(i).CanHaveFocus THEN - PRINT #1, "Control(__UI_NewID).CanHaveFocus = __UI_True" + PRINT #1, "Control(__UI_NewID).CanHaveFocus = True" b$ = MKI$(-20): PUT #2, , b$ END IF IF Control(i).Disabled THEN - PRINT #1, "Control(__UI_NewID).Disabled = __UI_True" + PRINT #1, "Control(__UI_NewID).Disabled = True" b$ = MKI$(-21): PUT #2, , b$ END IF IF Control(i).Hidden THEN - PRINT #1, "Control(__UI_NewID).Hidden = __UI_True" + PRINT #1, "Control(__UI_NewID).Hidden = True" b$ = MKI$(-22): PUT #2, , b$ END IF IF Control(i).CenteredWindow THEN - PRINT #1, "Control(__UI_NewID).CenteredWindow = __UI_True" + PRINT #1, "Control(__UI_NewID).CenteredWindow = True" b$ = MKI$(-23): PUT #2, , b$ END IF IF Control(i).ContextMenuID THEN @@ -2292,7 +2494,7 @@ SUB SaveSelf b$ = MKI$(-26) + _MK$(_FLOAT, Control(i).Interval): PUT #2, , b$ END IF IF Control(i).WordWrap THEN - PRINT #1, "Control(__UI_NewID).WordWrap = __UI_True" + PRINT #1, "Control(__UI_NewID).WordWrap = True" b$ = MKI$(-27): PUT #2, , b$ END IF PRINT #1, @@ -2323,7 +2525,7 @@ END SUB ' l = RegOpenKeyExA(Ky, _OFFSET(SubKey), 0, KEY_READ, _OFFSET(hKey)) ' IF l THEN -' __UI_AddListBoxItem "FontList", "Access to fonts failed." +' AddItem __UI_GetID("FontList"), "Access to fonts failed." ' EXIT SUB ' ELSE ' dwIndex = 0 @@ -2333,12 +2535,12 @@ END SUB ' l = RegEnumValueA(hKey, dwIndex, _OFFSET(Value), _OFFSET(numTchars), 0, _OFFSET(dwType), _OFFSET(bData), _OFFSET(numBytes)) ' IF l THEN ' IF l <> ERROR_NO_MORE_ITEMS THEN -' __UI_AddListBoxItem "FontList", "Access to fonts failed." +' AddItem __UI_GetID("FontList"), "Access to fonts failed." ' END IF ' EXIT DO ' ELSE ' IF UCASE$(RIGHT$(formatData(dwType, numBytes, bData), 4)) = ".TTF" THEN -' __UI_AddListBoxItem "FontList", LEFT$(Value, numTchars) + " = " + formatData(dwType, numBytes, bData) +' AddItem __UI_GetID("FontList"), LEFT$(Value, numTchars) + " = " + formatData(dwType, numBytes, bData) ' END IF ' END IF ' dwIndex = dwIndex + 1 @@ -2407,3 +2609,183 @@ END SUB ' END SELECT ' END FUNCTION '$END IF + +'FUNCTION idezfilelist$ and idezpathlist$ (and helper functions) were +'adapted from ide_methods.bas (QB64): +FUNCTION idezfilelist$ (path$, method, TotalFound AS INTEGER) 'method0=*.bas, method1=*.* + DIM sep AS STRING * 1, filelist$, a$ + sep = CHR$(13) + + TotalFound = 0 + $IF WIN THEN + OPEN "opendlgfiles.dat" FOR OUTPUT AS #150: CLOSE #150 + IF method = 0 THEN SHELL _HIDE "dir /b /ON /A-D " + QuotedFilename$(path$) + "\*.frmbin >opendlgfiles.dat" + IF method = 1 THEN SHELL _HIDE "dir /b /ON /A-D " + QuotedFilename$(path$) + "\*.* >opendlgfiles.dat" + filelist$ = "" + OPEN "opendlgfiles.dat" FOR INPUT AS #150 + DO UNTIL EOF(150) + LINE INPUT #150, a$ + IF LEN(a$) THEN 'skip blank entries + IF filelist$ = "" THEN filelist$ = a$ ELSE filelist$ = filelist$ + sep + a$ + TotalFound = TotalFound + 1 + END IF + LOOP + CLOSE #150 + KILL "opendlgfiles.dat" + idezfilelist$ = filelist$ + EXIT FUNCTION + $ELSE + filelist$ = "" + FOR i = 1 TO 2 - method + OPEN "opendlgfiles.dat" FOR OUTPUT AS #150: CLOSE #150 + IF method = 0 THEN + IF i = 1 THEN SHELL _HIDE "find " + QuotedFilename$(path$) + " -maxdepth 1 -type f -name " + CHR$(34) + "*.frmbin" + CHR$(34) + " >opendlgfiles.dat" + IF i = 2 THEN SHELL _HIDE "find " + QuotedFilename$(path$) + " -maxdepth 1 -type f -name " + CHR$(34) + "*.FRMBIN" + CHR$(34) + " >opendlgfiles.dat" + END IF + IF method = 1 THEN + IF i = 1 THEN SHELL _HIDE "find " + QuotedFilename$(path$) + " -maxdepth 1 -type f -name " + CHR$(34) + "*" + CHR$(34) + " >opendlgfiles.dat" + END IF + OPEN "opendlgfiles.dat" FOR INPUT AS #150 + DO UNTIL EOF(150) + LINE INPUT #150, a$ + IF LEN(a$) = 0 THEN EXIT DO + FOR x = LEN(a$) TO 1 STEP -1 + a2$ = MID$(a$, x, 1) + IF a2$ = "/" THEN + a$ = RIGHT$(a$, LEN(a$) - x) + EXIT FOR + END IF + NEXT + IF filelist$ = "" THEN filelist$ = a$ ELSE filelist$ = filelist$ + sep + a$ + TotalFound = TotalFound + 1 + LOOP + CLOSE #150 + NEXT + KILL "opendlgfiles.dat" + idezfilelist$ = filelist$ + EXIT FUNCTION + $END IF +END FUNCTION + +FUNCTION idezpathlist$ (path$, TotalFound%) + DIM sep AS STRING * 1, a$, pathlist$, c AS INTEGER, x AS INTEGER, b$ + DIM i AS INTEGER + sep = CHR$(13) + + TotalFound% = 0 + $IF WIN THEN + OPEN "opendlgfiles.dat" FOR OUTPUT AS #150: CLOSE #150 + a$ = "": IF RIGHT$(path$, 1) = ":" THEN a$ = "\" 'use a \ after a drive letter + SHELL _HIDE "dir /b /ON /AD " + QuotedFilename$(path$ + a$) + " >opendlgfiles.dat" + pathlist$ = "" + OPEN "opendlgfiles.dat" FOR INPUT AS #150 + DO UNTIL EOF(150) + LINE INPUT #150, a$ + IF pathlist$ = "" THEN pathlist$ = a$ ELSE pathlist$ = pathlist$ + sep + a$ + TotalFound% = TotalFound% + 1 + LOOP + CLOSE #150 + KILL "opendlgfiles.dat" + 'count instances of / or \ + c = 0 + FOR x = 1 TO LEN(path$) + b$ = MID$(path$, x, 1) + IF b$ = PathSep$ THEN c = c + 1 + NEXT + IF c >= 1 THEN + IF LEN(pathlist$) THEN pathlist$ = ".." + sep + pathlist$ ELSE pathlist$ = ".." + TotalFound% = TotalFound% + 1 + END IF + 'add drive paths + FOR i = 0 TO 25 + IF LEN(pathlist$) THEN pathlist$ = pathlist$ + sep + pathlist$ = pathlist$ + CHR$(65 + i) + ":" + TotalFound% = TotalFound% + 1 + NEXT + idezpathlist$ = pathlist$ + EXIT FUNCTION + $ELSE + pathlist$ = "" + OPEN "opendlgfiles.dat" FOR OUTPUT AS #150: CLOSE #150 + SHELL _HIDE "find " + QuotedFilename$(path$) + " -maxdepth 1 -mindepth 1 -type d >opendlgfiles.dat" + OPEN "opendlgfiles.dat" FOR INPUT AS #150 + DO UNTIL EOF(150) + LINE INPUT #150, a$ + IF LEN(a$) = 0 THEN EXIT DO + FOR x = LEN(a$) TO 1 STEP -1 + a2$ = MID$(a$, x, 1) + IF a2$ = "/" THEN + a$ = RIGHT$(a$, LEN(a$) - x) + EXIT FOR + END IF + NEXT + IF pathlist$ = "" THEN pathlist$ = a$ ELSE pathlist$ = pathlist$ + sep + a$ + TotalFound% = TotalFound% + 1 + LOOP + CLOSE #150 + KILL "opendlgfiles.dat" + + IF path$ <> "/" THEN + a$ = ".." + + IF pathlist$ = "" THEN pathlist$ = a$ ELSE pathlist$ = a$ + sep + pathlist$ + TotalFound% = TotalFound% + 1 + END IF + + idezpathlist$ = pathlist$ + EXIT FUNCTION + $END IF +END FUNCTION + +FUNCTION idezchangepath$ (path$, newpath$) + DIM x AS INTEGER, a$ + + idezchangepath$ = path$ 'default (for unsuccessful cases) + + $IF WIN THEN + 'go back a path + IF newpath$ = ".." THEN + FOR x = LEN(path$) TO 1 STEP -1 + a$ = MID$(path$, x, 1) + IF a$ = "\" THEN + idezchangepath$ = LEFT$(path$, x - 1) + EXIT FOR + END IF + NEXT + EXIT FUNCTION + END IF + 'change drive + IF LEN(newpath$) = 2 AND RIGHT$(newpath$, 1) = ":" THEN + idezchangepath$ = newpath$ + EXIT FUNCTION + END IF + idezchangepath$ = path$ + "\" + newpath$ + EXIT FUNCTION + $ELSE + 'go back a path + IF newpath$ = ".." THEN + FOR x = LEN(path$) TO 1 STEP -1 + a$ = MID$(path$, x, 1) + IF a$ = "/" THEN + idezchangepath$ = LEFT$(path$, x - 1) + IF x = 1 THEN idezchangepath$ = "/" 'root path cannot be "" + EXIT FOR + END IF + NEXT + EXIT FUNCTION + END IF + IF path$ = "/" THEN idezchangepath$ = "/" + newpath$ ELSE idezchangepath$ = path$ + "/" + newpath$ + EXIT FUNCTION + $END IF + +END FUNCTION + +FUNCTION QuotedFilename$ (f$) + $IF WIN THEN + QuotedFilename$ = CHR$(34) + f$ + CHR$(34) + $ELSE + QuotedFilename$ = "'" + f$ + "'" + $END IF +END FUNCTION + + diff --git a/UiEditor.frm b/UiEditor.frm index 40adbdf..3e5e76a 100644 --- a/UiEditor.frm +++ b/UiEditor.frm @@ -6,275 +6,342 @@ SUB __UI_LoadForm DIM __UI_NewID AS LONG __UI_NewID = __UI_NewControl(__UI_Type_Form, "UiEditorForm", 598, 430, 0, 0, 0) - __UI_SetCaption "UiEditorForm", UiEditorTitle$ - Control(__UI_NewID).Font = __UI_Font("segoeui.ttf", 12, "") + SetCaption "UiEditorForm", UiEditorTitle$ + Control(__UI_NewID).Font = SetFont("segoeui.ttf", 12, "") __UI_NewID = __UI_NewControl(__UI_Type_MenuBar, "FileMenu", 44, 18, 8, 0, 0) - __UI_SetCaption "FileMenu", "&File" + SetCaption "FileMenu", "&File" __UI_NewID = __UI_NewControl(__UI_Type_MenuBar, "ViewMenu", 44, 18, 52, 0, 0) - __UI_SetCaption "ViewMenu", "&View" + SetCaption "ViewMenu", "&View" __UI_NewID = __UI_NewControl(__UI_Type_MenuBar, "InsertMenu", 44, 18, 52, 0, 0) - __UI_SetCaption "InsertMenu", "&Insert" + SetCaption "InsertMenu", "&Insert" __UI_NewID = __UI_NewControl(__UI_Type_MenuBar, "AlignMenu", 0, 0, 0, 0, 0) - __UI_SetCaption "AlignMenu", "Align" + SetCaption "AlignMenu", "Align" __UI_NewID = __UI_NewControl(__UI_Type_MenuBar, "OptionsMenu", 44, 18, 52, 0, 0) - __UI_SetCaption "OptionsMenu", "&Options" + SetCaption "OptionsMenu", "&Options" __UI_NewID = __UI_NewControl(__UI_Type_MenuBar, "HelpMenu", 44, 18, 545, 0, 0) - __UI_SetCaption "HelpMenu", "&Help" + SetCaption "HelpMenu", "&Help" Control(__UI_NewID).Align = __UI_Right __UI_NewID = __UI_NewControl(__UI_Type_Frame, "ToolBox", 62, 376, 30, 40, 0) - Control(__UI_NewID).HasBorder = __UI_True + Control(__UI_NewID).HasBorder = True __UI_NewID = __UI_NewControl(__UI_Type_Frame, "PropertiesFrame", 457, 186, 110, 40, 0) - __UI_SetCaption "PropertiesFrame", "Control properties: Main form" - Control(__UI_NewID).HasBorder = __UI_True + SetCaption "PropertiesFrame", "Control properties: Main form" + Control(__UI_NewID).HasBorder = True __UI_NewID = __UI_NewControl(__UI_Type_Frame, "ColorMixer", 457, 175, 110, 240, 0) - __UI_SetCaption "ColorMixer", "Color mixer" - Control(__UI_NewID).HasBorder = __UI_True + SetCaption "ColorMixer", "Color mixer" + Control(__UI_NewID).HasBorder = True - '__UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "FileMenuNew", 91, 18, 0, 22, __UI_GetID("FileMenu")) - '__UI_SetCaption "FileMenuNew", "&New" + __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "FileMenuNew", 91, 18, 0, 22, __UI_GetID("FileMenu")) + SetCaption "FileMenuNew", "&New" + + __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "FileMenuOpen", 91, 18, 0, 22, __UI_GetID("FileMenu")) + SetCaption "FileMenuOpen", "&Open..." __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "FileMenuSave", 91, 18, 0, 22, __UI_GetID("FileMenu")) - __UI_SetCaption "FileMenuSave", "&Save form-" - __UI_LoadImage Control(__UI_NewID), "InForm\disk.png" + SetCaption "FileMenuSave", "&Save form-" + ToolTip(__UI_NewID) = "File name is automatically taken from your form's name property" + LoadImage Control(__UI_NewID), "InForm\disk.png" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "FileMenuExit", 56, 18, 0, 40, __UI_GetID("FileMenu")) - __UI_SetCaption "FileMenuExit", "E&xit" + SetCaption "FileMenuExit", "E&xit" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "ViewMenuPreviewDetach", 56, 18, 0, 40, __UI_GetID("ViewMenu")) - __UI_SetCaption "ViewMenuPreviewDetach", "&Keep preview window attached" + SetCaption "ViewMenuPreviewDetach", "&Keep preview window attached" Control(__UI_NewID).Value = -1 __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "ViewMenuPreview", 56, 18, 0, 40, __UI_GetID("ViewMenu")) - __UI_SetCaption "ViewMenuPreview", "&Open preview window-" + SetCaption "ViewMenuPreview", "&Open preview window-" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "ViewMenuLoadedFonts", 56, 18, 0, 40, __UI_GetID("ViewMenu")) - __UI_SetCaption "ViewMenuLoadedFonts", "&Loaded fonts" + SetCaption "ViewMenuLoadedFonts", "&Loaded fonts" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "InsertMenuMenuBar", 0, 0, 0, 0, __UI_GetID("InsertMenu")) - __UI_SetCaption "InsertMenuMenuBar", "Menu &Bar" + SetCaption "InsertMenuMenuBar", "Menu &Bar" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "InsertMenuMenuItem", 0, 0, 0, 0, __UI_GetID("InsertMenu")) - __UI_SetCaption "InsertMenuMenuItem", "Menu &Item" - Control(__UI_NewID).Disabled = __UI_True + SetCaption "InsertMenuMenuItem", "Menu &Item" + Control(__UI_NewID).Disabled = True __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "AlignMenuAlignLeft", 0, 0, 0, 0, __UI_GetID("AlignMenu")) - __UI_SetCaption "AlignMenuAlignLeft", "Align &Left" + SetCaption "AlignMenuAlignLeft", "Align &Left" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "AlignMenuAlignRight", 0, 0, 0, 0, __UI_GetID("AlignMenu")) - __UI_SetCaption "AlignMenuAlignRight", "Align &Right" + SetCaption "AlignMenuAlignRight", "Align &Right" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "AlignMenuAlignTops", 0, 0, 0, 0, __UI_GetID("AlignMenu")) - __UI_SetCaption "AlignMenuAlignTops", "Align T&op" + SetCaption "AlignMenuAlignTops", "Align T&op" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "AlignMenuAlignBottoms", 0, 0, 0, 0, __UI_GetID("AlignMenu")) - __UI_SetCaption "AlignMenuAlignBottoms", "Align &Bottom-" + SetCaption "AlignMenuAlignBottoms", "Align &Bottom-" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "AlignMenuAlignCentersV", 0, 0, 0, 0, __UI_GetID("AlignMenu")) - __UI_SetCaption "AlignMenuAlignCentersV", "Align cent&ers Vertically" + SetCaption "AlignMenuAlignCentersV", "Align cent&ers Vertically" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "AlignMenuAlignCentersH", 0, 0, 0, 0, __UI_GetID("AlignMenu")) - __UI_SetCaption "AlignMenuAlignCentersH", "Ali&gn centers Horizontally" + SetCaption "AlignMenuAlignCentersH", "Ali&gn centers Horizontally" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "AlignMenuAlignCenterV", 0, 0, 0, 0, __UI_GetID("AlignMenu")) - __UI_SetCaption "AlignMenuAlignCenterV", "Center &Vertically" + SetCaption "AlignMenuAlignCenterV", "Center &Vertically" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "AlignMenuAlignCenterH", 0, 0, 0, 0, __UI_GetID("AlignMenu")) - __UI_SetCaption "AlignMenuAlignCenterH", "Center &Horizontally-" + SetCaption "AlignMenuAlignCenterH", "Center &Horizontally-" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "AlignMenuDistributeV", 0, 0, 0, 0, __UI_GetID("AlignMenu")) - __UI_SetCaption "AlignMenuDistributeV", "Distribute Ver&tically" + SetCaption "AlignMenuDistributeV", "Distribute Ver&tically" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "AlignMenuDistributeH", 0, 0, 0, 0, __UI_GetID("AlignMenu")) - __UI_SetCaption "AlignMenuDistributeH", "Distribute Hori&zontally" + SetCaption "AlignMenuDistributeH", "Distribute Hori&zontally" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "OptionsMenuAutoName", 0, 0, 0, 0, __UI_GetID("OptionsMenu")) - __UI_SetCaption "OptionsMenuAutoName", "&Auto-name controls" - Control(__UI_NewID).Value = __UI_True - __UI_SetTip "OptionsMenuAutoName", "Automatically set control names based on caption and type" + SetCaption "OptionsMenuAutoName", "&Auto-name controls" + Control(__UI_NewID).Value = True + ToolTip(__UI_GetID("OptionsMenuAutoName")) = "Automatically set control names based on caption and type" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "HelpMenuHelp", 0, 0, 0, 0, __UI_GetID("HelpMenu")) - __UI_SetCaption "HelpMenuHelp", "&What's all this?" + SetCaption "HelpMenuHelp", "&What's all this?" __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "HelpMenuAbout", 0, 0, 0, 0, __UI_GetID("HelpMenu")) - __UI_SetCaption "HelpMenuAbout", "&About..." + SetCaption "HelpMenuAbout", "&About..." __UI_NewID = __UI_NewControl(__UI_Type_Button, "AddButton", 22, 22, 20, 26, __UI_GetID("ToolBox")) - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_Button, "AddLabel", 22, 22, 20, 56, __UI_GetID("ToolBox")) - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_Button, "AddTextBox", 22, 22, 20, 86, __UI_GetID("ToolBox")) - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_Button, "AddCheckBox", 22, 22, 20, 116, __UI_GetID("ToolBox")) - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_Button, "AddRadioButton", 22, 22, 20, 146, __UI_GetID("ToolBox")) - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_Button, "AddListBox", 22, 22, 20, 176, __UI_GetID("ToolBox")) - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_Button, "AddDropdownList", 22, 22, 20, 206, __UI_GetID("ToolBox")) - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_Button, "AddTrackBar", 22, 22, 20, 236, __UI_GetID("ToolBox")) - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_Button, "AddProgressBar", 22, 22, 20, 266, __UI_GetID("ToolBox")) - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_Button, "AddPictureBox", 22, 22, 20, 296, __UI_GetID("ToolBox")) - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_Button, "AddFrame", 22, 22, 20, 326, __UI_GetID("ToolBox")) - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "PropertiesList", 174, 23, 20, 20, __UI_GetID("PropertiesFrame")) - __UI_AddListBoxItem "PropertiesList", "Name" - __UI_AddListBoxItem "PropertiesList", "Caption" - __UI_AddListBoxItem "PropertiesList", "Text" - __UI_AddListBoxItem "PropertiesList", "Top" - __UI_AddListBoxItem "PropertiesList", "Left" - __UI_AddListBoxItem "PropertiesList", "Width" - __UI_AddListBoxItem "PropertiesList", "Height" - __UI_AddListBoxItem "PropertiesList", "Font" - __UI_AddListBoxItem "PropertiesList", "Tool tip" - __UI_AddListBoxItem "PropertiesList", "Value" - __UI_AddListBoxItem "PropertiesList", "Min" - __UI_AddListBoxItem "PropertiesList", "Max" - __UI_AddListBoxItem "PropertiesList", "Interval" - __UI_AddListBoxItem "PropertiesList", "Padding (Left/Right)" - Control(__UI_NewID).HasBorder = __UI_True + AddItem __UI_GetID("PropertiesList"), "Name" + AddItem __UI_GetID("PropertiesList"), "Caption" + AddItem __UI_GetID("PropertiesList"), "Text" + AddItem __UI_GetID("PropertiesList"), "Top" + AddItem __UI_GetID("PropertiesList"), "Left" + AddItem __UI_GetID("PropertiesList"), "Width" + AddItem __UI_GetID("PropertiesList"), "Height" + AddItem __UI_GetID("PropertiesList"), "Font" + AddItem __UI_GetID("PropertiesList"), "Tool tip" + AddItem __UI_GetID("PropertiesList"), "Value" + AddItem __UI_GetID("PropertiesList"), "Min" + AddItem __UI_GetID("PropertiesList"), "Max" + AddItem __UI_GetID("PropertiesList"), "Interval" + AddItem __UI_GetID("PropertiesList"), "Padding (Left/Right)" + Control(__UI_NewID).HasBorder = True Control(__UI_NewID).Value = 1 Control(__UI_NewID).Max = 14 - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_TextBox, "PropertyValue", 250, 23, 200, 20, __UI_GetID("PropertiesFrame")) - Control(__UI_NewID).HasBorder = __UI_True - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).HasBorder = True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_PictureBox, "PropertyUpdateStatus", 16, 16, 430, 23, __UI_GetID("PropertiesFrame")) - Control(__UI_NewID).HasBorder = __UI_False + Control(__UI_NewID).HasBorder = False Control(__UI_NewID).BackStyle = __UI_Transparent __UI_NewID = __UI_NewControl(__UI_Type_CheckBox, "Stretch", 150, 17, 22, 59, __UI_GetID("PropertiesFrame")) - __UI_SetCaption "Stretch", "Stretch" - Control(__UI_NewID).CanHaveFocus = __UI_True + SetCaption "Stretch", "Stretch" + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_CheckBox, "HasBorder", 150, 17, 22, 79, __UI_GetID("PropertiesFrame")) - __UI_SetCaption "HasBorder", "Has border" - Control(__UI_NewID).CanHaveFocus = __UI_True + SetCaption "HasBorder", "Has border" + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_CheckBox, "ShowPercentage", 149, 17, 22, 99, __UI_GetID("PropertiesFrame")) - __UI_SetCaption "ShowPercentage", "Show percentage" - Control(__UI_NewID).CanHaveFocus = __UI_True + SetCaption "ShowPercentage", "Show percentage" + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_CheckBox, "WordWrap", 150, 17, 22, 119, __UI_GetID("PropertiesFrame")) - __UI_SetCaption "WordWrap", "Word wrap" - Control(__UI_NewID).CanHaveFocus = __UI_True + SetCaption "WordWrap", "Word wrap" + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_CheckBox, "CanHaveFocus", 150, 17, 182, 59, __UI_GetID("PropertiesFrame")) - __UI_SetCaption "CanHaveFocus", "Can have focus" - Control(__UI_NewID).CanHaveFocus = __UI_True + SetCaption "CanHaveFocus", "Can have focus" + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_CheckBox, "Disabled", 150, 17, 182, 79, __UI_GetID("PropertiesFrame")) - __UI_SetCaption "Disabled", "Disabled" - Control(__UI_NewID).CanHaveFocus = __UI_True + SetCaption "Disabled", "Disabled" + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_CheckBox, "Hidden", 150, 17, 182, 99, __UI_GetID("PropertiesFrame")) - __UI_SetCaption "Hidden", "Hidden" - Control(__UI_NewID).CanHaveFocus = __UI_True + SetCaption "Hidden", "Hidden" + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_CheckBox, "CenteredWindow", 150, 17, 182, 119, __UI_GetID("PropertiesFrame")) - __UI_SetCaption "CenteredWindow", "Centered window" - Control(__UI_NewID).CanHaveFocus = __UI_True + SetCaption "CenteredWindow", "Centered window" + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_CheckBox, "Resizable", 102, 17, 339, 59, __UI_GetID("PropertiesFrame")) - __UI_SetCaption "Resizable", "Resizable" - Control(__UI_NewID).CanHaveFocus = __UI_True + SetCaption "Resizable", "Resizable" + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_Label, "Label1", 83, 20, 24, 151, __UI_GetID("PropertiesFrame")) - __UI_SetCaption "Label1", "Text align:" + SetCaption "Label1", "Text align:" __UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "AlignOptions", 104, 20, 109, 151, __UI_GetID("PropertiesFrame")) - __UI_SetCaption "AlignOptions", "Left" - __UI_AddListBoxItem "AlignOptions", "Left" - __UI_AddListBoxItem "AlignOptions", "Center" - __UI_AddListBoxItem "AlignOptions", "Right" - Control(__UI_NewID).HasBorder = __UI_True + SetCaption "AlignOptions", "Left" + AddItem __UI_GetID("AlignOptions"), "Left" + AddItem __UI_GetID("AlignOptions"), "Center" + AddItem __UI_GetID("AlignOptions"), "Right" + Control(__UI_NewID).HasBorder = True Control(__UI_NewID).Value = 1 Control(__UI_NewID).Max = 3 - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_Label, "Label2", 83, 20, 225, 151, __UI_GetID("PropertiesFrame")) - __UI_SetCaption "Label2", "Back style:" + SetCaption "Label2", "Back style:" __UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "BackStyleOptions", 134, 20, 311, 151, __UI_GetID("PropertiesFrame")) - __UI_SetCaption "BackStyleOptions", "Left" - __UI_AddListBoxItem "BackStyleOptions", "Opaque" - __UI_AddListBoxItem "BackStyleOptions", "Transparent" - Control(__UI_NewID).HasBorder = __UI_True + SetCaption "BackStyleOptions", "Left" + AddItem __UI_GetID("BackStyleOptions"), "Opaque" + AddItem __UI_GetID("BackStyleOptions"), "Transparent" + Control(__UI_NewID).HasBorder = True Control(__UI_NewID).Value = 1 Control(__UI_NewID).Max = 2 - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "ColorPropertiesList", 161, 21, 10, 20, __UI_GetID("ColorMixer")) - __UI_AddListBoxItem "ColorPropertiesList", "ForeColor" - __UI_AddListBoxItem "ColorPropertiesList", "BackColor" - __UI_AddListBoxItem "ColorPropertiesList", "SelectedForeColor" - __UI_AddListBoxItem "ColorPropertiesList", "SelectedBackColor" - __UI_AddListBoxItem "ColorPropertiesList", "BorderColor" - Control(__UI_NewID).HasBorder = __UI_True + AddItem __UI_GetID("ColorPropertiesList"), "ForeColor" + AddItem __UI_GetID("ColorPropertiesList"), "BackColor" + AddItem __UI_GetID("ColorPropertiesList"), "SelectedForeColor" + AddItem __UI_GetID("ColorPropertiesList"), "SelectedBackColor" + AddItem __UI_GetID("ColorPropertiesList"), "BorderColor" + Control(__UI_NewID).HasBorder = True Control(__UI_NewID).Value = 1 Control(__UI_NewID).Max = 5 - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_PictureBox, "ColorPreview", 159, 115, 10, 51, __UI_GetID("ColorMixer")) - Control(__UI_NewID).HasBorder = __UI_True + Control(__UI_NewID).HasBorder = True __UI_NewID = __UI_NewControl(__UI_Type_TrackBar, "Red", 198, 40, 191, 17, __UI_GetID("ColorMixer")) Control(__UI_NewID).Max = 255 - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True Control(__UI_NewID).Interval = 25 __UI_NewID = __UI_NewControl(__UI_Type_TextBox, "RedValue", 36, 23, 400, 20, __UI_GetID("ColorMixer")) Control(__UI_NewID).BorderColor = _RGB32(255, 0, 0) - Control(__UI_NewID).HasBorder = __UI_True - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).HasBorder = True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_TrackBar, "Green", 198, 40, 191, 67, __UI_GetID("ColorMixer")) Control(__UI_NewID).Max = 255 - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True Control(__UI_NewID).Interval = 25 __UI_NewID = __UI_NewControl(__UI_Type_TextBox, "GreenValue", 36, 23, 400, 70, __UI_GetID("ColorMixer")) Control(__UI_NewID).BorderColor = _RGB32(0, 180, 0) - Control(__UI_NewID).HasBorder = __UI_True - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).HasBorder = True + Control(__UI_NewID).CanHaveFocus = True __UI_NewID = __UI_NewControl(__UI_Type_TrackBar, "Blue", 198, 40, 191, 117, __UI_GetID("ColorMixer")) Control(__UI_NewID).Max = 255 - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).CanHaveFocus = True Control(__UI_NewID).Interval = 25 __UI_NewID = __UI_NewControl(__UI_Type_TextBox, "BlueValue", 36, 23, 400, 120, __UI_GetID("ColorMixer")) Control(__UI_NewID).BorderColor = _RGB32(0, 0, 255) - Control(__UI_NewID).HasBorder = __UI_True - Control(__UI_NewID).CanHaveFocus = __UI_True + Control(__UI_NewID).HasBorder = True + Control(__UI_NewID).CanHaveFocus = True + '---------------------------------- + 'Open dialog: + '---------------------------------- + __UI_NewID = __UI_NewControl(__UI_Type_PictureBox, "DialogBG", 598, 430, -600, -500, 0) + Control(__UI_NewID).BackColor = _RGB32(200, 200, 200) + + __UI_NewID = __UI_NewControl(__UI_Type_Frame, "OpenFrame", 463, 289, -600, -500, 0) + SetCaption "OpenFrame", "Open" + Control(__UI_NewID).HasBorder = True + Control(__UI_NewID).BackColor = _RGB32(200, 200, 200) + + __UI_NewID = __UI_NewControl(__UI_Type_Label, "FileNameLB", 73, 23, 15, 16, __UI_GetID("OpenFrame")) + SetCaption "FileNameLB", "File &name:" + Control(__UI_NewID).BackStyle = __UI_Transparent + + __UI_NewID = __UI_NewControl(__UI_Type_TextBox, "FileNameTextBox", 363, 23, 89, 16, __UI_GetID("OpenFrame")) + Control(__UI_NewID).HasBorder = True + Control(__UI_NewID).CanHaveFocus = True + + __UI_NewID = __UI_NewControl(__UI_Type_Label, "PathLB", 437, 23, 15, 44, __UI_GetID("OpenFrame")) + SetCaption "PathLB", "Path: C:\QB64" + Control(__UI_NewID).BackStyle = __UI_Transparent + + __UI_NewID = __UI_NewControl(__UI_Type_Label, "FilesLB", 200, 23, 25, 75, __UI_GetID("OpenFrame")) + SetCaption "FilesLB", "&Files:" + Control(__UI_NewID).BackStyle = __UI_Transparent + + __UI_NewID = __UI_NewControl(__UI_Type_ListBox, "FileList", 200, 150, 25, 99, __UI_GetID("OpenFrame")) + Control(__UI_NewID).HasBorder = True + Control(__UI_NewID).CanHaveFocus = True + + __UI_NewID = __UI_NewControl(__UI_Type_Label, "PathsLB", 200, 23, 242, 75, __UI_GetID("OpenFrame")) + SetCaption "PathsLB", "&Paths:" + Control(__UI_NewID).BackStyle = __UI_Transparent + + __UI_NewID = __UI_NewControl(__UI_Type_ListBox, "DirList", 200, 150, 242, 99, __UI_GetID("OpenFrame")) + Control(__UI_NewID).HasBorder = True + Control(__UI_NewID).CanHaveFocus = True + + __UI_NewID = __UI_NewControl(__UI_Type_Button, "OpenBT", 80, 23, 274, 255, __UI_GetID("OpenFrame")) + SetCaption "OpenBT", "&Open" + Control(__UI_NewID).CanHaveFocus = True + + __UI_NewID = __UI_NewControl(__UI_Type_Button, "CancelBT", 80, 23, 362, 255, __UI_GetID("OpenFrame")) + SetCaption "CancelBT", "&Cancel" + Control(__UI_NewID).CanHaveFocus = True + + __UI_NewID = __UI_NewControl(__UI_Type_CheckBox, "ShowOnlyFrmbinFilesCB", 200, 23, 25, 255, __UI_GetID("OpenFrame")) + SetCaption "ShowOnlyFrmbinFilesCB", "Show only .frmbin files" + Control(__UI_NewID).Value = -1 + Control(__UI_NewID).CanHaveFocus = True + Control(__UI_NewID).BackStyle = __UI_Transparent END SUB SUB __UI_AssignIDs - + DialogBG = __UI_GetID("DialogBG") + OpenFrame = __UI_GetID("OpenFrame") + FileNameLB = __UI_GetID("FileNameLB") + FileNameTextBox = __UI_GetID("FileNameTextBox") + PathLB = __UI_GetID("PathLB") + FilesLB = __UI_GetID("FilesLB") + FileList = __UI_GetID("FileList") + PathsLB = __UI_GetID("PathsLB") + DirList = __UI_GetID("DirList") + OpenBT = __UI_GetID("OpenBT") + CancelBT = __UI_GetID("CancelBT") + ShowOnlyFrmbinFilesCB = __UI_GetID("ShowOnlyFrmbinFilesCB") END SUB diff --git a/UiEditorPreview.bas b/UiEditorPreview.bas index 95abb73..81d5fbd 100644 --- a/UiEditorPreview.bas +++ b/UiEditorPreview.bas @@ -1,6 +1,6 @@ OPTION _EXPLICIT -$EXEICON:'.\InForm\InForm Preview.ico' +'$EXEICON:'.\InForm\InForm Preview.ico' CONST OffsetEditorPID = 1 CONST OffsetPreviewPID = 5 @@ -21,6 +21,9 @@ DIM SHARED UiPreviewPID AS LONG DIM SHARED ExeIcon AS LONG DIM SHARED AutoNameControls AS _BYTE +REDIM SHARED QB64KEYWORDS(0) AS STRING +READ_KEYWORDS + DIM i AS LONG DIM SHARED AlphaNumeric(255) FOR i = 48 TO 57: AlphaNumeric(i) = -1: NEXT @@ -97,7 +100,7 @@ SUB __UI_BeforeUpdateDisplay OPEN "UiEditor.dat" FOR BINARY AS #UiEditorFile IF NOT MidRead THEN - MidRead = __UI_True + MidRead = True b$ = SPACE$(4): GET #UiEditorFile, OffsetEditorPID, b$ UiEditorPID = CVL(b$) @@ -122,14 +125,14 @@ SUB __UI_BeforeUpdateDisplay b& = GetExitCodeProcess(hnd&, ExitCode&) IF b& = 1 AND ExitCode& = 259 THEN 'Editor is active. - EditorWasActive = __UI_True + EditorWasActive = True ELSE 'Editor was closed. - IF EditorWasActive = __UI_False THEN + IF EditorWasActive = False THEN 'Preview was launched by user DIM Answer AS LONG _SCREENHIDE - Answer = __UI_MessageBox("InForm Designer is not running. Please run the main program.", "InForm Preview", 0) + Answer = MessageBox("InForm Designer is not running. Please run the main program.", "InForm Preview", 0) END IF SYSTEM END IF @@ -161,13 +164,13 @@ SUB __UI_BeforeUpdateDisplay TempValue = __UI_NewControl(__UI_Type_Button, "", 80, 23, TempWidth \ 2 - 40, TempHeight \ 2 - 12, ThisContainer) CASE __UI_Type_Label, __UI_Type_CheckBox, __UI_Type_RadioButton TempValue = __UI_NewControl(TempValue, "", 150, 23, TempWidth \ 2 - 75, TempHeight \ 2 - 12, ThisContainer) - __UI_SetCaption Control(TempValue).Name, RTRIM$(Control(TempValue).Name) + SetCaption Control(TempValue).Name, RTRIM$(Control(TempValue).Name) CASE __UI_Type_TextBox TempValue = __UI_NewControl(__UI_Type_TextBox, "", 120, 23, TempWidth \ 2 - 60, TempHeight \ 2 - 12, ThisContainer) - __UI_SetCaption Control(TempValue).Name, RTRIM$(Control(TempValue).Name) + SetCaption Control(TempValue).Name, RTRIM$(Control(TempValue).Name) CASE __UI_Type_ListBox TempValue = __UI_NewControl(__UI_Type_ListBox, "", 200, 200, TempWidth \ 2 - 100, TempHeight \ 2 - 100, ThisContainer) - Control(TempValue).HasBorder = __UI_True + Control(TempValue).HasBorder = True CASE __UI_Type_DropdownList TempValue = __UI_NewControl(__UI_Type_DropdownList, "", 200, 23, TempWidth \ 2 - 100, TempHeight \ 2 - 12, ThisContainer) CASE __UI_Type_TrackBar @@ -178,7 +181,7 @@ SUB __UI_BeforeUpdateDisplay TempValue = __UI_NewControl(TempValue, "", 230, 150, TempWidth \ 2 - 115, TempHeight \ 2 - 75, ThisContainer) CASE __UI_Type_Frame TempValue = __UI_NewControl(TempValue, "", 230, 150, TempWidth \ 2 - 115, TempHeight \ 2 - 75, 0) - __UI_SetCaption Control(TempValue).Name, RTRIM$(Control(TempValue).Name) + SetCaption Control(TempValue).Name, RTRIM$(Control(TempValue).Name) CASE __UI_Type_MenuBar 'Before adding a menu bar item, reset all other menu bar items' alignment FOR i = 1 TO UBOUND(Control) @@ -187,32 +190,38 @@ SUB __UI_BeforeUpdateDisplay END IF NEXT TempValue = __UI_NewControl(TempValue, "", 0, 0, 0, 0, 0) - __UI_SetCaption Control(TempValue).Name, RTRIM$(Control(TempValue).Name) + SetCaption Control(TempValue).Name, RTRIM$(Control(TempValue).Name) __UI_RefreshMenuBar - __UI_ActivateMenu Control(TempValue), __UI_False + __UI_ActivateMenu Control(TempValue), False CASE __UI_Type_MenuItem IF __UI_ActiveMenu > 0 AND LEFT$(Control(__UI_ParentMenu).Name, 5) <> "__UI_" THEN TempValue = __UI_NewControl(TempValue, "", 0, 0, 0, 0, __UI_ParentMenu) - __UI_SetCaption Control(TempValue).Name, RTRIM$(Control(TempValue).Name) - __UI_ActivateMenu Control(__UI_ParentMenu), __UI_False + SetCaption Control(TempValue).Name, RTRIM$(Control(TempValue).Name) + __UI_ActivateMenu Control(__UI_ParentMenu), False END IF END SELECT IF __UI_ActiveMenu > 0 AND (Control(TempValue).Type <> __UI_Type_MenuBar AND Control(TempValue).Type <> __UI_Type_MenuItem) THEN __UI_DestroyControl Control(__UI_ActiveMenu) END IF FOR i = 1 TO UBOUND(Control) - Control(i).ControlIsSelected = __UI_False + Control(i).ControlIsSelected = False NEXT - Control(TempValue).ControlIsSelected = __UI_True + Control(TempValue).ControlIsSelected = True __UI_TotalSelectedControls = 1 __UI_FirstSelectedID = TempValue - __UI_ForceRedraw = __UI_True + __UI_ForceRedraw = True END IF b$ = SPACE$(2): GET #UiEditorFile, OffsetNewDataFromEditor, b$ TempValue = CVI(b$) b$ = MKI$(0): PUT #UiEditorFile, OffsetNewDataFromEditor, b$ - IF TempValue = -1 THEN + IF TempValue = -2 THEN + 'Hide the preview + _SCREENHIDE + ELSEIF TempValue = -3 THEN + 'Show the preview + _SCREENSHOW + ELSEIF TempValue = -1 THEN DIM FloatValue AS _FLOAT 'Editor sent property value b$ = SPACE$(2): GET #UiEditorFile, OffsetPropertyChanged, b$ @@ -238,10 +247,10 @@ SUB __UI_BeforeUpdateDisplay IF __UI_TotalSelectedControls > 0 THEN FOR i = 1 TO UBOUND(Control) IF Control(i).ControlIsSelected THEN - __UI_SetCaption RTRIM$(Control(i).Name), b$ + SetCaption RTRIM$(Control(i).Name), b$ IF LEN(b$) > 0 AND b$ <> "&" THEN GOSUB AutoName IF Control(i).Type = __UI_Type_MenuItem THEN - __UI_ActivateMenu Control(Control(i).ParentID), __UI_False + __UI_ActivateMenu Control(Control(i).ParentID), False END IF END IF NEXT @@ -291,15 +300,16 @@ SUB __UI_BeforeUpdateDisplay IF Control(i).ControlIsSelected THEN Text(i) = b$ IF Control(i).Type = __UI_Type_Button OR Control(i).Type = __UI_Type_MenuItem THEN - __UI_LoadImage Control(i), b$ + LoadImage Control(i), b$ ELSEIF Control(i).Type = __UI_Type_PictureBox THEN - __UI_LoadImage Control(i), b$ + LoadImage Control(i), b$ IF LEN(Text(i)) > 0 THEN 'Load successful 'Keep aspect ratio at load Control(i).Height = (_HEIGHT(Control(i).HelperCanvas) / _WIDTH(Control(i).HelperCanvas)) * Control(i).Width END IF + IF LEN(b$) > 0 AND b$ <> "&" THEN GOSUB AutoName ELSEIF Control(i).Type = __UI_Type_ListBox OR Control(i).Type = __UI_Type_DropdownList THEN - Text(i) = __UI_ReplaceText(b$, "\n", CHR$(13), __UI_False, TotalReplacements) + Text(i) = Replace(b$, "\n", CHR$(13), False, TotalReplacements) IF Control(i).Max < TotalReplacements + 1 THEN Control(i).Max = TotalReplacements + 1 Control(i).LastVisibleItem = 0 'Reset it so it's recalculated END IF @@ -384,16 +394,16 @@ SUB __UI_BeforeUpdateDisplay IF __UI_TotalSelectedControls > 0 THEN FOR i = 1 TO UBOUND(Control) IF Control(i).ControlIsSelected THEN - Control(i).Font = __UI_Font(NewFontFile, NewFontSize, NewFontParameters) + Control(i).Font = SetFont(NewFontFile, NewFontSize, NewFontParameters) END IF NEXT ELSE - Control(__UI_FormID).Font = __UI_Font(NewFontFile, NewFontSize, NewFontParameters) + Control(__UI_FormID).Font = SetFont(NewFontFile, NewFontSize, NewFontParameters) DIM MustRedrawMenus AS _BYTE FOR i = 1 TO UBOUND(Control) IF Control(i).Type = __UI_Type_MenuBar OR Control(i).Type = __UI_Type_MenuItem OR Control(i).Type = __UI_Type_MenuPanel OR Control(i).Type = __UI_Type_ContextMenu THEN - Control(i).Font = __UI_Font(NewFontFile, NewFontSize, NewFontParameters) - MustRedrawMenus = __UI_True + Control(i).Font = SetFont(NewFontFile, NewFontSize, NewFontParameters) + MustRedrawMenus = True END IF NEXT IF MustRedrawMenus THEN __UI_RefreshMenuBar @@ -483,7 +493,7 @@ SUB __UI_BeforeUpdateDisplay IF Control(i).ControlIsSelected THEN Control(i).Hidden = CVI(b$) IF Control(i).Type = __UI_Type_MenuItem AND __UI_ParentMenu = Control(i).ParentID THEN - __UI_ActivateMenu Control(Control(i).ParentID), __UI_False + __UI_ActivateMenu Control(Control(i).ParentID), False END IF END IF NEXT @@ -606,9 +616,9 @@ SUB __UI_BeforeUpdateDisplay CASE 201 TO 210 'Alignment commands __UI_DesignModeAlignCommand = TempValue - __UI_HasInput = __UI_True + __UI_HasInput = True END SELECT - __UI_ForceRedraw = __UI_True + __UI_ForceRedraw = True END IF IF __UI_ActiveMenu > 0 AND LEFT$(Control(__UI_ParentMenu).Name, 5) = "__UI_" AND __UI_CantShowContextMenu THEN @@ -625,23 +635,23 @@ SUB __UI_BeforeUpdateDisplay b$ = MKL$(__UI_FormID) PUT #UiEditorFile, OffsetFormID, b$ - MidRead = __UI_False + MidRead = False CLOSE #UiEditorFile END IF END SUB SUB __UI_BeforeUnload 'DIM Answer AS _BYTE - 'Answer = __UI_MessageBox("Leaving UI", "Copy current form data to clipboard?", __UI_MsgBox_YesNoCancel + __UI_MsgBox_Question) - 'IF Answer = __UI_MsgBox_Cancel THEN - ' __UI_UnloadSignal = __UI_False - 'ELSEIF Answer = __UI_MsgBox_Yes THEN - ' Answer = __UI_MessageBox("Leaving UI", "Not yet implemented", __UI_MsgBox_OkOnly + __UI_MsgBox_Information) + 'Answer = MessageBox("Leaving UI", "Copy current form data to clipboard?", MsgBox_YesNoCancel + MsgBox_Question) + 'IF Answer = MsgBox_Cancel THEN + ' __UI_UnloadSignal = False + 'ELSEIF Answer = MsgBox_Yes THEN + ' Answer = MessageBox("Leaving UI", "Not yet implemented", MsgBox_OkOnly + MsgBox_Information) 'END IF END SUB SUB __UI_BeforeInit - __UI_DesignMode = __UI_True + __UI_DesignMode = True UiPreviewPID = __UI_GetPID LoadPreview END SUB @@ -666,7 +676,7 @@ SUB LoadPreview DIM Dummy AS LONG DIM BinaryFileNum AS INTEGER, LogFileNum AS INTEGER - CONST LogFileLoad = __UI_False + CONST LogFileLoad = False IF _FILEEXISTS("UiEditorPreview.frmbin") = 0 THEN EXIT SUB @@ -682,9 +692,9 @@ SUB LoadPreview EXIT SUB END IF IF LogFileLoad THEN PRINT #LogFileNum, "FOUND INFORM+1" - __UI_AutoRefresh = __UI_False + __UI_AutoRefresh = False FOR i = UBOUND(Control) TO 1 STEP -1 - IF LEFT$(Control(i).Name, 9) <> "__UI_Text" AND LEFT$(Control(i).Name, 16) <> "__UI_PreviewMenu" THEN + IF LEFT$(Control(i).Name, 5) <> "__UI_" THEN __UI_DestroyControl Control(i) END IF NEXT @@ -744,7 +754,7 @@ SUB LoadPreview b$ = SPACE$(4): GET #BinaryFileNum, , b$ b$ = SPACE$(CVL(b$)) GET #BinaryFileNum, , b$ - __UI_SetCaption RTRIM$(Control(TempValue).Name), b$ + SetCaption RTRIM$(Control(TempValue).Name), b$ IF LogFileLoad THEN PRINT #LogFileNum, "CAPTION:" + Caption(TempValue) CASE -3 'Text b$ = SPACE$(4): GET #BinaryFileNum, , b$ @@ -752,7 +762,7 @@ SUB LoadPreview GET #BinaryFileNum, , b$ Text(TempValue) = b$ IF Control(TempValue).Type = __UI_Type_PictureBox OR Control(TempValue).Type = __UI_Type_Button THEN - __UI_LoadImage Control(TempValue), Text(TempValue) + LoadImage Control(TempValue), Text(TempValue) ELSEIF Control(TempValue).Type = __UI_Type_Form THEN IF ExeIcon <> 0 THEN _FREEIMAGE ExeIcon: ExeIcon = 0 ExeIcon = IconPreview&(b$) @@ -762,7 +772,7 @@ SUB LoadPreview END IF IF LogFileLoad THEN PRINT #LogFileNum, "TEXT:" + Text(TempValue) CASE -4 'Stretch - Control(TempValue).Stretch = __UI_True + Control(TempValue).Stretch = True IF LogFileLoad THEN PRINT #LogFileNum, "STRETCH" CASE -5 'Font IF LogFileLoad THEN PRINT #LogFileNum, "FONT:"; @@ -781,7 +791,7 @@ SUB LoadPreview NewFontSize = VAL(FontSetup$) - Control(TempValue).Font = __UI_Font(NewFontFile, NewFontSize, NewFontAttributes) + Control(TempValue).Font = SetFont(NewFontFile, NewFontSize, NewFontAttributes) CASE -6 'ForeColor b$ = SPACE$(4): GET #BinaryFileNum, , b$ Control(TempValue).ForeColor = _CV(_UNSIGNED LONG, b$) @@ -806,7 +816,7 @@ SUB LoadPreview Control(TempValue).BackStyle = __UI_Transparent IF LogFileLoad THEN PRINT #LogFileNum, "BACKSTYLE:TRANSPARENT" CASE -12 - Control(TempValue).HasBorder = __UI_True + Control(TempValue).HasBorder = True IF LogFileLoad THEN PRINT #LogFileNum, "HASBORDER" CASE -13 b$ = SPACE$(1): GET #BinaryFileNum, , b$ @@ -833,19 +843,19 @@ SUB LoadPreview Control(TempValue).HotKeyOffset = CVI(b$) IF LogFileLoad THEN PRINT #LogFileNum, "HOTKEYOFFSET="; Control(TempValue).HotKeyOffset CASE -19 - Control(TempValue).ShowPercentage = __UI_True + Control(TempValue).ShowPercentage = True IF LogFileLoad THEN PRINT #LogFileNum, "SHOWPERCENTAGE" CASE -20 - Control(TempValue).CanHaveFocus = __UI_True + Control(TempValue).CanHaveFocus = True IF LogFileLoad THEN PRINT #LogFileNum, "CANHAVEFOCUS" CASE -21 - Control(TempValue).Disabled = __UI_True + Control(TempValue).Disabled = True IF LogFileLoad THEN PRINT #LogFileNum, "DISABLED" CASE -22 - Control(TempValue).Hidden = __UI_True + Control(TempValue).Hidden = True IF LogFileLoad THEN PRINT #LogFileNum, "HIDDEN" CASE -23 - Control(TempValue).CenteredWindow = __UI_True + Control(TempValue).CenteredWindow = True IF LogFileLoad THEN PRINT #LogFileNum, "CENTEREDWINDOW" CASE -24 'Tips b$ = SPACE$(4): GET #BinaryFileNum, , b$ @@ -864,7 +874,7 @@ SUB LoadPreview Control(TempValue).Interval = _CV(_FLOAT, b$) IF LogFileLoad THEN PRINT #LogFileNum, "INTERVAL="; Control(TempValue).Interval CASE -27 - Control(TempValue).WordWrap = __UI_True + Control(TempValue).WordWrap = True IF LogFileLoad THEN PRINT #LogFileNum, "WORDWRAP" CASE -28 b$ = SPACE$(4): GET #BinaryFileNum, , b$ @@ -872,7 +882,7 @@ SUB LoadPreview IF LogFileLoad THEN PRINT #LogFileNum, "TRANSPARENTCOLOR" __UI_ClearColor Control(TempValue).HelperCanvas, Control(TempValue).TransparentColor, -1 CASE -29 - Control(TempValue).CanResize = __UI_True + Control(TempValue).CanResize = True IF LogFileLoad THEN PRINT #LogFileNum, "CANRESIZE" CASE -31 b$ = SPACE$(2): GET #BinaryFileNum, , b$ @@ -883,7 +893,7 @@ SUB LoadPreview EXIT DO CASE -1024 IF LogFileLoad THEN PRINT #LogFileNum, "READ END OF FILE: -1024" - __UI_EOF = __UI_True + __UI_EOF = True EXIT DO CASE ELSE IF LogFileLoad THEN PRINT #LogFileNum, "UNKNOWN PROPERTY ="; CVI(b$) @@ -893,12 +903,13 @@ SUB LoadPreview LOOP UNTIL __UI_EOF CLOSE #BinaryFileNum IF LogFileLoad THEN CLOSE #LogFileNum - __UI_AutoRefresh = __UI_True + __UI_AutoRefresh = True EXIT SUB LoadError: - __UI_AutoRefresh = __UI_True CLOSE #BinaryFileNum + KILL "UiEditorPreview.frmbin" + __UI_AutoRefresh = True EXIT SUB END IF END SUB @@ -907,7 +918,7 @@ SUB SavePreview DIM b$, i AS LONG, a$, FontSetup$, TempValue AS LONG DIM BinFileNum AS INTEGER, TxtFileNum AS INTEGER - CONST Debug = __UI_False + CONST Debug = False BinFileNum = FREEFILE OPEN "UiEditorPreview.frmbin" FOR BINARY AS #BinFileNum @@ -1200,18 +1211,25 @@ FUNCTION AdaptName$ (tName$, TargetID AS LONG) DIM Name$, NewName$, i AS LONG, c$, NextIsCapital AS _BYTE, CheckID AS LONG Name$ = RTRIM$(tName$) - IF NOT AlphaNumeric(ASC(Name$, 1)) AND ASC(Name$, 1) <> 38 THEN Name$ = "__" + Name$ + DO + IF Alpha(ASC(Name$, 1)) OR ASC(Name$, 1) = 38 THEN + IF LEFT$(Name$, 1) = "_" AND MID$(Name$, 2, 1) <> "_" THEN Name$ = "_" + Name$ + EXIT DO + END IF + Name$ = MID$(Name$, 2) + IF LEN(Name$) = 0 THEN Name$ = Control(TargetID).Name: EXIT DO + LOOP FOR i = 1 TO LEN(Name$) IF AlphaNumeric(ASC(Name$, i)) THEN IF NextIsCapital THEN NewName$ = NewName$ + UCASE$(CHR$(ASC(Name$, i))) - IF ASC(RIGHT$(NewName$, 1)) >= 65 AND ASC(RIGHT$(NewName$, 1)) <= 90 THEN NextIsCapital = __UI_False + IF ASC(RIGHT$(NewName$, 1)) >= 65 AND ASC(RIGHT$(NewName$, 1)) <= 90 THEN NextIsCapital = False ELSE NewName$ = NewName$ + CHR$(ASC(Name$, i)) END IF ELSE - IF ASC(Name$, i) = 32 THEN NextIsCapital = __UI_True + IF ASC(Name$, i) = 32 THEN NextIsCapital = True END IF NEXT @@ -1233,5 +1251,84 @@ FUNCTION AdaptName$ (tName$, TargetID AS LONG) END IF LOOP + IF IS_KEYWORD(NewName$) THEN NewName$ = "__" + NewName$ + AdaptName$ = NewName$ END FUNCTION + +'READ_KEYWORDS and IS_KEYWORD come from vWATCH64: +SUB READ_KEYWORDS + DIM ThisKeyword$, TotalKeywords AS INTEGER + + RESTORE QB64KeywordsDATA + 'Populate QB64KEYWORDS(): + DO + READ ThisKeyword$ + IF ThisKeyword$ = "**END**" THEN + EXIT DO + END IF + TotalKeywords = TotalKeywords + 1 + REDIM _PRESERVE QB64KEYWORDS(1 TO TotalKeywords) AS STRING + QB64KEYWORDS(TotalKeywords) = ThisKeyword$ + LOOP + + QB64KeywordsDATA: + DATA $IF,$ELSE,$END + DATA _ALPHA,_ALPHA32,_AUTODISPLAY,_AXIS,_BACKGROUNDCOLOR,_BIT, + DATA _BLEND,_BLUE,_BLUE32,_BUTTON,_BUTTONCHANGE,_BYTE,$CHECKING + DATA _CLEARCOLOR,_CLIP,_CLIPBOARD$,_CONNECTED,_CONNECTIONADDRESS$ + DATA $CONSOLE,_CONSOLE,_CONSOLETITLE,_CONTROLCHR,_COPYIMAGE,_COPYPALETTE + DATA _CV,_DEFAULTCOLOR,_DEFINE,_DELAY,_DEST,_DEST,_DEVICE$,_DEVICEINPUT + DATA _DEVICES,_DIREXISTS,_DISPLAY,_DISPLAY,_DONTBLEND,_DONTWAIT + DATA _ERRORLINE,_EXIT,_FILEEXISTS,_FLOAT,_FONT,_FONT,_FONTHEIGHT + DATA _FONTWIDTH,_FREEFONT,_FREEIMAGE,_FREETIMER,_FULLSCREEN,_FULLSCREEN + DATA _GREEN,_GREEN32,_HEIGHT,_HIDE,_ICON,_INTEGER64,_KEYHIT,_KEYDOWN + DATA _LASTAXIS,_LASTBUTTON,_LASTWHEEL,_LIMIT,_LOADFONT,_LOADIMAGE + DATA _MAPTRIANGLE,_MAPUNICODE,_MEM,_MEMCOPY,_MEMELEMENT,_MEMFILL + DATA _MEMFREE,_MEMGET,_MEMIMAGE,_MEMNEW,_MEMPUT,_MIDDLE,_MK$,_MOUSEBUTTON + DATA _MOUSEHIDE,_MOUSEINPUT,_MOUSEMOVE,_MOUSEMOVEMENTX,_MOUSEMOVEMENTY + DATA _MOUSESHOW,_MOUSEWHEEL,_MOUSEX,_MOUSEY,_NEWIMAGE,_NONE,_OFFSET + DATA _OPENCLIENT,_OPENCONNECTION,_OPENHOST,_OS$,_PALETTECOLOR,_PIXELSIZE + DATA _PRESERVE,_PRINTIMAGE,_PRINTMODE,_PRINTSTRING,_PRINTWIDTH,_PUTIMAGE + DATA _RED,_RED32,$RESIZE,_RESIZE,_RGB,_RGB32,_RGBA,_RGBA32 + DATA _ROUND,_SCREENCLICK,$SCREENHIDE,_SCREENHIDE,_SCREENIMAGE,_SCREENMOVE + DATA _SCREENPRINT,$SCREENSHOW,_SCREENSHOW,_SCREENX,_SCREENY,_SETALPHA + DATA _SHELLHIDE,_SNDBAL,_SNDCLOSE,_SNDCOPY,_SNDGETPOS,_SNDLEN,_SNDLIMIT + DATA _SNDLOOP,_SNDOPEN,_SNDPAUSE,_SNDPAUSED,_SNDPLAY,_SNDPLAYCOPY + DATA _SNDPLAYFILE,_SNDPLAYING,_SNDRATE,_SNDRAW,_SNDRAWLEN,_SNDRAWDONE + DATA _SNDRAWOPEN,_SNDSETPOS,_SNDSTOP,_SNDVOL,_SOURCE,_TITLE,_UNSIGNED + DATA _WHEEL,_WIDTH,ABS,ABSOLUTE,ACCESS,ALIAS,AND,ANY,APPEND + DATA AS,ASC,ATN,BEEP,BINARY,BLOAD,BSAVE,BYVAL,CALL,CALLS + DATA CASE,CDBL,CDECL,CHAIN,CHDIR,CHR$,CINT,CIRCLE,CLEAR,CLNG + DATA CLOSE,CLS,COLOR,COMMAND$,COMMON,CONST,COS,CSNG,CSRLIN + DATA CVD,CVDMBF,CVI,CVL,CVS,CVSMBF,DATA,DATE$,DECLARE,DEF + DATA DEFDBL,DEFINT,DEFLNG,DEFSNG,DEFSTR,DIM,DO,DOUBLE,DRAW + DATA $DYNAMIC,ELSE,ELSEIF,END,ENVIRON,EOF,EQV,ERASE,ERDEV + DATA ERL,ERR,ERROR,EXIT,EXP,FIELD,FILEATTR,FILES,FIX,FOR + DATA FRE,FREE,FREEFILE,FUNCTION,GET,GOSUB,GOTO,HEX$,IF,IMP + DATA $INCLUDE,INKEY$,INP,INPUT,INSTR,INT,INTEGER,INTERRUPT + DATA INTERRUPTX,IOCTL,IOCTL$,IS,KEY,KILL,LBOUND,LCASE$,LEFT$,LEN + DATA LET,LINE,LIST,LOC,LOCATE,LOCK,LOF,LOG,LONG,LOOP,LPOS + DATA LPRINT,LSET,LTRIM$,MID,MID$,MKD$,MKDIR,MKDMBF$,MKI$,MKL$ + DATA MKS$,MKSMBF$,MOD,NAME,NEXT,NOT,OCT$,OFF,ON,OPEN,OPTION + DATA OR,OUT,OUTPUT,PAINT,PALETTE,PCOPY,PEEK,PEN,PLAY,PMAP + DATA POINT,POKE,POS,PRESET,PRINT,PSET,PUT,RANDOM,RANDOMIZE + DATA READ,REDIM,REM,RESET,RESTORE,RESUME,RETURN,RIGHT$,RMDIR + DATA RND,RSET,RTRIM$,RUN,SADD,SCREEN,SEEK,SEG,SELECT,SETMEM,SGN + DATA SHARED,SHELL,SIGNAL,SIN,SINGLE,SLEEP,SOUND,SPACE$,SPC + DATA SQR,STATIC,$STATIC,STEP,STICK,STOP,STR$,STRIG,STRING + DATA STRING$,SUB,SWAP,SYSTEM,TAB,TAN,THEN,TIME$,TIMER,TO + DATA TROFF,TRON,TYPE,UBOUND,UCASE$,UEVENT,UNLOCK,UNTIL,VAL + DATA VARPTR,VARPTR$,VARSEG,VIEW,WAIT,WEND,WHILE,WIDTH,WINDOW + DATA WRITE,XOR,_CEIL,BASE,_EXPLICIT,_INCLERRORLINE,_DIR$ + DATA _INCLERRORFILE$,$EXEICON,**END** +END SUB + +FUNCTION IS_KEYWORD (Text$) + DIM uText$, i AS INTEGER + uText$ = UCASE$(RTRIM$(LTRIM$(Text$))) + FOR i = 1 TO UBOUND(QB64KEYWORDS) + IF QB64KEYWORDS(i) = uText$ THEN IS_KEYWORD = True: EXIT FUNCTION + NEXT i +END FUNCTION + diff --git a/UiEditorPreview.frm b/UiEditorPreview.frm index 12696fd..94b8600 100644 --- a/UiEditorPreview.frm +++ b/UiEditorPreview.frm @@ -8,7 +8,7 @@ SUB __UI_LoadForm _RESIZE OFF __UI_NewID = __UI_NewControl(__UI_Type_Form, "Form1", 300, 300, 0, 0,0) - Control(__UI_NewID).Font = __UI_Font("segoeui.ttf", 12, "") + Control(__UI_NewID).Font = SetFont("segoeui.ttf", 12, "") END SUB SUB __UI_AssignIDs diff --git a/xp.uitheme b/xp.uitheme index b780599..97a4425 100644 --- a/xp.uitheme +++ b/xp.uitheme @@ -74,7 +74,7 @@ SUB __UI_DrawButton (This AS __UI_ControlTYPE, ControlState AS _BYTE) This.FocusState = __UI_Focus = This.ID __UI_TempCaptions(This.ID) = Caption(This.ID) This.PreviousParentID = This.ParentID - IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = __UI_True + IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = True IF This.Canvas <> 0 THEN _FREEIMAGE This.Canvas @@ -127,7 +127,7 @@ SUB __UI_DrawButton (This AS __UI_ControlTYPE, ControlState AS _BYTE) IF NOT This.Disabled THEN TempColor~& = This.ForeColor ELSE - TempColor~& = __UI_Darken(Control(__UI_FormID).BackColor, 80) + TempColor~& = Darken(Control(__UI_FormID).BackColor, 80) END IF Temp& = uprint((IconWidth / 2) + (This.Width \ 2 - __UI_PrintWidth&(TempCaption$) \ 2), ((This.Height \ 2) - uheight& \ 2), TempCaption$, LEN(TempCaption$), TempColor~&, 0) @@ -157,7 +157,7 @@ SUB __UI_DrawLabel (This AS __UI_ControlTYPE, ControlState AS _BYTE) 'Last time this control was drawn it had a different state/caption, so it'll be redrawn This.ControlState = ControlState __UI_TempCaptions(This.ID) = Caption(This.ID) - IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = __UI_True + IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = True This.PreviousParentID = This.ParentID IF This.Canvas <> 0 THEN @@ -181,7 +181,7 @@ SUB __UI_DrawLabel (This AS __UI_ControlTYPE, ControlState AS _BYTE) IF NOT This.Disabled THEN TempColor~& = This.ForeColor ELSE - TempColor~& = __UI_Darken(Control(__UI_FormID).BackColor, 80) + TempColor~& = Darken(Control(__UI_FormID).BackColor, 80) END IF 'Caption: @@ -286,7 +286,7 @@ SUB __UI_DrawRadioButton (This AS __UI_ControlTYPE, ControlState AS _BYTE) This.FocusState = __UI_Focus = This.ID This.PreviousValue = This.Value __UI_TempCaptions(This.ID) = Caption(This.ID) - IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = __UI_True + IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = True This.PreviousParentID = This.ParentID IF This.Canvas <> 0 THEN @@ -309,7 +309,7 @@ SUB __UI_DrawRadioButton (This AS __UI_ControlTYPE, ControlState AS _BYTE) DIM i AS SINGLE CaptionIndent = 0 - IF This.HasBorder = __UI_True THEN + IF This.HasBorder = True THEN CaptionIndent = 5 LINE (0, 0)-STEP(This.Width - 1, This.Height - 1), This.BorderColor, B END IF @@ -323,7 +323,7 @@ SUB __UI_DrawRadioButton (This AS __UI_ControlTYPE, ControlState AS _BYTE) IF NOT This.Disabled THEN TempColor~& = This.ForeColor ELSE - TempColor~& = __UI_Darken(Control(__UI_FormID).BackColor, 80) + TempColor~& = Darken(Control(__UI_FormID).BackColor, 80) END IF Temp& = uprint(CaptionIndent, ((This.Height \ 2) - uspacing& \ 2) + 1, TempCaption$, LEN(TempCaption$), TempColor~&, 0) @@ -364,7 +364,7 @@ SUB __UI_DrawCheckBox (This AS __UI_ControlTYPE, ControlState AS _BYTE) This.FocusState = __UI_Focus = This.ID This.PreviousValue = This.Value __UI_TempCaptions(This.ID) = Caption(This.ID) - IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = __UI_True + IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = True This.PreviousParentID = This.ParentID IF This.Canvas <> 0 THEN @@ -398,7 +398,7 @@ SUB __UI_DrawCheckBox (This AS __UI_ControlTYPE, ControlState AS _BYTE) IF NOT This.Disabled THEN TempColor~& = This.ForeColor ELSE - TempColor~& = __UI_Darken(Control(__UI_FormID).BackColor, 80) + TempColor~& = Darken(Control(__UI_FormID).BackColor, 80) END IF Temp& = uprint(CaptionIndent, ((This.Height \ 2) - uspacing& \ 2) + 1, TempCaption$, LEN(TempCaption$), TempColor~&, 0) @@ -437,7 +437,7 @@ SUB __UI_DrawProgressBar (This AS __UI_ControlTYPE, ControlState) This.FocusState = __UI_Focus = This.ID This.PreviousValue = This.Value __UI_TempCaptions(This.ID) = Caption(This.ID) - IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = __UI_True + IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = True This.PreviousParentID = This.ParentID IF This.Canvas <> 0 THEN @@ -497,7 +497,7 @@ SUB __UI_DrawProgressBar (This AS __UI_ControlTYPE, ControlState) IF NOT This.Disabled THEN TempColor~& = This.ForeColor ELSE - TempColor~& = __UI_Darken(Control(__UI_FormID).BackColor, 70) + TempColor~& = Darken(Control(__UI_FormID).BackColor, 70) END IF Temp& = __UI_PrintWidth(TempCaption$) @@ -537,7 +537,7 @@ SUB __UI_DrawTrackBar (This AS __UI_ControlTYPE, ControlState) This.ControlState = TempControlState This.FocusState = __UI_Focus = This.ID This.PreviousValue = This.Value - IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = __UI_True + IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = True This.PreviousParentID = This.ParentID IF This.Canvas <> 0 THEN @@ -614,14 +614,14 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState, ss1 AS LONG, ss2 A 'IF Text(This.ID) <> __UI_TempTexts(This.ID) THEN ' __UI_TempTexts(This.ID) = Text(This.ID) ' IF This.Multiline THEN - ' This.HasHScrollbar = __UI_False + ' This.HasHScrollbar = False ' DIM TempWidth AS LONG ' This.LongestLine = 0 ' FOR i = 1 TO __UI_CountLines(This.ID) ' TempWidth = __UI_PrintWidth(__UI_GetTextBoxLine$(This.ID, i, 0)) ' IF TempWidth > This.LongestLine THEN This.LongestLine = TempWidth - ' IF (This.LongestLine > This.Width AND This.HasVScrollBar = __UI_False) OR (This.LongestLine > This.Width - __UI_ScrollbarWidth AND This.HasVScrollBar = __UI_True) THEN - ' This.HasHScrollbar = __UI_True + ' IF (This.LongestLine > This.Width AND This.HasVScrollBar = False) OR (This.LongestLine > This.Width - __UI_ScrollbarWidth AND This.HasVScrollBar = True) THEN + ' This.HasHScrollbar = True ' END IF ' NEXT ' END IF @@ -629,7 +629,7 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState, ss1 AS LONG, ss2 A This.SelectionLength = __UI_SelectionLength This.PrevCursor = This.Cursor This.PrevVisibleCursor = This.VisibleCursor - IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = __UI_True + IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = True This.PreviousParentID = This.ParentID This.PrevFirstVisibleLine = This.FirstVisibleLine This.PrevCurrentLine = This.CurrentLine @@ -656,7 +656,7 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState, ss1 AS LONG, ss2 A IF NOT This.Disabled AND LEN(Text(This.ID)) THEN COLOR This.ForeColor, This.BackColor ELSE - COLOR __UI_Darken(Control(__UI_FormID).BackColor, 80), This.BackColor + COLOR Darken(Control(__UI_FormID).BackColor, 80), This.BackColor END IF STATIC c AS _UNSIGNED LONG @@ -682,7 +682,7 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState, ss1 AS LONG, ss2 A cursorBlink%% = NOT cursorBlink%% ELSEIF TIMER - __UI_LastInputReceived < .1 THEN SetCursor# = TIMER - cursorBlink%% = __UI_True + cursorBlink%% = True END IF IF cursorBlink%% THEN IF This.Cursor > UBOUND(__UI_ThisLineChars) THEN This.Cursor = UBOUND(__UI_ThisLineChars) @@ -717,7 +717,7 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState, ss1 AS LONG, ss2 A cursorBlink%% = NOT cursorBlink%% ELSEIF TIMER - __UI_LastInputReceived < .1 THEN SetCursor# = TIMER - cursorBlink%% = __UI_True + cursorBlink%% = True END IF FOR ThisLine = This.FirstVisibleLine TO TotalLines @@ -761,10 +761,10 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState, ss1 AS LONG, ss2 A IF TotalLines > This.Height \ uspacing& THEN This.FieldArea = This.Width / _FONTWIDTH((This.Font)) - 3 - This.HasVScrollbar = __UI_True + This.HasVScrollbar = True __UI_DrawVScrollBar This, ControlState ELSE - This.HasVScrollbar = __UI_False + This.HasVScrollbar = False END IF 'IF This.HasHScrollbar THEN @@ -796,7 +796,7 @@ SUB __UI_DrawListBox (This AS __UI_ControlTYPE, ControlState) This.PreviousValue = This.Value This.PreviousInputViewStart = This.InputViewStart __UI_TempTexts(This.ID) = Text(This.ID) - IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = __UI_True + IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = True This.PreviousParentID = This.ParentID IF This.Canvas <> 0 THEN @@ -845,7 +845,7 @@ SUB __UI_DrawListBox (This AS __UI_ControlTYPE, ControlState) IF NOT This.Disabled THEN TempColor~& = This.ForeColor ELSE - TempColor~& = __UI_Darken(Control(__UI_FormID).BackColor, 80) + TempColor~& = Darken(Control(__UI_FormID).BackColor, 80) END IF IF ThisItem% = This.Value THEN @@ -870,14 +870,14 @@ SUB __UI_DrawListBox (This AS __UI_ControlTYPE, ControlState) IF This.LastVisibleItem = 0 THEN This.LastVisibleItem = LastVisibleItem IF This.Max > This.LastVisibleItem THEN - This.HasVScrollbar = __UI_True + This.HasVScrollbar = True __UI_DrawVScrollBar This, ControlState ELSE - This.HasVScrollbar = __UI_False + This.HasVScrollbar = False END IF END IF - IF This.HasBorder = __UI_True THEN + IF This.HasBorder = True THEN LINE (0, 0)-STEP(This.Width - 1, This.Height - 1), This.BorderColor, B END IF '------ @@ -946,10 +946,10 @@ SUB __UI_DrawVScrollBar (TempThis AS __UI_ControlTYPE, ControlState AS _BYTE) END IF 'Mousedown on the track: - IF __UI_MouseDownOnID = This.ID AND This.HoveringVScrollbarButton = 4 AND __UI_DraggingThumb = __UI_False THEN + IF __UI_MouseDownOnID = This.ID AND This.HoveringVScrollbarButton = 4 AND __UI_DraggingThumb = False THEN 'Above the thumb _PUTIMAGE (This.Left, This.Top)-STEP(ImageWidth_Button - 1, ThumbTop + ThumbHeight + __UI_ScrollbarButtonHeight - 1), ControlImage_Track, , (0, 3 * ImageHeight_Button - ImageHeight_Button)-STEP(ImageWidth_Button - 1, ImageHeight_Button - 1) - ELSEIF __UI_MouseDownOnID = This.ID AND This.HoveringVScrollbarButton = 5 AND __UI_DraggingThumb = __UI_False THEN + ELSEIF __UI_MouseDownOnID = This.ID AND This.HoveringVScrollbarButton = 5 AND __UI_DraggingThumb = False THEN 'Below the thumb _PUTIMAGE (This.Left, This.Top + ThumbTop + __UI_ScrollbarButtonHeight)-STEP(ImageWidth_Button - 1, This.Height - (This.Top + ThumbTop + __UI_ScrollbarButtonHeight) - 1), ControlImage_Track, , (0, 3 * ImageHeight_Button - ImageHeight_Button)-STEP(ImageWidth_Button - 1, ImageHeight_Button - 1) END IF @@ -972,11 +972,11 @@ SUB __UI_DrawVScrollBar (TempThis AS __UI_ControlTYPE, ControlState AS _BYTE) END IF 'Draw thumb - IF __UI_DraggingThumb = __UI_True THEN + IF __UI_DraggingThumb = True THEN _PUTIMAGE (This.Left + 1, ThumbTop + __UI_ScrollbarButtonHeight)-STEP(ImageWidth_Thumb - 2, ThumbHeight - 1), ControlImage_Thumb, , (0, 3 * ImageHeight_Thumb - ImageHeight_Thumb + 2)-STEP(ImageWidth_Thumb - 1, ImageHeight_Thumb - 5) _PUTIMAGE (This.Left + 1, ThumbTop + __UI_ScrollbarButtonHeight)-STEP(ImageWidth_Thumb - 2, 1), ControlImage_Thumb, , (0, 3 * ImageHeight_Thumb - ImageHeight_Thumb)-STEP(ImageWidth_Thumb - 1, 1) _PUTIMAGE (This.Left + 1, ThumbTop + __UI_ScrollbarButtonHeight + ThumbHeight - 2)-STEP(ImageWidth_Thumb - 2, 1), ControlImage_Thumb, , (0, 3 * ImageHeight_Thumb - 4)-STEP(ImageWidth_Thumb - 1, 3) - ELSEIF This.HoveringVScrollbarButton = 3 AND __UI_DraggingThumb = __UI_False THEN + ELSEIF This.HoveringVScrollbarButton = 3 AND __UI_DraggingThumb = False THEN _PUTIMAGE (This.Left + 1, ThumbTop + __UI_ScrollbarButtonHeight)-STEP(ImageWidth_Thumb - 2, ThumbHeight - 1), ControlImage_Thumb, , (0, 2 * ImageHeight_Thumb - ImageHeight_Thumb + 2)-STEP(ImageWidth_Thumb - 1, ImageHeight_Thumb - 5) _PUTIMAGE (This.Left + 1, ThumbTop + __UI_ScrollbarButtonHeight)-STEP(ImageWidth_Thumb - 2, 1), ControlImage_Thumb, , (0, 2 * ImageHeight_Thumb - ImageHeight_Thumb)-STEP(ImageWidth_Thumb - 1, 1) _PUTIMAGE (This.Left + 1, ThumbTop + __UI_ScrollbarButtonHeight + ThumbHeight - 2)-STEP(ImageWidth_Thumb - 2, 1), ControlImage_Thumb, , (0, 2 * ImageHeight_Thumb - 4)-STEP(ImageWidth_Thumb - 1, 3) @@ -1023,7 +1023,7 @@ SUB __UI_DrawDropdownList (This AS __UI_ControlTYPE, ControlState) This.PreviousValue = This.Value This.PreviousInputViewStart = This.InputViewStart __UI_TempTexts(This.ID) = Text(This.ID) - IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = __UI_True + IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = True This.PreviousParentID = This.ParentID IF This.Canvas <> 0 THEN @@ -1044,7 +1044,7 @@ SUB __UI_DrawDropdownList (This AS __UI_ControlTYPE, ControlState) END IF CaptionIndent = 0 - IF This.HasBorder = __UI_True THEN + IF This.HasBorder = True THEN CaptionIndent = 5 LINE (0, 0)-STEP(This.Width - 1, This.Height - 1), This.BorderColor, B END IF @@ -1072,7 +1072,7 @@ SUB __UI_DrawDropdownList (This AS __UI_ControlTYPE, ControlState) IF NOT This.Disabled THEN TempColor~& = This.ForeColor ELSE - TempColor~& = __UI_Darken(Control(__UI_FormID).BackColor, 80) + TempColor~& = Darken(Control(__UI_FormID).BackColor, 80) END IF IF __UI_Focus = This.ID THEN @@ -1099,7 +1099,7 @@ SUB __UI_DrawDropdownList (This AS __UI_ControlTYPE, ControlState) DropdownState = 3 ELSEIF (This.ID = __UI_HoveringID OR This.ID = __UI_ParentDropdownList) AND NOT This.Disabled THEN DropdownState = 2 - ELSEIF This.Disabled = __UI_True THEN + ELSEIF This.Disabled = True THEN DropdownState = 4 ELSE DropdownState = 1 @@ -1147,7 +1147,7 @@ SUB __UI_DrawFrame (This AS __UI_ControlTYPE) IF This.ChildrenRedrawn OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.HelperCanvas = 0 OR (__UI_IsDragging AND Control(__UI_DraggingID).ParentID = This.ID) OR This.Value <> This.PreviousValue OR __UI_ForceRedraw OR __UI_DesignMode THEN 'Last time we drew this frame its children had different images - This.ChildrenRedrawn = __UI_False + This.ChildrenRedrawn = False This.PreviousValue = This.Value __UI_TempCaptions(This.ID) = Caption(This.ID) @@ -1162,7 +1162,7 @@ SUB __UI_DrawFrame (This AS __UI_ControlTYPE) _FONT This.Font - IF This.Hidden = __UI_False THEN + IF This.Hidden = False THEN IF This.BackStyle = __UI_Opaque THEN CLS , This.BackColor ELSE @@ -1175,7 +1175,7 @@ SUB __UI_DrawFrame (This AS __UI_ControlTYPE) IF NOT This.Disabled THEN TempColor~& = This.ForeColor ELSE - TempColor~& = __UI_Darken(Control(__UI_FormID).BackColor, 80) + TempColor~& = Darken(Control(__UI_FormID).BackColor, 80) END IF 'This.Canvas holds the children controls' images @@ -1274,7 +1274,7 @@ SUB __UI_DrawMenuBar (This AS __UI_ControlTYPE, ControlState AS _BYTE) END IF IF This.Disabled THEN - TempColor~& = __UI_Darken(Control(__UI_FormID).BackColor, 80) + TempColor~& = Darken(Control(__UI_FormID).BackColor, 80) END IF Temp& = uprint(__UI_MenuBarOffset, ((This.Height \ 2) - uspacing& \ 2), TempCaption$, LEN(TempCaption$), TempColor~&, 0) @@ -1287,7 +1287,7 @@ SUB __UI_DrawMenuBar (This AS __UI_ControlTYPE, ControlState AS _BYTE) IF __UI_DesignMode THEN IF This.Left + This.Width = __UI_NewMenuBarTextLeft THEN 'Last menu bar item. Next is "Add new" - TempColor~& = __UI_Darken(Control(__UI_FormID).BackColor, 80) + TempColor~& = Darken(Control(__UI_FormID).BackColor, 80) _DEST Control(__UI_FormID).Canvas _FONT (This.Font) Temp& = uprint(__UI_NewMenuBarTextLeft + __UI_MenuBarOffset, ((This.Height \ 2) - uspacing& \ 2), "Add new", 7, TempColor~&, 0) @@ -1346,10 +1346,10 @@ SUB __UI_DrawMenuPanel (This AS __UI_ControlTYPE, ControlState AS _BYTE) TempCaption$ = __UI_TrimAt0$(Caption(i)) IF RIGHT$(TempCaption$, 1) = "-" THEN - HasSeparator = __UI_True + HasSeparator = True TempCaption$ = LEFT$(TempCaption$, LEN(TempCaption$) - 1) ELSE - HasSeparator = __UI_False + HasSeparator = False END IF IF __UI_Focus = i OR (__UI_HoveringID = i AND __UI_Focus = i) THEN @@ -1362,7 +1362,7 @@ SUB __UI_DrawMenuPanel (This AS __UI_ControlTYPE, ControlState AS _BYTE) END IF IF Control(i).Disabled THEN - TempColor~& = __UI_Darken(Control(__UI_FormID).BackColor, 80) + TempColor~& = Darken(Control(__UI_FormID).BackColor, 80) CheckMarkIndex = 3 END IF @@ -1374,7 +1374,7 @@ SUB __UI_DrawMenuPanel (This AS __UI_ControlTYPE, ControlState AS _BYTE) LINE (Control(i).Left + __UI_MenuItemOffset + Control(i).HotKeyOffset, Control(i).Top + Control(i).Height \ 2 + uheight& \ 2 - 1)-STEP(Temp& - 1, 0), TempColor~& END IF - IF Control(i).Value = __UI_True THEN + IF Control(i).Value = True THEN 'Checked menu item _PUTIMAGE (__UI_MenuItemOffset \ 2 - CheckMarkWidth \ 2, Control(i).Top + Control(i).Height \ 2 - CheckMarkHeight \ 2), ControlImage, , (0, CheckMarkIndex * CheckMarkHeight - CheckMarkHeight)-STEP(6, 6) ELSE @@ -1395,7 +1395,7 @@ SUB __UI_DrawMenuPanel (This AS __UI_ControlTYPE, ControlState AS _BYTE) NEXT IF __UI_DesignMode AND LEFT$(This.Name, 5) <> "__UI_" THEN - TempColor~& = __UI_Darken(Control(__UI_FormID).BackColor, 80) + TempColor~& = Darken(Control(__UI_FormID).BackColor, 80) Temp& = uprint(__UI_MenuItemOffset, This.Height - (uheight& + 6), "Add new", 7, TempColor~&, 0) END IF '--- @@ -1415,7 +1415,7 @@ SUB __UI_DrawPictureBox (This AS __UI_ControlTYPE, ControlState AS _BYTE) IF This.Stretch <> This.PreviousStretch OR This.PreviousValue <> This.HelperCanvas OR This.ControlState <> ControlState OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN 'Last time this control was drawn it had a different state/caption, so it'll be redrawn This.ControlState = ControlState - IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = __UI_True + IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = True This.PreviousParentID = This.ParentID This.PreviousValue = This.HelperCanvas This.PreviousStretch = This.Stretch @@ -1441,7 +1441,7 @@ SUB __UI_DrawPictureBox (This AS __UI_ControlTYPE, ControlState AS _BYTE) _PUTIMAGE (0, 0), This.HelperCanvas, This.Canvas END IF - IF This.HasBorder = __UI_True THEN + IF This.HasBorder = True THEN LINE (0, 0)-STEP(This.Width - 1, This.Height - 1), This.BorderColor, B END IF '------