Как перетащить узел из одной позиции в другую, используя perl win32 :: gui?Является ли это возможным?Я создаю древовидное представление и добавляю узел динамически.После завершения древовидной структуры мне нужно переместить одну позицию узла в другую путем перетаскивания.Я упомянул код ниже.
use strict;
use Win32::GUI;
my $main_window=Win32::GUI::Window->new(
-name => 'Main',
-text => 'Main Window',
-left => 375,
-top => 200,
-width =>510,#370,
-height =>480,
-background => [177,175,175],
-dialogui => 1,
-maximizebox => 0,
);
$C = new Win32::GUI::Cursor("harrow.cur");
Win32::GUI::SetCursor($C);
$B1 = new Win32::GUI::Bitmap("node.bmp");
$B2 = new Win32::GUI::Bitmap("node_sel.bmp");
$IL = new Win32::GUI::ImageList(26, 26, 0, 2, 30);
$IL->Add($B1, 0);
$IL->Add($B2, 0);
my $TV=$main_window->AddTreeView(
-name => "myTree",
-text => "",
-width => 220,
-height => 238,
-left => 260,
-top => 198,
-lines => 1,
-rootlines => 1,
-buttons => 1,
-visible => 1,
-imagelist => $IL,
-editlabels =>1,
-singleexpand => 1,
-disabledragdrop =>0,
);
my $IndentWin = new GUI::Window(
-text => "Treeview Indent",
-name => "IndentWin",
-width => 200,
-height => 100,
-left => 10,
-top => 10,
-background=>[190,190,190],
);
my $IndentVal = $IndentWin->AddLabel(
-text => "Indent value = ".$TV->Indent(),
-name => "IndentVal",
-left => 10,
-top => 10,
);
my $IndentNew = $IndentWin->AddTextfield(
-text => $TV->Indent(),
-name => "IndentNew",
-left => 10,
-top => 40,
-width => 100,
-height => 25,
);
my $IndentSet = $IndentWin->AddButton(
-text => "Set",
-name => "IndentSet",
-left => 130,
-top => 10,
);
my $Button=$main_window->AddButton(
-text => 'Create tree',
-name => 'treecreate',
-size => [110,20],
-align=>center,
-pos => [135,150],
-font => $font1,
-background => [177,175,175],
-foreground => [],
-tabstop => 1,
);
$main_window->Show();
my $DOS = Win32::GUI::GetPerlWindow();
Win32::GUI::Hide($DOS);
Win32::GUI::Dialog();
sub treecreate_Click{
for(my $inc=0;$inc>=10;$inc++){
$TV->InsertItem(
-text => 'Root'.$inc,
-image => 0,
-selectedimage => 1,
);
}
}
после создания древовидного меню, как перетащить одну позицию узла в другую позицию.