Changeset 11089
- Timestamp:
- 03/13/10 00:33:54 (6 months ago)
- Files:
-
- 1 modified
-
trunk/Padre/lib/Padre/Plugin/Devel.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre/lib/Padre/Plugin/Devel.pm
r10997 r11089 67 67 Wx::gettext('Dump Current PPI Tree') => 'dump_ppi', 68 68 Wx::gettext('Dump %INC and @INC') => 'dump_inc', 69 Wx::gettext('Dump Display Data')=> 'dump_display',69 Wx::gettext('Dump Display Geometry') => 'dump_display', 70 70 Wx::gettext('Start/Stop sub trace') => 'trace_sub_startstop', 71 71 … … 132 132 } 133 133 134 135 134 sub dump_document { 136 135 my $self = shift; … … 183 182 sub dump_display { 184 183 my $self = shift; 185 my $count = Wx::Display->GetCount;186 184 my @displays = (); 187 foreach ( 0 .. $count ) { 188 my $display = Wx::Display->new($_); 185 186 # Due to the way it is mapped into Wx.pm 187 # this must NOT be called as a method. 188 my $count = Wx::Display::GetCount(); 189 190 foreach ( 0 .. $count - 1 ) { 191 my $display = Wx::Display->new($_); 189 192 push @displays, 190 193 { 191 194 IsPrimary => $display->IsPrimary, 192 GetGeometry => $ display->GetGeometry,193 GetClientArea => $ display->GetClientArea,195 GetGeometry => $self->_rect($display->GetGeometry), 196 GetClientArea => $self->_rect($display->GetClientArea), 194 197 }; 195 198 } 196 199 $self->_dump( 197 { GetCount => $count,200 { GetCount => $count, 198 201 DisplayList => \@displays, 199 202 } 200 203 ); 204 } 205 206 sub _rect { 207 my $self = shift; 208 my $rect = shift; 209 my %hash = map { 210 $_ => $rect->$_() 211 } qw{ 212 GetTop 213 GetBottom 214 GetLeft 215 GetRight 216 GetHeight 217 GetWidth 218 }; 219 $hash{wx} = $rect; 220 return \%hash; 201 221 } 202 222
