GithubHelp home page GithubHelp logo

trevordevore / levurehelper-file_browser Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 2.0 7 KB

Levure helper for creating a file browser control in your application

License: MIT License

livecode levure dataview levure-helper hacktoberfest

levurehelper-file_browser's Introduction

File Browser Helper

The File Browser helper is an example of a helper that extends the DataView Tree behavior. It will list the folders and files of a root folder and allow the user to drill down into the contents of sub-folders.

This helper includes a behavior script that can be assigned to a DataView. When in use the behavior chain of the DataView group control is as follows:

File Browser DataView Tree Behavior > DataView Tree Behavior > DataView Behavior

The helper includes the row templates necessary for display files and folders.

Note that this helper requires the DataView Tree helper and DataView helper.

Demo

The DataView Demo application includes an example of using this helper:

https://github.com/trevordevore/dataview_demo

Including File Browser in your project

To include the File Browser Dataview control in your project (using git):

  1. Submodule the File Browser Dataview control https://github.com/trevordevore/levurehelper-file_browser to app/helpers/file_browser
  2. Submodule the DataView helper https://github.com/trevordevore/levurehelper-dataview to app/helpers/dataview
  3. Submodule the DataView Tree helper https://github.com/trevordevore/levurehelper-dataview_tree to app/helpers/dataview-tree

Creating

To create a File Browser DataView control call the command createNewFileBrowserDataView while working in the IDE. This will copy the "DataView Template" group from the "DataViewControlTemplate" stack that comes with the DataView helper onto the current card of the current stack. It will also set the necessary behaviors and properties in order or the File Browser to work.

Usage

To display the contents of a folder set the dvRootFolder property.

Example:

on mouseUp
	answer folder "Select folder to display:"
	if it is not empty then
		set the dvRootFolder of group "File Browser DataView" to it
	end if
end mouseUp

API

levurehelper-file_browser's People

Contributors

macmikey avatar trevordevore avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

macmikey justuni

levurehelper-file_browser's Issues

Doesn't render?

Still debugging, but does not render. I got the group to install, and the behaviors all seem to be current. Firing the (corrected) example code (see PR #1) seems to generate the array, but the rendering never happens.

Installer add another layer of behavior script

I think the installer for the fb should add one additional behavior layer above the fb, for storing the developer's code that is specific to a project. Example: I am adding context menu handlers, keyboard events, a double-click handler, etc., but none of that should be foisted on the developer in every fb, so it should probably be up a level from the fb (it could be in a script for the fb group, but this is Levure, so it should be in a behavior SOS).
The question I am wrestling with is placement of said SOS. When the installer runs it could prompt, or have a dialog, or for the git-it-done version I'm thinking of just throwing it into /ui//behaviors. Thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.