wxPerl::Styles - shortcuts for wxFOO style constants


wxPerl-Styles documentation  | view source Contained in the wxPerl-Styles distribution.

Index


NAME

Top

wxPerl::Styles - shortcuts for wxFOO style constants

SYNOPSIS

Top

This package encapsulates stringwise access to wxPerl constants, primarily for use in specifying styles, but also for comparing constants.

  use Wx qw(
    ALIGN_RIGHT
  );
  ... wxALIGN_RIGHT ... ;

Becomes:

  use Wx ();
  use wxPerl::Styles 'wxVal';
  ... wxVal('align_right') ... ;

Names will be uppercased automatically.

When using wxPerl::Constructors, style is always a named parameter, so this gives you the 'style => ...' bit:

  use Wx ();
  use wxPerl::Constructors;
  use wxPerl::Styles 'style';
  ...

  my $text_ctrl = wxPerl::TextCtrl->new($self, 'some text here',
    style('hscroll', te => 'process_enter|multiline')
  );

NOTE

Top

This does delay typo errors until run-time, but widget-construction is pretty close to compile time, and the error messages are likely to be more informative than 'syntax error'. Also, I think that's a small price to pay for not having all of those extra methods kicking around in your class.

wxVal

  my $style = wxVal('align_right',
    te => 'PROCESS_ENTER|MULTILINE'
  );

style

Same as wxVal(), but returns (style => $style) for use with wxPerl::Constructors named parameter lists.

  my %param = style(@list);

ID

Hash-parameter shortcut for 'id => Wx::wxID_OK()' and etc.

  my %param = ID('ok');

_mk_constant

  my $const = _mk_constant($prefix, $string);

_get_constant

Expects a fully qualified subname such as 'Wx::wxALIGN_RIGHT'.

  my $const = _get_constant($name);

AUTHOR

Top

Eric Wilhelm @ <ewilhelm at cpan dot org>

http://scratchcomputing.com/

BUGS

Top

If you found this module on CPAN, please report any bugs or feature requests through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

If you pulled this development version from my /svn/, please contact me directly.

COPYRIGHT

Top

NO WARRANTY

Top

Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.

LICENSE

Top

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


wxPerl-Styles documentation  | view source Contained in the wxPerl-Styles distribution.