diff --git a/LEARN.md b/LEARN.md index 96f307d..ed2e677 100644 --- a/LEARN.md +++ b/LEARN.md @@ -37,7 +37,7 @@ already being productive means having a bang up time doin' it all. - [14 - Kindergarten - Concurrent and Parallel Programing](https://docs.google.com/document/d/10MGPC7j4lpGrMlQS4xtQTEGrvpBecgDUnqu1OrjSVxk) - [15 - Pulling it All Togeher With A Real GUI App - clos-encounters game](https://github.com/rabbibotton/clos-encounters) -CLOG Videos +CLOG Video Series - [CLOG "Plunger" Video series use CLOG Builder to create a pro-app](https://www.youtube.com/playlist?list=PLSUeblYuDUiOucAaqkrVlmOG4p-q7lFU6) - [CLOG Extra - Learn tips on using CLOG](https://www.youtube.com/playlist?list=PLSUeblYuDUiNWHCf8xbHNlxPFQ5clF0YG) @@ -59,15 +59,6 @@ Full Free Books:  -CLOG Builder Tutorials (Reddit links) - -- [01 - Chat App ](https://www.reddit.com/r/lisp/comments/sj1tv5/clog_builder_tutorial_1_a_chat_app_from_start_to/) -- [02 - Building a Web Page ](https://www.reddit.com/r/lisp/comments/sn8j77/clog_builder_tutorial_2_building_a_web_page/) -- [03 - Importing HTML in to Builder ](https://www.reddit.com/r/lisp/comments/snvv0w/clog_builder_tutorial_3_importing_html_adding/) -- [04 - CLOS-CONTACT - database controls, a complete application](https://www.reddit.com/r/lisp/comments/t61sib/clog_builder_tutorial_4_a_complete_database_app/) - - (Completed Tutorial 4 at https://github.com/rabbibotton/clos-contact but you better do the tutorial!) -- [05 - Using and Creating Controls ](https://www.reddit.com/r/lisp/comments/w2d6dr/builder_tutorial_5_using_and_creating_lisp_custom/) - CLOG "The Framework" (Code Tutorials) - [01-tutorial.lisp](tutorial/01-tutorial.lisp) - Hello World @@ -106,6 +97,15 @@ CLOG "The Framework" (Code Tutorials) - [34-tutorial.lisp](tutorial/34-tutorial.lisp) - 2D WebGL example - [35-tutorial.lisp](tutorial/35-tutorial.lisp) - 3D WebGL example +CLOG Builder Tutorials (Reddit links) + +- [01 - Chat App ](https://www.reddit.com/r/lisp/comments/sj1tv5/clog_builder_tutorial_1_a_chat_app_from_start_to/) +- [02 - Building a Web Page ](https://www.reddit.com/r/lisp/comments/sn8j77/clog_builder_tutorial_2_building_a_web_page/) +- [03 - Importing HTML in to Builder ](https://www.reddit.com/r/lisp/comments/snvv0w/clog_builder_tutorial_3_importing_html_adding/) +- [04 - CLOS-CONTACT - database controls, a complete application](https://www.reddit.com/r/lisp/comments/t61sib/clog_builder_tutorial_4_a_complete_database_app/) + - (Completed Tutorial 4 at https://github.com/rabbibotton/clos-contact but you better do the tutorial!) +- [05 - Using and Creating Controls ](https://www.reddit.com/r/lisp/comments/w2d6dr/builder_tutorial_5_using_and_creating_lisp_custom/) + CLOG Demos - Learn through Projects - [01-demo.lisp](demos/01-demo.lisp) - Sparkey the Snake Game @@ -122,8 +122,7 @@ Misc CLOG Tutorials MANUAL -https://rabbibotton.github.io/clog/clog-manual.html - +- [CLOG - Reference Manual](https://rabbibotton.github.io/clog/clog-manual.html) GENERAL INFORMATION diff --git a/README.md b/README.md index bb98d35..b6f0cde 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ ### License BSD 3-Clause License -[Learn to program Common Lisp and CLOG here - LEARN.md](LEARN.md) +- [Learn to program Common Lisp and CLOG here - LEARN.md](LEARN.md) -[Video of CLOG Builder in action](https://youtu.be/CgTJMxsz3EY) +- [Video of CLOG Builder in action](https://youtu.be/CgTJMxsz3EY) --- @@ -19,11 +19,9 @@ frameworks and website frameworks. The CLOG package starts up the connectivity to the browser or other websocket client (often a browser embedded in a native template application.) -[CLOG - Technical Overview and Purpose](CONCEPT.md) +- [CLOG - Reference Manual](https://rabbibotton.github.io/clog/clog-manual.html) -[CLOG - Reference Manual](https://rabbibotton.github.io/clog/clog-manual.html) - -STATUS: CLOG and CLOG Builder 1.9 released. +STATUS: CLOG and CLOG Builder 2.0 released. CLOG is actually based on GNOGA, a framework I wrote for Ada in 2013 and used in commercial production code for the last 10+ years. CLOG @@ -53,66 +51,76 @@ programming logic, events and decisions are done on the server which can be local, or remote over the web. CLOG is developed with ECL and SBCL, it is tested fairly regulary on - Linux, Windows, Android, Rasperry Pi, and Mac. It - should in theory work out of the box on any system with Quicklisp - (although you could hand install) and CLACK (easily switched out - and the ecl Android/iPhone branch for example doesn't use). +Linux, Windows, Android, Rasperry Pi, and Mac. It +should in theory work out of the box on any system with Quicklisp +(although you could hand install) and CLACK (easily switched out +and the ecl Android/iPhone branch for example doesn't use). CLOG is in QuickLisp (ql:quickload :clog), however I recommend -adding the UltraLisp distribution to it as QuickLisp is update -infrequenty. It is also worthwhile if wish to see the source, -cloning CLOG into ~/common-lisp directory [or other quicklisp/asdf -findable directory ``(push #P"path/to/dir/of/projects" ql:*local-project-directories*)`` ]: +adding the UltraLisp distribution as QuickLisp is update +infrequenty. + +However for the bleeding ede latest version and bug fixes clone +CLOG into ~/common-lisp or a findable source directory, i.e. +[ ``(push #P"path/to/dir/of/projects" ql:*local-project-directories*)`` ] + +For git (you also need the clog builder plugins clog-ace and clog-terminal +for the builder from git): ``` -For git (you need the clog-ace and clog-terminal for the builder too from git): - cd ~/common-lisp git clone https://github.com/rabbibotton/clog.git git clone https://github.com/rabbibotton/clog-ace.git git clone https://github.com/rabbibotton/clog-terminal.git +``` +For now should also clone my branch of fast-websockets as the maintainers +version is broked for larger files even if using UltraLisp: -For now one, until fix integrated, should also clone a branch of fast-websockets -if using larger files in the builder: - +``` git clone https://github.com/rabbibotton/fast-websocket.git +``` -To update do _often_ in the future go to the created directories and type: +Update git clones with: +``` git pull +``` +To add UltraLisp to QuickLisp: -To add UltraLisp to QuickLisp (updates quicker than the standard QuickLisp): - -To add UtraLisp to quicklisp install: +``` (ql-dist:install-dist "http://dist.ultralisp.org/" :prompt nil) +``` -To update to latest packages do _often_ to get the latest: +You still need often to update the UltraLisp and QuicLisp with: + +``` (ql:update-all-dists) +``` -Then as always: +To get started load CLOG and then can load and run the builder: + +``` (ql:quickload :clog) +(ql:quickload :clog/tools) +(clog-tools:clog-builder) ``` -List of plugins for CLOG on UltraLisp - https://ultralisp.org/tags/clog-plugin/ +A list of plugins for CLOG are available at - +https://ultralisp.org/tags/clog-plugin/ - -To load this package and work through tutorials (assuming you -have Quicklisp configured.) - -Note: If using portacle for Windows you will need to -update Quicklisp use (ql:update-dist "quicklisp") -You will also likely need to copy the sqlite3 dll from +Note: If using portacle for Windows you will need to copy the sqlite3 dll from https://www.sqlite.org/download.html to portacle\win\lib Consider a custom [install on windows](WINDOWS.md) -1. Start emacs then M-x slime +1. Start emacs then M-x slime (or just run sbcl at the command line or use the + CLOG Buider REPL Tools -> CLOG Builder Repl) 2. In the REPL, run: ``` -CL-USER> (ql:quickload :clog) +CL-USER> (ql:quickload :clog) ; if not already loaded CL-USER> (clog:run-tutorial 1) ``` @@ -128,7 +136,6 @@ CL-USER> (clog:clog-install-dir) You can the run the demos with: ``` -CL-USER> (ql:quickload :clog) CL-USER> (clog:run-demo 1) ``` @@ -139,7 +146,7 @@ CL-USER> (ql:quickload :clog/tools) CL-USER> (clog-tools:clog-builder) ``` -You can also open a "clog-repl" window in your browser to play +You can also open a "clog-repl" browser window to play from the common-lisp repl: ``` @@ -149,10 +156,10 @@ CLOG-USER> (setf (background-color *body*) "beige") CLOG-USER> (create-div *body* :content "Hello World!") ``` -The clog-repl URL is http://127.0.0.1:8080/repl *body* will always refer to the -last access of that URL. +The clog-repl URL is http://127.0.0.1:8080/repl ``*body*``` will always refer +to the last access of that URL. -To open a browser with the CLOG manual: +To open a browser with the CLOG manual (or in the builder it is under Help): ``` CL-USER> (clog:open-manual) @@ -171,7 +178,7 @@ to be a CLOGer.  -Here is a sample CLOG app: +Here is a very simple sample CLOG app (from Tutorial 1): ```lisp (defpackage #:clog-user ; Setup a package for our work to exist in @@ -225,97 +232,8 @@ Other samples of CLOG on the web: - [CLOG on iOS and Android](https://www.reddit.com/r/lisp/comments/tl46of/would_it_be_cool_to_run_a_clog_app_on_mobile_you/) - [Learn CLOG Dashboard](https://gist.github.com/mmontone/3a5a8a57675750e99ffb7fa64f40bc39#file-clog-learn-lisp) -Websites/apps made with CLOG - -- clogpower.com -- ackfock.com - -CLOG Builder Tutorials - -1. Chat App - https://www.reddit.com/r/lisp/comments/sj1tv5/clog_builder_tutorial_1_a_chat_app_from_start_to/ -2. Building a Web Page - https://www.reddit.com/r/lisp/comments/sn8j77/clog_builder_tutorial_2_building_a_web_page/ -3. Importing HTML in to Builder, Adding Pages and Hand Coding - https://www.reddit.com/r/lisp/comments/snvv0w/clog_builder_tutorial_3_importing_html_adding/ -4. CLOS-CONTACT - Using database controls demos a contact manager app in clog. - https://www.reddit.com/r/lisp/comments/t61sib/clog_builder_tutorial_4_a_complete_database_app/ -5. Using and Creating Custom Controls - https://www.reddit.com/r/lisp/comments/w2d6dr/builder_tutorial_5_using_and_creating_lisp_custom/ - -CLOG Tutorials - -- [01-tutorial.lisp](tutorial/01-tutorial.lisp) - Hello World -- [02-tutorial.lisp](tutorial/02-tutorial.lisp) - Closures in CLOG -- [03-tutorial.lisp](tutorial/03-tutorial.lisp) - Events fire in parallel -- [04-tutorial.lisp](tutorial/04-tutorial.lisp) - The event target, reusing event handlers -- [05-tutorial.lisp](tutorial/05-tutorial.lisp) - Using connection-data-item -- [06-tutorial.lisp](tutorial/06-tutorial.lisp) - Tasking and events -- [07-tutorial.lisp](tutorial/07-tutorial.lisp) - My first CLOG video game (and handling disconnects) -- [08-tutorial.lisp](tutorial/08-tutorial.lisp) - Mice Love Containers -- [09-tutorial.lisp](tutorial/09-tutorial.lisp) - Tabs, panels, and forms -- [10-tutorial.lisp](tutorial/10-tutorial.lisp) - Canvas -- [11-tutorial.lisp](tutorial/11-tutorial.lisp) - Attaching to existing HTML -- [12-tutorial.lisp](tutorial/12-tutorial.lisp) - Running a website in CLOG (routing) -- [13-tutorial/](tutorial/13-tutorial) - Flying Solo - A minimalist CLOG project -- [14-tutorial.lisp](tutorial/14-tutorial.lisp) - Local (persistent) and Session client-side storage -- [15-tutorial.lisp](tutorial/15-tutorial.lisp) - Multi-media -- [16-tutorial.lisp](tutorial/16-tutorial.lisp) - Bootstrap 4, Loading css files and javascript -- [17-tutorial.lisp](tutorial/17-tutorial.lisp) - W3.CSS layout example and Form submit methods -- [18-tutorial.lisp](tutorial/18-tutorial.lisp) - Drag and Drop -- [19-tutorial.lisp](tutorial/19-tutorial.lisp) - Using JavaScript components -- [20-tutorial.lisp](tutorial/20-tutorial.lisp) - New CLOG plugin from JavaScript component -- [21-tutorial.lisp](tutorial/21-tutorial.lisp) - New CLOG plugin in Common-Lisp -- [22-tutorial.lisp](tutorial/22-tutorial.lisp) - CLOG GUI Menus and Desktop Look and Feel, and popups -- [23-tutorial.lisp](tutorial/23-tutorial.lisp) - Using semaphores to wait for input -- [24-tutorial.lisp](tutorial/24-tutorial.lisp) - CLOG WEB containers -- [25-tutorial.lisp](tutorial/25-tutorial.lisp) - A "local" web app using CLOG WEB -- [26-tutorial.lisp](tutorial/26-tutorial.lisp) - A web page and form with CLOG WEB -- [27-tutorial.lisp](tutorial/27-tutorial.lisp) - Panel Box Layouts -- [28-tutorial/](tutorial/28-tutorial) - CLOG Builder Hello - A minimalist CLOG Builder project -- [29-tutorial.lisp](tutorial/29-tutorial.lisp) - Presentations (and jQuery) - linking lisp objects to clog objects -- [30-tutorial.lisp](tutorial/30-tutorial.lisp) - Instant websites - clog-web-site -- [31-tutorial.lisp](tutorial/31-tutorial.lisp) - Database and Authority based websites - clog-web-dbi and clog-auth -- [32-tutorial.lisp](tutorial/32-tutorial.lisp) - Database Managed Content websites - clog-web-content -- [33-tutorial.lisp](tutorial/33-tutorial.lisp) - with-clog-create - Using a declarative syntax for GUIs -- [34-tutorial.lisp](tutorial/34-tutorial.lisp) - 2D WebGL example -- [35-tutorial.lisp](tutorial/35-tutorial.lisp) - 3D WebGL example - -CLOG Demos - -- [01-demo.lisp](demos/01-demo.lisp) - Sparkey the Snake Game -- [02-demo.lisp](demos/02-demo.lisp) - Chat - Private instant messenger -- [03-demo.lisp](demos/03-demo.lisp) - IDE - A very simple common lisp IDE -- [04-demo.lisp](demos/04-demo.lisp) - CMS Website - A very simple database driven website - -CLOG Video Series - CLOG Plunger -- [CLOG Plunger - Episode 1](https://www.youtube.com/watch?v=srme8Sh4nI4) - Flow - The real secret to Common Lisp productivity. -- [CLOG Plunger - Episode 2](https://www.youtube.com/watch?v=0i1GM8Pz-G4) - The prequel -- [CLOG Plunger - Episode 3](https://www.youtube.com/watch?v=z0H8uVRoPOI) - A new menu item and a draggable Index Card -- [CLOG Plunger - Episode 4](https://www.youtube.com/watch?v=Fzv0hZqYk5Q) - Panels are classes -- [CLOG Plunger - Episode 5](https://www.youtube.com/watch?v=CjBDhp89BGE) - Selectedp and make-resizable -- [CLOG Plunger - Episode 6](https://www.youtube.com/watch?v=wLEWNVq_zt8) - Adding a cork board and data URIs -- [CLOG Plunger - Episode 7](https://www.youtube.com/watch?v=RLDhklvsj2Q) - Add card, Delete cards, Edit Cards -- [CLOG Plunger - Episode 8](https://www.youtube.com/watch?v=pGVaXnY8Xh8) - Moving data in and out of cards -- [CLOG Plunger - Episode 9](https://www.youtube.com/watch?v=oapC2921vpo) - File save and load -- [CLOG Plunger - Episode 10](https://www.youtube.com/watch?v=ew_I-Mf1W0I) - Moving the board to a component with save, load, delete of cards -- [CLOG Plunger - Episode 11](https://www.youtube.com/watch?v=izgRAhcHCxA) - Debugging Race Conditions - -CLOG Extras - Supplementary Video Series -- [CLOG Extra 1](https://www.youtube.com/watch?v=HbKWnAxrwRo) - What is Eval Form / Eval Sel / Eval All in the builder? -- [CLOG Extra 2](https://www.youtube.com/watch?v=ffoHO2d6WDE) - The CLOG Plugin - CLOG-Plotly -- [CLOG Extra 3](https://www.youtube.com/watch?v=jEBDwjMnFXE) - The CLOG Project System -- [CLOG Extra 4](https://www.youtube.com/watch?v=CgTJMxsz3EY) - All about panels - -Common Lisp The Language - Supplementary programming tutorials - -A series covering Common Lisp, highlighting key points and discussions on using the key reference to Common Lisp. Quick paced and intended for review further work on mastering the power of Common using the book: [Common Lisp The Language 2nd Edition by Guy L. Steele](https://www.cs.cmu.edu/Groups/AI/html/cltl/cltl2.html) - -- [Common Lisp The Language 2nd Edition - Episode #1](https://www.youtube.com/watch?v=lxd_xcXmPPY) - Covers Preface, Chp 1 and 2 -- [Common Lisp The Language 2nd Edition - Episode #2](https://www.youtube.com/watch?v=9mvQzbr7fIQ) - Covers Chp 3 - Scope and Extent -- [Common Lisp The Language 2nd Edition - Episode #3](https://www.youtube.com/watch?v=VABqkuIwiJY) - Covers Chp 4 - Type Specifiers -- [Common Lisp The Language 2nd Edition - Episode #4](https://www.youtube.com/watch?v=rS3TVHULeUc) - Covers Chp 5 - Program Structure -- [Common Lisp The Language 2nd Edition - Episode #5](https://www.youtube.com/watch?v=4GYwSxoMo2Q) - - Covers Chp 6 - Predicates +Get started learning CLOG and the CLOG Builder with +* [Learn CLOG](LEARN.md) Tool Summary diff --git a/doc/clog-manual.html b/doc/clog-manual.html index 24fbaf6..17fc205 100644 --- a/doc/clog-manual.html +++ b/doc/clog-manual.html @@ -6539,11 +6539,11 @@ clog-body. If main-menu add as main menu bar.
[generic-function] CREATE-GUI-MENU-WINDOW-SELECT CLOG-OBJ &KEY CLASS HTML-ID
+[generic-function] CREATE-GUI-MENU-WINDOW-SELECT CLOG-OBJ &KEY CLASS HTML-ID CONTENT
-Attached a clog-select as a menu item that auto updates -with open windows and maximizes them unless is a keep-on-top window or -on-window-can-maximize returns nil. Only one instance allowed.
Attaches a clog-select as a menu item that auto updates +with open windows and focuses them unless is a keep-on-top window. +Only one instance allowed.
[generic-function] CREATE-GUI-MENU-FULL-SCREEN CLOG-GUI-MENU-BAR &KEY HTML-ID
Add as last item in menu bar to allow for a full screen -icon ⤢ and full screen mode.
Toggle CLOG-GUI-WINDOW as maximize window.
[generic-function] WINDOW-TOGGLE-PINNED CLOG-GUI-WINDOW &KEY STATE KEEP-ON-TOP
+ +Toggle the pinned state of a CLOG-GUI-WINDOW. A pinned
+window cannot be moved, closed, resized, maximized or normalized. A new
+window is always unpinned. If keep-on-top the keep-on-top state is toggled
+to match the pinned state. :state forces state. Returns new state
[generic-function] WINDOW-KEEP-ON-TOP CLOG-GUI-WINDOW
+[generic-function] WINDOW-KEEP-ON-TOP CLOG-GUI-WINDOW &KEY STATE
-Set CLOG-GUI-WINDOW to stay on top. Use window-focus to undue.
Set CLOG-GUI-WINDOW to stay on top based on state (default t).
Create a local file dialog box called TITLE using INITIAL-DIR on server
machine, upon close ON-FILE-NAME called with filename or nil if failure.
CLOG-GUI - Look and Feel
[variable] *TOP-BAR-HEIGHT* 20
+ +Overlap on new windows created with top set as nil
[variable] *DEFAULT-TITLE-CLASS* "w3-black"
+ +Window title bar class
[variable] *DEFAULT-BORDER-CLASS* "w3-card-4 w3-white w3-border"
+ +Window frame border
@@ -7694,17 +7756,24 @@ replace the browser contents with
HTML.
CLOG Popups
+ +[variable] *CLOG-POPUP-PATH* "/clogwin"
+ +Default URL for popup windows
[function] ENABLE-CLOG-POPUP &KEY (PATH *CLOG-POPUP-PATH*)
[function] ENABLE-CLOG-POPUP &KEY (PATH *CLOG-POPUP-PATH*) (BOOT-FILE "/boot.html")
Enable handling of clog enabled popups
[function] OPEN-CLOG-POPUP OBJ &KEY (PATH *CLOG-POPUP-PATH*) (ADD-SYNC-TO-PATH T) (SYNC-KEY (RANDOM-HEX-STRING)) (NAME "_blank") (SPECS "") (WAIT-TIMEOUT 10)
[function] OPEN-CLOG-POPUP OBJ &KEY (PATH *CLOG-POPUP-PATH*) (ADD-SYNC-TO-PATH T) (SYNC-KEY (RANDOM-HEX-STRING)) (NAME "_blank") (SPECS "") (WAIT-TIMEOUT 10)
Open a new browser window/popup in most cases a tab. Since they are controlled by clog you have full control of the new popups and are more flexible than using diff --git a/source/clog-gui.lisp b/source/clog-gui.lisp index ad81274..deb183d 100644 --- a/source/clog-gui.lisp +++ b/source/clog-gui.lisp @@ -88,7 +88,6 @@ (server-file-dialog function) "CLOG-GUI - Look and Feel" - (*menu-bar-class variable) (*menu-bar-class* variable) (*menu-bar-drop-down-class* variable) (*menu-item-class* variable) diff --git a/tools/clog-builder-files.lisp b/tools/clog-builder-files.lisp index 9b06df3..a8a1e53 100644 --- a/tools/clog-builder-files.lisp +++ b/tools/clog-builder-files.lisp @@ -69,6 +69,7 @@ (m-save (create-gui-menu-item m-file :content "save (cmd/ctrl-s)")) (m-saveas (create-gui-menu-item m-file :content "save as..")) (m-emacs (create-gui-menu-item m-file :content "open in emacs")) + (m-ntab (create-gui-menu-item m-file :content "open in new tab")) (m-edit (create-gui-menu-drop-down menu :content "Edit")) (m-undo (create-gui-menu-item m-edit :content "undo (cmd/ctrl-z)")) (m-redo (create-gui-menu-item m-edit :content "redo (shift cmd/ctrl-z)")) @@ -232,9 +233,6 @@ (setf last-date (file-write-date file-name)) (sleep .5) (remove-class btn-save "w3-animate-top")))) - (set-on-click m-emacs (lambda (obj) - (declare (ignore obj)) - (swank:ed-in-emacs file-name))) (flet ((save (obj data &key save-as) (cond ((or (equal file-name "") (getf data :shift-key) @@ -273,6 +271,16 @@ (setf last-date (file-write-date file-name)) (sleep .5) (remove-class btn-save "w3-animate-top")))))))))) + (set-on-click m-emacs (lambda (obj) + (when is-dirty + (save obj nil)) + (swank:ed-in-emacs file-name) + (window-close win))) + (set-on-click m-ntab (lambda (obj) + (when is-dirty + (save obj nil)) + (on-open-file-ext obj :open-file file-name) + (window-close win))) (set-on-window-can-close win (lambda (obj) (cond (is-dirty