wxPerl::Styles - shortcuts for wxFOO style constants
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') );
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.
my $style = wxVal('align_right', te => 'PROCESS_ENTER|MULTILINE' );
Same as wxVal(), but returns (style => $style) for use with wxPerl::Constructors named parameter lists.
my %param = style(@list);
Hash-parameter shortcut for 'id => Wx::wxID_OK()' and etc.
my %param = ID('ok');
my $const = _mk_constant($prefix, $string);
Expects a fully qualified subname such as 'Wx::wxALIGN_RIGHT'.
my $const = _get_constant($name);
Eric Wilhelm @ <ewilhelm at cpan dot org>
http://scratchcomputing.com/
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 (C) 2007 Eric L. Wilhelm, All Rights Reserved.
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.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install wxPerl::Styles, copy and paste the appropriate command in to your terminal.
cpanm
cpanm wxPerl::Styles
CPAN shell
perl -MCPAN -e shell install wxPerl::Styles
For more information on module installation, please visit the detailed CPAN module installation guide.