[perl-win32-gui-users] Combobox help

2003-05-10 Thread Joel Ricketts
First, I want to send huge amounts of thanks to Mr. Calpini, for his work 
in developing this.  I've always believed I couldn't really do development 
for Win32, because the Win32 API was so cryptic.  Having an actual Perl 
front end -- a language with which I'm familiar from the Unix world -- is 
wonderful beyond belief.  Thank you!

I've run into a couple of problems, and until now have been able to find 
the answers on the 'net or on this list.  This one, though, has me 
stumped.  I've seen others with the same issue, tried the solutions 
recommended for them, and no dice.

Basically, I have a Combobox that I'm trying to display to the user.  I've 
populated it with, for the test, about 12 items.  It displays only the 
original items; the others are accessible through the keyboard, but not 
up-down scrolling list is available.  It just shows the first 10 or so.  

 $Step2Source = $NewDlg->AddCombobox (
-name=>"NewJobWizardStep2Source",
-tabstop=>1,
-left=>145,
-top=>168,
-width=>280,
-height=>100,
-addstyle=>WS_VISIBLE | 3 | WS_VSCROLL | WS_TABSTOP);

 if ($numjobs > 0) {
my $thisjob;
foreach $thisjob (sort keys %joblist) {
   $thisjob =~ s/.firebak$//i;
   $Step2Source->InsertItem ($thisjob);
   }
}

I've tried about every variation on this I can think of, with no dice.  
The Combobox appears, and can drop down, and everything's there.  But no 
listbox.  I've tried using the scroll=>1 parameter.  Tried just about 
every combination of the styles I can think of, including -addstyle and 
-style both.  No luck.  As far as I can tell, my code is basically 
identical to all the examples out there.  Ideas?

Joel






Re: [perl-win32-gui-users] Combobox help

2003-05-11 Thread Joel Ricketts
I grabbed that package.  Still can't quite figure it out -- it's as 
perplexing as any Visual environment.  I've messed with it like crazy... 
the only thing I can figure out is that I've encountered some bug in the 
library, that's being triggered by something else in the code.  

The package looks good, I'll admit.  I'm just still a bit at a loss as to 
how to actually *use* it. :)  So I may try that.  On the other hand, it 
might just do the same thing to me, so I'm not sure.  

Anyway, I appreciate your response, and if you have any ideas, please let 
me know.

Joel


On Sun, 11 May 2003, Johan Lindstrom wrote:

> At 01:13 2003-05-11 -0500, Joel Ricketts wrote:
> >Basically, I have a Combobox that I'm trying to display to the user.  I've
> >populated it with, for the test, about 12 items.  It displays only the
> >original items; the others are accessible through the keyboard, but not
> >up-down scrolling list is available.  It just shows the first 10 or so.
> >
> >  $Step2Source = $NewDlg->AddCombobox (
> > -name=>"NewJobWizardStep2Source",
> > -tabstop=>1,
> > -left=>145,
> > -top=>168,
> > -width=>280,
> > -height=>100,
> > -addstyle=>WS_VISIBLE | 3 | WS_VSCROLL | WS_TABSTOP);
> 
> That should work. 3 is the
> -addstyle", 0x0003));   #CBS_DROPDOWNLIST
> 
> and this enables the vertical scroll bar:
> -addstyle", 0x0020));   #WS_VSCROLL
> 
> So it _should_ work. Why it doesn't, I don't know. Maybe if you remove some 
> of the other styles until it works.
> 
> Or if you, ehrm, use The GUI Loft, where it simply works right away :)
> (set the ScrollV property on the ComboBox)
> 
> http://www.bahnhof.se/~johanl/perl/Loft/
> 
> 
> /J
> 
>  --  --- -- --  --  -- -  - -
> Johan LindströmSourcerer @ Boss Casinos [EMAIL PROTECTED]
> 
> Latest bookmark: "Win32-GUI Perl module"
> http://www.jeb.ca/perl/win32_module.htm
> dmoz (1 of 7): .../Software/Operating_Systems/Graphic_Subsystems/ 19
> 
> 
> 
> 
> ---
> Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
> The only event dedicated to issues related to Linux enterprise solutions
> www.enterpriselinuxforum.com
> 
> ___
> 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] Combobox help

2003-05-11 Thread Joel Ricketts
Johan, you're a lifesaver.  I put it in explicitly as 

0x0020 | ...

And it worked.  I'm not sure why that would be any different, but, well, 
there you have it :)

Joel


On Sun, 11 May 2003, Johan Lindstrom wrote:

> At 01:13 2003-05-11 -0500, Joel Ricketts wrote:
> >Basically, I have a Combobox that I'm trying to display to the user.  I've
> >populated it with, for the test, about 12 items.  It displays only the
> >original items; the others are accessible through the keyboard, but not
> >up-down scrolling list is available.  It just shows the first 10 or so.
> >
> >  $Step2Source = $NewDlg->AddCombobox (
> > -name=>"NewJobWizardStep2Source",
> > -tabstop=>1,
> > -left=>145,
> > -top=>168,
> > -width=>280,
> > -height=>100,
> > -addstyle=>WS_VISIBLE | 3 | WS_VSCROLL | WS_TABSTOP);
> 
> That should work. 3 is the
> -addstyle", 0x0003));   #CBS_DROPDOWNLIST
> 
> and this enables the vertical scroll bar:
> -addstyle", 0x0020));   #WS_VSCROLL
> 
> So it _should_ work. Why it doesn't, I don't know. Maybe if you remove some 
> of the other styles until it works.
> 
> Or if you, ehrm, use The GUI Loft, where it simply works right away :)
> (set the ScrollV property on the ComboBox)
> 
> http://www.bahnhof.se/~johanl/perl/Loft/
> 
> 
> /J
> 
>  --  --- -- --  --  -- -  - -
> Johan LindströmSourcerer @ Boss Casinos [EMAIL PROTECTED]
> 
> Latest bookmark: "Win32-GUI Perl module"
> http://www.jeb.ca/perl/win32_module.htm
> dmoz (1 of 7): .../Software/Operating_Systems/Graphic_Subsystems/ 19
> 
> 
> 
> 
> ---
> Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
> The only event dedicated to issues related to Linux enterprise solutions
> www.enterpriselinuxforum.com
> 
> ___
> 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] More Combobox Help

2003-05-12 Thread Joel Ricketts
Johan was able to help me by including the options for WS_VSCROLL.  For 
some reason, using the name of the constant fails utterly, while using it 
by number works fine.

My combobox drops down now.  One little annoyance left:

When it drops down, the first five items in the list (i.e. all that are 
displayed initially) have a sort of grey background to them behind the 
text.  Once I scroll down, any options below that do not have the grey 
background and are correctly shown with black text on white background.  
When I scroll back up, the first five options are now shown normally.

While the program is usable, this is disconcerting to the end user.  Any 
suggestions?  I'm looking into using TheGUILoft, perhaps, just to see if 
it might help.  Johan showed me the value of a few of the constants, but 
I'm not sure where I would get those -- do those come from Visual C++ header 
files?  Could somebody possibly give me an idea where to find those 
values?  I'm wondering if this is related to WS_VISIBLE or WS_NOTIFY, 
which I see people using, but am not sure the reason for them :)  They may 
not be translating properly.

>From what I have seen, the primary problem I'm running into is a lack of 
documentation.  The size of the documentation project is, of course, 
massive.  Still, it's sometimes hard to figure out what options are 
available, and what options apply to what classes, and what they do.  As 
somebody who hasn't done GUI programming under Windows before, some of the 
options and methods aren't intuitively obvious.  More than anything, 
having better documentation of the library would make this package go from 
being great to superb!  Unless somebody knows where there is some, and I 
just haven't found it.  I've been using Aldo's documentation off his web 
site, which is great as far as it goes, but isn't finished yet from the 
look of things.  

Any help would be appreciated!  Thanks!




[perl-win32-gui-users] Existing problems

2003-06-12 Thread Joel Ricketts
I'm having some issues with Win32::GUI that I was hoping people could help 
with.

1. In a Listview, is there any way to right-justify a column?  I have a 
list of filesizes, but haven't found any way to right-justify one of the 
columns.  I can live with it the way it is, but it would look nicer if I 
could right-justify ;)

2. In TreeView, the list of items will sometimes clear entirely when a 
node is closed.  As in, the whole TreeView becomes blank.  Is this 
something I'm causing in my code or inadvertently triggering?  Or is this 
a known bug that I can't really work around?

3. In TreeView, is there any way to change the image associated with a 
node after it's been inserted?  I've tried this; the image doesn't seem to 
change.

4. In TreeView, some of my icons seem to appear in monochrome.  A few 
appear in full color.  They were all created identically.  Is there some 
special format I need to use to make them appear in proper colors?

5. When using a listview with checkboxes, is there a way to set the 
initial state?  I can't find any documentation on this feature.

6. When a treeview is first expanded such that the vertical scrollbar 
appears for the first time, the control goes blank until I find the 
scrollbar and scroll down.  Is there a workaround for this behavior?

Thanks.  Any help would be appreciated. :)






RE: [perl-win32-gui-users] ListView question: What event should I use when checking an item on a list?

2003-06-12 Thread Joel Ricketts
I've used the following code to get notified when an item changes:

sub DirTree_Click   # Anytime user clicks in our window
{
   my ($x,$y) = Win32::GUI::GetCursorPos();
# Grab mouse pointer location
   my ($left,$top,$right,$bottom) = $dirtree->GetWindowRect ();
# Subtract upper left of our control
   $x -= $left;
   $y -= $top;

   my ($node,$ninfo) = $dirtree->HitTest ($x, $y);
# See where they clicked.  $node will be the node they
# clicked on; $ninfo will be a number indicating where.
   return if ($node eq "0");# Don't remember why I added this :)
   return if ($ninfo != 64);# '64' means they clicked the 
# checkbox



On Fri, 23 May 2003 [EMAIL PROTECTED] wrote:

> I tried _ItemCheck, this worked like a charm!
> 
> Regards,
> Sam Dela Cruz
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> "Stuart Arnold" <[EMAIL PROTECTED]>
> Sent by: 
> [EMAIL PROTECTED]
> 05/16/2003 05:49 PM
> 
>  
> To: Sam Dela Cruz/SVL/SC/[EMAIL PROTECTED]
> 
> cc: 
> Subject:RE: [perl-win32-gui-users] ListView question: What 
> event should I use when 
> checking an item on a list?
> Classification: 
> 
> 
> 
> I gave up on _ItemClick, Just try the "_Click" like a Listbox does.
> You don't get anything as part of your call like ItemClick does, you
> just have to inspect the selected item(s).
> Besides, you get better control on what's going on.
> 
> To inspect, just get SelectedItems, then loop thru them for their
> options, eg, -checked.
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> [EMAIL PROTECTED]
> Sent: Friday, May 16, 2003 7:33 PM
> To: perl-win32-gui-users@lists.sourceforge.net
> Subject: [perl-win32-gui-users] ListView question: What event should I
> use when checking an item on a list?
> 
> 
> Hi All,
> 
> Another question.  There are only three events in the documentation for 
> ListView:
> 1.  ColumnClick
> 2.  ItemClick
> 3.  KeyDown
> 
> So if I want to capture the moment that a user checks on a list item,
> what 
> do I use.  Nothing seems to fit, I tried ItemClick but this only
> responds 
> when you select an item, not when you check an item.
> 
> Please help.  Thanks.
> 
> Regards,
> Sam Dela Cruz
> 
> 
> ---
> This SF.net email is sponsored by: If flattening out C++ or Java code to
> make your application fit in a relational database is painful, 
> don't do it! Check out ObjectStore. Now part of Progress Software.
> http://www.objectstore.net/sourceforge
> ___
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> 
> 
> 
> 
> ---
> This SF.net email is sponsored by: If flattening out C++ or Java
> code to make your application fit in a relational database is painful, 
> don't do it! Check out ObjectStore. Now part of Progress Software.
> http://www.objectstore.net/sourceforge
> ___
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> 
> 
> 
> 
> 
> ---
> This SF.net email is sponsored by: ObjectStore.
> If flattening out C++ or Java code to make your application fit in a
> relational database is painful, don't do it! Check out ObjectStore.
> Now part of Progress Software. http://www.objectstore.net/sourceforge
> ___
> 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] Existing problems

2003-06-13 Thread Joel Ricketts
I found the answers to a few of these, and a little more info.  Still need 
help with some of them.

On Thu, 12 Jun 2003, Joel Ricketts wrote:

> I'm having some issues with Win32::GUI that I was hoping people could help 
> with.
> 
> 1. In a Listview, is there any way to right-justify a column?  I have a 
> list of filesizes, but haven't found any way to right-justify one of the 
> columns.  I can live with it the way it is, but it would look nicer if I 
> could right-justify ;)

Still haven't found a way to do this.  Maybe if I could find a way to set 
the font of an item, and use a monospaced font... how does Windows do it, 
I wonder?

> 
> 2. In TreeView, the list of items will sometimes clear entirely when a 
> node is closed.  As in, the whole TreeView becomes blank.  Is this 
> something I'm causing in my code or inadvertently triggering?  Or is this 
> a known bug that I can't really work around?

Fixed.  In my code, I was accidentally doing 'DeleteItem()' with a blank 
argument.  That freaked it out.

> 
> 3. In TreeView, is there any way to change the image associated with a 
> node after it's been inserted?  I've tried this; the image doesn't seem to 
> change.

Still no answer on this.  The image doesn't change when I use 
ChangeItem().  

> 
> 4. In TreeView, some of my icons seem to appear in monochrome.  A few 
> appear in full color.  They were all created identically.  Is there some 
> special format I need to use to make them appear in proper colors?

Still having this issue.  Any ideas?

> 
> 5. When using a listview with checkboxes, is there a way to set the 
> initial state?  I can't find any documentation on this feature.

The ItemCheck() function is supposed to do this, at least from what I see 
in the c++ code for Win32::GUI.  However, for whatever reason, it doesn't 
work.  The items always appear unchecked until I actually click on them.  
I'd like to be able to show the current state, however.

> 6. When a treeview is first expanded such that the vertical scrollbar 
> appears for the first time, the control goes blank until I find the 
> scrollbar and scroll down.  Is there a workaround for this behavior?

Still having this issue.  It looks bad, certainly, but it's still usable.  
Not suitable for any kind of professional software, though :/

> 
> Thanks.  Any help would be appreciated. :)
> 
> 
> 
> 
> 
> ---
> This SF.NET email is sponsored by: eBay
> Great deals on office technology -- on eBay now! Click here:
> http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
> ___
> 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] Existing problems

2003-06-15 Thread Joel Ricketts
On Sun, 15 Jun 2003, Jeremy White wrote:

> >I found the answers to a few of these, and a little more info.  Still need
> >help with some of them.
> 
> Not sure I can help, but here is my 2 pence worth.
> 
> >Still haven't found a way to do this.  Maybe if I could find a way to set
> >the font of an item, and use a monospaced font... how does Windows do it,
> >I wonder?
> 
> Have a play with Win32::GUI::Grid, you can make it look like a listview, but 
> is much
> powerful.

I'll take a look at it, certainly!

> 
> http://perso.club-internet.fr/rocherl/Win32GUI.html#Grid
> 
> > >
> > > 4. In TreeView, some of my icons seem to appear in monochrome.  A few
> > > appear in full color.  They were all created identically.  Is there some
> > > special format I need to use to make them appear in proper colors?
> >
> >Still having this issue.  Any ideas?
> >
> 
> I had allsorts of problems with bitmap colours in a treeview. The solution 
> for me was to increase the number of bits used for each pixel in the image 
> list.
> 
> $imagelist=new Win32::GUI::ImageList(16, 16, 1 | 0x0010, 17, 25);

Will give this a shot...

> 
> > > 6. When a treeview is first expanded such that the vertical scrollbar
> > > appears for the first time, the control goes blank until I find the
> > > scrollbar and scroll down.  Is there a workaround for this behavior?
> >
> >Still having this issue.  It looks bad, certainly, but it's still usable.
> >Not suitable for any kind of professional software, though :/
> 
> The only time I had similar behaviour was when I was using a tabstrip on the 
> same window as the treeview - does this apply to you?

Yes, this is the case.  Unfortunately, I kinda need to do it.  Any idea 
how I can get around this behavior?  I've tried just about everything I 
can think of, but it still seems to blank no matter what I do :/  It's 
like it expands, then immediately blanks.  I can see it expand for a split 
second.