SOURCE CODE: Resizable Dialog

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
  <title>Resizable Dialog | JavaScript Examples | UIZE JavaScript Framework</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="keywords" content="featured drag-and-drop widget Uize.Widgets.Dialog.Widget"/>
  <meta name="description" content="See an example of a draggable and resizable modal JavaScript dialog that uses inline HTML (rather than a blockable popup window) and is configurable."/>
  <link rel="alternate" type="application/rss+xml" title="UIZE JavaScript Framework - Latest News" href=""/>
  <link rel="stylesheet" href="../css/page.css"/>
  <link rel="stylesheet" href="../css/page.example.css"/>


<script type="text/javascript" src="../js/Uize.js"></script>

<h1 class="header">
  <a id="page-homeLink" href="../index.html" title="UIZE JavaScript Framework home"></a>
  <a href="../index.html" class="homeLinkText" title="UIZE JavaScript Framework home">UIZE JavaScript Framework</a>

<div class="main">
  <h1 class="document-title">
    <a href="../javascript-examples.html" class="breadcrumb breadcrumbWithArrow">JAVASCRIPT EXAMPLES</a>
    Resizable Dialog
    <div class="pageActionsShell">
      <div id="page-actions" class="pageActions"><a href="source-code/dialog-resizable.html" class="buttonLink">SOURCE</a></div>

  <!-- explanation copy -->

  <div class="explanation">
    <p>In this example, an instance of the <a href="../reference/Uize.Widgets.Dialog.Widget.html"><code>Uize.Widgets.Dialog.Widget</code></a> class is being used to implement a resizable modal dialog. The dialog can be resized by dragging on any of the corners or sides. Dragging on a side changes the dialog's dimensions in one axis only, while dragging on a corner changes the dimensions in both axes. In any given HTML implementation of a resizable dialog, all drag handles are optional. If you like, you can provide just a lower right corner drag handle. Since resizable dialogs share code with the marquee widget (<a href="../reference/Uize.Widget.Resizer.Marquee.html"><code>Uize.Widget.Resizer.Marquee</code></a>), it is possible to configure a resizable dialog to have a constrained aspect ratio, or to be resizable only in one axis, by setting state for its <code>resizer</code> child widget. The resizable dialog widget has child widgets for the <b>"OK"</b>, <b>"CANCEL"</b>, and <b>"CLOSE"</b> buttons.</p>

    <p>To open the dialog, click the <b>"OPEN DIALOG"</b> button below.</p>

  <center id="page-launcherButton" style="margin-bottom: 20px;"></center>

  <!-- programmatic interface examples -->

  <div class="programmaticInterface">
      <li>Resizing Configurations
          <li>FIXED WIDTH ONLY: <a href="javascript://" class="linkedJs">dialog.children.resizer.set ({fixedX:true,fixedY:false}); dialog.set ({shown:true})</a></li>
          <li>FIXED HEIGHT ONLY: <a href="javascript://" class="linkedJs">dialog.children.resizer.set ({fixedX:false,fixedY:true}); dialog.set ({shown:true})</a></li>
          <li>NOT RESIZABLE: <a href="javascript://" class="linkedJs">dialog.children.resizer.set ({fixedX:true,fixedY:true}); dialog.set ({shown:true})</a></li>
          <li>FULLY RESIZABLE: <a href="javascript://" class="linkedJs">dialog.children.resizer.set ({fixedX:false,fixedY:false}); dialog.set ({shown:true})</a></li>

<!-- JavaScript code to wire up the page -->

<script type="text/javascript">

Uize.require (
  function () {
    'use strict';

    /*** create the example page widget ***/
      var page = = UizeSite.Page.Example ({evaluator:function (code) {eval (code)}});

    /*** create the Uize.Widgets.Dialog.Widget object ***/
      var dialog = page.addChild (
          title:'RESIZABLE DIALOG WINDOW',
                '<div style="padding:5px;">' +
                  Uize.Str.Repeat.repeat ('This is a resizable dialog. ',50) +

    /*** add the launcher button ***/
      page.addChild (
          text:'OPEN DIALOG',
          action:function () {dialog.set ({shown:true})},

    /*** wire up the page widget ***/
      page.wireUi ();