From: Stephen P. <Ste...@uc...> - 2004-02-17 14:03:19
|
Hi, I've just spent the morning converting and documenting Rammy's perl = toolbar functions into XS. They're now in the CVS. The new functions are as follows: # (@)METHOD:SetButtonState(BUTTON, STATE) # (@)METHOD:SetStyle(STYLE) # (@)METHOD:SetExtendedStyle(STYLE) # (@)METHOD:GetStyle(STYLE) # (@)METHOD:MoveButton(BUTTON, TARGET) # (@)METHOD:SetImageList(IMAGELIST) # (@)METHOD:SetHotImageList(IMAGELIST) # (@)METHOD:SetDisabledImageList(IMAGELIST) # (@)METHOD:GetImageList() # (@)METHOD:GetHotImageList() # (@)METHOD:GetDisabledImageList() # (@)METHOD:ChangeBitmap(BUTTON, BITMAP) # (@)METHOD:CheckButton(BUTTON, CHECKED) # (@)METHOD:DeleteButton(BUTTON) # (@)METHOD:SetToolTips(TOOLTIP) SetToolTips is not really needed, as you should be able to assign a = tooltip object using the -tooltip option when constructing the toolbar = now. Same thing with SetImageList; you should be able to use -imagelist = to set an imagelist now. Note that there is already a Padding() method for the toolbar so I didnt = add Rammy's padding one which seemed to do a similar thing. I've also = (hopefully) fixed the "tooltips crash application on exit" bug that = appeared when I ran Rammy's test code. There is some safety checking on SetImageList, AddBitmap and = ChangeBitmap. You cannot call SetImageList and AddBitmap/ChangeBitmap on = the same toolbar as microsoft says this would be a really bad idea, so = you get a croak about it if you try it. Another thing is, I've modified the ButtonClick event so that when a = button that has the TBSTYLE_DROPDOWN style applied to it is clicked, an = extra argument gets passed to ButtonClick with the value of 1. This = allows you to tell if you need to show a drop-down menu. There have been a ton of constants added to GUI.pm and = GUI_Constants.cpp, so you can use most of the regular toolbar styles, = extended styles, button styles etc. One word of warning is to avoid = using the BTNS_*** constants and use the TBSTYLE_*** equivalents = instead, as the availability of the BTNS_*** constants depends on the = headers and compiler used (they're a new thing). I added dwFlags to the USERDATA and CREATESTRUCT structs. This dword is = intended to store any per-object flags needed. for instance, the toolbar = uses FLAGS_TB_HASBITMAPS to remember if AddBitmap has been called and = complain if the user attempts to SetImageList on the same toolbar = object. Developers: add flags as you see fit. One last thing. We're running out of mask bits in the NEM. Are they = really needed? The mask only appears to be used as a speed thing (to = avoid doing a hash lookup for each event) so perhaps it would be more = sensible to group some events together or something? Thoughts please... Steve |
From: Jez W. <je...@je...> - 2004-02-17 19:28:54
|
I'm having problems building using ming. I get the following error: C:\development\Win32-GUI-0.0.670>nmake install Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. C:\Perl\bin\perl.exe -IC:\Perl\lib -IC:\Perl\lib C:\Perl\lib\ExtUtils/xs ubpp -typemap C:\Perl\lib\ExtUtils\typemap -typemap typemap Toolbar.xs > Toolba r.cpp gcc -c -g -O2 -DWIN32 -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -f= no- strict-aliasing -DPERL_MSVCRT_READFIX -g -O2 -DVERSION=3D\"0.0.670\" = -DXS_ VERS ION=3D\"0.0.670\" -DHASATTRIBUTE -IC:\Perl\lib\CORE -D__MINGW__ Toolbar.c= pp Toolbar.xs: In function `BOOL Toolbar_onParseOption(char*, SV*, tagPERLWIN32GUI_CREATESTRUCT*)': Toolbar.xs:24: cannot convert `_IMAGELIST*' to `HWND__*' in assignment Toolbar.xs: In function `void XS_Win32__GUI__Toolbar_ChangeBitmap(PerlInterpreter*, CV*)': Toolbar.xs:320: warning: cast from pointer to integer of different size NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0= x1' Stop. If I comment out the line, it builds ok. Cheers, jez. ----- Original Message -----=20 From: "Stephen Pick" <Ste...@uc...> To: "Win32-Gui-Users (E-mail)" <per...@li...= t>; "Win32 GUI Hackers (E-mail)" <per...@li...= t> Sent: Tuesday, February 17, 2004 1:58 PM Subject: [perl-win32-gui-hackers] CVS update: Toolbars Hi, I've just spent the morning converting and documenting Rammy's perl toolb= ar functions into XS. They're now in the CVS. The new functions are as follows: # (@)METHOD:SetButtonState(BUTTON, STATE) # (@)METHOD:SetStyle(STYLE) # (@)METHOD:SetExtendedStyle(STYLE) # (@)METHOD:GetStyle(STYLE) # (@)METHOD:MoveButton(BUTTON, TARGET) # (@)METHOD:SetImageList(IMAGELIST) # (@)METHOD:SetHotImageList(IMAGELIST) # (@)METHOD:SetDisabledImageList(IMAGELIST) # (@)METHOD:GetImageList() # (@)METHOD:GetHotImageList() # (@)METHOD:GetDisabledImageList() # (@)METHOD:ChangeBitmap(BUTTON, BITMAP) # (@)METHOD:CheckButton(BUTTON, CHECKED) # (@)METHOD:DeleteButton(BUTTON) # (@)METHOD:SetToolTips(TOOLTIP) SetToolTips is not really needed, as you should be able to assign a toolt= ip object using the -tooltip option when constructing the toolbar now. Same thing with SetImageList; you should be able to use -imagelist to set an imagelist now. Note that there is already a Padding() method for the toolbar so I didnt = add Rammy's padding one which seemed to do a similar thing. I've also (hopefully) fixed the "tooltips crash application on exit" bug that appea= red when I ran Rammy's test code. There is some safety checking on SetImageList, AddBitmap and ChangeBitmap= . You cannot call SetImageList and AddBitmap/ChangeBitmap on the same toolb= ar as microsoft says this would be a really bad idea, so you get a croak abo= ut it if you try it. Another thing is, I've modified the ButtonClick event so that when a butt= on that has the TBSTYLE_DROPDOWN style applied to it is clicked, an extra argument gets passed to ButtonClick with the value of 1. This allows you = to tell if you need to show a drop-down menu. There have been a ton of constants added to GUI.pm and GUI_Constants.cpp,= so you can use most of the regular toolbar styles, extended styles, button styles etc. One word of warning is to avoid using the BTNS_*** constants = and use the TBSTYLE_*** equivalents instead, as the availability of the BTNS_= *** constants depends on the headers and compiler used (they're a new thing). I added dwFlags to the USERDATA and CREATESTRUCT structs. This dword is intended to store any per-object flags needed. for instance, the toolbar uses FLAGS_TB_HASBITMAPS to remember if AddBitmap has been called and complain if the user attempts to SetImageList on the same toolbar object. Developers: add flags as you see fit. One last thing. We're running out of mask bits in the NEM. Are they reall= y needed? The mask only appears to be used as a speed thing (to avoid doing= a hash lookup for each event) so perhaps it would be more sensible to group some events together or something? Thoughts please... Steve ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id438&op=3Dick _______________________________________________ Perl-Win32-GUI-Hackers mailing list Per...@li... https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-hackers |
From: Steve P. <st...@ba...> - 2004-02-17 20:21:16
|
Hi Jez, I didnt say there wouldn't be bugs in it :) I've updated the CVS, it was a stupid mistake (casting a tooltip handle to an imagelist handle - DUH), so it should work now. Let me know of any other bugs, I'm sure there will be plenty as I did not have time to fully test things like imagelists on it. Steve ----- Original Message ----- From: "Jez White" <je...@je...> To: "Stephen Pick" <Ste...@uc...>; "Win32 GUI Hackers (E-mail)" <per...@li...> Sent: Tuesday, February 17, 2004 7:24 PM Subject: Re: [perl-win32-gui-hackers] CVS update: Toolbars I'm having problems building using ming. I get the following error: C:\development\Win32-GUI-0.0.670>nmake install Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. C:\Perl\bin\perl.exe -IC:\Perl\lib -IC:\Perl\lib C:\Perl\lib\ExtUtils/xs ubpp -typemap C:\Perl\lib\ExtUtils\typemap -typemap typemap Toolbar.xs > Toolba r.cpp gcc -c -g -O2 -DWIN32 -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno- strict-aliasing -DPERL_MSVCRT_READFIX -g -O2 -DVERSION=\"0.0.670\" -DXS_ VERS ION=\"0.0.670\" -DHASATTRIBUTE -IC:\Perl\lib\CORE -D__MINGW__ Toolbar.cpp Toolbar.xs: In function `BOOL Toolbar_onParseOption(char*, SV*, tagPERLWIN32GUI_CREATESTRUCT*)': Toolbar.xs:24: cannot convert `_IMAGELIST*' to `HWND__*' in assignment Toolbar.xs: In function `void XS_Win32__GUI__Toolbar_ChangeBitmap(PerlInterpreter*, CV*)': Toolbar.xs:320: warning: cast from pointer to integer of different size NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0x1' Stop. If I comment out the line, it builds ok. Cheers, jez. ----- Original Message ----- From: "Stephen Pick" <Ste...@uc...> To: "Win32-Gui-Users (E-mail)" <per...@li...>; "Win32 GUI Hackers (E-mail)" <per...@li...> Sent: Tuesday, February 17, 2004 1:58 PM Subject: [perl-win32-gui-hackers] CVS update: Toolbars Hi, I've just spent the morning converting and documenting Rammy's perl toolbar functions into XS. They're now in the CVS. The new functions are as follows: # (@)METHOD:SetButtonState(BUTTON, STATE) # (@)METHOD:SetStyle(STYLE) # (@)METHOD:SetExtendedStyle(STYLE) # (@)METHOD:GetStyle(STYLE) # (@)METHOD:MoveButton(BUTTON, TARGET) # (@)METHOD:SetImageList(IMAGELIST) # (@)METHOD:SetHotImageList(IMAGELIST) # (@)METHOD:SetDisabledImageList(IMAGELIST) # (@)METHOD:GetImageList() # (@)METHOD:GetHotImageList() # (@)METHOD:GetDisabledImageList() # (@)METHOD:ChangeBitmap(BUTTON, BITMAP) # (@)METHOD:CheckButton(BUTTON, CHECKED) # (@)METHOD:DeleteButton(BUTTON) # (@)METHOD:SetToolTips(TOOLTIP) SetToolTips is not really needed, as you should be able to assign a tooltip object using the -tooltip option when constructing the toolbar now. Same thing with SetImageList; you should be able to use -imagelist to set an imagelist now. Note that there is already a Padding() method for the toolbar so I didnt add Rammy's padding one which seemed to do a similar thing. I've also (hopefully) fixed the "tooltips crash application on exit" bug that appeared when I ran Rammy's test code. There is some safety checking on SetImageList, AddBitmap and ChangeBitmap. You cannot call SetImageList and AddBitmap/ChangeBitmap on the same toolbar as microsoft says this would be a really bad idea, so you get a croak about it if you try it. Another thing is, I've modified the ButtonClick event so that when a button that has the TBSTYLE_DROPDOWN style applied to it is clicked, an extra argument gets passed to ButtonClick with the value of 1. This allows you to tell if you need to show a drop-down menu. There have been a ton of constants added to GUI.pm and GUI_Constants.cpp, so you can use most of the regular toolbar styles, extended styles, button styles etc. One word of warning is to avoid using the BTNS_*** constants and use the TBSTYLE_*** equivalents instead, as the availability of the BTNS_*** constants depends on the headers and compiler used (they're a new thing). I added dwFlags to the USERDATA and CREATESTRUCT structs. This dword is intended to store any per-object flags needed. for instance, the toolbar uses FLAGS_TB_HASBITMAPS to remember if AddBitmap has been called and complain if the user attempts to SetImageList on the same toolbar object. Developers: add flags as you see fit. One last thing. We're running out of mask bits in the NEM. Are they really needed? The mask only appears to be used as a speed thing (to avoid doing a hash lookup for each event) so perhaps it would be more sensible to group some events together or something? Thoughts please... Steve ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&op=ick _______________________________________________ Perl-Win32-GUI-Hackers mailing list Per...@li... https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-hackers ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&op=ick _______________________________________________ Perl-Win32-GUI-Hackers mailing list Per...@li... https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-hackers |
From: Jez W. <je...@je...> - 2004-02-17 20:29:18
|
Hi, No problem. I'll be giving it a good test tomorrow. I think I've found a = bug with the listview background change - some of my list views have a thin black band on one side (on XP, with XP styles and without, I've yet to tr= y it on other versions of windows). I'll create a test example once I've looked at it a little more. Thanks for the work - some real good enhancements going in. Cheers, jez. ----- Original Message -----=20 From: "Steve Pick" <st...@ba...> To: "Jez White" <je...@je...>; "Win32 GUI Hackers (E-mail)= " <per...@li...> Sent: Tuesday, February 17, 2004 8:16 PM Subject: Re: [perl-win32-gui-hackers] CVS update: Toolbars > Hi Jez, > > I didnt say there wouldn't be bugs in it :) > > I've updated the CVS, it was a stupid mistake (casting a tooltip handle= to > an imagelist handle - DUH), so it should work now. Let me know of any other > bugs, I'm sure there will be plenty as I did not have time to fully tes= t > things like imagelists on it. > > Steve > > ----- Original Message -----=20 > From: "Jez White" <je...@je...> > To: "Stephen Pick" <Ste...@uc...>; "Win32 GUI Hackers (E-mail= )" > <per...@li...> > Sent: Tuesday, February 17, 2004 7:24 PM > Subject: Re: [perl-win32-gui-hackers] CVS update: Toolbars > > > I'm having problems building using ming. I get the following error: > > C:\development\Win32-GUI-0.0.670>nmake install > > Microsoft (R) Program Maintenance Utility Version 1.50 > Copyright (c) Microsoft Corp 1988-94. All rights reserved. > > C:\Perl\bin\perl.exe -IC:\Perl\lib -IC:\Perl\lib > C:\Perl\lib\ExtUtils/xs > ubpp -typemap C:\Perl\lib\ExtUtils\typemap -typemap typemap Toolbar.xs= > > Toolba > r.cpp > > > > > gcc -c -g -O2 -DWIN32 -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -f= no- > trict-aliasing -DPERL_MSVCRT_READFIX -g -O2 -DVERSION=3D\"0.0.670\" -= DXS_ > VERS > ION=3D\"0.0.670\" -DHASATTRIBUTE -IC:\Perl\lib\CORE -D__MINGW__ Toolbar= .cpp > Toolbar.xs: In function `BOOL Toolbar_onParseOption(char*, SV*, > tagPERLWIN32GUI_CREATESTRUCT*)': > Toolbar.xs:24: cannot convert `_IMAGELIST*' to `HWND__*' in assignment > Toolbar.xs: In function `void > XS_Win32__GUI__Toolbar_ChangeBitmap(PerlInterpreter*, CV*)': > Toolbar.xs:320: warning: cast from pointer to integer of different size > NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0x1' > Stop. > > If I comment out the line, it builds ok. > > Cheers, > > jez. > ----- Original Message -----=20 > From: "Stephen Pick" <Ste...@uc...> > To: "Win32-Gui-Users (E-mail)" <per...@li...>; > "Win32 GUI Hackers (E-mail)" <per...@li...> > Sent: Tuesday, February 17, 2004 1:58 PM > Subject: [perl-win32-gui-hackers] CVS update: Toolbars > > > Hi, > > I've just spent the morning converting and documenting Rammy's perl toolbar > functions into XS. They're now in the CVS. > > The new functions are as follows: > # (@)METHOD:SetButtonState(BUTTON, STATE) > # (@)METHOD:SetStyle(STYLE) > # (@)METHOD:SetExtendedStyle(STYLE) > # (@)METHOD:GetStyle(STYLE) > # (@)METHOD:MoveButton(BUTTON, TARGET) > # (@)METHOD:SetImageList(IMAGELIST) > # (@)METHOD:SetHotImageList(IMAGELIST) > # (@)METHOD:SetDisabledImageList(IMAGELIST) > # (@)METHOD:GetImageList() > # (@)METHOD:GetHotImageList() > # (@)METHOD:GetDisabledImageList() > # (@)METHOD:ChangeBitmap(BUTTON, BITMAP) > # (@)METHOD:CheckButton(BUTTON, CHECKED) > # (@)METHOD:DeleteButton(BUTTON) > # (@)METHOD:SetToolTips(TOOLTIP) > > SetToolTips is not really needed, as you should be able to assign a tooltip > object using the -tooltip option when constructing the toolbar now. Sam= e > thing with SetImageList; you should be able to use -imagelist to set an > imagelist now. > > Note that there is already a Padding() method for the toolbar so I didn= t add > Rammy's padding one which seemed to do a similar thing. I've also > (hopefully) fixed the "tooltips crash application on exit" bug that appeared > when I ran Rammy's test code. > > There is some safety checking on SetImageList, AddBitmap and ChangeBitm= ap. > You cannot call SetImageList and AddBitmap/ChangeBitmap on the same toolbar > as microsoft says this would be a really bad idea, so you get a croak about > it if you try it. > > Another thing is, I've modified the ButtonClick event so that when a button > that has the TBSTYLE_DROPDOWN style applied to it is clicked, an extra > argument gets passed to ButtonClick with the value of 1. This allows yo= u to > tell if you need to show a drop-down menu. > > There have been a ton of constants added to GUI.pm and GUI_Constants.cp= p, so > you can use most of the regular toolbar styles, extended styles, button > styles etc. One word of warning is to avoid using the BTNS_*** constant= s and > use the TBSTYLE_*** equivalents instead, as the availability of the BTNS_*** > constants depends on the headers and compiler used (they're a new thing= ). > > I added dwFlags to the USERDATA and CREATESTRUCT structs. This dword is > intended to store any per-object flags needed. for instance, the toolba= r > uses FLAGS_TB_HASBITMAPS to remember if AddBitmap has been called and > complain if the user attempts to SetImageList on the same toolbar objec= t. > Developers: add flags as you see fit. > > One last thing. We're running out of mask bits in the NEM. Are they rea= lly > needed? The mask only appears to be used as a speed thing (to avoid doi= ng a > hash lookup for each event) so perhaps it would be more sensible to gro= up > some events together or something? Thoughts please... > > Steve > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id438&op=3Dick > _______________________________________________ > Perl-Win32-GUI-Hackers mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-hackers > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id438&op=3Dick > _______________________________________________ > Perl-Win32-GUI-Hackers mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-hackers > |
From: Jez W. <je...@je...> - 2004-02-18 10:07:50
|
Hi, I've had a play and it seems ok - although I'm having a few problems with some of the styles - but this could be me:) The example below creates a toolbar with a few buttons (run in the samples folder for it to pick up the bitmaps) which are added via image lists. If I use the SetStyle method (with any style) the toolbar ends up at the bottem of the window. I've yet to get any functionality working with SetExtendedStyle (I was trying to get tooltips working with the toolbar using the text from the buttons). Just me? Cheers, jez. ============== use Win32::GUI; $W = new Win32::GUI::Window( -title => "Win32::GUI::Toolbar test", -left => 100, -top => 100, -width => 500, -height => 400, -name => "Window", ); $B1 = new Win32::GUI::Bitmap("one.bmp"); $B2 = new Win32::GUI::Bitmap("two.bmp"); $B3 = new Win32::GUI::Bitmap("three.bmp"); $IL = new Win32::GUI::ImageList(16, 16, 0, 3, 10); $IL->Add($B1, 0); $IL->Add($B2, 0); $IL->Add($B3, 0); $TB = $W->AddToolbar( -left => 0, -top => 0, -width => 300, -height => 100, -name => "Toolbar", -addstyle => 0x0800, ); $TB->SetImageList($IL); #$TB->SetStyle(TBSTYLE_FLAT|TBSTYLE_TRANSPARENT); #$TB->SetExtendedStyle(TBSTYLE_EX_MIXEDBUTTONS|TBSTYLE_EX_DRAWDDARROWS); $Bh1 = new Win32::GUI::Bitmap("three.bmp"); $Bh2 = new Win32::GUI::Bitmap("one.bmp"); $Bh3 = new Win32::GUI::Bitmap("two.bmp"); $ILhot = new Win32::GUI::ImageList(16, 16, 0, 3, 10); $ILhot->Add($Bh1, 0); $ILhot->Add($Bh2, 0); $ILhot->Add($Bh3, 0); $TB->SetHotImageList($ILhot); $TB->AddButtons( 4, 0, 1, 4, 0, 0, 1, 2, 4, 0, 1, 0, 0, 0, TBSTYLE_SEP, 0, 2, 3, 4, 0, 2, ); $TB->AddString("One"); $TB->AddString("Two"); $TB->AddString("Three"); $W->Show; Win32::GUI::Dialog(); sub Window_Terminate { return -1; } sub Window_Resize { $TB->Resize($W->ScaleWidth-10, 100); } sub Toolbar_ButtonClick { my($button) = @_; print "Toolbar: clicked button $button\n"; } |