diff --git a/InForm/InForm.ui b/InForm/InForm.ui index d56d26c..7b4c4d6 100644 --- a/InForm/InForm.ui +++ b/InForm/InForm.ui @@ -439,8 +439,8 @@ SUB __UI_InternalMenus __UI_NewID = __UI_NewControl(__UI_Type_ContextMenu, "__UI_PreviewMenu", 0, 0, 0, 0, 0) Control(__UI_NewID).Font = SetFont("segoeui.ttf?arial.ttf?/Library/Fonts/Arial.ttf?InForm/resources/NotoMono-Regular.ttf?cour.ttf", 12) - 'Hotkeys used: - 'A, B, C, D, E, G, H, I, L, M, N, O, P, R, S, T, U, V, W, X, Y, Z + 'Hotkeys available: + 'F, J, K, Q __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuNewMenuBar", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) SetCaption __UI_GetID("__UI_PreviewMenuNewMenuBar"), "New &MenuBar control" @@ -455,6 +455,10 @@ SUB __UI_InternalMenus SetCaption __UI_GetID("__UI_PreviewMenuSetDefaultButton"), "&Set as default button-" ToolTip(__UI_NewID) = "The default button can be triggered with Enter even if it doesn't have focus at run time." + __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuBindControls", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) + SetCaption __UI_GetID("__UI_PreviewMenuBindControls"), "Bind selected controls-" + ToolTip(__UI_NewID) = "The default button can be triggered with Enter even if it doesn't have focus at run time." + __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "__UI_PreviewMenuConvertType", 0, 0, 0, 0, __UI_GetID("__UI_PreviewMenu")) SetCaption __UI_GetID("__UI_PreviewMenuConvertType"), "Co&nvert to type-" diff --git a/InForm/UiEditor.bas b/InForm/UiEditor.bas index a89904c..c48f873 100644 --- a/InForm/UiEditor.bas +++ b/InForm/UiEditor.bas @@ -16,6 +16,7 @@ DIM SHARED HelpMenu AS LONG, FontSwitchMenu AS LONG DIM SHARED Toolbox AS LONG, ColorMixer AS LONG DIM SHARED OpenFrame AS LONG, ZOrdering AS LONG DIM SHARED ControlProperties AS LONG, ControlToggles AS LONG +DIM SHARED SetControlBinding AS LONG 'Menu items DIM SHARED FileMenuNew AS LONG, FileMenuOpen AS LONG @@ -38,7 +39,7 @@ DIM SHARED EditMenuCopy AS LONG, EditMenuPaste AS LONG DIM SHARED EditMenuDelete AS LONG, EditMenuSelectAll AS LONG DIM SHARED EditMenuCP437 AS LONG, EditMenuCP1252 AS LONG DIM SHARED EditMenuConvertType AS LONG, EditMenuSetDefaultButton AS LONG -DIM SHARED EditMenuRestoreDimensions AS LONG +DIM SHARED EditMenuRestoreDimensions AS LONG, EditMenuBindControls AS LONG DIM SHARED EditMenuAllowMinMax AS LONG, EditMenuZOrdering AS LONG DIM SHARED ViewMenuPreviewDetach AS LONG @@ -101,6 +102,19 @@ DIM SHARED ShowOnlyFrmbinFilesCB AS LONG, SaveFrmOnlyCB AS LONG DIM SHARED ControlList AS LONG, UpBT AS LONG DIM SHARED DownBT AS LONG, CloseZOrderingBT AS LONG +'Set binding dialog +DIM SHARED SourceControlLB AS LONG +DIM SHARED SourceControlNameLB AS LONG +DIM SHARED TargetControlLB AS LONG +DIM SHARED TargetControlNameLB AS LONG +DIM SHARED SwapBT AS LONG +DIM SHARED SourcePropertyLB AS LONG +DIM SHARED SourcePropertyList AS LONG +DIM SHARED TargetPropertyLB AS LONG +DIM SHARED TargetPropertyList AS LONG +DIM SHARED BindBT AS LONG +DIM SHARED CancelBindBT AS LONG + 'Properties DIM SHARED TextAlignLB AS LONG, AlignOptions AS LONG DIM SHARED VerticalAlignLB AS LONG, VAlignOptions AS LONG @@ -150,7 +164,7 @@ DIM SHARED UndoPointer AS INTEGER, TotalUndoImages AS INTEGER DIM SHARED totalBytesSent AS _UNSIGNED _INTEGER64 DIM SHARED RecentMenuItem(1 TO 9) AS LONG, RecentListBuilt AS _BYTE DIM SHARED LoadedWithGifExtension AS _BYTE, AddGifExtension AS _BYTE -DIM SHARED TotalGifLoaded AS LONG +DIM SHARED TotalGifLoaded AS LONG, SetBindingDialogOpen AS _BYTE TYPE newInputBox ID AS LONG @@ -588,6 +602,18 @@ SUB __UI_Click (id AS LONG) Control(ZOrdering).Left = 18: Control(ZOrdering).Top = 40 __UI_Focus = ControlList ZOrderingDialogOpen = True + CASE EditMenuBindControls + Caption(StatusBar) = "Setting control bindings..." + Control(DialogBG).Left = 0: Control(DialogBG).Top = 0 + Control(SetControlBinding).Left = 83: Control(SetControlBinding).Top = 192 + __UI_Focus = SourcePropertyList + SetBindingDialogOpen = True + CASE SwapBT + SWAP Caption(SourceControlNameLB), Caption(TargetControlNameLB) + CASE BindBT, CancelBindBT + Control(DialogBG).Left = -600: Control(DialogBG).Top = -600 + Control(SetControlBinding).Left = -600: Control(SetControlBinding).Top = -600 + SetBindingDialogOpen = False CASE CloseZOrderingBT Caption(StatusBar) = "Ready." Control(DialogBG).Left = -600: Control(DialogBG).Top = -600 diff --git a/InForm/UiEditor.frm b/InForm/UiEditor.frm index 26f7540..9102d64 100644 --- a/InForm/UiEditor.frm +++ b/InForm/UiEditor.frm @@ -150,6 +150,10 @@ SUB __UI_LoadForm SetCaption __UI_NewID, "Restore &image dimensions" Control(__UI_NewID).Disabled = True + __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "EditMenuBindControls", 103, 18, 0, 88, __UI_GetID("EditMenu")) + SetCaption __UI_NewID, "&Bind controls..." + 'Control(__UI_NewID).Disabled = True + __UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "EditMenuAllowMinMax", 103, 18, 0, 88, __UI_GetID("EditMenu")) SetCaption __UI_NewID, "Validate .Min/.Ma&x bounds-" Control(__UI_NewID).Disabled = True @@ -764,6 +768,97 @@ SUB __UI_LoadForm SetCaption __UI_NewID, "Close" Control(__UI_NewID).CanHaveFocus = True + __UI_NewID = __UI_NewControl(__UI_Type_Frame, "SetControlBinding", 434, 216, -600, -600, 0) + SetCaption __UI_NewID, "Set control binding" + Control(__UI_NewID).HasBorder = True + Control(__UI_NewID).Value = 11 + Control(__UI_NewID).BorderSize = 1 + + __UI_NewID = __UI_NewControl(__UI_Type_Label, "SourceControlLB", 100, 23, 19, 18, __UI_GetID("SetControlBinding")) + SetCaption __UI_NewID, "Source control:" + Control(__UI_NewID).VAlign = __UI_Middle + + __UI_NewID = __UI_NewControl(__UI_Type_Label, "SourceControlNameLB", 311, 23, 110, 18, __UI_GetID("SetControlBinding")) + SetCaption __UI_NewID, "SourceControlName" + Control(__UI_NewID).VAlign = __UI_Middle + + __UI_NewID = __UI_NewControl(__UI_Type_Label, "TargetControlLB", 100, 23, 19, 46, __UI_GetID("SetControlBinding")) + SetCaption __UI_NewID, "Target control:" + Control(__UI_NewID).VAlign = __UI_Middle + + __UI_NewID = __UI_NewControl(__UI_Type_Label, "TargetControlNameLB", 311, 23, 110, 46, __UI_GetID("SetControlBinding")) + SetCaption __UI_NewID, "TargetControlName" + Control(__UI_NewID).VAlign = __UI_Middle + + __UI_NewID = __UI_NewControl(__UI_Type_Button, "SwapBT", 62, 23, 359, 32, __UI_GetID("SetControlBinding")) + SetCaption __UI_NewID, "Swap" + Control(__UI_NewID).CanHaveFocus = True + + __UI_NewID = __UI_NewControl(__UI_Type_Label, "SourcePropertyLB", 112, 23, 19, 99, __UI_GetID("SetControlBinding")) + SetCaption __UI_NewID, "Source property:" + Control(__UI_NewID).VAlign = __UI_Middle + + __UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "SourcePropertyList", 295, 23, 124, 99, __UI_GetID("SetControlBinding")) + AddItem __UI_NewID, "Top" + AddItem __UI_NewID, "Left" + AddItem __UI_NewID, "Width" + AddItem __UI_NewID, "Height" + AddItem __UI_NewID, "Bordersize" + AddItem __UI_NewID, "Padding" + AddItem __UI_NewID, "Value" + AddItem __UI_NewID, "Min" + AddItem __UI_NewID, "Max" + AddItem __UI_NewID, "Interval" + AddItem __UI_NewID, "MinInterval" + AddItem __UI_NewID, "Stretch" + AddItem __UI_NewID, "HasBorder" + AddItem __UI_NewID, "ShowPercentage" + AddItem __UI_NewID, "AutoScroll" + AddItem __UI_NewID, "AutoSize" + AddItem __UI_NewID, "PasswordField" + AddItem __UI_NewID, "Disabled" + AddItem __UI_NewID, "Hidden" + Control(__UI_NewID).HasBorder = True + Control(__UI_NewID).Value = 7 + Control(__UI_NewID).CanHaveFocus = True + Control(__UI_NewID).BorderSize = 1 + + __UI_NewID = __UI_NewControl(__UI_Type_Label, "TargetPropertyLB", 112, 23, 19, 127, __UI_GetID("SetControlBinding")) + SetCaption __UI_NewID, "Target property:" + Control(__UI_NewID).VAlign = __UI_Middle + + __UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "TargetPropertyList", 295, 23, 124, 127, __UI_GetID("SetControlBinding")) + AddItem __UI_NewID, "Top" + AddItem __UI_NewID, "Left" + AddItem __UI_NewID, "Width" + AddItem __UI_NewID, "Height" + AddItem __UI_NewID, "Bordersize" + AddItem __UI_NewID, "Padding" + AddItem __UI_NewID, "Value" + AddItem __UI_NewID, "Min" + AddItem __UI_NewID, "Max" + AddItem __UI_NewID, "Interval" + AddItem __UI_NewID, "MinInterval" + AddItem __UI_NewID, "Stretch" + AddItem __UI_NewID, "HasBorder" + AddItem __UI_NewID, "ShowPercentage" + AddItem __UI_NewID, "AutoScroll" + AddItem __UI_NewID, "AutoSize" + AddItem __UI_NewID, "PasswordField" + AddItem __UI_NewID, "Disabled" + AddItem __UI_NewID, "Hidden" + Control(__UI_NewID).HasBorder = True + Control(__UI_NewID).Value = 7 + Control(__UI_NewID).CanHaveFocus = True + Control(__UI_NewID).BorderSize = 1 + + __UI_NewID = __UI_NewControl(__UI_Type_Button, "BindBT", 80, 23, 131, 173, __UI_GetID("SetControlBinding")) + SetCaption __UI_NewID, "Bind" + Control(__UI_NewID).CanHaveFocus = True + + __UI_NewID = __UI_NewControl(__UI_Type_Button, "CancelBindBT", 80, 23, 224, 173, __UI_GetID("SetControlBinding")) + SetCaption __UI_NewID, "Cancel" + Control(__UI_NewID).CanHaveFocus = True END SUB SUB __UI_AssignIDs @@ -797,6 +892,7 @@ SUB __UI_AssignIDs EditMenuCP1252 = __UI_GetID("EditMenuCP1252") EditMenuSetDefaultButton = __UI_GetID("EditMenuSetDefaultButton") EditMenuRestoreDimensions = __UI_GetID("EditMenuRestoreDimensions") + EditMenuBindControls = __UI_GetID("EditMenuBindControls") EditMenuAllowMinMax = __UI_GetID("EditMenuAllowMinMax") EditMenuZOrdering = __UI_GetID("EditMenuZOrdering") ViewMenuPreviewDetach = __UI_GetID("ViewMenuPreviewDetach") @@ -942,4 +1038,16 @@ SUB __UI_AssignIDs FileMenuRecent9 = __UI_GetID("FileMenuRecent9") KeyboardComboLB = __UI_GetID("KeyboardComboLB") KeyboardComboBT = __UI_GetID("KeyboardComboBT") + SetControlBinding = __UI_GetID("SetControlBinding") + SourceControlLB = __UI_GetID("SourceControlLB") + SourceControlNameLB = __UI_GetID("SourceControlNameLB") + TargetControlLB = __UI_GetID("TargetControlLB") + TargetControlNameLB = __UI_GetID("TargetControlNameLB") + SwapBT = __UI_GetID("SwapBT") + SourcePropertyLB = __UI_GetID("SourcePropertyLB") + SourcePropertyList = __UI_GetID("SourcePropertyList") + TargetPropertyLB = __UI_GetID("TargetPropertyLB") + TargetPropertyList = __UI_GetID("TargetPropertyList") + BindBT = __UI_GetID("BindBT") + CancelBindBT = __UI_GetID("CancelBindBT") END SUB