Skip to content

Commit

Permalink
Remove debug code.
Browse files Browse the repository at this point in the history
  • Loading branch information
FellippeHeitor committed Mar 26, 2018
1 parent ee6520f commit 9f73c43
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 52 deletions.
25 changes: 10 additions & 15 deletions InForm/InForm.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2271,7 +2271,6 @@ SUB __UI_EventDispatcher
__UI_MouseDownOnID = 0

ProcessClick:
echo 3, "Entered ProcessClick"
IF RTRIM$(Control(Control(__UI_HoveringID).ParentID).Name) = "__UI_TextFieldMenu" OR RTRIM$(Control(Control(__UI_HoveringID).ParentID).Name) = "__UI_PreviewMenu" THEN
'Internal context menus - Text field/Design mode options
IF RTRIM$(Control(Control(__UI_HoveringID).ParentID).Name) = "__UI_TextFieldMenu" THEN
Expand Down Expand Up @@ -2583,7 +2582,6 @@ SUB __UI_EventDispatcher
END SELECT
__UI_KeyPress __UI_Focus
ELSE
echo 3, "Will click HoveringID button"
__UI_Click __UI_HoveringID
__UI_KeyHit = 0
END IF
Expand Down Expand Up @@ -3028,7 +3026,6 @@ SUB __UI_EventDispatcher
__UI_KeyHit = 0
END IF
__UI_HoveringID = i
echo 3, "Will ProcessClick after ENTER on Button or similar"
GOTO ProcessClick
ELSEIF Control(__UI_Focus).Type = __UI_Type_ListBox AND __UI_Focus = __UI_ActiveDropdownList THEN
__UI_Focus = __UI_ParentDropdownList
Expand Down Expand Up @@ -3798,7 +3795,6 @@ SUB __UI_EventDispatcher
'Enter activates the default button, if any
IF __UI_IsDragging = False AND __UI_KeyHit = -13 AND __UI_DefaultButtonID > 0 THEN
'Enter released and there is a default button
echo 3, "Will click Default Button"
__UI_Click __UI_DefaultButtonID
__UI_KeyHit = 0
END IF
Expand Down Expand Up @@ -5576,15 +5572,14 @@ SUB __UI_ExpandControlDrawOrder (size&)
REDIM _PRESERVE ControlDrawOrder(UBOUND(ControlDrawOrder) + size&) AS LONG
END SUB


SUB echo (debugSession AS INTEGER, text$)
'$CONSOLE
'DIM prevDest AS LONG
'CONST thisSession = 4
'IF debugSession < thisSession THEN EXIT SUB
'prevDest = _DEST
'_DEST _CONSOLE
'PRINT text$
'_DEST prevDest
END SUB
'SUB echo (debugSession AS INTEGER, text$)
' $CONSOLE
' DIM prevDest AS LONG
' CONST thisSession = 4
' IF debugSession < thisSession THEN EXIT SUB
' prevDest = _DEST
' _DEST _CONSOLE
' PRINT text$
' _DEST prevDest
'END SUB

60 changes: 30 additions & 30 deletions InForm/UiEditor.bas
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ SUB __UI_Click (id AS LONG)
"ALIGNMENUDISTRIBUTEH"
b$ = MKI$(0)
SendData b$, Dummy
Edited = True: echo 1, "edited while aligning controls"
Edited = True
CASE "OPTIONSMENUAUTONAME"
AutoNameControls = NOT AutoNameControls
Control(id).Value = AutoNameControls
Expand All @@ -196,14 +196,14 @@ SUB __UI_Click (id AS LONG)
b$ = MKI$(__UI_Type_MenuBar)
PUT #UiEditorFile, OffsetNewControl, b$
CLOSE #UiEditorFile
Edited = True: echo 1, "edited while inserting menu item in menu bar"
Edited = True
CASE "INSERTMENUMENUITEM"
UiEditorFile = FREEFILE
OPEN "InForm/UiEditor.dat" FOR BINARY AS #UiEditorFile
b$ = MKI$(__UI_Type_MenuItem)
PUT #UiEditorFile, OffsetNewControl, b$
CLOSE #UiEditorFile
Edited = True: echo 1, "edited while inserting menu item in existing menu panel"
Edited = True
CASE "VIEWMENUPREVIEWDETACH"
PreviewAttached = NOT PreviewAttached
Control(id).Value = PreviewAttached
Expand All @@ -229,51 +229,51 @@ SUB __UI_Click (id AS LONG)
b$ = MKI$(Dummy)
PUT #UiEditorFile, OffsetNewControl, b$
CLOSE #UiEditorFile
Edited = True: echo 1, "edited while adding a new control"
Edited = True
CASE "STRETCH"
b$ = MKI$(Control(id).Value)
SendData b$, 14
Edited = True: echo 1, "edited while setting STRETCH"
Edited = True
CASE "HASBORDER"
b$ = MKI$(Control(id).Value)
SendData b$, 15
Edited = True: echo 1, "edited while setting HASBORDER"
Edited = True
CASE "TRANSPARENT"
b$ = MKI$(Control(__UI_GetID("TRANSPARENT")).Value)
SendData b$, 28
Edited = True: echo 1, "edited while setting TRANSPARENT"
Edited = True
CASE "SHOWPERCENTAGE"
b$ = MKI$(Control(id).Value)
SendData b$, 16
Edited = True: echo 1, "edited while setting SHOWPERCENTAGE"
Edited = True
CASE "WORDWRAP"
b$ = MKI$(Control(id).Value)
SendData b$, 17
Edited = True: echo 1, "edited while setting WORDWRAP"
Edited = True
CASE "CANHAVEFOCUS"
b$ = MKI$(Control(id).Value)
SendData b$, 18
Edited = True: echo 1, "edited while setting CANHAVEFOCUS"
Edited = True
CASE "DISABLED"
b$ = MKI$(Control(id).Value)
SendData b$, 19
Edited = True: echo 1, "edited while setting DISABLED"
Edited = True
CASE "HIDDEN"
b$ = MKI$(Control(id).Value)
SendData b$, 20
Edited = True: echo 1, "edited while setting HIDDEN"
Edited = True
CASE "CENTEREDWINDOW"
b$ = MKI$(Control(id).Value)
SendData b$, 21
Edited = True: echo 1, "edited while setting CENTERED WINDOW"
Edited = True
CASE "RESIZABLE"
b$ = MKI$(Control(id).Value)
SendData b$, 29
Edited = True: echo 1, "edited while setting RESIZABLE"
Edited = True
CASE "PASSWORDMASKCB"
b$ = MKI$(Control(id).Value)
SendData b$, 33
Edited = True: echo 1, "edited while setting PASSWORDMASKCB"
Edited = True
CASE "VIEWMENUPREVIEW"
$IF WIN THEN
SHELL _DONTWAIT ".\InForm\UiEditorPreview.exe"
Expand Down Expand Up @@ -361,7 +361,7 @@ SUB __UI_Click (id AS LONG)
PrevListValue = Control(ControlList).Value
b$ = MKL$(zOrderIDs(Control(ControlList).Value)) + MKL$(zOrderIDs(Control(ControlList).Value - 1))
SendData b$, 211
Edited = True: echo 1, "edited while changing z ordering UP"
Edited = True
_DELAY .1
LoadPreview
Moving = True: GOSUB ReloadZList
Expand All @@ -373,7 +373,7 @@ SUB __UI_Click (id AS LONG)
PrevListValue = Control(ControlList).Value
b$ = MKL$(zOrderIDs(Control(ControlList).Value)) + MKL$(zOrderIDs(Control(ControlList).Value + 1))
SendData b$, 212
Edited = True: echo 1, "edited while changing z ordering DOWN"
Edited = True
_DELAY .1
LoadPreview
Moving = True: GOSUB ReloadZList
Expand Down Expand Up @@ -475,19 +475,19 @@ SUB __UI_Click (id AS LONG)
CASE "EDITMENUUNDO"
b$ = MKI$(0)
SendData b$, 214
Edited = True: echo 1, "edited while clicking UNDO"
Edited = True
CASE "EDITMENUREDO"
b$ = MKI$(0)
SendData b$, 215
Edited = True: echo 1, "edited while clicking REDO"
Edited = True
CASE "EDITMENUCP437"
b$ = MKL$(437)
SendData b$, 34 'Encoding
Edited = True: echo 1, "edited while changing to CP437"
Edited = True
CASE "EDITMENUCP1252"
b$ = MKL$(1252)
SendData b$, 34 'Encoding
Edited = True: echo 1, "edited while changing to CP1252"
Edited = True
CASE "VIEWMENUSHOWPOSITIONANDSIZE"
__UI_ShowPositionAndSize = NOT __UI_ShowPositionAndSize
Control(id).Value = __UI_ShowPositionAndSize
Expand Down Expand Up @@ -518,7 +518,7 @@ SUB __UI_MouseUp (id AS LONG)
CASE "RED", "GREEN", "BLUE"
'Compose a new color and send it to the preview
SendNewRGB
Edited = True: echo 1, "edited while sending new RGB"
Edited = True
END SELECT
END SUB

Expand Down Expand Up @@ -578,7 +578,7 @@ SUB __UI_BeforeUpdateDisplay
b$ = SPACE$(2): GET #UiEditorFile, OffsetNewDataFromPreview, b$
IF CVI(b$) = -1 OR CVI(b$) = -3 THEN
'Controls in the editor lose focus when the preview is manipulated
IF CVI(b$) = -1 THEN Edited = True: echo 1, "edited while the preview was 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
__UI_ForceRedraw = True
Expand All @@ -602,10 +602,10 @@ SUB __UI_BeforeUpdateDisplay
Answer = MessageBox("Only .ico files are accepted.", "", MsgBox_OkOnly + MsgBox_Exclamation)
ELSEIF CVI(b$) = -7 THEN
'A new empty form has just been created or a file has just finished loading from disk
Edited = False: echo 1, "reset Edited with signal -7"
Edited = False
ELSEIF CVI(b$) = -8 THEN
'Preview form was resized
Edited = True: echo 1, "-8 PreviewForm was resized"
Edited = True
ELSEIF CVI(b$) = -9 THEN
'User attempted to close the preview form
__UI_Click __UI_GetID("FileMenuNew")
Expand Down Expand Up @@ -664,11 +664,11 @@ SUB __UI_BeforeUpdateDisplay
IF (__UI_KeyHit = ASC("z") OR __UI_KeyHit = ASC("Z")) AND __UI_CtrlIsDown THEN
b$ = MKI$(0)
SendData b$, 214
Edited = True: echo 1, "edited while CTRL Z"
Edited = True
ELSEIF (__UI_KeyHit = ASC("y") OR __UI_KeyHit = ASC("Y")) AND __UI_CtrlIsDown THEN
b$ = MKI$(0)
SendData b$, 215
Edited = True: echo 1, "edited while CTRL Y"
Edited = True
END IF

'Make ZOrdering menu enabled/disabled according to control list
Expand Down Expand Up @@ -1440,11 +1440,11 @@ SUB __UI_KeyPress (id AS LONG)

SELECT EVERYCASE UCASE$(RTRIM$(Control(id).Name))
CASE "PROPERTYVALUE"
Edited = True: echo 1, "edited while changing PROPERTYVALUE"
Edited = True
CASE "ALIGNOPTIONS"
Edited = True: echo 1, "edited while changing ALIGNOPTIONS"
Edited = True
CASE "VALIGNOPTIONS"
Edited = True: echo 1, "edited while changing VALIGNOPTIONS"
Edited = True
END SELECT
END SUB

Expand Down
7 changes: 0 additions & 7 deletions InForm/UiEditorPreview.bas
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,6 @@ SUB __UI_BeforeUpdateDisplay
UiEditorFile = FREEFILE
OPEN "InForm/UiEditor.dat" FOR BINARY AS #UiEditorFile

FOR i = 1 TO UBOUND(Control)
IF Control(i).Type = __UI_Type_Font THEN
IF Control(i).Value > 0 THEN echo 4, RTRIM$(Control(i).Name) + " - " + Text(i) + STR$(Control(i).Value): j = 1
END IF
NEXT
IF j = 1 THEN echo 4, "---------------------"

IF NOT MidRead THEN
MidRead = True
b$ = SPACE$(4): GET #UiEditorFile, OffsetEditorPID, b$
Expand Down

0 comments on commit 9f73c43

Please sign in to comment.