mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-02-06 12:01:39 +08:00
...
This commit is contained in:
@@ -7420,6 +7420,18 @@ GuiVirtualDataGrid (Editor)
|
||||
}
|
||||
}
|
||||
|
||||
void GuiVirtualDataGrid::OnStyleInstalled(vint index, ItemStyle* style)
|
||||
{
|
||||
GuiVirtualListView::OnStyleInstalled(index, style);
|
||||
if (auto itemStyle = dynamic_cast<DefaultDataGridItemTemplate*>(style))
|
||||
{
|
||||
if (selectedCell.row == index && selectedCell.column != -1)
|
||||
{
|
||||
itemStyle->NotifySelectCell(selectedCell.column);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GuiVirtualDataGrid::OnStyleUninstalled(ItemStyle* style)
|
||||
{
|
||||
GuiVirtualListView::OnStyleUninstalled(style);
|
||||
|
||||
@@ -17700,6 +17700,7 @@ GuiVirtualDataGrid
|
||||
|
||||
compositions::IGuiAltActionHost* GetActivatingAltHost()override;
|
||||
void OnItemModified(vint start, vint count, vint newCount)override;
|
||||
void OnStyleInstalled(vint index, ItemStyle* style)override;
|
||||
void OnStyleUninstalled(ItemStyle* style)override;
|
||||
|
||||
void NotifyCloseEditor();
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -43,7 +43,7 @@
|
||||
@cpp:Private
|
||||
var books: observe BookItem^[] = {};
|
||||
@cpp:Private
|
||||
var lastSelectedItem: int = -1;
|
||||
var lastSelectedCell: GridPos = {row:-1 column:-1};
|
||||
|
||||
@cpp:Private
|
||||
var iconBook16: ImageData^ = null;
|
||||
@@ -70,7 +70,6 @@
|
||||
self.iconOpen16 = cast (ImageData^) self.ResolveResource("res", "Open16.png", true);
|
||||
self.iconOpen32 = cast (ImageData^) self.ResolveResource("res", "Open32.png", true);
|
||||
|
||||
|
||||
for (i in range [0, 24))
|
||||
{
|
||||
var book = new BookItem^();
|
||||
@@ -115,29 +114,33 @@
|
||||
<_>1</_>
|
||||
</att.DataColumns>
|
||||
|
||||
<ev.SelectionChanged-eval><![CDATA[
|
||||
<ev.SelectedCellChanged-eval><![CDATA[
|
||||
{
|
||||
var last = self.lastSelectedItem;
|
||||
var current = datagrid.SelectedItemIndex;
|
||||
self.lastSelectedItem = current;
|
||||
|
||||
Application::GetApplication().InvokeInMainThread(self, func():void
|
||||
var last = self.lastSelectedCell;
|
||||
var current = datagrid.SelectedCell;
|
||||
if (last.row != current.row)
|
||||
{
|
||||
if (last != -1)
|
||||
self.lastSelectedCell = current;
|
||||
|
||||
Application::GetApplication().InvokeInMainThread(self, func():void
|
||||
{
|
||||
self.books[last].SmallImage = self.iconBook16;
|
||||
self.books[last].LargeImage = self.iconBook32;
|
||||
self.books.ItemChanged(last, 1, 1);
|
||||
}
|
||||
if (current != -1)
|
||||
{
|
||||
self.books[current].SmallImage = self.iconOpen16;
|
||||
self.books[current].LargeImage = self.iconOpen32;
|
||||
self.books.ItemChanged(current, 1, 1);
|
||||
}
|
||||
});
|
||||
if (last.row != -1)
|
||||
{
|
||||
self.books[last.row].SmallImage = self.iconBook16;
|
||||
self.books[last.row].LargeImage = self.iconBook32;
|
||||
self.books.ItemChanged(last.row, 1, 1);
|
||||
}
|
||||
if (current.row != -1)
|
||||
{
|
||||
self.books[current.row].SmallImage = self.iconOpen16;
|
||||
self.books[current.row].LargeImage = self.iconOpen32;
|
||||
self.books.ItemChanged(current.row, 1, 1);
|
||||
}
|
||||
self.datagrid.SelectCell(current, false);
|
||||
});
|
||||
}
|
||||
}
|
||||
]]></ev.SelectionChanged-eval>
|
||||
]]></ev.SelectedCellChanged-eval>
|
||||
</BindableDataGrid>
|
||||
</Cell>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user