$30 off During Our Annual Pro Sale. View Details »

Creating Custom Widgets (2012)

4D Japan
November 01, 2024

Creating Custom Widgets (2012)

4D Japan

November 01, 2024
Tweet

More Decks by 4D Japan

Other Decks in Technology

Transcript

  1. Creating Custom Widgets Summit 2012, Silicon Valley, CA Language Reference

    •Form event osearch for “subforms”, not “widgets”
  2. Creating Custom Widgets Summit 2012, Silicon Valley, CA Design Reference

    •Subforms and widgets owidgets, a.k.a. “page subforms”
  3. Creating Custom Widgets Summit 2012, Silicon Valley, CA Need to

    get the language straight! widgets? subforms?
  4. Creating Custom Widgets Summit 2012, Silicon Valley, CA Taxonomy •Widget

    opage subform with a bound variable •Widget Form o form used as the content of a widget •Parent Form oform that host a widget form •Container osubform object used as a widget
  5. Creating Custom Widgets Summit 2012, Silicon Valley, CA Limitations •Printing

    onot supported... •Cross window interaction onot supported... •Add to standard object library onot supported...
  6. Creating Custom Widgets Summit 2012, Silicon Valley, CA New in

    v13 •FORM Get current page * oadds widgets support •FORM GOTO PAGE * oadds widgets support actually, works in v12, just undocumented... •OBJECT GET/SET SUBFORM •OBJECT GET SUBFORM CONTAINER SIZE
  7. Creating Custom Widgets Summit 2012, Silicon Valley, CA Things to

    know •Event de fi nition oOn Load, On Activate •Event sequence oWidget before Parent •Component architecture oWrapper methods oContext: Component ≠ Widget
  8. Creating Custom Widgets Summit 2012, Silicon Valley, CA Best practices

    •Form local variables oAlso useful for private local storage •Naming convention oObjects, pointer to objects oWrapper method pre fi xes •Macros v2 oTemplates oDocumentation
  9. Creating Custom Widgets Summit 2012, Silicon Valley, CA Ask yourself...

    •Do I need to support page 2? oif not, coding is easier... •Could the layout be static? oif yes, coding is easier... •Do I need to stay on v12? oon v13, coding is easier...
  10. Creating Custom Widgets Summit 2012, Silicon Valley, CA Page 2

    support •Different event sequence oNo On Load in parent oMultiple On Load’s in widget •Solution oVirtual form event (-On Load) oOn Timer oOn Page Change (v13)
  11. Creating Custom Widgets Summit 2012, Silicon Valley, CA Dynamic layout

    support •Container size oVirtual form event (-On Load) with EXECUTE METHOD IN SUBFORM ov13 OBJECT GET SUBFORM CONTAINER SIZE •Timing oWidgets on page 2 initially don’t exist •Resize? o forget it... (especially on page 2)
  12. Creating Custom Widgets Summit 2012, Silicon Valley, CA Dynamic layout

    support •Pages inside widget oOf fi cially supported in v13! •SVG oSVG SET ATTRIBUTE * •WebArea o JavaScript
  13. Creating Custom Widgets Summit 2012, Silicon Valley, CA Thank You!

    https://github.com/miyako/ plugins, components, widgets... https://twitter.com/kmiyako/ sources.4d.com updates [email protected]