Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gendl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
47
Issues
47
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gendl
gendl
Commits
e0121a28
Commit
e0121a28
authored
Feb 17, 2014
by
Dave Cooper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added form in tasty for required-inputs
parent
97c98521
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
10 deletions
+96
-10
apps/tasty/source/assembly.lisp
apps/tasty/source/assembly.lisp
+32
-9
apps/tasty/source/part-type-form.lisp
apps/tasty/source/part-type-form.lisp
+64
-1
No files found.
apps/tasty/source/assembly.lisp
View file @
e0121a28
;;
;; Copyright 20
02, 2009, 2012
Genworks International
;; Copyright 20
14
Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
...
...
@@ -30,6 +30,10 @@ o support for multiple viewports
o filter inspector slots to local slots
o make Update! work properly for pre-made object expression.
o allow input of required input-slots.
|#
...
...
@@ -63,19 +67,23 @@ o filter inspector slots to local slots
(
the
(
set-slot!
:root-object
(
the
root-object
)))
(
the
tree
update!
)))
(
use-jquery?
(
the
have-valid-instance?
))
(
use-raphael?
(
the
have-valid-instance?
))
(
use-x3dom?
(
the
have-valid-instance?
))
(
use-jquery?
(
the
have-valid-instance
-and-inputs
?
))
(
use-raphael?
(
the
have-valid-instance
-and-inputs
?
))
(
use-x3dom?
(
the
have-valid-instance
-and-inputs
?
))
)
:computed-slots
(
(
ui-specific-layout-js
(
when
(
the
use-jquery?
)
"/static/gwl/js/tasty-initlayout-3.js"
))
(
have-valid-instance?
(
not
(
typep
(
the
root-object
)
'null-part
)))
(
additional-header-content
(
when
(
the
have-valid-instance?
)
(
have-valid-instance-and-inputs?
(
and
(
the
have-valid-instance?
)
(
the
required-inputs-satisfied?
)))
(
additional-header-content
(
when
(
the
have-valid-instance-and-inputs?
)
(
the
ta2-style-view
)))
(
ta2-style-view
(
with-cl-who-string
()
...
...
@@ -107,6 +115,8 @@ o filter inspector slots to local slots
;;(color-selected :red)
(
required-inputs-satisfied?
(
the
required-inputs-form
satisfied?
))
)
:hidden-objects
...
...
@@ -141,6 +151,10 @@ o filter inspector slots to local slots
(
the
(
make-root-instance
type
))))
(
required-inputs-form
:type
'required-inputs-form
:root-object
(
the
root-object-object
)
:tatu-root
self
)
(
tree
:type
'tree:newertree
;;:type 'tree:tree
...
...
@@ -337,10 +351,19 @@ The error was: ~a
((
main-sheet-body
()
(
if
(
the
have-valid-instance?
)
(
write-the
ui-sheet
)
(
write-the
part-type-form
main-sheet
)))
(
cond
((
and
(
the
have-valid-instance?
)
(
the
required-inputs-satisfied?
))
(
write-the
ui-sheet
))
((
the
have-valid-instance?
)
(
write-the
required-inputs-form
))
(
t
(
write-the
part-type-form
main-sheet
))))
(
required-inputs-form
()
(
write-the
required-inputs-form
main-sheet
))
(
ui-sheet
()
(
with-cl-who
(
:indent
t
)
...
...
apps/tasty/source/part-type-form.lisp
View file @
e0121a28
;;
;; Copyright 20
02, 2009
Genworks International and Genworks BV
;; Copyright 20
14
Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
...
...
@@ -60,3 +60,66 @@
(
:td
((
:input
:type
:string
:name
:object-expression
:size
40
:value
(
the
object-expression
)))))
(
:tr
(
:td
:br
)
(
:td
((
:input
:type
:submit
:name
:submit
:value
" Browse!"
))))))))))
(
defparameter
*test-self*
nil
)
(
define-object
required-inputs-form
(
base-html-sheet
)
:input-slots
(
root-object
tatu-root
)
:computed-slots
((
respondent
(
the
tatu-root
))
(
required-input-slots
(
the
root-object
(
message-list
:category
:required-input-slots
)))
(
satisfied-toggle
nil
:settable
)
(
satisfied?
(
progn
(
the
satisfied-toggle
)
(
let
((
result
t
))
(
dolist
(
slot
(
the
required-input-slots
))
(
let
((
status
(
the
root-object
(
slot-status
slot
))))
(
when
(
eql
status
:unbound
)
(
setq
result
nil
))))
(
print-variables
result
)
result
))))
:objects
((
required-input-inputs
:type
'text-form-control
:sequence
(
:size
(
length
(
the
required-input-slots
)))
:pseudo-inputs
(
keyword
)
:size
20
:domain
:pass-thru
:keyword
(
nth
(
the-child
index
)(
the
required-input-slots
))
:default
:unbound
:prompt
(
the-child
keyword
)))
:functions
(
(
after-set!
()
(
setq
*test-self*
(
the
root-object
))
(
format
t
"In the after-set! of the required-inputs-form...~%"
)
(
dolist
(
slot
(
list-elements
(
the
required-input-inputs
)))
(
unless
(
eql
(
the-object
slot
value
)
:unbound
)
(
the
root-object
(
set-slot!
(
the-object
slot
keyword
)
(
the-object
slot
value
)))))
(
the
(
set-slot!
:satisfied-toggle
(
not
(
the
satisfied-toggle
)))))))
(
define-lens
(
html-format
required-inputs-form
)()
:output-functions
((
main-sheet
()
(
with-cl-who
()
(
with-html-form
(
:cl-who?
t
)
(
dolist
(
slot
(
list-elements
(
the
required-input-inputs
)))
(
htm
(
:p
(
str
(
the-object
slot
html-string
)))))
(
:p
((
:input
:type
:submit
:name
:submit
:value
" Browse!"
))))))))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment