diff --git a/dotscape b/dotscape index 34e3b06..5103f7d 100755 Binary files a/dotscape and b/dotscape differ diff --git a/functional-core/app/app-update.sml b/functional-core/app/app-update.sml index 653fcaf..d75ef3b 100644 --- a/functional-core/app/app-update.sml +++ b/functional-core/app/app-update.sml @@ -358,12 +358,21 @@ struct fun enterBrowseMode model = let val model = AppWith.mode (model, AppType.BROWSE_MODE) - (* should draw modal window as well, but that's not needed right now *) + (* todo: should draw modal window as well *) val fileMsg = LOAD_FILES (#openFilePath model) in (model, FILE fileMsg) end + fun handleFileBrowserAndPath (model, fileBrowser, path) = + let + val model = AppWith.fileBrowserAndPath (model, fileBrowser, path) + (* todo: update and recreate vector indicating text to redraw, + * if not in normal mode *) + in + (model, NO_MAILBOX) + end + fun updateNormalMode (model: app_type, inputMsg) = case inputMsg of MOUSE_MOVE {x = mouseX, y = mouseY} => @@ -388,6 +397,8 @@ struct | KEY_SPACE => enterOrSpaceCoordinates model | USE_TRIANGLES triangles => useTriangles (model, triangles) | TRIANGLES_LOAD_ERROR => trianglesLoadError model + | FILE_BROWSER_AND_PATH {fileBrowser, path} => + handleFileBrowserAndPath (model, fileBrowser, path) fun update (model: app_type, inputMsg) = case #mode model of diff --git a/functional-core/app/app-with.sml b/functional-core/app/app-with.sml index 863017a..dca62ed 100644 --- a/functional-core/app/app-with.sml +++ b/functional-core/app/app-with.sml @@ -9,6 +9,10 @@ sig val mousePosition: AppType.app_type * Real32.real * Real32.real -> AppType.app_type + val fileBrowserAndPath: + AppType.app_type * AppType.file_browser_item vector * string + -> AppType.app_type + val arrowX: AppType.app_type * int -> AppType.app_type val arrowY: AppType.app_type * int -> AppType.app_type @@ -576,4 +580,46 @@ struct , fileBrowser = fileBrowser } end + + fun fileBrowserAndPath (app: app_type, fileBrowser, path) = + let + val + { mode + , xClickPoints + , yClickPoints + , numClickPoints + , windowWidth + , windowHeight + , triangles + , triangleStage + , undo + , redo + , showGraph + , mouseX + , mouseY + , arrowX + , arrowY + , openFilePath = _ + , fileBrowser = _ + } = 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 + , fileBrowser = fileBrowser + , openFilePath = path + } + end end