add fileBrowserIdx field to track which item is selected in the browser
This commit is contained in:
@@ -37,6 +37,7 @@ struct
|
|||||||
, arrowY = 0
|
, arrowY = 0
|
||||||
, openFilePath = ""
|
, openFilePath = ""
|
||||||
, fileBrowser = Vector.fromList []
|
, fileBrowser = Vector.fromList []
|
||||||
|
, fileBrowserIdx = 0
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ sig
|
|||||||
, arrowY: int
|
, arrowY: int
|
||||||
, openFilePath: string
|
, openFilePath: string
|
||||||
, fileBrowser: file_browser_item vector
|
, fileBrowser: file_browser_item vector
|
||||||
|
, fileBrowserIdx: int
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -87,5 +88,6 @@ struct
|
|||||||
, arrowY: int
|
, arrowY: int
|
||||||
, openFilePath: string
|
, openFilePath: string
|
||||||
, fileBrowser: file_browser_item vector
|
, fileBrowser: file_browser_item vector
|
||||||
|
, fileBrowserIdx: int
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ sig
|
|||||||
AppType.app_type * AppType.file_browser_item vector * string
|
AppType.app_type * AppType.file_browser_item vector * string
|
||||||
-> AppType.app_type
|
-> AppType.app_type
|
||||||
|
|
||||||
|
val fileBrowserIdx: AppType.app_type * int -> AppType.app_type
|
||||||
|
|
||||||
val arrowX: AppType.app_type * int -> AppType.app_type
|
val arrowX: AppType.app_type * int -> AppType.app_type
|
||||||
val arrowY: AppType.app_type * int -> AppType.app_type
|
val arrowY: AppType.app_type * int -> AppType.app_type
|
||||||
|
|
||||||
@@ -86,6 +88,7 @@ struct
|
|||||||
, arrowY = _
|
, arrowY = _
|
||||||
, openFilePath
|
, openFilePath
|
||||||
, fileBrowser
|
, fileBrowser
|
||||||
|
, fileBrowserIdx
|
||||||
} = app
|
} = app
|
||||||
|
|
||||||
val newUndo = newUndoHd :: undo
|
val newUndo = newUndoHd :: undo
|
||||||
@@ -107,6 +110,7 @@ struct
|
|||||||
, arrowY = arrowY
|
, arrowY = arrowY
|
||||||
, openFilePath = openFilePath
|
, openFilePath = openFilePath
|
||||||
, fileBrowser = fileBrowser
|
, fileBrowser = fileBrowser
|
||||||
|
, fileBrowserIdx = fileBrowserIdx
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -132,6 +136,7 @@ struct
|
|||||||
, arrowY = _
|
, arrowY = _
|
||||||
, openFilePath
|
, openFilePath
|
||||||
, fileBrowser
|
, fileBrowser
|
||||||
|
, fileBrowserIdx
|
||||||
} = app
|
} = app
|
||||||
|
|
||||||
val newTriangle = {x1 = x1, y1 = y1, x2 = x2, y2 = y2, x3 = x3, y3 = y3}
|
val newTriangle = {x1 = x1, y1 = y1, x2 = x2, y2 = y2, x3 = x3, y3 = y3}
|
||||||
@@ -155,6 +160,7 @@ struct
|
|||||||
, arrowY = arrowY
|
, arrowY = arrowY
|
||||||
, openFilePath = openFilePath
|
, openFilePath = openFilePath
|
||||||
, fileBrowser = fileBrowser
|
, fileBrowser = fileBrowser
|
||||||
|
, fileBrowserIdx = fileBrowserIdx
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -178,6 +184,7 @@ struct
|
|||||||
, arrowY
|
, arrowY
|
||||||
, openFilePath
|
, openFilePath
|
||||||
, fileBrowser
|
, fileBrowser
|
||||||
|
, fileBrowserIdx
|
||||||
} = app
|
} = app
|
||||||
in
|
in
|
||||||
{ mode = mode
|
{ mode = mode
|
||||||
@@ -197,6 +204,7 @@ struct
|
|||||||
, arrowY = arrowY
|
, arrowY = arrowY
|
||||||
, openFilePath = openFilePath
|
, openFilePath = openFilePath
|
||||||
, fileBrowser = fileBrowser
|
, fileBrowser = fileBrowser
|
||||||
|
, fileBrowserIdx = fileBrowserIdx
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -220,6 +228,7 @@ struct
|
|||||||
, arrowY = _
|
, arrowY = _
|
||||||
, openFilePath
|
, openFilePath
|
||||||
, fileBrowser
|
, fileBrowser
|
||||||
|
, fileBrowserIdx
|
||||||
} = app
|
} = app
|
||||||
in
|
in
|
||||||
{ mode = mode
|
{ mode = mode
|
||||||
@@ -239,6 +248,7 @@ struct
|
|||||||
, arrowY = arrowY
|
, arrowY = arrowY
|
||||||
, openFilePath = openFilePath
|
, openFilePath = openFilePath
|
||||||
, fileBrowser = fileBrowser
|
, fileBrowser = fileBrowser
|
||||||
|
, fileBrowserIdx = fileBrowserIdx
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -264,6 +274,7 @@ struct
|
|||||||
, arrowY
|
, arrowY
|
||||||
, openFilePath
|
, openFilePath
|
||||||
, fileBrowser
|
, fileBrowser
|
||||||
|
, fileBrowserIdx
|
||||||
} = app
|
} = app
|
||||||
|
|
||||||
val xClickPoints = ClickPoints.generate (wStart, wFinish, numClickPoints)
|
val xClickPoints = ClickPoints.generate (wStart, wFinish, numClickPoints)
|
||||||
@@ -286,6 +297,7 @@ struct
|
|||||||
, arrowY = arrowY
|
, arrowY = arrowY
|
||||||
, openFilePath = openFilePath
|
, openFilePath = openFilePath
|
||||||
, fileBrowser = fileBrowser
|
, fileBrowser = fileBrowser
|
||||||
|
, fileBrowserIdx = fileBrowserIdx
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -332,6 +344,7 @@ struct
|
|||||||
, arrowY
|
, arrowY
|
||||||
, openFilePath
|
, openFilePath
|
||||||
, fileBrowser
|
, fileBrowser
|
||||||
|
, fileBrowserIdx
|
||||||
} = app
|
} = app
|
||||||
in
|
in
|
||||||
{ mode = mode
|
{ mode = mode
|
||||||
@@ -351,6 +364,7 @@ struct
|
|||||||
, arrowY = arrowY
|
, arrowY = arrowY
|
||||||
, openFilePath = openFilePath
|
, openFilePath = openFilePath
|
||||||
, fileBrowser = fileBrowser
|
, fileBrowser = fileBrowser
|
||||||
|
, fileBrowserIdx = fileBrowserIdx
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -375,6 +389,7 @@ struct
|
|||||||
, arrowY
|
, arrowY
|
||||||
, openFilePath
|
, openFilePath
|
||||||
, fileBrowser
|
, fileBrowser
|
||||||
|
, fileBrowserIdx
|
||||||
} = app
|
} = app
|
||||||
|
|
||||||
val newUndo =
|
val newUndo =
|
||||||
@@ -401,6 +416,7 @@ struct
|
|||||||
, arrowY = arrowY
|
, arrowY = arrowY
|
||||||
, openFilePath = openFilePath
|
, openFilePath = openFilePath
|
||||||
, fileBrowser = fileBrowser
|
, fileBrowser = fileBrowser
|
||||||
|
, fileBrowserIdx = fileBrowserIdx
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -425,6 +441,7 @@ struct
|
|||||||
, arrowY
|
, arrowY
|
||||||
, openFilePath
|
, openFilePath
|
||||||
, fileBrowser
|
, fileBrowser
|
||||||
|
, fileBrowserIdx
|
||||||
} = app
|
} = app
|
||||||
|
|
||||||
val newUndo = newUndoHd :: undo
|
val newUndo = newUndoHd :: undo
|
||||||
@@ -450,6 +467,7 @@ struct
|
|||||||
, arrowY = arrowY
|
, arrowY = arrowY
|
||||||
, openFilePath = openFilePath
|
, openFilePath = openFilePath
|
||||||
, fileBrowser = fileBrowser
|
, fileBrowser = fileBrowser
|
||||||
|
, fileBrowserIdx = fileBrowserIdx
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -473,6 +491,7 @@ struct
|
|||||||
, showGraph = _
|
, showGraph = _
|
||||||
, openFilePath
|
, openFilePath
|
||||||
, fileBrowser
|
, fileBrowser
|
||||||
|
, fileBrowserIdx
|
||||||
} = app
|
} = app
|
||||||
in
|
in
|
||||||
{ mode = mode
|
{ mode = mode
|
||||||
@@ -492,6 +511,7 @@ struct
|
|||||||
, arrowY = arrowY
|
, arrowY = arrowY
|
||||||
, openFilePath = openFilePath
|
, openFilePath = openFilePath
|
||||||
, fileBrowser = fileBrowser
|
, fileBrowser = fileBrowser
|
||||||
|
, fileBrowserIdx = fileBrowserIdx
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -515,6 +535,7 @@ struct
|
|||||||
, showGraph
|
, showGraph
|
||||||
, openFilePath
|
, openFilePath
|
||||||
, fileBrowser
|
, fileBrowser
|
||||||
|
, fileBrowserIdx
|
||||||
} = app
|
} = app
|
||||||
in
|
in
|
||||||
{ mode = newMode
|
{ mode = newMode
|
||||||
@@ -534,6 +555,7 @@ struct
|
|||||||
, arrowY = arrowY
|
, arrowY = arrowY
|
||||||
, openFilePath = openFilePath
|
, openFilePath = openFilePath
|
||||||
, fileBrowser = fileBrowser
|
, fileBrowser = fileBrowser
|
||||||
|
, fileBrowserIdx = fileBrowserIdx
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -557,6 +579,7 @@ struct
|
|||||||
, triangleStage = _
|
, triangleStage = _
|
||||||
, openFilePath
|
, openFilePath
|
||||||
, fileBrowser
|
, fileBrowser
|
||||||
|
, fileBrowserIdx
|
||||||
} = app
|
} = app
|
||||||
|
|
||||||
val triangleStage = NO_TRIANGLE
|
val triangleStage = NO_TRIANGLE
|
||||||
@@ -578,6 +601,7 @@ struct
|
|||||||
, arrowY = arrowY
|
, arrowY = arrowY
|
||||||
, openFilePath = openFilePath
|
, openFilePath = openFilePath
|
||||||
, fileBrowser = fileBrowser
|
, fileBrowser = fileBrowser
|
||||||
|
, fileBrowserIdx = fileBrowserIdx
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -601,6 +625,7 @@ struct
|
|||||||
, arrowY
|
, arrowY
|
||||||
, openFilePath = _
|
, openFilePath = _
|
||||||
, fileBrowser = _
|
, fileBrowser = _
|
||||||
|
, fileBrowserIdx = _
|
||||||
} = app
|
} = app
|
||||||
in
|
in
|
||||||
{ mode = mode
|
{ mode = mode
|
||||||
@@ -618,8 +643,53 @@ struct
|
|||||||
, mouseY = mouseY
|
, mouseY = mouseY
|
||||||
, arrowX = arrowX
|
, arrowX = arrowX
|
||||||
, arrowY = arrowY
|
, arrowY = arrowY
|
||||||
, fileBrowser = fileBrowser
|
|
||||||
, openFilePath = path
|
, openFilePath = path
|
||||||
|
, fileBrowser = fileBrowser
|
||||||
|
, fileBrowserIdx = 0
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
fun fileBrowserIdx (app: app_type, newFileBrowserIdx) =
|
||||||
|
let
|
||||||
|
val
|
||||||
|
{ mode
|
||||||
|
, xClickPoints
|
||||||
|
, yClickPoints
|
||||||
|
, numClickPoints
|
||||||
|
, windowWidth
|
||||||
|
, windowHeight
|
||||||
|
, triangles
|
||||||
|
, triangleStage
|
||||||
|
, undo
|
||||||
|
, redo
|
||||||
|
, showGraph
|
||||||
|
, mouseX
|
||||||
|
, mouseY
|
||||||
|
, arrowX
|
||||||
|
, arrowY
|
||||||
|
, openFilePath = openFilePath
|
||||||
|
, fileBrowser = fileBrowser
|
||||||
|
, fileBrowserIdx = _
|
||||||
|
} = app
|
||||||
|
in
|
||||||
|
{ mode = mode
|
||||||
|
, xClickPoints = xClickPoints
|
||||||
|
, yClickPoints = yClickPoints
|
||||||
|
, numClickPoints = numClickPoints
|
||||||
|
, triangles = triangles
|
||||||
|
, triangleStage = triangleStage
|
||||||
|
, windowWidth = windowWidth
|
||||||
|
, windowHeight = windowHeight
|
||||||
|
, undo = undo
|
||||||
|
, redo = redo
|
||||||
|
, showGraph = showGraph
|
||||||
|
, mouseX = mouseX
|
||||||
|
, mouseY = mouseY
|
||||||
|
, arrowX = arrowX
|
||||||
|
, arrowY = arrowY
|
||||||
|
, openFilePath = openFilePath
|
||||||
|
, fileBrowser = fileBrowser
|
||||||
|
, fileBrowserIdx = newFileBrowserIdx
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user