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)