App-Widget

 view release on metacpan or  search on metacpan

lib/App/Widget/DataTable.pm  view on Meta::CPAN


        # This seems to cause <input> elements to take on the font size
        # currently active for text that surrounds them
        # i.e. <font size="-2"><input type="text" style="font-size: 100%;"></font>
        push(@edit_style, "font_size",   "100%")     if ($font_size);

        # border_style",
        # border_width",
        # border_color",
        # padding",
        # background_color",

        # any columns we are editing, we need to compute max width (size) for textfield
        for ($col = 0; $col < $numcols; $col++) {
            $column_length[$col] = 5;  # minimum length
            $column = "";
            if (defined $columns && defined $columns->[$col]) {
                $column = $columns->[$col];
            }
    
            if (($column ne "" && $self->{column_selected}{$column}) ||

lib/App/Widget/DataTable.pm  view on Meta::CPAN

                    $elem = sprintf($format, $elem) if ($format);
                }
                if (! defined $self->{editdata}{$key}{$column}) {
                    $self->{editdata}{$key}{$column} = $elem
                }
                $html .= "  <td $td_row_attrib$td_col_attrib>${elem_begin}";
                $html .= $context->widget("$name\{editdata}{$key}{$column}",
                             class => "App::Widget::TextField",
                             size => $column_length[$col]+2,   # add 2 just to give some visual space
                             maxlength => 99,
                             background_color => "#ffaaaa",
                             border_style => "solid",
                             border_width => "1px",
                             padding => 0,
                             @edit_style,
                         )->html();
                $html .= "$elem_end</td>\n";
            }
            else {
                $elem = $self->html_escape($elem);
                if (!defined $elem || $elem eq "") {

lib/App/Widget/DataTable2.pm  view on Meta::CPAN


        # This seems to cause <input> elements to take on the font size
        # currently active for text that surrounds them
        # i.e. <font size="-2"><input type="text" style="font-size: 100%;"></font>
        push(@edit_style, "font_size",   "100%")      if ($font_size);

        # border_style",
        # border_width",
        # border_color",
        # padding",
        # background_color",

        # any columns we are editing, we need to compute max width (size) for textfield
        for ($col = 0; $col < $numcols; $col++) {
            $column_length[$col] = 5;  # minimum length
            $column = "";
            if (defined $columns && defined $columns->[$col]) {
                $column = $columns->[$col];
            }

            # Removed because when a row is added without a selected row

lib/App/Widget/DateField.pm  view on Meta::CPAN

      class => "App::Widget::DateField",
      size  => 8,                 # from HTML spec
      maxlength => 18,            # from HTML spec
      style => "mystyle",         # from HTML to support CSS
      color => "#6666CC",         # from CSS spec
      font_size => "10px",        # from CSS spec
      border_style => "solid",    # from CSS spec
      border_width => "1px",      # from CSS spec
      border_color => "#6666CC",  # from CSS spec
      padding => "2px",           # from CSS spec
      background_color => "#ccffcc",           # from CSS spec
      font_family => "Verdana, Geneva, Arial", # from CSS spec
      override => 1,              # increase precedence of following options to "override" from "default"
      #validate => "date",         # not impl. yet ("date", "time", "datetime", "enum", "number", "integer", ":regexp")
      #autocomplete => \@previous_choices,  # not impl. yet
   );

   # internal way
   use App::Widget::DateField;
   $w = App::Widget::DateField->new($name);

lib/App/Widget/ImageBarSelector.pm  view on Meta::CPAN

    my $self = shift;

    my $context    = $self->{context};
    my $name       = $self->{name};
    my $node       = $self->node_list();
    my $pad        = $self->{pad};
    my $align      = $self->{align};
    my $valign     = $self->{valign};
    my $bar_height = $self->{height};
    my $bar_width  = $self->{width};
    my $bar_background = $self->{background};
    my $theme      = $context->so_get("theme") || $context->{options}{theme} || "app";

    my $html = "";

    my ($nodebase, $nodeidx, $nodenumber, $nodelabel, $parentnodenumber, $nodelevel, $opennodenumber);
    my (@nodeidx, $selected_nodenumber, $w);

    $selected_nodenumber = $self->{selected};
    $selected_nodenumber = $self->get_tag_nodenumber($selected_nodenumber);

lib/App/Widget/ImageBarSelector.pm  view on Meta::CPAN

    if (defined $node->{1} && !defined $node->{2}) {
        $nodelevel = 1;
        $nodebase = "1.";
    }
    my $table_opts = ($bar_width) ? " width=\"$bar_width\"" : " width=\"100%\"";
    my $td_opts = "";
    $td_opts .= " align=\"$align\"" if ($align);
    $td_opts .= " valign=\"$valign\"" if ($valign);
    $td_opts .= " height=\"$bar_height\"" if ($bar_height);
    $td_opts .= " width=\"$bar_width\"" if ($bar_width);
    if ($bar_background) {
        $td_opts .= " background=\"$html_url_dir/theme/$theme/$bar_background\"";
    }
    my $auth = $context->authorization();
    my (@args, $auth_name);
    for (; $nodelevel <= $#nodeidx; $nodelevel++) {
        $html .= "\n<!-- ImageBarSelector (BEGIN) -->\n";
        $html .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"${table_opts}><tr><td${td_opts}>\n";
        $html .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
        $html .= "  <tr>";

        $nodeidx = 1;

lib/App/Widget/ImageBarSelector.pm  view on Meta::CPAN

            }
            if ($pad->{width}) {
                $td_dims    .= " width=\"$pad->{width}\"";
                $image_dims .= " width=\"$pad->{width}\"";
            }
            else {
                $td_dims    .= " width=\"99%\"";
                $image_dims .= " width=\"99%\"";
            }
            my $bgimage = "$html_url_dir/theme/$theme/" . $pad->{image};
            $html .= "<td${td_dims} background=\"$bgimage\"><img src=\"$bgimage\" border=\"0\"${image_dims}></td>\n";
        }

        $html .= "  </tr>\n";
        $html .= "</table>\n";
        $html .= "</td></tr></table>\n";
        $html .= "<!-- ImageBarSelector (END) -->\n";
    }

    &App::sub_exit() if ($App::trace);
    $html;

lib/App/Widget/Password.pm  view on Meta::CPAN

      size  => 8,                 # from HTML spec
      maxlength => 18,            # from HTML spec
      tabindex => 1,              # from HTML spec
      style => "mystyle",         # from HTML to support CSS
      color => "#6666CC",         # from CSS spec
      font_size => "10px",        # from CSS spec
      border_style => "solid",    # from CSS spec
      border_width => "1px",      # from CSS spec
      border_color => "#6666CC",  # from CSS spec
      padding => "2px",           # from CSS spec
      background_color => "#ccffcc",           # from CSS spec
      font_family => "Verdana, Geneva, Arial", # from CSS spec
      override => 1,              # increase precedence of following options to "override" from "default"
      #validate => "date",         # not impl. yet ("date", "time", "datetime", "enum", "number", "integer", ":regexp")
      #autocomplete => \@previous_choices,  # not impl. yet
   );

   # internal way
   use App::Widget::Password;
   $w = App::Widget::Password->new($name);

lib/App/Widget/Stylizable.pm  view on Meta::CPAN

######################################################################

# These are the valid style sheet attributes
my @style_attrib = (
    "color",
    "font_size",
    "border_style",
    "border_width",
    "border_color",
    "padding",
    "background_color",
    "font_family",
);

my %style_attrib = (
    "color"            => "color",
    "font_size"        => "font-size",
    "border_style"     => "border-style",
    "border_width"     => "border-width",
    "border_color"     => "border-color",
    "padding"          => "padding",
    "background_color" => "background-color",
    "font_family"      => "font-family",
);

# TODO: consider getting list of ("lang") from parent
my @absorbable_attrib = (
    "lang",            # language (en, de, fr, en_us, en_ca, etc.)
    @style_attrib,
);

######################################################################

lib/App/Widget/StylizableContainer.pm  view on Meta::CPAN

######################################################################

# These are the valid style sheet attributes
my @style_attrib = (
    "color",
    "font_size",
    "border_style",
    "border_width",
    "border_color",
    "padding",
    "background_color",
    "font_family",
);

# TODO: consider getting list of ("lang") from parent
my @absorbable_attrib = (
    "lang",            # language (en, de, fr, en_us, en_ca, etc.)
    @style_attrib,
);

######################################################################

lib/App/Widget/TextArea.pm  view on Meta::CPAN

      maxlength => 18,            # from HTML spec
      tabindex => 1,              # from HTML spec
      readonly => 1,              # from HTML spec
      style => "mystyle",         # from HTML to support CSS
      color => "#6666CC",         # from CSS spec
      font_size => "10px",        # from CSS spec
      border_style => "solid",    # from CSS spec
      border_width => "1px",      # from CSS spec
      border_color => "#6666CC",  # from CSS spec
      padding => "2px",           # from CSS spec
      background_color => "#ccffcc",           # from CSS spec
      font_family => "Verdana, Geneva, Arial", # from CSS spec
      override => 1,              # increase precedence of following options to "override" from "default"
      #validate => "date",         # not impl. yet ("date", "time", "datetime", "enum", "number", "integer", ":regexp")
      #autocomplete => \@previous_choices,  # not impl. yet
   );

   # internal way
   use App::Widget::TextArea;
   $w = App::Widget::TextArea->new($name);

lib/App/Widget/TextField.pm  view on Meta::CPAN

      size  => 8,                 # from HTML spec
      maxlength => 18,            # from HTML spec
      tabindex => 1,              # from HTML spec
      style => "mystyle",         # from HTML to support CSS
      color => "#6666CC",         # from CSS spec
      font_size => "10px",        # from CSS spec
      border_style => "solid",    # from CSS spec
      border_width => "1px",      # from CSS spec
      border_color => "#6666CC",  # from CSS spec
      padding => "2px",           # from CSS spec
      background_color => "#ccffcc",           # from CSS spec
      font_family => "Verdana, Geneva, Arial", # from CSS spec
      override => 1,              # increase precedence of following options to "override" from "default"
      #validate => "date",         # not impl. yet ("date", "time", "datetime", "enum", "number", "integer", ":regexp")
      #autocomplete => \@previous_choices,  # not impl. yet
   );

   # internal way
   use App::Widget::TextField;
   $w = App::Widget::TextField->new($name);

lib/App/Widget/ValidatedTextField.pm  view on Meta::CPAN

      size  => 8,                 # from HTML spec
      maxlength => 18,            # from HTML spec
      tabindex => 1,              # from HTML spec
      style => "mystyle",         # from HTML to support CSS
      color => "#6666CC",         # from CSS spec
      font_size => "10px",        # from CSS spec
      border_style => "solid",    # from CSS spec
      border_width => "1px",      # from CSS spec
      border_color => "#6666CC",  # from CSS spec
      padding => "2px",           # from CSS spec
      background_color => "#ccffcc",           # from CSS spec
      font_family => "Verdana, Geneva, Arial", # from CSS spec
      override => 1,              # increase precedence of following options to "override" from "default"
      validate => "date",         # not impl. yet ("date", "time", "datetime", "enum", "number", "integer", ":regexp")
      #autocomplete => \@previous_choices,  # not impl. yet
   );

   # internal way
   use App::Widget::ValidatedTextField;
   $w = App::Widget::ValidatedTextField->new($name);



( run in 0.603 second using v1.01-cache-2.11-cpan-f56aa216473 )