[perl-win32-gui-users] DateTime new methods
Glenn, Below are two new methods (GetDateTime and SetDateTime) for the datetime control. They allow the setting and reading of the time component. I've also included a simple example. I'll update the online documentation when you have released the new build. I tried to find the fix for the splitter control but couldn't find any code, although found this mail from Trevor Garside: Splitter Auto-Size I made some changes to the Splitter code to make it to auto-resize as it is being dragged. If you are interested in it, I can send it. This was the first bit of code I edited, and at that point I had no idea how XS worked. Now that I am more familiar with it, I want to re-code it and make it a switch-enabled option. I've emailed him to see if he is prepaired to send the code to this list. Cheers, jez. ### # (@)METHOD:GetDateTime() # (preliminary) Returns the date and time in the DateTime control in a eight # elements array (year, month, day, dayofweek, hour, minute, second, millisecond). # Based on code from Laurent Rocher void GetDateTime(handle) HWND handle PREINIT: SYSTEMTIME st; PPCODE: if(DateTime_GetSystemtime(handle, &st) == GDT_VALID) { EXTEND(SP, 8); XST_mIV(0, st.wYear); XST_mIV(1, st.wMonth); XST_mIV(2, st.wDay); XST_mIV(3, st.wDayOfWeek); XST_mIV(4, st.wHour); XST_mIV(5, st.wMinute); XST_mIV(6, st.wSecond); XST_mIV(7, st.wMilliseconds); XSRETURN(8); } else { XSRETURN_UNDEF; } ### # (@)METHOD:SetDateTime(YEAR,MON, DAY, HOUR, MIN, SEC, [MSEC=0]) # (preliminary) Sets the date time in the DateTime control # Based on code from Laurent Rocher BOOL SetDateTime(handle, year, mon, day, hour, min, sec, msec=0) HWND handle int year int mon int day int hour int min int sec int msec PREINIT: SYSTEMTIME st; CODE: ZeroMemory(&st, sizeof(SYSTEMTIME)); st.wYear = year; st.wDay= day; st.wMonth = mon; st.wHour = hour; st.wMinute = min; st.wSecond = sec; st.wMilliseconds = msec; RETVAL = DateTime_SetSystemtime(handle, GDT_VALID, &st); OUTPUT: RETVAL ### An example using the new methods: use strict; use Win32::GUI; # main Window my $Window = new Win32::GUI::Window ( -name => "Window", -title=> "Test", -pos => [100, 100], -size => [400, 400], ) or die "new Window"; # Date time control my $DateTime = new Win32::GUI::DateTime ( -parent => $Window, -name => "DateTime", -pos => [10, 10], -size => [180, 20], ); $DateTime->Format('dd-MMM- HH:mm:ss'); # Test Buttons my $Button = $Window->AddButton ( -name => "Gettime", -text => "Get the time", -pos => [100, 100], -size => [100, 100], ); my $Button1 = $Window->AddButton ( -name => "Settime", -text => "Set the time", -pos => [205, 100], -size => [100, 100], ); # Event loop $Window->Show(); Win32::GUI::Dialog(); # Main window event handler sub Window_Terminate { return -1; } # Button events sub Gettime_Click { my ($mday, $mon, $year, undef, $hour, $min,$sec) = $DateTime->GetDateTime(); print "Year $year Month $mon Day $mday Hour $hour Min $min Sec $sec \n"; } sub Settime_Click { my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $year += 1900; $DateTime->SetDateTime($year, $mon, $mday, $hour,$min, $sec); } _ On the move? Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile
Re: [perl-win32-gui-users] accelerator keys - now working
From: Erick Bourgeois <[EMAIL PROTECTED]> > Erick, are you able to generate flat html files which could be included > automatically in new builds? Jeremy, I seems redundant to create HTML files for the distro and have online ones. I was under the impression that creating this documentation project, we would be seperating the 2 and thus certain people could concentrate on that which they want to contribute. It is indeed redundant, but I can see the need for flat file html pages, when new builds are ready for wide spread distribution, through, say Activestate. At some point it would be nice to see win::gui as part of the Activestate core:) Personally, I think the documentation project should become the focal point of win::gui - it is easy to update and add to, and it does a nice job of selling win::gui. Cheers, jez. _ Hotmail messages direct to your mobile phone http://www.msn.co.uk/msnmobile
[perl-win32-gui-users] I'm here
hello Win32::GUI people I'm here, I'm here! I'm very, very sorry for my latitance. I know I have promised a lot of things, a lot of times, and never respected what I said. please accept my excuse for this. and I'm very, very happy to see things moving and people willing to help. as it is clear at this point, I'm not in the position to continue developing Win32::GUI all alone. but I'm not going to give up the project. if there is something useful for the community I can do acting as a coordinator (sort of "pumpking", in Perl terms), I'll be very happy to coordinate. if someone feels like taking over the whole stuff, I'll be very happy to be just a member of a team of developers. my current development version of Win32::GUI has many bugfixes, but the internals are being heavily reworked (to support NEM more "natively") and there are many non-working features. as an open question to anyone interested, I ask: do you think it is better to keep the "rewrite" off for a while and work on bugfixing the current release, or do you prefer working with me on the new internals? I can give all the tech help (eg. about XS and about how Win32::GUI works) to people who want to be part of the dev team. there's a mailing list (perl-win32-gui-hackers) that I set up just for this task. so, if you want CVS commit access on SourceForge, just give me your SourceForge user name and I will set it up. the -hackers mailing list can also be used to ask questions about how SourceForge and/or CVS works. regarding the documentation, I appreciate what Erick did, but I found it a little difficult to work with. I think a wiki (with CGI::Kwiki, for example) would be a better start. we could also write in POD so that the documentation could be more easily integrated in the CPAN distribution. I'm still backlogging all the messages on the list, so I will have more to elaborate on later. for now, please accept my most sincere and humble apologies for being such a non-existant person for so much time :-( cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print;
[perl-win32-gui-users] How to Flash a Window?
Does anyone know how I could go about making my main window flash when a certain event has occured? I've tried something like the following code, but can't seem to get it to work. $mainwindow = Win32::GUI::Window -> new ( -name => "Mainwindow", -text => "Main Window", -width => 100, -height => 100, ); . my $flash = new Win32::API('user32','FlashWindow',['N','N'],'N'); my $ret = $flash -> Call($mainwindow, 1); Thanks. Len.
Re: [perl-win32-gui-users] I'm here
Hi Aldo, Glad to hear from you again. I would like CVS commit access on SourceForge, user name guruglenn although I may not be able to use it until next year (but that's only a couple months away). Thank you. I'm glad to hear you are working on NEM, as I think it is a friendlier model overall. Unfortunately, due to timing, I must proceed with my current project using the old event model + bug fixes. Regarding bugfixes, it would be nice to have them available on the current code base, but at this point, with many non-working features in your current development code base, it seems like simply releasing it wouldn't be practical. Although I haven't yet figured out SourceForge's CVS implementation, I know the general capabilities of a source code control system, having worked with SCCS, RCS, and ClearCase. And I think CVS is built on top of SCCS or RCS, so has the same capabilities, just packages them nicer? At least, I think that is how it started... Anyway, perhaps it would be nice to have two branches... a development branch and a bugfix branch. Perhaps you could continue on the NEM on the development branch, and let other people work on the bugfix branch, fixing bugs, and perhaps doing minor enhancements. If this sounds good to you, perhaps someone (I'd volunteer starting in Jan, but if there are other volunteers that's OK) could be the designated "pumpking" for the bugfix branch. On approximately 11/17/2003 2:47 AM, came the following characters from the keyboard of Aldo Calpini: hello Win32::GUI people I'm here, I'm here! I'm very, very sorry for my latitance. I know I have promised a lot of things, a lot of times, and never respected what I said. please accept my excuse for this. and I'm very, very happy to see things moving and people willing to help. as it is clear at this point, I'm not in the position to continue developing Win32::GUI all alone. but I'm not going to give up the project. if there is something useful for the community I can do acting as a coordinator (sort of "pumpking", in Perl terms), I'll be very happy to coordinate. if someone feels like taking over the whole stuff, I'll be very happy to be just a member of a team of developers. my current development version of Win32::GUI has many bugfixes, but the internals are being heavily reworked (to support NEM more "natively") and there are many non-working features. as an open question to anyone interested, I ask: do you think it is better to keep the "rewrite" off for a while and work on bugfixing the current release, or do you prefer working with me on the new internals? I can give all the tech help (eg. about XS and about how Win32::GUI works) to people who want to be part of the dev team. there's a mailing list (perl-win32-gui-hackers) that I set up just for this task. so, if you want CVS commit access on SourceForge, just give me your SourceForge user name and I will set it up. the -hackers mailing list can also be used to ask questions about how SourceForge and/or CVS works. regarding the documentation, I appreciate what Erick did, but I found it a little difficult to work with. I think a wiki (with CGI::Kwiki, for example) would be a better start. we could also write in POD so that the documentation could be more easily integrated in the CPAN distribution. I'm still backlogging all the messages on the list, so I will have more to elaborate on later. for now, please accept my most sincere and humble apologies for being such a non-existant person for so much time :-( cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print; --- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl ___ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users -- Glenn -- http://nevcal.com/ === Like almost everyone, I receive a lot of spam every day, much of it offering to help me get out of debt or get rich quick. It's ridiculous. -- Bill Gates And here is why it is ridiculous: The division that includes Windows posted an operating profit of $2.26 billion on revenue of $2.81 billion. --from Reuters via http://biz.yahoo.com/rc/031113/tech_microsoft_msn_1.html So that's profit of over 400% of investment... with a bit more investment in Windows technology, particularly in the area of reliability, the profit percentage might go down, but so might the bugs and security problems? Seems like it would be a reasonable tradeoff. WalMart earnings are 3.4% of investment.
Re: [perl-win32-gui-users] How to Flash a Window?
Hi, Try with Window handle : my $ret = $flash -> Call($mainwindow->{-handle}, 1); Laurent. > Does anyone know how I could go about making my main window flash when a > certain event has occured? > > I've tried something like the following code, but can't seem to get it to > work. > > $mainwindow = Win32::GUI::Window -> new ( > -name => "Mainwindow", > -text => "Main Window", > -width => 100, > -height => 100, > ); > > .. > > my $flash = new Win32::API('user32','FlashWindow',['N','N'],'N'); > my $ret = $flash -> Call($mainwindow, 1); > > Thanks. > > Len.
Re: [perl-win32-gui-users] How to Flash a Window?
That worked great. Thank you very much. Len. "Laurent ROCHER" <[EMAIL PROTECTED]To: perl-win32-gui-users@lists.sourceforge.net ernet.fr>cc: [EMAIL PROTECTED] Subject: Re: [perl-win32-gui-users] How to Flash a Window? 11/17/2003 11:53 AM Please respond to "Laurent ROCHER" Hi, Try with Window handle : my $ret = $flash -> Call($mainwindow->{-handle}, 1); Laurent. > Does anyone know how I could go about making my main window flash when a > certain event has occured? > > I've tried something like the following code, but can't seem to get it to > work. > > $mainwindow = Win32::GUI::Window -> new ( > -name => "Mainwindow", > -text => "Main Window", > -width => 100, > -height => 100, > ); > > .. > > my $flash = new Win32::API('user32','FlashWindow',['N','N'],'N'); > my $ret = $flash -> Call($mainwindow, 1); > > Thanks. > > Len.
Re: [perl-win32-gui-users] I'm here
Hi Aldo, Happy to read you again. Last week, i have proposed to use SourceForge CVS for start a bug fix branch on 665 release. I have play a little with CVS, and i think i can setup CVS like this. 1) Tag current CVS source code as Win32-GUI-0_0_622. I have notice a problem with text files. Each line end with CRCRLF. I found this in TortoiseCVS FAQ : http://www.tortoisecvs.org/faq.html#sharelinux I have fix this in my home repository, so i can correct it before. 2) Upload 665 code and tag it as Win32-GUI-0_0_665 3) Make a Win32-GUI-0_0_665-Fix branch and use this branch for fix bug. So, we can continue to use main branch for new version. If you are agree, i can do the job and start to work on 665 fix branch. I probably take a look on next release too ;) Kwiki it's a good idea. It's very easy to install/customize/use. Why not use SourceForge Web Space (i read somewhere it's possible to use perl cgi). Laurent. > > Glad to hear from you again. I would like CVS commit access on > SourceForge, user name guruglenn although I may not be able to use it > until next year (but that's only a couple months away). Thank you. > > I'm glad to hear you are working on NEM, as I think it is a friendlier > model overall. Unfortunately, due to timing, I must proceed with my > current project using the old event model + bug fixes. > > Regarding bugfixes, it would be nice to have them available on the > current code base, but at this point, with many non-working features in > your current development code base, it seems like simply releasing it > wouldn't be practical. > > Although I haven't yet figured out SourceForge's CVS implementation, I > know the general capabilities of a source code control system, having > worked with SCCS, RCS, and ClearCase. And I think CVS is built on top > of SCCS or RCS, so has the same capabilities, just packages them nicer? > At least, I think that is how it started... Anyway, perhaps it would > be nice to have two branches... a development branch and a bugfix branch. > > Perhaps you could continue on the NEM on the development branch, and let > other people work on the bugfix branch, fixing bugs, and perhaps doing > minor enhancements. > > If this sounds good to you, perhaps someone (I'd volunteer starting in > Jan, but if there are other volunteers that's OK) could be the > designated "pumpking" for the bugfix branch. > > On approximately 11/17/2003 2:47 AM, came the following characters from > the keyboard of Aldo Calpini: > > hello Win32::GUI people > > > > I'm here, I'm here! I'm very, very sorry for my latitance. I know I > > have promised a lot of things, a lot of times, and never respected > > what I said. please accept my excuse for this. > > > > and I'm very, very happy to see things moving and people willing to > > help. as it is clear at this point, I'm not in the position to continue > > developing Win32::GUI all alone. but I'm not going to give up the project. > > if there is something useful for the community I can do acting as a > > coordinator (sort of "pumpking", in Perl terms), I'll be very happy to > > coordinate. if someone feels like taking over the whole stuff, I'll be > > very happy to be just a member of a team of developers. > > > > my current development version of Win32::GUI has many bugfixes, but the > > internals are being heavily reworked (to support NEM more "natively") > > and there are many non-working features. as an open question to anyone > > interested, I ask: do you think it is better to keep the "rewrite" off > > for a while and work on bugfixing the current release, or do you > > prefer working with me on the new internals? > > > > I can give all the tech help (eg. about XS and about how Win32::GUI works) > > to people who want to be part of the dev team. there's a mailing list > > (perl-win32-gui-hackers) that I set up just for this task. > > > > so, if you want CVS commit access on SourceForge, just give me your > > SourceForge user name and I will set it up. the -hackers mailing list > > can also be used to ask questions about how SourceForge and/or CVS > > works. > > > > regarding the documentation, I appreciate what Erick did, but I found > > it a little difficult to work with. I think a wiki (with CGI::Kwiki, > > for example) would be a better start. we could also write in POD so > > that the documentation could be more easily integrated in the CPAN > > distribution. > > > > I'm still backlogging all the messages on the list, so I will have > > more to elaborate on later. for now, please accept my most sincere and > > humble apologies for being such a non-existant person for so much > > time :-( > > > > > > cheers, > > Aldo > > > > __END__ > > $_=q,just perl,,s, , another ,,s,$, hacker,,print;
[perl-win32-gui-users] Splitter code from Trevor Garside
All, Below is code from Trevor Garside (reproduced with permission) - it adds a new event _Drag for the splitter control. The downside is that it disables the _Release event. I've tested it and it works (558). If this is included in any new build, the _Release event should be enabled. Cheers, jez. --- /* ### # (@)INTERNAL:SplitterMsgLoop(hwnd, uMsg, wParam, lParam) # message loop for Win32::GUI::Splitter objects */ LRESULT CALLBACK SplitterMsgLoop(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { int PerlResult; char Name[MAX_EVENT_NAME]; HV* self; SV** fetching; SV* storing; long tracking, horizontal, trackpos; int min; int max; POINT pt; HWND phwnd; HDC hdc; RECT rc; LPPERLWIN32GUI_USERDATA perlud; #ifdef PERLWIN32GUI_STRONGDEBUG printf("!XS(SplitterMsgLoop) got (%ld, 0x%x, %ld, %ld)\n", hwnd, uMsg, wParam, lParam); #endif if(uMsg == WM_DESTROY) { safefree( (LPPERLWIN32GUI_USERDATA) GetWindowLong(hwnd, GWL_USERDATA)); return DefWindowProc(hwnd, uMsg, wParam, lParam); } #ifdef PERL_OBJECT pPerl = ((LPPERLWIN32GUI_USERDATA) GetWindowLong(hwnd, GWL_USERDATA))->pPerl; #endif PerlResult = 1; strcpy(Name, "main::"); if(GetObjectName(NOTXSCALL hwnd, Name)) { switch(uMsg) { case WM_MOUSEMOVE: self = HV_SELF_FROM_WINDOW(hwnd); fetching = hv_fetch(self, "-tracking", 9, FALSE); if(SvMAGICAL(self)) mg_get(*fetching); if(fetching != NULL) { tracking = SvIV(*fetching); if(tracking) { fetching = hv_fetch(self, "-horizontal", 11, FALSE); if(SvMAGICAL(self)) mg_get(*fetching); if(fetching != NULL && SvOK(*fetching)) { horizontal = SvIV(*fetching); } fetching = hv_fetch(self, "-trackpos", 9, FALSE); if(SvMAGICAL(self)) mg_get(*fetching); if(fetching != NULL && SvOK(*fetching)) { trackpos = SvIV(*fetching); } /* * (@)EVENT:Drag(COORD) * Sent when the Splitter is dragged to a new coordinate * (@)APPLIES_TO:Splitter */ if(horizontal > 0) { phwnd = GetParent(hwnd); GetCursorPos(&pt); ScreenToClient(phwnd, &pt); if(trackpos != pt.y) { pt.y = AdjustSplitterCoord(NOTXSCALL self, pt.y, phwnd); //DrawSplitter(NOTXSCALL hwnd); GetClientRect(hwnd, &rc); SetWindowPos(hwnd, NULL, rc.left, pt.y, 0, 0, SWP_NOZORDER | SWP_NOSIZE); //DrawSplitter(NOTXSCALL hwnd); if(trackpos != pt.y) { storing = newSViv((long) pt.y); hv_store(self, "-trackpos", 9, storing, 0); if(SvMAGICAL(self)) mg_set(storing); strcat(Name, "_Drag"); PerlResult = DoEvent_Long(NOTXSCALL Name, (long) pt.y); } } } else { phwnd = GetParent(hwnd); GetCursorPos(&pt); ScreenToClient(phwnd, &pt); if(trackpos != pt.x) { pt.x = AdjustSplitterCoord(NOTXSCALL self, pt.x, phwnd); //DrawSplitter(NOTXSCALL hwnd); GetClientRect(hwnd, &rc); SetWindowPos(hwnd, NULL, pt.x, rc
Re: [perl-win32-gui-users] I'm here
From: Aldo Calpini <[EMAIL PROTECTED]> and I'm very, very happy to see things moving and people willing to help. as it is clear at this point, I'm not in the position to continue developing Win32::GUI all alone. but I'm not going to give up the project. if there is something useful for the community I can do acting as a coordinator (sort of "pumpking", in Perl terms), I'll be very happy to coordinate. if someone feels like taking over the whole stuff, I'll be very happy to be just a member of a team of developers. I think one thing we can all agree on is that we have missed the role of a coordinator and figurehead. Welcome back:) my current development version of Win32::GUI has many bugfixes, but the internals are being heavily reworked (to support NEM more "natively") and there are many non-working features. as an open question to anyone interested, I ask: do you think it is better to keep the "rewrite" off for a while and work on bugfixing the current release, or do you prefer working with me on the new internals? From a personal viewpoint - maintaining two or more code lines always ends up in a mess. However, there is a legitimate need to get a new build out with all the bug fixes and minor improvements. Once a new build is released, focus should back to the new development. regarding the documentation, I appreciate what Erick did, but I found it a little difficult to work with. I think a wiki (with CGI::Kwiki, for example) would be a better start. we could also write in POD so that the documentation could be more easily integrated in the CPAN distribution. I quite liked what Erick did - but your the boss:) I think Win32::GUI does need a document project of some sort - it takes alot of the druggery out the process. Perhaps Erick could set up something under sourceforge and make the sourceforge website the "home" of Win32::GUI? Cheers, jez. _ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger