Hi Art,
You have it right. You just got caught by the 0 index. You are trying to
set the contents of cell , but you should be setting cell 1.
for my $CellType (GVIT_NUMERIC, GVIT_DATE, GVIT_DATECAL, GVIT_TIME,
GVIT_CHECK, GVIT_COMBO, GVIT_LIST, GVIT_URL) {
$Grid->SetCellType($row++, 1, $CellType);
}
$Grid->SetCellOptions( 5, 1, 1 ); # button?
$Grid->SetCellOptions( 6, 1, [ "Combo", "Box" ]);
$Grid->SetCellOptions( 7, 1, [ "List", "Box" ]);
I changed the above lines, and your sample worked for me.
Brian Millham
This message traveled at least 44,000 miles to reach you!
Creator of the DW6000 Monitor
http://www.millham.net/dw6000
[EMAIL PROTECTED]
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Arthur Schwarz
Sent: Wednesday, October 11, 2006 2:51 PM
To: [email protected]
Subject: [perl-win32-gui-users] Grid questions
I'm trying to use 1.03_4 Grid and have the following questions:
1. In GUI.html::SetCellFormat there is a listing of 'DT_*' formats. In
GUI::Constants but missing from this list are:
DT_CHARSTREAM
DT_DISPFILE
DTIDEPREFIX
DT_METAFILE
DT_NOFULLWIDTHCHARBREAK
DT_PLOTTER
DT_PREFIXONLY
DT_RASCAMERA
DT_RASDISPLAY
DT_RASPRINTER
Oversight or deliberate?
2. I'm experimenting with using List Boxes, Combo Boxes and Buttons in a
Grit but have somehow missed the point. My implementation is a no-go, code
below. What am I missing?
use Win32::GUI; # Binding to Win32 GUI
use Win32::GUI::Grid; # Binding to Win32 GUI Grid
use Win32::GUI::Constants; # Windows constants
use integer;
my $TopWindow = new Win32::GUI::Window( # Create Main Window
-name => 'TopWindow',
-helpbox => 1,
-left => 30,
-hashelp => 1,
-height => 450,
-maxwidth => 565,
-minheight => 380,
-minwidth => 565,
-title => 'GUI Editor',
-top => 20,
-width => 570,
);
my $Grid = $TopWindow->AddGrid( # Create Grid object
-columns => 2,
-doublebuffer => 1,
-editable => 0,
# -enable => Enable
-fixedcolumns => 1,
-fixedrows => 1,
# -height => Heigth
-hscroll => 0,
# -left => Left position
-name => "Property Grid",
# -parent => $Editor::Win::TopWindow,
# -popstyle => Pop style
-pos => [ 425, 0 ],
# -pushstyle => Push style
-rows => 10,
-size => [ 140, $TopWindow->Height()-43 ],
# -style => Default style
# -top => Top position
-visible => 1,
-vscroll => 0,
# -width => Width
);
$Grid->SetCellText(0, 0, "Property" );
$Grid->SetCellText(0, 1, "Value" );
for my $row (1..$Grid->GetRows()) {
$Grid->SetCellText($row, 0, "Property $row " );
}
for my $row (1..4) {
for my $col (1..$Grid->GetColumns()) {
$Grid->SetCellText($row, $col, "Cell : <$row, $col>");
}
}
my $row = 1;
for my $CellType (GVIT_NUMERIC, GVIT_DATE, GVIT_DATECAL, GVIT_TIME,
GVIT_CHECK, GVIT_COMBO, GVIT_LIST, GVIT_URL) {
$Grid->SetCellType($row++, 2, $CellType);
}
$Grid->SetCellOptions( 5, 2, 1 ); # button?
$Grid->SetCellOptions( 6, 2, [ "Combo", "Box" ]);
$Grid->SetCellOptions( 7, 2, [ "List", "Box" ]);
$Grid->AutoSize();
$TopWindow->Show(); # makes TopWindow visible
Win32::GUI::Dialog(); # Windows control loop
art
(& thanks)
---
avast! Antivirus: Inbound message clean.
Virus Database (VPS): 0641-2, 10/10/2006
Tested on: 10/11/2006 5:04:44 PM
avast! is copyright (c) 2000-2006 ALWIL Software.
http://www.avast.com
---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0641-2, 10/10/2006
Tested on: 10/11/2006 8:13:48 PM
avast! is copyright (c) 2000-2006 ALWIL Software.
http://www.avast.com