[perl-win32-gui-users] Status bar Parts method bug.
Hi, I've found a bug when using the parts method in the status bar control. All the following statements fail (no error, application just exits): $status->Parts($width-200,$width-100,-1); my $temp=$status->Parts($width-200,$width-100,-1); my @temp=$status->Parts($width-200,$width-100,-1); While the following works: print $status->Parts($width-200,$width-100,-1); foreach ($status->Parts($width-200,$width-100,-1)) {print "$_ \n";} See example below. I've created a task in the tracker. Cheers, jez. = use Win32::GUI; use strict; my $W = new GUI::Window( -title=> "Win32::GUI::status test", -left => 100, -top => 100, -width=> 300, -height => 200, -name => "main", -onResize => \&main_resize ); my $status=$W->AddStatusBar(-name => "Status"); $status->Parts(50,100,-1); $status->PartText(0,'Lots of text'); $status->PartText(1,'Part 1'); $status->PartText(2,'Part 2'); $W->Show; Win32::GUI::Dialog; sub main_resize { $status->Width($W->ScaleWidth); $status->Top($W->ScaleHeight - $status->Height); my $width=$status->Width; #The following work: print $status->Parts($width-200,$width-100,-1); #foreach ($status->Parts($width-200,$width-100,-1)) {print "$_ \n";} #The following fail: #$status->Parts($width-200,$width-100,-1); #my $temp=$status->Parts($width-200,$width-100,-1); #my @temp=$status->Parts($width-200,$width-100,-1); }
Re: [perl-win32-gui-users] Status bar Parts method bug.
Hi Jez Ok, noted. Interesting. I'll look into this on Monday. Steve - Original Message - From: Jez White To: Win32-GUI Sent: Sunday, February 15, 2004 10:07 AM Subject: [perl-win32-gui-users] Status bar Parts method bug. Hi, I've found a bug when using the parts method in the status bar control. All the following statements fail (no error, application just exits): $status->Parts($width-200,$width-100,-1); my $temp=$status->Parts($width-200,$width-100,-1); my @temp=$status->Parts($width-200,$width-100,-1); While the following works: print $status->Parts($width-200,$width-100,-1); foreach ($status->Parts($width-200,$width-100,-1)) {print "$_ \n";} See example below. I've created a task in the tracker. Cheers, jez. = use Win32::GUI; use strict; my $W = new GUI::Window( -title=> "Win32::GUI::status test", -left => 100, -top => 100, -width=> 300, -height => 200, -name => "main", -onResize => \&main_resize ); my $status=$W->AddStatusBar(-name => "Status"); $status->Parts(50,100,-1); $status->PartText(0,'Lots of text'); $status->PartText(1,'Part 1'); $status->PartText(2,'Part 2'); $W->Show; Win32::GUI::Dialog; sub main_resize { $status->Width($W->ScaleWidth); $status->Top($W->ScaleHeight - $status->Height); my $width=$status->Width; #The following work: print $status->Parts($width-200,$width-100,-1); #foreach ($status->Parts($width-200,$width-100,-1)) {print "$_ \n";} #The following fail: #$status->Parts($width-200,$width-100,-1); #my $temp=$status->Parts($width-200,$width-100,-1); #my @temp=$status->Parts($width-200,$width-100,-1); }
[perl-win32-gui-users] Toolbar Package available here
Hello all, SInce we all were looking for functions f\to control the toolbar and I really needed one and after digging, here is a good control code will make you happy. Anyone interested to complete the package and include it with the WIn3::GUI welcomed, I realy did not have the time as I just needed to do basci enable/disable buttons, replace images. The code below has functions for enabling/disabling, deleting buttons setting toolbar style,checking buttons, alot to doc. The code is here: use Win32::GUI; # sub WM_USER {0x0400;} # 0x0400 = 1024 # sub TBCDRF_NOEDGES {0x0001;} # Don't draw button edges sub TBCDRF_HILITEHOTTRACK {0x0002;} # Use color of the button bk when hottracked sub TBCDRF_NOOFFSET {0x0004;} # Don't offset button if pressed sub TBCDRF_NOMARK{0x0008;} # Don't draw default highlight of image/text for TBSTATE_MARKED sub TBCDRF_NOETCHEDEFFECT {0x0010;} # Don't draw etched effect for disabled items # #- Toolbar button states functions for use with Send Message- sub TB_ENABLEBUTTON {(&WM_USER + 1);} sub TB_CHECKBUTTON {(&WM_USER + 2);} sub TB_PRESSBUTTON{(&WM_USER + 3);} sub TB_HIDEBUTTON{(&WM_USER + 4);} sub TB_INDETERMINATE {(&WM_USER + 5);} sub TB_MARKBUTTON{(&WM_USER + 6);} sub TB_ISBUTTONENABLED {(&WM_USER + 9);} sub TB_ISBUTTONCHECKED {(&WM_USER + 10);} sub TB_ISBUTTONPRESSED {(&WM_USER + 11);} sub TB_ISBUTTONHIDDEN {(&WM_USER + 12);} sub TB_ISBUTTONINDETERMINATE {(&WM_USER + 13);} sub TB_ISBUTTONHIGHLIGHTED {(&WM_USER + 14);} sub TB_SETSTATE {(&WM_USER + 17);} sub TB_GETSTATE {(&WM_USER + 18);} #- Toolbar button states constants--- sub TBSTATE_CHECKED {0x01;} sub TBSTATE_PRESSED {0x02} sub TBSTATE_ENABLED {0x04} sub TBSTATE_HIDDEN {0x08} sub TBSTATE_INDETERMINATE {0x10} sub TBSTATE_WRAP { 0x20} sub TBSTATE_ELLIPSES{0x40} sub TBSTATE_MARKED {0x80} sub TB_CheckButton {&TB_SetState(@_, &TBSTATE_CHECKED);} sub TB_EnableButton {&TB_SetState(@_, &TBSTATE_ENABLED);} sub TB_PressButton {&TB_SetState(@_, &TBSTATE_PRESSED);} sub TB_HideButton {&TB_SetState(@_, &TBSTATE_HIDDEN);} sub TB_Indeterminate{&TB_SetState(@_, &TBSTATE_INDETERMINATE);} sub TB_Wrap {&TB_SetState(@_, &TBSTATE_WRAP);} sub TB_Ellipses {&TB_SetState(@_, &TBSTATE_ELLIPSES);} sub TB_Marked {&TB_SetState(@_, &TBSTATE_MARKED);} sub TB_MarkButton {&TB_SetState(@_, &TB_ENABLEBUTTON);} sub TB_ISButtonEnabled {&TB_SetState(@_, &TB_ENABLEBUTTON);} sub TB_ISButtonChecked {&TB_SetState(@_, &TB_ENABLEBUTTON);} sub TB_ISButtonPressed {&TB_SetState(@_, &TB_ENABLEBUTTON);} sub TB_ISButtonHidden {&TB_SetState(@_, &TB_ENABLEBUTTON);} sub TB_ISButtonIndeterminate {&TB_SetState(@_, &TB_ENABLEBUTTON);} sub TB_ISButtonHighlighted {&TB_SetState(@_, &TB_ENABLEBUTTON);} sub TB_SetState{ my ($Handle, $Button, $State) = @_; $Handle or return undef; $Button ||=0; $State ||= 1; return Win32::GUI::SendMessage($Handle, &TB_SETSTATE, $Button, $State); } # #- Toolbar styles--- sub TBSTYLE_TOOLTIPS{0x0100} sub TBSTYLE_WRAPABLE{0x0200} sub TBSTYLE_ALTDRAG {0x0400} sub TBSTYLE_FLAT{0x0800} sub TBSTYLE_LIST{0x1000} sub TBSTYLE_CUSTOMERASE {0x2000} sub TBSTYLE_REGISTERDROP{0x4000} sub TBSTYLE_TRANSPARENT {0x8000} sub TBSTYLE_EX_DRAWDDARROWS {0x0001} sub TB_SETSTYLE {(&WM_USER + 56);} sub TB_GETSTYLE {(&WM_USER + 57);} sub ToolbarSetStyle{ my ($Handle, $Style) = @_; $Handle or return undef; $Style ||= 0; return Win32::GUI::SendMessage($Handle, &TB_SETSTYLE, 0, $Style | 1); #return Win32::GUI::SendMessage($Handle, &TB_SETSTYLE, 0, $Style | &TBGetStyle); } # sub TBGetStyle{ my ($Handle) = @_; $Handle or return undef; return Win32::GUI::SendMessage($Handle, &TB_GETSTYLE, 0, 0); } # #- Toolbar button styles--- sub TBSTYLE_BUTTON {0x} sub TBSTYLE_SEP {0x0001} sub TBSTYLE_CHECK {0x0002} sub TBSTYLE_GROUP {0x0004} sub TBSTYLE_CHECKGROUP {(&TBSTYLE_GROUP | &TBSTYLE_CHECK);} sub TBSTYLE_DROPDOWN{0x0008} sub TBSTYLE_AUTOSIZE{0x0010} # automatically calculate the cx of the button sub TBSTYLE_NOPREFIX{0x0020} # if this button should not have accel pr
Re: [perl-win32-gui-users] help with Win32::GUI::Grid
Thanks Laurent: new module works great! = ** * END OF MESSAGE * __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html