| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
############################################################################# |
|
2
|
|
|
|
|
|
|
## Name: lib/Wx/DemoModules/wxHtmlTag.pm |
|
3
|
|
|
|
|
|
|
## Purpose: wxPerl demo hlper for wxHtmlWindow custom tags |
|
4
|
|
|
|
|
|
|
## Author: Mattia Barbon |
|
5
|
|
|
|
|
|
|
## Modified by: |
|
6
|
|
|
|
|
|
|
## Created: 20/12/2003 |
|
7
|
|
|
|
|
|
|
## RCS-ID: $Id: wxHtmlTag.pm 3120 2011-11-18 18:50:54Z mdootson $ |
|
8
|
|
|
|
|
|
|
## Copyright: (c) 2003-2004, 2006 Mattia Barbon |
|
9
|
|
|
|
|
|
|
## Licence: This program is free software; you can redistribute it and/or |
|
10
|
|
|
|
|
|
|
## modify it under the same terms as Perl itself |
|
11
|
|
|
|
|
|
|
############################################################################# |
|
12
|
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
1626
|
use Wx::Html; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
package Wx::DemoModules::wxHtmlTag::Handler; |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
use strict; |
|
18
|
|
|
|
|
|
|
use base 'Wx::PlHtmlTagHandler'; |
|
19
|
|
|
|
|
|
|
use Wx::Calendar; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
|
22
|
|
|
|
|
|
|
my $class = shift; |
|
23
|
|
|
|
|
|
|
my $this = $class->SUPER::new; |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
return $this; |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub GetSupportedTags { |
|
29
|
|
|
|
|
|
|
return 'WXPERLCTRL'; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub HandleTag { |
|
33
|
|
|
|
|
|
|
my( $this, $htmltag ) = @_; |
|
34
|
|
|
|
|
|
|
my $parser = $this->GetParser; |
|
35
|
|
|
|
|
|
|
my $htmlwin = $parser->GetWindow; |
|
36
|
|
|
|
|
|
|
my $calendar = Wx::CalendarCtrl->new( $htmlwin, -1 ); |
|
37
|
|
|
|
|
|
|
my $cell = Wx::HtmlWidgetCell->new( $calendar ); |
|
38
|
|
|
|
|
|
|
my $cnt = $parser->GetContainer; |
|
39
|
|
|
|
|
|
|
$cnt->InsertCell( $cell ); |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
return 1; |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
package Wx::DemoModules::wxHtmlTag; |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
use strict; |
|
47
|
|
|
|
|
|
|
use base 'Wx::HtmlWindow'; |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub new { |
|
50
|
|
|
|
|
|
|
my $class = shift; |
|
51
|
|
|
|
|
|
|
my $this = $class->SUPER::new( $_[0], -1 ); |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$this->GetParser->AddTagHandler( Wx::DemoModules::wxHtmlTag::Handler->new ); |
|
54
|
|
|
|
|
|
|
$this->SetPage( <
|
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Title |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Heading |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Calendar Control using custom tag. |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
EOT |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
return $this; |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub add_to_tags { 'windows/html' } |
|
71
|
|
|
|
|
|
|
sub title { 'Custom tags' } |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |