mirror of
https://github.com/FellippeHeitor/InForm.git
synced 2025-01-15 03:49:56 +00:00
Adds toggle for invisible controls (View menu). +
+ saves the new setting to InForm.ini
This commit is contained in:
parent
3ad1975015
commit
be6722fa43
1 changed files with 30 additions and 2 deletions
|
@ -32,6 +32,7 @@ DIM SHARED EditMenuAllowMinMax AS LONG, EditMenuZOrdering AS LONG
|
||||||
|
|
||||||
DIM SHARED ViewMenuPreviewDetach AS LONG
|
DIM SHARED ViewMenuPreviewDetach AS LONG
|
||||||
DIM SHARED ViewMenuShowPositionAndSize AS LONG
|
DIM SHARED ViewMenuShowPositionAndSize AS LONG
|
||||||
|
DIM SHARED ViewMenuShowInvisibleControls AS LONG
|
||||||
DIM SHARED ViewMenuPreview AS LONG, ViewMenuLoadedFonts AS LONG
|
DIM SHARED ViewMenuPreview AS LONG, ViewMenuLoadedFonts AS LONG
|
||||||
|
|
||||||
DIM SHARED InsertMenuMenuBar AS LONG, InsertMenuContextMenu AS LONG
|
DIM SHARED InsertMenuMenuBar AS LONG, InsertMenuContextMenu AS LONG
|
||||||
|
@ -639,6 +640,10 @@ SUB __UI_Click (id AS LONG)
|
||||||
__UI_ShowPositionAndSize = NOT __UI_ShowPositionAndSize
|
__UI_ShowPositionAndSize = NOT __UI_ShowPositionAndSize
|
||||||
Control(id).Value = __UI_ShowPositionAndSize
|
Control(id).Value = __UI_ShowPositionAndSize
|
||||||
SaveSettings
|
SaveSettings
|
||||||
|
CASE ViewMenuShowInvisibleControls
|
||||||
|
__UI_ShowInvisibleControls = NOT __UI_ShowInvisibleControls
|
||||||
|
Control(id).Value = __UI_ShowInvisibleControls
|
||||||
|
SaveSettings
|
||||||
CASE FontSwitchMenuSwitch, FontLB, FontListLB
|
CASE FontSwitchMenuSwitch, FontLB, FontListLB
|
||||||
ShowFontList = NOT ShowFontList
|
ShowFontList = NOT ShowFontList
|
||||||
IF id <> FontSwitchMenuSwitch THEN __UI_MouseEnter FontLB
|
IF id <> FontSwitchMenuSwitch THEN __UI_MouseEnter FontLB
|
||||||
|
@ -713,6 +718,8 @@ SUB __UI_MouseEnter (id AS LONG)
|
||||||
Caption(StatusBar) = "Toggles whether the preview form will be moved with the editor."
|
Caption(StatusBar) = "Toggles whether the preview form will be moved with the editor."
|
||||||
CASE ViewMenuShowPositionAndSize
|
CASE ViewMenuShowPositionAndSize
|
||||||
Caption(StatusBar) = "Toggles whether size and position indicators will be shown in the preview."
|
Caption(StatusBar) = "Toggles whether size and position indicators will be shown in the preview."
|
||||||
|
CASE ViewMenuShowInvisibleControls
|
||||||
|
Caption(StatusBar) = "Toggles whether invisible controls (e.g. ContextMenus) will be shown in the preview."
|
||||||
CASE ViewMenuPreview
|
CASE ViewMenuPreview
|
||||||
Caption(StatusBar) = "Launches the preview window in case it's been closed accidentaly."
|
Caption(StatusBar) = "Launches the preview window in case it's been closed accidentaly."
|
||||||
CASE ViewMenuLoadedFonts
|
CASE ViewMenuLoadedFonts
|
||||||
|
@ -1083,7 +1090,7 @@ SUB __UI_BeforeUpdateDisplay
|
||||||
|
|
||||||
STATIC prevAutoName AS _BYTE, prevMouseSwap AS _BYTE
|
STATIC prevAutoName AS _BYTE, prevMouseSwap AS _BYTE
|
||||||
STATIC prevShowPos AS _BYTE, prevSnapLines AS _BYTE
|
STATIC prevShowPos AS _BYTE, prevSnapLines AS _BYTE
|
||||||
STATIC SignalsFirstSent AS _BYTE
|
STATIC prevShowInvisible AS _BYTE, SignalsFirstSent AS _BYTE
|
||||||
|
|
||||||
IF prevAutoName <> AutoNameControls OR SignalsFirstSent = False THEN
|
IF prevAutoName <> AutoNameControls OR SignalsFirstSent = False THEN
|
||||||
prevAutoName = AutoNameControls
|
prevAutoName = AutoNameControls
|
||||||
|
@ -1103,6 +1110,12 @@ SUB __UI_BeforeUpdateDisplay
|
||||||
Send Client, b$
|
Send Client, b$
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
IF prevShowInvisible <> __UI_ShowInvisibleControls OR SignalsFirstSent = False THEN
|
||||||
|
prevShowInvisible = __UI_ShowInvisibleControls
|
||||||
|
b$ = "SHOWINVISIBLECONTROLS>" + MKI$(__UI_ShowInvisibleControls) + "<END>"
|
||||||
|
Send Client, b$
|
||||||
|
END IF
|
||||||
|
|
||||||
IF prevSnapLines <> __UI_SnapLines OR SignalsFirstSent = False THEN
|
IF prevSnapLines <> __UI_SnapLines OR SignalsFirstSent = False THEN
|
||||||
prevSnapLines = __UI_SnapLines
|
prevSnapLines = __UI_SnapLines
|
||||||
b$ = "SNAPLINES>" + MKI$(__UI_SnapLines) + "<END>"
|
b$ = "SNAPLINES>" + MKI$(__UI_SnapLines) + "<END>"
|
||||||
|
@ -1124,6 +1137,9 @@ SUB __UI_BeforeUpdateDisplay
|
||||||
FirstSelected = CVL(thisData$)
|
FirstSelected = CVL(thisData$)
|
||||||
CASE "DEFAULTBUTTONID"
|
CASE "DEFAULTBUTTONID"
|
||||||
PreviewDefaultButtonID = CVL(thisData$)
|
PreviewDefaultButtonID = CVL(thisData$)
|
||||||
|
CASE "SHOWINVISIBLECONTROLS"
|
||||||
|
__UI_ShowInvisibleControls = CVI(thisData$)
|
||||||
|
Control(ViewMenuShowInvisibleControls).Value = __UI_ShowInvisibleControls
|
||||||
CASE "ORIGINALIMAGEWIDTH"
|
CASE "ORIGINALIMAGEWIDTH"
|
||||||
OriginalImageWidth = CVI(thisData$)
|
OriginalImageWidth = CVI(thisData$)
|
||||||
CASE "ORIGINALIMAGEHEIGHT"
|
CASE "ORIGINALIMAGEHEIGHT"
|
||||||
|
@ -2154,6 +2170,9 @@ SUB SaveSettings
|
||||||
IF __UI_ShowPositionAndSize THEN value$ = "True" ELSE value$ = "False"
|
IF __UI_ShowPositionAndSize THEN value$ = "True" ELSE value$ = "False"
|
||||||
WriteSetting "InForm/InForm.ini", "InForm Settings", "Show position and size", value$
|
WriteSetting "InForm/InForm.ini", "InForm Settings", "Show position and size", value$
|
||||||
|
|
||||||
|
IF __UI_ShowInvisibleControls THEN value$ = "True" ELSE value$ = "False"
|
||||||
|
WriteSetting "InForm/InForm.ini", "InForm Settings", "Show invisible controls", value$
|
||||||
|
|
||||||
IF CheckUpdates THEN value$ = "True" ELSE value$ = "False"
|
IF CheckUpdates THEN value$ = "True" ELSE value$ = "False"
|
||||||
WriteSetting "InForm/InForm.ini", "InForm Settings", "Check for updates", value$
|
WriteSetting "InForm/InForm.ini", "InForm Settings", "Check for updates", value$
|
||||||
|
|
||||||
|
@ -2268,6 +2287,7 @@ SUB __UI_OnLoad
|
||||||
AutoNameControls = True
|
AutoNameControls = True
|
||||||
CheckUpdates = True
|
CheckUpdates = True
|
||||||
__UI_ShowPositionAndSize = True
|
__UI_ShowPositionAndSize = True
|
||||||
|
__UI_ShowInvisibleControls = True
|
||||||
__UI_SnapLines = True
|
__UI_SnapLines = True
|
||||||
|
|
||||||
DIM FileToOpen$, FreeFileNum AS INTEGER
|
DIM FileToOpen$, FreeFileNum AS INTEGER
|
||||||
|
@ -2310,6 +2330,14 @@ SUB __UI_OnLoad
|
||||||
__UI_ShowPositionAndSize = True
|
__UI_ShowPositionAndSize = True
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
value$ = ReadSetting("InForm/InForm.ini", "InForm Settings", "Show invisible controls")
|
||||||
|
IF LEN(value$) THEN
|
||||||
|
__UI_ShowInvisibleControls = (value$ = "True")
|
||||||
|
ELSE
|
||||||
|
WriteSetting "InForm/InForm.ini", "InForm Settings", "Show invisible controls", "True"
|
||||||
|
__UI_ShowInvisibleControls = True
|
||||||
|
END IF
|
||||||
|
|
||||||
value$ = ReadSetting("InForm/InForm.ini", "InForm Settings", "Check for updates")
|
value$ = ReadSetting("InForm/InForm.ini", "InForm Settings", "Check for updates")
|
||||||
IF LEN(value$) THEN
|
IF LEN(value$) THEN
|
||||||
CheckUpdates = (value$ = "True")
|
CheckUpdates = (value$ = "True")
|
||||||
|
@ -2348,6 +2376,7 @@ SUB __UI_OnLoad
|
||||||
Control(OptionsMenuCheckUpdates).Value = CheckUpdates
|
Control(OptionsMenuCheckUpdates).Value = CheckUpdates
|
||||||
Control(OptionsMenuSnapLines).Value = __UI_SnapLines
|
Control(OptionsMenuSnapLines).Value = __UI_SnapLines
|
||||||
Control(ViewMenuShowPositionAndSize).Value = __UI_ShowPositionAndSize
|
Control(ViewMenuShowPositionAndSize).Value = __UI_ShowPositionAndSize
|
||||||
|
Control(ViewMenuShowInvisibleControls).Value = __UI_ShowInvisibleControls
|
||||||
|
|
||||||
IF _FILEEXISTS("InForm/UiEditorPreview.frmbin") THEN KILL "InForm/UiEditorPreview.frmbin"
|
IF _FILEEXISTS("InForm/UiEditorPreview.frmbin") THEN KILL "InForm/UiEditorPreview.frmbin"
|
||||||
|
|
||||||
|
@ -4404,4 +4433,3 @@ FUNCTION SpecialCharsToEscapeCode$ (Text$)
|
||||||
NEXT
|
NEXT
|
||||||
SpecialCharsToEscapeCode$ = Temp$ + CHR$(34)
|
SpecialCharsToEscapeCode$ = Temp$ + CHR$(34)
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue