David,
 
The value "WS_VISIBLE | 3 | WS_VSCROLL | WS_TABSTOP" for the style of the combobox I ripped from another Perl program.  I saw an example that used it so I did too.  It could have come from someone here in the listserv as well, I'm not sure; it worked so I used it.
 
Jonathan
--------------------------------------------------------------
Jonathan Southwick                             
[EMAIL PROTECTED]
Technical and Network Services
Allegheny College
Meadville, PA  16335                             814-332-2755
 
 
----- Original Message -----
From: Kuo David
Sent: Wednesday, September 27, 2000 4:01 PM
Subject: RE: [perl-win32-gui] Re: ComboBox

Hi Jonathan,
 
Thank you for your example. I had found the answer for my question. I have some VB experience and are new for per win32-GUI . In VB you don't have to set the minimum height for combobox in order to see the drop down list, VB takes care it for you. When I create the combobox, I didn't realize you need to make the height bigger enough to show the drop down list. The height of my combobox is too small to show the item list. After I set the height to be bigger, I could see the item list and use mouse to select my item. 
 
Since I am new for win32-GUI, I have some more stupid questions. Maybe you guys can help me easily.
 
1. In VB different controls may have same options (properties) and different options. How does perl handle this?
    Are the options in $Window->AddSomeControl( -name => "controlName", -text =>"Text", -width => 0, -height => 0, -top => 0, .....); statement only for common options? How should I do with -style option? How did you get the value "WS_VISIBLE | 3 | WS_VSCROLL | WS_TABSTOP"? What are the other values I can set for the -style option. Where can I find the information (usage, meaning...) about those WS_....?
 
2. In the session of win32-GUI of ActivePerl On Line Help there are a lot of descriptions for options and methods are marked as "[TBD]". Do you know where can I find the detail explanations for those [TBD]s? 
 
Thank you guys!
 
David  
-----Original Message-----
From: Jonathan Southwick [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 27, 2000 1:38 PM
To: [EMAIL PROTECTED]
Subject: Re: [perl-win32-gui] Re: ComboBox

David,
 
Here is an example:
use Win32::GUI;
 
my $screen_width = Win32::GUI::GetSystemMetrics(0);   ## gets current screen width
my $screen_height = Win32::GUI::GetSystemMetrics(1);   ## gets screen height 
my $minwidth = 600;   ## width I want the window to start at
my $minheight = 240;   ## height I want the window to start at
$DataWindow = new Win32::GUI::Window(
 -name   => "DataWindow",
 -top    => ($screen_height - $minheight)/2,   ## center window vertically 
 -left   => ($screen_width - $minwidth)/2,   ## center window horizontally
 -width  => $minwidth,
 -height => $minheight,
 -title  => "Fruit Chooser",
);
 
$DataWindow->AddLabel(
 -name   => "Combo_Label",
 -text   => "Fruit: ",
 -top    => 55,
 -left   => 25,
 -visible=> 0,
);
 
$FruitList = $DataWindow->AddCombobox(
 -name   => "Dropdown",
 -top    => 52,
 -left   => 90,
 -width  => 120,
 -height => 110,
 -tabstop=> 1,
 -style  => WS_VISIBLE | 3 | WS_VSCROLL | WS_TABSTOP,
);
 
$FruitList ->InsertItem("apple");
$FruitList ->InsertItem("banana");
$FruitList ->InsertItem("cantaloupe");
$FruitList ->InsertItem("grapes");
$FruitList ->InsertItem("orange");
$FruitList ->InsertItem("pear");
$FruitList ->InsertItem("star fruit");
 
sub Dropdown_Change {
    $FruitList->Text($FruitList->GetString($FruitList->SelectedItem));
}
 
 
 
Jonathan
--------------------------------------------------------------
Jonathan Southwick                              [EMAIL PROTECTED]
Technical and Network Services
Allegheny College
Meadville, PA  16335                             814-332-2755
 
 
----- Original Message -----
From: Kuo David
Sent: Wednesday, September 27, 2000 10:35 AM
Subject: [perl-win32-gui]

Hi there,
 
Can any one tell me how to make the combobox showing the item list when user click it by the mouse. The comboxbox I made does not allow me to select item by mouse. I have to use up/down arrow to do that. Thanks in advance.
 

Feng-Shen (David) Kuo
Senior Scientific Programmer
Orchid BioSciences, Inc.
Princeton NJ  08540

Reply via email to