Hi Samuel,

I use a treeview control in one of my applications, and more often than not
the text exceeds the width of the window and as soon as you select the '+'
arrow, the vertical scroll bar comes in to play. I have not experienced ANY
problems with the control as you decribe.

I'm no expert but have included the pieces of code that relate to the
treeview control, see if any of the content helps...

===========================================
# Bitmaps
$BMP_GLOBE = new Win32::GUI::Bitmap('./Images/tvwglobe.bmp') or
print_and_die("new Globe Bitmap");
$BMP_MOB = new Win32::GUI::Bitmap('./Images/tvwmob.bmp') or
print_and_die("new Mobile Bitmap");

# Imagelist
$tvwIL = new Win32::GUI::ImageList(16, 16, 24, 7, 16);
#
$tvwIL_GLOBE    = $tvwIL->Add($BMP_GLOBE);
$tvwIL_MOB       = $tvwIL->Add($BMP_MOB);
$dummy = $tvwIL->BackColor(hex("0000FF"));

# Build the TreeView Control
$tvwNumDetails = $NumAnalysisWindow->AddTreeView(
    -name      => "tvwNumDetails",
    -text      => " ",
    -left      => 12,
    -top       => 310,
    -width     => 760,
    -height    => 190,
    -lines     => 1,
    -rootlines => 1,
    -buttons   => 1,
    -visible   => 1,
    -imagelist => $tvwIL,
);

# ===============================
sub btnDetails_Click {

        $tvwCLR    = $NumAnalysisWindow->tvwNumDetails->Clear;

        # INTERNATIONAL CALLS
        $tvw9 = $NumAnalysisWindow->tvwNumDetails->InsertItem(
                        -bold          => 1,
                                -text          => "International Calls",
                        -image         => 0,
                        -selectedimage => 2,
        );
        foreach $calldetail9(@list_intlnums) {
                $tvwIN9 = $NumAnalysisWindow->tvwNumDetails->InsertItem(
                           -parent => $tvw9,
               -text   => $calldetail9,
               -image  => $tvwIL_GLOBE,
           );

        }
        # =============================================
        # MOBILE CALLS
        $tvw4 = $NumAnalysisWindow->tvwNumDetails->InsertItem(
                        -text          => "Mobile Calls",
                        -image         => 0,
                        -selectedimage => 4,
        );
        foreach $calldetail4(@list_04nums) {
                $tvwIN4 = $NumAnalysisWindow->tvwNumDetails->InsertItem(
                                -parent => $tvw4,
                -text   => "$calldetail4",
                -image  => $tvwIL_MOB,
           );
        }
}
===========================================

cheers

Chris

   1. Treeview expand collapse refresh problem ([EMAIL PROTECTED])

--__--__--

Message: 1
To: perl-win32-gui-users@lists.sourceforge.net
From: [EMAIL PROTECTED]
Date: Mon, 10 Feb 2003 12:28:40 -0500
Subject: [perl-win32-gui-users] Treeview expand collapse refresh problem

Hi all, wonder if anyone has experienced the same before and if there is a
solution to such issue or suggestions.  I have a Win32 GUI app with a
treeview of nodes(# varies from a few to hundreds).  While node text does
not exceed defined control boundary, it all works well.  However, when
vertical/horizontal scroll bar is required, expanding and collapsing both
give problem refreshing the control.  It happens when one clicks on the +, -
sign but not on the node text.  I've tried InvalidateRect() on treeview
control and/or the parent window to no avail.  Also tried using win32 api
sendmessage WM_SETREDRAW that only stop/start control from refreshing on
changes.  Anyone has any idea?  Maybe on -addstyle option on treeview
control??  Aldo if you're reading this and have time, can you shed some
light?  Please advise.  Thanks.





Reply via email to