Re: [perl-win32-gui-users] Win XP styles
You shouldn't have any issue with Reshacker and PP. I can recommend PerlApp with Win32GUI, it's a nice tool. As a side you can also use Reshacker to add icons, bitmaps, string tables and other objects to the exe. In the case of icons, bitmaps, string tables Win32::GUI automatically looks into the exe first so you dont need to change your code. Cheers, Jeremy. Date: Tue, 4 Nov 2008 20:32:02 +1100 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; perl-win32-gui-users@lists.sourceforge.net Subject: Re: [perl-win32-gui-users] Win XP styles I don't have an active license for perlapp so I've been using PP. Reshacker looks good, as long as the end result is the same it should do fine, thanks. On Tue, Nov 4, 2008 at 8:12 PM, Jeremy White [EMAIL PROTECTED] wrote: Hi, When packing the script into an exe what tool are you using? If you are using PerlApp from activestate you may need to update to a later version as I think it adds a manifest to the exe which overrides any file based manifest. You can manually change the manifest with a tool such as reshacker to force it to use XP styles. As a side the manifest file should always match the name of the exe being run. Cheers, Jez. Date: Tue, 4 Nov 2008 18:50:55 +1100 From: [EMAIL PROTECTED] To: perl-win32-gui-users@lists.sourceforge.net Subject: [perl-win32-gui-users] Win XP styles Hi, I've been trying to get a listview which looks like this: http://delphitutorial.info/wp-content/uploads/2007/07/next-grid.jpg as opposed to the old (and ugly) style: http://www.knowdotnet.com/articles/PrintListViewDemoForm.jpg Robert's perl.exe.manifest file did the trick only it doesn't work after packing the script to an exe. Is there another way to use xp styles? Also on the subject of Listview, how do you get row sorting functionality? (with an arrow on the column which the rows are being sorted by) Any help appreciated, -Jaun _ X Factor: latest video, features and more. Click here! http://clk.atdmt.com/GBL/go/115454063/direct/01/ _ See the most popular videos on the web http://clk.atdmt.com/GBL/go/115454061/direct/01/- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/___ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/
Re: [perl-win32-gui-users] Win XP styles
Hi, The way I do this is to create a child window that is the same size as the tab control (with the tab showing) and overlay it on the tab control. I then place the controls on this child window. Cheers, Jeremy. Date: Wed, 5 Nov 2008 10:26:41 +0300 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; perl-win32-gui-users@lists.sourceforge.net Subject: Re: [perl-win32-gui-users] Win XP styles Hello Jaun, Sorry for offtopic question, but I’m very interested how do you plan to deal with tabstrip controls with XP style activated? In XP style it has white background but all controls that you put on it will have it default (gray). Or you just don’t use tabstrips in your apps? Regards, _ Ilya Bandorin From: Jaun [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2008 10:51 AM To: perl-win32-gui-users@lists.sourceforge.net Subject: [perl-win32-gui-users] Win XP styles Hi, I've been trying to get a listview which looks like this: http://delphitutorial.info/wp-content/uploads/2007/07/next-grid.jpg as opposed to the old (and ugly) style: http://www.knowdotnet.com/articles/PrintListViewDemoForm.jpg Robert's perl.exe.manifest file did the trick only it doesn't work after packing the script to an exe. Is there another way to use xp styles? Also on the subject of Listview, how do you get row sorting functionality? (with an arrow on the column which the rows are being sorted by) Any help appreciated, -Jaun = Ce message et toutes les pieces jointes (ci-apres le message) sont confidentiels et susceptibles de contenir des informations couvertes par le secret professionnel. Ce message est etabli a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee interdite. Tout message electronique est susceptible d'alteration. La SOCIETE GENERALE et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme falsifie. = This message and any attachments (the message) are confidential, intended solely for the addressees, and may contain legally privileged information. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. = _ See the most popular videos on the web http://clk.atdmt.com/GBL/go/115454061/direct/01/- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/___ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/
[perl-win32-gui-users] Threads
Hi all, Am I susceptible to a crash if I create a Win32::GUI object (such as a label) in one thread, then call methods on that object in another thread? Following is an example of what I mean. Notice that I'm passing the label object as an argument to the entry point function of the new thread. This seems to work, but I don't know if I should be doing it just because it works: use strict; use Win32::GUI(); use threads; my $main = Win32::GUI::Window-new ( -name = 'Main', -text = 'Template Window', -size = [300,300], ); my $label = $main-AddLabel ( -text = 'I like the number 10', -pos = [10,10], ); threads-create('countDown', $label); $main-Center(); $main-Show(); Win32::GUI::Dialog(); sub countDown { my $labelObject = shift; for (my $i=9; $i0; $i--) { $labelObject-Text(I like the number $i); sleep(1); } } Thanks, Rob - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/___ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/
Re: [perl-win32-gui-users] Threads
I thought only the main thread can be used to create GUI elements reliably. Isn't that true? Octavian - Original Message - From: Perl Rob [EMAIL PROTECTED] To: perl-win32-gui-users@lists.sourceforge.net Sent: Thursday, November 06, 2008 6:52 PM Subject: [perl-win32-gui-users] Threads Hi all, Am I susceptible to a crash if I create a Win32::GUI object (such as a label) in one thread, then call methods on that object in another thread? Following is an example of what I mean. Notice that I'm passing the label object as an argument to the entry point function of the new thread. This seems to work, but I don't know if I should be doing it just because it works: use strict; use Win32::GUI(); use threads; my $main = Win32::GUI::Window-new ( -name = 'Main', -text = 'Template Window', -size = [300,300], ); my $label = $main-AddLabel ( -text = 'I like the number 10', -pos = [10,10], ); threads-create('countDown', $label); $main-Center(); $main-Show(); Win32::GUI::Dialog(); sub countDown { my $labelObject = shift; for (my $i=9; $i0; $i--) { $labelObject-Text(I like the number $i); sleep(1); } } Thanks, Rob - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/
Re: [perl-win32-gui-users] SOLUTION -- Newlines disappearing in richedit(unicode-content)
Hi Octavian and Glenn The thing with the '\par' was the point. The RTF-format is documented here: http://msdn.microsoft.com/en-us/library/aa140283(office.10).aspx i had to turn the '\r\n' into '\\par\r\n'. So here is my solution to handle multiline-unicode-text with richedit-fields. You need the pragmas: use utf8; # 'sub GT_DEFAULT() {0};' #my $flags = $flags = GT_DEFAULT; # defined with a constant my $codepage = 1200; my $struct = pack(LLIpp, $maxlen, $flags, $codepage, undef, undef); my $address = pack(P20, $struct); my $wparam = unpack(L, $address); my $numTchar = $window - $richedit - SendMessage(1118, $wparam, $buffer); # Alternatively You can define the message as constants WM_USER and EM_GETTEXTEX in the header of the program -- 'sub WM_USER() {1024};' and 'sub EM_GETTEXTEX() {+WM_USER+94};' # my $numTchar = $WIN - re - SendMessage(qw(EM_GETTEXTEX {+WM_USER() {1024}+94}), $wparam, $buffer); # defined with constants my $octets = substr($buffer, 0, ($numTchar*2)); my $text = decode(UCS-2LE, $octets); return($text); # Returns a unicode-string } And the Set-function: sub SetText # prepares unicode-strings for the Text()-method of the richedit { my @input = @_; my $rtf_prolog = '{\rtf1'; # Minimal-RTF-Header. Define Your own RTF-Header according the RTF-specs $input[0] =~ s/([^\x00-\x7F])/'\uc1\u'.((ord $1 32768)?ord $1 : ord($1)-65536).'?'/eg; # Converting unicode into 'escaped' RTF-format $input[0] =~ s/(\r\n)/\\par\r\n/g; # Converting common newlines (\r\n) into RTF-newlines (\par\r\n) return $rtf_prolog . $input[0] . '}'; # Returns the string as RTF } So if you want so get the text of the field, use: $SAVE = GetText($window,'richedit_field'); And to set it back, use: $window - richdit_field - Text(SetText($SAVE)); In this example, I made the function GetText variable, if you have more than one window or richedit-field. Honestly, I tested this not to much. Newlines, tabs and spaces works well. But i don't know what happens, if there is something totally unexpected in the richedit. Feel free to ask, if anyone needs examples or further information to the functions above. Again, thanks to all. Regards, Raphael On Wed 05/11/08 22:49 , Octavian Rasnita [EMAIL PROTECTED] sent: If I remember well, you need to use \par in the RTF document for specifying a new line. Find and read the RTF specifications. It will help you to do more other things. Octavian - Original Message - From: Raphael Stoeckli rabanti.chTo: Sent: Wednesday, November 05, 2008 10:05 PM Subject: [perl-win32-gui-users] Newlines disappearing in richedit(unicode-content) Hi @ all I’m working on an program, that can handle Unicode-text in richedit-fields. The fields sets and gets the text using some modifications of the richedit-field. These mods are also from this mailinglist. The problem is, that Newlines (\r\n) in strings (whether if it’s ASCII or Unicode) seems to be wiped, when I put the string into the modified richedit-field. I wrote a demo/test-program to show this behavior. You can get it here: http://www.rabanti.ch/storage/rtf_utf_test.pl or http://www.rabanti.ch/storage/rtf_utf_test.zip (if there is a problem with the encoding, while downloading) Anyhow I try to describe it abbreviated in this post. For saving Unicode-content into a string, I use these functions: - sub WM_USER() {1024}; sub EM_GETTEXTEX() {+WM_USER+94}; sub GT_DEFAULT() {0}; sub get_unicode # takes the text out of the richedit-field { my $maxlen = 1024; my $buffer = x $maxlen; my $flags = GT_DEFAULT; my $codepage = 1200; my $struct = pack(LLIpp, $maxlen, $flags, $codepage, undef, undef); my $address = pack(P20, $struct); my $wparam = unpack(L, $address); my $numTchar = $WIN - re - SendMessage(EM_GETTEXTEX, $wparam, $buffer); # re is the richedit-field, $WIN the window-object my $octets = substr($buffer, 0, ($numTchar*2)); my $text = decode(UCS-2LE, $octets); return($text); } - This is the richedit-field (simplified): $RE = $WIN - AddRichEdit( -name = 're', -size = [240, 80], -pushstyle = WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_LEFT | ES_MULTILINE, ); - I get the text out of the field like that: $SAVE = get_unicode; When I try to write the string back into the field, I use this function and definition: - our $RTF_PROLOG = '{\rtf1'; sub string2rtf # string-converter for RTF-handling { my @input = @_; $input[0] =~ s/([^\x00-\x7F])/'\uc1\u'.((ord $1 32768)?ord $1 : ord($1)-65536).'?'/eg; return $input[0]; } - I try to set the text like that: $WIN - re - Text($RTF_PROLOG . string2rtf($SAVE) . '}'); The result is that all
Re: [perl-win32-gui-users] Threads
I thought only the main thread can be used to create GUI elements reliably. Isn't that true? No. As long as you are using the latest version of Win32::GUI and a late perl (5.8.7 +) you can have any number of threads creating GUI objects (a separate message pump will be created in each thread - so when one thread/window is frozen becuase it's doing work, all other thread/windows will still work). The big problem becomes when you want to share Win32::GUI objects (the handles) between threads - for some things you'll be OK, for others you may get burnt (this is a windows issue rather than Win32::GUI). The best solution is to use the Win32::GUI object in the thread that created it and use thread safe queues to communicate between threads. You are also safe when other perl modules create threads (perl and C threads) and comunicate back to the thread with the Win32::GUI GUI. For some examples on how easy threading can be with Win32::GUI have a look at: Win32::GUI::ThreadUtils @ http://www.robmay.me.uk/win32gui The module is flaged as experimental, but it will give a good intro. Has some examples of various threading models - boss/worker etc. Cheers, Jeremy. Octavian - Original Message - From: Perl Rob To: Sent: Thursday, November 06, 2008 6:52 PM Subject: [perl-win32-gui-users] Threads Hi all, Am I susceptible to a crash if I create a Win32::GUI object (such as a label) in one thread, then call methods on that object in another thread? Following is an example of what I mean. Notice that I'm passing the label object as an argument to the entry point function of the new thread. This seems to work, but I don't know if I should be doing it just because it works: use strict; use Win32::GUI(); use threads; my $main = Win32::GUI::Window-new ( -name = 'Main', -text = 'Template Window', -size = [300,300], ); my $label = $main-AddLabel ( -text = 'I like the number 10', -pos = [10,10], ); threads-create('countDown', $label); $main-Center(); $main-Show(); Win32::GUI::Dialog(); sub countDown { my $labelObject = shift; for (my $i=9; $i0; $i--) { $labelObject-Text(I like the number $i); sleep(1); } } Thanks, Rob - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/ _ BigSnapSearch.com - 24 prizes a day, every day - Search Now! http://clk.atdmt.com/UKM/go/117442309/direct/01/ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/