Re: [perl-win32-gui-users] making windows - help w/code

2002-03-06 Thread paul . barker
Hi



I've tried the code on XP and I don't get the first window or the button in the
  "Window Title" window.



If I cut and paste the declaration for window 2 and call it window 3 I get
  another window but if I call it W1 I still don't see it ?



I'll keep thinking ;-)



PB



***
Important.
Confidentiality: This communication is intended for the above-named person and
may be confidential and/or legally privileged. Any opinions expressed in this
communication are not necessarily those of the company. If it has come to you
in error you must take no action based on it, nor must you copy or show it to
anyone; please delete/destroy and inform the sender immediately.

Monitoring/Viruses
Orange may monitor all incoming and outgoing emails in line with current
legislation.  Although we have taken steps to ensure that this email and
attachments are free from any virus, we advise that in keeping with good
computing practice the recipient should ensure they are actually virus free.

Orange PCS Limited is a subsidiary of Orange SA and is registered in England No
2178917, with its address at St James Court, Great Park Road, Almondsbury Park,
Bradley Stoke, Bristol BS32 4QJ.
***




Re: [perl-win32-gui-users] making windows - help w/code

2002-03-06 Thread paul . barker
Hmm, interesting.

Are you by any chance trying to run the code from within a GUI debugger ?  If I
run your code from within Perl builder I get 2 windows. If I save the code and
run it from a command window I get 3 windows !

Can't explain it but I'll keep thinking.

I've replicated the behaviour with this code :

use Win32::GUI;
use strict;


my $W = new Win32::GUI::Window(
-title  => "Window1",
-left   => 100,
-top=> 100,
-width  => 280,
-height => 260,
-name   => "Window",
);

my $X = new Win32::GUI::Window(
-title  => "Window2",
-left   => 150,
-top=> 150,
-width  => 280,
-height => 260,
-name   => "Window2",
);


$W->Show();
$X->Show();
Win32::GUI::Dialog();

If I run it through the debugger both $W and $X get initialised to
Win32::GUI::Window objects but only window $W is shown.

It seems to be the order that you call $WINDOW->Show(); If I move the
$X->Show(); line before the corresponding line for window $W then window $W is
shown but not window $X !!!

Ah well so much for IDEs !

Cheers

Paul



***
Important.
Confidentiality: This communication is intended for the above-named person and
may be confidential and/or legally privileged. Any opinions expressed in this
communication are not necessarily those of the company. If it has come to you
in error you must take no action based on it, nor must you copy or show it to
anyone; please delete/destroy and inform the sender immediately.

Monitoring/Viruses
Orange may monitor all incoming and outgoing emails in line with current
legislation.  Although we have taken steps to ensure that this email and
attachments are free from any virus, we advise that in keeping with good
computing practice the recipient should ensure they are actually virus free.

Orange PCS Limited is a subsidiary of Orange SA and is registered in England No
2178917, with its address at St James Court, Great Park Road, Almondsbury Park,
Bradley Stoke, Bristol BS32 4QJ.
***




[perl-win32-gui-users] change color in listbox for addstring

2002-03-06 Thread NAHUM Marc
hye,
how can i change a color when i made a AddString into a Listbox ?

thanks





RE: [perl-win32-gui-users] making windows - help w/code

2002-03-06 Thread Joe_Pfaltzgraff



Joe [EMAIL PROTECTED]
03/06/2002 08:23 AM

Yup, you're right, it must be an issue with Komodo, command line works fine,
Komodo doesn't.  My work around for now is I tell the window to hide, and then
show and it works.

Thanks!





"Rogers, John" <[EMAIL PROTECTED]> on 03/05/2002 06:27:20 PM

To:   Joe Pfaltzgraff/[EMAIL PROTECTED]
cc:

Subject:  RE: [perl-win32-gui-users] making windows - help w/code



Hi,
I your problem is that you are running the code under the Komodo debugger.
try from command line.
I think this is a Komodo issue.

JohnR

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 6 March 2002 5:00
To: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] making windows - help w/code






Joe [EMAIL PROTECTED]
03/05/2002 01:59 PM

I have code that is supposed to make 2 windows...  only the second window is
made, the first never appears and the two are identical.  If I add code to
make
another window at the beginning, the two windows are created, but not the
additional one.  From what I observed, the first attempt to create a window
in a
program always fails, and all the others succeed...  Any idea what is going
on,
or what to do about it?

Thanks!
Joe Pfaltzgraff

I'm running WinXP and Komodo 1.2

Here is the code - not much of a program at all yet - Which ever window I
tell
to show first doesn't show.  I can do the first window twice and then it's
okay.
With this code $W1 doesn't show.

use strict;
use Win32::GUI;

my($window) = new Win32::GUI::Window(
-name => "window", -title => "Window Title",
-left => 100, -top => 100, -width => 500, -height => 400, );

$window->AddButton( -name => "Button1" );
$window->Button1->Show();

my ($W1, $W2);

$W1 = new Win32::GUI::Window(
-name  => "W1",
-title => "First Window",
-pos   => [ 100, 100 ],
-size  => [ 300, 200 ],
);
$W2 = new Win32::GUI::Window(
-name  => "W2",
-title => "Second Window",
POs   => [ 150, 150 ],
-size  => [ 300, 200 ],
);


$W1->Show();
$W2->Show();
$window->Show();
Win32::GUI::Dialog();



___
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users







RE: [perl-win32-gui-users] change color in listbox for addstring

2002-03-06 Thread Rogers, John
Hi,

Do you want to change the whole list box, or each Item ?

Whole ListBox, is easy something like;
$Winobj->Listname->Change(-foreground=>[$r,$g,$b])
where r g b is 0 to 255 value, and/or -background

Individual Items, I dunno,

JohnR

-Original Message-
From: NAHUM Marc [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 6 March 2002 8:08
To: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] change color in listbox for addstring


hye,
how can i change a color when i made a AddString into a Listbox ?

thanks



___
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users



Re: [perl-win32-gui-users] change color in listbox for addstring

2002-03-06 Thread NAHUM Marc
I want change a unique item
if ($toto==1) {$Listbox_verif_fic->AddString("$infocreation")} #in different
color ...

thanks,

- Original Message -
From: "Rogers, John" <[EMAIL PROTECTED]>
To: "'NAHUM Marc'" <[EMAIL PROTECTED]>;

Sent: Wednesday, March 06, 2002 2:24 PM
Subject: RE: [perl-win32-gui-users] change color in listbox for addstring


> Hi,
>
> Do you want to change the whole list box, or each Item ?
>
> Whole ListBox, is easy something like;
> $Winobj->Listname->Change(-foreground=>[$r,$g,$b])
> where r g b is 0 to 255 value, and/or -background
>
> Individual Items, I dunno,
>
> JohnR
>
> -Original Message-
> From: NAHUM Marc [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, 6 March 2002 8:08
> To: perl-win32-gui-users@lists.sourceforge.net
> Subject: [perl-win32-gui-users] change color in listbox for addstring
>
>
> hye,
> how can i change a color when i made a AddString into a Listbox ?
>
> thanks
>
>
>
> ___
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
>
> ___
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
>




RE: [perl-win32-gui-users] change color in listbox for addstring

2002-03-06 Thread Rogers, John
Marc,
AFAIK I dont think you can. ( I hope I am wrong )
Perhaps you can use ListView in a rethink?

John R


-Original Message-
From: NAHUM Marc [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 6 March 2002 11:42
To: Rogers, John; perl-win32-gui-users@lists.sourceforge.net
Subject: Re: [perl-win32-gui-users] change color in listbox for
addstring


I want change a unique item
if ($toto==1) {$Listbox_verif_fic->AddString("$infocreation")} #in different
color ...

thanks,

- Original Message -
From: "Rogers, John" <[EMAIL PROTECTED]>
To: "'NAHUM Marc'" <[EMAIL PROTECTED]>;

Sent: Wednesday, March 06, 2002 2:24 PM
Subject: RE: [perl-win32-gui-users] change color in listbox for addstring


> Hi,
>
> Do you want to change the whole list box, or each Item ?
>
> Whole ListBox, is easy something like;
> $Winobj->Listname->Change(-foreground=>[$r,$g,$b])
> where r g b is 0 to 255 value, and/or -background
>
> Individual Items, I dunno,
>
> JohnR
>
> -Original Message-
> From: NAHUM Marc [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, 6 March 2002 8:08
> To: perl-win32-gui-users@lists.sourceforge.net
> Subject: [perl-win32-gui-users] change color in listbox for addstring
>
>
> hye,
> how can i change a color when i made a AddString into a Listbox ?
>
> thanks
>
>
>
> ___
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
>
> ___
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
>



RE: [perl-win32-gui-users] Re: WYSIWYG

2002-03-06 Thread Frazier, Joe Jr
If you are asking for what I think, you are out of luck.  Text is just what it 
says: Plain Text!  If you want files which have some kind of formatting (font 
size, font style, font color, bold, etc) the files must be generated in a 
application which supports those things and saved as some type of binary or 
marked up file (.rtf comes to mind) and then must be opened by an application 
which supports the file type.  Notepad allows users to change the font 
size/style for "viewing" and each machine may have different font sizes/styles 
when opening the exact same document.  

If I am not mistaken, printing from Notepad will print exactly like the current 
view style (I dont have time to test).  If you control the printing of the 
files to disk in the first place, you could write them as an excel file using 
the Spreadsheet::WriteExcel(?) module and have the users open the file in Excel 
and print from there.   This would allow some fairly powerfull formatting 
options.  If you dont write the files to disk, then you can even read them in 
via script/exe you build and convert them to Excel and then open the document 
in Excel.

Note: Any where Excel is mentioned, you could probably substitute Star Office's 
Spreadsheet program, although I have not tested it.

If this is on Windows and you/they have Excel installed, I would highly suggest 
using the Win32::OLE module so you can set columns to the widths you need and 
such.  If you have never played with Win32::OLE to work with Office 
applications, I believe this will greatly increase your knowledge of both 
Perl/OO-ish programming/VB.  Using this to modify Excel Documents via Perl is 
how I learned alot about Perl.

Joe Frazier, Jr.
Technical Support Engineer
Peopleclick Service Support

Tel:  +1-800-841-2365
E-Mail: mailto:[EMAIL PROTECTED]


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 05, 2002 12:37 PM
> To: Borus Gabor
> Cc: Perl List
> Subject: Re: [perl-win32-gui-users] Re: WYSIWYG
> 
> 
> 
> I'm not looking for a tool to desing a gui window I'm looking 
> for some way
> to have whatever text comes up on the richtext field look 
> exactly like what
> will be printed out.  Spacing, size, indents, etc
> 
> 
> 



[perl-win32-gui-users] RTF 2 HTML

2002-03-06 Thread Ultimate Red Dragon
Well, I worked for a bit tonight and I finally came up with a (admitantly 
pathetic) basic RTF to HTML converter.


It's not that great, I don't claim it's efficient, just that it works.

Currently, it supports new lines, bold, italics and underline.

I'm working on converting < and > correctly, as well as a HTML 2 RTF sub (or 
is there already one?)


sub rtf2html{
  my $re = $main->reDesc;  #Just set this to the RichEdit object
  my $i = 0;
  my $b = 0;
  my $u = 0;
  my $text = '';
  my $oldtext = $re->Text();
  foreach my $x (0..(length($oldtext)+1)){
 $re->Select($x,$x+1);
 my %att = $re->GetCharFormat();
 #Note: The odd if statements are to avoid
 #  annoying warning messages
 if(($i && !exists($att{-italic})) || (!$i && exists($att{-italic}))){
$i = $att{-italic};
$text .= ($i ? '' : '');
 }
 if(($b && !exists($att{-bold})) || (!$b && exists($att{-bold}))){
$b = $att{-bold};
$text .= ($b ? '' : '');
 }
 if(($u && !exists($att{-underline})) || (!$u && 
exists($att{-underline}))){

$u = $att{-underline};
$text .= ($u ? '' : '');
 }
 $text .= substr($oldtext,$x,1);
  }
  $text =~ s/\r//g;
  $text =~ s/\n//gio;
  return $text;
}


Comments, questions, suggestions?  I know the output leaves something to be 
desired, but most browsers can translate it well enough...  Feel free to 
take this and run with it, I just ask that ya post any improvements :)


_
Send and receive Hotmail on your mobile device: http://mobile.msn.com