createShowDia method

void createShowDia ()

Performs the dialog creation and display logic.

Implementation

void createShowDia() {
  dia = DivElement(); // create the dialog box

  DiaAttr.setDialogStyle2(dia); // initialize the style with defaults

  // make some style attributes dependent on the modality and append
  // the dialog box the document body
  if (isModal) {
    diaContainer = DivElement();
    diaContainer.style
      ..position = "absolute" // so as to cover app-div completely
      ..top = "0"
      ..left = "0"
      ..bottom = "0"
      ..right = "0"
      ..width = "100%"
      ..height = "100%"
//       ..border = "3px solid red" // "width style color"
      ..margin = "-50"
      ..padding = "0"
      ..userSelect = "none" // user cannot select contents
      ..zIndex = "${DiaAttr.ZINDEX_DIALOG}"
      ..overflowY = "auto"; // scrollbar if too many item cells in dialog

    document.body.append(diaContainer);

    dia.style
//      ..width = "${18}em" // width MUST be set by callers, must NOT be set here!
      ..color = DiaAttr.attr[DiaAttr.DIALOG_TEXT_COLOR];

    diaContainer.append(dia);
  } else {
    dia.style
          ..position = "absolute" // rel. to entire application (body)
          ..top = "0" // def. abs. position, usually overidden, e.g. PopupMenu
          ..left = "0"
          ..width = "300px" // def. width, usually overidden, e.g. PopupMenu
        ;
    document.body.append(dia);
  }

  // define the "stacking" of dialogs
  dia.style.zIndex = "${DiaAttr.ZINDEX_DIALOG + 1}";
  isopen = true;
}